You create a manipulator by extending the Manipulator abstract class and other supporting classes.

A Manipulator requires an @CasManipulator annotation. The annotation has several important attributes you can configure:

The listModules task of the CAS Server Command-line Utility and the listModules() call of the CAS Server API both return the attribute values you specify in the @CasManipulator annotations.

To create a manipulator extension:

  1. Create a Java project in your development environment of your choice.

    If you are creating several extensions in one plug-in, you can use the same Java project for each extension.

  2. Add the CAS Extension API libraries to your compile classpath. These include all the libraries available in CAS\version\lib\cas-extension-api.

  3. Create a subclass of Manipulator and specify the PipelineComponentConfiguration subclass that the extension uses.

    For example:

    public class SubstringManipulator extends Manipulator<SubstringManipulatorConfig>{
    
    }
  4. Add a @CasManipulator annotation to the Manipulator class and any attributes as described above.

    For example:

    @CasManipulator(
    		supportsIncrementals=true, 
    		deleteRecordsBypassManipulator = true,
    		displayName="Substring Manipulator", 
    		description="Generates a new property that is a substring of another property value")
    public class SubstringManipulator extends Manipulator<SubstringManipulatorConfig>
  5. Implement the getConfigurationClass() method to return the appropriate PipelineComponentConfiguration subclass.

    For example:

    public Class<SubstringManipulatorConfig> getConfigurationClass() {
    		return SubstringManipulatorConfig.class;
    	}
  6. Implement the createManipulatorRuntime() method to create an implementation of the ManipulatorRuntime class.

    For example:

    public ManipulatorRuntime createManipulatorRuntime(
    			SubstringManipulatorConfig configuration, PipelineComponentRuntimeContext context) {
    		return new SubstringManipulatorRuntime(context, configuration);
    }
  7. Implement the getRuntimeClass() method to return the runtime class the manipulator creates.

    For example:

    	public Class<SubstringManipulatorRuntime> getRuntimeClass() {
    		return SubstringManipulatorRuntime.class;
    	}
  8. Optionally, override the deleteInstance() method. CAS Server calls deleteInstance() when it removes an extension from an acquisition. In this method, you can perform any clean up that is necessary when CAS Server calls deleteInstance() to remove the extension from an acquisition. The default implementation of deleteInstance() is empty.



Copyright © Legal Notices