Class CritdatesMetadataHandler

java.lang.Object
org.iirds.dita.ot.plugin.contrib.CritdatesMetadataHandler
All Implemented Interfaces:
IirdsMetadataHandler

public class CritdatesMetadataHandler extends Object implements IirdsMetadataHandler
Metadata handler that extracts iiRDS metadata from <critdates> elements of maps and topics. The expiry value is taken from <created> and might be overridden by the latest <revised> element when present. The golive value is taken from <created> element and might be overridden by the latest <revised> element when present.

When golive or expiry has been found, a ContentLifeCycleStatus resource carrying the dates with status Released is added to the information unit when generating the iiRDS model. The dateOfStatus is set to the date of the latest <revised> element when present.

Author:
Martin Kreutzer, Empolis Information Management GmbH
  • Field Details

  • Constructor Details

    • CritdatesMetadataHandler

      public CritdatesMetadataHandler()
  • Method Details

    • getName

      public String getName()
      Description copied from interface: IirdsMetadataHandler
      The name this metadata handler can be activated by from the dita command via parameters
      Specified by:
      getName in interface IirdsMetadataHandler
      Returns:
      the unique name, should be short and comprehensible to users of the DITA OT.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • reformatDate

      public String reformatDate(String date)
      Tries to parse a date string with difference formats
      Parameters:
      date - the date string to parse
      Returns:
      the parse and reformat date in format yyyy-MM-dd or null, when the date is not reformatable
    • extractMetadata

      public void extractMetadata(ToCNode node, Document document)
      Description copied from interface: IirdsMetadataHandler
      Extract metadata from an XML DOM of a topic or map. Implementations should store the extracted metadata via ToCNode.setProperty(String, Object). The key of the property should reflect the element / attribute where the metadata come form in order to achieve unique keys for the properties.
      Specified by:
      extractMetadata in interface IirdsMetadataHandler
      Parameters:
      node - the ToC node context
      document - the DOM to extract from
    • addToModel

      public void addToModel(ToCNode root, org.apache.jena.rdf.model.Model model)
      Description copied from interface: IirdsMetadataHandler
      Adds extracted metadata of a topic or map to the iiRDS RDF model. Implementations shall access the extracted metadata via ToCNode.getProperty(String). The iiRDS InformationUnit has already been created when this method gets called and is accessible via ToCNode.getInformationUnit()
      Specified by:
      addToModel in interface IirdsMetadataHandler
      Parameters:
      root - the ToC node context
      model - the RDF model (graph) to work with and update