DLESE Tools
v1.6.0

org.dlese.dpc.ndr.reader
Class MetadataReader

java.lang.Object
  extended by org.dlese.dpc.ndr.reader.NdrObjectReader
      extended by 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

    Field Summary
     
    Fields inherited from class org.dlese.dpc.ndr.reader.NdrObjectReader
    createdDate, doc, dsFormats, handle, lastModifiedDate, nativeDataStreamFormat, nsContext, objectType
     
    Constructor Summary
    MetadataReader(Document response)
              Constructor for the MetadataReader object
    MetadataReader(Document response, String nativeDataStreamFormat)
              Constructor for the MetadataReader object
    MetadataReader(String handle)
              Constructor for the MetadataReader object
    MetadataReader(String handle, String nativeDataStreamFormat)
              Constructor for the MetadataReader object with nativeFormat specified
     
    Method Summary
     Document getCanonicalNsdlDcItemRecord()
              Gets the "nsdl_dc" datastream as a dom4j.Document
     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.
     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.
     String getItemId()
              Gets the nsdl:itemId property of the Metadata object
     Document getItemRecord()
              Gets the native datastream as a dom4j.Document (using the nativeDataStream attribute of this reader).
     String getRecordId()
              Gets the ncs:recordId property of the Metadata object, which is defined only if this object is managed by the NCS.
     String getStatus()
              Gets the ncs:status property of the Metadata object, which is defined only if this object is managed by the NCS
     String getUniqueID()
              Gets the nsdl:uniqueID property of the Metadata object.
     boolean isNcsMetadata()
              Returns true if this Metadata object is managed by the NCS.
    protected static void pp(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
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    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(Document response)
                   throws Exception
    Constructor for the MetadataReader object

    Parameters:
    response - NOT YET DOCUMENTED
    Throws:
    Exception - NOT YET DOCUMENTED

    MetadataReader

    public MetadataReader(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 Detail

    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 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 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(Node node)

    DLESE Tools
    v1.6.0