Windchill: Using custom actions in profiles

 IT, Java  Kommentare deaktiviert für Windchill: Using custom actions in profiles
Jan 272015
 

Windchills profile mechanism allows the administrator to show or hide UI components such as attributes and actions. Profiles can be defined on site or organisation level. The Product or Library manager is able to override the profiles from the team page on the product / library by using the Configure Actions for Roles mechanism.

The custom actions (defined in Windchill\codebase\config\actions\customActions.xml) are not directly visible when creating or changing a profile. To make them visible (and selectable) inside the profiles, you have to add them to the config file for profiles (Windchill\codebase\roleaccessprefs.xml)

Example customActions.xml:

<listofactions>
	<objecttype name="object" class="java.lang.Object" resourceBundle="com.pbo.resource.NavigationRB">
		<action name="testPhilipp">
			<command url="netmarkets/jsp/test.jsp" windowType="popup"/>
		</action>
	</objecttype>
</listofactions>

To make the action „testPhilipp“ available in the profiles, you have to add an <uic> element in the roleaccessprefs.xml file:

<product labelId="productLabel">
	 <!-- Adding the action "testPhilipp" to the product level -->
	  <uic name="testPhilipp" order="1010" enabled="true" defaultAll="false" defaultManager="true" 
	          defaultGuest="false" managerEnabled="true" guestEnabled="false"/>

The value of the attribte name in the action-tag must be equal to the name attribute in the uic tag. It is also possible to add a uicomponent attribute when defining your custom action and use its value to reference the action in the roleaccessprefs.xml:

<listofactions>
	<objecttype name="object" class="java.lang.Object" resourceBundle="com.pbo.resource.NavigationRB">
		<action name="testPhilipp" uicomponent="myUicName">
			<command url="netmarkets/jsp/test.jsp" windowType="popup"/>
		</action>
	</objecttype>
</listofactions>

roleaccessprefs.xml:

<product labelId="productLabel">
	 <!-- Adding the action "testPhilipp" to the product level -->
	  <uic name="myUicName" order="1010" enabled="true" defaultAll="false" defaultManager="true" 
	          defaultGuest="false" managerEnabled="true" guestEnabled="false"/>

 

Now you can restart Windchill and you will see your action „testPhilipp“ when changing or creating a profile. To show a more detailed (and maybe localized) name you can use ResourceBundles. Add an entry to the roleAccessResource.rbInfo file.