1.19.1 Main metadata

The main metadata are displayed on the "Bibliographic data" page.

They can be configured as follows:

<metadata>
    <metadataView index="0" label="metadata" url="" condition="">
        <template name="_DEFAULT">
            <metadata label="MD_TITLE" hideIfOnlyMetadataField="true">
                <param type="field" key="MD_TITLE" />
            </metadata>
            <metadata label="MD_AUTHOR" value="MASTERVALUE_WIKINORM" sortField="SORT_NAME" group="true">
                <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="DC" topstructOnly="true">
                <param type="translatedfield" key="DC" />
            </metadata>
            <metadata label="DOCSTRCT_TOP">
                <param type="translatedfield" key="DOCSTRCT_TOP" />
            </metadata>
            <metadata label="DOCSTRCT_SUB" hideIfOnlyMetadataField="true">
                <param type="translatedfield" key="DOCSTRCT_SUB" />
            </metadata>
            <metadata label="URN">
                <param type="field" key="URN" />
            </metadata>
            <metadata label="MD_COPYRIGHT">
                <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">
                <param type="translatedfield" key="MD_LICENSELABELFIELD">
                    <replace condition="-MDNUM_PUBLICRELEASEYEAR:[* TO NOW/YEAR]" regex=".+">MESSAGE_LICENCEINFORMATION</replace>
                </param>
            </metadata>
            <metadata label="DATECREATED">
                <param type="millisfield" key="DATECREATED" />
            </metadata>
            <metadata label="label__citation_style_apa-6th-edition" citationTemplate="apa-6th-edition">
                <param type="citeproc" dest="title" key="MD_TITLE"/>
                <param type="citeproc" dest="author" key="MD_AUTHOR"/>
                <param type="citeproc" dest="publisher" key="MD_PUBLISHER"/>
                <param type="citeproc" dest="placepublish" key="MD_PLACEPUBLISH"/>
                <param type="citeproc" dest="issued" key="MD_YEARPUBLISH"/>
                <param type="citeproc" dest="isbn" key="MD_ISBN"/>
                <param type="field" key="MD_RELATED_RECORD_ID" value="MASTERVALUE_RELATED_RECORD_LINK" condition="PI:{0}"/>
            </metadata>
            <metadata label="MD_RELATIONSHIP_PERSONS" value="LINK_RELATIONSHIPS_PERSONS">
                <param key="MD_PROCESSID" type="field" removeHighlighting="true" />
            </metadata>
            <metadata label="CREATED" value="{0}">
                <param type="datefield" pattern="dd/MM/yyyy" key="MD_DATESTART" />
            </metadata>
        </template>
        <template name="monograph">
            <metadata label="MD_TITLE" >
                <param type="field" key="MD_TITLE" />
            </metadata>
            <metadata label="MD_AUTHOR" value="MASTERVALUE_WIKINORM" group="true">
                <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>
    </metadataView>
    <metadataView index="1" label="label__metadata_special" url="_special" condition="DC:specialcollection">
            <metadata label="MD_SPECIAL" >
                <param type="field" key="MD_SPECIAL" defaultValue="---" />
            </metadata>
    </metadataView>
</metadata>

Any number of <metadataView> elements can be defined. Each element creates an independent metadata page with its own link in the sidebar.

The following attributes are included:

Attribute

Description

index

Order of the view within the listing. Missing values are implicitly set to 0. However, if multiple views are configured, each must have a unique value.

label

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

url

URL pattern for the page. The value is appended as a suffix to the standard /metadata pattern. If several views are configured, a maximum of one element may have an empty value of this attribute, all others require a unique value each.

condition

Optional condition for displaying the link in the sidebar. Allowed are either a Solr field name ("MD_FOO") or a field-value pair ("MD_FOO:bar"), which must have the main element of the opened work.

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

sortField

Here you can optionally define a sortable field (e.g. SORT_VALUE) which can be used to sort multiple values within a grouped metadata field.

type

The value of the type attribute contains the number of the widget 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

citationTemplate

Optional attribute that is only required for the display of citation recommendations. A citation style valid for Citeproc is then specified here.

hideIfOnlyMetadataField

Metadata marked true here are considered dispensable. If there are only metadata fields in a structural element that have this attribute, the entire metadata block for this structural element is hidden. If, on the other hand, at least one metadata field is present that has the attribute value false, the block with all metadata is displayed (metadata with the attribute value true are then also displayed). The default value is false.

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

metadataTab0=Beschreibung
metadataTab1=Inhalt
metadataTab2=Weitere Informationen

