Customization Points
The uic Element
Each UIC in roleaccessprefs.xml represents a uicomponent or action to be controlled.
Parameter
Default Value
Possible values
Req?
Description
name
n/a
string
Y
The name of the UI component. This must match the value of the uicomponent (or name) attribute on an action element in actions.xml. This must also match the value of a resource entry constant in the resource bundle.
Order
?
Non-negative? Integer
N
The position of this UI component in the wizard. UI components with lower numbers are placed before those with higher numbers.
Enabled
true
true | false
N
Whether or not this uicomponent must be shown in the wizard and utilized by the system.
DefaultAll
true
true | false
N
The default visibility value for All Members.
DefaultManager
true
true | false
N
The default visibility value for Project Managers.
The permissions are a union of all permissions across all roles; if you set defaultManager to false; you must also set defaultAll to false, otherwise managers will still have access through the ALL_MEMBERS role.
DefaultGuest
true
true | false
N
The default visibility value for people in the Guest role.
Guests are not technically members of the Project; they are not unioned with the ALL_MEMBERS role.
ManagerEnabled
true
true | false
N
Whether or not this uicomponent can affect the manager role. Do not change this value in out-of-the-box UICs. For customized UICs, you can choose your own setting.
GuestEnabled
true
true | false
N
Whether or not this uicomponent can affect the guest role. Do not change this value in out-of-the-box UICs. For customized UICs, you can choose your own setting.
RunClass
Java class name
N
The class on which runMethod exists
runMethod
Java method name
N
The method to run when the UIAccess is changed.
This represents the name of a method that runs when a UIAccess element associated with this uicomponent is updated.
The signature of this method must be:
void foo(WTPrincipal principal, WTContainer container, boolean isRender)
The principal passed in is the group or user on which to operate. The boolean isRender is the updated value for the UIAccess.
Making a Customized Tab Available to Visibility Administration
Making a customized action available to visibility administration is essentially the same procedure as making an out of the box action available. A tab, however, cannot be managed by container administrators (configuring role-based visibility). Therefore you can only make a customized tab available to site and organization administrators for configuring visibility profiles. This means you can add a <uic> element for the tab only to the <global> section of roleaccessprefs.xml. For example, assume that you have already created a customized tab, and have an associated <MyTab>actions.xml file. You can add the tab to the list for profile-based visibility administration as follows:
1. Add a new uic element to roleaccessprefs.xml under the <global> section with a unique name, for example, CUSTOMIZED_TAB.
<uic name="CUSTOMIZED_TAB" order="190" enabled="true"
defaultAll="true"/>
2. Associate the appropriate actions in actions.xml with the uicomponent.
<action name="list2" uicomponent="CUSTOMIZED_TAB">
<command windowType="page"/>
</action>
3. Add a new entry to roleAccessResource.java with a constant that is the same as the uic name. The value is what is displayed in the profile actions UI. Compile the updated Java file:
@RBEntry("View Customized Tab ")
public static final String PROJECT_CREATE_FOLDERS =
"CUSTOMIZED_TAB ";
4. Restart the servlet engine and the MethodServer.
Assigning One uicomponent to Multiple Actions
If you want to tie one UI component to multiple actions, you need to specify the uicomponent attribute for each of those actions, using the same value. For example, the procedure described in the Procedure - Making an Action Available to Visibility Administration in Solution creates a UI component called PROJECT_CREATE_FOLDERS associated with the folder_create action. You can assign the list_create_folder action to the same UI component by specifying the uicomponent attribute for that action in actions.xml as follows:
<action name="list_create_folder"
uicomponent="PROJECT_CREATE_FOLDERS" ajax="row">
As a result, the "Create Folders" entry in the Configure Actions for Roles and New Profile pages affects the visibility for both folder_create and list_create_folder actions.
Changing the Labels for a UI Component
You can alter the label used for a UI component in the Configure Actions for Roles and New Profile pages, without making any other changes to that UI component. Simply change the associated resource entry value in the roleAccessResource.java file, and regenerate your bundles. For example:
@RBEntry("Create Folders - My New Label ")
public static final String PROJECT_CREATE_FOLDERS =
"PROJECT_CREATE_FOLDERS ";
Updating Access Control (Advanced Role-Based UI)
It is possible to extend user permissions using Role-Based UI. This can be used for updating real access control (in the form of ad hoc or policy access control lists), or for doing potentially anything else.
This is accomplished by specifying a class/method combination on the uic in the configuration file. The method is called when the associated uicomponent is updated. For example, part of the Role-Based UI feature includes the ability to extend Modify Team permissions. The uic element in the configuration file includes two additional attributes that identify the class and method to call:
<uic name="PROJECT_MODIFY_TEAM" order="30" enabled="true"
defaultAll="false"
defaultManager="true" defaultGuest="false"
managerEnabled="false" guestEnabled="false"

runClass="com.ptc.netmarkets.roleAccess.StandardNmRoleAccessService"
runMethod="modifyTeamPermissions"/>
The only restriction on runClass is that it needs to be accessible from the MethodServer. Given runMethod="myRunMethod", then myRunMethod must have the following signature:
public static void myRunMethod(WTPrincipal principal, WTContainer
container, boolean isRender)
throws WTException
The principal passed in is the group or user on which to operate. The boolean isRender is what the field in the UIAccess table was just set to for the passed in principal.
Was this helpful?