Control Project Template
Introduction
Use the "blank" Control sample (located at <BeehiveRoot>/samples/controls-blank) as a template for building your own Control projects.
The template contains a basic 'Hello World' control to get you started. Control projects can be archived in a JAR file and then imported into multiple applications. Simply import the JAR archive into the application's WEB-INF/lib directory.
Using the Control Project Template
The following instruction assume that you have completed the basic Beehive set up procedure at Set Up the Dev Environment.
To use the template:
(1) Copy the contents of <BeehiveRoot>/samples/controls-blank into your project folder (referred to as <Project-Folder> below). (Or copy controls-blank to another location and rename it as <Project-Folder>.)
(2) In the file controls-blank/build.properties, edit the beehive.home property so it points to <BeehiveRoot> (the top-level folder of your beehive installation). For example, if your beehive installation resides at /apache/apache-beehive-1.0, then your build.properties file would appear as follows.
build.properties
beehive.home=/apache/apache-beehive-1.0
An Ant build file is included in the template, which will compile your control project into a distributable JAR file. After you have copied the contents of controls-blank into your project folder, the following directory structure should exist:
<Project-Folder> src build.properties build.xml
The following Ant command will compile the control template.
ant -f <Path-to-Project-Folder>\build.xml build
This will produce a distributable JAR file at: <Project-Folder>/build/mycontrols.jar.
To use the JAR in your other projects (like a web project or a web service project), copy mycontrols.jar into the project's WEB-INF/lib directory.
(To change the name of the generated JAR file, edit the following line in build.xml.)
<property name="build.jar" value="mycontrols.jar"/>