Documentation Center

IWriteMetadataAndBlobPlugin - BlobExtractHyperlinks

Copies the hyperlinks found in the XML content (ExtractXPath parameter) towards the appropriate repository metadata fields (specified by the MetadataField and MetadataFieldLevel parameters).

Plugin Configuration

The following workset fields need to be configured:
Field NameField Level
The name of the field specified in the MetadataField parameterThe level of the field specified in the MetadataFieldLevel parameter
The following parameters can be configured:
ParameterRequiredDefault valueAllowed valuesDescription
ExtractXPathYes  XPath query syntax used to search and retrieve the information from within the supplied XML document
MetadataFieldYes Yes, NoThe metadata field which should be set by the information returned by the ExtractXPath query. Only string fields are support, number and date fields are not.
MetadataFieldLevelNolnglogical, version, lngThe metadata field level
HyperlinkSeparatorNo# The hyperlink separator
MetadataUpperCaseNoYesYes, NoConvert the retrieved value(s) into uppercase characters before storing them in the repository
DocumentUpperCaseNoNoYes, NoConvert the retrieved value(s) into uppercase characters and update the XML document appropriately
AddObjectRefNoYesYes, NoAdd extra values for hyperlinks with # to the topic itself. So for example, an href="A#B" will store "A, A#B"
ObjectRefRegExpNo  The regular expression to extract the object reference. If this value is set, the TargetRefRegExp becomes required.
TargetRefRegExpNo  The regular expression to extract the target reference. If this value is set, the ObjectRefRegExp becomes required.
<plugin name="ISHSYSHYPERLINKSTOMETADATA" handler="BlobExtractHyperlinks" 
  ishcondition="CurrentAction in ('Create', 'Update', 'Checkin') and (ISHType in ('ISHMasterDoc', 'ISHModule', 'ISHLibrary') and EDT='EDTXML')">
  <description>Find hyperlinks in document and put them on card</description>
  <workingset>
    <ishfields>
      <ishfield name="FISHHYPERLINKS" level="lng" />
    </ishfields>
  </workingset>
  <initialize>
    <parameters>
      <parameter name="ExtractXPath">
        (//*[contains(@class,' topic/xref ')][@href!='-dita-use-conref-target' or not(@conref)][not(ancestor::*[@conref])][not(ancestor-or-self::*[@scope and @scope!=''][position()=1]/@scope='external')]/@href) | (//*[contains(@class,' topic/link ')][@href!='-dita-use-conref-target' or not(@conref)][not(ancestor::*[@conref])][not(ancestor-or-self::*[@scope and @scope!=''][position()=1]/@scope='external')]/@href) | (//*[contains(@class,' map/reltable ')]//*[contains(@class,' map/topicref ')][@href!='-dita-use-conref-target' or not(@conref)][not(ancestor::*[@conref])][not(ancestor-or-self::*[@scope and @scope!=''][position()=1]/@scope='external')]/@href) | (//*[contains(@class,' map/reltable ')]//*[contains(@class,' map/navref ')][@mapref!='-dita-use-conref-target' or not(@conref)][not(ancestor::*[@conref])][not(ancestor-or-self::*[@scope and @scope!=''][position()=1]/@scope='external')]/@mapref)
      </parameter>
      <parameter name="MetadataField">FISHHYPERLINKS</parameter>
      <parameter name="HyperlinkSeparator">#</parameter>
      <parameter name="MetadataUpperCase">Yes</parameter>
      <parameter name="DocumentUpperCase">Yes</parameter>
      <parameter name="AddObjectRef">Yes</parameter>
    </parameters>
  </initialize>
</plugin>   

Plugin flow

The plugin will execute the defined ExtractXPath query to retrieve the value(s) to be stored in the metadata property.

The plugin will extract the targets from the hyperlinks using the HyperlinkSeparator as a delimiter.

If configured, the retrieved value(s) will be converted into uppercase in the document.

If configured, the retrieved value(s) will be converted into uppercase before storing them in the repository metadata property.

If configured, the logical ids will be added to the metadata property.