2.19.1 Main metadata

The list of main metadata (i.e. metadata displayed on the Bibliographic Data page) can be configured as follows:

config_viewer.xml
<metadata>
<mainMetadataList>
<template name="_DEFAULT">
<metadata label="MD_TITLE" value="" type="">
<param type="field" key="MD_TITLE" />
</metadata>
<metadata label="MD_AUTHOR" value="MASTERVALUE_WIKINORM" group="true" type="" >
<param type="field" key="MD_VALUE" />
<param type="wikifield" key="MD_VALUE" />
<param type="normdatauri" key="NORM_URI" />
<param type="normdatasearch" key="NORM_IDENTIFIER" />
</metadata>
<metadata label="URN " value="" type="">
<param type="field" key="URN" />
</metadata>
<metadata label="MD_COPYRIGHT" value="" type="">
<param type="field" key="MD_COPYRIGHT">
<replace string="[year]">2019</replace>
<replace char="X">Y</replace>
<replace regex="..."></replace>
</param>
</metadata>
<metadata label="MD_LICENSELABELFIELD" value="" type="">
<param type="translatedfield" key="MD_LICENSELABELFIELD">
<replace condition="-MDNUM_PUBLICRELEASEYEAR:[* TO NOW/YEAR]" regex=".+">MESSAGE_LICENCEINFORMATION</replace>
</param>
</metadata>
</template>
<template name="monograph">
<metadata label="MD_TITLE" value="" type="">
<param type="field" key="MD_TITLE" />
</metadata>
<metadata label="MD_AUTHOR" value="MASTERVALUE_WIKINORM" group="true" type="" >
<param type="field" key="MD_VALUE" />
<param type="wikifield" key="MD_VALUE" />
<param type="normdatauri" key="NORM_URI" />
<param type="normdatasearch" key="NORM_IDENTIFIER" />
</metadata>
</template>
</mainMetadataList>
</metadata>

Depending on the structure type displayed, different configurations can be used here. The configurations are placed in an element <template>. In the above example, a separate metadata list is configured for the structure type monograph.

Metadata for LIDO events are also configured via this list. Desired event metadata must also be listed here.

Each element <metadata> describes a metadata field that is to be displayed. The order of the listing corresponds to the order in which this metadata (if available) is displayed. The element has the following attributes:

Attribute

Description

label

The key for the name of this metadata field (the translation for this key must be available in the respective messages.properties)

value

Default value of the metadata. For example, this value can be a URL defined in messages.properties that contains placeholders that are replaced by actual values from the metadata (see the configuration of MD_AUTHOR in the above example). For simple metadata, this attribute should be left empty (see the configuration of MD_TITLE in the above example).

type

The value of the type attribute contains the number of the tab or block in which the metadata is to be displayed (starting with 0). If this attribute is missing, the value 0 is automatically used.

group

Optional attribute that indicates whether it is a grouped metadata. Default is false.

Titles for the individual tabs are configured in messages_*.properties according to the pattern metadataTab<Number>:

messages_de.properties
metadataTab0=Beschreibung
metadataTab1=Inhalt
metadataTab2=Weitere Informationen

Metadata of events (only from LIDO records) are displayed in the museum view as additional tabs behind the regular metadata tabs.

Bibliographic data

Each <metadata> element must contain at least one element <param>. These define the source of the actual values for this metadata type. The following attributes must be configured:

Attribute

Description

type

The type of the value describes the way whether and how the value is handled. Possible types are:

  • field- The value is taken over as it is.

  • translatedfield- The value is translated into the current language, if a translation exists.

  • unescapedfield- no HTML unescaping is performed on the value

  • wikifield- Adjusts the value of a search query in Wikipedia: brackets are removed, spaces are replaced by underscores

  • wikipersonfield- Like wikifield, but if the value contains a comma, the strings before and after the comma are also swapped, so that person names are converted to the pattern first name_last name for correct Wikipedia resolving.

  • urlescapedfield- Here, characters encoded especially for URLs such as the slash

  • normdatauri- A button is rendered which retrieves and opens the authority data using the authority data URI contained here.

  • hierarchicalfield - Creates a link for each hierarchy level. Intended for use with the Solr field DC.

  • A button is rendered, which can be used with the configured index field in key a search will start, which will list all records with this field lists a combination of values (for example, NORM_IDENTIFIER).

