Documentation Center

IWriteMetadataAndBlobPlugin - BlobCompareValue

Compares whether 2 values are the same or not. If not, a DifferentValuesFoundException is thrown. If one or both values contain a nodelist, all node.InnerText strings should match the other value.

Plugin Configuration

The following parameters can be configured:
ParameterRequiredDefault valueAllowed valuesDescription
FirstValueYes One of the following can be used to specify the value:
  • A value of type="Parameter". Specifies that the value value comes from a plug-in input parameter. Allowed values: DocId, EDT or ISHType
    
                  <parameter name="Value">
                    <value type="Parameter">DocID</value>
                  </parameter>
                
  • A value of type="DocExtractXPath". Specifies the XPath to be used to extract the value from the current document.
    
                  <parameter name="FirstValue">
                    <value type="DocExtractXPath">(/*[contains(@class,' map/map ')]/@id) | (/*[contains(@class,' topic/topic ')]/@id) | (dita/@id)</value>
                  </parameter>
  • A value of type="MetadataField". Specifies the metadata field to be used as a value. Only string fields which return zero or one value are supported.
    
                  <parameter name="Value">
                    <value type="MetadataField">
                      <parameter name="MetadataField">FTITLE</parameter>
                      <parameter name="MetadataFieldLevel">logical</parameter>
                    </value>
                  </parameter>
                
  • A value of type="newGUID". Specifies that the value should be a new GUID value.
    
                  <parameter name="Value">
                    <value type="newGUID"/>
                  </parameter>
                
  • A value of type="newBase62". Specifies that the value should be a new BASE62 value.
    
                  <parameter name="Value">
                    <value type="newBase62"/>
                  </parameter>
                
First value for comparison
SecondValueYes Same allowed values as for the FirstValue parameterSecond value for comparison
<plugin name="CHECKMASTERORMAPID" handler="BlobCompareValue" 
        ishcondition="CurrentAction in ('Create', 'Update', 'Checkin', 'CreateTranslation') and (EDT='EDTXML')">
          <description>Check that the id in the document is the same as the DocId provided via metadata</description>
          <initialize>
            <parameters>
              <parameter name="FirstValue">
                <value type="DocExtractXPath">(/*[contains(@class,' map/map ')]/@id) | (/*[contains(@class,' topic/topic ')]/@id) | (dita/@id)</value>
              </parameter>
              <parameter name="SecondValue">
                <value type="Parameter">DocID</value>
              </parameter>
              <!-- -111 = ciErrXMLIncorrectIdError -->
              <!-- parameter name="ErrorNumber">-111</parameter -->
            </parameters>
          </initialize>
        </plugin>

Plugin flow

The plugin will retrieve the values for both parameters and compare them.