PluginManifestsAndJars

From Protege Wiki
Jump to: navigation, search

Creating Protege plug-in manifests and JAR files

A Protege plug-in JAR file can be built with the standard "jar" Java Archive Tool. (See the documentation on Sun's Java Technology Web site for more information about working with JAR and manifest files). A JAR file can contain one or more Protege plug-ins. The manifest for a plug-in JAR file must contain a section which describes the plug-in and every manifest must start with the following line:

Manifest-Version: 1.0

After this line, you must put a blank line followed by any number of Protege plug-in entries. The entries must be separated by blank lines and the last line in the file must be a blank line. Examples of manifest entries are given below.

tab widget plug-in:

Name: edu/stanford/smi/protege/ui/ClsesTab.class
Tab-Widget: True


slot widget plug-in:

The following is the standard, simple manifest entry for a slot widget plug-in.

Name: edu/stanford/smi/protegex/imagemap/ImageMapToSymbolWidget.class
Slot-Widget: True

The following entry is more specialized. It will cause to system to assign the declared slot widget plug-in as the widget for any slot which has single cardinality, type Instance, and has allowed classes of "URI".

Name: edu/stanford/smi/protegex/rdf/uri/widget/URIFieldWidget.class
Slot-Widget: True
Default-Widget: True
Default-Widget-For-Cardinality: Single
Default-Widget-For-Type: Instance
Default-Widget-For-Allowed-Class: URI


back-end plug-in:

Name: edu/stanford/db/protegex/storage/rdf/RDFKnowledgeBaseFactory.class
Storage-Factory: True


project plug-in:

Name: examples/projectplugin/MenuItemInserter.class
Project-Plugin: True


createproject plug-in:

Name: examples/createprojectplugin/FooCreator.class
Create-Project-Plugin: True


export plug-in:

Name: examples/exportplugin/FooExporter.class
Export-Plugin: True