public class CritdatesMetadataHandler extends Object implements IirdsMetadataHandler
<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.
Modifier and Type | Field and Description |
---|---|
(package private) SimpleDateFormat |
americanDateFormat |
(package private) SimpleDateFormat |
defaultDateFormat |
(package private) static String |
ENDTIME_APPENDIX |
(package private) SimpleDateFormat[] |
formats |
(package private) SimpleDateFormat |
germanMonthNameDateFormat |
(package private) static org.slf4j.Logger |
logger |
(package private) static String |
META_CREATED |
(package private) static String |
META_EXPIRY |
(package private) static String |
META_GOLIVE |
(package private) static String |
META_REVISED |
(package private) static String |
STARTTIME_APPENDIX |
Constructor and Description |
---|
CritdatesMetadataHandler() |
Modifier and Type | Method and Description |
---|---|
void |
addToModel(ToCNode root,
org.apache.jena.rdf.model.Model model)
Adds extracted metadata of a topic or map to the iiRDS RDF model.
|
void |
extractMetadata(ToCNode node,
Document document)
Extract metadata from an XML DOM of a topic or map.
|
String |
getName()
The name this metadata handler can be activated by from the
dita
command via parameters |
String |
reformatDate(String date)
Tries to parse a date string with difference formats
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
completeModel
static final String META_REVISED
static final String META_CREATED
static final String META_EXPIRY
static final String META_GOLIVE
static org.slf4j.Logger logger
static final String STARTTIME_APPENDIX
static final String ENDTIME_APPENDIX
SimpleDateFormat defaultDateFormat
SimpleDateFormat americanDateFormat
SimpleDateFormat germanMonthNameDateFormat
SimpleDateFormat[] formats
public String getName()
IirdsMetadataHandler
dita
command via parametersgetName
in interface IirdsMetadataHandler
public String reformatDate(String date)
date
- the date string to parsepublic void extractMetadata(ToCNode node, Document document)
IirdsMetadataHandler
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.extractMetadata
in interface IirdsMetadataHandler
node
- the ToC node contextdocument
- the DOM to extract frompublic void addToModel(ToCNode root, org.apache.jena.rdf.model.Model model)
IirdsMetadataHandler
ToCNode.getProperty(String)
. The iiRDS InformationUnit
has
already been created when this method gets called and is accessible via
ToCNode.getInformationUnit()
addToModel
in interface IirdsMetadataHandler
root
- the ToC node contextmodel
- the RDF model (graph) to work with and updateCopyright © 2024. All rights reserved.