100% found this document useful (1 vote)
1K views52 pages

Windchill Data Utility Customization Guide

This document provides instructions for customizing Windchill by creating and configuring custom data utilities. It discusses: 1. What data utilities are and how they can be used to augment attribute data and customize UI components. 2. How to create a custom data utility class by extending AbstractDataUtility and implementing its methods. 3. How to register the custom data utility in the service.properties.xconf file so UI components can access it. 4. An exercise demonstrating how to create a data utility to customize the part name field on the info page to display both the name and number.

Uploaded by

Vindya Prasad
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views52 pages

Windchill Data Utility Customization Guide

This document provides instructions for customizing Windchill by creating and configuring custom data utilities. It discusses: 1. What data utilities are and how they can be used to augment attribute data and customize UI components. 2. How to create a custom data utility class by extending AbstractDataUtility and implementing its methods. 3. How to register the custom data utility in the service.properties.xconf file so UI components can access it. 4. An exercise demonstrating how to create a data utility to customize the part name field on the info page to display both the name and number.

Uploaded by

Vindya Prasad
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
  • Introduction to Windchill Customization
  • Data Utility Classes
  • Creating a Custom DataUtility Class
  • Registering Data Utility
  • Exercise 1 – Change Part Attribute Field
  • Register Data Utility on Method Server Service
  • UI Validation
  • Exercise 2 – Code
  • Wizard Implementation
  • Picker Configuration
  • Configurable Links

Windchill Customization

Day 03

1
Takeaway
At the end of this session you should be able to
Data Utilities
UI Validation
Wizards
Pickers
Configurable Links

22
Data Utilities
Data utilities are java classes that can be used for customizations that cannot be accomplished
using the available configuration points.
A data utility is used to get the data and meta-data of an attribute and create the UI component
which will be used to render the attribute in the UI. If the data returned by a core API is not
sufficient for creating the UI component, data utilities can be used to augment this data with
additional information. The additional information can be fetched by an additional query, a call to a
service, or whatever else you can get at via Java code.
The OOTB implementations of data utilities provide the behavior defined for Windchill OOTB
applications in accordance with Windchill UI standards.
You can configure a data utility for any attribute id.

33
GUI Components
This component will generally be constructed in the Method Server and then returned to the Servlet Container for rendering.
The GUI Component interface has one method that needs to be implemented:
public void draw (Writer out, RenderingContext renderContext) throws RenderingException;
It just needs to be understand, we will not touch OOTB function.

The following are the OOTB lists of GUI Components


AttributeDisplayComponentCheckBox LocationInputComponent
ComboBox AttributeGuiComponent
DateDisplayComponent AttributeInputComponent
DateInputComponent AttributeInputCompositeComponent
EnumInputComponent BooleanInputComponent
UrlInputComponent NumberInputComponent
IconComponent NumericDisplayComponent
Label NumericInputComponent
PushButton TextArea
RadioButton TextBox
RevisionInputComponent TextDisplayComponent
StringInputComponent PickerInputComponent

44
Implementation : Create Custom DataUtility Class
The data utility interface ([Link]) has three core methods:
The getDataValue method gets the value that should be placed within a particular table cell. Typically, the object that
is returned by this method should be an instance of GUIComponent. This interface has been retrofitted with NmString,
NmDate.
Object getDataValue(String component_id, Object datum, ModelContext mc) throws WTException;
The setModelData method enables the data utility to prefetch data for all the row objects for a particular column that
will be rendered. The method is called before getDataValue is called for any row, and is supplied with a List of all the
objects that will be processed.
void setModelData(String component_id, List objects, ModelContext mc) throws WTException;
The getLabel method enables the data utility to populate the descriptor with the correct label. There is a default
implementation in the AbstractDataUtility for getting a label from a common UI rbinfo file.
String getLabel(String component_id, ModelContext mc) throws WTException;
When using DataUtility, we have to use an abstract super class named AbstractDataUtility generally.
AbstractDataUtility is the child class of DataUtility.

