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

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

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.