[an error occurred while processing this directive]
USERS
DEVELOPERS
 an introduction to developing plug-ins

A plug-in is an extension to Protégé. There are six types of plug-ins:


There are several steps that are common to the development of each of the Protégé plug-in types, which are described below. Specific information required by the different plug-in types is described elsewhere.

The process for developing a plug-in consists of the following broad steps:

Develop a skeletal plug-in

Before you can develop the code specific to your plug-in, you need to generate a stub plug-in with the desired name but with trivial functionality, and then get it to load into Protégé and show up in the appropriate places. To do this:
  1. Subclass the appropriate class for your plug-in type
  2. Implement all the methods required to do something simple.
  3. Generate a manifest file with an appropriate entry for your plug-in. Although you need a manifest file for Protégé to see and use your plug-in it is not necessary to package your plug-in as a JAR file while it is being developed. Protégé can load and run a plug-in that consists only of .class files in a directory.
Flesh out the plug-in

Once your skeletal plug-in shows up you can begin to flesh it out by developing the code specific to your plug-in. For tab or slot-widget plug-ins, this will involve generating java swing components, assembling them, and laying them out. For back-end plug-ins, this will mean writing or interfacing with a existing parser or database. See the documentation for each plug-in type for more information.

Package and distribute the plug-in

Once you have developed and tested your plug-in you may wish to package it so that others can use it. We recommend that at the point that you give your plug-in to your first "user", you package your plug-in as a JAR file. Attempting to distribute a plug-in as a collection of .class files is an error-prone and frustrating process for both developers and users.

To create a JAR file from your .class files and your manifest file, use the standard java "jar" command. For your users to "install" a plug-in, they just need to place the JAR file in the "plugins" subdirectory of the Protégé installation directory.

After you package your plug-in as a JAR file you will need to retest it before you distribute it. There are several problems (unrelated to Protégé) that arise which can cause a plug-in packaged as a JAR file to behave differently from a plug-in accessed as .class files.




[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive]