Package org.iirds.dita.ot.plugin.spi
Interface IirdsMetadataHandler
- All Known Implementing Classes:
AudienceMetadataHandler,AudiencePropertyHandler,ComponentMetadataHandler,CompositeMetadataHandler,CopyrightMetadataHandler,CritdatesMetadataHandler,ProdnameMetadataHandler,ProductPropertyHandler,ShortdescMetadataHandler,SubjectSchemeDataMetadataHandler
public interface IirdsMetadataHandler
Gets metadata from DITA content and updates the iiRDS RDF model with the found
metadata.
There are three stages:
- Extract metadata from DITA and store it temporarily:
extractMetadata(ToCNode, Document) - Set the metadata to the iiRDS information unit after all metadata
ahndlers have doen their extraction job:
addToModel(ToCNode, Model) - Perform any metadata manipulations and completion of the iiRDS model
after all handlers have extracted and set their metadata to the RDF model:
completeModel(ToCNode, Model)
Metadata handlers might extract and set metadata or even just run any post-processing to finalize the iiRDS RDF model.
Implementations should not store any state related information concerning an
exctraction in the instance. The instance must be re-usable for different
extractions. Store any state information in the ToCNode provided in
the instance methods called.
- Author:
- Martin Kreutzer, Empolis Information Management GmbH
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddToModel(ToCNode node, org.apache.jena.rdf.model.Model model) Adds extracted metadata of a topic or map to the iiRDS RDF model.default voidcompleteModel(ToCNode root, org.apache.jena.rdf.model.Model model) Perform any post-processes on the iiRDS RDF model, after all metadata handlers have done their extraction and model update jobs.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 parameters
-
Method Details
-
getName
String getName()The name this metadata handler can be activated by from theditacommand via parameters- Returns:
- the unique name, should be short and comprehensible to users of the DITA OT.
-
extractMetadata
Extract 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.- Parameters:
node- the ToC node contextdocument- the DOM to extract from
-
addToModel
Adds 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()- Parameters:
node- the ToC node contextmodel- the RDF model (graph) to work with and update
-
completeModel
Perform any post-processes on the iiRDS RDF model, after all metadata handlers have done their extraction and model update jobs. It should be used to complete the model, e.g. in the case mandatory metadata are missing. The default implementation does nothing. This method gets called only for the root node (usually the document). The implementation is free toaccessand manipulate any child nodes.- Parameters:
root- the ToC node contextmodel- the RDF model (graph) to work with
-