Professional Documents
Culture Documents
Liferay Certified Gold Level Partner Liferay consulting, architecture, support and end-to-end implementation Ability to service clients after implementations through Xtivias 24x7x365 database and Application/Web Server support services. (www.virtual-asa.com; www.virtualdba.com)
ZK - An Introduction
ZK is a leading enterprise Ajax+Mobile framework with an Open Source Community base. A lightweight Ajax framework with hundreds of supported components to speed development. A Java based solution with no need for JavaScript or extensive binding configurations. Provides the option of using ZUML, a powerful markup language that enables the interface to be described in XML with no Java code at all. Combined with frameworks such as JPA, Hibernate, Spring and CDI provides a full MVC solution.
ZK - An Introduction
ZK - An Introduction
ZK - An Introduction
ZK - An Introduction
ZK - An Introduction
ZK Is A Mature Technology
Many leading companies around the world use the ZK Framework
Why ZK?
Compared to a solution like GWT which requires backend service implementations such as GWT RPC, GWTs JSON, and GWTs XML, ZK is a much less complex solution. ZK does not expose business logic to the browser and is designed to protect against XSS and CSRF attacks. Provides hundreds of UI components (widgets) such as select boxes, input controls, and grids. Promotes a strong MVC approach, especially when coupled with frameworks like Spring, CDI, JPA, or Hibernate.
ZK Support
Supported Enterprise version of ZK is available Enterprise version extra features -Comet Push capability -On-demand rendering - performance enhancement for large data sets within components -Master Detail drop-down component in grids Active development Active community Built-in support for clustered environments if guidelines are followed (http://books.zkoss.org/wiki/ZK%20Developer's %20Reference/Clustering/Programming%20Tips)
ZUML
ZKs markup language is a natural extension of the backing Java components and provides a quick easy method for providing certain classes of solutions or prototyping.
<window title="My First Window" border="normal" width="200px"> Hello, World! </window>
ZUML
An active Hello World utilizing ZSCRIPT.
<?page title="ZK Hello World" contentType="text/html;charset=UTF-8"?> <zk> <window title="ZK active Hello World" border="normal" width="250px"> <zscript>boolean display = true;</zscript> <vbox width="100%" > <button id="l1" width="120px" label="Say Hello?" onClick="doClick()" /> <cell align="center"> ! <label id="layout" /> </cell> <zscript> void doClick() { layout.value = display ? "Hello There!" : "Goodbye."; l1.label= display ? "Say Goodbye?" : "Say Hello?"; display = !display; } </zscript> </vbox> </window> </zk>
ZUML
An active Hello World utilizing ZSCRIPT.
<?page title="ZK Hello World" contentType="text/html;charset=UTF-8"?> <zk> <window title="ZK active Hello World" border="normal" width="250px"> <zscript>boolean display = true;</zscript> <vbox width="100%" > <button id="l1" width="120px" label="Say Hello?" onClick="doClick()" /> <cell align="center"> ! <label id="layout" /> </cell> <zscript> void doClick() { layout.value = display ? "Hello There!" : "Goodbye."; l1.label= display ? "Say Goodbye?" : "Say Hello?"; display = !display; } </zscript> </vbox> </window> </zk>
ZUML
An active Hello World utilizing ZSCRIPT.
<?page title="ZK Hello World" contentType="text/html;charset=UTF-8"?> <zk> <window title="ZK active Hello World" border="normal" width="250px"> <zscript>boolean display = true;</zscript> <vbox width="100%" > <button id="l1" width="120px" label="Say Hello?" onClick="doClick()" /> <cell align="center"> ! <label id="layout" /> </cell> <zscript> void doClick() { layout.value = display ? "Hello There!" : "Goodbye."; l1.label= display ? "Say Goodbye?" : "Say Hello?"; display = !display; } </zscript> </vbox> </window> </zk>
ZK in a Portal Environment
ZK OOB comes with the DHtmlLayoutPortlet, which supports the only doView method. This allows easy and fast integration of ZK web apps into a portal environment, or the development of a ZK portlet. Limitations in a portal environment:
-All ZK components should be wrapped in a base window component -The wrapping window component should use the embedded mode -Changing displayed components should be done within the context of
the base window component
ZK In Liferay Portal
A few additional steps need to be taken for ZK portlets to successfully run in the Liferay Portal server.
In portal-ext.properties, set:
speedfilters=false
Each portlet defined in portlet.xml should add a portlet preference for zk_page pointing to the starting ZUL page for the portlet.
<portlet-preferences> <preference> <name>zk_page</name> <value>/portletview.zul</value> </preference> </portlet-preferences>
PortletView
JSR-168 Compliance
ZKs provided DhtmlLayoutPortlet does not support the edit and help modes. During Ajax calls there is no access to the request attributes, portlet preferences nor any vendor specific attributes. To rectify these shortcomings, we extend the DhtmlLayoutPortlet and utilize the PortletView to enable access to these items during the lifecycle of the page.
FullDhtmlPortlet
Extends the DhtmlLayoutPortlet to provide implementations for the doEdit and doHelp methods. Default zul pages are edit.zul and help.zul, both of which can be overridden in portlet.xml:
! ! ! ! ! ! ! ! ! ! ! ! ! ! <portlet-preferences> ! <preference> ! ! <name>zk_page</name> ! ! <value>/portletview.zul</value> ! </preference> ! <preference> ! ! <name>zk_edit_page</name> ! ! <value>/portletviewedit-base.zul</value> ! </preference> ! <preference> ! ! <name>zk_help_page</name> ! ! <value>/portletviewhelp-base.zul</value> ! </preference> </portlet-preferences>
Demo
Demo
ZUML Java Components PortletWindow FullDhtmlLayoutPortlet Edit and Help modes
Q&A
Links:
ZK: http://www.zkoss.org -http://www.zkoss.org/zkdemo -http://books.zkoss.org/wiki/Documentation -http://books.zkoss.org/wiki/Small_Talks -http://blog.zkoss.org Liferay: http://www.liferay.com Xtivia: http://www.xtivia.com
Visit the Xtivia ECS booth to learn more about Xtivias services and how our Liferay experts can help you! Post-ECS: info@xtivia.com or 888-685-3101 option 2