ZK Developer's Guide
()
About this ebook
ZK is an open-source web development framework that enables web applications to have the rich user experiences and low development costs that desktop applications have had for years. ZK includes an Ajax-based event-driven engine, rich sets of XML User Interface Language (XUL) and XHTML components, and a markup language.
The ZK rich client framework takes the so-called server-centric approach: the content synchronization of components and the event pipelining between clients and servers are automatically done by the engine and Ajax plumbing codes are completely transparent to web application developers. Therefore, the end users get rich user interfaces with similar engaged interactivity and responsiveness to that of desktop applications, while for programmers, development remains similar in simplicity to that of desktop applications.
This book is a Developer's Guide that steps you through the ZK framework with examples. It starts with installing and configuring ZK and takes you on to integrate it with other frameworks. By the time you are through the book you will be able to build an application on your own.
Related to ZK Developer's Guide
Related ebooks
Getting Started with Meteor.js JavaScript Framework - Second Edition Rating: 0 out of 5 stars0 ratingsOpa Application Development: A rapid and secure web development framework to develop web applications quickly and easily in Opa Rating: 0 out of 5 stars0 ratingsIsomorphic JavaScript Web Development: Universal JavaScript with React and Node Rating: 0 out of 5 stars0 ratingsHands-On Reactive Programming in Spring 5: Build cloud-ready, reactive systems with Spring 5 and Project Reactor Rating: 0 out of 5 stars0 ratingsKnockoutJS Blueprints Rating: 0 out of 5 stars0 ratingsBuilding Applications with Spring 5 and Vue.js 2: Build a modern, full-stack web application using Spring Boot and Vuex Rating: 0 out of 5 stars0 ratingsSpring Web Flow 2 Web Development Rating: 0 out of 5 stars0 ratingsMastering JavaScript Design Patterns - Second Edition Rating: 5 out of 5 stars5/5Apps and Services with .NET 8: Build practical projects with Blazor, .NET MAUI, gRPC, GraphQL, and other enterprise technologies Rating: 0 out of 5 stars0 ratingsJasmine JavaScript Testing - Second Edition Rating: 0 out of 5 stars0 ratingsMastering Backbone.js Rating: 0 out of 5 stars0 ratingsBeginning Backbone.js Rating: 3 out of 5 stars3/5Angular UI Development with PrimeNG Rating: 0 out of 5 stars0 ratingsLearning D3.js Mapping Rating: 0 out of 5 stars0 ratingsJava: High-Performance Apps with Java 9: Boost your application's performance with the new features of Java 9 Rating: 0 out of 5 stars0 ratingsInstant Play Framework Starter: Build your web applications from the ground up with the Play Framework for Java and Scala Rating: 0 out of 5 stars0 ratingsAngular 2 Components Rating: 0 out of 5 stars0 ratingsMastering Spring 5: An effective guide to build enterprise applications using Java Spring and Spring Boot framework, 2nd Edition Rating: 0 out of 5 stars0 ratingsReact Application Architecture for Production: Learn best practices and expert tips to deliver enterprise-ready React web apps Rating: 0 out of 5 stars0 ratingsNext.js Quick Start Guide: Server-side rendering done right Rating: 0 out of 5 stars0 ratingsLearning Splunk Web Framework Rating: 0 out of 5 stars0 ratingsVisual Studio Condensed: For Visual Studio 2013 Express, Professional, Premium and Ultimate Editions Rating: 0 out of 5 stars0 ratingsImplementing C# 11 and .NET 7.0: Learn how to build cross-platform apps with .NET Core (English Edition) Rating: 0 out of 5 stars0 ratingsGetting Started with React Rating: 0 out of 5 stars0 ratingsSoftware Architecture for Busy Developers: Talk and act like a software architect in one weekend Rating: 0 out of 5 stars0 ratingsFull Stack Development with Spring Boot 3 and React: Build modern web applications using the power of Java, React, and TypeScript Rating: 0 out of 5 stars0 ratingsJavaScript Frameworks for Modern Web Development: The Essential Frameworks, Libraries, and Tools to Learn Right Now Rating: 0 out of 5 stars0 ratingsBeginning Jakarta EE: Enterprise Edition for Java: From Novice to Professional Rating: 0 out of 5 stars0 ratings
Information Technology For You
CompTIA ITF+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam FC0-U61 Rating: 5 out of 5 stars5/5Summary of Super-Intelligence From Nick Bostrom Rating: 4 out of 5 stars4/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5CompTIA A+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Core 1 Exam 220-1101 Rating: 0 out of 5 stars0 ratingsAn Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5How to Write Effective Emails at Work Rating: 4 out of 5 stars4/5Data Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5CompTia Security 701: Fundamentals of Security Rating: 0 out of 5 stars0 ratingsCOMPUTER SCIENCE FOR ROOKIES Rating: 0 out of 5 stars0 ratingsSupercommunicator: Explaining the Complicated So Anyone Can Understand Rating: 3 out of 5 stars3/5ChatGPT: The Future of Intelligent Conversation Rating: 4 out of 5 stars4/5Getting started with Audacity 1.3 Rating: 5 out of 5 stars5/5Practical Ethical Hacking from Scratch Rating: 5 out of 5 stars5/5Health Informatics: Practical Guide Rating: 0 out of 5 stars0 ratingsCybersecurity for Beginners : Learn the Fundamentals of Cybersecurity in an Easy, Step-by-Step Guide: 1 Rating: 0 out of 5 stars0 ratingsLinux Command Line and Shell Scripting Bible Rating: 3 out of 5 stars3/5How to Find a Wolf in Siberia (or, How to Troubleshoot Almost Anything) Rating: 0 out of 5 stars0 ratingsA Mind at Play: How Claude Shannon Invented the Information Age Rating: 4 out of 5 stars4/5The Design Inference Rating: 5 out of 5 stars5/5Personal Knowledge Graphs: Connected thinking to boost productivity, creativity and discovery Rating: 0 out of 5 stars0 ratingsWordPress Plugin Development: Beginner's Guide Rating: 0 out of 5 stars0 ratingsWho Says Elephants Can't Dance?: Leading a Great Enterprise Through Dramatic Change Rating: 4 out of 5 stars4/5CompTIA Network+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam N10-008 Rating: 0 out of 5 stars0 ratingsUnderstanding TCP/IP Rating: 4 out of 5 stars4/520 Windows Tools Every SysAdmin Should Know Rating: 5 out of 5 stars5/5Learn Algorithmic Trading: Build and deploy algorithmic trading systems and strategies using Python and advanced data analysis Rating: 0 out of 5 stars0 ratings
Reviews for ZK Developer's Guide
0 ratings0 reviews
Book preview
ZK Developer's Guide - Schumacher Hans-Jurgen
Table of Contents
ZK Developer's Guide
Credits
About the Authors
About the Reviewers
Preface
What This Book Covers
What You Need for This Book
Who is This Book For?
Conventions
Reader Feedback
Customer Support
Downloading the Example Code for the Book
Errata
Questions
1. Getting Started with ZK
What is ZK?
XHTML
XUL
ZUML
First Step: Say Hello to ZK
Inside ZK—How ZK Works
The Three Relatives—Desktop, Page, and Component
Identification in ZK
Loading and Updating a ZK Page
Phase: Page Initial
Phase: Component Creation
Phase: Event Processing
Phase: Rendering
Phase: Request Processing
Phase: Event Processing
Phase: Rendering
Events in ZK—Listening and Processing
What is the Priority?—The Order of Event Processing
How Can We Parallelize Event Listeners?
Event Processing Thread—Initialize and Cleanup
Event Types
ZUML - ZK User Interface Markup Language
Molds
ZK Attributes
ZK Elements
Layout Techniques
Separation of Concerns
Configuration and Deployment
Configuration of web.xml
Configuration of zk.xml
Deployment
Deployment of ZK Applications with Maven
Summary
2. Online Media Library
An Online Media Library
Setting up Eclipse to Develop with ZK
Setting up a New Project
Creating the Pages
Summary
3. Extending the Online Media Library
AJAX—Live Data
Updating at the Right Place
Optimize the Result Presentation
Improve Navigation Inside the Data
Some Candies for the User
Summary
4. Is it on the Desktop or on the Web?
Adding Drag-and-Drop
Adding a Login Page
Extending Add and Update
Internationalization with the ZK Framework
Summary
5. Integration with Other Frameworks
Integration with the Spring Framework
Hibernate
JasperReport
ZK Mobile
ZK JSP Tags Library
ZK JSF Components
Binding to a Backing Bean
ValueBinding of a component
Summary
6. Creating Custom Components
Cascading Style Sheets (CSS)
Macro Components
Creating Our Own Component
Summary
7. Development Tools for the ZK Framework
ZK-Bench
Dynamic Preview of Pages
The Palette
Databinding
Deployment
Snippets
Project Explorer
Snapshot Gallery
Summary
A. Configuration Files in ZK
WEB.XML
zk.xml
Configuration of ZK.XML
Index
ZK Developer's Guide
Markus Stäuble
Jurgen Schumacher
ZK Developer's Guide
Copyright © 2008 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: March 2008
Production Reference:1170308
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-847192-00-4
www.packtpub.com
Cover Image by Vinayak Chittar (<vinayak.chittar@gmail.com>)
Credits
Authors
Markus Stäuble
Hans-Jürgen Schumacher
Reviewers
Razvan Remus Popovici
Christianto Sahat Kurniawan Hutasoit
Development Editor
Rashmi Phadnis
Technical Editors
Bhupali Khule
Shailendra Shetye
Editorial Team Leader
Mithil Kulkarni
Project Manager
Abhijeet Deobhakta
Indexer
Monica Ajmera
Proofreader
Chris Smith
Production Coordinator
Aparna Bhagat
Cover Designer
Aparna Bhagat
About the Authors
Markus Stäuble is currently working as Senior Software Engineer. He has a Master's degree in Computer Science. He started with Java in the year 1999, since when he has gained much experience in building enterprise Java systems, especially web applications. He has a deep knowledge of the Java platform and the tools and frameworks around Java.
There are several people who have supported the writing of my first book. But there is especially one person to whom I want to say thank you, my wife Maria Elena. She supported the writing very much and gave me the power and energy to finish that work.
Hans-Jürgen Schumacher studied mathematics at the University of Karlsruhe, Germany. For 17 years he has been working as a Software Developer and Architect. Right now he has the position of a Senior Architect for J2EE. One of his special fields are GUIs for web applications as well as Improvements in the Software Build process.
I would like to thank my son Samuel, who was just born at the right time and gave me the power to finish this book.
About the Reviewers
Razvan Remus Popovici owns a BS degree in Computer Science from Transylvania
University of Brasov, Romania in 1999. His software development experience consists of more than 10 years in application and database design, client-server or multi-tier application development in various domains such as networking, communications, accounting, statistics, management, or bioinformatics. His entrepreneurial background consists in a start-up with an accounting software company in Romania in 1996 (which is still selling!) and experience as an independent contractor in Germany.
Currently employed full time at Wayne State University in Detroit, Razvan is involved in architecture, design, and development of OntoTools, a software application for statistics analysis of microarray experiments used by genetics researchers.
Razvan owns Software Ingenieurbuero Popovici in Germany; the company is a sub-contractor for development of a product that enables enterprises to implement ITIL (Information Technology Infrastructure Library) concepts.
Previously, Razvan worked for many companies, such as Siemens, Nokia Siemens Netwoks, matrix42 AG, HLP, Exody GmbH, ROUTE66 BV, and RCS SA.
I would like to thank my wife Mihaela for her support while reviewing this book, and my parents.
Christianto Sahat Kurniawan Hutasoit is an independent Java developer. He has been playing with Java and JEE since 2001, and is already working for different Java projects in Indonesia, Germany, and Singapore. He can be reached at <csahat@gmail.com>.
For my mum, S. Resmiana Limbong. Thanks for your struggle.
Preface
ZK is an open-source web development framework that enables web applications to have the rich user experiences and low development costs that desktop applications have had for years. ZK includes an AJAX-based event-driven engine, rich sets of XML User Interface Language (XUL), and XHTML components, and a markup language (ZUML).The ZK rich client framework takes the so-called server-centric approach: the content synchronization of components and the event pipelining between clients and servers are automatically done by the engine and AJAX plumbing codes are completely transparent to web application developers. Therefore, the end users get rich user interfaces with similar engaged interactivity and responsiveness to that of desktop applications, while for programmers, development remains similar in simplicity to that of desktop applications
What This Book Covers
In Chapter 1 we give an introduction to, and take a look behind the ZK framework. In the last section of this chapter, we show some important issues from the ZK User Interface Language (ZUML).
In Chapter 2 we will implement a CRUD (Create—Read—Update—Delete) application. We will also design and implement the pages with the ZK framework.
At the beginning of Chapter 3, we start with a simple CRUD application. The first thing we do here is to add some AJAX features to the application (live data). Here, we will learn many cornerstones provided by the ZK framework, and that we only have to implement some interfaces to use these features. We will move the application from a mixed code approach to a Model-View-Controller Architecture.
Chapter 4 deals with the end of the third phase in the development of a CRUD application with the AJAX ZK framework. We start with a simple application, and extend it step by step. The application now has many features that you will need in other applications as well.
Chapter 5 introduces the advantages and disadvantages of ZK. Then we will see how to integrate ZK with the Spring Framework and also why it is useful to do so. We will then move on to Hibernate and JasperReport.
In Chapter 6 we will