Class EpoIdMetadataContributor

java.lang.Object
org.dspace.importer.external.metadatamapping.contributor.EpoIdMetadataContributor
All Implemented Interfaces:
MetadataContributor<org.jdom2.Element>

public class EpoIdMetadataContributor extends Object implements MetadataContributor<org.jdom2.Element>
Custom MetadataContributor to manage Epo ID. Need as input <publication-reference> element and all children.
Author:
Pasquale Cavallo
  • Field Details

  • Constructor Details

    • EpoIdMetadataContributor

      public EpoIdMetadataContributor(String query, Map<String,String> prefixToNamespaceMapping, MetadataFieldConfig field)
      Initialize EpoIdMetadataContributor with all required fields: a query, prefixToNamespaceMapping and MetadataFieldConfig
      Parameters:
      query - query string
      prefixToNamespaceMapping - metadata prefix to namespace mapping
      field - MetadataFieldConfig
    • EpoIdMetadataContributor

      public EpoIdMetadataContributor()
      Empty constructor for EpoIdMetadataContributor
  • Method Details

    • setNeedType

      public void setNeedType(boolean needType)
      This property will be used in ID definition. If this is true, id will be in the form docType:EpoID, otherwise EpoID will be returned
      Parameters:
      needType - if true, docType will be included in id definition
    • getPrefixToNamespaceMapping

      public Map<String,String> getPrefixToNamespaceMapping()
      Return prefixToNamespaceMapping
      Returns:
      a prefixToNamespaceMapping map
    • getMetadataFieldMapping

      public MetadataFieldMapping<org.jdom2.Element,MetadataContributor<org.jdom2.Element>> getMetadataFieldMapping()
      Return metadataFieldMapping
      Returns:
      MetadataFieldMapping
    • setMetadataFieldMapping

      public void setMetadataFieldMapping(MetadataFieldMapping<org.jdom2.Element,MetadataContributor<org.jdom2.Element>> metadataFieldMapping)
      Set the metadataFieldMapping of this SimpleXpathMetadatumContributor
      Specified by:
      setMetadataFieldMapping in interface MetadataContributor<org.jdom2.Element>
      Parameters:
      metadataFieldMapping - the new mapping.
    • setPrefixToNamespaceMapping

      public void setPrefixToNamespaceMapping(Map<String,String> prefixToNamespaceMapping)
      Set the prefixToNamespaceMapping for this object,
      Parameters:
      prefixToNamespaceMapping - the new mapping.
    • getField

      public MetadataFieldConfig getField()
      Return the MetadataFieldConfig used while retrieving MetadatumDTO
      Returns:
      MetadataFieldConfig
    • setField

      @Autowired(required=true) public void setField(MetadataFieldConfig field)
      Setting the MetadataFieldConfig
      Parameters:
      field - MetadataFieldConfig used while retrieving MetadatumDTO
    • getQuery

      public String getQuery()
      Return query used to create an xpathExpression on, this query is used to
      Returns:
      the query this instance is based on
    • setQuery

      @Autowired(required=true) public void setQuery(String query)
      Setting the query
      Parameters:
      query - query used
    • contributeMetadata

      public Collection<MetadatumDTO> contributeMetadata(org.jdom2.Element element)
      Retrieve the metadata associated with the given object. Depending on the retrieved node (using the query), different types of values will be added to the MetadatumDTO list
      Specified by:
      contributeMetadata in interface MetadataContributor<org.jdom2.Element>
      Parameters:
      element - A class to retrieve metadata from.
      Returns:
      a collection of import records. Only the identifier of the found records may be put in the record.