Customizing Tree Color and Icon Masks |
Technical Article |
AbstractThis article describes how to customize the background color of texts and the masks of icons of the Navigator and Editor trees (VPM and PPR) depending on end-user defined rules based on attributes. |
ENOVIA V6, ENOVIA VPM V4 and ENOVIA V5 VPM users have many possibilities for customizing their Product Structure Navigator (PSN).
Consequently in the context of offering a new solution the isofunctional aspect becomes more important.
The customization is based upon knowledge rules using PLM attributes.
The customization mechanism is based on script files and applied to PPR Navigator and VPM Navigator.
All the references and representation references are customizable (not the instances item).
A different customization can be defined for different customized types, e.g. ENOSAM_VPMPart and PLMProductDS.
First define a family that will allow a rule to be rerouted according to object type.
This family is a CATRuleExit file, this file must be located in the following runtime view directory : <os>\resources\knowledge\scripts.
The Rule is a CATRule file, this file must be located in the following runtime view directory : <os>\resources\knowledge\scripts.
These script files must be located in the following runtime view directory \intel_a\resources\knowledge\scripts
Syntax:
Two Keywords are to be used in family files:
After that, in your CATRule file, you can condition the information you send by using following items:
You have to define three values, corresponding to the desired RGB values.
You have to define the icon Mask Name.
In the CATRule files: This object represents the customized object on which attributes need to be accessed so as to define rule.
If a rule is validated, it is via the above parameters (MyColor, IconMask) that the customization will be retrieved:
(parameters is an internal Keyword allowing to access attributes)
Note: The Icon mask should be BMP files, located in the runtime view ( <os>\Resources\Graphic\Icons). The size of icon masks should be 10*10 pixel.
Refresh Management:
The attributes used in a rule so as to manage the Background color or the icon mask can change in the session.
In some cases, their modifications are immediately taken into account:
But in other cases, the only way to guarantee refreshed (up-to-date) information is to do an expand.
Attributes which can be used in rules
For defining rules on objects, there is a dedicated Resource file named
Attributes_For_Rules.CATRsc
Put in <os>\resources\msgcatalog directory.
Here is its syntax :
Attributes.<Object_type>=”Attribute_1|Attribute_2|……|Attribute_n”;
Where attributes separated by a | are retrieved from DataBase.
Example of file Attributes_For_Rules.CATRsc :
Attributes.PLMProductDS = "PLM_ExternalID|V_description|V_organization";
Attributes.PLMRepresentationDS = "V_discipline|V_nature";
So there will be the possibility to define rules based on following attributes for the PLMProductDS real type:
ExternalID V_description V_organization
And these ones on PLMRepresentationDS real type :
V_discipline V_nature
Principle: The displayed nodes of a tree will have a background color and icons driven by rules based on attributes.
Example: Here is a customized VPM Navigator Tree according to the following configuration script files (*.CATRuleExit and *.CATRule):
DSCustomization.CATRuleExit
<Scripts> <Script OpeningID="ManageColor" Type="PLMRepresentationDS" ScriptName="Color_LOCKUSER"/> <Script OpeningID="ManageColor" Type="PLMProductDS" ScriptName="Color_LOCKUSER"/> </Scripts>
Color_LOCKUSER.CATRule
let UserId(String) UserId = Parameters->GetAttributeString("UserID") if ( (ThisObject.LOCKUSER=="ILI") and (UserId == "ILI") ) Parameters->SetAttributeString("MyColor","0|255|0") else if (UserId == " ILI") Parameters->SetAttributeString("MyColor","0|255|255")
Tree with connected user ILI
Unlock Operation
After unlock, color changed from green to blue.
New Session with connection to another user
Tree not customized as connected user is different from ILI (On which rule is defined in this sample)
Principle: The displayed nodes of a tree (in navigation window) can have a background color and Icon Masks driven by rules based on attributes.
DSCustomization.CATRuleExit
<Scripts> <Script OpeningID="ManageColor" Type="PLMRepresentationDS" ScriptName="Color_LOCKUSER"/> <Script OpeningID="ManageColor" Type="PLMProductDS" ScriptName="Color_LOCKUSER"/> <Script OpeningID="ManageMask" Type="PLMProductDS" ScriptName="Mask_rules"/> <Script OpeningID="ManageMask" Type="PLMRepresentationDS" ScriptName="Mask_rules"/> </Scripts>
Mask_rules.CATRule
Parameters->SetAttributeString("IconMask","I_TP")
Only tree mask attributes will be used to define rules.
No customization will be possible on instances.
The icon customization of multi-extended product is not managed.
For example, if a Product has two extensions (Electrical and Resource), we will not be able to precisely define the icon to be used in the context (there is no management of this ambiguity).
Write rules (*.CATRuleExit and *.CATRule) to customize the background color of texts and icon masks of the Navigator tree (VPM and PPR) depending on attributes values.
Version: 1 [Mar 2007] | Document created |