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
| Field Name | Field Level |
|---|---|
| The name of the field specified in the MetadataField parameter | The level of the field specified in the MetadataFieldLevel parameter |
| Parameter | Required | Default value | Allowed values | Description |
|---|---|---|---|---|
| ExtractXPath | Yes | XPath query syntax used to search and retrieve the information from within the supplied XML document | ||
| MetadataField | Yes | Yes, No | The 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. | |
| MetadataFieldLevel | No | lng | logical, version, lng | The metadata field level |
| HyperlinkSeparator | No | # | The hyperlink separator | |
| MetadataUpperCase | No | Yes | Yes, No | Convert the retrieved value(s) into uppercase characters before storing them in the repository |
| DocumentUpperCase | No | No | Yes, No | Convert the retrieved value(s) into uppercase characters and update the XML document appropriately |
| AddObjectRef | No | Yes | Yes, No | Add extra values for hyperlinks with # to the topic itself. So for example, an href="A#B" will store "A, A#B" |
| ObjectRefRegExp | No | The regular expression to extract the object reference. If this value is set, the TargetRefRegExp becomes required. | ||
| TargetRefRegExp | No | 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.