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:
$AJAXHOME/ws/jmaki/faces
- Runtime library$AJAXHOME/ide-plugins/netbeans/jmaki-faces-dt
- Design time
libraryEach 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]
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:
ajax
project from CVS into a directory labelled (for the purposes of
this discussion as "$AJAXHOME".$AJAXHOME/ws/jmaki
directory and execute ant
with no arguments.$AJAXHOME/ws/jmaki/faces
.
You should see a project named "jMaki JSF Components Library (Runtime)"
show up in your projects window.$NBHOME/enterprise3/modules/ext/servlet2.5-jsp2.1-api.jar
(where $NBHOME is where you have NetBeans installed).$AJAXHOME/ide-plugins/netbeans/jmaki-faces-dt
. You
should see a project named "jMaki JSF Components Library (Designtime)"
show up in your projects window.dist/jmaki-faces.jar
in that project).build.xml
file, and select the Run
Target option, and execute the copy-resources
target
to make a local copy of the resources that will be included in the
component import libary.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]
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]
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:
ajax-wrapper-comp.jar
containing the jMaki wrapper.widgets.zip
from jMaki must be expanded into the
resources directory of the web application.[Top]
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:
jmaki-resources.jar
) that will be
placed in the WEB-INF/lib
directory of the web
application project automatically, avoiding the need to expand
the resources into the web app resources
directory
directly.widgets.zip
file, run the copy-resources
Ant target in the $AJAXHOME/ide-plugins/netbeans/jmaki-faces-dt
directory to copy the most recent version.jmaki-resources.jar
file
is not checked in to the source code repository
(primarily because of its size). Therefore, everyone who is
building the design time code will need to perform this task on
their own checked out repository, each time the resources change.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:
jmaki-faces.jar
.ajax-wrapper-comp.jar
copied from the runtime project's lib
directory.jmaki-resources.jar
constructed
from the resources copied by the copy-resources
target.[Top]
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:
$AJAXHOME/ide-plugins/netbeans/jmaki-faces-dt/dist/jmaki-faces.complib
if you are currently developing).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]