55
Implementation : Sample DataUtility Class
public class CSCLifeCycleDataUtility extends AbstractDataUtility {
public Object getDataValue(String component_id, Object datum, ModelContext mc) throws WTException {
...
// Initialize ComboBox UI Component
ComboBox comboBox = new ComboBox();
[Link](component_id);
[Link]([Link](component_id, datum, mc));

ComponentMode mode = [Link]();
String selectClassName = [Link]([Link]());

Class aClass = [Link](selectClassName);
Vector vecLCTemplate = [Link](aClass,
[Link]().getContainerRef());
for(int k=0; k<[Link](); k++){
lcTemplate = (LifeCycleTemplate)((LifeCycleTemplateReference)[Link](k)).getObject();
[Link]([Link]());
[Link]([Link]());
}

[Link](requstValue); //Key
[Link](displayValue); // display
return comboBox;
}
private String getValue(String component_id, Object datum, ModelContext mc) throws WTException {
return [Link](component_id, datum, mc);
}

66
Implementation : Register Data Utility
Customized data utility class cannot be used directly on GUI Component. All GUI Components can
read service identification which is registered in Method Server services cache – generally registered in
“[Link].”
Example: [Link]

<Service name="[Link]">
<Option
serviceClass="[Link] ity"
requestor="[Link]"
selector="[Link]"
cardinality="duplicate"/>
</Service>

serviceClass: DataUtility Class


Selector: DataUtility Identification name (All GUI Component use this name)

77
Implementation : How to Set Data Utility on the GUI Component
GUI Component will be rendered by using several methodologies, so we have to understand how to
set custom data utility on each of GUI components.
MVC designed – all MVC component has default function for setting data utility. (Tree/Table/Attribute Panel)
JcaTreeConfig treeConfig = (JcaTreeConfig) [Link]();
ColumnConfig col = [Link]("number", true);
[Link](“[Link]");
[Link](col);

Type Managed – Layout attributes. (Wizard/attribute panel in Info page)

88
Exercise 1 — Change Part Attribute Field (Layout)
On the info page of WTPart, primary attribute group has a name value. We will
change the value using DataUtility. After gluing DataUtility, part name field will be
shown name and number.

99
Exercise 1 — Create Data Utility
1 . Create DataUtility class
This class will get instance object from parameter for change label, and reset value using “Label” Component.
– Class name: CSCPartNameDataUtility
– Super Class: AbstractDataUtility
– Override: getDataValue

package [Link];
Import [Link];
public class TrainPartNameDataUtility extends AbstractDataUtility {
@Override
public Object getDataValue(String component_id, Object datum, ModelContext mc) throws WTException {
Label nameComponent = new Label("");
[Link]([Link](component_id, datum, mc));
[Link](component_id);
WTPart part = (WTPart)datum;
[Link]([Link]() + " ( " + [Link]() + " )" );
return nameComponent;
}
}

10
10
Register Data Utility on Method Server Service
2. Update “[Link]” for registering custom data utility
Open “$WT_HOME/codebase/[Link]” and add the following block at the end of the file. Actually, it must be
located in the front of the “</Configuration>” tag.
<Service context="default" name="[Link]">
<Option serviceClass="[Link]"
selector=“myPartNameDataUtility"
requestor="[Link]" DataUtility class
cardinality="duplicate" /> DataUtility Id
</Service>
3. Register service on system configuration
Open Windchill shell and execute “xconfmanger –p”

11
11
Set Data Utility ID on Part Primary Attributes Layout
4. Open type manager and select part object. Finally, set data utility ID on name attribute
A. Open Site > Utilities > Type and Attribute Management
B. Select Manage Types tab and select Part object
C. Select action menu on part detail page and select Edit menu
D. Select Layout tab and select “Primary Attributes Info Page Layout” of Layouts menu.
E. Select detail button of name attributes
F. Set data utility ID named “myPartNameDataUtility” on the editing window of name

12
12
Test Result
6. Restart Method Server and Test
Open part information and check name attribute

13
13
UI Validation
The UI Component Validation Service was created to give Windchill clients a central service to call to perform validation for
actions and other components appearing in the Windchill UI.
The following categories of validation are available :
Pre-Validation
The first category of UI Validation is referred to as Pre-Validation. This is the category of validation that most people will first associate with UI
Validation. Pre- Validation is a term that describes the process of determining whether or not a UI Component should be available in the UI. An
example of Pre-Validation would be disabling the “check-in” action for an object that is not checked-out. Pre-Validation can be applied to both actions
and attributes in the UI. Of the three types of UI Validation, this type is the most often-used.
Post-Select Validation
A second category of UI Validation is Post-Select Validation. Post-Select Validation is the process of determining whether or not an action should be
allowed to proceed once it is selected in the UI. An example of post-select validation would be displaying an error message and not allowing the
checkout to proceed if a user tries to perform a checkout on an object that is already checked out. Post-Select Validation applies only to actions.
Post-Submit Validation
The final category of UI Validation is Post-Submit Validation. This type of validation is used exclusively in wizards or other forms where users enter
data. An example of Post-Submit Validation would be stopping a user from moving to the next step in a wizard because the data they’ve entered in
the current step is invalid. Post-Submit Validation applies only to wizard steps and wizard submissions.

14
14
UI Validation
To create a Validator, you’ll need to create a subclass of [Link].
[Link]. There are currently five public methods defined in
DefaultUIComponentValidator. java which can be overriden:
performFullPreValidation()
performLimitedPreValidation()
validateFormSubmission()
validateSelectedAction()
validateSelectedMultiSelectAction()
For those methods which you do not override, the default behavior (always enable/ permit) will be
inherited from the DefaultUIComponentValidator class Validator classes must be registered via
xconfmanager in [Link]. The validation service uses the service entries to find the correct
Validator for a specific validation key, (action). The format of the entry should be as shown below :
[Link]/rsc/default/[Link]/<validationKey>/
null/0=[Link]

15
15
UI Validation
validateSelectedAction
This method is called by a client application to determine if an action selected by the user from the UI can be performed. For example, if a user selects
the Revise action from the UI, the validateSelectedAction method is used to determine if the Revise action should proceed.
public UIValidationResult validateSelectedAction (String validationKey, UIValidationCriteria validationCriteria, Locale locale)
validationKey
Identifies the action being validated as defined in [Link]
UIValidationCriteria
Bean to hold the data that has been set by the client and passed to the validation service The return type is UIValidationResult whose attributes include a
status field indicating if the requested action is permitted. UIValidationResult should be set up as shown in the code snippet below
UIValidationStatus status = null;
UIValidationFeedbackMsg msg = null;
if (we can allow this action to proceed){status = [Link]; }
else{ status = [Link];
msg = new UIValidationMsg(localized text, [Link]) }
return new UIValidationResult(a_key, contextObject, status, msg);

16
16
UI Validation
validateSelectedMultiSelectAction
This method is similar to the validateSelectedAction method, but in this case a different object, UIValidationResultSet is returned.
public UIValidationResultSet validateSelectedMultiSelectAction (String validationKey,UIValidationCriteria validationCriteria, Locale locale)
validateFormSubmission
This method is called by the client to validate user entered form data.
public UIValidationResult validateFormSubmission (String validationKey, UIValidationCriteria validationCriteria, Locale locale)
performFullPreValidation
This method is called by the client to check if an action should be displayed in the UI
public UIValidationResult performFullPreValidation (String validationKey, UIValidationCriteria validationCriteria, Locale locale)
performLimitedPreValidation
This method is called by the client to check if an action should be displayed in the UI, behaves in a similar way as
performFullPreValidation. The intention is that the limited validation is less thorough than full validation, but will perform quicker
public UIValidationResult performLimitedPreValidation (String validationKey, UIValidationCriteria validationCriteria, Locale locale)

17
17
Exercise 2
A form validator is required to check the value of the NAME attribute when creating
a new [Link] value entered should be checked to ensure that the name does not
not contain the "!" character
1. Check if any validator is already implemented against the "New Part" action
2. Create validator class, [Link]
3. Implment a custom methods to extract name field from form data and validate
4. Register the validator

18
18
Exercise 2 - Code
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link].*;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class partNameValidator extends CreatePartActionValidator implements UIComponentValidator {
private static final Logger log = [Link]([Link]());

19
19
Exercise 2 - Code
@Override
public UIValidationResult validateFormSubmission(UIValidationKey validationKey,UIValidationCriteria validationCriteria, Locale locale) throws WTException {
UIValidationResult defaultResult = [Link](validationKey,validationCriteria,locale);
[Link]("validationCriteria====> :: "+validationCriteria);
UIValidationStatus defaultStatus = [Link]();
[Link]("[Link]====> :: "+ [Link]());

if(!([Link]().equals("[Link]")))
return defaultResult;
UIValidationStatus status = null;
UIValidationFeedbackMsg feedbackMsg = null;
String SuppliedName = getNameFromForm(validationCriteria);
[Link]("SuppliedName====> :: "+SuppliedName);
if(validName(SuppliedName)){
status = [Link];
}else{
status = [Link];
feedbackMsg = [Link]("Name Contains Invalid Character",[Link]);
}
return [Link](validationKey,status,feedbackMsg);
}

20
20
Exercise 2 - Code
private String getNameFromForm(UIValidationCriteria validationCriteria) throws WTException {
String name = null;
Map fromDataMap = [Link]();
Iterator it = [Link]().iterator();
while([Link]()){
String key = (String)[Link]();
[Link]("key====> :: "+key);
if([Link]("MBA|name")){
name = (String)[Link](key);
}
}
[Link]("getNameFromForm====> :: "+name);
return name;
}

private boolean validName(String name) throws WTException {


boolean valid = true;
[Link]("validName====> :: "+name);
if([Link]("!")) valid = false;

[Link]("valid====> :: "+ valid);


return valid;
}

21
21
Exercise 2 – Compile and Register
ant -f bin/[Link] class -[Link]=[Link] -[Link]=%wt_home%/src/com/ptc/training/mvc/validator

[Link]
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Configuration
SYSTEM "[Link]">
<Configuration>
<Service context="default" name="[Link]">
<Option serviceClass="[Link]"
requestor="null"
selector="createPartWizard"
cardinality="duplicate"
targetFile="codebase/[Link]"
/>
</Service>
</Configuration>

xconfmanager -i %wt_home%/codebase/com/ptc/training/[Link]

xconfmanager –p

Restart the Windchill to test the validator

22
22
Wizard
Wizards are popup windows that are used to
guide you step by step through the process of
creating an object, or performing an operation
on an object. A wizard is a user interface
consisting of a sequence of steps that lead the
user through a specific task one step at a time,
the user clicks next to move through the steps.
All wizard JSP pages must be located at
“$WT_HOME/codebase/netmarkets/jsp”
because wizard is controlled and calls several
EXT-JS functions and the JavaScript located on
the netmarkets directory. (IMPORTANT)

23
23
Architecture of Wizard
Base Wizard
• <%@ taglib prefix="jca" uri="[Link]
Tag declaration is required for using the JCA component. (Required)
• <%@ include file="/netmarkets/jsp/components/[Link]"%>
• <%@ include file="/netmarkets/jsp/components/[Link]"%>
It is similar to “[Link]” of the general JCA page, but you have to use the above JSPF
for wizard.

• %@include file="/netmarkets/jsp/util/[Link]"%
If it includes the latest file, it is the same JSPF with a general JCA declaration.

24
24
Architecture of Wizard
After completing basic environment configuration, you should design a detailed wizard page which includes wizard page design and
step design. The following are details of basic understanding of wizard .

1. First of all, you have to design all steps on the base wizard and decide which wizard steps should be called JSPs.
2. Basically all step pages will be loaded on the session when loading basic wizard page. It seems like all step pages
include pages of basic wizard, although all step pages have independent JSP pages. When loading wizard page, if one
step page has an error, the system will not be able to load all wizard pages.
3. If the step is to show the page base on the previous page’s information, we can set a preload flag using
“preloadWizardPage” on step configuration which exists on the “<action>” tag in “[Link].” However, it can be used only
for one time loading. After loading this page, it can’t be reloaded although you can return to the previous page and
change information.
4. Each wizard step is an independent JCA page.
5. Each wizard step configuration is set on “[Link].” Base wizard will just call the action name.
25
25
Architecture of Wizard
Generally wizard form process will be extended from the “DefaultObjectFormProcess” class.

Sample of Form Process


Overriding doOperation(), postProcess() or
preProcess() FormProcess.
Generally wizard information will be
included on NmCommandBean.
Form processor function must return form
result for the end action of wizard.

26
26
Exercise 3 — Creating a Simple Wizard
Design of Wizard Customization
Add a new toolbar button for calling the wizard. The button
also includes FormProcessor. (Add one action and modify
the toolbar action.)
Create one wizard page (JSP page).
Create two step pages (JSP or MVC page).
Add two actions for step page (add actions) – because
wizard page calls action name for adding step page on
wizard.
Customization Action
1. Add action for button.
2. Add action for step.
3. Create Resource Bundle.
4. Modify folder toolbar actionModel.
5. Create wizard body JSP.
6. Create wizard step MVC & JSP.
7. Create Form Processor.

27
27
Configure Step and Base Wizard
1. Design actions for step and button
On the wizard configuration, you have to set the execution class. And you also have to take an action for each
step, and configure which JSP or MVC page needs to call from step action.
$WT_HOME/codebase/config/actions/[Link]

<objecttype name="cscwizard" class="" resourceBundle="[Link]">


<action name="wizardSamples">
<command windowType="popup" class="[Link]" method="execute"
url="netmarkets/jsp/csc/[Link]"/>
</action>
<action name="show_mvc_content">
<component windowType="wizard_step" name=“[Link]"/>
</action>
<action name="show_jsp_content" preloadWizardPage="false">
<command windowType="wizard_step" url="netmarkets/jsp/csc/[Link]"/>
</action>
</objecttype>

• <action name="wizardSamples”>
– Button action for calling wizard. This action should be set for calling back form processor.

• <action name="show_mvc_content"> <action name="show_jsp_content">


– Action configuration for step page
28
28
Add Button on Folder Toolbar
2. Add one button on Folder toolbar
For starting the wizard, we have to use one button or menu link. This button or menu will include wizard executing process when all
steps of wizard are completed.

$WT_HOME/codebase/config/actions/[Link]
<model name="folderbrowser_toolbar_actions">
<description>Folder browser toolbar actions menu for all Folders.</description>
<action name="wizardSamples" type="cscwizard" shortcut="true"/>
<action name="separator" type="separator"/>
<submodel name="folderbrowser_toolbar_open_submenu" />
<action name="separator" type="separator" />
<submodel name="folderbrowser_toolbar_new_submenu" />
<action name="separator" type="separator" />
<action name="list_cut" type="object" />
……
</model>
Copy the whole block named “folderbrowser_toolbar_actions” from “[Link]”
Add custom action on the folder browser toolbar for calling the wizard.
<action name=“wizardSamples” type=“cscwizard” shortcut=“true”/>
<action name=“seperator” type=“seperator”/>
Don’t touch other existing actions.

29
29
Create Wizard Page
3. Create wizard page
The wizard page includes step page configuration, and also the wizard page and the step page will be merged on a same one page
internally. So if you have constants or whole environment, you can set those on wizard page design. The following is just a simple
wizard source. If you want to add more complexity, you can make your source code. However, you should keep this format at least.
$WT_HOME/codebase/netmarkets/jsp/csc/[Link]
<%@ taglib prefix="jca" uri="[Link]
<%@ include file="/netmarkets/jsp/components/[Link]"%>
<%@ include file="/netmarkets/jsp/components/[Link]"%>

<jca:wizard title="Create Part Sample For CSC">


<jca:wizardStep action="show_mvc_content" type="cscwizard" label="Insert Part Attribute"/>
<jca:wizardStep action="show_jsp_content" type="cscwizard"/>
</jca:wizard>
<%@include file="/netmarkets/jsp/util/[Link]"%>

For setting a wizard, you have to use JCA tag.


jca:wizard>: Configuration for body of wizard
<jca:wizardStep>: Configuration for wizard step
You must use “[Link]” instead of “[Link]” for wizard page, and also you have to include “[Link]” for sending wizard request
to server.

30
30
Create a Wizard Step
4. Create a wizard step
This sample has two wizard steps. One will call MVC. Another will call a JSP page. In action configuration, we already set “[Link].” It
is OOTB MVC function, so it doesn’t need to create a new MVC. If you want to add your MVC in the step, you have to design and create for your step.
$WT_HOME/codebase/config/actions/[Link]
<action name="show_mvc_content">
<component windowType="wizard_step" name=“[Link]"/>
</action>
It is OOTB. No need
<action name="show_jsp_content" preloadWizardPage="false"> new create
<command windowType="wizard_step" url="netmarkets/jsp/csc/[Link]"/>
</action>
$WT_HOME/codebase/netmarkets/jsp/csc/[Link]
<%@ taglib prefix="jca" uri="[Link]
<%@ include file="/netmarkets/jsp/components/[Link]" %>
<%@ include file="/netmarkets/jsp/components/[Link]" %>

JSP PAGE FOR WIZARD STEP

<%@include file="/netmarkets/jsp/util/[Link]"%>

Note: Although a step page is included in the wizard body, the step also has same architecture like a wizard body.

31
31
Create a Resource Bundle
5. Create a Resource Bundle
We set the custom resource bundle for displaying action name, so we have to make a resource bundle file.

$WT_HOME/codebase/config/actions/[Link]
<objecttype name="cscwizard" class="" resourceBundle="[Link]">

$WT_HOME/codebase/ext/csc/training/resource/[Link]
package [Link];

import [Link];
import [Link];
import [Link];
import [Link];

@RBUUID("[Link]")
public final class CSCTrainingRB extends WTListResourceBundle {
@RBEntry("Wizard Sample")
public static final String PRIVATE_CONSTANT_7 = "[Link]";
@RBEntry("Wizard-current_step.gif")
public static final String PRIVATE_CONSTANT_8 = "[Link]“;
@RBEntry("Show MVC Content")
public static final String PRIVATE_CONSTANT_9 = "cscwizard.show_mvc_content.description";
@RBEntry("Show JSP Content")
public static final String PRIVATE_CONSTANT_10 = "cscwizard.show_jsp_content.description";
}

32
32
Test Wizard
6. Restart the Service and check the result.

33
33
Picker
1. Picker is not exactly customization. It is mostly about configuration.
2. Windchill core has several picker components. You just choose a usable picker for correct requirement. (If you
want to make a special picker component, it is a very complex customization. If possible, avoid that
customization.)
3. The following is the readied system component generally used.
User Picker
Organization Picker
Context Picker
Item Picker
Type Picker
Participant Picker

4. For the above picker, WC10 uses 3 kinds of tags as follows.


<%@ taglib prefix="wctags" tagdir="/WEB-INF/tags" %>
<%@ taglib uri="[Link] prefix="p"%>
<%@ taglib uri="[Link] prefix="jca"%>

34
34
User Picker
<wctags:userPicker id="testUserPicker" label="MyUserPicker"/>
The user picker is used when you have a requirement to select specific user(s) depending upon certain criteria and use them in
your application. Typical use case could be that you may want to find parts which are created by a certain user. In this case, you
can have a user picker and then through this you can select the user and pass it onto the search criteria to perform search for
parts.

35
35
Organization Picker
<wctags:organizationPicker id="orgPicker" label="MyOrgPicker"/>
The organization picker is used when you have a requirement to select specific organization(s) depending upon certain criteria and use
them in your application. Typical use case could be that you may want to find parts that are available in a particular organization. In this
case, you can have an organization picker and then through this you can select the organization and pass it onto the search criteria to
perform search for parts.

36
36
Context Picker
<wctags:contextPicker id="contextPicker" label="MyContextPicker"
pickerTitle="ContextPicker" />
The context picker is used when you have a requirement to perform an operation that is based on a certain context.

37
37
Item Picker
<wctags:itemPicker id="itemPicker" label="MyItemPicker" pickerTitle="ItemPicker"/>
The item picker is used when you have a requirement to select specific business object(s) depending upon certain criteria and use
them in your application.

38
38
Type Picker
Type Picker Common Component is to be used either for display or for assignment of type-able items. For example, in a search application to select
the type of objects that you are interested to do a search on or in a create application to create an item of a specific type. It can be used to display the
type in case of edit or view applications. The component can be used in the context/mode of CREATE, EDIT, SEARCH, or VIEW.

39
39
Format of Type Picker
Type Picker has several types of format like the following: Tree Type, Table Type, and Drop-Down

Type Picker in a “Drop-Down” format


<p:typePicker id="typePickerTest" label="Type : " mode="SEARCH" >
<p:pickerParam name="format" value="dropdown" />
</p:typePicker>
Type Picker in a “table” format
<p:typePicker id="typePickerTest" label="Type : " mode="SEARCH" >
<p:pickerParam name="format" value="table" />
</p:typePicker>
Type Picker in a “tree” format
<p:typePicker id="typePickerTest" label="Type : " mode="SEARCH" >
<p:pickerParam name="format" value="tree" />
</p:typePicker>

40
40
Participant Picker
The current way of picking of participants is limited to Users and Groups and is not consistent across Windchill. The new Participant Picker Common
Component gives a consistent behavior across Windchill. Participant Picker gives you the ability to search Participants of type User, Group, and
Organization. It provides a wide variety of search scope criteria which can be used to narrow down the search.

<jca:participantPickeractionClass="[Link]" actionMethod="addPrincipal"
participantType="<%= [Link] %>"> > </jca:participantPicker>

41
41
Item Master Picker
Item Master picker just tries to find the mastered object.

<wctags:itemMasterPicker id="itemMasterPicker" label="MyItemMasterPicker"/>

42
42
Picker Process

43
43
Exercise 4 — Item Picker
Design of Item Picker
Item Picker can be designed by the customer in cases
such as:
Search Criteria
Target Search Object
Other pickers are designed by the system, so you just call
target picker using tags.

44
44
Exercise 4 — Item Picker
Create a Search Criteria Set – Item Picker
Before you create a picker pop-up window, you should set search attribute set.
The Set file is located in “$WT_HOME/codebase” and the file name is “[Link].”
We will use the following sample for searching WTPart, so the objectType is set as “[Link].”
The attribute name should be used for object’s model or IBA logical name. The name can be checked in the Property Report.
Each Display name is registered in ResourceBundle, so the file name is the bundle’s key.

45
45
Exercise 4 — Item Picker
Create a Picker Page
Previously you made a picker component, so you will make the picker base (parent page) using this component.
Creating a Picker base (parent page) is same as creating a JCA page, so you should set and include all taglib.
Additionally, you should set “wctags” taglib.

46
46
Exercise 4 — Item Picker
Previously you made picker component, so you will make the picker base (parent page) using this component.
Picker base (parent page) is of same architecture as a JCA page, so you should set and include all taglib.
Additionally, you should set “wctags” taglib.

47
47
Exercise 4 — Item Picker
Picker Resource Bundle
The resource bundle is located at “$WT_HOME/src/com/ptc/windchill/enterprise/search/client.” Resource Bundle file name is “[Link].”
Copy all java codes to eclipse compiled directory.
If you are not using the existing locale, add the locale java code which is copied from “[Link].”
Finally add custom resource on java code.

package [Link];
import [Link].*;
@RBUUID("[Link]")
public final class searchClientResource extends WTListResourceBundle {
…….
@RBEntry("Custom Number")
@RBComment("Custom Number")
public static final String CUSTOM_NUMBER_LABEL = "CUSTOM_NUMBER_LABEL";
@RBEntry("Custom Name:")
@RBComment("Custom Name")
public static final String CUSTOM_NAME_LABEL = "CUSTOM_NAME_LABEL";
}

48
48
Exercise 4 — Item Picker
Picker Callback Function
The previous JSP page should include the JavaScript function for a picker callback. The picker pop-up page will return to parent page’s JS function about
selected object information. The picker will call the function when you create the picker tag within pickerCallBack’s name.

<script>
function partPickerCallback (objects, pickerID)
{
[Link](pickerID
+"$label$").setAttribute("value",[Link][0].name);
[Link](pickerID
+"$label$___old").setAttribute("value",[Link][0].name);
}
</script>
<wctags:itemPicker id="cscPickerForPart" label="Custom Part Picker"
pickerTitle="Demo Part Search" showVersion="false"
objectType="[Link]" showTypePicker="false"
componentId="cscPartPicker" pickerCallback="partPickerCallback“
/>

49
49
Exercise 4 — Item Picker
result

50
50
Configurable Link
Special link types, known as configurable links, are provided which can be used to
configure and display additional relationship tables on document and part
information pages. JSP files have been provided to allow sites to implement and
display these configurable link tables. The tables then display in the navigation link
menus on the information page.
An example has been provided out-of-the-box for each of the configurable link
types, including tables for both the parent type and child type information pages.
The following files are delivered for the example:
<Windchill>/loadfiles/configurableLinks/[Link]
The load file loads both the link types and the association constraints

51
51
Installing the Configurable Links Example
Use the following procedure to install the configurable links example.
1. Open a windchill shell.
2. Enter the following command:
xconfmanager -i
<Windchill>/codebase/com/ptc/windchill/enterprise/[Link] -p
3. Restart your method server.
4. Load the loadfile:
windchill [Link] -d
<Windchill>/loadfiles/configurableLinks/[Link]

52
52

Common questions

Powered by AI

Beyond registration, integrating a custom data utility into Windchill's GUI components involves detailed methodological considerations. Firstly, the MVC design pattern should be employed, effectively utilizing its default functions for data utility settings in components like trees and tables. The data utility's ID, registered during the registration phase, must be assigned to specific component attributes through the Type Manager. This involves configuring layouts, such as adjusting 'Primary Attributes Info Page Layout', where the data utility ID is mapped to the target attribute, ensuring contextual rendering .

Creating and registering a custom UIComponentValidator in Windchill involves several key steps. First, subclass the DefaultUIComponentValidator.java to define specific validation logic for required methods like validateFormSubmission() or validateSelectedAction(). Next, compile the subclass using an appropriate build script, ensuring compilation details include class paths and output locations. Then, register the validator through 'service.properties.xconf', updating configuration entries with the validator class and ensuring the service context and selectors are correctly set. Finally, execute the xconfmanager commands to integrate and activate these changes, followed by a restart of the Windchill server to ensure the validator is operational .

UI Validation in Windchill is categorized into Pre-Validation, Post-Select Validation, and Post-Submit Validation, each affecting user interactions differently. Pre-Validation determines component availability in the UI, preventing users from interacting with unpermitted elements, such as disabling a 'check-in' action for a non-checked-out object. Post-Select Validation checks if an action can proceed after selection, offering feedback or preventing operation if prerequisites are not met, like stopping a double checkout. Post-Submit Validation applies during wizard operations, blocking progression when invalid data is entered, ensuring required fields are completed correctly before advancing in processes .

Post-submit validation plays a crucial role in ensuring data integrity during wizard-based processes in Windchill by preventing users from proceeding with incomplete or invalid data. It acts as a checkpoint at the end of each wizard step that requires user input, evaluating whether all necessary conditions are met before allowing progression. This validation helps maintain data integrity by enforcing constraints and dependencies specified for data fields, thus reducing errors and preventing invalid operations within wizard-driven workflows .

The "preloadWizardPage" feature enhances user experience in Windchill wizards by preloading pages with information from previous steps based on predefined configurations in 'action.xml'. This preload allows smoother navigation and continuity for complex processes requiring context transition between steps. However, it is limited by its one-time use per session loading, meaning reloading upon returning to previous steps is not supported, which can inconvenience users needing to adjust initial entries based on successive step insights. Thus, prudent design is necessary to optimize its utility while acknowledging its constraints in workflow flexibility .

Resource bundles in Windchill wizards facilitate internationalization and customization by encapsulating UI texts and labels into centralized, externalized strings referenced by wizards. This organization allows for easy localization, as different language packs can replace resource files without altering the core code. Customization is also enhanced by allowing changes in UI terminology and branding without deep code modifications. Each entry in the resource bundle corresponds to interface elements, ensuring a consistent user experience while supporting diverse linguistic and regional preferences .

Wizards improve usability in Windchill by guiding users through complex tasks in a structured, step-by-step manner, minimizing errors and cognitive load. The key components of wizard architecture include JSP pages for both the base wizard and individual steps, a configuration setup in 'action.xml' to control sequencing and functionality, and resource bundles for interface customizations. Wizards also include form processors for handling transitions, ensuring data integrity, and maintaining consistent flow through actions and MVC components. Detailed configurations using JCA components and predefined tag inclusions further assist in integrating these functionalities into Windchill's UI .

The "getDataValue" method is central to customizing the ComboBox UI component in Windchill by determining the internal and display values assigned to the ComboBox. Within this method, a ComboBox instance is initialized and configured with names and columns derived from attribute utility helpers and model contexts. The method finds candidate templates through lifecycle services and populates the ComboBox with names from lifecycle templates, handling both internal request values and visible display values, thus tailoring its behavior in the Windchill UI .

Custom data utilities in Windchill are registered and utilized through the Method Server's services cache, referencing a unique identifier specified in service properties configurations, typically in a file like 'service.properties.xconf'. Once registered, GUI components refer to the data utility using its identification name specified as part of the registration. This integration allows the GUI components to read service identifications and apply the corresponding behavior defined by the customization .

Data utilities in Windchill serve to enhance UI components when default core API data is insufficient by providing a mechanism to fetch additional information that augments the available data. This additional data can be retrieved through various means such as making additional queries, calling services, or accessing any data available via Java code. The GUI component associated with data utilities typically returns an instance of a GUIComponent to the rendering context, benefiting from augmented meta-data and attribute data for an enriched UI component .

1 
Windchill Customization 
Day 03
2 
 Takeaway 
At the end of this session you should be able to  
Data Utilities 
UI Validation 
Wizards 
Pickers 
Configurabl
3 
Data Utilities 
Data utilities are java classes that can be used for customizations that cannot be accomplished 
using the
4 
GUI Components 
4 
This component will generally be constructed in the Method Server and then returned to the Servlet Cont
5 
Implementation : Create Custom DataUtility Class 
5 
The data utility interface (com.ptc.core.components.descriptor.DataUt
6 
Implementation : Sample DataUtility Class  
6 
 
public class CSCLifeCycleDataUtility extends AbstractDataUtility {  
publ
7 
Implementation : Register Data Utility 
7 
Customized data utility class cannot be used directly on GUI Component. All GUI
8 
Implementation : How to Set Data Utility on the GUI Component  
8 
GUI Component will be rendered by using several methodo
9 
Exercise 1 — Change Part Attribute Field (Layout) 
On the info page of WTPart, primary attribute group has a name value. W
10 
Exercise 1 — Create Data Utility  
1 . Create DataUtility class  
This class will get instance object from parameter for

You might also like