key

The field in the Solr Index that contains the desired value.

prefix

Character string that is immediately after the value of the metadata (spaces are coded with SPACE).

suffix

Character string that is immediately before the value of the metadata (spaces are coded with SPACE).

value

The attribute value in <param> optionally offers the possibility to define a Master Value (character string or Message Key) for the respective parameter, in which the value of the parameter is inserted (e.g. value="foo {0} bar"). The entire expression is then inserted into the respective placeholder of the master value of the entire metadata (if the parameter has the index 0, the entire expression is inserted into the placeholder {0} of the metadata). If a value attribute is defined, any prefix and suffix parameters set are ignored.

Example:

<metadata label="MD_LOREMIPSUM" value="LOREMIPSUM_MASTER_KEY">

<param type="field" key="MD_LOREM" value="LOREM_MSG_KEY" />

<param type="field" key="MD_DOLOR" />

</metadata>

messages_de.properties:

MD_LOREMIPSUM=LI

LOREMIPSUM_MASTER_KEY={0} ipsum {1} sit amet.

LOREM_MSG_KEY=<a href="https://example.com/?search={0}>{0}</a>

Output:

LI: Lorem ipsum dolor sit amet.

Below an <param> element, <replace /> rules can be defined. The attributes string, char or regex can be used to define values that are extracted from the metadata and then replaced by the value specified in the replace block.

In the following example, the placeholder string [year] is searched for in the metadata from the field MDRIGHT and replaced by 2019:

config_viewer.xml
<metadata>
<mainMetadataList>
<template name="_DEFAULT">
<metadata label="MD_COPYRIGHT" value="" type="">
<param type="field" key="MD_COPYRIGHT">
<replace string="[year]">2019</replace>
</param>
</metadata>
</template>
</mainMetadataList>
</metadata>

The order of the <param> elements corresponds to the order in which the placeholders in the default value (if configured) are replaced.

Example:

messages_de.properties
MASTERVALUE_WIKINORM={1} <a href\="http\://de.wikipedia.org/wiki/{3}" target\="_blank" title\="Wikipedia" alt\="Wikipedia" data-trigger\="hover" data-placement\="top" data-toggle\="tooltip"><i class\="fa fa-wikipedia-w" aria-hidden\="true"></i></a> {5}

The key MASTERVALUE_WIKINORM contains a complete HTML fragment with a Wikipedia URL, which contains two placeholders {1} and {3}. At the end the placeholder for the automatically generated link to GND is configured.

The metadata configuration for MD_AUTHOR (see first example) contains three <param> elements: a field, wikifield and normdatauri. The unchanged value in field replaces {1} (the displayed name). The same value as wikifield is formatted for Wikipedia conformance and replaces {2} (part of the URL). The result then consists of the author's name followed by a Wikipedia icon linking to the following URL:

http://en.wikipedia.org/wiki/Georges_Grosjean

The parameters are defined with {0}, {1}, ... is addressed. However, if group="true" is set, they are {1}, {3}, ...

Optionally, a condition can be specified to replace metadata values. This makes it possible, for example, if a work is publicly restricted with a moving wall but can be viewed internally at a reading place, to display an alternative license for the period of the moving wall. The syntax of the condition here is the same Solr syntax that can be used as a condition when defining licenses:

config_viewer.xml
<metadata>
<mainMetadataList>
<template name="_DEFAULT">
<metadata label="MD_LICENSELABELFIELD" value="" type="">
<param type="translatedfield" key="MD_LICENSELABELFIELD">
<replace condition="-MDNUM_PUBLICRELEASEYEAR:[* TO NOW/YEAR]" regex=".+">MESSAGE_LICENCEINFORMATION</replace>
</param>
</metadata>
</template>
</mainMetadataList>
</metadata>