Customizing PH Automatic Applicability
You can define a set of options and choices to be automatically used for filtering when a user navigates to a product hierarchy (PH). By default, the system uses a logical expression that resizes the PH node and converts it into an element named setAutomaticApplicability. PTC Arbortext Content Delivery uses this element in the user interface to set options and choices automatically when a PH is selected.
You can modify the customizations.xsl file so that the TAL process sets filtering options and choices automatically in the required format. Follow these steps to customize the PH applicability:
1. Add a template call for the custom attribute to the customizations.xsl file with mode = "CustomPH-applicability".
This generates the required markup in DCTM_Output after the customization. For example:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:stl="http://www.enigma.com/Styling"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="stl">
<xsl:param name="bundlePath"/>
<!-- OOTB SSH: PH2TOC_tr.xsl
Customization stylesheet Partlist Transform. Use XSLT's priority on the template match to override the corresponding OOTB template match.
The .meta is used for the transformation
Example:
xsl:template match="element-to-be-customized" priority='2'>
...............
Your customized transform logic goes here.
...............
</xsl:template>
-->
<!--The abtract template to be overriden in order to add custom attributes-->
<xsl:template match="Property" mode="custom" priority='2'/>
<!--The abtract template to be overriden in order to drop custom to be added under Metadata
<xsl:template match="Property" mode="mapping" priority='2'/> -->
<xsl:variable name="CUSTOM_PH_SOFT_ATTRIBUTES">
</xsl:variable>
<!--The abtract template to be overriden in order to customize PH applicability-->
<xsl:variable name="CustomPH-applicability" select="'true'"/>
<xsl:variable name="optionDefination-File" select="document(concat($bundlePath, '/OptionsDefinition.xml'))"/>
<xsl:template match="*" mode="CustomPH-applicability">
<xsl:for-each select="$optionDefination-File/OptionsDefinition/OptionSet">
<xsl:element name="setAutomaticApplicability">
<xsl:for-each select="Option">
<xsl:element name="Option">
<xsl:attribute name="label">
<xsl:value-of select="@label"/>
</xsl:attribute>
<xsl:for-each select="Choice">
<xsl:element name="Choice">
<xsl:attribute name="label">
<xsl:value-of select="@label"/>
</xsl:attribute>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:for-each>
<!--<setAutomaticApplicability>
<Option label="Bus">
<Choice label="FuelBus"/>
<Choice label="ElectricBus"/>
</Option>
</setAutomaticApplicability>-->
</xsl:template>
</xsl:stylesheet>
2. Set the CustomPH-applicability variable to process the customized template.