Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

See Configurable Workflow for more information on configuring workflows per Collection.


6. Configure Virtual Metadata to display for related Entities (optionally)

"Virtual Metadata" is metadata that is dynamically determined (at the time of access) based on an Entity's relationship to other Entities.  A basic example is displaying a Person Entity's name in the "dc.contributor.author" field of a related Publication Entity.  That "dc.contributor.author" field doesn't actually exist on the Publication, but is dynamically added as "virtual metadata" simply because the Publication is linked to the Person (via a relationship).

Virtual Metadata is configurable for all Entities and all relationships.  DSpace comes with default settings for its default Entity model, and those can be found in [dspace]/config/spring/api/virtual-metadata.xml. In that Spring Bean configuration file, you'll find a map of each relationship type to a metadata field & its value.  Here's a summary of how it works:

  • The "org.dspace.content.virtual.VirtualMetadataPopulator" bean maps every Relationship type (from relationship-types.xml) to a <util:map> definition (of a given ID) also in the virtual-metadata.xml

    Code Block
    <!-- For example, the isAuthorOfPublication relationship is linked to a map of ID "isAuthorOfPublicationMap" -->
    <entry key="isAuthorOfPublication" value-ref="isAuthorOfPublicationMap"/>


  • That <util:map> defintion defines which DSpace metadata field will store the virtual metadata. It also links to the bean which will dynamically define the value of this metadata field.

    Code Block
    <!-- In this example, isAuthorOfPublication will be displayed in the "dc.contributor.author" field -->
    <!-- The *value* of that field will be defined by the "publicationAuthor_author" bean -->
    <util:map id="isAuthorOfPublicationMap">
        <entry key="dc.contributor.author" value-ref="publicationAuthor_author"/>
    </util:map>


  • A bean of that ID then defines the value of the field, based on the related Entity. In this example, these fields are pulled from the related Person entity and concatenated.  If the Person has "person.familyName=Jones" and "person.givenName=Jane", then the value of "dc.contributor.author" on the related Publication will be dynamically set to "Jones, Jane.

    Code Block
     <bean class="org.dspace.content.virtual.Concatenate" id="publicationAuthor_author">
        <property name="fields">
            <util:list>
                <value>person.familyName</value>
                <value>person.givenName</value>
                <value>organization.legalName</value>
            </util:list>
        </property>
        <property name="separator">
            <value>, </value>
        </property>
        <property name="useForPlace" value="true"/>
        <property name="populateWithNameVariant" value="true"/>
    </bean>


If the default Virtual Metadata looks good to you, no changes are needed.  If you make any changes, be sure to restart Tomcat to update the bean definitions.

Designing your own Entity model

...

Configure the model in relationship-types.xml

  • Similar to the default relationship-types.xml, configure a relationship type per connection between 2 entity types
  • Include the 2 entity type names which are being connected.
  • Determine a clear an unambiguous name for the relation in both directions
  • Optionally: determine the cardinality (min/max occurrences) for the relationships
  • Optionally: determine default behavior for copying metadata if the relationship is deleted

...

...