Package org.iirds.dita.ot.plugin.contrib
Class CritdatesMetadataHandler
java.lang.Object
org.iirds.dita.ot.plugin.contrib.CritdatesMetadataHandler
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescription(package private) SimpleDateFormat(package private) SimpleDateFormat(package private) static final String(package private) SimpleDateFormat[](package private) SimpleDateFormat(package private) static org.slf4j.Logger(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToModel(ToCNode root, org.apache.jena.rdf.model.Model model) Adds extracted metadata of a topic or map to the iiRDS RDF model.voidextractMetadata(ToCNode node, Document document) Extract metadata from an XML DOM of a topic or map.getName()The name this metadata handler can be activated by from theditacommand via parametersreformatDate(String date) Tries to parse a date string with difference formatstoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.iirds.dita.ot.plugin.spi.IirdsMetadataHandler
completeModel
-
Field Details
-
META_REVISED
- See Also:
-
META_CREATED
- See Also:
-
META_EXPIRY
- See Also:
-
META_GOLIVE
- See Also:
-
logger
static org.slf4j.Logger logger -
STARTTIME_APPENDIX
- See Also:
-
ENDTIME_APPENDIX
- See Also:
-
defaultDateFormat
SimpleDateFormat defaultDateFormat -
americanDateFormat
SimpleDateFormat americanDateFormat -
germanMonthNameDateFormat
SimpleDateFormat germanMonthNameDateFormat -
formats
SimpleDateFormat[] formats
-
-
Constructor Details
-
CritdatesMetadataHandler
public CritdatesMetadataHandler()
-
-
Method Details
-
getName
Description copied from interface:IirdsMetadataHandlerThe name this metadata handler can be activated by from theditacommand via parameters- Specified by:
getNamein interfaceIirdsMetadataHandler- Returns:
- the unique name, should be short and comprehensible to users of the DITA OT.
-
toString
-
reformatDate
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
Description copied from interface:IirdsMetadataHandlerExtract metadata from an XML DOM of a topic or map. Implementations should store the extracted metadata viaToCNode.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:
extractMetadatain interfaceIirdsMetadataHandler- Parameters:
node- the ToC node contextdocument- the DOM to extract from
-
addToModel
Description copied from interface:IirdsMetadataHandlerAdds extracted metadata of a topic or map to the iiRDS RDF model. Implementations shall access the extracted metadata viaToCNode.getProperty(String). The iiRDSInformationUnithas already been created when this method gets called and is accessible viaToCNode.getInformationUnit()- Specified by:
addToModelin interfaceIirdsMetadataHandler- Parameters:
root- the ToC node contextmodel- the RDF model (graph) to work with and update
-