Constraint Algorithm Usage for Folder Location Fields
To control the folder location options shown to users when they are selecting a folder path, the Windchill user interface allows you to specify combinations of constraint algorithms in AttrConstraints tag for the folder.id attribute.
* 
The use of constraints with the folder.id attribute assumes that a default value is also set (as described in Setting a Default Folder Path Example).
The following folder location options are available:
Show the location as a read-only pregenerated value by specifying the GetServerPreGeneratedValue algorithm, which displays the default value set for the folder.id attribute.
To use this option by itself, also specify the GetImmutableConstraint algorithm. For example:
<AttrValue id="folder.id"
algorithm="com.ptc.core.foundation.folder.server.impl.FolderPathAttributeAlgorithm">
<Arg>/Default</Arg>
</AttrValue>

<AttrConstraint id="folder.id"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerPreGeneratedValue"/>
<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint"/>
</AttrConstraint>
displays as follows:
In this example, the default value for the folder.id attribute is /GOLF_CART.
Show the location as the read-only value that is automatically generated from the default value set for the folder.id attribute by specifying the GetServerAssignedConstraint algorithm.
To use this option by itself, also specify the GetImmutableConstraint algorithm. For example:
<AttrValue id="folder.id"
algorithm="com.ptc.core.foundation.folder.server.impl.FolderPathAttributeAlgorithm">
<Arg>/Default</Arg>
</AttrValue>

<AttrConstraint id="folder.id"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint"/>
<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint"/>
</AttrConstraint>
displays as follows:
Show the location so that the user can select a folder by either using the folder location presented in the field or by browsing to a different folder.
The logic used to determine the folder location presented initially in the field takes into account all of the different places in the user interface from which the user can select a folder and presents the most suitable folder location for each case. For example when the user creates an object by clicking an icon from the Folder Contents table associated with the Design folder, the folder location presented in the field is the folder from which the icon was clicked (in this case, /GOLF_CART/Design).
This option can be used by itself if you specify an empty list of constraint algorithms. For example:
<AttrConstraint id="folder.id"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints"\>
displays as follows:
The option can also be used in combination with other options by either specifying the GetServerAssignedConstraint algorithm or the GetServerPreGeneratedValue algorithm.
* 
To display this option, you must not specify the GetImmutableConstraint algorithm in the constraint list.
For an example showing the combination of supported user interface options for the folder location field and the constraint algorithms used to produce the display, see Location in the Basic Customization section.
Isto foi útil?