Informagen Echo2 Component Library
Version 1.0

Will Gilbert (gilbert@informagen.com)

The Components

Download

Source and binaries, all platforms (ZIP): Informagen-Components.zip
Source and binaries, all platforms (TAR): Informagen-Components.tar.gz

Installation

Uncompress the ZIP or TAR file into the directory "Components". The Informagen Echo2 Components JAR library has been prebuilt and is located at Components/Library/target/informagen-echo-components-1.0.jar

This file may be renamed to suit your style.

A test application WAR file has been pre-built for a TOMCAT server and is located at Components/Testing/target/deployment/Echo2-Tester.war

This WAR is based on the NextApp's "Interactive Test".

Rebuilding from source with Maven2

This library and the test application were developed with Maven2. Apologies the ANT guys for not providing a build.xml file. I am an avid ANT user and have created a widely used ANT task for creating Mac OS X standalone application, JarBundler. Maven2 has proven to be an excellent tool for Echo2 WebApplication development, especially with this project in which a library and a testing application were developed in parallel.

For those ANT users out there who are curious about Maven2, this project is well suited as an example project. It has many of the nice little tricks which Maven2 uses to create simple, yet custom builds.

Because the NextApp Echo2 libraries are not availble in the usual Maven repositories I have made them available from my own server, using a <repository> entry in each of the pom.xml files.

You can download and install Maven2 from its download site.

Build and install the Component Library

From a terminal window, go to the Components/Libary directory.

% mvn install

This will compile the source, merge in the resources, and move the resulting JAR file into your local Maven2 repository. If this is your first time using Maven, it will also download several plug-ins which it needs. Be patient, these will only be downloaded once. Refer to the Maven documentation for the location of the local Maven repository. On UNIX, it is located at ~/.m2, and there settings to reconfigure this location. For Windows, I have no clue where these files end up, RTFM.

Build and run the Testing Application

Change to the Testing directory and run jetty.

% cd ../Testing/
% mvn jetty:run

This builds the Testing application WAR file, loads in the Echo2 and Informagen Echo2 Components libraries and runs Jetty, a very nice servlet container. Log messages are sent to the terminal window which started Jetty. Maven will download more plugins in order to to run Jetty. As with the plugins above these will only be downloaded once.

Viewing the Testing Application

From any browser enter the following URL. Press the "Start" button from the initial HTML page.

http://localhost:9090/Echo2-Test-Harness/

Deploying to Different Targets

Maven has the notion of "Filters & Profiles". These can be used create WAR files for specific targets using a properties file to filter the source and resource files, looking for substition tags of the form ${subsitution.tag.string}

Using the provided POM file one can target the localhost Tomcat server, using the localhost profile and the localhost filter file. This is great for version numbers, log level and log filename, and a myriad of other uses.

I use it for an explicit label in the application to show if the application was build for "Development", "Acceptance", or "Production". The IT guys love me this, no mixed-up WAR deployment.

% mvn clean package -P localhost

It's always a good idea to clean often, especially when changing profiles.

Conclusion

Enjoy these new Echo2 components as much I as I enjoyed writing them.

Do give Maven a try! Using two terminal windows, you create a new package in one and run jetty in the other as a great way to develop Echo2 application. Jetty can be stopped and started very quickly. Be warned, even though Jetty monitors your source files and can automatically reload the web application on its own. This tends to work with diminishing returns, eventually your Echo2 application will become unresponsive and you have to kill -9 Jetty from another terminal window.

Oh yes, there is one more thing....

Based on Brad Baker's "Writing Your Own Component Peers, Part 3" tutorial I have included the HTML prototype files used to develop the HTML and CSS for these components. These files can be found in Components/Library/src/prototype

You will have to adjust the paths to the various JavaScript file to match your file structure.