This documentation describes the installation, configuration and use of the plugin. You can use this plugin to retrieve data from an external system and transfer it to Goobi. The catalog must have an API that allows records to be delivered as JSON.
GPL 2.0 or newer
The plugin consists of two files:
plugin_intranda_opac_json.jar contains the program logic and must be installed readable for the user
tomcat at the following path:
plugin_intranda_opac_json.xml must also be readable by the user
tomcat and must be located under the following path:
The configuration of the plugin is done in the following files located in the directory
In the file
goobi_opac.xml the interface to the desired catalog system must be made known. This is done with an entry that looks like the following:
<catalogue title="JSON"><config description="JSON OPAC" address="https://example.com/opac?id="port="443" database="x" iktlist="x" ucnf="x" opacType="intranda_opac_json" /><searchFields><searchField label="Identifier" value="12"/></searchFields></catalogue>
title attribute contains the name under which the catalog can be selected in the user interface,
address the URL to the API endpoint and
opacType the plugin to be used. In this case the entry must be
Mapping the contents of the JSON record to Goobi metadata is done within the
plugin_intranda_opac_json.xml file. The fields within the JSON record are defined using
JSONPath, the XPath equivalent of JSON.
<config_plugin><config><recordType field="[?(@.recordType=='archival_object')]" docType="Monograph" /><recordType field="$.children[?(@.itemCount > 1)]" docType="Volume" anchorType="MultiVolumeWork" /><recordType field="$.children[?(@.itemCount == 1)]" docType="Monograph" /><defaultPublicationType>Monograph</defaultPublicationType><metadata metadata="PublicationYear" field="$.date" /><metadata metadata="DocLanguage" field="$.language" /><metadata metadata="CatalogIDDigital" field="$.identifier" docType="volume" /><metadata metadata="CatalogIDDigital" field="$.children[?(@.itemCount > 1)].children.itemId" docType="volume" /><metadata metadata="CatalogIDDigital" field="$.uri" regularExpression="s/\/some-prefix\/(.+)/$1/g" docType="anchor" /><metadata metadata="shelfmarksource" field="$.identifierShelfMark" docType="volume" /><metadata metadata="TitleDocMain" field="$.title" docType="volume" /><metadata metadata="OtherTitle" field="$.alternativeTitle" docType="volume" /><metadata metadata="CurrentNo" field="$..children.children.sequenceNumber" docType="volume" /><metadata metadata="CurrentNoSorting" field="$..children.children.sequenceNumber" docType="volume" /><person metadata="Author" field="creator" firstname="s/^(.+?)\, (.+?)$/$2/g" lastname="s/^(.+?)\, (.+?)$/$1/g" validationExpression="/^.+?\, .+?\, .+$/" regularExpression="s/^(.+?)\, (.+?)\, .+/$1\, $2/g"/></config></config_plugin>
The configuration file contains four types of fields:
This type is used to recognize the document type of the JSON record
This type is used if no document type was recognized before
This type is used to map JSON fields to metadata
This type is used to map JSON fields to persons
recordType contains the attributes
field a JSONPath expression is specified that is applied to the record. If the type is a multi-volume work or newspaper/magazine, the
anchor type to be used must be specified in the
anchorType field. If a field with such an expression exists, the document type defined in
docType is created. If not, the next configured
recordType will be checked.
There are a number of characters that are masked in this file. This includes characters such as
< > & ", which have a special meaning in XML and must therefore be specified as
< > & ". Also affected is the
comma, which must also be masked as
\, using a backslash.
If none of the definitions apply, a document can be created with the type from
defaultPublicationType. If this field is missing or empty, no record is created instead.
The two fields
person are used to import individual content from the JSON record into the respective metadata. A number of attributes are available for this purpose:
Contains the name of the metadata or person
Path to the content within the JSON object
May have the value
Regular expression, which checks if the found value matches the defined expression. If this is not the case, the value is ignored.
A regular expression to manipulate the value. This is applied after the
A regular expression that determines the first name of a person from the field contents.
A regular expression that determines the last name of a person from the field contents.
When you search for an identifier in Goobi, a request is sent to the configured URL in the background.
According to the configuration described above, this corresponds approximately to the following URL:
If a valid record is found under this URL, it will be searched for the fields defined within
recordType in which the document type should be located. If no fields are defined or they are not found, the type from the configured element
defaultPublicationType is used instead. The required structure element is then created with the determined type.
The configured expressions of the
person are then evaluated in sequence. If data is found with an expression, the corresponding specified metadata is generated.
The following URLs could be of further help for the installation or especially for the configuration of the plugin:
JSONPath Online Evaluator: https://jsonpath.com/
JSONPath Description: https://support.smartbear.com/alertsite/docs/monitors/api/endpoint/jsonpath.html