Class NldrMetadataRecordExporter

java.lang.Object
org.dlese.dpc.xml.nldr.NldrMetadataRecordExporter
Direct Known Subclasses:
OsmRecordExporter

public abstract class NldrMetadataRecordExporter extends Object
Reads XML records and converts to an exported form (i.e., "containing citableUrls"). NLDR metadata records may involve mulitple-namespaces and may conttain "assets" (primary content in the NLDR).
Author:
Jonathan Ostwald
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor that loads the given record.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract List
    Gets the assetNodes attribute of the NldrMetadataRecord object
    protected static final String
    Return a string for the current time and date, sutiable for display in log files and output to standout:
    abstract String
    Gets the id attribute of the NldrMetadataRecord object
    Gets the textAtPath attribute of the NldrMetadataRecord object
    Gets the xml attribute of the NldrMetadataRecord object
    org.dom4j.Node
    Gets the xmlNode attribute of the NldrMetadataRecord object
    Gets the xml stripped of the XML declaration and DTD declaration.
    static String
    Expands xpath into namespace-aware version, hanlding attributes and attribute/value specifiers.
    protected static final void
    pp(org.dom4j.Node node)
    Description of the Method
    protected final void
    Output a line of text to error out, with datestamp.
    Select Nodes for provided xpath
    org.dom4j.Node
    Select Single node for provided xpath
    static void
    setDebug(boolean db)
    Sets the debug attribute of the object
    void
    setTextAtPath(String xpath, String value)
    Sets the textAtPath attribute of the NldrMetadataRecord object
    Get a String representation of this XML.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • NldrMetadataRecordExporter

      public NldrMetadataRecordExporter(String xml) throws org.dom4j.DocumentException
      Constructor that loads the given record. No validation is performed.
      Parameters:
      xml - The XML to start with
      Throws:
      org.dom4j.DocumentException - If error parsing the XML
  • Method Details

    • getId

      public abstract String getId()
      Gets the id attribute of the NldrMetadataRecord object
      Returns:
      The id value
    • getAssetNodes

      public abstract List getAssetNodes()
      Gets the assetNodes attribute of the NldrMetadataRecord object
      Returns:
      The assetNodes value
    • getTextAtPath

      public String getTextAtPath(String path)
      Gets the textAtPath attribute of the NldrMetadataRecord object
      Parameters:
      path - NOT YET DOCUMENTED
      Returns:
      The textAtPath value
    • setTextAtPath

      public void setTextAtPath(String xpath, String value)
      Sets the textAtPath attribute of the NldrMetadataRecord object
      Parameters:
      xpath - xpath of element
      value - text to set
    • selectNodes

      public List selectNodes(String xpath)
      Select Nodes for provided xpath
      Parameters:
      xpath - xpath
      Returns:
      list of selected nodes
    • selectSingleNode

      public org.dom4j.Node selectSingleNode(String xpath)
      Select Single node for provided xpath
      Parameters:
      xpath - xpath
      Returns:
      NOT YET DOCUMENTED
    • makeXPath

      public static String makeXPath(String s)
      Expands xpath into namespace-aware version, hanlding attributes and attribute/value specifiers.

      /record/relation
      /*[local-name()='record']/*[local-name()='relation'
      //relation/@type
      //*[local-name()='relation']/@type
      /record/relation[@type='Has part']
      /*[local-name()='record']/*[local-name()='relation'][@type='Has part']
      Parameters:
      s - xpath as a qualifed string
      Returns:
      namespace aware xpath
    • getXmlNode

      public org.dom4j.Node getXmlNode()
      Gets the xmlNode attribute of the NldrMetadataRecord object
      Returns:
      The xmlNode value
    • getXml

      public String getXml()
      Gets the xml attribute of the NldrMetadataRecord object
      Returns:
      The xml value
    • getXmlStripped

      public String getXmlStripped()
      Gets the xml stripped of the XML declaration and DTD declaration.
      Returns:
      The xml value
    • toString

      public String toString()
      Get a String representation of this XML.
      Overrides:
      toString in class Object
      Returns:
      The XML string
    • getDateStamp

      protected static final String getDateStamp()
      Return a string for the current time and date, sutiable for display in log files and output to standout:
      Returns:
      The dateStamp value
    • pp

      protected static final void pp(org.dom4j.Node node)
      Description of the Method
      Parameters:
      node - Description of the Parameter
    • prtlnErr

      protected final void prtlnErr(String s)
      Output a line of text to error out, with datestamp.
      Parameters:
      s - The text that will be output to error out.
    • setDebug

      public static void setDebug(boolean db)
      Sets the debug attribute of the object
      Parameters:
      db - The new debug value