Class MetadataReader

java.lang.Object
org.dlese.dpc.ndr.reader.NdrObjectReader
org.dlese.dpc.ndr.reader.MetadataReader

public class MetadataReader extends NdrObjectReader
Extension of NdrObjectReader for accessing properties, dataStreams, and relationships of NDR Metadata Objects.

More Info:

  • 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
  • Author:
    ostwald
    • Constructor Details

      • MetadataReader

        public MetadataReader(String handle) throws Exception
        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

        public MetadataReader(String handle, String nativeDataStreamFormat) throws Exception
        Constructor for the MetadataReader object with nativeFormat specified
        Parameters:
        handle - handle to MetadataObject in the NDR
        nativeDataStreamFormat - nativeFormat of the collection to which this metata belongs
        Throws:
        Exception - if handle does not correspond to existing Metatadata object
      • MetadataReader

        public MetadataReader(org.dom4j.Document response) throws Exception
        Constructor for the MetadataReader object
        Parameters:
        response - NOT YET DOCUMENTED
        Throws:
        Exception - NOT YET DOCUMENTED
      • MetadataReader

        public MetadataReader(org.dom4j.Document response, String nativeDataStreamFormat) throws Exception
        Constructor for the MetadataReader object
        Parameters:
        response - NOT YET DOCUMENTED
        nativeDataStreamFormat - NOT YET DOCUMENTED
        Throws:
        Exception - NOT YET DOCUMENTED
    • Method Details

      • getRecordId

        public String 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

        public String getUniqueID()
        Gets the nsdl:uniqueID property of the Metadata object.
        Returns:
        The uniqueID value
      • getItemId

        public String getItemId()
        Gets the nsdl:itemId property of the Metadata object
        Returns:
        The itemId value
      • getStatus

        public String 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

        public org.dom4j.Document getItemRecord() throws Exception
        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

        public org.dom4j.Document getCanonicalNsdlDcItemRecord() throws Exception
        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)