Creating a ZK Groovy Console

SECURITY WARNING: Please take note of the warning at the end of the tutorial !
UPDATE 2011-07-08: A good article on the security concern I recommend http://www.jroller.com/melix/entry/customizing_groovy_compilation_process

We use the Groovy Script Engine to run small Groovy scripts to prepare incoming interface messages for further processing. Here I share with you how to embed the engine into a ZK page. Very basic, though it shows you the concept and it is wasy to expand to your needs.

ZK Groovy Console

Continue reading

ZK with EJB3.1 running on Glassfish (Part 2)

In part 1 we connected a web application to a database using an EJB for reading access, deployed on a Glassfish Server. In part 2 we do some modifications to create a true CRUD application by adding add, delete and update.

Pre-Requirements:

  • Netbeans 6.7 or later
  • Installed ZK plugin (link)
  • Glassfish V3 or later
  • Netbeans Project from Part 1 (link)

Continue reading

ZK with EJB3.1 running on Glassfish

A while back I created a tutorial that covers the direct DB access from a ZK application (link). Today I want to show you the most simple ZK application that reads from a DB using EJB 3.1 and display the data in a listbox.

Prerequisites:

  • Netbeans 6.7 or later
  • Installed ZK plugin (link)
  • Glassfish V3 or later

The tutorial covers 2 steps, the first part to create an EJB and the second part to create a ZK application. It covers all details of the project creation with Netbeans, but it does not elaborate the underlying EJB, JPA technology, feel free to read more about it at the Netbeans doc (eg. link) or in-detail at Oracle (link).

Continue reading

Automatic Version Numbering in Web Applications with Hudson (Part 3)

In this third and last part of the tutorial (part 1, part 2) we add the version reading feature to a ZK application, which is actually not a big difference to the regular jsp page that we created earlier.
It is also a good exercise how to add the ZK library to an existing web project.

Requirements:

  • Netbeans 6.8
  • Glassfish V3 Application Server
  • Installed ZK 5.0 Plugin for Netbeans (link)

(Older Versions and non-EE6 work as well)

Continue reading

Tutorial: Internationalize ZK Web Applications (Part 2)

In part 1 (link) we created a multi language supporting web application with the ZK Ajax framework. Out-of-the box it will follow the browser’s default or preferred language which is perfect assuming 1 user would always use the same desktop with the same browser. But what happens if you create an application that is used by different users on public browsers or in an office/production environment with shared work stations (web kiosk). The preference page might not be accessible, and 90% of users won’t even know how or are not very excited to change the browsers preferences to have their own language displayed. Did you try to change it before ? Firefox: Go to edit|preferences|Language choose..| select (add) you language and move it to the top. You want to change it back ? Go there again and….. This is not WEB 2.0 !

What we need is the application to change the language on the fly, and even better store it as a user preference if you use accounts.

We continue with the application from part 1.

Continue reading

Tutorial: Internationalize ZK Web Applications (Part 1)

I would say internationalization is a key feature in any software that is (potentially) used in different countries or user with different languages. You dont want to inject this feature at the end of your implementation but put in place right at the beginning. Using todays framework is not a big deal to hook on the browsers locale settings and make an application speaking that language (if it is provided, otherwise fall back into the default language). I found 2 tutorials for the ZK Ajax framework covering internationalization (link1, link2), I will add another approach here, focusing on the separation of zul page (viewer) and its controller.

Requirements:

  • Netbeans 6.8
  • Glassfish V3 Application Server
  • Installed ZK Plugin for Netbeans (link)

(Older Versions and non-EE6 work as well, Internationalization is not a Java EE6 specific feature)

Continue reading

ZK Community Edition (CE) plugin for Netbeans

With the license change you have now 3 versions to choose from: Community, Professional and Enterprise Editions (more details here). The first Netbeans plugin for ZK 5 contained the enterprise version, resulting in a warning in the logfile the version will expire after 60 days. Since last week you can download the plugin that comes with the CE libraries.
Note: You need to install the other ZK5 plugin, de-activating is not enough. Download (link) and install as usual.

Enterprise Edition

Install ZK 5 CE Plugin

After installing the CE plugin your projects (created with the other version will throw a reference problem at you. You can’t resolve, you need to open the project properties and delete the previous library and import the new one. You need to verify if you used enterprise features that are not available in the community edition.

Project Properties

Reference Problem

Project Properties

Migrating a ZK363 to a ZK500 Web Project

The ZK Ajax framework is embedded into Netbeans as a plugin since a couple of previous releases of ZK. Now with ZK500 out for a couple of weeks, you might want to migrate your projects to the latest version. This short tutorial describes the most simple scenario: Migrating a Java EE6 project. If you need to migrate from Java EE5 or earlier, you will have more work to do, even per default, the Java EE5 will run on Glassfish V3 (as Java EE6 reference server).

Excursion: Install the ZK 5.0 plugin (for those who haven’t done it yet)
Note, you can install (or keep) both versions of the plugin.

  • Download the plugin file from sf.net (link). File: net-sf-rem500.nbm
  • Open Tools|Plugin|Downloaded

    Netbeans Plugins

    Continue reading

ZK 3.6.3 and ZK5.0rc with Glassfish V3 and EE6

In my previous post I described how to get a EE6 web application using the ZK3.6.3 framework on Glassfish V3. I noted while redeploying or undeploying the web-application it made the GF instance plus the JVM crash (running Ubuntu 9.04,9.10 and JDK 1.6.b16).

This problem does NOT exist anymore with the latest build from last week. Make sure you update to build b72. Start the updatetool in glassfish-home/bin. (you might have to start it several times, I got several times time-out errors, or better click on the reminder if you choose the automatic update check feature).

SVH20091115_001

Glassfish V3b72