The PatternValueHandler will allow you to specify a pattern and the token values to be replaced in the pattern.
The pattern parameter is called "pattern". If this parameter is not specified, the value of the corresponding database column will be used as pattern. All rest of
the parameters will be used as token/value for replacing in the pattern.
For example, in wc-extract-catentdesc.xml, define the following section:
<_config:Query>
<_config:SQL>
<![CDATA[
SELECT CATENTDESC.CATENTRY_ID, LANGUAGE_ID, NAME, PARTNUMBER, THUMBNAIL, FULLIMAGE, PUBLISHED
FROM CATENTDESC, CATENTRY WHERE CATENTRY.CATENTRY_ID = CATENTDESC.CATENTRY_ID AND CATENTRY.CATENTRY_ID=? AND LANGUAGE_ID=?
]]>
</_config:SQL>
<_config:Param name="CATENTRY_ID" />
<_config:Param name="LANGUAGE_ID" />
<_config:ColumnMapping name="THUMBNAIL" value="THUMBNAIL">
<_config:ValueHandler className="com.ibm.commerce.foundation.dataload.config.PatternValueHandler" >
<_config:Parameter name="pattern" value="thumbnail/partNumber.jpg" valueFrom="Fixed" />
<_config:Parameter name="partNumber" value="PARTNUMBER"/>
</_config:ValueHandler>
</_config:ColumnMapping>
</_config:Query>
The pattern is defined as "thumbnail/partNumber.jpg". There is another parameter called "partNumber". This parameter will be treated as token parameter. This value handler will replace the "partNumber" in the pattern "thumbnail/partNumber.jpg"
with the value of the actual part number. In the end, the thumbnail column value in the output CSV will be like "thumbnail/AuroraWMDRS-1.jpg". Note that more than one token parameters can be defined.