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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis class maps EPO's response metadata needs to extract epo ID. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MetadataFieldConfigprotected MetadataFieldMapping<org.jdom2.Element,MetadataContributor<org.jdom2.Element>> protected String -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor for EpoIdMetadataContributorEpoIdMetadataContributor(String query, Map<String, String> prefixToNamespaceMapping, MetadataFieldConfig field) Initialize EpoIdMetadataContributor with all required fields: a query, prefixToNamespaceMapping and MetadataFieldConfig -
Method Summary
Modifier and TypeMethodDescriptioncontributeMetadata(org.jdom2.Element element) Retrieve the metadata associated with the given object.getField()Return the MetadataFieldConfig used while retrieving MetadatumDTOMetadataFieldMapping<org.jdom2.Element,MetadataContributor<org.jdom2.Element>> Return metadataFieldMappingReturn prefixToNamespaceMappinggetQuery()Return query used to create an xpathExpression on, this query is used tovoidsetField(MetadataFieldConfig field) Setting the MetadataFieldConfigvoidsetMetadataFieldMapping(MetadataFieldMapping<org.jdom2.Element, MetadataContributor<org.jdom2.Element>> metadataFieldMapping) Set the metadataFieldMapping of this SimpleXpathMetadatumContributorvoidsetNeedType(boolean needType) This property will be used in ID definition.voidsetPrefixToNamespaceMapping(Map<String, String> prefixToNamespaceMapping) Set the prefixToNamespaceMapping for this object,voidSetting the query
-
Field Details
-
field
-
metadataFieldMapping
protected MetadataFieldMapping<org.jdom2.Element,MetadataContributor<org.jdom2.Element>> metadataFieldMapping -
prefixToNamespaceMapping
-
query
-
-
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 stringprefixToNamespaceMapping- metadata prefix to namespace mappingfield- 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
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:
setMetadataFieldMappingin interfaceMetadataContributor<org.jdom2.Element>- Parameters:
metadataFieldMapping- the new mapping.
-
setPrefixToNamespaceMapping
Set the prefixToNamespaceMapping for this object,- Parameters:
prefixToNamespaceMapping- the new mapping.
-
getField
Return the MetadataFieldConfig used while retrieving MetadatumDTO- Returns:
- MetadataFieldConfig
-
setField
Setting the MetadataFieldConfig- Parameters:
field- MetadataFieldConfig used while retrieving MetadatumDTO
-
getQuery
Return query used to create an xpathExpression on, this query is used to- Returns:
- the query this instance is based on
-
setQuery
Setting the query- Parameters:
query- query used
-
contributeMetadata
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:
contributeMetadatain interfaceMetadataContributor<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.
-