Package org.iirds.dita.ot.plugin
Class CompositeMetadataHandler
java.lang.Object
org.iirds.dita.ot.plugin.CompositeMetadataHandler
- All Implemented Interfaces:
IirdsMetadataHandler
A composite metadata handler. It consists of other metadata handlers added by
addMetadataHandler(IirdsMetadataHandler). The methods delegate to
all member handler.- Author:
- Martin Kreutzer, Empolis Information Management GmbH
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeMetadataHandler(String name, IirdsMetadataHandler... handlers) Create a composite metadata handler and provide the handlers -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMetadataHandler(IirdsMetadataHandler handler) Add an metadata handlervoidaddMetadataHandlers(Collection<IirdsMetadataHandler> handlers) Adds metadata handlersvoidaddToModel(ToCNode node, org.apache.jena.rdf.model.Model model) Adds extracted metadata of a topic or map to the iiRDS RDF model.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 parametersvoidtoString()
-
Constructor Details
-
CompositeMetadataHandler
public CompositeMetadataHandler() -
CompositeMetadataHandler
Create a composite metadata handler and provide the handlers- Parameters:
name- the name of this handlerhandlers- the handlers making up this composite metadata handler
-
-
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.
-
setName
-
toString
-
getMetadataHandlers
- Returns:
- unmodifiable list of metadata handlers composing this metadata handler
-
addMetadataHandlers
Adds metadata handlers- Parameters:
handlers- the metadata handlers to add
-
addMetadataHandler
Add an metadata handler- Parameters:
handler- the metadata handler to add
-
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:
node- the ToC node contextmodel- the RDF model (graph) to work with and update
-
completeModel
Description copied from interface:IirdsMetadataHandlerPerform 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.- Specified by:
completeModelin interfaceIirdsMetadataHandler- Parameters:
root- the ToC node contextmodel- the RDF model (graph) to work with
-