Incubator > Beehive
 

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, 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>.) 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.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 app project or a web service project), copy mycontrols.jar into the project's WEB-INF/lib directory.