Servigistics InService Publishing and Loading > Additional Information > TAL Customization > Customizing Access Options
  
Customizing Access Options
To apply access control on additional attributes and have more control over access filtering of the content, you must do the following three customizations:
Adding options and choices using an OptionsDefinition file
Applying applicability of access options on the data to be filtered using a FilterDefinition-Mapping file
Loading an access option that is valid for filtering.
Each one of these steps is covered in a separate section.
Additions to the OptionsDefinition File
This is a file in the bundle that lists all the options and their corresponding choices that are available and supported in the system. You can add more or remove some existing options (and related choices). In general, one Option element can contain one or more Choice elements.
Follow is an entry in this file:

<OptionSet container="OR:wt.pdmlink.PDMLinkProduct:115636" label="OptionSet" token="_oset4562692">
<Option label="Release" token="_opt4318852">
<Name>Release</Name>
<Choice label="postRelease" token="_ch4318861">
<Name>postRelease</Name>
</Choice>
<Choice label="preRelease" token="_ch4318862">
<Name>preRelease</Name>is
</Choice>
</Option>
</OptionSet>
* 
The Option name and Choice name can be localized using the translation.xml file
The use and purpose of the elements and their attributes is covered in this table:
Property Name
Type
Purpose
OptionSet
Element
A placeholder with multiple Option elements
Option
Element
A placeholder with multiple Choice elements
Choice
Element
A placeholder for allowed choices for a given option
token
attribute
Used for lookup purpose in translation.xml for language translation.
label
attribute
The name of the option you are adding.
Name
element
The name of the Option or Choice you are adding.
Applying Applicability Using the FilterDefinition-Mapping File
The options and their choices described in the above section are used in FilterDefinition-Mapping.xml to restrict the access to some data by applying them on that data during the TAL process. The filter definition mapping file is used to apply applicability of access options on particular data indicated by the XPATH and the type of object.
This is a configurable mapping file which is kept in the INSERVICE_HOME/InS_SW/Config/System/Config folder structure. This file can be updated to control or apply the applicability on the specific bundle data during the TAL process.
Follow is an example of this file:

<?xml version="1.0" encoding="UTF-8"?>
<FilterDefinitions>
<FilterDefinition type="IS" xmd="false">
FilterProperty label="Color" xpath="metadata[@id='PartList_4119316']/data[@name='Color']" delimiter=","/>
<FilterProperty label="number" xpath="metadata[@id='EPMDocument_4336801']/data[@name='number']" delimiter=","/>
<FilterProperty label="number" xpath="metadata[@id='EPMDocument_2042453']/data[@name='number']" delimiter=","/>
<FilterProperty label="Color" xpath="metadata[@id='EPMDocument_2053239']/data[@name='Color']" delimiter=","/>
</FilterDefinition>

<!--At entire document level -->
<FilterDefinition type="PDFM" xmd="true">
<!--For a specific pdf. -->
<FilterProperty label="number" xpath="Metadata[@id='EPMDocument_4336801']/Property[@token='number']/Value" delimiter=" "/>
<!--For every pdf. -->
<FilterProperty label="number" xpath="Metadata/Property[@token='number']/Value" delimiter=" "/>
</FilterDefinition>

<FilterDefinition type="IEXML" xmd="true">
<!--For a specific xml. -->
<FilterProperty label="number" xpath="Metadata[@id='EPMDocument_2042453']/Property[@token='number']/Value" delimiter=" "/>
<!--For every xml. -->
<FilterProperty label="number" xpath="Metadata/Property[@token='number']/Value" delimiter=" "/>
</FilterDefinition>

<FilterDefinition type="PARTSLIST" xmd="true">
<FilterProperty label="Color" xpath="Metadata[@id='PartList_4119316']/Property[@token='Color']/Value" delimiter=","/>
</FilterDefinition>

<FilterDefinition type="GRAPHIC" xmd="true">
<FilterProperty label="Color" xpath="Metadata[@id='EPMDocument_2053239']/Property[@token='Color']/Value" delimiter=" "/>
</FilterDefinition>

