Package org.dspace.content
Class RelationshipMetadataServiceImpl
- java.lang.Object
-
- org.dspace.content.RelationshipMetadataServiceImpl
-
- All Implemented Interfaces:
RelationshipMetadataService
public class RelationshipMetadataServiceImpl extends Object implements RelationshipMetadataService
-
-
Field Summary
Fields Modifier and Type Field Description protected ItemServiceitemServiceprotected MetadataFieldServicemetadataFieldServiceprotected RelationshipServicerelationshipServiceprotected RelationshipTypeServicerelationshipTypeServiceprotected VirtualMetadataPopulatorvirtualMetadataPopulator
-
Constructor Summary
Constructors Constructor Description RelationshipMetadataServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected List<RelationshipMetadataValue>constructLatestForDiscoveryMetadataValues(Context context, String schema, String element, String qualifier, List<ItemUuidAndRelationshipId> data)Turn the given data into a list of relation.*.latestForDiscovery virtual metadata values.protected List<RelationshipMetadataValue>findLatestForDiscoveryMetadataValues(Context context, Item item, EntityType itemEntityType)Create the list of relation.*.latestForDiscovery virtual metadata values for the given item.List<RelationshipMetadataValue>findRelationshipMetadataValueForItemRelationship(Context context, Item item, String entityType, Relationship relationship, boolean enableVirtualMetadata)Retrieves the list of RelationshipMetadataValue objects specific to only one Relationship of the item.StringgetEntityTypeStringFromMetadata(Item item)Deprecated.List<RelationshipMetadataValue>getRelationshipMetadata(Item item, boolean enableVirtualMetadata)This method retrieves a list of MetadataValue objects that get constructed from processing the given Item's Relationships through the config given to theVirtualMetadataPopulator
-
-
-
Field Detail
-
relationshipService
@Autowired(required=true) protected RelationshipService relationshipService
-
relationshipTypeService
@Autowired(required=true) protected RelationshipTypeService relationshipTypeService
-
itemService
@Autowired(required=true) protected ItemService itemService
-
virtualMetadataPopulator
@Autowired(required=true) protected VirtualMetadataPopulator virtualMetadataPopulator
-
metadataFieldService
@Autowired(required=true) protected MetadataFieldService metadataFieldService
-
-
Method Detail
-
getRelationshipMetadata
public List<RelationshipMetadataValue> getRelationshipMetadata(Item item, boolean enableVirtualMetadata)
Description copied from interface:RelationshipMetadataServiceThis method retrieves a list of MetadataValue objects that get constructed from processing the given Item's Relationships through the config given to theVirtualMetadataPopulator- Specified by:
getRelationshipMetadatain interfaceRelationshipMetadataService- Parameters:
item- The Item that will be processed through it's RelationshipsenableVirtualMetadata- This parameter will determine whether the list of Relationship metadata should be populated with metadata that is being generated through the VirtualMetadataPopulator functionality or not- Returns:
- The list of MetadataValue objects constructed through the Relationships
-
findLatestForDiscoveryMetadataValues
protected List<RelationshipMetadataValue> findLatestForDiscoveryMetadataValues(Context context, Item item, EntityType itemEntityType) throws SQLException
Create the list of relation.*.latestForDiscovery virtual metadata values for the given item.- Parameters:
context- the DSpace context.item- the item.itemEntityType- the entity type of the item.- Returns:
- a list (may be empty) of metadata values of type relation.*.latestForDiscovery.
- Throws:
SQLException
-
constructLatestForDiscoveryMetadataValues
protected List<RelationshipMetadataValue> constructLatestForDiscoveryMetadataValues(Context context, String schema, String element, String qualifier, List<ItemUuidAndRelationshipId> data)
Turn the given data into a list of relation.*.latestForDiscovery virtual metadata values.- Parameters:
context- the DSpace context.schema- the schema for all metadata values.element- the element for all metadata values.qualifier- the qualifier for all metadata values.data- a POJO containing the item uuid and relationship id.- Returns:
- a list (may be empty) of metadata values of type relation.*.latestForDiscovery.
-
getEntityTypeStringFromMetadata
@Deprecated public String getEntityTypeStringFromMetadata(Item item)
Deprecated.Description copied from interface:RelationshipMetadataServiceThis method will retrieve the EntityType String from an item- Specified by:
getEntityTypeStringFromMetadatain interfaceRelationshipMetadataService- Parameters:
item- The Item for which the entityType String will be returned- Returns:
- A String value indicating the entityType
-
findRelationshipMetadataValueForItemRelationship
public List<RelationshipMetadataValue> findRelationshipMetadataValueForItemRelationship(Context context, Item item, String entityType, Relationship relationship, boolean enableVirtualMetadata) throws SQLException
Description copied from interface:RelationshipMetadataServiceRetrieves the list of RelationshipMetadataValue objects specific to only one Relationship of the item. This method processes one Relationship of an Item and will return a list of RelationshipMetadataValue objects that are generated for this specific relationship for the item through the config in VirtualMetadataPopulator It returns a combination of the output of the findVirtualMetadataFromConfiguration method and the getRelationMetadataFromOtherItem method.- Specified by:
findRelationshipMetadataValueForItemRelationshipin interfaceRelationshipMetadataService- Parameters:
context- The contextitem- The item whose virtual metadata is requestedentityType- The entity type of the given itemrelationship- The relationship whose virtual metadata is requestedenableVirtualMetadata- Determines whether the VirtualMetadataPopulator should be used. If false, only the relation."relationname" metadata is populated If true, fields from the spring config virtual metadata is included as well- Returns:
- The list of virtual metadata values
- Throws:
SQLException
-
-