public abstract class DataCiteMetadataFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ABSTRACT |
static java.lang.String |
CREATOR |
static java.lang.String |
CREATORNAME |
static java.lang.String |
CREATORS |
static java.lang.String |
DESCRIPTIONS |
static java.lang.String |
DOI |
static java.lang.String |
EN |
static java.lang.String |
FORMATS |
protected static java.lang.String |
INVALIDCODE |
static java.lang.String |
NAMESPACE |
static java.lang.String |
RESOURCE |
static java.lang.String |
SCHEMALOCATION |
static java.lang.String |
SUBJECTS |
static java.lang.String |
TITLES |
static java.lang.String |
XML_LANG |
protected static javax.xml.xpath.XPath |
xpath |
Constructor and Description |
---|
DataCiteMetadataFactory() |
Modifier and Type | Method and Description |
---|---|
protected org.w3c.dom.Document |
addIdentifier(org.w3c.dom.Document doc,
java.lang.String identifier,
java.lang.String scheme)
Add the identifier element to the root document.
|
protected org.w3c.dom.Document |
addLanguage(org.w3c.dom.Document doc,
java.lang.String language)
Append a subject to the document.
|
protected org.w3c.dom.Document |
addPublicationYear(org.w3c.dom.Document doc,
java.lang.String publicationYear)
Add the publication year node
|
protected org.w3c.dom.Document |
addPublisher(org.w3c.dom.Document doc,
java.lang.String publisher)
Add the publisher node
|
protected org.w3c.dom.Document |
addResourceType(org.w3c.dom.Document doc,
java.lang.String resourceTypeGeneral,
java.lang.String resourceType)
Add the resource type to the document
|
protected org.w3c.dom.Document |
addVersion(org.w3c.dom.Document doc,
java.lang.String version)
Add the version element to the document
|
protected org.w3c.dom.Document |
appendCreator(java.lang.String creatorName,
org.w3c.dom.Document doc,
java.lang.String affiliation,
java.lang.String nameIdentifier,
java.lang.String nameIdentifierSchemeURI,
java.lang.String nameIdentifierScheme)
Append a creator element to the root element.
|
protected org.w3c.dom.Document |
appendDescription(java.lang.String description,
org.w3c.dom.Document doc,
java.lang.String language,
java.lang.String descriptionType)
Append a description to the document.
|
protected org.w3c.dom.Document |
appendFormat(org.w3c.dom.Document doc,
java.lang.String format)
Add the format (MIME type) of the meta data object to the document
|
protected org.w3c.dom.Document |
appendSubject(java.lang.String subject,
org.w3c.dom.Document doc,
java.lang.String language)
Append a subject to the document
|
org.w3c.dom.Document |
appendTitle(java.lang.String title,
org.w3c.dom.Document doc,
java.lang.String language)
Append a title to the title list element
|
abstract boolean |
canProcess(java.lang.String namespace)
Determine if the factory can handle the meta data with the given name space
|
abstract java.lang.String |
generateMetadata(org.dataone.service.types.v1.Identifier identifier,
org.dataone.service.types.v2.SystemMetadata sysmeta)
Method to generate the datacite meta data xml string for an object with the given system meta data.
|
protected org.w3c.dom.Document |
generateROOTDoc()
Generate the blank DOM document for the datacite name space
|
static java.lang.String |
lookupFormat(org.dataone.service.types.v2.SystemMetadata sysMeta)
Figure out the format (mime type) of the data object
|
protected java.lang.String |
removeIdSchemePrefix(java.lang.String id,
java.lang.String scheme)
Remove the sheme prefix for a given id.
|
protected java.lang.String |
serializeDoc(org.w3c.dom.Document doc)
Serialize the given doc object to a string
|
public static final java.lang.String EN
public static final java.lang.String XML_LANG
public static final java.lang.String NAMESPACE
public static final java.lang.String SCHEMALOCATION
public static final java.lang.String RESOURCE
public static final java.lang.String CREATORS
public static final java.lang.String CREATOR
public static final java.lang.String CREATORNAME
public static final java.lang.String TITLES
public static final java.lang.String SUBJECTS
public static final java.lang.String DESCRIPTIONS
public static final java.lang.String FORMATS
public static final java.lang.String DOI
public static final java.lang.String ABSTRACT
protected static final java.lang.String INVALIDCODE
protected static javax.xml.xpath.XPath xpath
public abstract java.lang.String generateMetadata(org.dataone.service.types.v1.Identifier identifier, org.dataone.service.types.v2.SystemMetadata sysmeta) throws org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.ServiceFailure
sysmeta
- the system meta data information of an given objectorg.dataone.service.exceptions.InvalidRequest
org.dataone.service.exceptions.ServiceFailure
public abstract boolean canProcess(java.lang.String namespace)
namespace
- the name space of the meta dataprotected org.w3c.dom.Document generateROOTDoc() throws java.lang.Exception
java.lang.Exception
protected org.w3c.dom.Document addIdentifier(org.w3c.dom.Document doc, java.lang.String identifier, java.lang.String scheme) throws org.dataone.service.exceptions.InvalidRequest
doc
- identifier
- org.dataone.service.exceptions.InvalidRequest
protected org.w3c.dom.Document appendCreator(java.lang.String creatorName, org.w3c.dom.Document doc, java.lang.String affiliation, java.lang.String nameIdentifier, java.lang.String nameIdentifierSchemeURI, java.lang.String nameIdentifierScheme) throws javax.xml.xpath.XPathExpressionException
creatorName
- the name of the creator. If it is a person, it should be this format - lastName, firstName.doc
- nameIdentifier
- the value of the name identifier, e.g., 0000-0003-0003-2515nameIdentifierSchemeURI
- the URI of the name identifier scheme, e.g., http://orcid.org/nameIdentifierScheme
- the name of the name identifier scheme, e.g., ORCIDaffilication
- the affiliation the creator associates withjavax.xml.xpath.XPathExpressionException
public org.w3c.dom.Document appendTitle(java.lang.String title, org.w3c.dom.Document doc, java.lang.String language) throws javax.xml.xpath.XPathExpressionException
doc
- the document which will be modifiedtitle
- the title will be appendedlanguage
- the language which the tile uses. This method will transform the language to the ISO 639 two-letter code. If it is null, EN will be usedjavax.xml.xpath.XPathExpressionException
protected org.w3c.dom.Document addPublisher(org.w3c.dom.Document doc, java.lang.String publisher) throws org.dataone.service.exceptions.InvalidRequest
doc
- the doc needs to be modifiedpublisher
- the publisher will be addedorg.dataone.service.exceptions.InvalidRequest
protected org.w3c.dom.Document addPublicationYear(org.w3c.dom.Document doc, java.lang.String publicationYear) throws org.dataone.service.exceptions.InvalidRequest
doc
- the doc needs to be modifiedpublicationYear
- the publication year will be addedorg.dataone.service.exceptions.InvalidRequest
protected org.w3c.dom.Document appendSubject(java.lang.String subject, org.w3c.dom.Document doc, java.lang.String language) throws javax.xml.xpath.XPathExpressionException
subject
- the subject will be appendeddoc
- the document will be modifiedlanguage
- the language which the subject is using. This method will transform the language string to the ISO 639 two-letter code. If it is null, EN will be used.javax.xml.xpath.XPathExpressionException
protected org.w3c.dom.Document addLanguage(org.w3c.dom.Document doc, java.lang.String language)
doc
- the document object will be modifiedlanguage
- the language is used in the meta data. This method will transform the language string to the ISO 639 two-letter code.protected org.w3c.dom.Document addResourceType(org.w3c.dom.Document doc, java.lang.String resourceTypeGeneral, java.lang.String resourceType)
doc
- the document object will be modifiedresourceType
- it should be one of those options:
"Audiovisual"
"Collection"
"Dataset"
"Event"
"Image"
"InteractiveResource"
"Model"
"PhysicalObject"
"Service"
"Software
"Sound"
"Text"
"Workflow"
"Other"protected org.w3c.dom.Document appendFormat(org.w3c.dom.Document doc, java.lang.String format) throws javax.xml.xpath.XPathExpressionException
doc
- the document object will be modifiedformat
- the format of the meta data objectjavax.xml.xpath.XPathExpressionException
protected org.w3c.dom.Document addVersion(org.w3c.dom.Document doc, java.lang.String version)
doc
- the document object will be modifiedversion
- the value of the versionprotected org.w3c.dom.Document appendDescription(java.lang.String description, org.w3c.dom.Document doc, java.lang.String language, java.lang.String descriptionType) throws javax.xml.xpath.XPathExpressionException
description
- the value of the descriptiondoc
- the document object will be modifiedlanguage
- the language is used in the descriptiondescriptionType
- the type of the description. It only can be the these options:
"Abstract"
"Methods"
"SeriesInformation"
"TableOfContents"
"Other"javax.xml.xpath.XPathExpressionException
protected java.lang.String serializeDoc(org.w3c.dom.Document doc)
doc
- public static java.lang.String lookupFormat(org.dataone.service.types.v2.SystemMetadata sysMeta)
sysMeta
- protected java.lang.String removeIdSchemePrefix(java.lang.String id, java.lang.String scheme)
id
- scheme
- Copyright © 2023 Regents of the University of California. All Rights Reserved.