Package org.iirds.dita.ot.plugin.contrib

# Class ProductPropertyHandler

java.lang.Object
org.iirds.dita.ot.plugin.contrib.ProductPropertyHandler

All Implemented Interfaces:
  `IirdsMetadataHandler`

public class ProductPropertyHandler extends Object implements IirdsMetadataHandler
Extracts products from the `product` attribute on the root element of topics and and the root map. Groups names in the attribute value get ignored. Only items outside of groups and group members are taken into account.

Author:
  Martin Kreutzer, Empolis Information Management GmbH

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `(package private) static org.slf4j.Logger`
  `logger`
  `(package private) static final String`
  `PROP_PRODUCT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ProductPropertyHandler()`

- ## Method Summary

  Modifier and Type
  Method
  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`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface org.iirds.dita.ot.plugin.spi.IirdsMetadataHandler

  `completeModel`

- ## Field Details

  - ### PROP_PRODUCT

    static final String PROP_PRODUCT
    See Also:
      - Constant Field Values

  - ### logger

    static org.slf4j.Logger logger

- ## Constructor Details

  - ### ProductPropertyHandler

    public ProductPropertyHandler()

- ## 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`

  - ### 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