Metadata from LIDO events are automatically displayed in additional widgets per event.

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.

  • normdatasearch- A button is rendered which starts a search with the configured index field in key, listing all works with this field:value combination (e.g. NORM_IDENTIFIER).

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

  • millisfield - Formats millisecond timestamps as date (dd.MM.yyyy if locale = DE, otherwise MM/dd/yyyy).

  • citeproc - Indicates that a citation recommendation using Citeproc is to be created.

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.

topstructOnly

If the attribute has the value true, metadata that occurs in all structural elements is only listed for the main record. This is usually the case with the DC field where the collections are stored. Default is false

dest

Is only needed in connection with the type="citeproc" and then specifies where the values from the solr field configured in the key="" attribute should be mapped within Citeproc.

condition

Optionally, a simple Solr query can be defined in condition for the parameter. In this case, the value is only used if the query returns hits. In this case, the placeholder {0} in the query is replaced by the value of the parameter (usually the value of the field in the parameter key). The following example shows the link to another work (with the identifier in MD_RELATED_RECORD_ID) only if this work also exists in the index:

<param type="field" key="MD_RELATED_RECORDID" value="MASTERVALUE_RELATED_RECORD_LINK" condition="PI:{0}" />

removeHighlighting

The search hit highlighting is not applied to the value if the attribute is set to true. This allows you to use this value for URL construction, for example. Default is false

pattern

Only works with the type="datefield". A desired formatting for the date can then be configured (Java-compatible notation). In this case, the configured formatting is applied to valid dates instead of the locale-based formatting. Examples of the pattern are dd/MM/yyyy or dd.MM.yyyy.

defaultValue

If the configured parameter is empty, the value specified in the defaultValue is output. If no defaultValue is specified, the parameter is skipped.

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. The attribute condition can be used to formulate an optional Solr Query. In this case, only metadata of records to which the conditions apply are treated accordingly.

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

<metadata>
    <mainMetadataList>
        <template name="_DEFAULT">
            <metadata label="MD_COPYRIGHT" value="" type="">
                <param type="field" key="MD_COPYRIGHT">
                    <replace string="[year]" condition="DOCSTRCT:monograph">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:

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:

<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>

Multi-level grouped metadata.

If there are grouped metadata in the index, which in turn contain further grouped metadata, further elements can be configured within a element to map them (theoretically arbitrarily deep). In the interface they are visualized as a purple badge.

<metadata label="MD_EVENT" value="MASTERVALUE_EVENT" group="true" singleString="false" labelField="EVENTTYPE" type="3">
    <param type="field" key="EVENTTYPE" value="MASTERVALUE_NULL">
    <param type="field" key="MD_MATERIAL"/>
    <param type="field" key="MD_DESCRIPTION" />
    <metadata label="MD_ARTIST" value="MASTERVALUE_EVENT_ACTOR" singleString="false"  group="true">
        <param type="field" key="MD_NAME" value="MASTERVALUE_EVENT_ACTOR_NAME" />
        <param type="field" key="MD_DISPLAYNAME" />
        <param type="field" key="MD_ROLE" />
        <param type="field" key="MD_STARTDATE" />
        <param type="field" key="MD_ENDDATE" />
        <param type="field" key="MD_URI_GETTY" value="MASTERVALUE_URI_GETTY" />
        <param type="field" key="MD_URI_SIKART" value="MASTERVALUE_URI_SIKART" />
        <param type="normdatauri" key="NORM_URI"/>
    </metadata>
    <metadata label="MD_DESIGNER" value="MASTERVALUE_EVENT_ACTOR" singleString="false"  group="true">
        <param type="field" key="MD_DISPLAYNAME" />
        <param type="field" key="MD_ROLE" />
        <param type="field" key="MD_STARTDATE" />
        <param type="field" key="MD_ENDDATE" />
        <param type="field" key="MD_URI_GETTY" value="MASTERVALUE_URI_GETTY" />
        <param type="field" key="MD_URI_SIKART" value="MASTERVALUE_URI_SIKART" />
        <param type="normdatauri" key="NORM_URI"/>
    </metadata>
</metadata>

The attribute singleString="true" defines that grouped parameters are output via a master value in the messages_XX.properties (as in the examples above). If the attribute is set to false, parameter values are output in tabular form as label/value pairs. Default value is true.

If the heading of the grouped metadata should not be the field name (in the example above the translation of MD_EVENT), but for example the type of the event, the attribute labelField can be used to specify a subordinate field of the grouped metadata from which the heading should be taken (in the example EVENTTYPE). Attention: In this case the selected subfield must also be configured as , otherwise no value can be loaded for it! If the subfield is not to be displayed additionally as a parameter, the reserved attribute value value="MASTERVALUE NULL" can be used to empty the parameter again after its value has been used for the heading.

Last updated