IWriteMetadataAndBlobPlugin - BlobExtractFirstMetadata
Copies the InnerXml or InnerText of the first node in the XML content that matches one of the XPath expressions provided in the ExtractXPath* parameters 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 |
|---|---|---|---|---|
| ExtractXPath01 | Yes | Â | Â | XPath query syntax used to search and retrieve the information from within the supplied XML document. The ExtractXPath* will be executed in order. Once an XPath returns a node, this first node will be used to obtain the InnerXml or InnerText and no further XPath expression will be executed. |
| ExtractXPath02 -> ExtractXPath99 | No | Â | Â | XPath query syntax used to search and retrieve the information from within the supplied XML document. The ExtractXPath* will be executed in order. Once an XPath returns a node, this first node will be used to obtain the InnerXml or InnerText and no further XPath expression will be executed. |
| MetadataField | Yes | Â | The (element) name of the metadata field which should be set by the information returned by the ExtractXPath query. Only single value string or long fields are supported, number and date fields are not. | |
| MetadataFieldLevel | No | lng | logical, version, lng | The metadata field level |
| ReturnValueType | No | InnerText | InnerXml, InnerText | Indicates whether to store
|
plugin name="ISHEXTRACTLNGTITLETOMETADATA" example
<plugin name="ISHEXTRACTLNGTITLETOMETADATA" handler="BlobExtractFirstMetadata" ishcondition="CurrentAction in
('Create', 'Update', 'Checkin', 'CreateTranslation') and (EDT='EDTXML') and
(ISHType in ('ISHMasterDoc', 'ISHModule', 'ISHLibrary'))">
<description>Find first matching title in document and put it on the FISHLNGTITLEXML metadata field.</description>
<workingset>
<ishfields>
<ishfield name="FISHLNGTITLEXML" level="lng" />
</ishfields>
</workingset>
<initialize>
<parameters>
<parameter name="TitleExtractXPath01">/*[contains(@class,' bookmap/bookmap ')]/*[contains(@class,' bookmap/booktitle ')]
/*[contains(@class,' bookmap/mainbooktitle ')]</parameter>
<parameter name="TitleExtractXPath02">/*[contains(@class,' bookmap/bookmap ')]/*[contains(@class,' bookmap/booktitle ')]
/preTranslation/*[contains(@class,' bookmap/mainbooktitle ')][2]</parameter>
<parameter name="TitleExtractXPath03">//*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/titlealts ')]
/*[contains(@class,' topic/navtitle ')]</parameter>
<parameter name="TitleExtractXPath04">//*[contains(@class,' map/map ') or contains(@class,' topic/topic ')]
/*[contains(@class,' topic/title ')]</parameter>
<parameter name="TitleExtractXPath05">//*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/titlealts ')]
/preTranslation/*[contains(@class,' topic/navtitle ')][2]</parameter>
<parameter name="TitleExtractXPath06">//*[contains(@class,' map/map ') or contains(@class,' topic/topic ')]
/preTranslation/*[contains(@class,' topic/title ')][2]</parameter>
<parameter name="TitleExtractXPath07">//*[contains(@class,' map/map ')]/@title</parameter>
<parameter name="MetadataField">FISHLNGTITLEXML</parameter>
<parameter name="MetadataFieldLevel">lng</parameter>
<parameter name="ReturnValueType">InnerXml</parameter>
</parameters>
</initialize>
</plugin>
Plugin flow
The plugin will execute the defined ExtractXPath* queries (in order) one by one. The first node that is returned by one of the XPaths will be used further.
If ReturnValueType=InnerXml, the plugin will get the InnerXml of the node, otherwise it will the InnerText and store it in the metadata property.
If no node is found, no value is stored for the field.