Servigistics InService Publishing and Loading > Additional Information > TAL Customization > Adding Custom Attributes
  
Adding Custom Attributes
The TAL implementation restricts the elements that are part of the transformation output. If you want to send some additional input parameters, then you can include the additional attributes in a pre-defined variable. These new attributes will then be processed by TAL.
TAL loads the attributes that are in the pre-defined variables. These attributes can have the following characteristics:
Single value or multiple values
With or without an Enum key
With translation or without translation
Input Examples from Px Bundles
Following is an input example for an Information Structure (IS) or Publication Structure (PS) using a DMPmap.xml file:
<data name="customattr1" transidref="457b17e2cf7e2ea3" xml:lang="en-US">Value of the attribute 1</data>
<data name="customattr2" key="customKey">Value of the attribute 2</data>
<data name="customattr3">Value of the attribute 2</data>
Following is an example for PDF, XML, IEGraphic, PL (parts list), or PART where the attribute is included in the respective files:
<Property token="customattr1">
<Value key="customKey1">Val1</Value>
<Value key="customKey2">Val2</Value>
<Value key="customKey3">Val3</Value>
</Property>
<Property token="customattr2">
<Value transidref="457b17e2cf7e2ea0" xml:lang="en-US" key="customKey11">Val21</Value>
<Value transidref="457b17e2cf7e2ea1" xml:lang="en-US" key="customKey12">Val22</Value>
</Property>
<Property token="customattr3">
<Value transidref="457b17e2cf7e2ea0" xml:lang="en-US" key="customKey31">Val31</Value>
</Property>
Customization Instructions
To load these metadata attributes, you must set the attributes to pre-defined variables. The value of these variables should be separated by commas between the attributes. Following is an example:
<xsl:variable name="CUSTOM_IS_SOFT_ATTRIBUTES" select="concat(',customattr1,customattr2,customattr3,')"/>
<xsl:variable name="CUSTOM_TYPE_SOFT_ATTRIBUTES" select="concat(',customattr1,customattr2,customattr3,')"/>
Each transform TYPE has its own set of variables (CUSTOM_name) used for custom attributes. The following list provides the customization file and variable name for each type.
IS or PS
Customization File: TranformationDriver\IS\customizations.xsl
Variable Name: CUSTOM_IS_SOFT_ATTRIBUTES
PH
Customization File: TranformationDriver\PH\customizations.xsl
Variable Name: CUSTOM_PH_SOFT_ATTRIBUTES
IEXML
Customization File: TranformationDriver\IEXML\customizations.xsl
Variable Name: CUSTOM_IEXML_SOFT_ATTRIBUTES
PDF
Customization File: TranformationDriver\PDFM\customizations.xsl
Variable Name: CUSTOM_PDFM_SOFT_ATTRIBUTES
GRAPHIC
Customization File: TranformationDriver\GRAPHIC\customizations.xsl
Variable Name: CUSTOM_GRAPHIC_SOFT_ATTRIBUTES
PART RELATION
Customization File: TranformationDriver\PARTRELATIONS\abstractCustomPx2PartsRelations.xsl
This file is included in customPx2PartsRelations.xsl.
Variable Name: CUSTOM_PARTSRELATIONS_SOFT_ATTRIBUTES
This applies to the Rel/Metadata input.
PARTSLIST
Customization File: TranformationDriver\PARTSLIST\abstractCustomPartsList2Feed.xsl
This file is included in customPartsList2Feed.xsl.
This type has multiple variables:
CUSTOM_PARTSLIST_PARTLIST_SOFT_ATTRIBUTES
This applies to the PartsList/PartList/Metadata input.
CUSTOM_PARTSLIST_ITEMS_ITEM_PARTLISTITEM_SOFT_ATTRIBUTES
This applies to the PartsList/Items/Item/PartListItem/Metadata input.
CUSTOM_PARTSLIST_PARTLIST_META_SOFT_ATTRIBUTES
This applies to the PARTSLIST .meta input.
CUSTOM_PARTSLIST_ITEMS_ITEM_PARTLISTITEM_PART_SOFT_ATTRIBUTES
This applies to the PartsList/Part/Metadata and PartsList/Items/Item/Part/Metadata input.
CUSTOM_PARTSLIST_IMAGES_IMAGE_SOFT_ATTRIBUTES
This applies to the PartsList/Images/Image/imageObj/Metadata input.
PART
Customization File: TranformationDriver\PARTS\abstractCustomPart2Feed.xsl
For this type, you need to add template calls for custom attributes in an XSL template with mode="translate". See the following example.
<xsl:template match="Metadata[starts-with(@source,'wt.part.WTPart')]"
mode="custom.wt.part.WTPart">
<xsl:apply-templates select="Property[@token = 'customattr1']" mode="translate"/>
<xsl:apply-templates select="Property[@token = 'customattr2']" mode="translate"/>
<xsl:apply-templates select="Property[@token = 'customattr3']" mode="translate"/>
</xsl:template>
Once custom attributes are loaded into the Servigistics InService repository, additional customization is required on the view stylesheet and type property to use the attributes in the user interface for either display or search. See Updating the View Stylesheet and Updating the Default Transformation Process for more information.