Exporting Controls into JARs

Workshop lets you package your control classes as JAR files that can be reused in other Java projects. This is the simplest way to distribute controls.

This approach is somewhat limited, providing no custom labels, no custom icons, no insertion wizards. If you are creating controls that will have very wide distribution (e.g., an ISV developing controls for customers), you may want to package your custom control as a plug-in.

To package a control as a JAR file, select File > Export > Beehive Control JAR File.

Only control files in utility projects are available for JAR file packaging; controls in other project types are not available for export.

All Java class files in the utility project are included in the JAR file, including control interface, control implementation classes, and all other Java classes. Note that by default, only class files are included in the JAR file. To include the Java source files, place a checkmark next to Include Java source files.

To use a control in another web application:

  1. Copy the JAR file to the WEB-INF/lib folder.
  2. Add a reference to that control to a control client by right-clicking anywhere within the client's Java source file and selecting Insert > Control.
  3. A list of available controls appears. The heading Existing Project Controls lists the available controls, including controls in JAR files.

Alternately, you can:

  1. Copy the JAR file to the APP-INF/lib folder of the associated EAR project.
  2. Add a reference to that control to a control client by right-clicking anywhere within the client's Java source file and selecting Insert > Control.
  3. A list of available controls appears. The heading Existing Application Controls lists the available controls, including controls in JAR files.

As long as the JAR is inserted into the user's classpath as described above, the control will be discovered automatically by Workshop and property set/event handler features will be provided.

Related Topics

Building Controls


Still need help? Post a question on the Workshop newsgroup.