USERS
DEVELOPERS


see also:
BACKEND
EXPORT
PROJECT
SLOT WIDGET
TAB WIDGET
 how to write a createproject plug-in

The goal of a createproject plug-in is to take any file in a source format produced by another program and create the closest possible "natural" Protégé knowledge-base. This may involve discarding information in the source that cannot be mapped cleanly to Protégé constructs. It is up to the plug-in developer to decide whether and how to notify the user about discarded information and whether or not to allow the user to provide guidance on how source file information should be mapped to the equivalent Protégé constructs. Also, a createproject plug-in should not introduce menu items or make other more permanent changes to the system. Once something is imported, a user should not be able to tell what the original source format was.

Developers of createproject plug-ins may be interested in reading the documentation on our Web site that details the differences between the createproject, export, and back-end plug-in types.

[ Description of what example plug-in does here. ]

Follow these steps to compile and run the createproject plug-in example:
  1. Download the source code. (Please make sure to preserve the path information in the ZIP file).
  2. Set up your Java development environment:
    • Use JDK 1.4 or higher for your compiler.
    • Configure the compiler to write output classes to <protege_install_dir>/plugins (replacing protege_install_dir with your Protégé installation directory).
    • Add the following JAR files to your classpath: protege.jar, looks.jar, unicode_panel.jar.
    • Pass the JVM the following parameter -Dprotege.dir=<protege_install_dir>.
  3. Compile the source code. Check that your compiler has indeed put the "FooCreator.class" and "FooFilesWizardPage.class" files into the "plugins/examples/createprojectplugin" directory. Also, please make sure that your development environment copies the meta-inf directory with the manifest file to your output directory. Some development environments do this by default, others require you to specify that MF files should be copied to the output directory. The following is an example of what your directory structure should look like after properly downloading and compiling the example code:
    
    <protege_install_dir>
        plugins
            examples
                backend
                createprojectplugin
                exportplugin
                projectplugin
                slotwidget
                tabwidget
            meta-inf
    
  4. Run the example from your development environment, specifying edu.stanford.smi.protege.Application as the main class. Any "Duplicate plugin" warnings are benign and can be ignored. Select File | New Project... and in the "Create New Project" dialog, check the "Create from Existing Sources" checkbox. Click the "Next" button and notice that the example source type "Foo Files" appears in the list of existing source types.