Last Modified: 1 February 2007

Table of Contents

Inroduction

This document describes how to build the JSF component library (and the associated design time support code for Visual Web Pack if you wish) that wraps jMaki capabilities in traditionally structured JavaServer Faces components. The runtime and design time code are in separate directories in the source repository (where $AJAXHOME is the top level directory where you have checked out the source code:

Each of these directories is a standard NetBeans class library project (with slightly tweaked build.xml files), so that you will be able to build the two projects either inside NetBeans, or using Ant from the command line directly.

[Top]

One Time Setup

When a NetBeans project is stored in a source repository, the nbproject directory (containing key configuration information) is included, but the nbproject/private directory (containing pathnames that are specific to your local environment) is not. Therefore, you will need to open each project once in NetBeans to cause the private configuration information to be created. Here is a quick summary of the required steps:

From here on, you can develop these two projects within NetBeans (recommended for maximum productivity), or use your favorite editings and execute the Ant scripts from the command line. Like the rest of jMaki, the default Ant target is the one that rebuilds the current project, so you normally will not need to specify a specific target (with exceptions listed below).

[Top]

Updating The jMaki Core

The core code of jMaki, as well as the static resources (stylesheets, javascript, and so on) for the supported widgets, is under rapid development on the trunk of the source repository. On occasion it will be necessary for you to update your wrapper library and/or widget resources, before you rebuild the component library. Here are the steps to do this from the command line (including rebuilding the complib).

At this point, you will have an updated component library, which you can use in VWP as described below.

[Top]

Developing The Runtime Library

The runtime component library is developed in the $AJAXHOME/ws/jmaki/faces directory, in the usual manner. Keep in mind that this library has a dependency on the ajax-wrapper-comp.jar library built by the parent project ($AJAXHOME/ws/jmaki). Therefore, whenver this library is modified, you will need to update the copy inside this project. Use the copy-wrapper target of this project's build script to copy in the latest version. Note that this file is also checked in to CVS, so you will need to do a CVS commit as well to save the changes away.

The result of building this library is a standard JavaServer Faces component library (dist/jmaki-faces.jar) with an embedded META-INF/faces-config.xml file to register its resources with the JSF runtime. This library can be used in any web application where JSF component libraries are supported, as long as the necessary dependencies are also included. As of this writing, that means:

[Top]

Developing The Design Time Library

This optional project takes the runtime library produced above, and adds the necessary design time support to make these components available on the palette in the Visual Web Pack add-on to NetBeans 5.5. The home directory for the project is $AJAXHOME/ide-plugins/netbeans/jmaki-faces-dt. Again, most of the development process is similar to what you would do for any other Java class library, with the following tweaks:

The output of the build process for this project is a component import library ("complib") that can be imported into NetBeans with the Visual Web Pack installed, as described below. The complib file dist/jmaki-faces.complib includes the following contents:

[Top]

Using Components In Visual Web Pack

Before you can use the jMaki-Faces components in any visual web application, you must import them into the tool. That is done by the following steps:

Next, you must add the component library to a visual web project, to make the components it contains available on the palette:

Once you have done this, the component palette (for this project) will be updated to include the jMaki Faces wrapper components included in the library. In addition, all of the necessary runtime code in the WEB-INF/lib directory.

Note in particular that it is NOT necessary to expand the static resources into the resources directory of the web application itself. This is thanks to a recent enhancement to jMaki that will look for the resources in the classpath of the web application. However, you can override individual resources by storing them in the resources directory. For example, to customize the JavaScript file for the Dojo Clock widget, you would create your own version at resources/dojo/clock/component.js and this will be used instead of the standard version, for this application.

[Top]