Class ReplaceCharacterXPathMetadataContributor

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

public class ReplaceCharacterXPathMetadataContributor extends SimpleXpathMetadatumContributor
This contributor replace specific character in the metadata value. It is useful for some provider (e.g. Scopus) which use containing "/" character. Actually, "/" will never encode by framework in URL building. In the same ways, if we encode "/" -> %2F, it will be encoded by framework and become %252F.
Author:
Boychuk Mykhaylo (boychuk.mykhaylo at 4science.com)
  • Constructor Details

    • ReplaceCharacterXPathMetadataContributor

      public ReplaceCharacterXPathMetadataContributor()
  • Method Details

    • contributeMetadata

      public Collection<MetadatumDTO> contributeMetadata(org.jdom2.Element element)
      Description copied from class: SimpleXpathMetadatumContributor
      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>
      Overrides:
      contributeMetadata in class SimpleXpathMetadatumContributor
      Parameters:
      element - An element to retrieve metadata from.
      Returns:
      a collection of import records. Only the identifier of the found records may be put in the record.
    • setCharacterToBeReplaced

      public void setCharacterToBeReplaced(int characterToBeReplaced)
    • setCharacterToReplaceWith

      public void setCharacterToReplaceWith(int characterToReplaceWith)