SlideShare a Scribd company logo
1 of 26
Download to read offline
ZK Framework in Navis TOS
Edwin Yu
Senior Software Engineer, Navis Framework Team
eyu@navis.com
ZK U.S. User Group Nov 7, 2011, Cypress, CA


                                                 Copyright © 2011 Navis, LLC. All Rights Reserved.
Agenda
•   Background
    •   Navis
•   Why ZK Framework?
•   Product Demo
•   ZK Framework Integration
    •   Macro Component, Template
•   ZK Server+Client Fusion
    •   OpenLayers Map
•   Unit + Integration Testing
•   Debugging Tips



2
                                    Copyright © 2011 Navis, LLC. All Rights Reserved.
Navis

  •   Oakland, CA
  •   Proven TOS functionality for State of The
      Art Automated Terminals
      •   Equipment automation
      •   Gate operation automation
  •   Help Terminal Operators increase
      capacity and optimize operations
      to lower costs




 3
                                                  Copyright © 2011 Navis, LLC. All Rights Reserved.
Navis TOS Client Locations




Terminals (in TEU)
 Up to 300,000    61
 300,001 – 500,000
                 41
 500,001 – 1 Mil 54
 > 1Mil – 1.5 Mil 17
 > 1.5 Mil        25
 New Site TEU Data NA
                   11
                  209




 4
                               Copyright © 2011 Navis, LLC. All Rights Reserved.
Product Demo
•   [demo]




5
               Copyright © 2011 Navis, LLC. All Rights Reserved.
Choosing a Web Technology

                              ULC Client
                               (Swing)



            HTML              ULC
             (Strut)
            Native Strut     Native ULC
           Programming      Programming


               Presentation Tier


                  Business Tier


                Persistence Tier

6
                                           Copyright © 2011 Navis, LLC. All Rights Reserved.
Choosing a Web Technology
•   Business Requirements
    •   Investment Protection
    •   Engineers’ Skill Set
•   Technical Requirements
    •   Open Source Ajax
    •   Low Learning Curve - Productivity
    •   Component-based MVC (as opposed to request-based)
    •   Integration Friendly
•   2 Months Evaluation in 2009
    •   Prototyping
    •   Architecture Reviews



7
                                                    Copyright © 2011 Navis, LLC. All Rights Reserved.
Web Technology Evaluation




8
                            Copyright © 2011 Navis, LLC. All Rights Reserved.
Choosing ZK Framework
•   Check References
•   Load Testing, Performance Comparison
    •   Table with 150 Rows




•   Prototype




9
                                           Copyright © 2011 Navis, LLC. All Rights Reserved.
ZK Framework Integration

                                            ULC Client
        ZK Client engine in browser          (Swing)


                     Navis Framework
                         ZK                ULC
                  Custom ZK widgets   Custom ULC widgets

                            Shared UI Logic
                          Presentation Tier

                             Business Tier


                           Persistence Tier

10
                                                           Copyright © 2011 Navis, LLC. All Rights Reserved.
ZK Framework Integration

                                            ULC Client
        ZK Client engine in browser          (Swing)


                     Navis Framework
                         ZK                ULC
                  Custom ZK widgets   Custom ULC widgets

                            Shared UI Logic
                          Presentation Tier

                             Business Tier
                                                       Navis
                                                       App

                           Persistence Tier

11
                                                           Copyright © 2011 Navis, LLC. All Rights Reserved.
ZK Framework Integration
•    To overcome our challenges, ZK Framework offers
     •   Swing-like Java API to build a UI tree
     •   Desktop programming paradigm
     •   Macro components
     •   ZUL as templates




12
                                                  Copyright © 2011 Navis, LLC. All Rights Reserved.
Macro Component
•    “Implement a new component by use of other components”
     – ZK reference documentation
•    Encapsulate a set of related functionality into a new reusable
     component
     •   For an example in our app, every tab shows a table
          •   Backed by a hibernate entity
          •   UI for Query Filters
          •   Context menu
          •   Pagination




13
                                                          Copyright © 2011 Navis, LLC. All Rights Reserved.
