Plugins
General Purpose
Rosetta is packaged with many bundled plug-in implementations, all described in the Plug-in Management section of the Rosetta Configuration Guide.
This page provides information for users who wish to extend Rosetta functionality by developing additional implementations.
Plugin Methods
Rosetta supports two plugin methods:
Java Plugin: A Java code plug-in wrapped as a JAR file
Script Plugin: An executable shell script plug-in (wrapped in a JAR package). Scripting language should be specified using the Shebang line.
Please refer to the Interface section for each plug-in type to learn which method is supported for the respective plug-in.
Plugin Types
| Name | Type | Module | Examples | |
|---|---|---|---|---|
| Access Rights | ARPlugin | Repository | javadoc | ORCID |
| Archive Decomposer | DecomposerPlugin | Preservation | javadoc | Unzip |
| Converter (Publishing) | ConverterRegistryPlugin | Repository | javadoc | XEpicur |
| Custom Fixity | CustomFixityPlugin | Repository | javadoc | Dummy |
| Field Validator | FieldValidatorPlugin | Repository | javadoc | Regex |
| File Comparison (5.1+) | FileComparisonPlugin | Preservation | PSNR | |
| Format Identifier | FormatIdentificationPlugin | Repository | javadoc | Dummy |
| DROID | ||||
| Format Validator | FormatValidationPlugin | Preservation | javadoc | |
| Full Text Extractor | FullTextExtractionPlugin | Repository | javadoc | |
| Migration Tool | MigrationToolPlugin | Preservation | PDF to JPG | |
| Persistent Identifier | PIGenerator | Repository | javadoc | |
| Publisher (Publishing) | PublisherRegistryPlugin | Repository | javadoc | Custom NFS |
| Repository Task | RepositoryTaskPlugin | Repository | javadoc | DC Replace |
| Risk Extractor | RiskExtractor | javadoc | DRMLINT | |
| Start-up Check | StartUpCheckPlugin | Repository | javadoc | DiskSpace |
| Storage Handler | StoragePlugin | Repository | javadoc | Amazon S3 |
| NFS in-place | ||||
| NFS Pair-tree | ||||
| Technical Metadata Extractor | TechnicalMDExtractorPlugin | Preservation | javadoc | |
| Technical Metadata Extractor and Format Validator | MDExtractorPlugin | Preservation | javadoc | Jpylyzer |
| Format Library Extractors | ||||
| Viewer Pre-Processor | VPPPlugin | Delivery | javadoc | FilePath |
| Customized Jpeg | ||||
| IA BookReader (with ALTO) | ||||
| IA BookReader (no ALTO) | ||||
| Virus Check | VirusCheckPlugin | Repository | ClamAV | |
| ClamAv (V2) |
For a full functional description of each of the Plug-in types, please see the Rosetta Configuration Guide – Plug-in Management.
Error Handling
Java
Developers can log errors to the server log using log4j or system.out.
Script
In case of a script error (or an initiated exit with a return value other than 0) – the script’s echo messages will be printed to the log as an ERROR message in the following format:
Execution of {script_full_path} failed: {echo_message}Metadata
Each plugin JAR file must contain a metadata XML file in the /PLUGIN-INF/ directory. The filename should contain ‘metadata’ and have an xml extension (e.g. metadata_myFirstPlugin.xml).
General Attributes
| Attribute | Description (values) | Mandatory |
|---|---|---|
| pluginTypeName | The plugin type (see above table). | Yes |
| module | The plugin module (see above table) | Yes |
| displayName | The name that will be displayed in the UI. | Yes |
| className | The Java full path class name. | Yes (java plug-in only) |
| initParameters | An x-form defining the plugin parameters and default parameter values (see table below). | No |
| description | A short description of the plugin. | No |
| version | The plugin version (double-precision floating-point format). | Yes |
| materialType | always ‘DIGITAL’. | Yes |
| implType | Plugin implementation type (script/java). | Yes |
| contactPerson | Contact Info (see table below). | Yes |
Example (script):
<pl:metadata-config xmlns:pl="http://www.exlibrisgroup.com/Plugins/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<pl:pluginTypeName>DecomposerPlugin</pl:pluginTypeName>
<pl:deployName>decomposeArcFile</pl:deployName>
<pl:className>bin/decomposeArcFile</pl:className>
<pl:initParameters>
<fr:x_form xmlns:fr="http://com/exlibris/digitool/common/forms/xmlbeans" />
</pl:initParameters>
<pl:description>decomposeArcFile</pl:description>
<pl:module>Preservation</pl:module>
<pl:version>2</pl:version>
<pl:materialType>DIGITAL</pl:materialType>
<pl:generalType>TASK</pl:generalType>
<pl:implType>script</pl:implType>
<pl:contactPerson>
<contact_info xmlns="http://www.exlibrisgroup.com/Plugins/1.0/" />
</pl:contactPerson>
</pl:metadata-config>X-form Attributes
| Attribute | Description (values) | Mandatory (default) |
|---|---|---|
| x_fields | Parameter declaration | Yes |
| x_field | Parameter configuration | Yes |
| field_name | ||
| label | Parameter name in the UI | Yes |
| ui_tool_tip | Label tool-tip | No |
| default_value | A default value for the field | No |
| mandatory | Indication whether the parameter is mandatory (true/false) | No (false) |
| x_logic_type | String | Yes |
| x_ui_type | Determines the UI component type | Yes |
| css_class | Determines the CSS class of the field label | No |
Please see the x_form.xsd for more details.
Example:
<fr:x_form xmlns:fr="http://com/exlibris/digitool/common/forms/xmlbeans">
<grid_x>2</grid_x>
<x_fields>
<x_field>
<field_name>recordType</field_name>
<label>recordType</label>
<ui_tool_tip>record type</ui_tool_tip>
<default_value>someType</default_value>
<mandatory>true</mandatory>
<x_logic_type>String</x_logic_type>
<x_ui_type>TextField</x_ui_type>
</x_field>
<x_field>
<label>role</label>
<mandatory>false</mandatory>
<x_logic_type>String</x_logic_type>
<x_ui_type>TextField</x_ui_type>
</x_field>
<x_field>
<label>createdOn</label>
<x_logic_type>Date</x_logic_type>
<x_ui_type>TextField</x_ui_type>
<x_options></x_options>
</x_field>
<x_field>
<label>createdBy</label>
<x_logic_type>String</x_logic_type>
<x_ui_type>TextField</x_ui_type>
</x_field>
<x_field>
<label>updatedBy</label>
<x_logic_type>String</x_logic_type>
<x_ui_type>TextField</x_ui_type>
</x_field></x_fields>
</fr:x_form>Public void initParams(Map<String, String> initParams)String recordType = initParams.get(“recordType”);Contact Info Attributes
| Attribute | Description | Mandatory |
|---|---|---|
| contactType | A description of the administrative job | No |
| firstName | First name | No |
| lastName | Last name | No |
| telephone1 | Primary telephone number | No |
| telephone2 | Additional telephone number | No |
| E-mail address | No | |
| address1 | Address | No |
| address2 | Address | No |
| city | City | No |
| zipCode | Zip | No |
| country | Country | No |
Example:
<pl:contactPerson>
<contact_info xmlns="http://www.exlibrisgroup.com/Plugins/1.0/">
<contactType>admin</contactType>
<firstName>Exlibris</firstName>
<lastName>Ltd</lastName>
<telephone1></telephone1>
<telephone2></telephone2>
<email>exlibris@exlibrisgroup.com</email>
<address1>1 Agodat Hasport Hapoel</address1>
<address2>Building 9</address2>
<city>Jerusalem</city>
<zipCode>91481</zipCode>
<country>Israel</country>
</contact_info>
</pl:contactPerson>Deployment and Installation
To deploy the plug-in, copy the jar file to $op_dir/plugins/custom. The dps user should have rw permissions on your file. Rosetta will display the plug-in in the list of custom plug-ins available for installation. If you are installing a new plugin, there is no need to restart Rosetta. If you are upgrading an existing plugin a restart is necessary, and you must be sure to increment the plugin version (see above, ‘General Attributes’).
