Developing Sun Master Indexes (Repository)

Implementing Master Index Custom Plug-ins (Repository)

Custom plug-ins are created in the com.stc.eindex.user package, and the name you specify for each plug-in is the name of the Java class created for the plug-in. You can create multiple source files that make up a plug-in. When you specify the custom plug-in in the configuration files, use the fully qualified class name of the class the master index application should call to carry out the custom processing. For example, if you create a custom plug-in named MergePolicy, the value to enter for the class in the Best Record file is com.stc.eindex.user.MergePolicy.

Follow these steps to implement a custom plug-in.


Note –

You can create custom plug-ins that define custom processing or that define custom components. For additional information about how to implement specific custom-plug ins, see the following topics:


Creating Master Index Custom Plug-ins (Repository)

You create a custom plug-in by composing Java code into a custom plug-in file in NetBeans. When you create a custom plug-in, a file is automatically created for you with the first line already entered (package com.stc.eindex.user;).

ProcedureTo Create Custom Plug-ins

  1. In the Projects window, expand the master index project and then expand the master index application.

  2. For each source file that defines a custom plug-in, do the following:

    1. Right-click the Custom Plug-ins folder, and select New from the context menu that appears.

    2. Enter the name of the Java class you want to create and then click OK.

      The custom plug-in file appears in the NetBeans editor.

    3. Create the custom processing rules using Java code.

    4. Close and save the file.

  3. Build the custom plug-in files, as described under Building Master Index Custom Plug-ins (Repository).

  4. Specify the name of the class the master index application should call for the custom plug-in in the appropriate configuration file.

Building Master Index Custom Plug-ins (Repository)

In order for the custom plug-ins you create to become a part of the master index application, you must build the plug-in files. This compiles the Java code and incorporates it into the application files. Compiling errors for custom plug-ins are not written to a log. An error message trace appears on a console window alerting you to the errors that occurred.

ProcedureTo Build Custom Plug-ins

  1. In the master index project, right-click the Custom Plug-ins folder.

  2. Select Build from the context menu that appears.


    Note –

    If you modify a custom plug-in file after it has been checked in, be sure to check the file out before making any changes; otherwise, any changes will be lost when you try to save the file. Rebuild the plug-in after you save the changes, and then regenerate the application to incorporate the changes. Regenerating the application also rebuilds all custom plug-ins.