<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
    <header>
        <title>Control Project Template</title>
    </header>
    <body>
            <section id="intro">
            <title>Introduction</title>
<p>
Use the "blank" Control sample (located at <code>&lt;BeehiveRoot>/samples/controls-blank</code>) as a 
template for building your own Control projects.
</p>

				<note>&lt;BeehiveRoot> refers to the top-level directory of your Beehive installation.
					A typical value for &lt;BeehiveRoot> would be <code>/apache/apache-beehive-1.0</code>. </note>
<p>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. </p>

        </section>
    <section>
        <title>Using the Control Project Template</title>
        <p>The following instruction assume that you have completed the basic Beehive set up procedure 
			at <a class="fork" href="site:docs/installation">Set Up the Dev Environment</a>.</p>
  <p>To use the template:</p> 
  <p>(1) Copy the contents of <code>&lt;BeehiveRoot>/samples/controls-blank</code> into your 
	project folder (referred to as <code>&lt;Project-Folder></code> below). (Or copy <code>controls-blank</code>
	to another location and rename it as <code>&lt;Project-Folder></code>.)</p>
	<p>(2) In the file <code>controls-blank/build.properties</code>, 
		edit the <code>beehive.home</code> property so it points to 
		<code>&lt;BeehiveRoot></code> (the top-level folder of your 
		beehive installation).  For example, if your beehive installation
					resides at <code>/apache/apache-beehive-1.0</code>, then your <code>build.properties</code> file
					would appear as follows.</p>
				
    <p><strong>build.properties</strong></p>
		<source>beehive.home=<strong>/apache/apache-beehive-1.0</strong></source>  
	<p>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 
	<code>controls-blank</code> into your project folder, the following directory structure should exist:</p>
<source>&lt;Project-Folder>
  src
  build.properties
  build.xml</source> 
  <p>The following Ant command will compile the control template.</p>
<source>ant -f <strong>&lt;Path-to-Project-Folder></strong>\build.xml build</source>
    <p>This will produce a distributable JAR file at: <code>&lt;Project-Folder>/build/mycontrols.jar</code>.</p>
    <p>To use the JAR in your other projects (like a web project or a web service project), copy 
		<code>mycontrols.jar</code> into the project's <code>WEB-INF/lib</code> directory.</p>
	<p>(To change the name of the generated JAR file, edit the following line in
		<code>build.xml</code>.)</p>
	<source><code>&lt;property name="build.jar" value="mycontrols.jar"/></code></source>
    </section>
    </body>
    <footer>
        <legal>Java, J2EE, and JCP are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.<br/>
	&copy; 2004, Apache Software Foundation
	</legal>
    </footer>
</document>
