Ready to Learn?Ex Libris products all provide open APIs

  • Primo resources
  • Alma resources
  • Rosetta resources
  • Leganto resources
  • bX resources
  • SFX resources
  • Aleph resources
  • Voyager resources

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

NameType Examples
Access RightsARPluginjavadocORCID
Archive DecomposerDecomposerPluginjavadocUnzip
Converter (Publishing)ConverterRegistryPluginjavadocXEpicur
Custom FixityCustomFixityPluginjavadocDummy
Field ValidatorFieldValidatorPluginjavadocRegex
File Comparison (5.1+)FileComparisonPlugin PSNR
Format IdentifierFormatIdentificationPluginjavadocDummy
Migration ToolMigrationToolPlugin PDF to JPG
Persistent IdentifierPIGeneratorjavadocURN Fixed Length
Publisher (Publishing)PublisherRegistryPluginjavadocCustom NFS
Repository TaskRepositoryTaskPluginjavadocDC Replace
Risk ExtractorRiskExtractorjavadocDRMLINT
Start-up CheckStartUpCheckPluginjavadocDiskSpace
Storage HandlerStoragePluginjavadocAmazon S3
NFS in-place
NFS Pair-tree
Technical Metadata ExtractorMDExtractorPluginjavadocJpylyzer
Viewer Pre-ProcessorVPPPluginjavadocFilePath
Customized Jpeg
IA BookReader (with ALTO)
IA BookReader (no ALTO)
Virus CheckVirusCheckPlugin 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

AttributeDescription (values)Mandatory
pluginTypeNameThe Plug-in type (see above table).Yes
displayNameThe name that will be displayed in the UI.Yes
classNameThe Java full path class name.Yes (java plug-in only)
initParametersAn x-form defining the plugin parameters and default parameter values (see table below).No
descriptionA short description of the plugin.No
versionThe plugin version (double-precision floating-point format).Yes
materialTypealways 'DIGITAL'.Yes
implTypePlugin implementation type (script/java).Yes
contactPersonContact 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: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

AttributeDescription (values)Mandatory (default)
x_fieldsParameter declarationYes
x_fieldParameter configurationYes
field_name  
labelParameter name in the UIYes
ui_tool_tipLabel tool-tipNo
default_valueA default value for the fieldNo
mandatoryIndication whether the parameter is mandatory (true/false) No (false)
x_logic_typeStringYes
x_ui_typeDetermines the UI component typeYes
css_classDetermines the CSS class of the field labelNo

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>

 

Make sure your plugin contains a method with the following signature:
Public void initParams(Map<String, String> initParams)
Retrieve the parameter values from the map by the field name and initialize the plug-in members. For a field named ‘recordType’:
String recordType = initParams.get(“recordType”);

 

Contact Info Attributes

 

AttributeDescriptionMandatory
contactTypeA description of the administrative jobNo
firstNameFirst nameNo
lastNameLast nameNo
telephone1Primary telephone numberNo
telephone2Additional telephone numberNo
emailE-mail addressNo
address1AddressNo
address2AddressNo
cityCityNo
zipCodeZipNo
countryCountryNo

 

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').