<!--For inline applicability. -->
<FilterDefinition type="IEXML" xmd="false">
<FilterProperty label="role" xpath="*[@applic_role]/@applic_role" delimiter=" "/>
</FilterDefinition>

<FilterDefinition type="PARTSLIST" xmd="false">
<FilterProperty label="DriveType" xpath="Metadata[@id='PartListItem_4119324']/Property[@token='DriveType']/Value" delimiter=","/>
</FilterDefinition>

<FilterDefinition type="PRT" xmd="false">
<FilterProperty label="Color" xpath="Metadata[@id='WTPart_3443834']/Property[@token='Color']/Value" delimiter=","/>
</FilterDefinition>

<!--For 3rd Party Bundle-->
<FilterDefinition type="KIT2PRT" xmd="false">
</FilterDefinition>

<FilterDefinition type="KIT2PRTLST" xmd="false">
</FilterDefinition>

<FilterDefinition type="PH" xmd="false">
</FilterDefinition>

<FilterDefinition type="PX" xmd="false">
</FilterDefinition>
</FilterDefinitions>
One FilterDefinitions element contains multiple FilterDefinition elements, each specific to a particular bundle type and its usage.
The use and purpose of the elements and their attributes is covered in this table:
Property Name
Type
Purpose
FilterDefinition
element
This element is specific to a particular bundle type and its usage.
type
attribute
Specifies the bundle type for which the given FilterDefinition is applicable.
Allowed values are: IS, PARTSLIST, GRAPHIC, PDFM, and IEXML.
xmd
attribute
Specifies whether the applicability should apply to a particular node or the entire document.
If true, applicability is applicable for the entire document.
If false, applicability is applicable for a particular node.
FilterProperty
element
Specifies the filter property to be applied.
label
attribute
Specifies the name of the applicability being applied.
For example: Color, Region, Source, and so forth.
xpath
attribute
The XPATH expression to the bundle data element to which the applicability is being applied.
Example one:

Metadata[@id='EPMDocument_1678511']
/Property[@token='Region']
/Value
This means look for the data present on the element named Value under an element named Property with the token attribute as Region under an element named Metadata with the id attribute as EPMDocument_1678511.
Example two:

*[@applic_Region]/@applic_Region
This means look for the data present on the attribute named applic_Region on any element.
Example three:

Metadata[@id='EPMDocument_8978311']
/Property[@token='name']
/Value/@xml:lang
This means look for the data present on the attribute named xml:lang on an element named Value under an element named Property with token attribute as name under element named Metadata with id attribute as EPMDocument_8978311.
Example four:

Metadata/Property[@token='Region']
/Value
This means look for the data present on the element named Value under an element named Property with the token attribute as Region under an element named Metadata.
delimiter
attribute
The delimiter used to separate the values in cases where multiple values exist on that element.
For example: comma, colon, space and so forth.
Load Access Option into the System
Out of all the options and their choices that are available in the system, you can use some or all of them to restrict the access to some users.
To do this list the subset of options and choices as access options and the valid options to be loaded using the Windchill loader. The load file contains the list of valid options and their type.
Create an XML file with the option name and its type and place it at this location: INSERVICE_HOME/InS_SW/SW/Applications/Windchill.ear/loadXMLFiles/servicecenter. For example: SCAccessOption.xml.
Run the following command in a Windchill shell:
windchill wt.load.LoadFromFile -u wcadmin -p wcadmin -d loadXMLFiles/servicecenter/SCAccessOption.xml
Follow is an example of this file:
<? xml version="1.0"?>
<! DOCTYPE InSObjects SYSTEM "standardX26.dtd">
<InSObjects>
<SCAccessOption>
<accessOptionLabel>Source</accessOptionLabel>
<accessOptionType>IE</accessOptionType>
</SCAccessOption>
<SCAccessOption>
<accessOptionLabel>Region</accessOptionLabel>
<accessOptionType>IE</accessOptionType>
</SCAccessOption>
</InSObjects>
The use and purpose of the elements is covered in this table:
Property Name
Type
Purpose
SCAccessOption
element
A placeholder for defining one AccessOption
accessOptionLabel
element
The name of the option
accessOptionType
element
The type of the option
* 
Currently the only supported type is IE.