Package org.dlese.dpc.ndr.reader
Class MetadataReader
java.lang.Object
org.dlese.dpc.ndr.reader.NdrObjectReader
org.dlese.dpc.ndr.reader.MetadataReader
Extension of NdrObjectReader for accessing properties, dataStreams, and
relationships of NDR Metadata Objects. Metadata overview: http://wiki.nsdl.org/index.php/Community:NDR/ObjectTypes#Metadata
Metadata data model: http://wiki.nsdl.org/index.php/Community:NCore/Model/Objects/Metadata
Metadata API requests: http://wiki.nsdl.org/index.php/Community:NDR/APIRequestsByObject#Metadata_requests
More Info:
- Author:
- ostwald
-
Field Summary
Fields inherited from class org.dlese.dpc.ndr.reader.NdrObjectReader
createdDate, doc, dsFormats, handle, lastModifiedDate, nativeDataStreamFormat, nsContext, objectType -
Constructor Summary
ConstructorsConstructorDescriptionMetadataReader(String handle) Constructor for the MetadataReader objectMetadataReader(String handle, String nativeDataStreamFormat) Constructor for the MetadataReader object with nativeFormat specifiedMetadataReader(org.dom4j.Document response) Constructor for the MetadataReader objectMetadataReader(org.dom4j.Document response, String nativeDataStreamFormat) Constructor for the MetadataReader object -
Method Summary
Modifier and TypeMethodDescriptionorg.dom4j.DocumentGets the "nsdl_dc" datastream as a dom4j.DocumentbooleanReturns true if the ncs:status property of the Metadata object (which is only present if this object is managed by the NCS) is NCS_FINAL_STATUS.booleanReturns true if the ncs:isValid property of the Metadata object, which is defined only if this object is managed by the NCS, is "true", and false otherwise.Gets the nsdl:itemId property of the Metadata objectorg.dom4j.DocumentGets the native datastream as a dom4j.Document (using the nativeDataStream attribute of this reader).Gets the ncs:recordId property of the Metadata object, which is defined only if this object is managed by the NCS.Gets the ncs:status property of the Metadata object, which is defined only if this object is managed by the NCSGets the nsdl:uniqueID property of the Metadata object.booleanReturns true if this Metadata object is managed by the NCS.protected static voidpp(org.dom4j.Node node) Methods inherited from class org.dlese.dpc.ndr.reader.NdrObjectReader
getCanonicalNsdlDcDataStream, getCreated, getCreatedDate, getDataStream, getDataStream, getDocument, getFormats, getHandle, getLastModified, getLastModifiedDate, getNativeDataStream, getNativeDataStream, getNode, getNodes, getNodeText, getNsContext, getObjectType, getProperty, getPropertyValues, getRelationship, getRelationshipValues, getState, getXPath, initDataStreams, setDebug
-
Constructor Details
-
MetadataReader
Constructor for the MetadataReader object- Parameters:
handle- handle to MetadataObject in the NDR- Throws:
Exception- if handle does not correspond to existing Metatadata object
-
MetadataReader
Constructor for the MetadataReader object with nativeFormat specified- Parameters:
handle- handle to MetadataObject in the NDRnativeDataStreamFormat- nativeFormat of the collection to which this metata belongs- Throws:
Exception- if handle does not correspond to existing Metatadata object
-
MetadataReader
Constructor for the MetadataReader object- Parameters:
response- NOT YET DOCUMENTED- Throws:
Exception- NOT YET DOCUMENTED
-
MetadataReader
Constructor for the MetadataReader object- Parameters:
response- NOT YET DOCUMENTEDnativeDataStreamFormat- NOT YET DOCUMENTED- Throws:
Exception- NOT YET DOCUMENTED
-
-
Method Details
-
getRecordId
Gets the ncs:recordId property of the Metadata object, which is defined only if this object is managed by the NCS.- Returns:
- The recordId value
-
getUniqueID
Gets the nsdl:uniqueID property of the Metadata object.- Returns:
- The uniqueID value
-
getItemId
Gets the nsdl:itemId property of the Metadata object- Returns:
- The itemId value
-
getStatus
Gets the ncs:status property of the Metadata object, which is defined only if this object is managed by the NCS- Returns:
- The status value
-
getIsValid
public boolean getIsValid()Returns true if the ncs:isValid property of the Metadata object, which is defined only if this object is managed by the NCS, is "true", and false otherwise.- Returns:
- The isValid value
-
getIsFinal
public boolean getIsFinal()Returns true if the ncs:status property of the Metadata object (which is only present if this object is managed by the NCS) is NCS_FINAL_STATUS.- Returns:
- The isFinal value
-
isNcsMetadata
public boolean isNcsMetadata()Returns true if this Metadata object is managed by the NCS.- Returns:
- The ncsMetadata value
-
getItemRecord
Gets the native datastream as a dom4j.Document (using the nativeDataStream attribute of this reader).- Returns:
- the native datastream
- Throws:
Exception- if the native datastream could not be read or processed
-
getCanonicalNsdlDcItemRecord
Gets the "nsdl_dc" datastream as a dom4j.Document- Returns:
- The canonicalNsdlDcItemRecord value
- Throws:
Exception- NOT YET DOCUMENTED
-
pp
protected static void pp(org.dom4j.Node node)
-