Configuration and build process

To configure and build the pow2webgui library, follow those steps:

Toolkit configuration

Open the Pow2Toolkit's configuration.properties file; it is used to configure the toolkit facilities. The file provides default values; set them according to your environment.

Note that Pow2webgui does not use any toolkit's database or LDAP feature, so it is not necessary to configure the JDBC or LDAP stuff. It is sufficient to coinfigure the log4j preferences as described below.

sectiondescription
Pow2Toolkit log set the pow2toolkit.loglevel and pow2webgui.loglevel properties values to a log4j compatible log level value. Example: info, warn, error.

Webgui configuration

The configuration of pow2webgui stores the informations about the components that are going to be registered during the boot process of the servlet container. To add or remove components, edit the $POW2WEBGUI_HOME/src/webapp/WEB-INF/pow2webgui-prototypes.properties file. This is the default configuration:

# widgets (concrete widget classes)
#
# format is:
# widget.${widgetName} = ${widgetClass}
#
widget.window         = com.pow2.webgui.window.Window
widget.tabbedSelector = com.pow2.webgui.tabbedselector.TabbedSelector
widget.tab            = com.pow2.webgui.tabbedselector.Tab
widget.lister         = com.pow2.webgui.lister.Lister


# widgets drawers (concrete drawing stategies)
#
# format is:
# drawer.${widgetName}.${drawerName} = ${drawerClass}
#
drawer.window.backoffice         = com.pow2.webgui.window.BOWindowDrawer
drawer.window.pow2               = com.pow2.webgui.window.Pow2WindowDrawer

drawer.tabbedSelector.backoffice = com.pow2.webgui.tabbedselector.BOTabbedDrawer
drawer.tab.backoffice            = com.pow2.webgui.tabbedselector.BOTabDrawer

drawer.tabbedSelector.amazon     = com.pow2.webgui.tabbedselector.AmazonTabbedDrawer
drawer.tab.amazon                = com.pow2.webgui.tabbedselector.AmazonTabDrawer

drawer.lister.amazon             = com.pow2.webgui.lister.AmazonListerDrawer


# widgets content providers
#
# format is:
# contentprovider.${widgetName}.${contentProviderName} = ${contentProviderClass}
#
contentprovider.lister.default = com.pow2.webgui.contentprovider.ContentProvider
        

Velocity configuration

The Velocity configuration is located at $POW2WEBGUI_HOME/src/webapp/WEB-INF/velocity.properties. The default configuration is:

resource.loader = file

file.resource.loader.description = Velocity File Resource Loader
file.resource.loader.class = org.apache.velocity.runtime.resource.loader.FileResourceLoader

# use only one path; WebGuiInit prepends to that path
# the servlet context path used by the web application.
file.resource.loader.path = /templates

file.resource.loader.cache = false
file.resource.loader.modificationCheckInterval = 600

#runtime.log = velocity_example.log
        

sectiondescription
file.resource.loader.path set the relative path of the templates directory. WebGuiInit (the initialization servlet) prepends to that path the servlet context path used by the web application. For example, the default "/templates" value indicates the templates directory is located at http://localhost:8080/pow2webgui/templates, where 8080 is the port of the servelt container and /pow2webgui is the name of the application context.
file.resource.loader.cache enables or disables the cache of the Velocity templates. Set it to true to enable the cache. Default value is false. Note: set this property to true for production environments.

Build process

The buid process uses Apache Maven 1.0.x as build tool. Please read the getting started with Maven document to install and understand how to use it.

Edit the $POW2WEBGUI_HOME/project.properties file and set the value of maven.repo.remote property according to your environment. The default value uses the Maven repositories located at pow2toolkit.sf.net and ibiblio web sites; it should be sufficient to build the pow2webgui jar.

# specifies the remote repositories using a comma-separated list of URLs;
maven.repo.remote = http://pow2toolkit.sourceforge.net/maven,http://www.ibiblio.org/maven
        

Open a shell, enter into the $POW2WEBGUI_HOME directory and digit:

> maven
to build the library. Use
> maven war
to generate the $POW2WEBGUI_HOME/target/pow2webgui.war web application archive containing the example application.

Deployment of the example web application

The build process creates a standard web application archive. It is possible to deploy it on any servlet container that supports the the servlet 2.3 and JSP 1.2 specifications.

Pow2webgui is currently used and tested on Tomcat 4.1.x and 5.x servlet containers.

Lifecycle of the web applications

Please read the Tomcat4 Manager App HOW-TO or the Tomcat5 Manager App HOW-TO to understand how to manage the deployment and the lifecycle of the example web application.

Codeczar's Maven Tomcat Plug-in

It is possible to use the Codeczar's Maven Tomcat plugin to deploy the pow2webgui example web application into a Tomcat servlet container. Download and install the plugin into your Maven environment. Then open the $POW2WEBGUI_HOME/project.properties file and edit the following lines

# codeczar's tomcat plugin
maven.tomcat.host = localhost
maven.tomcat.port = 8080
maven.tomcat.username = admin
maven.tomcat.password = admin
maven.tomcat.manager.context = manager
maven.tomcat.precompile = false
         
according to your environment. Start the Tomcat servlet container, open a shell, enter into the $POW2WEBGUI_HOME directory and digit:
> maven tomcat:deploy
         
The output of the Maven command should be similar to this one:
tomcat:deploy:
    [deploy] OK - Installed application at context path /pow2webgui
    [deploy]
BUILD SUCCESSFUL