Macro Component
lang-addon.xml                                                                      Reusable in any zul or in code
<component>                                                                         <zk>
    <component-name>zTable</component-name>
    <extends>listbox</extends>                                                        <zTable apply=“…” customAttr=“…”/>
    <component-class>com.navis.framework.zk.view.ZTable</component-class>
</component>                                                                        </zk>

                                                  a composite ui of the following


                                    ZPopupMenuButton                                        Button

      Paging



      filter.zul




       Listbox

 14
                                                                                             Copyright © 2011 Navis, LLC. All Rights Reserved.
Zul as Template
•        Build skeleton UI structure quickly
•        Dynamically Bind, via VariableResolver
         •   Controller
         •   Data Model
         •   Custom Attributes
•        Reusable, Executions.createComponents(“template.zul”, args)
     ?

                                  Presentation Tier
             ?                                                                    Business Tier

                                                                              Persistence Tier
                                 Generic form.zul
                                 <zk>
                                    <window closable="true" >
                                      …
                                      <zForm apply=“…” customAttr=“…”/>
                                      …
                                    </window>
15                               </zk>                                    Copyright © 2011 Navis, LLC. All Rights Reserved.
Dynamic Layout
•    Dynamically populated view means we can’t hard-code the
     width and height in our views (in code or in zul)
•    How is the width calculated?
•    Outside-in layout
     •   The UI resizes based on the size of the browser
     •   We want our components embedded on the page to maximize the width
         and height the container allows
•    Inside-out layout
     •   Our floating form dialogs resize based on its content
     •   We want our form dialog to minimize its width and height to show its
         content fully.
•    ZK offers ways for us to achieve without hard-coding width and
     height
16
                                                            Copyright © 2011 Navis, LLC. All Rights Reserved.
Inside-Out Calculations
•    hflex=“min” means it depends on the width of the inner
     container
•    To show a floating form dialog with minimal width without
     specifying a fixed width in our code:
                              <window mode="modal“>
                                <div hflex=“min”>
                                   <grid hflex=“min”>
                                     <columns>
                                        <column hflex=“min” align="right"/>
                                        <column hflex=“min”/>
                                     </columns>
                                     <rows>
                                        <row>….</row>
                                        <row>….</row>
                                     </rows>
                                   </grid>
                                </div>
17
                              </window>               Copyright © 2011 Navis, LLC. All Rights Reserved.
Inside-Out Calculations
•    hflex=“1” means it depends on the width of the outer
     container
•    To maximize the available space the child components can
     occupy:                              <window mode="modal“>
                                            <div hflex=“min”>
                                               <tabbox vflex=“1”>
                                                  <tabs>...</tabs>
                                                  <tabpanels>
                                                     <tabpanel>
                                                        <grid hflex=“1”>
                                                        …
                                                        </grid>
                                                     </tabpanel>
                                                  </tabpanels>
                                               </tabbox>
                                          </div>
                                          </window>
18
                                                 Copyright © 2011 Navis, LLC. All Rights Reserved.
Inside-Out Calculations
•    Leveraging hflex and vflex to auto-calculate the best minimal
     width and height for floating form dialogs, we can recursively build
     more complicated floating dialogs




19
                                                   Copyright © 2011 Navis, LLC. All Rights Reserved.
ZK Server+Client Fusion
•    ZK Server+Client Fusion architecture allows us to wrap
     Javascript libraries to the backend Java developers
•    OpenLayers
     •   Free Maps for the Web (BSD License)
     •   Pure JavaScript library for display map data
     •   No server-side dependencies




20
                                                        Copyright © 2011 Navis, LLC. All Rights Reserved.
ZK Server+Client Fusion with OpenLayers
•    Yard Planning and Control Application
•    Replace existing C++ rich-gui desktop program
•    [demo]


                                                  Application Server




21
                                               Copyright © 2011 Navis, LLC. All Rights Reserved.
ZK Server+Client Fusion with OpenLayers


                          Application
                          Server
     OpenLayers                                                       1. Populate map data
                        Navis Yard                                        to client
     Javascript lib
                        Planning &         Controller                 2. Handle forwarded
                       Controlling App                                    events from client


                      Navis Framework
                        ZK               lang-addon.xml                 1. Encapsulate
              ZK                                                        mapping functionality
                      Map.java              zk.wpd
            Map.js                                                      2. Send/receive client
                                           Map.java                     map events
                                            Map.js
                                         openlayers.js


