Sometimes, there are some important necessary derived informations that we want to see. All of these informations can be stored, like normal metadatas, inside new metadata items.

This functionality is provided by ItemEnhancers or MetadataEnhancers.

Functionality Brief

Inside DSpace-CRIS we can define some enhancers to enrich items’ metadatas using the metadata-enahncers.xml file, located inside the spring configuration folder ({dspace-home}config/spring/api).

Here we define the service that reads and enhances / enriches metadatas, ItemEnhancerServiceImpl. Also here are defined all the enhancing rules (defined by declaring beans) that will be applied to the new or edited metadatas.

Each bean should define:

  • class: Defines the logic behind the mapping;

  • sourceEntityType: Item Type to enhance;

  • sourceItemMetadataField: Source field (should contains authority reference);

  • relatedItemMetadataField: Related field (field of the item retrievable using the source field);

  • virtualQualifier: Qualifier of the newly mapped metadata (value behind related field).

The mapping functionality depends on the implementation of the bean (class definition), and actually there are two main implementations:

  • RelatedEntityItemEnhancer;

  • HierarchicalRelatedEntityItemEnhancer.

RelatedEntityItemEnhancer

The purpose of this enhancer is to extract target metadata from a linked entity to the entity itself. Here you should define the entity to enrich (sourceEntityType) and the metadata of the Item that contains a reference to the linked entity (sourceItemMetadataField), so once loaded the linked entity the target relatedItemMetadataField inside it will be mapped into a virtualQualifier metadata of the source item.

This process will be useful when you need to filter or assign some metadatas extractable from the linked entities, and only the necessary metadata will be stored (not the entire item).

HierarchicalRelatedEntityItemEnhancer

As you can tell from its name, this implementation extracts metadatas from linked hierarchical entities.

Like the previous one, you should define the entity to enrich (sourceEntityType) the metadata that contains a reference to a Hierarchical entity (sourceItemMetadataField) and the metadata of the Hierarchy used to traverse it (relatedItemMetadataField).

The hierarchy will be traversed and mapped inside the source item using the vitrualQualifier field, until a void or null value is found.

In this case you will be able to reproduce all the Hierachy of the item, and this information could be very useful to visualize and / or filter for.

  • No labels