22
                                                        Copyright © 2011 Navis, LLC. All Rights Reserved.
ZK Server+Client Fusion with OpenLayers



                       OpenLayers
                       Javascript lib
                                                                                         Application Server
DOM Tree


                         Map.js                            Map.java                            public class ZKComposer {
              Map = extends zul.Widget {                   class Map extends XulElement{         doAfterCompose() {
                variable : null,                             renderProperties() {                   _map = new Map();
                _bind: function() {                            // render all properties           }
                   // load openLayers lib                    }
                },                                           updateData() {                        onXXX() {
                setXXX: function(arg) {                         smartUpdate("updateData",            // server-side zk event
                }                               JSON data                       data);               // can invoke map api
              }                                              }                                     }
                                            fire(evt,data) }                                   }

           JSON Strings are converted
           to OpenLayers objects
23
                                                                                   Copyright © 2011 Navis, LLC. All Rights Reserved.
Testing
•    Selenium Unit Tests
     •   Switch in IdGenerator for non-production build
          <system-config>
              <id-generator-class>com.navis.framework.zk.util.ZIdGenerator</id-generator-class>
          </system-config>



     •   Give unique IDs to our components for selenium to identify
•    QTP (HP QuickTest Pro)
     •   Integration Test
     •   Add custom Javascript plugins
     •   Access ZK components in the client-side context, using ZK client API




24
                                                                                                  Copyright © 2011 Navis, LLC. All Rights Reserved.
Debugging Tips
•    Install Eclipse + ZK Studio
     •   Create sample program for learning and testing
•    Install Firefox with Firebug and ZK Jet
     •   Help identify the problems
     •   Generate ZK zul which can be copied and pasted out
     •   Debug in an Eclipse project
•    User Forum
•    ZK Support
     •   Sample zul
     •   Video capture




25
                                                          Copyright © 2011 Navis, LLC. All Rights Reserved.
Q&A




      Copyright © 2011 Navis, LLC. All Rights Reserved.

More Related Content

What's hot

WSO2Con USA 2015: Building Web Apps with Reusable UI Components and Composition
WSO2Con USA 2015: Building Web Apps with Reusable UI Components and CompositionWSO2Con USA 2015: Building Web Apps with Reusable UI Components and Composition
WSO2Con USA 2015: Building Web Apps with Reusable UI Components and CompositionWSO2
 
Refactoring to a Single Page Application
Refactoring to a Single Page ApplicationRefactoring to a Single Page Application
Refactoring to a Single Page ApplicationCodemotion
 
TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0Shiju Varghese
 
Organized web app development using backbone.js
Organized web app development using backbone.jsOrganized web app development using backbone.js
Organized web app development using backbone.jsShakti Shrestha
 
Blazor - The New Silverlight?
Blazor - The New Silverlight?Blazor - The New Silverlight?
Blazor - The New Silverlight?Christian Nagel
 
Single page applications
Single page applicationsSingle page applications
Single page applicationsDiego Cardozo
 
An Introduction to webOS
An Introduction to webOSAn Introduction to webOS
An Introduction to webOSKevin Decker
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5mbaric
 
Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Adam Mokan
 
Introduction to Seam Applications
Introduction to Seam ApplicationsIntroduction to Seam Applications
Introduction to Seam Applicationsnuwanrg
 
Introduction to Vue.js DevStaff Meetup 13.02
Introduction to Vue.js  DevStaff Meetup 13.02Introduction to Vue.js  DevStaff Meetup 13.02
Introduction to Vue.js DevStaff Meetup 13.02Paul Bele
 
ColdFusion framework comparison
ColdFusion framework comparisonColdFusion framework comparison
ColdFusion framework comparisonVIkas Patel
 
How Evoq Helps You Build Modern Web Applications
How Evoq Helps You Build Modern Web ApplicationsHow Evoq Helps You Build Modern Web Applications
How Evoq Helps You Build Modern Web ApplicationsDNN
 
Inland Empire .NET User's Group Silverlight Class
Inland Empire .NET User's Group Silverlight ClassInland Empire .NET User's Group Silverlight Class
Inland Empire .NET User's Group Silverlight Classiedotnetug
 
"Spring Boot. Boot up your development" Сергей Моренец
"Spring Boot. Boot up your development" Сергей Моренец"Spring Boot. Boot up your development" Сергей Моренец
"Spring Boot. Boot up your development" Сергей МоренецFwdays
 

What's hot (19)

WSO2Con USA 2015: Building Web Apps with Reusable UI Components and Composition
WSO2Con USA 2015: Building Web Apps with Reusable UI Components and CompositionWSO2Con USA 2015: Building Web Apps with Reusable UI Components and Composition
WSO2Con USA 2015: Building Web Apps with Reusable UI Components and Composition
 
Nuxt Talk
Nuxt TalkNuxt Talk
Nuxt Talk
 
Nuxt.js - Introduction
Nuxt.js - IntroductionNuxt.js - Introduction
Nuxt.js - Introduction
 
Refactoring to a Single Page Application
Refactoring to a Single Page ApplicationRefactoring to a Single Page Application
Refactoring to a Single Page Application
 
TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0
 
Organized web app development using backbone.js
Organized web app development using backbone.jsOrganized web app development using backbone.js
Organized web app development using backbone.js
 
Blazor - The New Silverlight?
Blazor - The New Silverlight?Blazor - The New Silverlight?
Blazor - The New Silverlight?
 
Single page applications
Single page applicationsSingle page applications
Single page applications
 
ASP.NET 5 Overview
ASP.NET 5 OverviewASP.NET 5 Overview
ASP.NET 5 Overview
 
An Introduction to webOS
An Introduction to webOSAn Introduction to webOS
An Introduction to webOS
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5
 
Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012
 
JavaCro'14 - Vaadin web application integration for Enterprise systems – Pete...
JavaCro'14 - Vaadin web application integration for Enterprise systems – Pete...JavaCro'14 - Vaadin web application integration for Enterprise systems – Pete...
JavaCro'14 - Vaadin web application integration for Enterprise systems – Pete...
 
Introduction to Seam Applications
Introduction to Seam ApplicationsIntroduction to Seam Applications
Introduction to Seam Applications
 
Introduction to Vue.js DevStaff Meetup 13.02
Introduction to Vue.js  DevStaff Meetup 13.02Introduction to Vue.js  DevStaff Meetup 13.02
Introduction to Vue.js DevStaff Meetup 13.02
 
ColdFusion framework comparison
ColdFusion framework comparisonColdFusion framework comparison
ColdFusion framework comparison
 
How Evoq Helps You Build Modern Web Applications
How Evoq Helps You Build Modern Web ApplicationsHow Evoq Helps You Build Modern Web Applications
How Evoq Helps You Build Modern Web Applications
 
Inland Empire .NET User's Group Silverlight Class
Inland Empire .NET User's Group Silverlight ClassInland Empire .NET User's Group Silverlight Class
Inland Empire .NET User's Group Silverlight Class
 
"Spring Boot. Boot up your development" Сергей Моренец
"Spring Boot. Boot up your development" Сергей Моренец"Spring Boot. Boot up your development" Сергей Моренец
"Spring Boot. Boot up your development" Сергей Моренец
 

Similar to Evaluating and Choosing ZK Framework

Zero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or lessZero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or lessDavalen LLC
 
F428435966 odtug web-logic for developers
F428435966 odtug   web-logic for developersF428435966 odtug   web-logic for developers
F428435966 odtug web-logic for developersMeng He
 
Advanced Reporting with Novell ZENworks Reporting Server: More than Asset Man...
Advanced Reporting with Novell ZENworks Reporting Server: More than Asset Man...Advanced Reporting with Novell ZENworks Reporting Server: More than Asset Man...
Advanced Reporting with Novell ZENworks Reporting Server: More than Asset Man...Novell
 
X plat dev - part ii publish
X plat dev - part ii publishX plat dev - part ii publish
X plat dev - part ii publishTekObserver
 
21st Century SOA
21st Century SOA21st Century SOA
21st Century SOABob Rhubart
 
Oracle ADF Overview for Beginners
Oracle ADF Overview for BeginnersOracle ADF Overview for Beginners
Oracle ADF Overview for BeginnersJithin Kuriakose
 
Essential Kit for Oracle JET Programming
Essential Kit for Oracle JET ProgrammingEssential Kit for Oracle JET Programming
Essential Kit for Oracle JET Programmingandrejusb
 
Plugin-able POS Solutions by Javascript @HDM9 Taiwan
Plugin-able POS Solutions by Javascript @HDM9 TaiwanPlugin-able POS Solutions by Javascript @HDM9 Taiwan
Plugin-able POS Solutions by Javascript @HDM9 TaiwanRack Lin
 
IBM Worklight - Technical Overview
IBM Worklight - Technical OverviewIBM Worklight - Technical Overview
IBM Worklight - Technical OverviewIIC_Barcelona
 
JEE Course - EJB
JEE Course - EJBJEE Course - EJB
JEE Course - EJBodedns
 
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012Arun Gupta
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC vipin kumar
 
Apache OFBiz: Real-World Open Source Java Platform ERP
Apache OFBiz: Real-World Open Source Java Platform ERPApache OFBiz: Real-World Open Source Java Platform ERP
Apache OFBiz: Real-World Open Source Java Platform ERPCampus Party Brasil
 
Flex Continuous Quality Builds Flex & (Ant || Maven)
Flex Continuous Quality Builds Flex & (Ant || Maven)Flex Continuous Quality Builds Flex & (Ant || Maven)
Flex Continuous Quality Builds Flex & (Ant || Maven)François Le Droff
 
Development with JavaFX 9 in JDK 9.0.1
Development with JavaFX 9 in JDK 9.0.1Development with JavaFX 9 in JDK 9.0.1
Development with JavaFX 9 in JDK 9.0.1Wolfgang Weigend
 
JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM
JBCNConf: jBPM & Vert.x Reactive and Polyglot BPMJBCNConf: jBPM & Vert.x Reactive and Polyglot BPM
JBCNConf: jBPM & Vert.x Reactive and Polyglot BPMMauricio (Salaboy) Salatino
 

Similar to Evaluating and Choosing ZK Framework (20)

Zero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or lessZero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or less
 
F428435966 odtug web-logic for developers
F428435966 odtug   web-logic for developersF428435966 odtug   web-logic for developers
F428435966 odtug web-logic for developers
 
Advanced Reporting with Novell ZENworks Reporting Server: More than Asset Man...
Advanced Reporting with Novell ZENworks Reporting Server: More than Asset Man...Advanced Reporting with Novell ZENworks Reporting Server: More than Asset Man...
Advanced Reporting with Novell ZENworks Reporting Server: More than Asset Man...
 
X plat dev - part ii publish
X plat dev - part ii publishX plat dev - part ii publish
X plat dev - part ii publish
 
Worklight Overview
Worklight OverviewWorklight Overview
Worklight Overview
 
21st Century SOA
21st Century SOA21st Century SOA
21st Century SOA
 
Oracle ADF Overview for Beginners
Oracle ADF Overview for BeginnersOracle ADF Overview for Beginners
Oracle ADF Overview for Beginners
 
JavaCro'15 - Oracle Java Cloud Service Java PaaS - Duško Vukmanović
JavaCro'15 - Oracle Java Cloud Service  Java PaaS - Duško VukmanovićJavaCro'15 - Oracle Java Cloud Service  Java PaaS - Duško Vukmanović
JavaCro'15 - Oracle Java Cloud Service Java PaaS - Duško Vukmanović
 
Essential Kit for Oracle JET Programming
Essential Kit for Oracle JET ProgrammingEssential Kit for Oracle JET Programming
Essential Kit for Oracle JET Programming
 
Plugin-able POS Solutions by Javascript @HDM9 Taiwan
Plugin-able POS Solutions by Javascript @HDM9 TaiwanPlugin-able POS Solutions by Javascript @HDM9 Taiwan
Plugin-able POS Solutions by Javascript @HDM9 Taiwan
 
IBM Worklight - Technical Overview
IBM Worklight - Technical OverviewIBM Worklight - Technical Overview
IBM Worklight - Technical Overview
 
JEE Course - EJB
JEE Course - EJBJEE Course - EJB
JEE Course - EJB
 
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
Apache OFBiz: Real-World Open Source Java Platform ERP
Apache OFBiz: Real-World Open Source Java Platform ERPApache OFBiz: Real-World Open Source Java Platform ERP
Apache OFBiz: Real-World Open Source Java Platform ERP
 
Flex Continuous Quality Builds Flex & (Ant || Maven)
Flex Continuous Quality Builds Flex & (Ant || Maven)Flex Continuous Quality Builds Flex & (Ant || Maven)
Flex Continuous Quality Builds Flex & (Ant || Maven)
 
DesktopApps.pptx
DesktopApps.pptxDesktopApps.pptx
DesktopApps.pptx
 
Oracle JET overview
Oracle JET overviewOracle JET overview
Oracle JET overview
 
Development with JavaFX 9 in JDK 9.0.1
Development with JavaFX 9 in JDK 9.0.1Development with JavaFX 9 in JDK 9.0.1
Development with JavaFX 9 in JDK 9.0.1
 
JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM
JBCNConf: jBPM & Vert.x Reactive and Polyglot BPMJBCNConf: jBPM & Vert.x Reactive and Polyglot BPM
JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM
 

Recently uploaded

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

Evaluating and Choosing ZK Framework

  • 1. ZK Framework in Navis TOS Edwin Yu Senior Software Engineer, Navis Framework Team eyu@navis.com ZK U.S. User Group Nov 7, 2011, Cypress, CA Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 2. Agenda • Background • Navis • Why ZK Framework? • Product Demo • ZK Framework Integration • Macro Component, Template • ZK Server+Client Fusion • OpenLayers Map • Unit + Integration Testing • Debugging Tips 2 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 3. Navis • Oakland, CA • Proven TOS functionality for State of The Art Automated Terminals • Equipment automation • Gate operation automation • Help Terminal Operators increase capacity and optimize operations to lower costs 3 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 4. Navis TOS Client Locations Terminals (in TEU) Up to 300,000 61 300,001 – 500,000 41 500,001 – 1 Mil 54 > 1Mil – 1.5 Mil 17 > 1.5 Mil 25 New Site TEU Data NA 11 209 4 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 5. Product Demo • [demo] 5 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 6. Choosing a Web Technology ULC Client (Swing) HTML ULC (Strut) Native Strut Native ULC Programming Programming Presentation Tier Business Tier Persistence Tier 6 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 7. Choosing a Web Technology • Business Requirements • Investment Protection • Engineers’ Skill Set • Technical Requirements • Open Source Ajax • Low Learning Curve - Productivity • Component-based MVC (as opposed to request-based) • Integration Friendly • 2 Months Evaluation in 2009 • Prototyping • Architecture Reviews 7 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 8. Web Technology Evaluation 8 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 9. Choosing ZK Framework • Check References • Load Testing, Performance Comparison • Table with 150 Rows • Prototype 9 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 10. ZK Framework Integration ULC Client ZK Client engine in browser (Swing) Navis Framework ZK ULC Custom ZK widgets Custom ULC widgets Shared UI Logic Presentation Tier Business Tier Persistence Tier 10 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 11. ZK Framework Integration ULC Client ZK Client engine in browser (Swing) Navis Framework ZK ULC Custom ZK widgets Custom ULC widgets Shared UI Logic Presentation Tier Business Tier Navis App Persistence Tier 11 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 12. ZK Framework Integration • To overcome our challenges, ZK Framework offers • Swing-like Java API to build a UI tree • Desktop programming paradigm • Macro components • ZUL as templates 12 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 13. Macro Component • “Implement a new component by use of other components” – ZK reference documentation • Encapsulate a set of related functionality into a new reusable component • For an example in our app, every tab shows a table • Backed by a hibernate entity • UI for Query Filters • Context menu • Pagination 13 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 14. Macro Component lang-addon.xml Reusable in any zul or in code <component> <zk> <component-name>zTable</component-name> <extends>listbox</extends> <zTable apply=“…” customAttr=“…”/> <component-class>com.navis.framework.zk.view.ZTable</component-class> </component> </zk> a composite ui of the following ZPopupMenuButton Button Paging filter.zul Listbox 14 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 15. Zul as Template • Build skeleton UI structure quickly • Dynamically Bind, via VariableResolver • Controller • Data Model • Custom Attributes • Reusable, Executions.createComponents(“template.zul”, args) ? Presentation Tier ? Business Tier Persistence Tier Generic form.zul <zk> <window closable="true" > … <zForm apply=“…” customAttr=“…”/> … </window> 15 </zk> Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 16. Dynamic Layout • Dynamically populated view means we can’t hard-code the width and height in our views (in code or in zul) • How is the width calculated? • Outside-in layout • The UI resizes based on the size of the browser • We want our components embedded on the page to maximize the width and height the container allows • Inside-out layout • Our floating form dialogs resize based on its content • We want our form dialog to minimize its width and height to show its content fully. • ZK offers ways for us to achieve without hard-coding width and height 16 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 17. Inside-Out Calculations • hflex=“min” means it depends on the width of the inner container • To show a floating form dialog with minimal width without specifying a fixed width in our code: <window mode="modal“> <div hflex=“min”> <grid hflex=“min”> <columns> <column hflex=“min” align="right"/> <column hflex=“min”/> </columns> <rows> <row>….</row> <row>….</row> </rows> </grid> </div> 17 </window> Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 18. Inside-Out Calculations • hflex=“1” means it depends on the width of the outer container • To maximize the available space the child components can occupy: <window mode="modal“> <div hflex=“min”> <tabbox vflex=“1”> <tabs>...</tabs> <tabpanels> <tabpanel> <grid hflex=“1”> … </grid> </tabpanel> </tabpanels> </tabbox> </div> </window> 18 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 19. Inside-Out Calculations • Leveraging hflex and vflex to auto-calculate the best minimal width and height for floating form dialogs, we can recursively build more complicated floating dialogs 19 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 20. ZK Server+Client Fusion • ZK Server+Client Fusion architecture allows us to wrap Javascript libraries to the backend Java developers • OpenLayers • Free Maps for the Web (BSD License) • Pure JavaScript library for display map data • No server-side dependencies 20 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 21. ZK Server+Client Fusion with OpenLayers • Yard Planning and Control Application • Replace existing C++ rich-gui desktop program • [demo] Application Server 21 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 22. ZK Server+Client Fusion with OpenLayers Application Server OpenLayers 1. Populate map data Navis Yard to client Javascript lib Planning & Controller 2. Handle forwarded Controlling App events from client Navis Framework ZK lang-addon.xml 1. Encapsulate ZK mapping functionality Map.java zk.wpd Map.js 2. Send/receive client Map.java map events Map.js openlayers.js 22 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 23. ZK Server+Client Fusion with OpenLayers OpenLayers Javascript lib Application Server DOM Tree Map.js Map.java public class ZKComposer { Map = extends zul.Widget { class Map extends XulElement{ doAfterCompose() { variable : null, renderProperties() { _map = new Map(); _bind: function() { // render all properties } // load openLayers lib } }, updateData() { onXXX() { setXXX: function(arg) { smartUpdate("updateData", // server-side zk event } JSON data data); // can invoke map api } } } fire(evt,data) } } JSON Strings are converted to OpenLayers objects 23 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 24. Testing • Selenium Unit Tests • Switch in IdGenerator for non-production build <system-config> <id-generator-class>com.navis.framework.zk.util.ZIdGenerator</id-generator-class> </system-config> • Give unique IDs to our components for selenium to identify • QTP (HP QuickTest Pro) • Integration Test • Add custom Javascript plugins • Access ZK components in the client-side context, using ZK client API 24 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 25. Debugging Tips • Install Eclipse + ZK Studio • Create sample program for learning and testing • Install Firefox with Firebug and ZK Jet • Help identify the problems • Generate ZK zul which can be copied and pasted out • Debug in an Eclipse project • User Forum • ZK Support • Sample zul • Video capture 25 Copyright © 2011 Navis, LLC. All Rights Reserved.
  • 26. Q&A Copyright © 2011 Navis, LLC. All Rights Reserved.