Client Customization Programmers Guide
Client Customization Programmers Guide
Publication Number
PLM00075 H
Proprietary and restricted rights notice
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Index-1
Figures
PropertyCheckbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-188
TitledPropertyCheckbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-189
PropertyRadioButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-189
TitledPropertyRadioButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-190
PropertyToggleButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-190
TitledPropertyToggleButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-191
LOVPopupButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-191
TitledPropertyLOVButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-192
PropertyLOVPopupButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-193
TitledPropertyLOVCombobox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-193
PropertyCheckboxOptionLov . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-194
TitledPropertyCheckboxOptionLov . . . . . . . . . . . . . . . . . . . . . . . . . . 3-194
PropertyRadioButtonOptionLov . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-194
TitledPropertyRadioButtonOptionLov . . . . . . . . . . . . . . . . . . . . . . . . 3-195
PropertyToggleButtonOptionLov . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-195
TitledPropertyToggleButtonOptionLov . . . . . . . . . . . . . . . . . . . . . . . 3-195
PropertyObjectLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-196
TitledPropertyObjectLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-197
PropertyLongText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-198
TitledPropertyLongText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-198
TitledPropertyLogicalPanel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-198
PropertyArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-199
TitledPropertyArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-200
PropertyImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-201
Delete dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-203
Expanded Delete dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-203
Progress indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-203
Completion indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-204
LOV dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-206
LOV panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-207
LOVPopupButton with no arguments . . . . . . . . . . . . . . . . . . . . . . . . 3-208
LOVPopupButton with arguments and popup window . . . . . . . . . . . . 3-209
OrgSelectionDialog component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-210
Organization dialog box search feature . . . . . . . . . . . . . . . . . . . . . . . 3-211
Referencers panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-212
Referencers reverse horizontal node layout . . . . . . . . . . . . . . . . . . . . 3-212
Referencers tree look node layout . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-213
Referencers vertical node layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-213
Item revision UI component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-214
Role panel in the Organization Selection dialog box . . . . . . . . . . . . . . 3-215
Group panel in the Organization Selection dialog box . . . . . . . . . . . . . 3-216
User panel in the Organization Selection dialog box . . . . . . . . . . . . . . 3-217
Usage of the TCTypeRenderer class . . . . . . . . . . . . . . . . . . . . . . . . . 3-218
Initial state of an AbstractPopupButton component . . . . . . . . . . . . . . 3-219
AbstractPopupButton component popup window . . . . . . . . . . . . . . . . 3-219
Table created using GenericTableModel component . . . . . . . . . . . . . . 3-221
Horizontal button layout with center alignment . . . . . . . . . . . . . . . . . 3-222
Results of resizing the dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-223
Horizontal button layout with left alignment and a 20-unit gap . . . . . . 3-223
Results of resizing the dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-224
Horizontal button layout with right alignment and a 20-unit gap . . . . 3-224
Results of resizing the dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-225
Vertical button layout with center alignment . . . . . . . . . . . . . . . . . . . 3-226
Vertical button layout with top alignment . . . . . . . . . . . . . . . . . . . . . 3-227
Tables
http://www.oracle.com/technetwork/java/javase/
downloads/index.html
http://archive.eclipse.org/eclipse/downloads/index.php
• Thin client
To successfully customize the thin client, you should be
familiar with the following:
o JavaScript
• Thin client
You do not have to do anything else to enable thin client
customization.
Configure client • Rich client
customization
Once you install the prerequisites and set up the Eclipse
IDE, no additional steps are required to configure rich client
customization.
• Thin client
No additional steps are required to configure thin client
customization.
Client interfaces
Teamcenter provides several interfaces, including a rich client interface, a
Web-based thin client interface, a Business Modeler IDE, and Teamcenter Client
for Microsoft Office. Because only the rich client and thin client interfaces have
supported customization methods, these are the only two interfaces that Siemens
PLM Software certifies for customization.
For more information about Teamcenter interfaces, see Getting Started with
Teamcenter.
1 Back and The Back and Forward buttons allow you to move between
Forward loaded Teamcenter applications. The small arrows next
to the buttons let you select from the list of currently
loaded applications.
For more information about moving between loaded
applications, see the Rich Client Interface Guide.
Note
On Windows systems, operational status for the rich client interface and the
Teamcenter server is provided by the Teamcenter icon in the system tray.
To display the running status dialog box, click the Teamcenter icon in the
system tray .
The server and user interface condition symbols show the current status of
the rich client interface and the Teamcenter server.
• The server status indicates the state of the Teamcenter server:
o The server is ready, but there is no current communication
between the client and the server.
The thin client interface has a standard menu bar and toolbar with options that vary
depending on the currently active application. You can place the cursor over a thin
client toolbar button to display a tooltip description.
The default layout for thin client applications has a header bar containing menus
and session information above three panes, arranged vertically side-by-side. Some
thin client applications arrange the component pane and the data pane horizontally.
The layout configuration for a thin client application can only be changed by
customization.
Note
If instant messaging is configured, the data pane may also display the current
Microsoft Office Communicator status of the owning and last modified users.
For more information about configuring instant messaging, see the Application
Administration Guide.
Syntax definitions
This manual uses a set of conventions to define the syntax of Teamcenter commands,
functions, and properties. Following is a sample syntax format:
harvester_jt.pl [bookmark-file-name bookmark-file-name ...]
[directory-name directory-name ...]
The conventions are:
Bold Bold text represents words and symbols you must type exactly as
shown.
In the preceding example, you type harvester_jt.pl exactly as
shown.
Italic Italic text represents values that you supply.
In the preceding example, you supply values for bookmark-file-name
and directory-name.
text-text A hyphen separates two words that describe a single value.
In the preceding example, bookmark-file-name is a single value.
[] Brackets represent optional elements.
... An ellipsis indicates that you can repeat the preceding element.
2 Enterprise-wide configuration
2 Enterprise-wide configuration
Enterprise-wide configuration
You can use the following tools to apply enterprise-wide changes for all clients.
• Business Modeler IDE
For more information, see Using the Business Modeler IDE.
• Style sheets
For more information, see Using style sheets.
• Command suppression
For more information, see Suppressing menu commands.
o Properties
o Rules
For more information about the Business Modeler IDE, see the Business Modeler
IDE Guide.
Note
If all commands are removed from a menu, the menu itself is deleted. If
commands are suppressed, redundant dividers are removed.
• Suppressing menu commands in both the thin client and rich client
To suppress menu commands in the thin client, Siemens PLM Software
recommends you use the Command Suppression application in the rich
client. This hides the commands in both the thin client and rich client. The
WEB_menu_entry_suppressions Web-specific preference must have no
values to work correctly. Some commands are unique to the thin client
and do not appear in the standard menu list in the Command Suppression
application. These commands can be found under the dhtml heading.
For more information about command suppression, see the Command
Suppression Guide.
• The customization affects both the rich client and thin client.
You can use style sheets to change the layout of pages such as forms, the Properties
dialog box, the Summary view, and the creation wizard dialog boxes.
Style sheets are XML documents stored in XMLRenderingStylesheet datasets.
This gives more control to sites regarding how dialog boxes are displayed. The XML
code allows sites to define a subset of properties to display, the display order, the
user interface rendering components to be used, and more. Sites can use XML code
to customize not only forms but also individual fields in the forms. To see all the
available style sheets, search for all the XMLRenderingStylesheet datasets.
When a style sheet is registered for a specific object type or form, it defines the
display of the object or form properties. Registration information is stored in
• Form
Defines the layout of forms, such as the Item Master form or the Item
RevisionMaster form.
For more information, see Form style sheet.
• Summary
Defines the layout of the Summary tab.
For more information, see Summary style sheet.
• Create
Defines the layout of dialog boxes used in the creation wizard when you
choose File→New→Other and some portions of dialog boxes when you choose
File→New→object.
For more information, see Create style sheet.
• Summary 2007
Defines the layout used in the My Teamcenter (2007) perspective.
For more information, see Summary 2007 style sheet.
These types are set on a style sheet using the Stylesheet Type box in the rich client.
The Property style sheet type defines the layout of the Properties dialog box.
To view the Properties dialog box in the rich client, right-click an object and choose
View Properties.
The Form style sheet defines the layout of forms, such as the Item Master form or
the Item RevisionMaster form.
To view a form in the rich client, select an instance of a form and click the Viewer tab.
The Summary style sheet type defines the layout of the Summary tab in the rich
client and the Overview tab in the thin client.
The Create style sheet type defines the layout of dialog boxes used in the creation
wizard.
To view creation dialog boxes in the rich client, choose File→New→Other.
Note
Only some portions of dialog boxes are defined with the create style sheet
when you choose File→New→object.
The Summary 2007 style sheet type defines the layout of the Summary tab
in the My Teamcenter (2007) perspective in the rich client. By default, the
My Teamcenter (2007) perspective is hidden. To view the perspective, remove
MyTeamcenterLegacy from the HiddenPerspectives preference, and choose
Window→Open Perspective→Other→My Teamcenter (2007).
2. Click the arrow on the Select a Search button and choose General.
4. Press the Enter key or click the Execute the Search button .
The results are displayed in the Search Results view.
5. In the Search Results tab, select the style sheet you want to view. Click the
Viewer tab to see the style sheet.
2. In the Search Results view, select the style sheet you want to use, choose
File→Save As, and rename it. For example, if you want to create a style sheet to
be used with a custom A5_MyItem business object, you could name the style
sheet A5_MyItem.
The new style sheet dataset is saved in your Newstuff folder in the Home view
and is still displayed in the Viewer tab.
b. In the Viewer tab, click the arrow in the Registered Type box and select the
business object type you want to register it to. For example, if you have a
custom A5_MyItem business object added to your server, select A5_MyItem
from the list.
c. Edit the style sheet in the Viewer tab to include the elements you want
displayed in the layout.
For example, if you want to display custom properties, add them where you
want them to appear on the page, like this:
<page title="General" titleKey="General" format="TwoColumn">
<firstcolumn>
<property name="object_string" column="32"/>
<separator/>
<property name="object_name" column="32"/>
<property name="object_desc" />
<separator/>
<property name="owning_user" renderingHint="objectlink"
modifiable="false" />
<property name="owning_group" renderingHint="objectlink"
modifiable="false" />
<property name="last_mod_user" />
<property name="a5_MyDate"/>
<property name="a5_MyDouble"/>
<property name="a5_MyFlag"/>
<property name="a5_MyLongString"/>
<property name="a5_MyLOV"/>
<property name="a5_MyRef"/>
</firstcolumn>
<secondcolumn>
<image/>
</secondcolumn>
</page>
d. To change the style sheet type, click the arrow in the Stylesheet Type box.
You can choose one of the following types:
Property
Form
Summary
Create
Summary 2007
For more information about the style sheet types, see Types of style sheets.
4. When you are done making changes, click the Apply button in the lower right
corner of the view.
5. To see the two new preferences, choose Edit→Options and at the bottom of the
dialog box, click Search.
6. To see the style sheet changes in the clients, clear the cache. For example, to see
the changes in the thin client, clear the Web browser cache. To see the changes
in the rich client, exit the rich client and restart it using the -clean command
argument to remove the old configuration from cache.
To make the new style sheets available for quick loading to clients, run the
generate_client_meta_cache utility to add the new style sheets to client
cache, for example:
generate_client_meta_cache stylesheet –u=infodba –p=infodba –g=dba
c. Locate and select the XML file in your operating system directory and click
Import.
Teamcenter displays the XML file in the Named References dialog box.
d. Click Close.
4. To see the style sheet changes in the clients, clear the cache. For example, to see
the changes in the thin client, clear the Web browser cache. To see the changes
in the rich client, exit the rich client and restart it using the -clean command
argument to remove the old configuration from cache.
Each commonly used business object type (such as item, folder, and dataset) has
style sheets that define the layout of its properties in the user interface.
1. To see the business object that a style sheet is registered to, in the rich client,
first search for XMLRenderingStylesheet datasets.
For more information, see Search for style sheets.
2. Select the style sheet, and in the Viewer tab, see the business object listed in the
Registered Type box on the style sheet
Viewing the business object type that the style sheet is registered to
3. To specify how the style sheet is to be used, select it in the Stylesheet Type box
(for example, for properties display, form rendering, Summary view, or creation
dialog boxes).
4. When the Registered Type box in the Viewer tab is used to register a new
property type style sheet with a business object type, a new REGISTEREDTO
preference and a new RENDERING preference are created. These preferences
apply the XML rendering style sheet dataset type to the business object type so
that the style sheet is displayed in the situation you set it for (for example, for
display of the business object’s property, summary, form, or create information).
To see preferences, choose Edit→Options and click Search at the bottom of the
dialog box.
When you register a style sheet, the preferences that are created depend on the
type of style sheet that is registered:
• Property
<dataset_name(dataset-UID)>.REGISTEREDTO=<type-name>
<type_name>.RENDERING=<dataset_name(dataset-UID)>
• Form
<dataset-name(dataset-uid)>.FORM_REGISTEREDTO=<type-name>
<type-name>.FORMRENDERING=<dataset-name(dataset-uid)>
• Summary
<dataset-name(dataset-uid)>.SUMMARY_REGISTEREDTO=<type-name>
<type-name>.SUMMARYRENDERING=<dataset-name(dataset-uid)>
• Create
<dataset-name(dataset-uid)>.CREATE_REGISTEREDTO=<type-name>
<type-name>.CREATERENDERING=<dataset-name(dataset-uid)>
Note
Use the TC_CreateRenderingInheritTypeList preference to define
the children business object types to inherit the create rendering
format.
The registration information is stored in the preference; each object type has two
entries used to display regular properties, as follows:
• <type_name>.RENDERING
The value of this key is the dataset name or the dataset UID used to display
properties of this type of object.
• <dataset_name>(UID).REGISTEREDTO
The value of this key is the type name for which this dataset is registered.
dataset-name/uid.FORM_REGISTEREDTO
3. Type form in the Search on preference name box and click the Search button
.
Teamcenter displays the preferences that begin with form in the Preferences list.
If no rendering registration is found for the currently selected type, the system
searches the hierarchy to determine if a rendering is registered to any of the parent
classes or parent types. If one is found, that rendering is honored.
• new-business-object-name.REGISTEREDTO
For more information for this type of preference, see the
<dataset_name>.REGISTEREDTO preference in the Preferences
and Environment Variables Reference.
The value of the preferences must be the name of the customized business object.
For example, to create a new business object called MyItem, you must create the
following preferences and set the value of each to MyItem:
• MyItem.RENDERING
• MyItem.REGISTEREDTO
For more information about creating preferences, see Rich Client Interface Guide.
After you create the preferences, either modify a predefined style sheet or create
a new style sheet.
For more information, see Create a custom style sheet by importing an XML file.
4. In the Registered Type box, select Folder, and in the Stylesheet Type box,
select Summary.
5. Edit the MyFolderSummary style sheet to add the checked_out property to the
header area. The following is an example of the modified header area:
<header>
<image source="type"/>
<property name="owning_user" />
<property name="last_mod_date" />
<property name="checked_out" />
<property name="release_status_list" />
<property name="object_type" />
</header>
9. You can configure the folder summary in many other ways. For example, to show
folder contents using the objectSet tag, place the following code highlighted in
bold into the MyFolderSummary style sheet after the properties section,
and click the Apply button:
<section text="properties">
<property name="object_name"/>
<property name="object_desc"/>
<property name="object_type"/>
<separator/>
<property name="owning_user" renderingHint="objectlink" modifiable="false"/>
<property name="owning_group" renderingHint="objectlink" modifiable="false"/>
<property name="last_mod_user"/>
<separator/>
<command commandId="com.teamcenter.rac.properties" text="moreProperties"/>
</section>
<section text="Contents">
<objectSet source="contents.WorkspaceObject" defaultdisplay="thumbnailDisplay"
sortby="object_name" sortdirection="ascending">
<tableDisplay>
<property name="object_string"/>
<property name="object_desc"/>
<property name="object_type"/>
<property name="owning_user"/>
<property name="owning_group"/>
<property name="last_mod_user"/>
</tableDisplay>
<thumbnailDisplay/>
<treeDisplay>
<property name="object_string"/>
<property name="object_desc"/>
<property name="object_type"/>
<property name="owning_user"/>
<property name="owning_group"/>
<property name="last_mod_user"/>
</treeDisplay>
<listDisplay/>
<command actionKey="newBusinessObjectContextualAction"
commandId="com.teamcenter.rac.common.AddNew" renderingHint="commandbutton"/>
<command actionKey="cutAction" commandId="org.eclipse.ui.edit.cut"
renderingHint="commandbutton">
<parameter name="localSelection" value="true"/>
</command>
<command actionKey="copyAction" commandId="com.teamcenter.rac.copy"
renderingHint="commandbutton"/>
<command actionKey="pasteAction"
commandId="com.teamcenter.rac.viewer.pastewithContext" renderingHint="commandbutton"/>
</objectSet>
</section>
When you select a folder and click the Summary tab, the Contents section
is displayed.
Adding a section to the rich client Summary pane using the objectSet tag
In the thin client, the change appears as follows.
Adding a section to the thin client Overview tab using the objectSet tag
The style sheet contains <page> elements, and each <page> can contain
multiple views. If a user right-clicks the Summary view, a shortcut menu with
the view list is displayed; the user can hide or display views. The viewer view
can be used for items, item revisions, and datasets, but not folders or forms.
The other two views can be used for any object.
Modify the Properties pane on the Summary view using style sheets
You can modify what appears in the Properties pane and its layout by codelessly
changing the rendering using Teamcenter style sheets. This example adds the
protection property to the folder general rendering.
1. In the rich client, find all XMLRenderingStylesheet datasets using the
search capability by removing all search criteria except for Type and setting it
to XMLRenderingStylesheet.
For more information, see Search for style sheets.
4. In the Registered Type box, select Folder, and in the Stylesheet Type box,
select Summary.
5. Edit the MyFolderSummary style sheet to add a separator and the protection
property to the general area. The following is an example of the modified general
area:
<column>
<section text="properties">
<property name="object_name"/>
<property name="object_desc"/>
<property name="object_type"/>
<separator/>
<property name="owning_user" renderingHint="objectlink" modifiable="false"/>
<property name="owning_group" renderingHint="objectlink" modifiable="false"/>
<property name="last_mod_user"/>
<separator/>
<property name="protection" />
<separator/>
<command commandId="com.teamcenter.rac.properties" text="moreProperties"/>
</section>
</column>
8. Exit the rich client and restart it using the -clean command argument to remove
the old configuration from cache.
Note
If your customizations still do not appear, clear cache by deleting the
Teamcenter subdirectory in the user’s home directory on the client. This
directory is automatically created again when the user starts the rich
client. This directory usually contains RAC and TAO subdirectories.
On a Windows client, it is typically the C:\Documents and
Settings\user-name\Teamcenter\ directory on Windows XP or the
Desktop\user-name\Teamcenter directory on Windows 7. On a UNIX
client, it is typically the $HOME/Teamcenter/ directory.
If you delete this directory, the last state of the rich client is lost, and the
user interface appears as it does at initial startup.
For more information, see Ensure your customizations appear.
9. In the rich client, select a folder and click the Summary tab.
The protection property is displayed.
Adding a property to the Properties pane on the Summary tab in the rich client
In the thin client, the change appears as follows.
Adding a property to the Properties pane on the Overview tab in the thin client
For more information about using style sheets, see Using style sheets.
Modify the item create panels in the New Business Object wizard using style
sheets
You can modify what appears in the New Business Object wizard in the rich client
when you choose the File→New→Other menu command by codelessly changing the
rendering using Teamcenter style sheets. This example modifies the item creation
panes by removing the user_data boxes from the Additional Item Information dialog
box (which uses the Item Master form) and the Item Revision Information dialog box
(which uses the ItemRevision Master form).
2. Select the ItemCreate dataset and choose File→Save As. Type MyItemCreate
in the Name box.
The MyItemCreate style sheet is saved in the Newstuff folder.
4. In the Registered Type box, select Item, and in the Stylesheet Type box, select
Create.
5. Edit the MyItemCreate style sheet to remove the user_data elements shown in
bold in the following sample:
<page title="Additional Item Information" titleKey="AdditionalItemInformation">
<view name="properties">
<property name="IMAN_master_form:project_id" />
<property name="IMAN_master_form:previous_item_id" />
<property name="IMAN_master_form:serial_number" />
<property name="IMAN_master_form:item_comment" />
<property name="IMAN_master_form:user_data_1" />
<property name="IMAN_master_form:user_data_2" />
<property name="IMAN_master_form:user_data_3" />
</view>
</page>
<page title="Item Revision Information" titleKey="ItemRevisionInformation">
<view name="properties">
<property name="revision:IMAN_master_form_rev:project_id" />
<property name="revision:IMAN_master_form_rev:previous_version_id" />
<property name="revision:IMAN_master_form_rev:serial_number" />
<property name="revision:IMAN_master_form_rev:item_comment" />
<property name="revision:IMAN_master_form_rev:user_data_1" />
<property name="revision:IMAN_master_form_rev:user_data_2" />
<property name="revision:IMAN_master_form_rev:user_data_3" />
</view>
</page>
8. Exit the rich client and restart it using the -clean command argument to remove
the old configuration from cache.
Note
If your customizations still do not appear, clear cache by deleting the
Teamcenter subdirectory in the user’s home directory on the client. This
directory is automatically created again when the user starts the rich
client. This directory usually contains RAC and TAO subdirectories.
On a Windows client, it is typically the C:\Documents and
Settings\user-name\Teamcenter\ directory on Windows XP or the
Desktop\user-name\Teamcenter directory on Windows 7. On a UNIX
client, it is typically the $HOME/Teamcenter/ directory.
If you delete this directory, the last state of the rich client is lost, and the
user interface appears as it does at initial startup.
For more information, see Ensure your customizations appear.
9. To test the customization in the rich client, choose File→New→Other and select
Item.
The user_data boxes are removed from the new item create panes.
Item Master Form with User Data boxes removed in the rich client
To see the change in the thin client, choose New→Item.
Item Master Form with User Data boxes removed in the thin client
For more information about using style sheets, see Using style sheets.
5. In the Registered Type box, select Item Master, and in the Stylesheet Type
box, select Property.
Note
Notice how this code adds an Advanced link to the form.
Customized layout of the form’s General properties page in the rich client
Click the Advanced link at the bottom of the form to open the additional
properties on the form.
Customized layout of the form’s Advanced properties page in the rich client
Note
To see the change in the rich client, you may need to exit the rich client
and restart it using the -clean command argument to remove the old
configuration from cache.
If your customizations still do not appear in the rich client, clear cache
by deleting the Teamcenter subdirectory in the user’s home directory on
the client. This directory is automatically created again when the user
starts the rich client. This directory usually contains RAC and TAO
subdirectories.
On a Windows client, it is typically the C:\Documents and
Settings\user-name\Teamcenter\ directory on Windows XP or the
Desktop\user-name\Teamcenter directory on Windows 7. On a UNIX
client, it is typically the $HOME/Teamcenter/ directory.
If you delete this directory, the last state of the rich client is lost, and the
user interface appears as it does at initial startup.
For more information, see Ensure your customizations appear.
For more information about using style sheets, see Using style sheets.
<header>
<image source="thumbnail"/>
<classificationTrace/>
<property name="owning_user"/>
<property name="last_mod_date"/>
<property name="release_status_list"/>
<property name="object_type"/>
</header>
<page text="Overview" format="TwoColumn">
<firstcolumn>
<section text="MyText">
The localized text strings are kept in xmlstylesheet_locale.properties files for the
rich client or in the locale\webstrings.xml file for the thin client.
When you customize a style sheet with new text, you must enter the text in the
different languages to be displayed in the user interface. If you do not enter localized
text strings, the unlocalized text appears in the user interface between exclamation
marks, for example: !MyText!.
Use the following methods to localize custom text in style sheets:
• Rich client
Open the TC_ROOT\portal\plugins\com.teamcenter.rac.viewer_version
plug-in and extract the
stylesheet\xmlstylesheet\xmlstylesheet_locale.properties file. Add the
text strings in this file, and distribute the revised JAR file on client machines.
For example, assume that the following code in a style sheet:
<section text="MyText">
• Thin client
In the thin client installation location, open the
staging_location\webapp_root\teamcenter\dhtml\common\intl\en_US\
webstrings.xml file and create a new entry for the text you want to localize, for
example:
<web_string>
<name>web_xrt_MyText</name><string>This Is My Text</string>
</web_string>
Then save the revised webstrings.xml file, regenerate and redeploy the .ear
file, and clear the browser cache.
For information about localizing custom rich client plug-ins, see Localize your
customizations.
<firstcolumn>
<property name="user_data_1" renderingHint="lovbutton" renderingStyle="titled"
border="true" />
<separator />
<property name="user_data_2" renderingStyle="titled" />
</firstcolumn>
<secondcolumn>
<property name="user_data_3" renderingStyle="titled" border="true" />
<property name="previous_item_id" renderingStyle="titled" />
</secondcolumn>
</page>
</rendering>
Each page in the XML is a tab. The tab uses OneColumn format, meaning that each
row has only one property. There is no rendering hint defined for the project_id
property; therefore, the default is used.
The following two figures illustrate how the XML code is rendered in the rich client
and the thin client.
The following code shows an example of an XML definition for item properties:
<?xml version="1.0" encoding="UTF-8"?>
<rendering>
<page title="General" titleKey="General" format="TwoColumn">
<firstcolumn>
<property name="object_string" column="32"/>
<separator/>
<property name="object_name" column="32"/>
<property name="object_desc" />
<separator/>
<property name="owning_user" />
<property name="owning_group" />
<property name="last_mod_user" />
</firstcolumn>
<secondcolumn>
<image/>
</secondcolumn>
</page>
<page title="Reservation" titleKey="Reservation">
<property name="checked_out" />
<property name="checked_out_user" />
<separator/>
<property name="checked_out_date" />
<property name="checked_out_change_id" />
<separator/>
<property name="reservation" />
</page>
<page title="Project" titleKey="Project">
<property name="proj_assign_mod_date" />
<property name="project_ids" />
<separator/>
<property name="project_list" />
</page>
<page title="All" titleKey="All">
<all type="property"/>
</page>
</rendering>
The following figures show the resulting item properties dialog box in the rich client
and thin client.
XML elements
The XML file used to define the property display must include certain elements and
attributes, as shown in the following sample code from the ItemRevision.xml file:
<rendering>
<page title="General" titleKey="General" format="TwoColumn">
<firstcolumn>
<property name="object_string" column="32"/>
<separator/>
<property name="object_name" column="32"/>
<property name="item_id" column="32"/>
<property name="item_revision_id" column="32"/>
<property name="object_desc" />
<property name="items_tag" />
<separator/>
<property name="owning_user" renderingHint="objectlink" modifiable="false" />
<property name="owning_group" renderingHint="objectlink" modifiable="false" />
<property name="last_mod_user" />
</firstcolumn>
<secondcolumn>
<image/>
</secondcolumn>
</page>
<page title="Reservation" titleKey="Reservation">
<property name="checked_out" />
<property name="checked_out_user" />
<separator/>
<property name="checked_out_date" />
<property name="checked_out_change_id" />
<separator/>
<property name="reservation" />
</page>
<page title="Project" titleKey="Project">
<property name="proj_assign_mod_date" />
<property name="project_ids" />
<separator/>
<property name="project_list" />
</page>
<page title="All" titleKey="All">
<all type="property"/>
</page>
</rendering>
all
Lists all properties of the defined object.
ATTRIBUTES
type
Indicates whether to list all the object properties or only form properties. The valid
values for this attribute are property and form.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the following types of style sheets (but not the New Business
Object wizard):
Property
Summary
Form
EXAMPLE
Following is sample code from the Folder.xml XML rendering style sheet showing
the all element:
<page title="All" titleKey="All">
<all type="property"/>
</page>
attachments
Specifies which objects attached to an item revision should appear in the attachments
list. The format for the element value is:
relation.type
For example:
<attachments>
IMAN_reference.MSExcel
</attachments>
The example displays all attachments to the item revision with a MSExcel type and
an IMAN_reference relation. Separate multiple entries with commas.
ATTRIBUTES
None.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the Summary style sheets.
EXAMPLE
Following is sample code from the ItemRevSummary2007.xml XML rendering
style sheet showing the attachments element:
<view name="attachments">
<attachments>IMAN_specification.UGMASTER, IMAN_reference.MSExcel,
IMAN_Rendering.DirectModel, SimplifiedRendering.JtSimplification</attachments>
</view>
break
Inserts a break in the pane.
ATTRIBUTES
None.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the following types of style sheets:
Property
Summary
Form
Create
EXAMPLE
<page titleKey=”general” title=”General” format=”OneColumn”>
<property name="project_id" icon=”images/group.gif”/>
<property name="serial_number" renderingHint="textfield" renderingStyle=”headed”/>
<property name="item_comment" renderingHint="textarea" column=”30” row=”5”/>
<property name="user_data_1" renderingHint="lovcombobox" renderingStyle=”titled”
border=”true” />
<separator />
<property name=”user_data_1” />
<property name=”user_data_2” />
<break />
</page>
classificationProperties
Specifies that the classification properties of the current object should be displayed.
Properties and their values are rendered as name/value pairs in static text.
For information about adding classification properties to an object, see the
Classification Guide.
ATTRIBUTES
None.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used only on Summary style sheets.
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the classificationProperties element:
<page text="Overview" format="TwoColumn">
<firstcolumn>
<section text="AvailableRevisions">
<objectSet source="revision_list.ItemRevision" defaultdisplay="thumbnailDisplay"
sortdirection="descending" sortby="item_revision_id">
<tableDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</tableDisplay>
<thumbnailDisplay/>
<treeDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</treeDisplay>
<listDisplay/>
</objectSet>
</section>
<section text="ItemProperties">
<property name="object_desc"/>
<separator/>
<property name="owning_user" renderingHint="objectlink" modifiable="false"/>
<property name="owning_group" renderingHint="objectlink" modifiable="false"/>
<property name="last_mod_user"/>
<separator/>
<property name="checked_out"/>
<property name="checked_out_user"/>
<separator/>
<command commandId="com.teamcenter.rac.properties" text="moreProperties"/>
</section>
<section text="ClassificationProperties">
<classificationProperties/>
</section>
</firstcolumn>
classificationTrace
Specifies that the classification traces of the item should be displayed, for example,
Home Care > Cleaners > Detergents.
For information about classification, see the Classification Guide.
ATTRIBUTES
None.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used only on Summary style sheets.
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the classificationTrace element:
<header>
<image source="thumbnail"/>
<classificationTrace/>
<property name="owning_user"/>
<property name="last_mod_date"/>
<property name="release_status_list"/>
<property name="object_type"/>
</header>
command
Specifies a command representation to be displayed.
ATTRIBUTES
actionKey
Specifies the action key that presents the command in the thin client. (If you do not
want to present the command in the thin client, you can omit this attribute.)
commandId
Specifies the command to be executed. This attribute is used only by the rich client.
The attribute value must be a key into a property file and must be a valid command
ID defined in the rich client. This is a string attribute that is required.
defaultTitle
Specifies the string to be displayed if a key is not found in the property file. This
is an optional attribute.
icon
Specifies the icon to be displayed before the command label. The attribute value
must be a key into a property file. This is an optional attribute.
renderingHint
Specifies whether the command is rendered as a hyperlink or as a button. Valid
values are hyperlink and commandbutton. This attribute is optional. If the
attribute is not specified, the command is rendered as a hyperlink.
text
Specifies the text to display. The attribute value must be a key into a property file. If
the key is not found, the attribute value itself is displayed as static text. If neither
the text or icon attributes are specified, the value of the commandId attribute
is rendered. This attribute is optional.
title
Specifies the default string of the title for this user interface element. This attribute
is used when the string in the titleKey attribute is not found in the locale file.
This is an optional attribute.
titleKey
Specifies the key used to search for the title in the locale file. If it is not defined, the
string defined by the title attribute is used. This is an optional attribute.
tooltip
Specifies the tooltip for the command. The attribute value must be a key into a
property file. This attribute is optional but is required if the icon attribute is
specified.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used only on the Summary style sheets.
EXAMPLE
Following is sample code using the command element on an object set:
<objectSet source="contents.WorkspaceObject" defaultdisplay="thumbnailDisplay"
sortby="object_name" sortdirection="ascending">
<tableDisplay>
<property name="object_string"/>
<property name="object_desc"/>
<property name="object_type"/>
<property name="owning_user"/>
<property name="owning_group"/>
<property name="last_mod_user"/>
</tableDisplay>
<thumbnailDisplay/>
<treeDisplay>
<property name="object_string"/>
<property name="object_desc"/>
<property name="object_type"/>
<property name="owning_user"/>
<property name="owning_group"/>
<property name="last_mod_user"/>
</treeDisplay>
<listDisplay/>
<command actionKey="newBusinessObjectContextualAction"
commandId="com.teamcenter.rac.common.AddNew" renderingHint="commandbutton"/>
<command actionKey="cutAction" commandId="org.eclipse.ui.edit.cut"
renderingHint="commandbutton">
<parameter name="localSelection" value="true"/>
</command>
<command actionKey="copyAction" commandId="com.teamcenter.rac.copy"
renderingHint="commandbutton"/>
<command actionKey="pasteAction"
commandId="com.teamcenter.rac.viewer.pastewithContext" renderingHint="commandbutton"/>
</objectSet>
In this example, the command element adds the Add New, Cut, Copy, and Paste
buttons in the user interface.
conditions
Indicates that rules are specified for a property.
The GoverningProperty and Rule elements are used within the conditions
element. The GoverningProperty tag defines the property to apply the condition
to, and the Rule tag defines the state of the property. If multiple properties within a
single form are to be tracked, there are multiple entries of the GoverningProperty
tag within the conditions tag. Combining entries for a different form types within a
single stylesheet is not permitted.
Note
The conditions and GoverningProperty tags do not work in the Viewer
view if the style sheet is registered for properties display.
ATTRIBUTES
None.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the following types of style sheets:
Property
Form
EXAMPLE
Following is sample style sheet code showing the conditions element:
<rendering>
<property name = "user_data_1"/>
<property name = "user_data_2"/>
<property name = "user_data_3"/>
<conditions>
<GoverningProperty propertyname = "user_data_1" propertyvalue = "Mine1">
<Rule propertyname = "user_data_2" state = "required"/>
<Rule propertyname = "user_data_3" state = "disabled"/>
</GoverningProperty>
<GoverningProperty propertyname = "user_data_1" propertyvalue = "Do IM">
<Rule propertyname = "user_data_2" state = "disabled"/>
<Rule propertyname = "user_data_3" state = "required"/>
</GoverningProperty>
</conditions>
</rendering>
The first GoverningProperty node in the sample states that if the User Data 1
box contains a value of Mine1, then the User Data 2 box is required and the User
Data 3 box is disabled. The second GoverningProperty node in the sample states
that if the User Data 1 box contains a value of Do IM, then the User Data 2 box is
disabled and the User Data 3 box is required.
Following is the resulting user interface.
Value in the User Data 1 box matches the first GoverningProperty node
Value in the User Data 1 box matches the second GoverningProperty node
For another example, see Set properties to be conditionally mandatory or disabled.
customPanel
Embeds a custom panel in the New Business Object wizard, which is run when you
choose File→New→Other in the rich client.
ATTRIBUTES
java
Specifies the fully qualified Java implementation class name responsible for building
the custom user interface (for example, com.teamcenter.rac.MyCustomPanel).
This is supported in the rich client only.
js
Specifies the path and name of the JavaScript file responsible for building the
custom user interface (for example, custom/MyCustomPanel.js). This is supported
in the thin client only.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the Create style sheets.
EXAMPLE
Following is a custom style sheet that uses the customPanel element. (This
example works in the rich client only.)
<?xml version="1.0" encoding="UTF-8"?>
<rendering>
<views>properties</views>
<page title="Item Information" titleKey="ItemInformation">
<view name="properties">
<property name="item_id" />
<property name="revision:item_revision_id" />
<property name="object_name" />
<property name="object_desc" />
<separator/>
<property name="uom_tag" />
<separator/>
<customPanel java="com.teamcenter.rac.ui.commands.newbo.mypanel.MyPanel" />
</view>
</page>
<page title="Additional Item Information" titleKey="AdditionalItemInformation">
<view name="properties">
<property name="IMAN_master_form:project_id" />
<property name="IMAN_master_form:previous_item_id" />
<property name="IMAN_master_form:serial_number" />
<property name="IMAN_master_form:item_comment" />
<property name="IMAN_master_form:user_data_1" />
<property name="IMAN_master_form:user_data_2" />
<property name="IMAN_master_form:user_data_3" />
</view>
</page>
<page title="Item Revision Information" titleKey="ItemRevisionInformation">
<view name="properties">
<property name="revision:IMAN_master_form_rev:project_id" />
<property name="revision:IMAN_master_form_rev:previous_version_id" />
<property name="revision:IMAN_master_form_rev:serial_number" />
<property name="revision:IMAN_master_form_rev:item_comment" />
<property name="revision:IMAN_master_form_rev:user_data_1" />
<property name="revision:IMAN_master_form_rev:user_data_2" />
<property name="revision:IMAN_master_form_rev:user_data_3" />
</view>
</page>
</rendering>
You must create your own custom panel to pass to the customPanel tag. Following
is the MyPanel.java file that defines the custom panel:
package com.teamcenter.rac.ui.commands.newbo.mypanel;
import com.teamcenter.rac.ui.commands.create.bo.NewBOWizard;
import com.teamcenter.rac.util.AbstractCustomPanel;
import com.teamcenter.rac.util.IPageComplete;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.FormToolkit;
public class MyPanel extends AbstractCustomPanel implements IPageComplete
{
private Composite composite;
private Text text;
public MyPanel()
{
}
public MyPanel( Composite parent )
{
super( parent );
}
@Override
public void createPanel()
{
FormToolkit toolkit = new FormToolkit( parent.getDisplay() );
composite = toolkit.createComposite( parent );
GridLayout gl = new GridLayout( 2, false );
composite.setLayout( gl );
GridData gd = new GridData( GridData.FILL_HORIZONTAL );
gd.grabExcessHorizontalSpace = true;
composite.setLayoutData( gd );
GridData labelGD = new GridData( GridData.HORIZONTAL_ALIGN_END );
Label label = toolkit.createLabel( composite, "Object_Name: " );
label.setLayoutData( labelGD );
GridData typeTextGd = new GridData( GridData.FILL_HORIZONTAL );
text = toolkit.createText( composite, "" );
text.setText( "This is my own panel" );
text.setLayoutData( typeTextGd );
}
public boolean isPageComplete()
{
String txt = text.getText();
return txt.length() == 0 ? false : true;
}
@Override
public Composite getComposite()
{
return composite;
}
@Override
public void updatePanel()
{
if( input != null )
{
NewBOWizard wizard = (NewBOWizard) input;
String msg = "";
if( wizard.model.getTargetArray()!= null )
{
try
{
msg = wizard.model.getTargetArray()[0].getProperty(
"object_name" ).toString();
}
catch( Exception e )
{
e.printStackTrace();
}
}
else
{
msg = "Nothing is selected";
}
text.setText( msg );
}
}
@Override
public Object getUserInput()
{
return null;
}
}
Following is the resulting custom panel added to the New Business Object wizard,
which is run when you choose File→New→Other in the rich client.
firstcolumn
Defines the layout of the first column defined on a page. The secondcolumn
element defines the layout of the second column on a page.
This element applies only if the TwoColumn format is set in the format attribute
on the page element.
ATTRIBUTES
None.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the following types of style sheets (but not the New Business
Object wizard):
Property
Summary
Form
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the firstcolumn element:
<page text="Overview" format="TwoColumn">
<firstcolumn>
<section text="AvailableRevisions">
<objectSet source="revision_list.ItemRevision"
defaultdisplay="thumbnailDisplay" sortdirection="descending"
sortby="item_revision_id">
<tableDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</tableDisplay>
<thumbnailDisplay/>
<treeDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</treeDisplay>
<listDisplay/>
</objectSet>
</section>
<section text="ItemProperties">
<property name="object_desc"/>
<separator/>
<property name="owning_user" renderingHint="objectlink" modifiable="false"/>
<property name="owning_group" renderingHint="objectlink" modifiable="false"/>
<property name="last_mod_user"/>
<separator/>
<property name="checked_out"/>
<property name="checked_out_user"/>
<separator/>
<command commandId="com.teamcenter.rac.properties" text="moreProperties"/>
</section>
<section text="ClassificationProperties">
<classificationProperties/>
</section>
</firstcolumn>
<secondcolumn>
<view name="viewer"/>
<view name="actions">
<command actionKey="copyAction" commandId="com.teamcenter.rac.copy" />
<command actionKey="saveAsAction" commandId="org.eclipse.ui.file.saveAs" />
<command actionKey="newProcessAction"
commandId="com.teamcenter.rac.newProcess" text="newProc" />
</view>
</secondcolumn>
</page>
GoverningProperty
Specifies the name and value of the field that initiates the Rule element. The
GoverningProperty tag must be contained within a condition tag and used in
conjunction with a rule tag.
Note
The conditions and GoverningProperty tags do not work in the Viewer
view if the style sheet is registered for properties display.
ATTRIBUTES
propertyname
Specifies the name of the field that triggers the rule if its value matches.
propertyvalue
Specifies the property value that triggers the rule.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the following types of style sheets:
Property
Form
EXAMPLE
<rendering>
<property name = "user_data_1"/>
<property name = "user_data_2"/>
<property name = "user_data_3"/>
<conditions>
<GoverningProperty propertyname = "user_data_1" propertyvalue = "Mine1">
<Rule propertyname = "user_data_2" state = "required"/>
<Rule propertyname = "user_data_3" state = "disabled"/>
</GoverningProperty>
<GoverningProperty propertyname = "user_data_1" propertyvalue = "Do IM">
<Rule propertyname = "user_data_2" state = "disabled"/>
<Rule propertyname = "user_data_3" state = "required"/>
</GoverningProperty>
</conditions>
</rendering>
header
Specifies that a header area must be displayed in the page.
ATTRIBUTES
None.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the Summary style sheets.
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the header element:
<rendering xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="XMLRenderingStylesheet_Schema.xsd">
<header>
<image source="thumbnail"/>
<classificationTrace/>
<property name="owning_user"/>
<property name="last_mod_date"/>
<property name="release_status_list"/>
<property name="object_type"/>
</header>
<page text="Overview" format="TwoColumn">
image
Specifies that an image is to be rendered. Image dimensions are always kept
proportional when being scaled or resized.
ATTRIBUTES
maxheight
Specifies the maximum height in pixels to which the image should be scaled. This is
a string attribute that is optional.
maxwidth
Specifies the maximum width in pixels to which the image should be scaled. This is
a string attribute that is optional.
source
Specifies the source of the image to display. The attribute value can be a thumbnail,
preview, or type keyword. This is a string attribute that is optional.
tooltip
Specifies the tooltip associated with the image. The attribute value must be a key
into a property file. This is a string attribute that is optional.
Note
For backward compatibility, if no attributes are specified and the current object
type is an Item, ItemRevision, or Dataset business object, an attempt is
made to find and render any preview image that is associated with the object.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the following types of style sheets:
Property
Summary
Form
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the image element:
<rendering xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="XMLRenderingStylesheet_Schema.xsd">
<header>
<image source="thumbnail"/>
<classificationTrace/>
<property name="owning_user"/>
<property name="last_mod_date"/>
<property name="release_status_list"/>
<property name="object_type"/>
</header>
label
Specifies a label to be rendered.
ATTRIBUTES
class
Defines the cascading style sheet (CSS) class used to provide the style for the label
text. The CSS class must be an existing thin client CSS.
label text="Sample text."
class="textCSSClass"
style
Controls font style for the label text, including font size, weight, name, and style
(such as italic). The format follows the CSS guideline, for example:
style="font-size:14pt;font-style:plain;
font-family:Tahoma;font-weight:bold"
text
Specifies the text to use for the label. The attribute value must be a key into a
property file. If the key is not found, the attribute value itself is displayed as static
text. This attribute is required.
Support is provided for localized values. For example, the tagging <label
text="Hello World" /> displays text on the property page, and <label
textKey="k_version_name" /> displays the localized text in the provided property.
URL addresses in the label text and property tags are automatically rendered.
(In the rich client, URL addresses are also automatically rendered for textfield
and textarea rendering hints.)
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the Summary style sheets.
EXAMPLES
• Text
Following is sample code for the label text element:
<label text="This is a raining day!" />
• style attribute
The property style sheet page tagging includes the style attribute
within the label text and property tags to control font
style. Support is provided for font size, weight, name, and style
(such as italic). The format follows the CSS guideline, for example,
style="font-size:14pt;font-style:plain;font-family:Tahoma;font-weight:bold".
For example:
<page title="Reservation" titleKey="Reservation"
visibleWhen="object_desc==Testing*">
<label text="The object is checked out? or not ...."
style="font-size:14pt; font-style:plain;font-family:Tahoma; font-weight:bold" />
...
</page>
• URL rendering
URL addresses included in the label and property tag are automatically
rendered.
For example:
<label text="Press www.abcnews.com to view the latest headlines!"
style=" font-size:14pt;font-style:plain;font-family:Tahoma;font-weight:normal" />
listDisplay
Displays a set of objects in a list format.
ATTRIBUTES
None.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on Summary style sheets.
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the listDisplay element:
<section text="AvailableRevisions">
<objectSet source="revision_list.ItemRevision" defaultdisplay="thumbnailDisplay"
sortdirection="descending" sortby="item_revision_id">
<tableDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</tableDisplay>
<thumbnailDisplay/>
<treeDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</treeDisplay>
<listDisplay/>
</objectSet>
</section>
objectSet
Provides a set of display options for the selected object. This element is a replacement
for the attachments element.
Click the appropriate button to view the object’s characteristics in a table, list, or tree.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the Summary style sheets.
EXAMPLE
Following is sample code using the objectSet tag:
<objectSet source="contents.WorkspaceObject" defaultdisplay="thumbnailDisplay"
sortby="object_name" sortdirection="ascending">
<tableDisplay>
<property name="object_string"/>
<property name="object_desc"/>
<property name="object_type"/>
<property name="owning_user"/>
<property name="owning_group"/>
<property name="last_mod_user"/>
</tableDisplay>
<thumbnailDisplay/>
<treeDisplay>
<property name="object_string"/>
<property name="object_desc"/>
<property name="object_type"/>
<property name="owning_user"/>
<property name="owning_group"/>
<property name="last_mod_user"/>
</treeDisplay>
<listDisplay/>
<command actionKey="newBusinessObjectContextualAction"
commandId="com.teamcenter.rac.common.AddNew" renderingHint="commandbutton"/>
<command actionKey="cutAction" commandId="org.eclipse.ui.edit.cut"
renderingHint="commandbutton">
<parameter name="localSelection" value="true"/>
</command>
<command actionKey="copyAction" commandId="com.teamcenter.rac.copy"
renderingHint="commandbutton"/>
<command actionKey="pasteAction"
commandId="com.teamcenter.rac.viewer.pastewithContext" renderingHint="commandbutton"/>
</objectSet>
Note
In an object set, you can use the command tag to add buttons for
existing menu commands. For example, you can place cut, copy, and paste
buttons on the object set. When you add command buttons, you must
add the actionKey argument to make the buttons appear in the thin
client. The action key value to use for each command can be found in the
staging-location\webapp_root\teamcenter\dhtml\common\intl\
language\wsomenu.xml file.
If the localSelection parameter is set to true for any command action, the
action is performed on the object selected in the object set. For example, In
case of the cut action, if the localSelection parameter is true, the cut action
operates on the object selected in the object set list. If the localSelection
parameter is false (or not set), the cut action operates on the object for which
the summary is being shown and not on an object selected in the object set.
Following is how the sample code is rendered in the user interface. This object set
shows the contents of a folder.
page
Presents a tab panel in a dialog box or view. If the page element is not defined in
the XML file, a default page is created.
ATTRIBUTES
format
Specifies the format to be used for this page. This attribute can have one of these
values: OneColumn or TwoColumn. The default value is OneColumn. This
attribute is optional.
The firstcolumn tag defines the layout of the first column, and the secondcolumn
tag defines the layout of the second column.
For more information, see firstcolumn and secondColumn.
text
Specifies the title to be displayed for the page. The attribute value must be a key
into a property file. If the key is not found, the attribute value itself is displayed as
static text. This is a required attribute.
title
Specifies the default string of the title for this tab. This attribute is used when the
string in the titleKey attribute is not found in the locale file. This is an optional
attribute.
titleKey
Specifies the key used to search for the title in the locale file. If it is not defined, the
string defined by the title attribute is used. This is an optional attribute.
visibleWhen
Defines conditional display of a tab based on an object’s properties. For example:
<page title="Reservation"
titleKey="Reservation"
visibleWhen="object_desc==Testing*">
...
</Page>
The sample code states that if the word Testing is used in the object_desc property,
the Reservation page appears.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the following types of style sheets:
Property
Summary
Form
Create
EXAMPLES
• page element
• visibleWhen attribute
To specify a single conditional evaluation for the component property, include
the visibleWhen parameter on the property style sheet page, for example,
visibleWhen="object_desc!=abc".
Consider the following code:
<page title="Reservation" titleKey="Reservation"
visibleWhen="object_desc==Testing*">
...
</Page>
If the word Testing is used in the object_desc property, the Reservation link
appears. In the following example, the object_desc property is blank, and
therefore the Reservation link does not appear.
parameter
Passes in the name/value parameters to the parent command. It launches a specific
named search when users choose the Add Existing menu command. This is a child
element of the command element. An example of a parameter is localSelection.
For more information about the localSelection parameter, see objectSet.
ATTRIBUTES
name
Specifies the parameter name, for example, searchName. This is a required
attribute.
value
Specifies the parameter value, for example, CustomSearch. This is a required
attribute.
SUPPORTED
CLIENTS
Rich client
SUPPORTED
STYLE
SHEETS
This tag can be used on Summary style sheets.
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the paramter element:
<command actionKey="newBusinessObjectContextualAction"
commandId="com.teamcenter.rac.common.AddNew" renderingHint="commandbutton"/>
<command actionKey="cutAction" commandId="org.eclipse.ui.edit.cut"
renderingHint="commandbutton">
<parameter name="localSelection" value="true"/>
</command>
<command actionKey="copyAction" commandId="com.teamcenter.rac.copy"
renderingHint="commandbutton"/>
<command actionKey="pasteAction"
commandId="com.teamcenter.rac.viewer.pastewithContext" renderingHint="commandbutton"/>
property
Specifies the property of the form or object. You must include at least one property in
the XML definition; otherwise, the system displays an empty panel.
ATTRIBUTES
border
Determines whether the border is displayed. Valid values are true and false. This
works only with the titled style. This is supported in both the rich client and thin
client.
column
Applies only to the textfield and textarea rendering hints. It sets the number of
columns. This is supported in both the rich client and thin client.
modifiable
Specifies if the owning_user or owning_group property can be modified (true or
false). For all other properties, use a property rule instead.
name
Specifies the display name of the property. This is a required attribute. This is
supported in both the rich client and thin client.
In the New Business Object wizard, you can use compounding to specify a property
with revision, IMAN_master_form, and IMAN_master_form_rev contexts on
style sheets registered to any object.
• For example, if the style sheet is registered on an item, name=
revision:item_revision_id displays the item_revision_id property from the
item’s revision.
renderingHint
Specifies the component used to render this property. This is an optional attribute. If
not defined, the default renderer is used based on the property type.
For more information, see Rendering hints. For a complete list of available rendering
hints, see Standard rendering hints. To add a custom rendering hint, see Add a
custom rendering hint.
renderingStyle
Defines the rendering style used in the rendering component. There are three styles:
headed, headless, and titled.
• Headed
This is the default rendering style. The property name is displayed on the left
followed by the property value renderer. This is supported in both the rich
client and thin client.
• Headless
This style renders only the property value without displaying the property name
in front of it. This is supported in both the rich client and thin client.
• Titled
The property name is displayed on the top of the property value renderer. This
is supported in both the rich client and thin client.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the following types of style sheets:
Property
Summary
Form
Create
EXAMPLES
• property element
Following is sample code from the ItemSummary.xml XML rendering style
sheet showing the property element:
<rendering xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="XMLRenderingStylesheet_Schema.xsd">
<header>
<image source="thumbnail"/>
<classificationTrace/>
<property name="owning_user"/>
<property name="last_mod_date"/>
<property name="release_status_list"/>
<property name="object_type"/>
</header>
• URL rendering
URL addresses in the label text and property tags are automatically rendered.
(In the rich client, URL addresses are also automatically rendered for textfield
and textarea rendering hints.)
For an example, see label.
rendering
Root element
ATTRIBUTES
Version
Specifies the version of the XML schema. When an older version is detected, the
program automatically converts the old scheme to the new one.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag is required on all types of style sheets:
Property
Summary
Form
Create
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the rendering element:
<rendering xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="XMLRenderingStylesheet_Schema.xsd">
<header>
<image source="thumbnail"/>
<classificationTrace/>
<property name="owning_user"/>
<property name="last_mod_date"/>
<property name="release_status_list"/>
<property name="object_type"/>
</header>
<page text="Overview" format="TwoColumn">
.
.
.
</rendering>
Rule
Applies the rule to the field if the GoverningProperty element matches its
conditions. The Rule tag must be contained within a conditions tag and used in
conjunction with a GoverningProperty tag.
ATTRIBUTES
propertyname
Specifies the name of the field to require or disable.
state
Indicates whether to make the field required or disabled. The valid values for this
attribute are required and disabled.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the following types of style sheets:
Property
Form
EXAMPLE
<rendering>
<property name = "user_data_1"/>
<property name = "user_data_2"/>
<property name = "user_data_3"/>
<conditions>
<GoverningProperty propertyname = "user_data_1" propertyvalue = "Mine1">
<Rule propertyname = "user_data_2" state = "required"/>
<Rule propertyname = "user_data_3" state = "disabled"/>
</GoverningProperty>
<GoverningProperty propertyname = "user_data_1" propertyvalue = "Do IM">
<Rule propertyname = "user_data_2" state = "disabled"/>
<Rule propertyname = "user_data_3" state = "required"/>
</GoverningProperty>
</conditions>
</rendering>
secondColumn
Defines the layout of the second column defined on a page. The firstcolumn element
defines the layout of the first column on a page.
This element applies only if the TwoColumn format has been set in the format
attribute on the page element.
ATTRIBUTES
None.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the following types of style sheets (but not the New Business
Object wizard):
Property
Summary
Form
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the secondcolumn element:
<page text="Overview" format="TwoColumn">
<firstcolumn>
<section text="AvailableRevisions">
<objectSet source="revision_list.ItemRevision" defaultdisplay="thumbnailDisplay"
sortdirection="descending" sortby="item_revision_id">
<tableDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</tableDisplay>
<thumbnailDisplay/>
<treeDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</treeDisplay>
<listDisplay/>
</objectSet>
</section>
<section text="ItemProperties">
<property name="object_desc"/>
<separator/>
<property name="owning_user" renderingHint="objectlink" modifiable="false"/>
<property name="owning_group" renderingHint="objectlink" modifiable="false"/>
<property name="last_mod_user"/>
<separator/>
<property name="checked_out"/>
<property name="checked_out_user"/>
<separator/>
<command commandId="com.teamcenter.rac.properties" text="moreProperties"/>
</section>
<section text="ClassificationProperties">
<classificationProperties/>
</section>
</firstcolumn>
<secondcolumn>
<view name="viewer"/>
<view name="actions">
<command actionKey="copyAction" commandId="com.teamcenter.rac.copy" />
<command actionKey="saveAsAction" commandId="org.eclipse.ui.file.saveAs" />
<command actionKey="newProcessAction" commandId="com.teamcenter.rac.newProcess"
text="newProc" />
</view>
</secondcolumn>
</page>
section
Defines a group of elements to be displayed together within a named section.
Note
This element is a replacement for the view element.
ATTRIBUTES
initialstate
Specifies whether the view or section should be expanded or collapsed on initial
rendering. Valid values are expanded or collapsed. The default value is
expanded. This attribute is optional.
Note
The initialstate tag is not supported on the thin client.
text
Specifies the title to be displayed on the section header. The attribute value must
be a key into a property file. If the key is not found, the attribute value itself is
displayed as static text. This attribute is required.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the Summary style sheets.
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the section element:
<page text="Overview" format="TwoColumn">
<firstcolumn>
<section text="AvailableRevisions">
<objectSet source="revision_list.ItemRevision" defaultdisplay="thumbnailDisplay"
sortdirection="descending" sortby="item_revision_id">
<tableDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</tableDisplay>
<thumbnailDisplay/>
<treeDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</treeDisplay>
<listDisplay/>
</objectSet>
</section>
<section text="ItemProperties">
<property name="object_desc"/>
<separator/>
<property name="owning_user" renderingHint="objectlink" modifiable="false"/>
<property name="owning_group" renderingHint="objectlink" modifiable="false"/>
<property name="last_mod_user"/>
<separator/>
<property name="checked_out"/>
<property name="checked_out_user"/>
<separator/>
<command commandId="com.teamcenter.rac.properties" text="moreProperties"/>
</section>
<section text="ClassificationProperties">
<classificationProperties/>
</section>
</firstcolumn>
<secondcolumn>
<view name="viewer"/>
<view name="actions">
<command actionKey="copyAction" commandId="com.teamcenter.rac.copy" />
<command actionKey="saveAsAction" commandId="org.eclipse.ui.file.saveAs" />
<command actionKey="newProcessAction" commandId="com.teamcenter.rac.newProcess"
text="newProc" />
</view>
</secondcolumn>
</page>
separator
Adds a separator in the pane.
ATTRIBUTES
None.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the following types of style sheets and the New Business
Object wizard:
Property
Summary
Form
Create
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the separator element:
<section text="ItemProperties">
<property name="object_desc"/>
<separator/>
<property name="owning_user" renderingHint="objectlink" modifiable="false"/>
<property name="owning_group" renderingHint="objectlink" modifiable="false"/>
<property name="last_mod_user"/>
<separator/>
<property name="checked_out"/>
<property name="checked_out_user"/>
<separator/>
<command commandId="com.teamcenter.rac.properties" text="moreProperties"/>
</section>
tableDisplay
Displays a set of objects in a table format.
ATTRIBUTES
None.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the Summary style sheets.
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the tableDisplay element:
<section text="AvailableRevisions">
<objectSet source="revision_list.ItemRevision" defaultdisplay="thumbnailDisplay"
sortdirection="descending" sortby="item_revision_id">
<tableDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</tableDisplay>
<thumbnailDisplay/>
<treeDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</treeDisplay>
<listDisplay/>
</objectSet>
</section>
thumbnailDisplay
Displays a set of objects using thumbnails arranged in a grid.
ATTRIBUTES
None.
SUPPORTED
CLIENTS
Rich client
SUPPORTED
STYLE
SHEETS
This tag can be used on Summary style sheets.
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the thumbnailDisplay element:
<section text="AvailableRevisions">
<objectSet source="revision_list.ItemRevision" defaultdisplay="thumbnailDisplay"
sortdirection="descending" sortby="item_revision_id">
<tableDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</tableDisplay>
<thumbnailDisplay/>
<treeDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</treeDisplay>
<listDisplay/>
</objectSet>
</section>
treeDisplay
Displays a set of objects in a tree format.
ATTRIBUTES
None.
SUPPORTED
CLIENTS
Rich client
SUPPORTED
STYLE
SHEETS
This tag can be used on Summary style sheets.
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the treeDisplay element:
<section text="AvailableRevisions">
<objectSet source="revision_list.ItemRevision" defaultdisplay="thumbnailDisplay"
sortdirection="descending" sortby="item_revision_id">
<tableDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</tableDisplay>
<thumbnailDisplay/>
<treeDisplay>
<property name="object_string"/>
<property name="item_revision_id"/>
<property name="release_status_list"/>
<property name="last_mod_date"/>
<property name="last_mod_user"/>
<property name="checked_out_user"/>
</treeDisplay>
<listDisplay/>
</objectSet>
</section>
view
Defines a group of properties to be displayed together. If there are firstcolumn and
secondcolumn elements, this element must be within them.
ATTRIBUTES
name
Specifies the display name of the view. This name can be localized in the textserver
files. This is a required attribute. The following view names are valid: properties,
viewer, impactanalysis, actions, and attachments.
SUPPORTED
CLIENTS
Rich client
Thin client
SUPPORTED
STYLE
SHEETS
This tag can be used on the following types of style sheets and the New Business
Object wizard:
Property
Summary
Form
Create
EXAMPLE
Following is sample code from the ItemSummary.xml XML rendering style sheet
showing the view element:
<secondcolumn>
<view name="viewer"/>
<view name="actions">
<command actionKey="copyAction" commandId="com.teamcenter.rac.copy" />
<command actionKey="saveAsAction" commandId="org.eclipse.ui.file.saveAs" />
<command actionKey="newProcessAction" commandId="com.teamcenter.rac.newProcess"
text="newProc" />
</view>
</secondcolumn>
Rendering hints
Use on Supported
property in thin
Rendering hint types client? JavaBeans
array Used for Yes – date, Headed or headless
array only: string
character, date, (text area), • SWT:
double, float, string Not applicable. (Currently using
integer, logical, LOV, LegacyPropertyBridgeBean.)
short, string, typed
note, typed reference • Swing:
reference, (UID) PropertyArray
typed relation. LOV are
supported Titled (Swing only)
• TitledPropertyArray
checkbox Character, Yes Headed or headless
date, double,
float, integer, • SWT:
logic, short, Not applicable. (Currently using
string, note. LegacyPropertyBridgeBean.)
• Swing:
PropertyCheckbox
Use on Supported
property in thin
Rendering hint types client? JavaBeans
label All types. Used Yes Headed or headless
for display
Note only; you • SWT:
cannot change LabelPropertyBean
As of Teamcenter
9.1, the button the value.
• Swing:
rendering PropertyLabel
hint and the
PropertyButton Titled (Swing only)
bean and
TitledPropertyButton • TitledPropertyLabel
bean are
deprecated and
are no longer
supported. Use the
label hint instead.
localizablearray String. No Headed or headless
• SWT:
Not applicable. (Currently using
LegacyPropertyBridgeBean.)
• Swing:
PropertyLocalizableArray
• Swing:
PropertyLocalizableLOVUIComponent
Use on Supported
property in thin
Rendering hint types client? JavaBeans
localizabletextarea String. No Headed or headless
• SWT:
LocalizedTextAreaPropertyBean
• Swing:
PropertyLocalizableTextArea
• Swing:
PropertyLocalizableTextField
• Swing:
PropertyLocalizableLongTextPanel
• Swing:
PropertyLogicalPanel
Use on Supported
property in thin
Rendering hint types client? JavaBeans
longtext Use only for Yes – Headed or headless
string type Rendered
when the as • SWT:
maximum textarea. Not applicable. (Currently using
length is bigger LegacyPropertyBridgeBean.)
than 2500.
• Swing:
PropertyLongText
Use on Supported
property in thin
Rendering hint types client? JavaBeans
lovuicomp Used with No Headed or headless
LOV only:
character, date, • SWT:
double, float, LOVUIComponentPropertyBean
integer, logical,
short, string, • Swing:
note, typed ref, PropertyLOVUIComponent
typed relation.
Titled (Swing only)
• TitledPropertyLOVUIComponent
objectlink Typed ref, Yes – Headed or headless
typed relation. Rendered
as a text • SWT:
field ObjectLinkPropertyBean
• Swing:
PropertyObjectLink
• Swing:
PropertyPanel
• Swing:
PropertyRadioButton
Use on Supported
property in thin
Rendering hint types client? JavaBeans
radiobuttonoptionlov Used with Yes – Headed or headless
LOV only: Rendered
character, date, using • SWT:
double, float, same Not applicable. (Currently using
integer, short, component LegacyPropertyBridgeBean.)
string, note, as string
typed ref, typed LOV array • Swing:
relation. PropertyRadioButtonOptionLov
Use on Supported
property in thin
Rendering hint types client? JavaBeans
styledtextfield Character, No Headed or headless
date, double,
float, integer, • SWT:
logic, short, StyledTextfieldPropertyBean
string, note.
• Swing:
PropertyStyledTextField
• Swing:
PropertyToggleButton
Use on Supported
property in thin
Rendering hint types client? JavaBeans
togglebuttonoptionlov Used with Yes – Headed or headless
LOV only: Rendered
character, date, using • SWT:
double, float, same Not applicable. (Currently using
integer, short, component LegacyPropertyBridgeBean.)
string, note, as string
typed ref, typed LOV array • Swing:
relation. PropertyToggleButtonOptionLov
• Swing
The Swing property bean is used by the Properties dialog box and the Viewer
view. There are two ways you can implement the Swing property bean:
o Add the new rendering hint definition to a custom stylesheet_user.property
file.
Each rendering hint has a key for the class path of the Java bean defined
in the com\teamcenter\rac\stylesheet.properties file, found in the
com.teamcenter.rac.common JAR file. You can plug in your own bean by
overwriting the entry in the properties file to replace the default Java bean,
or you can add new entries for custom Java beans.
For more information about overriding the properties file, see Customize
the rich client properties files.
The key has the following format for headed or headless beans:
rendering-hint.DEFINITION
For example:
textfield.DEFINITION=com.teamcenter.rac.stylesheet.
PropertyTextField
textfield_titled.DEFINITION=com.teamcenter.rac.stylesheet.
TitledPropertyTextField
After you finish creating the Java code, add the new package or class to your
custom plug-in export-package list in the MANIFEST.MF file, for example:
Export-Package: com.teamcenter.rac.viewer.customplugin.bean
Following is an example Java class that creates a custom SWT rendering hint:
package com.teamcenter.rac.viewer.customplugin.beans;
import com.teamcenter.rac.common.controls.LOVComboBox;
import com.teamcenter.rac.kernel.TCPropertyDescriptor;
import com.teamcenter.rac.viewer.stylesheet.beans.LOVComboBoxPropertyBean;
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
/**
*/
public class MyLOVComboBoxPropertyBean
extends LOVComboBoxPropertyBean implements IExecutableExtension
{
/**
*
* Constructor
*
* @param lovCombo
*/
public MyLOVComboBoxPropertyBean( LOVComboBox lovCombo )
{
super( lovCombo );
}
/**
* Constructor
*
* @param toolkit FormToolkit to use to create UI widgets
* @param parent composite
* @param renderFlat Flag indicating it’s read only or modifiable
* @param paramTable Map of attributes which in stylesheet file.
* @published
*/
public MyLOVComboBoxPropertyBean( FormToolkit toolkit, Composite parent,
boolean renderFlat, Map paramTable )
{
super(toolkit, parent, renderFlat, paramTable);
}
@Override
public void load( TCPropertyDescriptor desc )
throws Exception
{
super.load( desc );
System.out.println("This is mylovcombobox.");
// force it to load the LOVs
lovComboBox.initializeData(false);
}
@Override
public void setUIFValue( final Object value )
{
lovComboBox.getDisplay().asyncExec( new Runnable()
{
public void run()
{
if ( value != null )
{
lovComboBox.setSelectedItem( value );
}
else
{
lovComboBox.setText(""); //$NON-NLS-1$
}
}
} );
}
@Override
public void setInitializationData( IConfigurationElement config,
String propertyName, Object data )
throws CoreException
{
//
}
}
Rendering style
Each type of renderer supports three styles: headed, headless, and titled.
• Headed
Displays the property name on the left followed by the property value renderer.
This is the default rendering style.
This style has two components, the PropertyNameLabel JavaBean for the
property name and the PropertyrenderingHint JavaBean for the renderer (for
example, PropertyTextField or PropertyTextArea).
• Headless
Renders only the property value without displaying the property name.
This style contains only one JavaBean, PropertyrenderingHint.
• Titled
Displays the property name above the property value renderer.
Default renderers
The following table displays the default renderer for each type. If the rendering hint
is not provided, the default renderer is used.
You can use the conditions tag to configure rules on forms to make properties be
conditionally mandatory or disabled on the rich client and thin client. Teamcenter
clients implement specified rules locally using XML rendering style sheets without
modifying the underlying server side metamodel.
For more information about the conditions tag, see conditions.
Note
Style sheets are inherited by form types even where they have not been set.
3. Edit the style sheet to add your conditions between the rendering tags. You
must include rendering tags in the style sheet. If you use conditions, you cannot
use default rendering.
The following example makes the user_data_2 property required if the
user_data_1 property is set to axle and disabled if the object_desc property is
set to part:
<conditions>
<GoverningProperty propertyname = "user_data_1" propertyvalue = "axle">
<Rule propertyname = "user_data_2" state = "required"/>
</GoverningProperty>
<GoverningProperty propertyname = "object_desc" propertyvalue = "part">
<Rule propertyname = "user_data_2" state = "disabled"/>
</GoverningProperty>
</conditions>
• If you specify conflicting or circular rules, Teamcenter does not resolve the
problem. The rules are applied, and no error message is displayed.
A circular rule specifies that field 1 makes field 2 disabled and field 2 makes
field 1 disabled. A conflicting rule specifies that a field is both required and
disabled.
For more information about the tags and their properties, see XML elements.
4. Select Form in the Stylesheet Type list and select the appropriate object from
the Registered Type list.
• Teamcenter extension points and services (for example, the application extension
points).
Note
Your administrator can use the HiddenPerspectives preference to prevent
the display of some Teamcenter perspectives in the rich client.
For information about editing preference values, see the Preferences and
Environment Variables Reference.
If your site has online help installed, you can access application and view help from
the rich client Help menu or by pressing F1.
For more information about rich client perspectives and views, see the Rich Client
Interface Guide.
• Menu contributions
• Handler
For more information and full examples about how to use the Eclipse declarative
approach to menus and toolbars, see the following links:
• http://wiki.eclipse.org/Menu_Contributions
• http://wiki.eclipse.org/Platform_Command_Framework
• http://wiki.eclipse.org/Command_Core_Expressions
• http://www.vogella.de/articles/EclipseCommands/article.html
For examples about how to use the Eclipse approach to add menus and toolbar items,
see Adding menu commands to a menu, toolbar, and shortcut menu.
Command
Command has a globally unique ID and represents the abstract semantic concept of
a behavior, such as copy, paste, and save. A command is not the implementation of
that behavior nor is it the visual representation of that behavior.
<command id="com.teamcenter.rac.command"
name="%com.teamcenter.rac.command.name">
</command>
Menu contributions
Menu contributions represent a particular view or visual representation of a
command. The menu contributions create the menu and toolbar structures and
insert them into the correct Eclipse location. The location is specified as an Uniform
Resource Identifier (URI) and can be any one of the following:
• Main menu
• Main toolbar
• View toolbar
• View menu
• Trim area
The menu contribution can define a menu label, mnemonic, or icon. It contains
visual references to already defined commands. The visual representations of
commands may include labels, icons, and mnemonics. Menu contributions also may
include separators. Separators are only visible if there are visible commands before
and after a separator. The menu contribution can define when it will be visible
with a visibleWhen clause. The visibleWhen clause refers to all standard Eclipse
expressions. This expression can be very simple or very complex and evaluates to
either true or false which determines whether a menu is visible or not.
<menuContribution locationURI="menu:org.eclipse.ui.main.menu">
<menu id="file" label="%menu.file.label" mnemonic="%menu.file.mnemonic">
<command commandId="org.eclipse.ui.file.refresh"
mnemonic="%command.refresh.mnemonic"
style="push">
</command>
<separator name="sep1" visible="true"/>
<command commandId="org.eclipse.ui.file.exit"
mnemonic="%command.exit.mnemonic"
style="push">
</command>
</menu>
</menuContribution>
Note
You can define the icon for a menu toolbar item by specifying a URL. The URL
is case sensitive (for example, icon.PNG is not the same as icon.png). If you
give an incorrect icon URL, a warning is logged to the log file and the Console
view, if displayed. The menu or toolbar item with the incorrect URL definition
is not visible until it is corrected and the rich client is restarted.
If you run in development mode inside the IDE and pull the icon files from a
source folder, Windows is not case sensitive and finds the icons. However, once
you run the rich client from the command line where the icons are packaged
in the plug-in’s JAR file, the Java API does not find the icons since those
APIs are case sensitive.
Always verify the case is correct for image icons.
Handler
A handler implements one particular behavior for a given command. For any given
command, there can be zero or several handlers defined. However only none or
one handler may be active for a given command. The active handler controls the
command’s enabled state.
Handlers most commonly extend the AbstractHandler class. Handlers are
provided an application context in their execute(*) method. If a command has no
active handlers defined, any menu contributions defined for a command are not
visible. A command can also define a default handler ensuring that a command
always has an active handler. The handler can be declaratively activated via the
ActiveWhen clause or programmatically activated. The handler also defines
declaratively when a command appears enabled in any menu contribution with the
enabledWhen expression for the handler.
Introduction to SWT
The Standard Widget Toolkit (SWT) is a graphical toolkit for use with the Java
platform, and is maintained by the Eclipse Foundation. It is an alternative to the
Abstract Window Toolkit (AWT) and Swing Java toolkits.
For more information about SWT, see the following URL:
http://www.eclipse.org/swt/
Because the rich client already uses SWT, the necessary files are already loaded into
your Eclipse environment from TC_ROOT\portal\plugins when you defined the
target platform. Therefore, when you create a Java file, you can use the import
org.eclipse.swt.widgets command to include SWT in your coding.
For instructions about how to define the target platform, see Set the project
preferences.
Note
Teamcenter is moving toward SWT/JFace as the user interface toolkit and
moving away from AWT and Swing. Siemens PLM Software encourages you to
customize Teamcenter using SWT/Jface components. Siemens PLM Software
will discontinue Swing/AWT support in a future version.
For more information, see User interface components documented in Javadoc.
To become familiar with SWT, you can download SWT samples and run the SWT
tutorial in Eclipse:
1. Download Eclipse Classic 3.6 from the following URL:
http://www.eclipse.org/downloads/
SWT tutorial
Note
In the Download SWT standalone step of the tutorial, go to the
following URL:
http://download.eclipse.org/eclipse/downloads/
Select the latest release build, and find the SWT Binary and Source
download.
HelloWorldSWT application
3. If you create a custom rich client plug-in, export the plug-in to the
TC_ROOT\portal\plugins directory or a shared directory.
For more information, see Export your custom plug-in.
4. Clear cache and register any new plug-in to ensure the customization appears
in the rich client.
For more information, see Ensure your customizations appear.
The following steps are required to customize the rich client with Eclipse for the
first time:
1. Install Eclipse.
Install Eclipse
1. If you have not already downloaded and installed the Java Development Kit
(JDK) version 6 (Update 26 or later), do so before proceeding further. You can
download the JDK from the following Web site:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. Download the Eclipse 3.6 Software Development Kit (SDK) kit for your platform
from the following Web site:
http://archive.eclipse.org/eclipse/downloads/index.php
3. After you download the kit, extract the ZIP file to a directory on your machine.
The eclipse directory is automatically created below the installation directory.
4. Create a batch file that sets the environment, starts the server, and launches
Eclipse using the JDK command line parameters. Use the following template to
create your batch file:
set FMS_HOME=TC_ROOT\tccs
set JAVA_HOME=TC_ROOT\portal\jre
set JRE_HOME=TC_ROOT\portal\jre
set CLASSPATH=TC_ROOT\portal
set PATH=%FMS_HOME%\bin;%FMS_HOME%\lib;TC_ROOT\portal;%PATH%
start "TAO ImR" /min cmd /c "TC_ROOT\iiopservers\start_imr.bat"
Eclipse-install-directory\eclipse.exe -vm jdk-install-directory\bin\javaw
Note
You can use the portal.bat file as template for this batch file.
6. Use the default location for the workspace. This location is used by Eclipse to
store the project related information. Click OK.
Eclipse displays the welcome window. You can close it.
b. In the JRE Type dialog box, select Standard VM and click Next.
c. In the JRE Definition dialog box, type the JRE directory in the JRE home
box. It is the jre directory under the Java SDK installation directory.
e. Click Finish to save the new definition and close the dialog box.
2. In the Preferences dialog box, double-click the Plug-in Development node, then
select the Target Platform node.
4. In the Target Definition box, ensure Nothing is selected and click Next.
6. In the Add Content dialog box, select Directory and click Next.
9. In the Target Platform dialog box, select the target you just set and click OK.
2. In the tree on the left of the Create, manage, and run configurations dialog box,
double-click Eclipse Application, then select the New_configuration node.
5. Click the Arguments tab and type the following in the VM arguments box:
-Xms256m -Xmx1024m
6. Click the Debug button in the bottom right of the dialog box.
Ensure that the rich client logon dialog box appears. When it does, either click
Cancel or log on the rich client.
3. Click Next.
4. Click the Browse button to the right of the Directory dialog box and browse to
the TC_ROOT\portal directory.
5. Click Finish.
The JAR file is automatically generated into the TC_ROOT\portal\plugins
directory.
Before running the rich client to verify the customization, run the
TC_ROOT\portal\registry\genregxml file to register the plug-in with the rich
client, and clear the rich client cache.
For more information, see Ensure your customizations appear.
b. In the links folder, create a plain text file with a .link file extension (for
example, custom.link) that points to the shared directory, for example:
path=\\z:\\shared
Or:
path=/z:/shared
The slash is either one (/) or two (\\) depending on direction. Leading
slashes (/ or \\) are required to tell Eclipse that this is an absolute path.
Otherwise, it converts it to a relative path and does not support referencing
another drive.
Note
You must perform these steps whenever you create a new plug-in to add to
the rich client, which should be in most cases of rich client customization
(with the exception of style sheets). You must always wrap your rich client
customizations in a plug-in to ensure that the out-of-the-box rich client is
unchanged, thereby maintaining its integrity the next time you upgrade to a
newer version of Teamcenter. If you customize the out-of-the-box rich client
files, you can lose those customizations the next time you upgrade.
3. Ensure that the -clean and -initialize arguments are added to the portal.bat
file (between the start Teamcenter.exe command and %*).
Run the portal.bat file to launch the rich client to verify that your
customizations appear.
Note
To confirm that the plug-in is registered in the rich client, choose
Help→About→Installation Details and search the list to see the registered
plug-ins.
4. If your customizations still do not appear, to clear cache, delete the Teamcenter\
subdirectory in the user’s home directory on the client. This directory is
automatically created again when the user starts the rich client. This directory
usually contains RAC and TAO subdirectories.
On a Windows client, it is typically the C:\Documents and
Settings\user-name\Teamcenter\ directory on Windows XP or the
Desktop\user-name\Teamcenter directory on Windows 7. On a UNIX client,
it is typically the $HOME/Teamcenter/ directory.
If you delete this directory, the last state of the rich client is lost, and the user
interface appears as it does at initial startup.
2. Create an installable component descriptor (ICD) file that defines your custom
solution.
For more information creating a solution file, see Creating a solution file.
3. Run the Web Application Manager (insweb) to create a distribution instance for
your custom solution.
For more information, see Distribute a solution file.
{
[FROM]
sample.jar
[TO]
plugins
}
#The version of this Sample Solution.
[VERSION]
11
#Requires Teamcenter rich client install.
[PREREQUISITE_SOLUTIONS]
rac4t:11
#This file defines a Solution.
[SOLUTION]
Y
#It’s a Distribution Instance Solution.
[SOLUTION_TYPE]
DS_INSTANCE
#Install information
[MANIFEST_INFO]
{
#This is the RC_ROOT.
[SUBDIR]
rac
[TARGETS]
<target name="file_download_unix">
</target>
<target name="new_solution_unix">
</target>
<target name="file_download_win">
</target>
<target name="new_solution_win">
</target>
[DOWNLOAD_FILES]
{
#This section tells the OTW installer to download the jar.
#The location is subfolder to [SUBDIR] from above.
#If you have more than one jar, you need to list them here like this:
#[COMMON]
#plugins/sample.jar:1.0
#plugins/sample2.jar:1.0
#plugins/sample3.jar:1.0
[COMMON]
plugins/sample.jar:1.0
[SOLARIS]
[HPUX]
[AIX]
[NT_INTEL]
}
[PACKAGED_FILES]
{
[SOLARIS]
[HPUX]
[AIX]
[NT_INTEL]
}
}
The Web Application Manager displays a Progress dialog box and copies the
ICD file.
5. In the Web Applications list, select the rich client instance and click Modify.
The Web Application Manager displays the Modify Web Application dialog box.
7. Ensure the path to your solution files is listed in the Disk Locations for Install
Images box. If it is not, click Add.
10. When installation is complete, click OK to close the Progress dialog box.
The Web Application Manager displays the Modify Web Application dialog box.
13. Launch the Over-the-Web-installed rich client or the local otw.bat file
to download and use the sample.jar file. You can verify the JAR file
was downloaded to the designated installation location by looking in the
RC_ROOT\plugins directory.
Note
Once you install a customization using a solution file, you cannot remove it
using Over-the-Web Installer.
• If your customization includes one or more files that are not already on the
rich client, you must create a feature file using XML code to install the
custom files.
2. Zip your custom JAR file into a rac_feature-name.zip file (for example,
rac_samplecust.zip) with the root path for the JAR file set to \plugins.
The use of rac_ in the name signifies that the ZIP file contains a rich client
feature. For examples of these files, see the portal\compressed_files directory
on the Teamcenter installation source.
3. Click the browse button in the Update kit location box, navigate to the directory
that contains your ZIP file, select it, and click Select.
Install new client-side only customized files with a feature file and Configuration
Manager
If your customization includes one or more files that are not already on the rich
client and customize the client only, you must create a feature file using XML code
to install the custom files. If your customized files modify rich client files that have
been already installed, do not create the feature file; see Install the customized files
with Updates Manager instead.
1. In a text editor, create an XML file with the following code:
<?xml version="1.0" encoding="UTF-8"?>
<feature>
<name value="New Customization Files"/>
<size value="21"/>
<os value="windows" version="5.1"/>
<os value="sunos" version="5.10"/>
• Add or remove os tags to match the platforms where you use rich client.
• In the guid tag, change the value text to a unique value exactly 32
characters in length and composed of any combination of the numbers 0–9
and the letters A–F.
• In the unzip tag, change the file text to the name of the ZIP file that
contains your customizations.
To ensure that the todir="portal" line correctly unzips to the
portal\plugins directory, ensure that \plugins is set as the location in
the ZIP file.
10. Under the Client Enhancements node, select the check box for your new files.
The name of the box is the one you gave it in the feature file. Click Next.
11. In the Confirm Selections panel, click Next to start installing your customization
files.
Install new client and server customized files with a feature file and Configuration
Manager
If your customization includes one or more files that are not already on the rich
client and you customize both the client and server sides, you must modify the server
(Business Modeler IDE template project) feature file.
1. Open the template project in Business Modeler IDE, and in the Navigator view,
open the feature_template-name.xml file under the installation folder. Add the
following code directly at the same level as the data model feature:
<feature>
<name value="feature-display-name"/>
<property name="feature_id" value="rac"/>
<property name="bmide_optional" value="true"/>
<relation>
<depends>
<or value="FF18D25DA73019F880BCFFBC0029CA28"/>
<or value="E2564104E1B964BB23D78078DBA34EEA"/>
<or value="A2564824E1B434AC23D70178DBA34BCA"/>
</depends>
</relation>
<size value="0"/>
<singular value="true"/>
<guid value="85B3827CD5A0FA61220398F6C60C21AB"/>
<files>
<code>
<unzip file="portal/compressed_files/rac_feature-name.zip"
todir="portal"/>
</code>
</files>
</feature>
• In the name tag, change the value text to the feature name you want
displayed in TEM.
• In the size tag, change the value text to the approximate size (in megabytes)
of your customization files.
• In the guid tag, change the value text to a unique value exactly 32
characters in length and composed of any combination of the numbers 0–9
and the letters A–F.
• In the unzip tag, change the file text to the name of the ZIP file that
contains your customizations.
To ensure that the todir="portal" line correctly unzips to the
portal\plugins directory, ensure that \plugins is set as the location in
the ZIP file.
9. Under Base Install, select Teamcenter Rich Client 2-tier and under the
Extensions node, select the check box for your new files. Click Next.
10. In the Confirm Selections panel, click Next to start installing your customization
files.
b. In the New Project dialog box, select Plug-in Project. Then click Next.
c. In the New Plug-in Project dialog box Plug-in Project pane, type
com.mycom.addmenuitem in the Project name box. Click Next.
d. In the New Plug-in Project dialog box Content pane, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Ensure the Create a plug-in using one of these templates check box is
selected and select Hello, World Command in the list. Click Finish.
name="Sample Command"
id="com.mycom.addmenuitem.commands.sampleCommand">
</command>
</extension>
<extension point="org.eclipse.ui.handlers">
<handler
commandId="com.mycom.addmenuitem.commands.sampleCommand"
class="com.mycom.addmenuitem.handlers.SampleHandler">
</handler>
</extension>
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="menu:tools?after=additions">
<command
commandId="com.mycom.addmenuitem.commands.sampleCommand"
mnemonic="S"
icon="icons/sample.gif"
id="com.mycom.addmenuitem.menus.sampleCommand">
<visibleWhen>
<reference
definitionId="com.teamcenter.rac.ui.inMainPerspective">
</reference>
</visibleWhen>
</command>
</menuContribution>
</extension>
</plugin>
To add the menu to the menu bar instead of the Tools menu, change the
locationURI attribute to the following:
locationURI="menu:org.eclipse.ui.main.menu?after=additions"
b. In the New Project dialog box, select Plug-in Project. Then click Next.
c. In the New Plug-in Project dialog box Plug-in Project pane, type
com.mycom.addshortcut in the Project name box. Click Next.
d. In the New Plug-in Project dialog box Content pane, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Ensure the Create a plug-in using one of these templates check box is
selected and select Hello, World Command in the list. Click Finish.
If you want to package the project for distribution, export it to a JAR file and
place it in the TC_ROOT\portal directory.
b. In the New Project dialog box, select Plug-in Project. Then click Next.
c. In the New Plug-in Project dialog box Plug-in Project pane, type
com.mycom.addbutton in the Project name box. Click Next.
d. In the New Plug-in Project dialog box Content pane, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Ensure the Create a plug-in using one of these templates check box is
selected and select Hello, World Command in the list. Click Finish.
icon="icons/sample.gif"
tooltip="Say hello world"
id="com.mycom.addbutton.toolbars.sampleCommand">
<visibleWhen>
<reference
definitionId="com.teamcenter.rac.ui.inMainPerspective">
</reference>
</visibleWhen>
</command>
</menuContribution>
</extension>
</plugin>
Each Teamcenter perspective has its own toolbar. For example, the My
Teamcenter toolbar is navigator_Toolbar, and the Structure Manager toolbar
is pse_Toolbar. The toolbar is usually defined in the plugin.xml file for the
perspective. For example, the pse_Toolbar is defined in the plugin.xml file in
the com.teamcenter.rac.pse plug-in.
b. In the New Project dialog box, select Plug-in Project. Then click Next.
c. In the New Plug-in Project dialog box Plug-in Project pane, type
com.mycom.exitcommand in the Project name box. Click Next.
d. In the New Plug-in Project dialog box Content pane, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Ensure the Create a plug-in using one of these templates check box is
selected and select Hello, World Command in the list. Click Finish.
com.mycom.exitcommand
com.mycom.exitcommand.handlers
name="Sample Command"
categoryId="com.mycom.exitcommand.commands.category"
id="com.mycom.exitcommand.commands.sampleCommand">
</command>
<command
defaultHandler="com.mycom.exitcommand.handlers.SampleHandler"
id="com.mycom.exitcommand.command1.Exit"
name="Exit">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
commandId="com.mycom.exitcommand.commands.sampleCommand"
class="com.mycom.exitcommand.handlers.SampleHandler">
</handler>
</extension>
<extension
point="org.eclipse.ui.bindings">
<key
commandId="com.mycom.exitcommand.commands.sampleCommand"
contextId="org.eclipse.ui.contexts.window"
sequence="M1+6"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
</key>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:com.teamcenter.rac.ui.views.DetailsView?after=group4">
<menu
id="closeMenu"
label="Close">
<command
commandId="com.mycom.exitcommand.command1.Exit"
label="Exit"
style="push"
tooltip="Exit the application">
</command>
</menu>
</menuContribution>
<menuContribution
locationURI="toolbar:com.teamcenter.rac.ui.views.DetailsView">
<toolbar
id="com.mycom.exitcommand.toolbar1">
<command
commandId="com.mycom.exitcommand.command1.Exit"
icon="icons/sample.gif"
label="Exit"
style="push"
tooltip="Exit the application">
</command>
</toolbar>
<command
commandId="com.mycom.exitcommand.command1.Exit"
icon="icons/sample.gif"
label="Exit"
style="push"
tooltip="Exit the application">
</command>
</menuContribution>
</extension>
</plugin>
Although this example shows how to add an exit command, you can use this
process to add your own custom command to a view toolbar and menu.
b. In the New Project dialog box, select Plug-in Project. Then click Next.
c. In the New Plug-in Project dialog box Plug-in Project pane, type
com.mycom.toggle in the Project name box. Click Next.
d. In the New Plug-in Project dialog box Content pane, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Ensure the Create a plug-in using one of these templates check box is
selected and select Hello, World Command in the list. Click Finish.
b. Click the Runtime tab, click the Add button, and select the following:
com.mycom.toggle
com.mycom.toggle.handlers
commandId="com.mycom.toggle.commands.warnCommand"
label="Warn"
mnemonic="W"
style="toggle">
<visibleWhen>
<reference
definitionId="com.teamcenter.rac.ui.inMainPerspective">
</reference>
</visibleWhen>
</command>
<command
commandId="com.mycom.toggle.commands.errorCommand"
label="Error"
mnemonic="E"
style="toggle">
<visibleWhen>
<reference
definitionId="com.teamcenter.rac.ui.inMainPerspective">
</reference>
</visibleWhen>
</command>
</menu>
</menuContribution>
</extension>
</plugin>
package com.mycom.toggle.handlers;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.handlers.HandlerUtil;
import com.teamcenter.rac.util.Registry;
public class ToggleErrorHandler extends AbstractHandler {
private Registry reg ;
public ToggleErrorHandler() {
}
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Command command = event.getCommand();
boolean checked = HandlerUtil.toggleCommandState(command);
IWorkbenchWindow window = HandlerUtil
.getActiveWorkbenchWindowChecked(event);
reg = Registry.getRegistry(this);
if (checked) {
MessageDialog.openError(window.getShell(), reg.getString("Error.TITLE"),
reg.getString("Error.MESSAGE"));
}
return null;
}
}
b. In the New Project dialog box, select Plug-in Project. Click Next.
c. In the New Plug-in Project wizard Plug-in Project dialog box, type
com.mycom.customview in the Project name box. Click Next.
d. In the New Plug-in Project wizard Content dialog box, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Clear the Create a plug-in using one of these templates check box. Click
Finish.
b. Click the Dependencies tab, click the Add button, and select the
com.teamcenter.rac.kernel plug-in.
@Override
public IAspectUIService getUIService() {
// TODO Auto-generated method stub
return null;
}
protected void setupServices(BundleContext context) {
// TODO Auto-generated method stub
}
}
g. To create an empty plugin.xml file, click the Extensions tab and click the
Add button in the Extensions view, and click the Cancel button in the New
Extension dialog box.
A plugin.xml file is added to the project.
h. Click the plugin.xml tab and replace the code in the plugin.xml file with
the following:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.6"?>
<plugin>
<extension point="org.eclipse.ui.commands">
<command
name="Sample Command"
id="com.mycom.customview.commands.sampleCommand">
</command>
</extension>
<extension point="org.eclipse.ui.handlers">
<handler
commandId="com.mycom.customview.commands.sampleCommand"
class="com.mycom.customview.handlers.SampleHandler">
</handler>
</extension>
<extension point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:org.eclipse.ui.main.menu?after=additions">
<menu
label="Sample Menu"
mnemonic="M"
id="com.mycom.customview.menus.sampleMenu">
<command
commandId="com.mycom.customview.commands.sampleCommand"
mnemonic="S"
id="com.mycom.customview.menus.sampleCommand">
<visibleWhen>
<reference
definitionId="com.mycom.customview.inMainView" />
</visibleWhen>
</command>
</menu>
</menuContribution>
</extension>
<extension point="org.eclipse.ui.views">
<view
name="MyCom Custom View"
class="com.mycom.customview.views.CustomView"
id="com.mycom.customview.views.CustomView">
</view>
</extension>
<extension point="org.eclipse.core.expressions.definitions">
<definition id="com.mycom.customview.inMainView">
<with variable="activePartId">
<equals value="com.mycom.customview.views.CustomView" />
</with>
</definition>
</extension>
</plugin>
the user starts the rich client. This directory usually contains RAC and
TAO subdirectories.
On a Windows client, it is typically the C:\Documents and
Settings\user-name\Teamcenter\ directory on Windows XP or the
Desktop\user-name\Teamcenter directory on Windows 7. On a UNIX
client, it is typically the $HOME/Teamcenter/ directory.
For more information, see Ensure your customizations appear.
b. In the New Project dialog box, select Plug-in Project. Click Next.
c. In the New Plug-in Project wizard Plug-in Project dialog box, type
com.mycom.myview in the Project name box. Click Next.
d. In the New Plug-in Project wizard Content dialog box, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Clear the Create a plug-in using one of these templates check box. Click
Finish.
b. Click the Dependencies tab, click the Add button, and select the following
plug-ins:
com.teamcenter.rac.aifrcp
com.teamcenter.rac.common
com.teamcenter.rac.kernel
com.teamcenter.rac.util
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.part.*;
import com.mycom.myview.Activator;
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
import com.teamcenter.rac.common.IContextInputService;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.util.OSGIUtil;
import com.teamcenter.rac.util.AdapterUtil;
// This view shows how to:
// be a selection listener
// be a selection provider
// use the Teamcenter OSGI IContextInputService
// use the Teamcenter selection to AIFComponentContext adapter
// use Eclipse Jobs (to jump off the main thread)
// ...see IC_SelectionListener()
public class MyComView extends ViewPart {
public static final String ID = "com.mycom.myview.views.MyComView";
private TableViewer m_viewer;
private ISelection m_selection;
private MyComView m_view;
private IC_SelectionListener m_listener;
private boolean m_firstTime = true;
/**
* The constructor.
*/
public MyComView() {
m_view = this;
}
@Override
public void createPartControl(Composite parent) {
parent.setLayout( new FillLayout() );
// setup the viewer
m_viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
m_viewer.setContentProvider(new ViewContentProvider());
m_viewer.setLabelProvider(new ViewLabelProvider());
m_listener = new IC_SelectionListener();
// register the selection listener
getSite().getWorkbenchWindow().getSelectionService().addSelectionListener
( m_listener );
// viewer is a selection provider
getViewSite().setSelectionProvider( m_viewer );
}
@Override
public void dispose() {
// cleanup
getViewSite().setSelectionProvider( null );
getSite().getWorkbenchWindow().getSelectionService().removeSelectionListener
(m_listener);
super.dispose();
}
/**
* Passing the focus request to the viewer’s control.
*/
@Override
public void setFocus() {
//do nothing
}
// this will be executed in a job...it will get the children in the job
// and set the viewer input in the main thread
void setViewerInput() {
// use the Teamcenter adapter
AIFComponentContext ctxt = (AIFComponentContext) AdapterUtil.getAdapter(
( (StructuredSelection) m_selection ).getFirstElement(),
AIFComponentContext.class, true );
AIFComponentContext[] ctxts = null;
if (ctxt != null)
{
TCComponent comp = (TCComponent) ctxt.getComponent();
if (comp!=null)
{
try {
ctxts = comp.getChildren();
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
final AIFComponentContext[] fctxts = ctxts;
Display.getDefault().asyncExec(new Runnable() {
public void run() {
if (m_viewer.getContentProvider() != null)
{
m_viewer.setInput(fctxts == null ? new AIFComponentContext[0]
: fctxts);
}
}
});
}
// this is the viewer content provider
class ViewContentProvider implements IStructuredContentProvider {
public void inputChanged(Viewer v, Object oldInput, Object newInput) {
}
public void dispose() {
}
public Object[] getElements(Object parent) {
return (AIFComponentContext[])parent;
}
}
// this is the viewer label provider
class ViewLabelProvider extends LabelProvider implements
ITableLabelProvider {
public String getColumnText(Object obj, int index) {
AIFComponentContext ctxt = (AIFComponentContext)obj;
TCComponent tc = (TCComponent)ctxt.getComponent();
return tc.toString();
}
public Image getColumnImage(Object obj, int index) {
return null;
}
}
// this is the selection listener
private class IC_SelectionListener implements ISelectionListener
{
public void selectionChanged( IWorkbenchPart part, ISelection selection )
{
m_selection = selection;
if( selection == null || selection.isEmpty() )
{
IContextInputService contextInputService = (IContextInputService)
OSGIUtil.getService(
Activator.getDefault(), IContextInputService.class );
if( contextInputService != null )
{
m_selection = contextInputService.getInput();
}
}
// ignore selections from this view
// need m_firstTime to load the viewer if we open this view in a
// perspective where it is not showing
if( (m_firstTime) || (part != m_view) )
{
m_firstTime = false;
if (m_selection != null)
{
// use a job...don’t want to tie up the main thread
Job j = new Job( "" )
{
@Override
protected IStatus run( IProgressMonitor monitor )
{
setViewerInput();
return Status.OK_STATUS;
}
};
j.schedule();
}
}
}
}
}
e. To create an empty plugin.xml file, click the Extensions tab and click the
Add button in the Extensions view, and click the Cancel button in the New
Extension dialog box.
A plugin.xml file is added to the project.
f. Click the plugin.xml tab and replace the code in the plugin.xml file with
the following:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.6"?>
<plugin>
<extension point="org.eclipse.ui.views">
<view
name="MyCom View"
class="com.mycom.myview.views.MyComView"
id="com.mycom.myview.views.MyComView">
</view>
</extension>
</plugin>
C. Select an object.
The MyCom View view shows the contents of the selected object.
Viewer view
1. Create the project.
a. In Eclipse, choose File→New→Project.
b. In the New Project dialog box, select Plug-in Project. Click Next.
c. In the New Plug-in Project wizard Plug-in Project dialog box, type
com.mycom.customviewerview in the Project name box. Click Next.
d. In the New Plug-in Project wizard Content dialog box, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Clear the Create a plug-in using one of these templates check box. Click
Finish.
b. Click the Dependencies tab, click the Add button, and select the following
plug-ins:
org.eclipse.ui
org.eclipse.core.runtime
com.teamcenter.rac.aifrcp
com.teamcenter.rac.common
com.teamcenter.rac.kernel
com.teamcenter.rac.util
com.teamcenter.rac.viewer
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import com.teamcenter.rac.common.tcviewer.TCComponentViewerInput;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.util.AdapterUtil;
import com.teamcenter.rac.util.viewer.IViewerEvent;
import com.teamcenter.rac.util.viewer.ViewerEvent;
import com.teamcenter.rac.viewer.view.AbstractSwtSubViewer;
/**
* A simple "Hello World" example viewer.
*/
public class HelloWorldViewer
extends AbstractSwtSubViewer //implements IAdaptable
{
private Composite m_composite = null;
private Label m_label = null;
private TCComponent m_comp = null;
public HelloWorldViewer( Composite parent )
{
m_composite = new Composite( parent , SWT.NONE );
m_composite.setLayout(new FillLayout());
m_label = new Label( m_composite, SWT.None );
m_label.setText( "" );
m_label.setVisible(true);
m_label.setEnabled(true);
}
/*
* Currently this is just getting the TCComponent object
* from the viewer input.
*/
@Override
public void setInput( Object viewerInput )
{
TCComponentViewerInput input = (TCComponentViewerInput)
AdapterUtil.getAdapter( viewerInput,
TCComponentViewerInput.class );
m_comp = (TCComponent)input.getViewableObj();
super.setInput( m_comp );
}
@Override
public void inputChanged( Object input, Object oldInput )
{
HelloWorldViewerContentProvider cp = (HelloWorldViewerContentProvider)
getContentProvider();
String text = cp.getText( input );
m_label.setText( text );
//Notify the host viewer to reload.
ViewerEvent viewerEvent = new ViewerEvent( this, IViewerEvent.RELOADVIEW );
viewerEvent.queueEvent();
}
@Override
public Control getControl() {
return m_composite;
}
@Override
public void refresh() {
m_composite.layout();
}
{
//Do nothing.
}
public String getText( Object input )
{
return "Hello " + input.toString() + "!";
}
}
F. To create an empty plugin.xml file, click the Extensions tab and click
the Add button in the Extensions view, and click the Cancel button
in the New Extension dialog box.
A plugin.xml file is added to the project.
G. Click the plugin.xml tab and replace the code in the plugin.xml file
with the following:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="com.teamcenter.rac.viewer.ViewerViewRegistry">
<viewer
autoCheckout="false"
factoryClassName="com.mycom.customviewerview.factory.
HelloWorldViewerFactory"
id="HelloWorldViewer"
isSwing="false"
priority="100">
<enableWhen
checkEnabled="false">
</enableWhen>
</viewer>
<viewer
autoCheckout="false"
factoryClassName="com.teamcenter.rac.common.tcviewer.factory.
SwingViewerFactory"
id="SwingPropertyViewer"
isSwing="true"
priority="100"
viewPanel="com.teamcenter.rac.common.tcviewer.GenericViewer">
<enableWhen
checkEnabled="false">
</enableWhen>
</viewer>
</extension>
</plugin>
Note
Copying and pasting the plugin.xml file content is a quick way
to provide you with extensions for this example. However, when
you create your own extensions, instead of placing content directly
in the plugin.xml file, you work in the project’s Extensions tab.
Therefore, review the Extensions tab to see how you can create
extensions yourself.
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.ISaveablePart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.menus.CommandContributionItem;
import org.eclipse.ui.menus.CommandContributionItemParameter;
import com.teamcenter.rac.aif.kernel.AIFComponentChangeEvent;
import com.teamcenter.rac.aif.kernel.AIFComponentEvent;
import com.teamcenter.rac.aif.kernel.AIFComponentPropertyChangeEvent;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponentEventListener;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.common.SoaPropertyHelper;
import com.teamcenter.rac.common.tcviewer.TCComponentViewerInput;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCProperty;
import com.teamcenter.rac.util.AdapterUtil;
import com.teamcenter.rac.util.MessageBox;
import com.teamcenter.rac.util.SWTUIUtilities;
import com.teamcenter.rac.util.controls.DateControl;
import com.teamcenter.rac.util.controls.TextControl;
import com.teamcenter.rac.util.viewer.IViewerEvent;
import com.teamcenter.rac.util.viewer.ViewerEvent;
import com.teamcenter.rac.viewer.stylesheet.StylesheetRenderingConstants;
import com.teamcenter.rac.viewer.view.AbstractSwtSubViewer;
public class MyPropertyViewer
extends AbstractSwtSubViewer implements IAdaptable, ISaveablePart,
InterfaceAIFComponentEventListener
{
private Composite m_composite = null;
private TCComponent m_comp = null;
private Label m_w2StrLabel = null;
private TextControl m_w2StrText;
private TCProperty m_w2StrProp;
private Label m_w2IntegerLabel = null;
private TextControl m_w2IntegerText;
private TCProperty m_w2IntProp;
private Label m_w2DateLabel = null;
private DateControl m_w2DateButton;
private TCProperty m_w2DateProp;
private Label m_w2ObjDescLabel = null;
private TextControl m_w2ObjDescText;
private TCProperty m_w2ObjDescProp;
// private Label m_lovLabel;
// private LOVComboBox m_lovComboBox;
// private TCProperty m_lovProp;
public MyPropertyViewer( Composite parent )
{
m_composite = new Composite( parent , SWT.NONE );
m_composite.setLayout(new GridLayout(2, false) );
m_w2StrLabel = new Label( m_composite, SWT.None );
m_w2StrText = new TextControl( m_composite, SWT.SINGLE | SWT.FLAT | SWT.BORDER );
GridData m_w2StrTextGd = new GridData();
m_w2StrTextGd.horizontalAlignment = SWT.FILL;
m_w2StrTextGd.verticalAlignment = SWT.CENTER;
m_w2StrTextGd.widthHint = 30 * StylesheetRenderingConstants.
DEFAULT_TEXTFIELD_COL_WIDTH;
m_w2StrText.getTextWidget().setLayoutData( m_w2StrTextGd );
m_w2IntegerLabel = new Label( m_composite, SWT.None );
m_w2IntegerText = new TextControl( m_composite, SWT.SINGLE | SWT.FLAT |
SWT.BORDER );
m_w2IntegerText.getTextWidget().setLayoutData( m_w2StrTextGd );
m_w2DateLabel = new Label( m_composite, SWT.None );
AIFUtility.getDefaultSession().addAIFComponentEventListener( this );
}
@Override
public void setInput( Object viewerInput )
{
TCComponentViewerInput input = (TCComponentViewerInput)
AdapterUtil.getAdapter( viewerInput,
TCComponentViewerInput.class );
m_comp = (TCComponent)input.getViewableObj();
super.setInput( m_comp );
}
@Override
public void inputChanged( Object input, Object oldInput )
{
MyPropertyViewerContentProvider cp = (MyPropertyViewerContentProvider)
getContentProvider();
m_w2StrLabel.setText( cp.getPropertyDisplayName("w2str") );
m_w2StrProp = cp.getTCPropery("w2str");
m_w2StrText.getTextWidget().setText(m_w2StrProp.getStringValue());
m_w2IntegerLabel.setText(cp.getPropertyDisplayName("w2integer"));
m_w2IntProp = cp.getTCPropery("w2integer");
int ii = m_w2IntProp.getIntValue();
if( !m_w2IntProp.getNullVerdict() )
{
m_w2IntegerText.getTextWidget().setText(Integer.toString(ii));
}
m_w2DateLabel.setText(cp.getPropertyDisplayName("w2date"));
m_w2DateProp = cp.getTCPropery("w2date");
m_w2DateButton.setDate(m_w2DateProp.getDateValue());
m_w2ObjDescLabel.setText(cp.getPropertyDisplayName("object_desc"));
m_w2ObjDescProp = cp.getTCPropery("object_desc");
m_w2ObjDescText.getTextWidget().setText(m_w2ObjDescProp.getStringValue());
ViewerEvent viewerEvent = new ViewerEvent( this, IViewerEvent.RELOADVIEW );
viewerEvent.queueEvent();
}
@Override
public Control getControl()
{
return m_composite;
}
@Override
public void refresh()
{
if( m_composite == null || m_composite.isDisposed() )
{
return;
}
m_composite.layout();
if( m_comp.isCheckedOut() )
{
// Make panel writable
m_w2StrText.getTextWidget().setEditable(true);
m_w2IntegerText.getTextWidget().setEditable(true);
m_w2DateButton.setEnabled(true);
m_w2ObjDescText.getTextWidget().setEditable(true);
}
else
{
// make panel read-only or just show values in label like OOTB behavior.
m_w2StrText.getTextWidget().setEditable(false);
m_w2IntegerText.getTextWidget().setEditable(false);
m_w2DateButton.setEnabled(false);
m_w2ObjDescText.getTextWidget().setEditable(false);
}
}
@Override
public Object getAdapter( Class adapter )
{
if( adapter.equals( IContributionItem[].class ) )
{
return getCommandContributions();
}
return null;
}
private IContributionItem[] getCommandContributions()
{
List<IContributionItem> list = new ArrayList<IContributionItem>();
CommandContributionItemParameter contributionParameters =
new CommandContributionItemParameter(
PlatformUI.getWorkbench(), "", "com.teamcenter.rac.checkOut",
CommandContributionItem.STYLE_PUSH );
contributionParameters.mode = CommandContributionItem.MODE_FORCE_TEXT;
list.add( new CommandContributionItem( contributionParameters ) );
contributionParameters = new CommandContributionItemParameter(
PlatformUI.getWorkbench(), "",
"com.teamcenter.rac.checkIn", CommandContributionItem.STYLE_PUSH );
contributionParameters.mode = CommandContributionItem.MODE_FORCE_TEXT;
list.add( new CommandContributionItem( contributionParameters ) );
contributionParameters = new CommandContributionItemParameter(
PlatformUI.getWorkbench(), "",
"com.teamcenter.rac.saveCheckOut",
CommandContributionItem.STYLE_PUSH );
contributionParameters.mode = CommandContributionItem.MODE_FORCE_TEXT;
list.add( new CommandContributionItem( contributionParameters ) );
contributionParameters = new CommandContributionItemParameter(
PlatformUI.getWorkbench(), "",
"com.teamcenter.rac.cancelCheckOut",
CommandContributionItem.STYLE_PUSH );
contributionParameters.mode = CommandContributionItem.MODE_FORCE_TEXT;
list.add( new CommandContributionItem( contributionParameters ) );
return list.toArray( new IContributionItem[list.size()] );
}
// Implementation of ISaveablePart
@Override
public boolean isDirty()
{
// Check if the value has been changed
String txt = m_w2StrText.getTextWidget().getText();
if( !txt.equals(m_w2StrProp.getStringValue()) )
{
return true;
}
txt = m_w2IntegerText.getTextWidget().getText();
if( !txt.isEmpty() && m_w2IntProp.getNullVerdict() ||
txt.isEmpty() && !m_w2IntProp.getNullVerdict() )
{
return true;
}
if(!txt.isEmpty() && !txt.equals(Integer.toString(m_w2IntProp.getIntValue())))
{
return true;
}
Date date = m_w2DateButton.getDate();
if( (date == null && !m_w2DateProp.getNullVerdict()) ||
(date != null && m_w2DateProp.getNullVerdict()))
{
return true;
}
if( date != null && !date.equals(m_w2DateProp.getDateValue()) )
{
return true;
}
txt = m_w2ObjDescText.getTextWidget().getText();
if( !txt.equals(m_w2ObjDescProp.getStringValue()) )
{
return true;
}
return false;
}
// Implementation of ISaveablePart
@Override
public boolean isSaveAsAllowed()
{
return false;
}
// Implementation of ISaveablePart
@Override
public boolean isSaveOnCloseNeeded()
{
return true;
}
// Implementation of ISaveablePart
@Override
public void doSaveAs()
{
//not supported
}
// Implementation of ISaveablePart
@Override
public void doSave( final IProgressMonitor monitor )
{
try
{
setBusy( true );
// Save any changes in the viewer
TCProperty[] props = new TCProperty[] {m_w2StrProp,
m_w2IntProp, m_w2DateProp, m_w2ObjDescProp};
//TCProperty[] props = new TCProperty[] {m_w2ObjDescProp, m_lovProp};
String txt = m_w2StrText.getTextWidget().getText();
m_w2StrProp.setStringValueData(txt);
txt = m_w2IntegerText.getTextWidget().getText();
if( txt.isEmpty() )
{
m_w2IntProp.setNullVerdict(true);
}
else
{
int ii = Integer.parseInt(txt);
m_w2IntProp.setIntValueData(ii);
}
Date date = m_w2DateButton.getDate();
m_w2DateProp.setDateValueData(date);
txt = m_w2ObjDescText.getTextWidget().getText();
m_w2ObjDescProp.setStringValueData(txt);
SoaPropertyHelper.setPropertiesService( m_comp, props );
}
catch( Exception e )
{
MessageBox.post(e);
}
}
// Implement InterfaceAIFComponentEventListener
@Override
public void processComponentEvents( AIFComponentEvent[] events )
{
if( getInput() == null )
{
// nothing to be done.
return;
}
boolean requireUpdate = false;
Arrays.sort( events );
for( AIFComponentEvent event : events )
{
InterfaceAIFComponent targetComponent = event.getComponent();
if( targetComponent == getInput() ) // changed.
{
if( event instanceof AIFComponentPropertyChangeEvent )
{
// For property change event, don’t need to refresh the whole panel
}
else if( event instanceof AIFComponentChangeEvent )
{
requireUpdate = true;
}
}
}
if( requireUpdate )
{
SWTUIUtilities.asyncExec( new Runnable()
{
// update the check in/out UI widgets only
@Override
public void run()
{
refresh();
}
} );
}
}
}
{
e.printStackTrace();
}
return propName;
}
/**
* Return the property value
* @param propName The property name
* @return Object
*/
public Object getPropertyValue(String propName)
{
try
{
TCProperty prop = m_comp.getTCProperty(propName);
if( prop != null )
{
return prop.getPropertyData();
}
}
catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
}
F. Click the plugin.xml tab and add the code in bold to the plugin.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="com.teamcenter.rac.viewer.ViewerViewRegistry">
<viewer
autoCheckout="false"
factoryClassName="com.mycom.customviewerview.factory.
HelloWorldViewerFactory"
id="HelloWorldViewer"
isSwing="false"
priority="100">
<enableWhen
checkEnabled="false">
</enableWhen>
</viewer>
<viewer
autoCheckout="false"
factoryClassName="com.mycom.customviewerview.factory.
MyPropertyViewerFactory"
id="MyPropertyViewer"
isSwing="false"
priority="100">
<enableWhen
checkEnabled="false">
</enableWhen>
</viewer>
<viewer
autoCheckout="false"
factoryClassName="com.teamcenter.rac.common.tcviewer.factory.
SwingViewerFactory"
id="SwingPropertyViewer"
isSwing="true"
priority="100"
viewPanel="com.teamcenter.rac.common.tcviewer.GenericViewer">
<enableWhen
checkEnabled="false">
</enableWhen>
</viewer>
</extension>
</plugin>
Note
Copying and pasting content into the plugin.xml file is a
quick way to provide you with extensions for this example.
However, when you create your own extensions, instead of placing
content directly in the plugin.xml file, you work in the project’s
Extensions tab. Therefore, review the Extensions tab to see how
you can create extensions yourself.
b. In the New Project dialog box, select Plug-in Project. Click Next.
c. In the New Plug-in Project wizard Plug-in Project dialog box, type
com.mycom.customapp in the Project name box. Click Next.
d. In the New Plug-in Project wizard Content dialog box, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Clear the Create a plug-in using one of these templates check box. Click
Finish.
b. Click the Dependencies tab, click the Add button, and select the
com.teamcenter.rac.kernel plug-in.
• An icons directory.
Note
To create a directory, right-click the project and choose
New→Folder.
return null;
}
@Override
public IAspectUIService getUIService() {
// TODO Auto-generated method stub
return null;
}
protected void setupServices(BundleContext context) {
// TODO Auto-generated method stub
}
}
f. To create an empty plugin.xml file, click the project’s Extensions tab and
click the Add button in the Extensions view, and click the Cancel button in
the New Extension dialog box.
A plugin.xml file is added to the project.
g. Click the project’s plugin.xml tab and replace the code in the plugin.xml
file with the following:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.6"?>
<plugin>
<extension point="com.teamcenter.rac.aifrcp.application">
<aif_app_item
displayMode="Primary"
groupName="Mycompany"
icon="icons/defaultapplication_32.png"
id="com.mycom.customapp"
name="Custom Application"
ordinality="200"
perspective_id="com.mycom.customapp.perspectives.CustomPerspective"
session="com.teamcenter.rac.kernel.TCSession"
tooltip="Custom Application"/>
</extension>
<extension point="org.eclipse.ui.perspectives">
<perspective
class="com.mycom.customapp.perspectives.CustomPerspective"
icon="icons/defaultapplication_16.png"
id="com.mycom.customapp.perspectives.CustomPerspective"
name="Custom Application"/>
</extension>
<extension point="org.eclipse.ui.views">
<view
allowMultiple="false"
class="com.mycom.customapp.views.CustomView"
icon="icons/pview.gif"
id="com.mycom.customapp.views.CustomView"
name="Custom View"/>
</extension>
<extension point="org.eclipse.core.expressions.definitions">
<definition id="com.mycom.customapp.inMainView">
<or>
<with variable="activePartId">
<equals value="com.mycom.customapp.views.CustomView" />
</with>
<with variable="arc_property.ACTIVE_APPLICATION">
<equals value="com.mycom.customapp" />
</with>
</or>
</definition>
</extension>
</plugin>
This example does not require the definitions extension; you can remove it.
It is included for reference to show how you can determine if your application
is active.
b. Verify that the new Custom Application button is shown in the left-hand
navigation pane in the rich client.
b. In the New Project dialog box, select Plug-in Project. Click Next.
c. In the New Plug-in Project wizard Plug-in Project dialog box, type
com.mycom.sendtoapp in the Project name box. Click Next.
d. In the New Plug-in Project wizard Content dialog box, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Clear the Create a plug-in using one of these templates check box. Click
Finish.
b. Select the Dependencies tab, click the Add button, and select the following
plug-ins:
com.teamcenter.rac.aifrcp
com.teamcenter.rac.common
com.teamcenter.rac.kernel
• An icons directory.
Note
To create a directory, right-click the project and choose
New→Folder.
package com.mycom.sendtoapp.perspectives;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
public class CustomPerspective implements IPerspectiveFactory {
/** The perspective ID */
public static final String ID =
"com.mycom.sendtoapp.perspectives.CustomPerspective";
@Override
public void createInitialLayout(IPageLayout layout) {
// TODO Auto-generated method stub
layout.setEditorAreaVisible(false);
String editorArea = layout.getEditorArea();
IFolderLayout top = layout.createFolder("top", IPageLayout.TOP, -2f,
editorArea);
top.addView( "com.mycom.sendtoapp.views.CustomView" );
}
}
g. To create an empty plugin.xml file, click the project’s Extensions tab and
click the Add button in the Extensions view, and click the Cancel button in
the New Extension dialog box.
A plugin.xml file is added to the project.
h. Click the project’s plugin.xml tab and replace the code in the plugin.xml
file with the following:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.6"?>
<plugin>
<extension point="com.teamcenter.rac.aifrcp.application">
<aif_app_item
displayMode="Primary"
groupName="Mycompany"
icon="icons/defaultapplication_32.png"
id="com.mycom.sendtoapp"
name="SendTo Application"
ordinality="200"
perspective_id="com.mycom.sendtoapp.perspectives.CustomPerspective"
session="com.teamcenter.rac.kernel.TCSession"
tooltip="Send To Application"/>
</extension>
<extension point="org.eclipse.ui.perspectives">
<perspective
class="com.mycom.sendtoapp.perspectives.CustomPerspective"
icon="icons/defaultapplication_16.png"
id="com.mycom.sendtoapp.perspectives.CustomPerspective"
name="SendTo Application"/>
</extension>
<extension point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension targetID="*">
<perspectiveShortcut
id="com.mycom.sendtoapp.perspectives.CustomPerspective" />
</perspectiveExtension>
</extension>
<extension point="org.eclipse.ui.views">
<view
allowMultiple="false"
class="com.mycom.sendtoapp.views.CustomView"
icon="icons/pview.gif"
id="com.mycom.sendtoapp.views.CustomView"
name="Custom View"/>
</extension>
<extension point="org.eclipse.ui.commands">
<command
name="SendTo Application"
id="com.mycom.sendtoapp.sendto">
</command>
</extension>
<extension point="org.eclipse.ui.commandImages">
<command
icon="icons/defaultapplication_16.png"
id="com.mycom.sendtoapp.sendto">
</command>
</extension>
<extension point="org.eclipse.ui.handlers">
<handler
commandId="com.mycom.sendtoapp.sendto"
class="com.teamcenter.rac.common.handlers.SendToHandler:
com.mycom.sendtoapp.perspectives.CustomPerspective">
<enabledWhen>
<iterate ifEmpty="false">
<reference definitionId="com.mycom.sendtoapp.sendToActive"/>
</iterate>
</enabledWhen>
</handler>
</extension>
<extension point="org.eclipse.ui.menus">
<menuContribution
locationURI="popup:com.teamcenter.rac.sendto?after=additions">
<command
commandId="com.mycom.sendtoapp.sendto">
<visibleWhen>
<iterate ifEmpty="false">
<reference
definitionId="com.mycom.sendtoapp.sendToActive"/>
</iterate>
</visibleWhen>
</command>
</menuContribution>
</extension>
<extension point="org.eclipse.core.expressions.definitions">
<definition id="com.mycom.sendtoapp.sendToActive">
<and>
<adapt type="com.teamcenter.rac.kernel.TCComponent">
<not>
<adapt type="com.teamcenter.rac.kernel.TCComponent">
<test
property=
"com.teamcenter.rac.kernel.TCComponent.typeClass"
value="AllocationLine">
</test>
</adapt>
</not>
</adapt>
</and>
</definition>
<definition id="com.mycom.sendtoapp.inMainView">
<or>
<with variable="activePartId">
<equals value="com.mycom.sendtoapp.views.CustomView" />
</with>
<with variable="arc_property.ACTIVE_APPLICATION">
<equals value="com.mycom.sendtoapp" />
</with>
</or>
</definition>
</extension>
</plugin>
b. Verify that the new SendTo Application button is shown in the left-hand
navigation pane in the rich client. Click the SendTo Application button.
If you want to package the project for distribution, export it to a JAR file and
place it in the TC_ROOT\portal directory.
b. In the New Project dialog box, select Plug-in Project. Click Next.
c. In the New Plug-in Project wizard Plug-in Project dialog box, type
com.mycom.myitem in the Project name box. Click Next.
d. In the New Plug-in Project wizard Content dialog box, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Ensure the Create a plug-in using one of these templates check box is
selected and select Hello, World Command in the list. Click Finish.
b. Click the Dependencies tab, click the Add button, and select the following
plug-ins:
com.teamcenter.rac.aifrcp
com.teamcenter.rac.common
com.teamcenter.rac.kernel
com.teamcenter.rac.util
c. Click the Runtime tab, click the Add button, and select the following:
com.mycom.myitem
com.mycom.myitem.handlers
d. Click the plugin.xml tab and replace the code in the plugin.xml file with
the following:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.commands">
<category
name="Sample Category"
id="com.mycom.myitem.commands.category">
</category>
<command
name="Sample Command"
categoryId="com.mycom.myitem.commands.category"
id="com.mycom.myitem.commands.sampleCommand">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
commandId="com.mycom.myitem.commands.sampleCommand"
class="com.mycom.myitem.handlers.MyItemHandler">
</handler>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
commandId="com.teamcenter.rac.newItem"
class="com.mycom.myitem.handlers.MyItemHandler">
<activeWhen>
<iterate
ifEmpty="false">
<and>
<adapt
type="com.teamcenter.rac.kernel.TCComponent">
<test
property="com.teamcenter.rac.kernel.TCComponent.typeClass"
value="Folder">
</test>
</adapt>
</and>
</iterate>
</activeWhen>
</handler>
</extension>
<extension
point="org.eclipse.ui.bindings">
<key
commandId="com.mycom.myitem.commands.sampleCommand"
contextId="org.eclipse.ui.contexts.window"
sequence="M1+6"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
</key>
</extension>
</plugin>
b. Ensure that no folder is selected (for example, click the Details tab) and
choose File→New→Item.
The new item dialog box appears normally.
if you are creating a localization of a new custom project, modify the Eclipse
plug-in.xml file.
For more information about localization, see the Localization Guide.
1. Create the project.
a. In Eclipse, choose File→New→Project.
b. In the New Project dialog box, select Plug-in Project. Then click Next.
c. In the New Plug-in Project dialog box Plug-in Project pane, type
com.mycom.l10n in the Project name box. Click Next.
d. In the New Plug-in Project dialog box Content pane, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Ensure the Create a plug-in using one of these templates check box is
selected and select Hello, World Command in the list. Click Finish.
d. Edit the plugin.xml file replacing hard coded values with %keyname for the
name/value pairs you typed in the plugin.properties file. For example:
label="%myMenuitem.label"
For information about how to set up Eclipse to run the rich client, see Enable
rich client customization.
Note
If you make changes to any of the .properties files, or you add new
plug-ins or change plug-in content, you must run the genregxml
script to ensure your changes are included when the rich client starts.
This enhances performance because it caches the properties so they
can be loaded at startup. The script takes no arguments and generates
a RegistryLoader file for each locale in the portal\Registry
directory.
b. In the New Project dialog box, select Plug-in Project. Then click Next.
c. In the Project name box, type the project name, which should be in the form
of com.mycom.project-name. For example, type com.mycom.propertiesfile.
Click Next.
d. Under Options, ensure the Generate an activator and This plug-in will make
contributions to the UI check boxes are selected. Click Next.
e. Clear the Create a plug-in using one of these templates check box. Click
Finish.
b. Extract the properties file you want to override from the JAR file. For
example, extract the mpp.properties file.
c. In a text editor, open the properties file to determine the syntax of the
property you want to modify.
c. Select the following plug-ins from the list by holding down the Ctrl key while
you click them:
• com.teamcenter.rac.aifrcp
• com.teamcenter.rac.common
• com.teamcenter.rac.external
• com.teamcenter.rac.kernel
• com.teamcenter.rac.neva
• com.teamcenter.rac.tcapps
• com.teamcenter.rac.util
d. Click OK.
k. Click Finish.
l. Click the plugin.xml tab. Type text in the file so it looks like the following:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.6"?>
<plugin>
<extension
point="com.teamcenter.rac.util.tc_properties">
</extension>
</plugin>
4. Create a package.
a. In the Package Explorer view, right-click your project and choose
New→Package.
b. In the Name box, type the path name where the properties file was originally.
For example, if you originally extracted the mpp.properties file, the
package name should be com.teamcenter.rac.cme.mpp.
c. Click Finish.
f. Click the MANIFEST.MF tab and type your new package at the
end of the Export-Package line. For example, if your project
name is com.mycom.propertiesfile and the new package is called
com.teamcenter.rac.cme.mpp, the line should read:
Export-Package: com.mycom.propertiesfile, com.teamcenter.rac.cme.mpp
g. Click your project’s Runtime tab. If one or more of the items listed in the
Export-Package line in the previous step are missing, add the missing ones
by clicking the Add button, selecting the missing packages, and clicking OK.
6. Debug in Eclipse.
a. In Eclipse, choose Run→Debug Configurations.
b. In the Debug dialog box, under Java Application on the left-hand side, select
the configuration you want to debug.
b. In the New Project dialog box, select Plug-in Project. Then click Next.
c. In the New Plug-in Project dialog box Plug-in Project pane, type
com.mycom.tableviewer in the Project name box. Click Next.
d. In the New Plug-in Project dialog box Content pane, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Ensure the Create a plug-in using one of these templates check box is
selected and select Hello, World Command in the list. Click Finish.
b. Click the Runtime tab, click the Add button, and select the following:
com.mycom.tableviewer
com.mycom.tableviewer.handlers
<command
commandId="com.mycom.tableviewer.commands.sampleCommand"
icon="icons/sample.gif"
id="com.mycom.tableviewer.toolbars.sampleCommand"
label="TableViewer"
tooltip="Explore Tableviewer">
</command>
</toolbar>
</menuContribution>
</extension>
</plugin>
import org.eclipse.jface.viewers.Viewer;
public class TableContentProvider implements IStructuredContentProvider {
public Object[] getElements(Object parent) {
List results = new ArrayList();
if (parent instanceof ArrayList) {
results = (ArrayList) parent;
}
return results.toArray();
}
public void dispose() {
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
}
AbstractAIFDialog.class ).getImage(
"aifDesktop.ICON" ) );
shell.setText(reg.getString("details"));
shell.setLayout(new FillLayout());
createContents(shell);
shell.setSize(400, 400);
shell.open();
while (!shell.isDisposed()) {
if (!Display.getDefault().readAndDispatch())
Display.getDefault().sleep();
}
}
protected Control createContents(Composite parent) {
final Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(1, false);
layout.verticalSpacing = 10;
composite.setLayout(layout);
GridData data = new GridData(GridData.FILL_BOTH);
data.grabExcessHorizontalSpace = true;
composite.setLayoutData(data);
table = new Table(composite, SWT.BORDER | SWT.V_SCROLL | SWT.MULTI
| SWT.FULL_SELECTION);
table.setLinesVisible(true);
table.setHeaderVisible(true);
data = new GridData(SWT.FILL, SWT.FILL, true, false);
data.heightHint = 300;
table.setLayoutData(data);
TableLayout tableLayout = new TableLayout();
table.setLayout(tableLayout);
tableLayout.addColumnData(new ColumnWeightData(10, 50, true));
TableColumn column = new TableColumn(table, SWT.NONE);
column.setText(COLUMN_HEADINGS[0]);
column.setAlignment(SWT.LEFT);
tableLayout.addColumnData(new ColumnWeightData(15, 200, true));
column = new TableColumn(table, SWT.NONE);
column.setText(COLUMN_HEADINGS[1]);
column.setAlignment(SWT.LEFT);
tableViewer = new TableViewer(table);
tableViewer.setColumnProperties(COLUMN_HEADINGS);
tableViewer.setContentProvider(new TableContentProvider());
tableViewer.setLabelProvider(new TableLabelProvider());
CellEditor[] editors = new CellEditor[2];
editors[0] = new TextCellEditor(table);
editors[1] = new TextCellEditor(table);
tableViewer.setCellEditors(editors);
tableViewer.setCellModifier(new TableCellModifier());
Composite buttonComposite = new Composite(composite, SWT.NONE);
FillLayout fillLayout = new FillLayout(SWT.HORIZONTAL);
fillLayout.spacing = 10;
buttonComposite.setLayout(fillLayout);
Button addButton = new Button(buttonComposite, SWT.PUSH);
addButton.setText(reg.getString("Add"));
addButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
Row row = new Row("", "");
tableViewer.add(row);
table.setTopIndex(table.getItemCount());
table.select(table.getItemCount() - 1);
tableViewer.editElement(row, 0);
}
});
Button deleteButton = new Button(buttonComposite, SWT.PUSH);
deleteButton.setText(reg.getString("Delete"));
deleteButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ISelection selection = tableViewer.getSelection();
if (selection instanceof IStructuredSelection) {
Iterator iterator = ((IStructuredSelection) selection)
.iterator();
while (iterator.hasNext()) {
Object obj = iterator.next();
tableViewer.remove(obj);
}
}
}
});
Button closeButton = new Button(buttonComposite, SWT.PUSH);
closeButton.setText(reg.getString("Close"));
closeButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
composite.getParent().dispose();
}
});
return composite;
}
class TableCellModifier implements ICellModifier {
public boolean canModify(Object element, String property) {
return true;
}
public Object getValue(Object element, String property) {
Note
If you make changes to any of the .properties files, or you add new
plug-ins or change plug-in content, you must run the genregxml
script to ensure your changes are included when the rich client starts.
This enhances performance because it caches the properties so they
can be loaded at startup. The script takes no arguments and generates
a RegistryLoader file for each locale in the portal\Registry
directory.
TableViewer button
b. In the Details dialog box, click the Add button to add a line to the table, or
click the Delete button to remove a line.
b. In the New Project dialog box, select Plug-in Project. Then click Next.
c. In the New Plug-in Project dialog box Plug-in Project pane, type
com.mycom.treeviewer in the Project name box. Click Next.
d. In the New Plug-in Project dialog box Content pane, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Ensure the Create a plug-in using one of these templates check box is
selected and select Hello, World Command in the list. Click Finish.
b. Click the Runtime tab, click the Add button, and select the following:
com.mycom.treeviewer
com.mycom.treeviewer.handlers
id="com.mycom.treeviewer.toolbars.sampleCommand"
label="TreeViewer"
tooltip="Explore Treeviewer">
</command>
</toolbar>
</menuContribution>
</extension>
</plugin>
Note
By default, this example reads the C:\ drive on Windows systems.
To read the /user drive on UNIX systems, change code in the
Explorer.java file.
Note
If you make changes to any of the .properties files, or you add new
plug-ins or change plug-in content, you must run the genregxml
script to ensure your changes are included when the rich client starts.
This enhances performance because it caches the properties so they
can be loaded at startup. The script takes no arguments and generates
a RegistryLoader file for each locale in the portal\Registry
directory.
TreeViewer button
Tree viewer
Note
If you create your own query in Query Builder, you
must also add the query to the list of queries in the
TC_ROOT\lang\textserver\en_US\qry_text_locale.xml
file.
b. Open the Quick_Access_Queries preference and add the name of the query
to the list (for example, add Item Revision...).
Note
The attribute to use for the search (for example, Name) must exist on
the query. Look at the query in Query Builder to see the attributes
on the query.
3. Clear cache.
• Thin client
Shut down Web services and delete temporary tc_text.xml.mem files, for
example:
%TEMP%\V9000.0.1.20011number\number\TextSrv\en_US\tc_text.xml.mem.
Restart services.
• Rich client
To clear cache, delete the Teamcenter subdirectory in the user’s home
directory on the client. This directory is automatically created again when
the user starts the rich client. This directory usually contains RAC and
TAO subdirectories.
On a Windows client, it is typically the C:\Documents and
Settings\user-name\Teamcenter\ directory on Windows XP or the
Desktop\user-name\Teamcenter directory on Windows 7. On a UNIX
client, it is typically the $HOME/Teamcenter/ directory.
If you delete this directory, the last state of the rich client is lost, and the
user interface appears as it does at initial startup.
Also delete the directory containing temporary server cache (*.mem)
files for the Teamcenter server. On a Windows client, it is typically the
C:\temp\PTeamcenter-version directory.
For more information, see Ensure your customizations appear.
4. Test the new quick search item by clicking the arrow to the right of the quick
search.
Note
Background and foreground color customizations are possible for style sheet
rendering in the Summary tab of My Teamcenter only when the selected
object is in a checked-out state. This is because of flat rendering, when text or
empty display areas do not have widgets (such as a text box in the background
for a checked-in object).
Use the Teamcenter registry, which looks for the color setting in the following file
order:
a. customer.properties
b. properties_user.properties
c. properties.properties
b. In the New Project dialog box, select Plug-in Project. Then click Next.
d. Under Options, ensure the Generate an activator and This plug-in will make
contributions to the UI check boxes are selected. Click Next.
e. Clear the Create a plug-in using one of these templates check box. Click
Finish.
c. Click your project’s Extensions tab, click the Add button, and select the
com.teamcenter.rac.util.tc_properties extension point. Click Finish.
d. Click your project’s Overview tab and select the This plug-in is a singleton
check box.
c. Click Finish.
f. Click Finish.
h. Click the plugin.xml tab. The text in the tab should look like the following:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.6"?>
<plugin>
<extension
point="com.teamcenter.rac.util.tc_properties">
</extension>
</plugin>
i. Click your project’s MANIFEST.MF tab. It should look like the following:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Readonlycolor
Bundle-SymbolicName: com.mycom.readonlycolor;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.mycom.readonlycolor.Activator
Bundle-Vendor: MYCOM
Require-Bundle: org.eclipse.core.runtime,
com.teamcenter.rac.util;bundle-version="8000.3.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Note
If you make changes to any of the .properties files, or you add new
plug-ins or change plug-in content, you must run the genregxml
script to ensure your changes are included when the rich client starts.
This enhances performance because it caches the properties so they
can be loaded at startup. The script takes no arguments and generates
a RegistryLoader file for each locale in the portal\Registry
directory.
2. In the Process Template Filter dialog box, select a group in the Group Name
box (for example dba), type in the Object Type box (for example, Item) and move
templates from the Defined Process Template list on the right to the Assigned
Process Template list on the left. Click Apply.
This assigns these Workflow templates to the dba group for Item objects so
that only these templates are available for use with that object type with the
specified group.
4. In the New Process Dialog dialog box, click the Assigned button.
The filtered templates you previously chose for that object type and group name
are displayed in the Process Template box list.
b. In the New Project dialog box, select Plug-in Project. Click Next.
c. In the New Plug-in Project wizard Plug-in Project dialog box, type
com.mycom.workflowtemplatefilter in the Project name box. Click Next.
d. Do not change the default settings on the Content dialog box. Click Finish.
b. Click the Dependencies tab, click the Add button, and select the following
plug-ins:
com.teamcenter.rac.aifrcp
com.teamcenter.rac.kernel
com.teamcenter.rac.util
com.teamcenter.rac.workflow.processdesigner
B. Right-click the
com.teamcenter.rac.workflow.processdesigner.applyTemplateFilter
extension point and choose New→Client.
This adds an entry to the class box.
NoCustomFilteringRequiredException;
public class CustomFilter implements ITemplateFilter
{
TCSession session;
public Vector allTasktemplates = new Vector<TCComponentTaskTemplate>();
public Vector assignedTasktemplates = new Vector<TCComponentTaskTemplate>();
InterfaceAIFComponent[] pasteTargets = null;
boolean cancelButtonClicked = false;
public CustomFilter()
{
// TODO Auto-generated constructor stub
}
public Vector getFilteredTemplates(Vector alltemplates, Vector Assignedtemplates,
InterfaceAIFComponent[] pastetargets, TCSession s)throws
NoCustomFilteringRequiredException
{
allTasktemplates = alltemplates;
assignedTasktemplates = Assignedtemplates;
session = s;
CustomFilterDialog v = new CustomFilterDialog(true, this);
cancelButtonClicked = false;
v.showDialog();
if (cancelButtonClicked)
{
throw new NoCustomFilteringRequiredException ("Exception");
}
else
return v.templatelist;
}
// customize this dialog to add the status selection UI.
class CustomFilterDialog extends AbstractAIFDialog
{
/**
*
*/
private static final long serialVersionUID = 1L;
public Vector templatelist = new Vector<TCComponentTaskTemplate> ();
private JButton cancelButton;
private JButton applyButton;
private JComboBox statuses = null;
private JComboBox criteria = null;
CustomFilter op;
public CustomFilterDialog(boolean first, CustomFilter operation )
{
super(first);
op = operation;
initdialog();
}
public void showDialog()
{
this.setModal( true );
this.setVisible( true );
}
public void initdialog()
{
JPanel parentPanel = new JPanel (new VerticalLayout (5,2,2,2,2));
this.setTitle( "Filter Based on Status" );
this.getContentPane().add(parentPanel);
JPanel buttonPanel = new JPanel (new ButtonLayout ());
JPanel compPanel = new JPanel (new HorizontalLayout ());
applyButton = new JButton ("Apply");
applyButton.setMnemonic(’A’);
applyButton.addActionListener ( new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
startApplyOperation();
}
});
cancelButton = new JButton ("Cancel");
cancelButton.setMnemonic(’C’);
cancelButton.addActionListener ( new ActionListener()
{
public void actionPerformed (ActionEvent e)
{
setVisible(false);
cancelButtonClicked = true;
dispose();
}
});
//Add the buttons to the buttonPanel
buttonPanel.add(applyButton);
buttonPanel.add(cancelButton);
//ADD button panel and the com panel to the parent panel
parentPanel.add ( "top.bind", compPanel );
{
ex.printStackTrace();
}
}
}
}
b. In the New Process Dialog dialog box, click the Assigned button.
The Filter Based on Status dialog box is displayed.
Note
If you make changes to any of the .properties files, or you add new
plug-ins or change plug-in content, you must run the genregxml
script to ensure your changes are included when the rich client starts.
This enhances performance because it caches the properties so they
can be loaded at startup. The script takes no arguments and generates
a RegistryLoader file for each locale in the portal\Registry
directory.
b. In the data pane to the right, select an occurrence (item revision) in the
structure.
c. Right-click a column heading and add a column for an occurrence note type
(for example, UG NAME).
d. For the selected occurrence, double-click in the empty cell in that column and
type in your note (for example, type This is my occurrence note).
e. In the left pane, select that occurrence in the structure (the item revision)
and choose Tools→Intermediate Data Capture. For our example, choose
the Transfer Mode Name of tcm_export because it transfers the UG NAME
type of occurrence note.
When the IDC appears on the tab, there is no content in the data panel, and
there is no occurrence note column (for example, no UG NAME column).
That’s because the occurrence note type column must be added to this IDC
structure view using a customization.
3. Restart the rich client. (Be sure to delete the rich client cache and use the -clean
option when restarting Teamcenter.)
For more information, see Ensure your customizations appear.
b. In the New Project dialog box, select Plug-in Project. Click Next.
c. In the New Plug-in Project wizard Plug-in Project dialog box, type
com.mycom.mpp.perspectives in the Project name box and clear the
Source folder box. Click Next.
d. In the New Plug-in Project wizard Content dialog box, do the following:
A. Under Options, ensure the This plug-in will make contributions to the
UI check box is selected.
B. Click the No button next to Would you like to create a rich client
application?.
C. Click Next.
e. Clear the Create a plug-in using one of these templates check box. Click
Finish.
b. Click the Dependencies tab, click the Add button, and select the following:
org.eclipse.core.runtime
org.eclipse.ui
com.teamcenter.rac.cme.mpp
com.teamcenter.rac.aifrcp
c. Click the Runtime tab, click the Add button, and select
com.mycom.mpp.perspectives.
B. Click the Runtime tab, click the Add button, select the Show non-Java
packages check box, and select icons.
B. Click the project’s plugin.xml tab and replace the code in the plugin.xml
file with the following:
<plugin>
<extension
point="org.eclipse.ui.perspectives">
<perspective
class="com.teamcenter.rac.aifrcp.perspective.GenericRACPerspective"
icon="icons/consumptionPerspective_16.png"
id="com.teamcenter.rac.cme.mpp.Consumption"
name="%consumption.perspective.name">
</perspective>
</extension>
<extension
point="com.teamcenter.rac.aifrcp.perspectiveDefs">
<perspective
displayMode="Tertiary"
icon16="icons/consumptionPerspective_16.png"
icon24="icons/consumptionPerspective_24.png"
icon32="icons/consumptionPerspective_32.png"
id="com.teamcenter.rac.cme.mpp.Consumption"
label="%consumption.perspective.name"
legacyAppClass="com.teamcenter.rac.cme.application.
MFGLegacyApplication"
legacyAppId="com.teamcenter.rac.cme.mpp.MPPApplication"
ordinality="0"
taskpaneID="DFTaskPane"
tooltip="%consumption.perspective.name">
<contextRef id="com.teamcenter.rac.cme.mpp.ConsumptionContext"/>
<viewRef
allocateSecondaryId="false"
folderIdOverride="RAC_Folder_UL"
id="com.teamcenter.rac.cme.processView"
secondaryId="MPPApplication_1"
placeholderOnly="false">
</viewRef>
<viewRef
allocateSecondaryId="false"
folderIdOverride="RAC_Folder_UR"
id="com.teamcenter.rac.cme.productView"
secondaryId="MPPApplication_1"
placeholderOnly="false">
</viewRef>
<viewRef
allocateSecondaryId="false"
folderIdOverride="RAC_Folder_LR"
id="com.teamcenter.rac.cme.plantView"
secondaryId="MPPApplication_1"
placeholderOnly="false">
</viewRef>
<folderLayout
id="RAC_Folder_UR"
ratio="0.5">
</folderLayout>
<viewRef
folderIdOverride="RAC_Folder_UL"
id="com.teamcenter.rac.cme.processView"
placeholderOnly="true">
</viewRef>
<viewRef
folderIdOverride="RAC_Folder_UR"
id="com.teamcenter.rac.cme.productView"
placeholderOnly="true">
</viewRef>
<viewRef
folderIdOverride="RAC_Folder_LR"
id="com.teamcenter.rac.cme.plantView"
placeholderOnly="true">
</viewRef>
</perspective>
</extension>
<extension point="org.eclipse.ui.contexts">
<context id="com.teamcenter.rac.cme.mpp.ConsumptionContext"
description="%consumption.perspective.name"
name="%consumption.perspective.name"
parentId="com.teamcenter.rac.cme.mpp.MPPApplication.
applicationContext"/>
</extension>
<extension
point="org.eclipse.ui.perspectives">
<perspective
class="com.teamcenter.rac.aifrcp.perspective.
GenericRACPerspective"
icon="icons/threeD_16.png"
id="com.teamcenter.rac.cme.mpp.product3D"
name="%product-3d.perspective.name">
</perspective>
</extension>
<extension
point="com.teamcenter.rac.aifrcp.perspectiveDefs">
<perspective
displayMode="Tertiary"
icon16="icons/threeD_16.png"
icon24="icons/threeD_24.png"
icon32="icons/threeD_32.png"
id="com.teamcenter.rac.cme.mpp.product3D"
isLegacyAppDefault="false"
label="%product-3d.perspective.name"
legacyAppId="com.teamcenter.rac.cme.mpp.MPPApplication"
ordinality="0"
taskpaneID="DFTaskPane"
tooltip="%product-3d.perspective.name">
<contextRef id="com.teamcenter.rac.cme.mpp.MPPApplication.
applicationContext"/>
<viewRef
allocateSecondaryId="false"
folderIdOverride="RAC_Folder_UL"
id="com.teamcenter.rac.cme.productView"
secondaryId="MPPApplication_1"
networkId="3D_productView_001"
placeholderOnly="false">
</viewRef>
<viewRef
allocateSecondaryId="false"
folderIdOverride="RAC_Folder_UR"
id="com.teamcenter.rac.cme.graphics.3d"
secondaryId="com.teamcenter.rac.cme.productView_MPPApplication_1"
networkRef="3D_productView_001"
placeholderOnly="false">
</viewRef>
</perspective>
</extension>
<extension
point="org.eclipse.ui.perspectives">
<perspective
class="com.teamcenter.rac.aifrcp.perspective.GenericRACPerspective"
icon="icons/mbom_pbop_16.png"
id="com.teamcenter.rac.cme.mpp.mbom-pbop"
name="%mbom-pbop.perspective.name">
</perspective>
</extension>
<extension
point="com.teamcenter.rac.aifrcp.perspectiveDefs">
<perspective
displayMode="Tertiary"
icon16="icons/mbom_pbop_16.png"
icon24="icons/mbom_pbop_24.png"
icon32="icons/mbom_pbop_32.png"
id="com.teamcenter.rac.cme.mpp.mbom-pbop"
label="%mbom-pbop.perspective.name"
legacyAppId="com.teamcenter.rac.cme.mpp.MPPApplication"
ordinality="100"
taskpaneID="DefaultTaskPane"
tooltip="%mbom-pbop.perspective.name">
<contextRef id="com.teamcenter.rac.cme.mpp.MPPApplication.
applicationContext"/>
<viewRef
allocateSecondaryId="false"
folderIdOverride="RAC_Folder_UL"
id="com.teamcenter.rac.cme.productBopView"
secondaryId="MPPApplication_1"
networkId="mbom-pbop.pbop1"
placeholderOnly="false">
</viewRef>
<viewRef
allocateSecondaryId="false"
folderIdOverride="RAC_Folder_LL"
id="com.teamcenter.rac.cme.productView"
secondaryId="MPPApplication_1"
placeholderOnly="false">
</viewRef>
<viewRef
allocateSecondaryId="true"
id="com.teamcenter.rac.cme.mpp.ProcessRelationView"
networkRef="mbom-pbop.pbop1"
placeholderOnly="false"
secondaryId="mbom-pbom_001"
standalone="false">
</viewRef>
<folderLayout
id="RAC_Folder_LL"
ratio="0.5">
</folderLayout>
<folderLayout
id="RAC_Folder_UR"
ratio="0.5">
</folderLayout>
</perspective>
</extension>
</plugin>
6. Examine the project’s Extensions tab to review the extensions created in the
project.
Copying and pasting the plugin.xml file content is a quick way to provide
you with extensions for this example. However, when you create your own
extensions, instead of placing content directly in the plugin.xml file, you work
in the project’s Extensions tab. Therefore, you should review the Extensions
tab to see how you can create extensions yourself.
To make a perspective, a org.eclipse.ui.perspectives extension and a
com.teamcenter.rac.aifrcp.perspectiveDefs extension must be created for
each perspective.
org.eclipse.ui.perspectives extension
com.teamcenter.rac.aifrcp.perspectiveDefs extension
B. Add a viewRef element for each view you want to appear in the
perspective.
Following are the common primary views that are supported in
Manufacturing Process Planner:
• com.teamcenter.rac.cme.productView
• com.teamcenter.rac.cme.processView
• com.teamcenter.rac.cme.plantView
• com.teamcenter.rac.cme.plantBopView
• com.teamcenter.rac.cme.workinstructions.
win32.STXLibraryView (for STX)
• com.teamcenter.rac.cme.appInterfaceView (for IDC)
• com.teamcenter.rac.cme.plantBopView (for EBOP)
• com.teamcenter.rac.cme.productBopView (for EBOP)
• com.teamcenter.rac.cme.genericBopView (for EBOP)
• In the folderIdOverride box, select the folder you want the view to
appear in.
• If you want to define a secondary view for this primary view in this
perspective, type it in the networkId box. It does not matter what the
ID is as long as it is unique in this perspective.
• In the folderIdOverride box, select the folder you want the view to
appear in.
• In the networkId box, type the networkId value you provided in the
primary view.
D. If you want to create a secondary view that is not a graphics view, add
a viewRef element for the view and set the allocateSecondaryId box
to true.
Take note of the following for secondary views:
• In the id box, browse to the view you want to use for the secondary
view.
• In the folderIdOverride box, select the folder you want the view to
appear in.
• In the networkRef box, type the networkId value you provided in the
primary view. (If the networkRef value is set, then the secondaryId
value also must be set.)
Note
• Character (char) and character array (char [ ]) data types are not
supported in forms. Use a string (string) or a string array (string [ ])
data type with a length of 1.
• The default string value for False is an empty string. Therefore, end users
must click the Show empty properties link on the rendering page to see
this logic attribute if its value is set to False.
• Automatic forms
Allows you to display forms that have no associated interface definition. The
interface is created automatically as the form is displayed, based on the storage
fields identified within the form POM class.
For more information, see Developing automatic forms.
• JavaBean
Allows you to define forms using JavaBeans and an IDE (such as Eclipse) to
present form properties. Each bean knows how to display and save a specific
property type. This method is less complex than the abstract rendering method
but still requires some programming knowledge.
For more information, see Developing forms using JavaBeans.
• Abstract rendering
Allows you to write the form display by extending the AbstractRendering
class. This is the most flexible method of form customization. It is also the most
complex method and requires coding.
For more information, see Developing forms by extending the abstract class.
Note
The following class attributes have been lengthened from 32 to 128 bytes:
• item_id in the Item class
If you used these attributes in customized code, ensure they still display
correctly.
For an example of creating a form using JavaBeans, see Create a sample custom
form using JavaBeans.
b. In the Business Objects view, open the item revision business object (for
example, A5_MyItemRevision), click the Properties tab, and create the
custom persistent properties you want to display in the panel, for example:
• a5_MyDate
Select the Date attribute type.
• a5_MyDouble
Select the Double attribute type.
• a5_MyFlag
Select the Boolean attribute type.
• a5_MyLongString
Select the LongString attribute type.
• a5_MyLOV
Select the String attribute type. Attach an LOV to this property, for
example, BillCodes.
• a5_MyRef
Select the TypedReference attribute type. Choose a reference business
object, for example, Item.
c. Set the Enabled property constant to True for each of the new properties.
This means the property is enabled for display in the user interface.
d. Deploy the custom template from the Business Modeler IDE to your
Teamcenter server. If you use the deployment wizard, select the Generate
Server Cache? check box to generate shared server cache that contains
the new data model.
For more information, see the Business Modeler IDE Guide.
e. After deployment, test your new business object in the Teamcenter rich
client by creating an instance of it.
For example, in the My Teamcenter application, choose File→New→Item.
Your new business object appears in the New Item dialog box. Choose your
new business object and launch the New Item wizard.
b. In the New Project dialog box, select Plug-in Project. Click Next.
d. Under Options, ensure the Generate an activator and This plug-in will make
contributions to the UI check boxes are selected. Click Next.
e. Clear the Create a plug-in using one of these templates check box. Click
Finish.
C. Select the following plug-ins from the list by holding down the Ctrl key
while you click them:
com.teamcenter.rac.aifrcp
com.teamcenter.rac.common
com.teamcenter.rac.external
com.teamcenter.rac.kernel
com.teamcenter.rac.neva
com.teamcenter.rac.tcapps
com.teamcenter.rac.util
D. Click OK.
D. Click Finish.
C. Click Finish.
E. Open the project’s Runtime tab, click the Add button, and add the
com.teamcenter.rac.stylesheet package.
public CustomSamplePanel()
{
try
{
init();
}
catch( Exception e )
{
e.printStackTrace();
}
}
private void init()
throws Exception
{
this.setLayout( new BorderLayout() );
this.setOpaque( false );
JPanel jPanel1 = new JPanel();
jPanel1.setLayout( new PropertyLayout() );
jPanel1.setOpaque( false );
JLabel jLabel1 = new JLabel("Test double");
PropertyTextField doubleTextField = new PropertyTextField();
doubleTextField.setProperty( "a5_MyDouble" );
JLabel jLabel2 = new JLabel("Test date" );
PropertyDateButton dateButton = new PropertyDateButton();
//dateButton.setDate( (String) null );
//dateButton.setDisplayFormat( "d-MMM-yyyy HH:mm:ss" );
dateButton.setProperty( "a5_MyDate" );
dateButton.setMandatory( true );
JLabel jLabel3 = new JLabel("Test boolean");
PropertyLogicalPanel logicalPanel = new PropertyLogicalPanel();
logicalPanel.setProperty( "a5_MyFlag" );
JLabel jLabel4 = new JLabel("Test longstring");
PropertyLongTextPanel longTextPanel = new PropertyLongTextPanel();
longTextPanel.setProperty( "a5_MyLongString" );
JLabel jLabel5 = new JLabel("Test ref");
PropertyObjectLink refLink = new PropertyObjectLink();
refLink.setProperty( "a5_MyRef" );
JLabel jLabel6 = new JLabel("Test Lov");
PropertyLOVUIComponent lovUIComp = new PropertyLOVUIComponent();
lovUIComp.setProperty( "a5_MyLOV" );
this.add( jPanel1, BorderLayout.WEST );
jPanel1.add( "1.1", jLabel1 );
jPanel1.add( "1.2", doubleTextField );
jPanel1.add( "2.1", jLabel2 );
jPanel1.add( "2.2", dateButton );
jPanel1.add( "3.1", jLabel3 );
jPanel1.add( "3.2", logicalPanel );
jPanel1.add( "4.1", jLabel4 );
jPanel1.add( "4.2", longTextPanel );
jPanel1.add( "5.1", jLabel5 );
jPanel1.add( "5.2", refLink );
jPanel1.add( "6.1", jLabel6 );
jPanel1.add( "6.2", lovUIComp );
}
}
Note
If you want to set your panel’s background color, you cannot use
the setOpaque(false) tag. For more detail on the usage of this
Java API, go to the following URL:
http://download.oracle.com/javase/6/docs/api/javax/swing/
JComponent.html#setOpaque%28boolean%29
A5_MyItemRevision.JAVARENDERING=
com.teamcenter.rac.stylesheet.CustomSamplePanel
Note
If you make changes to any of the .properties files, or you add new
plug-ins or change plug-in content, you must run the genregxml
script to ensure your changes are included when the rich client starts.
This enhances performance because it caches the properties so they
can be loaded at startup. The script takes no arguments and generates
a RegistryLoader file for each locale in the portal\Registry
directory.
a. In the rich client, choose File→New→Item and select the new custom item
type (for example, A5_MyItem), and create an instance of it.
b. Select the item revision and click the Viewer tab or choose View→Properties
to see your new panel.
When the form loads, the system looks first for the constructor with a reference to
the TCComponentForm component. If one is found, it is used. If not, the default
constructor is used.
The properties of each property bean are described in Property beans.
After you create the component, all other JavaBean rules apply. For example, you
can attach icons for reference within an Integrated Development Environment
(IDE), such as Eclipse, and attach property rendering rules.
To perform checks prior to loading the property beans, override the checkObject
method as follows:
public void checkObject() throws Exception
{
//required checks
}
Note
All IDEs that support JavaBeans work with the property beans.
This method should only use the setValue<type>Data calls to the form property
and return it. Therefore, all properties in the property bean system are collected and
saved in one call. This increases the efficiency of the property bean.
Siemens PLM Software provides both save() and saveProperty() methods to allow
for flexibility in form storage. All property beans delivered with Teamcenter use the
saveProperty() method. If you choose to override any of the base property beans,
Siemens PLM Software recommends that you override the saveProperty() method.
The backslash character and a space (\ ) in the string create a space. If the
backslash character is not used, the space is misinterpreted and the form is
displayed using the automatic form display. Java interprets the key as item and
does not parse past the space, considering it the delimiter for the key/value
combination.
For an example of creating a form by extending the abstract class, see Create a
sample custom form by extending the abstract class.
This example extends the AbstractRendering component. The sample code uses
the getRenderingModified and isRenderingModified methods. These methods
ensure the values are copied from the New Item wizard to the form.
For more information about extending the abstract class, see Developing forms by
extending the abstract class.
Note
Rendering of the form is tied directly to the business object by placing the
following command into a custom stylesheet_user.properties file:
custom-business-object-name.FORMJAVARENDERING.
package-name.custom-java-form-name
b. Deploy the new custom item business object from the Business Modeler IDE
to your Teamcenter server.
c. After deployment, test your new business object in the Teamcenter rich
client by creating an instance of it.
For example, in the My Teamcenter application, choose File→New→Item.
Your new business object appears in the New Item dialog box. Choose your
new business object and launch the New Item wizard.
Observe the boxes on the Define additional item revision information page.
These are provided by the item revision master form. In the following steps,
you are going to create your own custom form to replace it and to provide
different boxes on this page.
b. In the New Project dialog box, select Plug-in Project. Click Next.
d. Under Options, ensure the Generate an activator and This plug-in will make
contributions to the UI check boxes are selected. Click Next.
e. Clear the Create a plug-in using one of these templates check box. Click
Finish.
C. Select the following plug-ins from the list by holding down the Ctrl key
while you click them:
com.teamcenter.rac.aifrcp
com.teamcenter.rac.common
com.teamcenter.rac.external
com.teamcenter.rac.kernel
com.teamcenter.rac.neva
com.teamcenter.rac.tcapps
com.teamcenter.rac.util
D. Click OK.
D. Click Finish.
d. Click the plugin.xml tab and replace the contents of the file with the
following:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension point="com.teamcenter.rac.util.tc_properties">
<plugin_properties pluginName="com.mycom.masterform"/>
</extension>
</plugin>
import java.util.HashMap;
import java.util.Map;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class A5_MyItemMaster extends AbstractRendering
{
/**
*
*/
private static final long serialVersionUID = 1L;
private JTextField data1_jtextfield;
private JTextField data2_jtextfield;
private TCProperty data1_tcproperty;
private TCProperty data2_tcproperty;
private TCComponentForm form;
public A5_MyItemMaster( TCComponentForm c)throws Exception
{
super ( c );
form = c;
loadRendering();
}
@Override
public void loadRendering() throws TCException
{
initializeUI();
data1_tcproperty = form.getFormTCProperty("user_data_1");
data2_tcproperty = form.getFormTCProperty("user_data_2");
data1_jtextfield.setText(data1_tcproperty.getStringValue());
data2_jtextfield.setText(data2_tcproperty.getStringValue());
}
@Override
public void saveRendering()
{
try
{
data1_tcproperty.setStringValueData(data1_jtextfield.getText() );
data2_tcproperty.setStringValueData(data2_jtextfield.getText() );
TCProperty[] ps = new TCProperty[2];
ps[0] = data1_tcproperty;
ps[1] = data2_tcproperty;
form.setTCProperties(ps);
}
catch ( TCException ex )
{
MessageBox.post(ex.getMessage(), null, MessageBox.ERROR);
}
}
@Override
public boolean isRenderingModified()
{
if( data1_tcproperty != null && !data1_jtextfield.getText().equals( data1_tcproperty.getStringValue() ) )
{
return true;
}
if( data2_tcproperty != null && !data2_jtextfield.getText().equals( data2_tcproperty.getStringValue() ) )
{
return true;
}
else
{
return false;
}
}
@Override
public Map getRenderingModified ()
{
Map modifiedRendering = new HashMap<String, Object> ();
if( data1_tcproperty != null && !data1_jtextfield.getText().equals( data1_tcproperty.getStringValue() ) )
{
data1_tcproperty.setStringValueData(data1_jtextfield.getText() );
modifiedRendering.put( "user_data_1", data1_tcproperty );
}
if( data2_tcproperty != null && !data2_jtextfield.getText().equals( data2_tcproperty.getStringValue() ) )
{
data2_tcproperty.setStringValueData( data2_jtextfield.getText() );
modifiedRendering.put( "user_data_2", data2_tcproperty );
}
return modifiedRendering;
}
private void initializeUI()
{
setLayout ( new VerticalLayout() );
JPanel mainPanel = new JPanel( new PropertyLayout());
mainPanel.setOpaque(false);
mainPanel.setEnabled(false);
// Create all the text fields
data1_jtextfield = new JTextField(15);
data2_jtextfield = new JTextField(15);
//Add components to Panel
mainPanel.add("1.1.right.center",new JLabel("User Data One"));
mainPanel.add("1.2.left.center", data1_jtextfield);
C. Click Finish.
d. On the Define additional item revision information page, you should see
your new item revision master form.
General comments
The form user interface is not limited to creation using an integrated development
environment (IDE) or to the use of any Java component. Third-party Java
components can be used within the form.
The Eclipse IDE can be used to generate the contents of the form. Once created,
you need only add the code required to read the property values from Teamcenter
and set the property values within the associated component on the panel. Other
components, such as LOVButton, make it easier to render the form properties.
If you upgrade from a previous version of Teamcenter that used the note attribute
in the form storage class, instances created from that class will continue to use the
note attribute. If you create a new storage class, it uses the string attribute, and
instances created from that class use the string attribute.
Starting with Engineering Process Management 2005, you should use the new
style sheet package (com.teamcenter.rac.stylesheet) instead of the old form
package (com.teamcenter.rac.form). The old form package will be deprecated
in a later release. If you want to still use the old custom forms in the new
package, move the entries you added to the form_user.properties file to the
stylesheet_user.properties file.
Form events
When a form is displayed, the size is governed by the standard of preferred size
for a dialog box. However, it may be necessary to control the dialog box size prior
to displaying the form. In this event, implement the InterfaceRendererEvent
interface within the form display class. This interface forces the implementation
of two methods: dialogDisplayed (OpenFormDialog dlg, boolean state).
The method is called before the dialog box is displayed. It is the place where the
setBounds() method for the dialog box can be called.
When a form is displayed, the okToModify() method is invoked. If the form is
modifiable, it is constructed and displayed as designed. However, if the form is not
modifiable, logic is executed to determine what should or should not be editable.
When a read-only form is displayed, the components shown in the following table
are modified.
When a form is not modifiable, all Container objects, such as JTabbedPane, are
ignored and the remaining components are disabled. This is because Container
objects allow users to traverse and work through them to view the data. You may
want to control the read-only ability of a component within a form, in which case you
must override the read-only logic by implementing the InterfaceRendererEvent
interface and providing body to the setReadOnly() method.
Displaying a form
When a form is displayed, the user interface definition for the form is constructed,
populated, and placed within a container. In the rich client, a form can be displayed
under two paradigms: dialog box and viewer. The dialog box displays when the form
is opened using the Open menu or the form is double-clicked.
<iterate operator="or">
<equals value="org.eclipse.ui.edit.cut"/>
</iterate>
</not>
</with>
</visibleWhen>
</command>
</menuContribution>
</menuContribution>
• Any contributions that are done statically in the code (for example, the Window
menu) cannot be suppressed.
• Any contributions that are done using Eclipse actions cannot be suppressed.
Assume that the plug-in contributes a sample command. This means that the
plug-in must define a command ID using the org.eclipse.ui.commands extension
point adhering to the naming convention, for example:
com.mycom.myapp.sampleCommand
To make this sample command visible only in the Sample Perspective perspective,
and if it is not suppressed from the Command Suppression perspective, use a
combination of this reference definition and the command suppression source
provider, for example:
<command commandId="com.mycom.myapp.sampleCommand" tooltip="%sampleCommand.TIP">
<visibleWhen>
<and>
<reference definitionId="com.mycom.myapp.inMainPerspective"/>
<with variable="rac_command_suppression">
<not>
<iterate operator="or">
<equals value="com.mycom.myapp.sampleCommand"/>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>
int n_input_args = 1;
Object [] input_args = new Object[n_input_args];
String[] client_string_array =
new String[]{"string_a", "string_b", "string_c"};
input_args[0] = client_string_array;
String return_data =
(String)userService.call("exchange_strings", input_args) ;
}
catch( TCException ex )
{
MessageBox.post(ex);
}
User service methods are registered during initialization of the Teamcenter server
and apply for the duration of the Teamcenter server session. User service methods
must be registered through the USERSERVICE_register_methods () function.
First, a custom callback function for the USERSERVICE_register_methods ()
function is registered through the CUSTOM_register_exit function. Then, in the
custom callback function, a custom user service method is registered by calling the
USERSERVICE_register_method () function.
For more information, see the Server Customization Programmer’s Guide.
Note
The USERSERVICE_register_methods function is called for rich client
logon only. It is used to register user service methods that are executed
only from the rich client. Teamcenter recommends that SOA interfaces be
developed to implement custom services.
Display Word, Excel, PowerPoint, PDF, and text files in the viewer
Microsoft Word, Excel, PowerPoint, PDF, and text files are displayed automatically
with no additional configuration required.
• Tabs that appear only when particular components are selected in the parent
panel.
You can customize how the second, selection-specific group of tabs is displayed.
• The subtype of the selected display component, which is generally the same
as the class type. However, for BOM lines, it is the occurrence type and for
attachment lines it is the relation to the parent.
For each selection, the system checks for six properties and adds all the tabs found.
You can edit these properties to change the tabs that are presented to the user:
Display-component-classtype.TABS
Display-component-subtype.TABS
Display-component-classtype.underlying component classtype.TABS
Display-component-classtype.underlying component subtype.TABS
Display-component-subtype.underlying component classtype.TABS
Display-component-subtype.underlying component subtype.TABS
For example, in the Multi-Structure Manager application, the default properties are:
BOMLine.TABS=Referencers, Variant, Attachments, InClassAtt, CMEViewer, Report,
IncrementalChangeInfo
TcItemBOPLine.TABS=Referencers, Variant, Attachments, InClassAtt, CMEViewer,
Report, IncrementalChangeInfo
AppGroupBOPLine.TABS=Referencers, Attachments, CMEViewer, IncrementalChangeInfo
GDELine.TABS=Referencers, InClassAtt, CMEViewer, Report, IncrementalChangeInfo
GDELinkLine.TABS=Referencers, InClassAtt, CMEViewer, Report,
IncrementalChangeInfo
MEAppearanceLine.TABS=Referencers, Attachments, CMEViewer, IncrementalChangeInfo
CfgAttachmentLine.TABS=Referencers, CMEViewer, IncrementalChangeInfo, Report
BOMLine.ItemRevision.TABS=ProductAppearance
TcItemBOPLine.ItemRevision.TABS=ProductAppearance
CfgAttachmentLine.ItemRevision.TABS=InClassAtt
You can add or delete the names of tabs that are displayed for each data panel in
this file.
Note
For more information about the jar command, see Sun’s Java
documentation.
3. In the custom properties file, edit the .TABS line to include the tab you want.
4. Insert the custom properties file into your own custom plug-in.
2. Open the
installation-location\portal\plugins\com.teamcenter.rac.cme.legacy JAR
file and find the mpp.properties file in the following directory:
com\teamcenter\rac\cme\mpp\mpp.properties
4. In the custom properties file, create .TABS entries for your custom business
object.
Manufacturing Process Planner accepts the following definitions in the
properties files:
line-type.TABS= tab-1, tab-2, tab-n
line-subtype.TABS=tab-1, tab-2, tab-n
line-type.underlying-type.TABS= tab-1, tab-2, tab-n
line-type.underlying-subtype.TABS= tab-1, tab-2, tab-n
line-subtype.underlying-type.TABS= tab-1, tab-2, tab-n
line-subtype.underlying-subtype.TABS= tab-1, tab-2, tab-n
Selecting the I1 item in the process structure (below the operation) matches
ImanItemBOPLine.TABS and ImanItemBOPLine.ItemRevision.TABS,
and as a result, the system shows the Variant and CMEViewer tabs.
The tab label and tooltip are defined in the mpp_locale.properties file:
tab.TABLABEL
tab.TOOLTIP
5. Insert the custom properties file into your own custom plug-in.
• priority
Specifies the priority of the extension using a valid integer value. If multiple
extensions are available for the filesSelector extension point, the rich client
refers to this attribute to choose the extension with the highest priority.
This string-type attribute is required.
• getSelectedFiles
Custom code must implement this method to return information about the file
selected by the user. This method must not perform any GUI interaction with
the end user.
This method encapsulates the file object, file type, and reference type
information in a TCFileDescriptor object and return it to the caller. The
TCFileDescriptor constructor is designed to perform validation on the file type
and reference type, and throw exceptions if the validation fails. Custom code is
expected to handle these exceptions.
• getFormattedText
Custom code must implement this method to return the path of the selected file.
This method should not attempt any GUI interaction with end users.
• resetSelectedFiles
Custom code must implement this method to clear the list of selected files.
The following example code demonstrates how a simple validation can be performed
using the filesSelector extension point. This sample code validates if the file being
imported is of length 0 bytes or if the file object selected by the user is a directory:
package sample;
import com.teamcenter.rac.commands.namedreferences.ImportFilesFileChooser;
import com.teamcenter.rac.commands.newdataset.IFilesSelector;
import com.teamcenter.rac.commands.newdataset.TCFileDescriptor;
import com.teamcenter.rac.kernel.TCComponentDatasetDefinition;
import com.teamcenter.rac.kernel.TCComponentDatasetDefinition.TCInvalidFileTypeException;
import com.teamcenter.rac.kernel.TCComponentDatasetDefinition.TCInvalidRefTypeException;
import com.teamcenter.rac.kernel.TCException;
import java.io.File;
import javax.swing.JFileChooser;
import java.util.List;
import java.util.ArrayList;
import javax.swing.JOptionPane;
return;
}
}
}
public List<TCFileDescriptor> getSelectedFiles()
{
return listOfFileDesc;
}
public String getFormattedText()
{
if ((listOfFileDesc != null) && (listOfFileDesc.size()>0))
{
String displayText=listOfFileDesc.get(0).getFile().getPath();
for (int i=1;i<listOfFileDesc.size();++i)
{
displayText = displayText + ", " + listOfFileDesc.get(i).getFile().getPath();
}
return displayText;
}
return null;
}
//Additional user-validation methods, We have chosen some simple validation examples
//Customer can similar validation in preferred fashion
public String isFileADirectory(File fileObj)
{
if ( fileObj.isDirectory())
{
return "You have selected directory (" + fileObj.getName() + "),
please select a valid file";
}
return null;
}
public String isFileZeroLength(File fileObj)
{
if ( fileObj.length()==0)
{
return "You have selected file (" + fileObj.getName() + " with length 0,
please select a valid file";
}
return null;
}
public void resetSelectedFiles()
{
listOfFileDesc = null;
}
public boolean isSelectedFileValid(File fileObj) throws Exception
{
String validationMessage=null;
validationMessage = isFileADirectory(fileObj);
if (validationMessage!=null)
{
throw new Exception(validationMessage);
}
validationMessage = isFileZeroLength(fileObj);
if (validationMessage!=null)
{
throw new Exception(validationMessage);
}
return true;
}
}
configuration file. You can use this as the basis for your own Launch Pad
configuration file. The file’s contents are as follows:
<?xml version="1.0" encoding="UTF-8"?>
<launchpad name="Getting Started"
xmlns="http://com.teamcenter.rac.launchpad">
</launchpad>
Tip
You can look at the schema directory in the
TC_ROOTportal\plugins\com.teamcenter.rac.launchpad plug-in
to see the definitions for file elements you can use in the Launch Pad
XML file.
4. Create a Launch Pad Rendering dataset and import your XML file:
a. In My Teamcenter, select the folder where you want to place your new
dataset and choose File→New→Dataset.
b. In the New Dataset dialog box, choose the Launch Pad Rendering type, type
the name of the dataset (for example, MyDefault_Launchpad) in the Name
box, select TextEditor in the Tool Used box, and click the Import button.
d. Click OK.
The dataset is created.
5. Add icons referenced in the XML file to the named references for the dataset:
a. Right-click the new Launch Pad Rendering dataset and choose Named
References.
b. In the Named References dialog box, click the Import button and select the
icons referenced in your Launch Pad XML file.
6. Now that you have created the Launch Pad Rendering dataset, create a
DEFAULT_LAUNCHRENDERING site preference whose value is the Launch
Pad Rendering dataset name (for example, MyDefault_Launchpad).
Now when you click the Launch Pad button in the left navigation bar, your
custom Launch Pad configuration is displayed. (You may have to close the
Launch Pad and open it again before the new configuration is displayed.)
7. You can pin objects to the Launch Pad such as items, item revisions, folders,
and so on, by right-clicking the objects and choosing Pin to Launch Pad.
Create additional Launch Pad configurations for these objects so that when
you double-click the object pinned on the Launch Pad, the configuration for
that object type is launched.
a. Create an XML configuration file for a specific object type by placing
that type into the launchpad name node of the XML configuration file.
For example, to create a configuration for Folder types, use launchpad
name="Folder", or to create a configuration for Item types, use launchpad
name="Item". Then create the Launch Pad dataset, import the XML file,
and add the necessary icons to the dataset’s named references.
c. When you double-click an that business object type (for example, an item or
folder) that is pinned to the Launch Pad, the new configuration is displayed.
(To return to the default configuration, click the Getting Started button
on the Launch Pad toolbar.)
• Plug-in
http://www.eclipse.org/articles/Article-Internationalization/how2I18n.html
http://www.eclipse.org/articles/Article-Speak-The-Local-Language/article.html
• Some Java API classes, methods, and constructors are deprecated or obsolete
and should be replaced.
For more information about deprecated and obsolete API, see the Teamcenter 9.1
Release Bulletin.
Hide perspectives
1. Log on to Teamcenter as a user that is in the dba group.
2. To import the JAR file, right-click the lib folder, choose Import→General→File
System, select the directory that contains the JAR file on your system, and
select the JAR file to import.
The JAR file is imported into the lib folder.
3. To add the lib folder to the classpath, on the Runtime tab, click the Add button
and select the lib folder
4. To ensure the new JAR file is built with the project, click the Build tab, and in
the Binary Build pane, select the check the box next to the lib folder.
6. To update the class path, right-click the project and choose PDE Tools→Update
classpath.
The JAR file is added to the Referenced Libraries container under the project.
7. To add the JAR to the project Java build path properties, perform the following
steps:
a. Right-click the project, choose Properties, and select Java Build Path in
the left pane.
b. In the Java Build Path dialog box, click the Add Library button, select User
Library, click Next, select the lib folder, and click Finish.
c. In the Java Build Path dialog box, select the lib library, click the Add JARs
button, select the JAR file under the lib folder, and click OK.
If you get the error shown in the following figure during Eclipse’s startup, either the
Java Runtime Environment is not installed or the PATH statement does not contain
the JDK-installation-directory\bin directory.
This error can occur when you expose custom classes using Eclipse but do not include
the class information in the MANIFEST.MF file. To correct this error, ensure that
you have added your plug-in on the Runtime tab in the Exported Packages pane in
Eclipse. This adds class information to the MANIFEST.MF file.
Previous to Teamcenter 2007.2, the classpath alone was sufficient to handle custom
class information. In later Teamcenter versions, you must add your plug-in to
the Exported Packages pane on the project Runtime tab to ensure that the
MANIFEST.MF file is correctly updated.
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/
views/console/ref-console_view.htm
There are also standard Eclipse views that can help you debug your customization.
For more information about the Eclipse views, see Debug using Eclipse views.
2. Select an object, such as an item or dataset. You can also copy an object’s tag
from a syslog and paste it in the UID box.
The object’s attributes and their values appear in the Print Object pane at the
bottom of the rich client.
Note
You cannot edit the values in the Print Object pane.
3. (Optional) Limit what is displayed in the pane by changing All attrs in the list
to one of the following:
• Refs only
Shows only those attributes whose value is a tag.
• Strings only
Shows only those attributes whose value is a string.
5. If you want to save the attributes and their values to a file, click the SAVE
button in the pane.
6. To see attributes of another object, leave the pane open and select the other
object. If you want to see attributes of an object you selected earlier, select it
from the list at the top of the pane.
2. To choose what you want to see in the monitor, click the Menu button in the
Communication Monitor pane and choose one or more of the following:
• Show Server Calls
Displays an entry for each call to the server.
• Show Request
Displays the XML request sent to the server.
• Show Response
Displays the XML response returned by the server.
• Show Timing
Displays the length of the server call in seconds.
3. If you want to clear the data, click the Clear button in the pane.
4. If you want to save the data to a file, click the Save As button in the pane.
2. To see the data from the server and client, click the Report button. The data
is also logged along with the text in the Log comment box. It also resets the
counters.
• The SQL and server CPU statistics are retrieved from the server.
• Wallclock time since reset is the time since the last reset.
Times are shown in milliseconds. If the top of the Performance Monitor
states that the Hi-Res timer is in use, times are accurate to 1 millisecond.
Otherwise the standard operating system clock is in use; Microsoft Windows
uses a 60 Hertz clock, so times on Windows are accurate to about 16
milliseconds.
• Server calls made is a count of all calls made to the server, not including the
call to get the SQL statistics.
Note
If you select the Reset on first server call check box, the Performance
Monitor is reset after the next server call after you click the Report button.
3. To clear the data and reset all counters, click the Reset button.
Note
If you select the Reset on first server call check box, the Performance
Monitor is reset after the next server call after you click the Reset button.
http://help.eclipse.org/helios/index.jsp?topic=
/org.eclipse.jdt.doc.user/reference/views/console/ref-console_view.htm
• Progress view
Shows the progress of background jobs. You can connect this view to your
customizations if you want to see the progress when your customizations run.
For more information, see the following URL in the Eclipse help:
http://help.eclipse.org/helios/index.jsp?topic=
/org.eclipse.platform.doc.isv/guide/runtime_jobs_progress.htm
To enable debug-level logging for the entire rich client, change the
log4j.rootLogger line in the TcLogger.properties file to DEBUG. The line
should look like this:
log4j.rootLogger=DEBUG, TcLoggerConsoleAppender, TcLoggerFileAppender,
TcLogContext
• Log location
By default, the rich client log is the operating-system-user-name_TcRAC.log file
in your operating system’s temporary directory. You can change the location
by changing the log4j.appender.TcLoggerFileAppender.file entry in the
TcLogger.properties file. This is the default location:
log4j.appender.TcLoggerFileAppender.file=${osgi.instance.area}/
${user.name}_TcRAC_${timestamp}.log
Adding appenders
You can easily add or remove an appender to a logger. The content of all appender
output is identical unless you add a filter to the content. Each appender supports
a pattern layout that determines the format of the output. By default, the rich
client has two kinds of appenders:
• A console appender which outputs to the console. To see console output in the
rich client outside of Eclipse, you must use the -consolelog flag on the command
line when you run the rich client.
Pattern layouts
Use a pattern layout to include more information in the console or log file. Each
appender has a pattern layout, which is a substitution string for the output.
• c
Display the logger (category) name.
• C
Display the fully qualified class name of the caller issuing the logging request.
• d
• F
Display the file name where the logging request was issued. This slows execution.
• l
Display the location information of the caller that generated the logging event.
This slows execution.
• L
Display the line number from where the logging request was issued. This slows
execution.
• m
Display the message.
• M
Display the method name where the logging request was issued. This slows
execution.
• n
Insert a new line.
• p
Display the priority of the logging event (DEBUG, WARN, INFO).
• r
Display the number of milliseconds elapsed since the start of the application
until the creation of the logging event.
• t
Display the name of the thread that generated the logging event.
• x
Display the nested diagnostic context (NDC) associated with the thread that
generated the logging event.
For example:
• %-5p: %m%n
This layout produces the following log message:
ERROR: There is something wrong here!
• Warning condition
logger.warn( String [,Throwable] );
• Information condition
logger.info( String [,Throwable] );
• Debug condition
logger.debug( String [,Throwable] );
Listener leaks
Events in Java are fired by means of listeners. An object registers interest with a
target object, so that when an event occurs the listening object is notified. For this
relationship to be maintained, the target object must maintain a reference to the
listening object. The Java memory management facilities look only to delete objects
from virtual memory when the objects are no longer referenced by any other Java
object. The problem at hand is the removal of listeners.
Rich client does not currently have a system in place to facilitate the removal of
listeners. This creates two issues:
• It causes a memory leak.
The memory leak issue exists because references are maintained to Java objects
that are no longer needed. This creates the situation in which the garbage
collector runs but is unable to remove the old objects because they are still tied
as listeners. Under this condition, the virtual memory of the Java VM eventually
runs out.
• It begins to impact performance of the UI, because old components are being
needlessly updated.
The performance issue is more prevalent than the memory leak. System
performance begins to deteriorate quickly under certain UI conditions. The use
of the viewer illustrates this, because as new viewers are displayed, they add
their components to the session, attached as listeners. The UI appears sluggish
and eventually becomes unusable.
InterfaceSignalOnClose
The InterfaceSignalOnClose class requires the implementation of the
closeSignaled() method. This interface is designed to signify the desire to be
notified when closure is to commence. The closeSignaled() method is designed to
remove any listeners that were created during the life of the object.
This interface signifies that the implementing class registers interest to be known
when closure occurs. The implementing class is required to implement the
closeSignaled() method. The closeSignaled() method is invoked when closure is
commencing (as shown in the following code):
public interface InterfaceSignalOnClose
{
public void closeSignaled();
}
Example: An implementation of the closeSignaled() method can look like the following:
public void closeSignaled()
{
TCSession session = (TCSession) application.getSession();
if (session != null)
{
session.removeAIFComponentEventListener( this );
}
}
SignalOnClose
The SignalOnClose class is designed to signal the processing of the components
to detach themselves from listeners and prepare to be closed. This class contains a
single method, close(), which is designed to be passed a reference to a Container
object. The Container object is the start of a recursive walk down the component
tree to look for instances of InterfaceSignalOnClose classes. If instances are
found, the classes are notified that closure is commencing. At this point, it is the
responsibility of the implementing class to take appropriate action.
For more information about using extension points, see topics in Sample rich client
customizations. Some topics show detailed use of Teamcenter extension points,
such as Add a new rich client application.
The following Teamcenter extension points are available for your use.
• title
Application task pane title.
• class
Application task pane implementation class.
• ApplicationTaskPaneSectionID
Sequence of section component IDs that contribute
to the application task pane. Each of the
ApplicationTaskPaneSectionID defined should
correspond to the ID attribute on the extensions
defined for the ApplicationTaskPaneSection
extension point.
ApplicationTaskPaneSection Adds an application task pane section to an application
task pane. Each ApplicationTaskPaneSection can
be composed of zero or more section components. An
application task pane section is associated with:
• ID
Unique ID of the application task pane section.
• title
Application task pane section title.
• iconBundleName
Location of the icons if they are located in a different
bundle.
• icon
Application task pane section icon.
• class
Application task pane section implementation class.
• secondaryTitle
Application task pane section secondary title.
• secondaryActionClass
Secondary action implementation class.
• SectionComponentID
Sequence of section component IDs that contribute
to the application task pane section. Each of the
SectionComponentID defined should correspond
to the ID attribute on the extensions defined for the
SectionComponent extension point.
SectionComponent Adds a section component to an application task pane
section. A section component is associated with:
• ID
Unique ID of the section component.
• title
Section component title.
• iconBundleName
Location of the icons if they are located in a different
bundle.
• icon
Section component icon.
• class
Section component implementation class.
• secondaryTitle
Section component secondary title.
• secondaryActionClass
Secondary action implementation class.
• SectionComponentID
• perspectiveId
Perspective ID that should be the same as the
ID in the org.eclipse.ui.perspectives extension
point or in the perspective_id attribute of the
com.teamcenter.rac.aifrcp.
application extension point.
• applicationId
The id attribute on the aif_app_item element
under the com.teamcenter.rac.aifrcp.
application extension point.
openWithConfiguration Matches editors with Teamcenter types in the Open
With menu.
• typeName
Teamcenter type name.
• editorId
Editor ID that is registered using the
org.eclipse.ui.editors extension point.
• perspectiveId
If specified, the perspective is posted prior to
opening the editor in the perspective. If the
specified perspective does not have an editor area
visible, then a default perspective (metadata-editing
perspective) is posted prior to opening the editor.
operation Contributes extensions that are used to perform an
operation from a wizard or dialog box.
ProjectSections Supports associating sections within a view.
tcOpenConfiguration Allows the extenders to specify a perspective ID to open
with in conjunction with the Eclipse core expressions.
When the core expression evaluates to true, the
perspective ID registered against it is used to open the
selected object.
tc_properties Defines the entry point where the customer can plug in
their override properties file.
• You can also use some of these command line arguments (such as
-attach) when constructing a URL to launch the rich client in a four-tier
environment. To obtain a URL in the four-tier rich client, right-click an
object such as an item and choose Copy, and then paste the resulting URL
into the address bar of a Web browser. This allows you to launch the rich
client and automatically open the copied object. For example:
http://svi6w101:7001/tc/launchapp?-attach=true&-s=226TCSession&
-o=QNG11_93oEfenBAAAAAAAAAAAAA
• -arch architecture
Defines the processor architecture on which the Eclipse platform is running. The
Eclipse platform ordinarily computes the optimal setting using the prevailing
value of Java os.arch property. If specified here, this is the value that the
Eclipse platform uses. The value specified here is available to plug-ins as
BootLoader.getOSArch(). Example values: x86, sparc, PA-RISC, ppc.
• -attach
Attaches the new client to an existing session.
For example, a user launches CATIA from the rich client and works on a
structure. The same structure is also loaded in Structure Manager. Selecting a
part in CATIA, the user wants to synchronize the same selections in Structure
Manager. This is where the -attach argument is useful to indicate that the
synchronization of the selections should happen in an existing rich client session.
• -application applicationId
Specifies the application to run. Applications are declared by plug-ins supplying
extensions to the org.eclipse.core.runtime.applications extension point.
This argument is typically not required. If specified, the value overrides the
value supplied by the configuration. If not specified, the Eclipse Workbench is
run. For example, to launch My Teamcenter, use the following command:
portal.bat -application=com.teamcenter.rac.ui.perspectives.navigatorPerspective
• -clean
Cleans cached data used by the OSGi framework and Eclipse run time. This is
useful if you have new plug-ins you have added to your environment. Try to run
Eclipse once with this argument if you observe startup errors after installation,
update, or using a shared configuration.
Note
When you start the rich client, if your customization changes still do not
appear in the user interface after running the -clean argument, delete
the Teamcenter subdirectory in the user’s home directory on the client.
This directory is automatically created again when the user starts the
rich client.
On a Windows client, it is typically the C:\Documents and
Settings\user-name\Teamcenter\ directory on Windows XP or the
Desktop\user-name\Teamcenter directory on Windows 7. On a UNIX
client, it is typically the $HOME/Teamcenter/ directory.
If you delete this directory, the last state of the rich client is lost, and the
user interface appears as it does at initial startup.
• -configuration configurationFileURL
The location for the Eclipse platform configuration file, expressed as a URL.
The configuration file determines the location of the Eclipse platform, the set
of available plug-ins, and the primary feature. Note that relative URLs are
not allowed. The configuration file is written to this location when the Eclipse
platform is installed or updated.
• -consolelog
Mirrors the Eclipse platform’s error log to the console used to run Eclipse. It is
effective when combined with -debug.
• -data workspacePath
The path of the workspace on which to run the Eclipse platform. The workspace
location is also the default location for projects. Relative paths are interpreted
relative to the directory that Eclipse was started from.
• -detach
Detaches the client from an existing session.
Starts clients as separate sessions. This is the default behavior, even if the
-detach option is not specified.
• -debug [optionsFile]
Puts the platform in debug mode and loads the debug options from the file at the
given location, if specified. This file indicates which debug points are available
for a plug-in and whether or not they are enabled. If a file location is not given,
the platform looks in the directory that eclipse was started from for a file called
.options. Both URLs and file system paths are allowed as file locations.
• -dev [classpathEntries]
Puts the platform in development mode. The optional classpath entries (a
comma separated list) are added to the run-time classpath of each plug-in. For
• -DskipRegReload args
If you are starting the rich client inside the Eclipse IDE, this option prevents the
registry database from loading if it already exists, which can save up to a minute
or more during startup depending on your system. You can add this argument to
your run/debug configuration. However, if you use this argument, any changes
you make to the registry property files are not used. If you are making changes
to the registry database, do not use this argument.
• -initialize
Initializes the configuration being run. All run-time related data structures
and caches are refreshed. This is useful with shared installs; running Eclipse
once with this option from an account with write privileges improves startup
performance.
• -nl locale
Defines the name of the locale on which the Eclipse platform is running. The
Eclipse platform ordinarily computes the optimal setting automatically. If
specified here, this is the value that the Eclipse platform uses. The value
specified here is available to plug-ins as BootLoader.getNL(). For example,
you can use the following: en_US or fr_FR_EURO.
• -nosplash
Runs the platform without putting up the splash screen.
• -os operatingSystem
Defines the operating system on which the Eclipse platform is running. The
Eclipse platform ordinarily computes the optimal setting using the prevailing
value of Java os.name property. If specified here, this is the value that the
Eclipse platform uses. The value specified here is available to plug-ins as
BootLoader.getOS() and used to resolve occurrences of the $os$ variable in
paths mentioned in the plug-in manifest file. For example, you can use one of the
following: win32, linux, hpux, solaris, aix.
• -perspective perspectiveId
The perspective to open in the active workbench window on startup. If this
parameter is not specified, the perspective that was active on shutdown will be
opened.
• -plugincustomization propertiesFile
The location of a properties file containing default settings for plug-in
preferences. These default settings override default settings specified in the
primary feature. Relative paths are interpreted relative to the directory that
Eclipse was started from.
• -product productId
The ID of the product to run. The product gives the launched instance of Eclipse
its personality, and determines the product customization information used.
This replaces -feature, which is still supported for compatibility.
• -refresh
Option for performing a global refresh of the workspace on startup. This
reconciles any changes that were made in the file system since the platform
was last run.
• -showlocation [workspaceName]
Option for displaying the location of the workspace in the window title bar. The
optional workspace name argument displays the provided name in the window
title bar instead of the location of the workspace.
• -vm vmPath
The location of Java Runtime Environment (JRE) to use to run the Eclipse
platform. If not specified, the JRE is at jre, sibling of the Eclipse executable.
Relative paths are interpreted relative to the directory that Eclipse was started
from.
• -vmargs args
When passed to Eclipse, this option customizes the operation of the Java Virtual
Machine (VM) used to run Eclipse. If specified, this option must come at the
end of the command line. The given arguments are dependant on the VM that
is being run.
Coding standards
Coding standards, such as file and directory structure conventions, naming and
property conventions, and dialog box text and color policies, ensure the consistency
and uniformity of customized code.
File organization
The following file and directory structure standards should be used when developing
the rich client customization code:
• All package names must be lowercase. Do not use space characters in package
names.
• The general package registry should have the same name as the last package
name. For example, for the com.mycompany.rac.explorer package, the
file for the ResourceBundle object that contains the registry information is
explorer.properties.
• Image files associated with a particular package must be located within the
images directory below the package.
Naming conventions
The following table describes the recommended naming convention for the various
Java types.
Java
type Rule Example Comment
Interface Interface[name], I[name] InterfaceAIFOperationListener, Teamcenter
ISelectionService standard
Abstract Abstract[name] AbstactAIFApplication Teamcenter/Java
class standard
Exception [name]Exception SomethingHappenedException Java
class standard
Variable Lowercase first word, factoryName Java
naming uppercase first letter of standard
other words.
Accessor Getting: Use getXXX, except getFactoryName(), Java
methods for Booleans, where XXX setFactoryName(), isReady() standard
is allowed. Setting: use
setXXX.
Source Same as Class name ISelectionService.java Java
files (including case). requirement
Class Uppercase first character of ComponentManager Java
names each word. standard
Property conventions
• Localization
• User properties
The reason for this distinction is that customers modify the user property files while
maintaining the links to the core development property files. The following table
describes the properties files using explorer as an example.
File Description
explorer.properties Base property file
explorer_locale.properties Property file for the purpose of localization
explorer_user.properties Customer created property file
The source conventions follow the Sun Java source code standards that match the
industry norms for Java development.
• Mnemonics should be used for common dialog box buttons, such as OK, Apply,
and Cancel.
• The initial location of the dialog box must be screen centered, and the sizing of
the dialog box must be adjusted with a sizing factor.
o Set all text area components to the initial size of 3 rows by 30 columns.
o Select the text when the focus is gained inside the text field.
• Color policies
Whenever possible, use the default color provided by the base component. Allow
the current look and feel to determine the color.
o If it is not possible to use the default color, use the SystemColor class.
o If neither the default color nor the SystemColor class suffice, define the
color in the property files so users can change it.
• Font policies
Whenever possible, use the default font provided by the base component.
If the default font is not sufficient, try one of the following options:
1. Offset the font based on the size of the current font. Do not hard code the
font name, because the font may not be available on all platforms.
Property beans
The following table lists JavaBeans that you can use to customize the properties
display.
Note
To display a red asterisk in the upper-right corner of a UI widget to indicate
a mandatory property, use the Business Modeler IDE to set the Required
property constant to true.
For more information, see the Business Modeler IDE Guide.
JavaBean Description
PropertyNameLabel Renders the name of a property (as shown in the following
figure). By specifying the name property, it shows either the
displayable name or real name of the property according to the
setting. This bean can be used along with other beans that
display the property value.
PropertyNameLabel
Properties:
property
Specifies the property name presented by the bean.
displayableName
Indicates whether the displayable name or real name is used.
colon
Indicates whether or not a colon is displayed after the name.
ProperyTextField Renders any nonarray type property, except reference/relation
type properties (as shown in the following figure). This bean
wraps the rendering of the given POM property into JTextField.
Upon saving, the bean attempts to convert the string to the
corresponding property type. If it cannot convert the string to
the required type, an exception is thrown.
PropertyTextField
Properties:
property
Specifies the property name presented by the bean. When a
component is provided, the property value is displayed inside
the box.
JavaBean Description
modifiable
Indicates whether the property is modifiable. If not
modifiable, the text box cannot be edited.
TitledProperty Displays the property name above the text box (as shown in the
TextField following figure). This bean is similar to the PropertyTextField
bean and actually contains two beans: PropertyNameLabel
and PropertyTextField.
TitledPropertyTextField
Properties:
bordered
Indicates whether a border is drawn around the text box.
PropertyTextArea
Properties:
property
Specifies the property name presented by the bean. When a
component is provide, the property value is displayed inside
the text area.
modifiable
Indicates whether the property is modifiable. If not
modifiable, the text area cannot be edited.
JavaBean Description
TitledProperty Displays the property name above the text area (as shown in the
TextArea following figure). This bean is similar to the PropertyTextArea
bean and actually contains two beans: PropertyNameLabel
and PropertyTextArea.
TitledPropertyTextArea
Properties:
bordered
Indicates whether a border is drawn around the text area.
TitledPropertyLabel
Properties:
bordered
Indicates whether a border is drawn around the label.
JavaBean Description
PropertySlider Renders any numeric type property. For double or float types, the
value is cast to an integer. For string or note types, the value is
converted to an integer if possible. Upon save, the value set on
the slider is converted to the corresponding property type and
saved. The following figure illustrates an implementation of the
PropertySlider bean.
PropertySlider
Properties:
property
The property name presented by the bean. When a
component is provided, the slider value is set according to
the property value.
modifiable
Indicates whether the property is modifiable. If not, the
slider is disabled.
TitledPropertySlider Displays the property name above the slider (as shown in the
following figure). This bean is similar to the PropertySlider
bean, and it actually contains two beans: PropertyNameLabel
and PropertySlider.
TitledPropertySlider
bordered
Indicates whether a border is drawn around the slider.
JavaBean Description
PropertyCheckbox Renders any nonarray type property, except reference/relation
type, using JCheckBox. A flag indicates whether the value is
saved only when the check box is selected or whether it is always
saved. There is a variable for the value to use on saving for a
selected button or for the deselected button. If the flag is set to
save regardless of whether the button is selected or deselected,
both the selected value to save and the deselected value to save
must be set. The following figure illustrates an implementation
of the PropertyCheckbox bean.
PropertyCheckbox
Properties:
property
The property name presented by this bean. When a
component is provided, the check box is selected if the
property value is same as the selected value.
modifiable
Indicates if the property is modifiable. If not, the check box is
disabled.
selectedValue
Specifies the value used for saving when the check box is
selected.
deselectedVaue
Specifies the value to use for saving when the check box is
deselected.
saveOnlyWhenSelected
Indicates to save only when check box is selected or to always
save.
TitledProperty Displays the property name above the check box (as shown in the
Checkbox following figure). This bean is similar to the PropertyCheckbox
bean and actually contains two beans: PropertyNameLabel
and PropertyCheckbox.
TitledPropertyCheckbox
bordered
Indicates whether a border is drawn around the check box.
JavaBean Description
PropertyRadioButton
Properties:
property
The property name presented by the bean. When a
component is provided, the button is selected if the property
value is the same as the selected value.
modifiable
Indicates whether the property is modifiable. If not, the
button is disabled.
selectedValue
Specifies the value used for saving when the button is
selected.
deselectedVaue
Specifies the value to use for saving when the button is
deselected.
saveOnlyWhenSelected
Indicates to save only when the button is selected or to
always save.
TitledProperty Displays the property name above the button (as shown
RadioButton in the following figure). This bean is similar to the
PropertyRadioButton bean.
TitledPropertyRadioButton
bordered
Indicates whether a border is drawn around the button.
JavaBean Description
PropertyToggleButton
Properties:
property
The property name presented by the bean. When a
component is provided, the button is selected if the property
value is the same as the selected value.
modifiable
Indicates whether the property is modifiable. If not, the
button is disabled.
selectedValue
Specifies the value used for saving when the button is
selected.
deselectedVaue
Specifies the value to use for saving when the button is
deselected.
saveOnlyWhenSelected
Indicates to save only when the button is selected or to
always save.
TitledProperty Displays the property name above the button. This bean
ToggleButton is similar to the PropertyToggleButton bean. The
following figure illustrates an implementation of the
TitledPropertyToggleButton bean.
TitledPropertyToggleButton
bordered
Indicates whether a border is drawn around the button.
JavaBean Description
LOVPopupButton
Properties:
property
The property name presented by the bean. When a
component is provided, the button text is set to the property
value.
modifiable
Indicates whether the property is modifiable. If not, the
button is disabled.
lovName
Specifies the name of the LOV that the bean uses. If
undefined, the LOV information is retrieved from the
property descriptor.
TitledProperty Displays the property name above the LOV button (as
LOVButton shown in the following figure). This bean is similar to the
PropertyLOVButton bean and actually contains two beans:
PropertyNameLabel and PropertyLOVButton.
JavaBean Description
TitledPropertyLOVButton
bordered
Indicates whether a border is drawn around the LOV popup
button.
PropertyLOVPopupButton
Properties:
property
The property name presented by the bean.
JavaBean Description
modifiable
Indicates whether the property is modifiable. If not, the
combo box is disabled.
lovName
Specifies the name of the LOV that the bean will use.
If undefined, the LOV information is retrieved from the
property descriptor.
TitledProperty Displays the property name above the LOV combo box (as
LOVCombobox shown in the following figure). This bean is similar to the
PropertyLOVCombobox bean.
TitledPropertyLOVCombobox
bordered
Indicates whether a border is drawn around the LOV combo
box.
In addition, you can apply the properties of the
PropertyLOVCombobox bean.
PropertyCheckbox Presents each value in the LOV as a check box (as shown in the
OptionLov following figure). This bean is designed for any type property
that has a LOV attached. If the property is not an array, the
check boxes are added to a button group; otherwise, they are not
added to the button group and multiple selections are allowed.
PropertyCheckboxOptionLov
Properties:
property
The property name presented by the bean.
JavaBean Description
modifiable
Indicates whether the property is modifiable. If not, the
check boxes are disabled.
lovName
Specifies the name of the LOV that the bean will use.
If undefined, the LOV information is retrieved from the
property descriptor.
TitledPropertyCheckbox Displays the property name above the check boxes (as
OptionLov shown in the following figure). This bean is similar to the
PropertyCheckboxOptionLov bean.
TitledPropertyCheckboxOptionLov
bordered
Indicates whether a border is drawn around the check boxes.
In addition, you can apply the properties of the
PropertyCheckboxOptionLov bean.
PropertyRadioButton Same as the PropertyCheckboxOptionLov bean, except it
OptionLov uses buttons (as shown in the following figure).
PropertyRadioButtonOptionLov
JavaBean Description
TitledPropertyRadio Displays the property name above the buttons (as shown
ButtonOptionLov in the following figure). This bean is similar to the
PropertyRadioButtonOptionLov bean.
TitledPropertyRadioButtonOptionLov
PropertyToggleButton Same as PropertyCheckboxOptionLov, except it uses buttons
OptionLov (as shown in the following figure).
PropertyToggleButtonOptionLov
TitledPropertyToggle Displays the property name above the buttons (as shown
ButtonOptionLov in the following figure). This bean is similar to the
PropertyToggleButtonOptionLov bean.
TitledPropertyToggleButtonOptionLov
JavaBean Description
PropertyPanel This bean is a generic container that allows the integrator to
control how property values are stored and displayed. You must
override the load and save methods to implement this standard
behavior. You can combine one or more UI components within
JPanel to provide custom behavior.
For example, if a property in a form called status is an integer
and is either 1 or 2 meaning Running or Stopped, you may
want two toggle buttons with radio behavior to represent this
property. To accomplish this, use the PropertyPanel bean with
two JToggleButtons contained within.
You must override the load and save methods of the
PropertyPanel to determine the selection state from the two
buttons. The PropertyPanel is designed for special behavior
beyond the scope of the other property beans described in this
manual.
TitledPropertyPanel Displays the property name above the panel. This is the same
as the PropertyPanel bean.
PropertyObjectLink This bean renders reference type properties. A shortcut menu is
provided for users to modify the value (as shown in the following
figure). If the value is not modifiable, the shortcut menu is not
available. When the link is clicked, the system displays a dialog
box with properties of this reference component.
PropertyObjectLink
Properties:
property
The property name presented by the bean.
modifiable
Indicates whether the property is modifiable. If not, the
shortcut menu is not available.
JavaBean Description
TitledProperty Displays the property name above the link (as shown
ObjectLink in the following figure). This bean is similar to the
PropertyObjectLink bean.
TitledPropertyObjectLink
bordered
Indicates whether a border is drawn around the link.
In addition, you can apply the properties of the
PropertyObjectLink bean.
PropertyLongText This bean can be used with any string or note type properties,
but is generally used to render text with lengths over 2500
characters. It contains a text area and a button. The long text
dialog box is displayed by clicking the button, making it easier to
browse the text (as shown in the following figure).
PropertyLongText
Properties:
property
The property name presented by the bean.
JavaBean Description
modifiable
Indicates whether the property is modifiable. If not, the text
area cannot be edited and only the close button is available
in the long text dialog box.
TitledProperty Displays the property name above the long text panel (as
LongText shown in the following figure). This bean is similar to the
PropertyLongText bean.
TitledPropertyLongText
bordered
Indicates whether a border is drawn around the text area.
In addition, you can apply the properties of the
PropertyLongText bean.
PropertyLogicalPanel This bean is used to present a logical type property. It uses two
buttons, one for value true and another for false.
property
The property name presented by the bean.
modifiable
Indicates whether the property is modifiable. If not, the
buttons are disabled.
TitledProperty Displays the property name above the box (as shown
LogicalPanel in the following figure). This bean is similar to the
PropertyLogicalPanel bean.
TitledPropertyLogicalPanel
bordered
Indicates whether a border is drawn around the text area.
In addition, you can apply the properties of the
PropertyLongText bean.
JavaBean Description
PropertyArray Renders all array type properties. It is composed with a list box
and buttons to access the values in the list box (as shown in the
following figure). Based on the type of the property, a different
renderer is used for modifying or adding values. If the property
is read only, users cannot enter edit mode.
PropertyArray
property
The property name presented by the bean.
modifiable
Indicates whether the property is modifiable. If not, the edit
button is not available and the user cannot enter edit mode.
JavaBean Description
TitledPropertyArray Displays the property name above the property array (as shown
in the following figure) and is similar to the PropertyArray
bean.
TitledPropertyArray
bordered
Specifies whether a border is drawn around the panel.
JavaBean Description
PropertyImage
TCComponentUINode
TCTable
TCTableCellRenderer
TCTableLine
TCTableModel
TCTableSelectionAdapter
TCTree
TCTreeCellRenderer
TCTreeNode
TCTreeOpenEvent
TCTreeOpenListener
TCTypeRenderer
VerticalLayout
AbstractProgessDialog
This class contains the definition for the AbstractProgressDialog class, which
displays the progress of multiple components individually, as they are processed.
The AbstractProgressDialog class has the following features:
• The status of the operation, such as in-progress, successful completion, or
failure of completion, is indicated for each component on the dialog box in the
following figure.
• If an operation fails, the tooltip on the error symbol describes the error.
• If the error symbol is clicked, the system displays a detailed error message.
• When an operation is in progress, a Stop button displays on the dialog box and
can be used to stop the operation. This feature is available only for the open
and delete operations. When the delete operation is aborted, the operation in
progress on a component cannot be stopped; however, the operation is stopped
before the next component is deleted.
Delete dialog
1 Components to be deleted.
2 Click Yes to initiate Delete operation.
Progress indicators
Completion indicators
• Copy
• Paste
• Delete
• Check-In
• Check-Out
• Transfer Check-Out
• Publish
• Unpublish
The startOperation() method is called when you click the Yes button. This method
builds the DeleteOperation class, which in turn calls the startProcess() method
from the AbstractProgressDialog class. The startProcess() method sets the focus
on the first displayed component, sets the in-progress icon against the component,
and calls the getOperations() method, which is an abstract method that the
subclass must implement. The getOperations() method in the DeleteDialog class
calls the DeleteOperation class on the first component.
The methods implemented by the subclass are shown in the following code:
setDialogTitle(r.getString("command.TITLE"));
setDisplaySuccessComponents(true);
setCommandIcon(r.getImageIcon("delete.ICON"));
setSuccessIcon(r.getImageIcon("delete.ICON"));
setConfirmationText(r.getString("confirmationText"));
setShowParentFlag(false);
setTCComponents(targets);
setConfirmationFlag(true);
public void run()
public void execute( AIFComponentContext compContext ) throws Exception
(This method builds the appropriate operation on the component)
public void startOperation()
(This method calls the startProcess() method from the AbstractProgressDialog
ExpansionRule
The ExpansionRule component gets the specific components of related types
that are attached to a component. Users can set the relations for specific types of
components and use the getChildren() method to get the required children. The
ExpansionRule component also provides the ability to filter out unwanted children.
LOVComboBox
The LOVComboBox component is used in place of the JComboBox component.
Note
This component is a Swing class. Teamcenter is moving toward SWT/JFace as
the user interface toolkit and moving away from AWT and Swing. Siemens
PLM Software encourages you to customize Teamcenter using SWT/Jface
components. Siemens PLM Software will discontinue Swing/AWT support in
a future version.
The LOVComboBox component loads the JComboBox component with the LOV
using a non-UI thread managed by the AIFSession object. This separates the UI
thread from the LOV loading thread and is beneficial because using the UI thread
to load an LOV containing a large number of entries takes a long time and hangs
the interface. Contents of LOVs are retrieved from the server side. If something
happens on the server or network, it blocks the user interface if an LOV is loading
using the UI thread but has no effect on the interface when a non-UI thread is
used to load the LOV.
For exhaustive and suggestive LOVs, the end user must use the backspace key to
clear the existing selection in the text box.
LOVDialog
The LOVDialog component provides another way to display an LOV.
Note
This component is a Swing class. Teamcenter is moving toward SWT/JFace as
the user interface toolkit and moving away from AWT and Swing. Siemens
PLM Software encourages you to customize Teamcenter using SWT/Jface
components. Siemens PLM Software will discontinue Swing/AWT support in
a future version.
{
MessageBox mb = new MessageBox(ex);
mb.setModal(true);
mb.setVisible(true);
}
lovDialog = new LOVDialog(parent, usersLOV);
lovDialog.setVisible(true);
TCQueryClause currentClause;
…
The code in the following example constructs an LOV popup button and displays a
default value:
LOVPopupButton lovPopup;
TCComponentListOfValues currentLov = currentClause.getLOV();
if(currentLov != null)
{
lovPopup = new LOVPopupButton(currentLov, null);
if (entryValue.length() != 0)
{
lovPopup.setDefaultValue(entryValue);
}
}
LOVPanel
The LOVPanel component is used by the LOVPopupButton and LOVDialog
components.
Note
This component is a Swing class. Teamcenter is moving toward SWT/JFace as
the user interface toolkit and moving away from AWT and Swing. Siemens
PLM Software encourages you to customize Teamcenter using SWT/Jface
components. Siemens PLM Software will discontinue Swing/AWT support in
a future version.
LOV panel
1 Value field
2 Find button
3 LOVListBox
4 Message center
5 Load Previous button
6 Load Next button
If an LOV is a suggestive list that accepts user input, the value field acts as an input
field. Users can input a value and press the Enter key. If the user clicks the Find
button, the list box loads the values that match the search criteria.
If the LOV is an exhaustive list that does not allow user input, the value field acts
as a filter input field. Users can input a value and press the enter key, which is
the same as clicking the Find button. The list box loads the values that match
the search criteria. Partially loading the LOV or using the query feature makes
searching efficient. The Load All button loads all found values and the Load Next
button loads the next set of found values.
LOVPopupButton
1 The LOVPopupButton component takes a given value set on its text field
(4 in this example).
2 Popup window is shown after the user clicks the button.
MRUButton
OpenByNameButton
OrgSelectionDialog
OrgSelectionDialog component
In addition, the dialog box provides the ability to search for a specific group, role,
or user within the organization (as shown in the following figure). If you click the
Reload button, the tree displays all top-level groups in the organization. Both
figures show the features of the OrgSelectionDialog component.
ReferencersPanel
The ReferencersPanel component displays where-used and where-referenced
diagrams. An object can be sent to the Referencers panel, where the user can
double-click it to search for where the object is used or referenced.
When a component is sent to the Referencers panel, whether it defaults to the
where-referenced or where-used display depends on the component type. Users can
define which components to display in the panel.
Referencers panel
The Referencers panel can display the nodes in reverse horizontal style, vertical
style, or tree-look style. Three layout managers are used to accomplish this:
• ReferencersReverseHorizontalNodeLayout
• ReferencersTreeLookNodeLayout
• ReferencersVerticalNodeLayout
ReferencersReverseHorizontalNodeLayout
The ReferencersReverseHorizontalNodeLayout layout manager extends from
the ReverseHorizontalNodeLayout component. It displays the nodes in reverse
horizontal order where the structure is expanded from right to left horizontally and
can display where-referenced and where-used information in different colors.
ReferencersTreeLookNodeLayout
ReferencersVerticalNodeLayout
ReferencerUINode
Note
This component is a Swing class. Teamcenter is moving toward SWT/JFace as
the user interface toolkit and moving away from AWT and Swing. Siemens
PLM Software encourages you to customize Teamcenter using SWT/Jface
components. Siemens PLM Software will discontinue Swing/AWT support in
a future version.
TCComponentUINode
The UI node is presented with the TCComponent object name and rendered icon
(as shown in the following figure).
TCConstants
The TCConstants class contains constants used across Teamcenter and its related
packages. Use the static variables defined in this class rather than hard-coding
strings.
RolePanel
The RolePanel reusable component extends the JPanel component and can be used
by any application to display role information (as shown in the following figure).
GroupPanel
The GroupPanel reusable component extends the JPanel component and can be
used by any application to display group information (as shown in the following
figure).
UserPanel
The UserPanel reusable component extends the JPanel component and can be used
by any application to display group information (as shown in the following figure).
TCTypeRenderer
AbstractDialog
The AbstractDialog component enhances the functionality of the JDialog
component, allowing you to instantiate the dialog box from a nonvisible application
and keep it modal. The AbstractDialog component also provides centerToScreen
methods.
AbstractPopupButton
The AbstractPopupButton class creates a custom popup window from a button.
This allows a small UI component to display a larger window that functions like
a dialog box.
The AbstractPopupButton component works like a JComboBox component. It
initially displays as a button (as shown in the following figure).
GenericTableModel
The following figure shows a table created with the GenericTableModel component.
iTextArea
The iTextArea component is a subclass of the JTextArea class and displays all the
same behaviors. Use this component to achieve a consistent look and feel across the
system. The goal is to use this component across the entire commercial Teamcenter
interface, so that when standards change or are enhanced the changes can be placed
in this class and be inherited by all implementing components.
Using the iTextArea subclass provides the following benefits over using the
JTextArea class:
• Field selection when focus is gained
Data is automatically selected when the focus is gained within the text area.
• Require signaling
You no longer must override the paint method to implement the paint, as
required. Instead, invoke the setRequired(Boolean state) method.
iTextField
The iTextField component is a subclass of the JTextField class and displays all the
same behaviors. Use this component to achieve a consistent look and feel across the
system. The goal is to use this component across the entire commercial Teamcenter
interface, so that when standards change or are enhanced the changes can be placed
in this class and be inherited by all implementing components.
Using the iTextField subclass provides the following benefits over using the
JTextfield class:
• Field selection when focus is gained
Data is automatically selected when the focus is gained within the text field.
• Require signaling
You no longer must override the paint method to implement the paint, as
required. Instead, invoke the setRequired(Boolean state) method.
Layout managers
This section describes the use of the layout managers (ButtonLayout,
HorizontalLayout, VerticalLayout, and PropertyLayout) in the design of
dialog boxes.
ButtonLayout
This section provides examples of horizontal and vertical button layouts using the
ButtonLayout layout manager.
Note
This component is a Swing class. Teamcenter is moving toward SWT/JFace as
the user interface toolkit and moving away from AWT and Swing. Siemens
PLM Software encourages you to customize Teamcenter using SWT/Jface
components. Siemens PLM Software will discontinue Swing/AWT support in
a future version.
Buttons are added in the order in which they are displayed. In the previous figure,
the sequence is OK, Apply and Cancel.
The following figure shows the dialog box when it is resized. The components
maintain their orientation and alignment.
Since the alignment is set to LEFT, the first button added is aligned to the left
corner of the dialog box and the remaining buttons are placed to the right of the
first, with a 20-unit gap between buttons. The following figure shows the dialog
box when it is resized.
Since the alignment is set to RIGHT, the first button added is aligned to the right
corner of the dialog box and the remaining buttons are placed to the left of the first,
with a 20-unit gap between buttons. The following figure shows the dialog box when
it is resized.
The buttonPanel panel is created. The panel uses the ButtonLayout layout
manager and assumes the default values for its parameters. Three buttons are
created and added to the panel. The buttons are positioned horizontally, in the
center of the panel, with a 10-unit gap between buttons. The buttons are not resized
when the panel is resized. The position of the buttons in relation to the edges of the
panel also remains unchanged.
When the panel is resized, the buttons maintain their size and alignment in relation
to the dialog box. The buttons are placed in the sequence in which they are added
to the panel.
The following figure shows the ButtonLayout layout manager with vertical
orientation and top alignment.
The following figure shows the ButtonLayout layout manager with vertical
orientation and bottom alignment.
The following figure shows the code used to create the previous examples:
public class testlayout extends JDialog
{
protected JButton one, two, three;
protected JPanel buttonPanel;
public testlayout ( Frame parent, String title )
{
super ( parent, title, false );
// Create a new panel with a ButtonLayout Manager
buttonPanel = new JPanel();
buttonPanel.setlayout ( new ButtonLayout(ButtonLayout.HORIZONTAL));
// Create three buttons
one = new JButton ( "OK" );
two = new JButton ( "Apply" );
three = new JButton ( "Cancel" );
// Add the buttons to the Panel created
buttonPanel.add (one );
buttonPanel.add (two);
buttonPanel.add (three);
this.add (buttonPanel);
this.pack ();
}
}
The buttonPanel panel is created. The panel uses the ButtonLayout layout
manager and assumes default values for its parameters. Three buttons are created
and added to the panel. The buttons are positioned horizontally in the center of the
panel with a 10-unit gap between buttons. Resizing a ButtonLayout panel does
not resize the buttons. The position of the buttons relative to the four edges of the
panel also remains unchanged.
HorizontalLayout
The HorizontalLayout layout manager positions children and attachments
horizontally in the container object.
Note
This component is a Swing class. Teamcenter is moving toward SWT/JFace as
the user interface toolkit and moving away from AWT and Swing. Siemens
PLM Software encourages you to customize Teamcenter using SWT/Jface
components. Siemens PLM Software will discontinue Swing/AWT support in
a future version.
When a component is added to the container object, the position of the component
is determined by the parameters passed in the name field. These parameters are
{Attachment, bind, HorizontalAlignment, VerticalAlignment}. The default
positioning for a component added without correct formatting in the name field is
(left.bind.center.center). bind and nobind indicate that the component will be
resized or maintained based on the space available. Top components are positioned
first, followed by bottom components and unbound components. If you do not call the
add function with a name string in the argument, an exception occurs.
The following figure shows the use of the HorizontalLayout layout manager.
vgap indicates the distance between the components in the dialog box. lm indicates
the left margin, rm indicates the right margin, tm indicates the top margin, and
bm indicates the bottom margin. All parameters are expressed in integers and
measured in pixels.
The following figure shows the dialog box that results when the following parameters
are passed to the constructor:
new HorizontalLayout (25, 10, 10, 25, 25);
The following figure also shows the behavior when the dialog box is resized. The
margins and spacing between components are maintained.
VerticalLayout
When a component is added to the container object, the position of the component
is determined by the parameters passed in the name field. These parameters are
{Attachment.Binding.HorizontalAlignment.VerticalAlignment}. The default
positioning for a component added without correct formatting in the name field is
(top.center.center.bind). Top components are positioned first, followed by bottom
components and unbound components. If you do not call the add function with a
name string in the argument, an exception occurs.
The following figure shows the use of a VerticalLayout layout manager. The
placement of the components within the dialog box is determined by the parameters
passed into the name field.
The following figure shows the layout of the components added with a bind
parameter. The Top and Unbound components are added with a bind parameter.
The Bottom component is added with a nobind parameter.
vgap indicates the distance between the components in the dialog box. lm indicates
the left margin, rm indicates the right margin, tm indicates the top margin, and
bm indicates the bottom margin. All parameters are expressed in integers and
measured in pixels.
The following figure shows the dialog box layout when the following parameters
are passed to the constructor:
new VerticalLayout (25, 10, 10, 25, 25);
The behavior of the dialog box when resized is also shown in the following figure.
The dialog box maintains the margins and the spacing between the components
when resized.
PropertyLayout
The code creates a buttonPanel panel using the PropertyLayout layout manager.
Three buttons are created and added to the panel in three separate columns. When
resized, the placement and size of the components remain unchanged (as shown in
the following figure). The default positioning of the components in the dialog box is
1.1.center.center.preferred.preferred. Because the horizontal alignment and
vertical alignment parameters are set to preferred, the components are not resized
along with the dialog box.
hgap indicates the horizontal distance between components in the dialog box. vgap
indicates the vertical distance between components in the dialog box. lm indicates
the left margin, rm indicates the right margin, tm indicates the top margin, and
bm indicates the bottom margin. All parameters are expressed in integers and
measured in pixels. The components are added to the dialog box horizontally, that is,
they are placed on the dialog box in the same row but in different columns.
The following figure shows the dialog box that results from passing the following
parameters to the constructor:
new PropertyLayout (10, 20, 10, 10, 40, 40);
The following figure also shows the behavior when the dialog box is resized. Only
the left and top margins and spacing between components are maintained when
the dialog box is resized.
d.show();
}
}
MessageBox
The MessageBox class communicates informational, warning, working, and error
messages to the user (as shown in the following figure).
MessageBox
The MessageBox class is a specialized JDialog class that provides the ability
to create and display a wide variety of message boxes to the user. Examples of
the information that appears in message boxes include help, detailed messages,
and general messages with icons that are set based on the type of MessageBox
component.
The following example shows code used to create a MessageBox component:
JFrame frm = new JFrame();
JPanel displayPanel = new JPanel(new BorderLayout());
JButton invokeButton = new JButton("Invoke MessageBox");
final MessageBox msgBox = new MessageBox(frm, "Some Message", "Title", MessageBox.ERROR);
displayPanel.add("Center", invokeButton);
frm.getContentPane().add(displayPanel);
invokeButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
msgBox.setVisible(true);
}
} );
frm.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
} );
frm.pack();
frm.validate();
frm.setVisible(true);
The following figure shows the message box produced by the code.
MLabel
The MLabel component displays text on multiple lines (as shown in the following
figure). The current AWT label and JLabel components are only capable of
displaying one line of text. The backslash and n character (\n) delimit the lines of
text.
MLabel component
The code in the following example constructs an MLabel component:
int fontSize = getFont().getSize();
Font fontText = new Font("TimesRoman", Font.PLAIN, fontSize+4);
Font f2 = new Font("TimesRoman", Font.BOLD, fontSize+32);
MLabel labelBanner = new MLabel(“TC Portal\nDesktop”);
labelBanner.setFont(f2);
labelBanner.setTextAlignment(MLabel.CENTER);
MLabel labelVersion = new MLabel(“Version 6.0\nUpdate version: 0”);
labelVersion.setFont(fontText);
labelVersion.setTextAlignment(MLabel.CENTER);
Registry
The Registry class contains registry information and provides a means of obtaining
information stored in a resource bundle, extending the functionality of the resource
bundle by way of encapsulation. This class provides the ability to native data types
and instance classes via key registry entries. The registry files must match the
package name.
The following code shows an example of a registry file.
# comments
import=com.teamcenter.rac.util
myLabel=My Label:
myIcon=images\myIcon.gif
ok=OK
ok.MNEMONIC=O
cancel=Cancel
cancel.MNEMONIC=C
The import statement in the preceding figure imports another registry file. It can
also import multiple files using a comma delimiter. The following figure shows the
hierarchy of the registry files in the com.teamcenter.rac.util package.
Separator
The Separator component visually separates user interface components (as shown
in the following figure). Separators can be oriented either horizontally or vertically.
f.setSize(new Dimension(350,350));
f.show();
}
}
SplitPane
The code in the following example creates the SplitPane component. It adds two
components, one for the left pane and one for right. The divider is set at 45 percent
of the total size of the SplitPane component.
SplitPane splitPane = new SplitPane ( SplitPane.HORIZONTAL_SPLIT );
JPanel leftPanel = new JPanel ();
JPanel rightPanel = new JPanel ();
// add components to splitPane
splitPane.setLeftComponent ( leftPanel );
splitPane.setRightComponent ( rightPanel );
splitPane.setDividerLocation(0.45);
splitPane.setDividerSize(2);
StringViewerDialog
The StringViewerDialog class loads a string array and displays text in a scrollable
format. This class extends from the AbstractDialog class. The dialog box allows
you to save and print the string array text and can also act as a simple text editor. In
the following figure, the entire panel is a StringViewerDialog component.
StringViewerDialog component
The code in the following example creates a StringViewerDialog component.
StringViewerDialog dlg = new StringViewerDialog (file);
dlg.setVisible(true);
StringViewerPanel
The StringViewerPanel component displays a text file or string array using a
JTextArea component to store and render the text. A scroll pane ID handles text
scrolling. The StringViewerPanel component serves as both a simple text editor
and a file viewer and supports print and saving files.
The following figure shows the Validation report, constructed using the
StringViewerPanel component.
Validation report
The code in the following example creates a StringViewerPanel component:
private StringViewerPanel stringViewerPanel = null;
stringViewerPanel = new StringViewerPanel(file);
parentPanel.add ( "unbound.bind.center.top", stringViewerPanel );
In Teamcenter 2007, the rich client was hosted within the Eclipse rich client platform
(RCP) framework. The RCP is a general purpose application framework that
provides strong support for modular and extensible component-based development
through the use of plug-ins. The rich client took limited advantage of the Eclipse
framework. There was a single Teamcenter perspective that all Teamcenter
applications used. The user interface was mostly Swing running with the aid of
the SWT_AWT bridge.
Starting with Teamcenter 8, the rich client took advantage of many Eclipse features
and introduced many SWT-based controls. Some of the rich client changes include:
• Each application became its own perspective.
• Many Teamcenter extension points, services, and SWT controls were added.
Integrating the Application Integration Framework (AIF) desktop with the Eclipse
workbench
If you have older AIF desktop customizations, you can integrate them with the
newer Eclipse RCP. However, although Teamcenter still supports the AIF in the
Eclipse RCP, you should make every effort to migrate your customization to use the
Eclipse RCP menu, toolbar, and status bar functionality.
In the rich client, the main integration point is an application. The active
application defines what is showing and its layout in the main pane area. The
current application controls the contents of the main menu bar and toolbar. The
navigation pane is always on and helps you to select the current application. In the
rich client, there is a main banner that identifies the current application and how
to switch between active applications. The main mechanism for defining the set of
applications has been the portal.properties file. This file is still supported and is
augmented by the aif_application extension point. The extension point supports
three different types of scenarios:
• Adding new traditional or legacy-based applications without modifying the
portal.properties file.
http://www.eclipse.org/articles/Article-UI-Workbench/workbench.html
perspective that can also manage pure SWT-based user interface components
simultaneously. Though these components can co-exist, there is no additional
infrastructure for these different user interface components to collaborate.
The rich client desktop is built on top of the Eclipse RCP workbench, including
the menubar, toolbar, and status bar. The RCP workbench is augmented with
additional shell trim that defines the main application switcher/banner bar and
the navigation pane. The remaining area is the current active Eclipse perspective.
By default, there is a simple Teamcenter perspective that simply holds a tabbed
stack of views. Each rich client application is forced to be associated with an
Eclipse perspective. Whenever a rich client application is activated, the associated
Eclipse perspective is made active. By default, an application is associated with the
Teamcenter perspective so legacy applications are not forced to define a perspective
to be associated with. If any application also contains a non-null main Swing JPanel,
that panel is wrapped in an AWT_SWT bridge view and placed in the stack of views.
Since each rich client application is associated with an Eclipse perspective, you
might want to read more about what an Eclipse perspective is.
For more information, see the following Web site:
http://www.eclipse.org/articles/using-perspectives/PerspectiveArticle.html
Context sensitivity
The AIF supports the concept of context sensitivity for all UI components. Context
sensitivity is controlling the availability of UI components when certain conditions or
states exist. In some cases, context sensitivity can be confusing to the user because
he or she may not know what to do to activate an option. One of the techniques
currently used to solve this is to change the tooltip text.
The model for the context sensitivity system is tied to the application where the
action appears. There is a selection listener associated with the application such
that when something is selected within the application, the application notifies
all listeners that a selection is changed. The idea behind this model is that the
application fires the event to all listeners and each UI component has an associated
handler that knows the UI component it is working for. The handler contains the
logic that determines the validity of the UI component with which it is associated.
In basic terms, the handler typically sets a component to disabled (setEnabled
(false)). However, the handler is flexible and is designed to allow any action to
be taken upon the associated UI component. For example, instead of disabling a
component you may want to write a handler that sets a UI component visibility
based upon a certain state. The handler interrogates the application for the state,
and based on the result invokes the UI components setVisible() method. The
handler simply implements one method. That method is responsible for making the
verdict and applying the appropriate action to the UI component.
Registration
The registration process is where the application, handler, and UI component are
bound together based on the context sensitivity object model. Each application
maintains a list of handlers (listeners) that are notified whenever a selection is
made within the application.
To register a handler (listener) with an application, invoke the following:
// c is an instance of a Component
MyHandler h = new MyHandler ( c );
app.addSelectionListener ( h );
This is typically done within the menu bar and toolbar construction. This can also be
done within the application panel construction for components located there.
There is a special implementation for Teamcenter applications that utilizes the
action system for the menu bar and toolbar. Register your handler within the
actions.properties file, and it is automatically used with the associated command.
Therefore, to register the simple RequiredSelectionHandler handler, which is
prepackaged for use, add it to your action definition within the actions.properties
file, as follows:
<yourCommand>.SELECTION_HANDLER=
com.teamcenter.rac.aif.common.contextsensitivity.RequiredSelectionHandler
No other registration is required for the command. When the selections change
within the application, your command is available only when something is selected.
If nothing is selected, it is not available.
If you want to keep components within the toolbar and menu bar synchronized like a
state selection, you can use this mechanism by manually triggering the selection
event and having your handlers refer to a class variable within the application for
the state. The system is written generically so that it can handle a variety of cases.
Write a handler
Base AIF provides the framework for context sensitivity as well as one implemented
handler, RequiredSelectionHandler. The RequiredSelectionHandler handler
looks at the given application, and if one or more components are selected, the
3. Register your handler with the action by either adding to the registry or
manually registering it within the UI parent in which it is contained (menu
bar, toolbar, panel).
3. The user enters data in the dialog box and submits it by clicking either the OK
or Apply button.
For more information, see Submitting the data and submitting the Web request.
For example, if the user creates a new folder, the process is:
3. The user types a name and a description for the folder, selects a type from the
list, and clicks OK.
4. A request to the server is generated that includes the data from the dialog box
and the appropriate insertion point.
5. The new folder is created on the server and attached using ITK.
6. An XML response is returned from the server with either the data to insert the
new folder in the user interface or an error message.
If you review the flow of this typical example, it helps you understand how the thin
client works. You can follow this example in detail to see how the infrastructure
components work together to implement this behavior.
Note that menu commands can execute arbitrary JavaScript. The menu XML is
delivered to the client and rendered as HTML with the JavaScript action attached.
In this case, the popupNewFolderDialog() function is called when the user
chooses the New→Folder menu command.
Note
Most menu entries are defined in the XML files, but the
New menu entries are the exception. The New menu items
are read from the WEB_displayed_new_menu_objects
preference, as shown by the following code in the line in the
staging_location\webapp_root\teamcenter\dhtml\common\
intl\language\wsomenu.xml file:
<menu type="new" title="New">
<menu type="NewmenuPlaceHolder" desc="Placeholder for menu entries of
WEB_displayed_new_menu_objects preference"></menu>
The menu XML is delivered to the client and rendered as HTML with a
JavaScript action attached. In this case, the popupNewFolderDialog()
function is called when the user chooses the New→Folder menu command.
If the dialog box already exists, the code displays it instead of creating a new
one. The dialog box is implemented using Teamcenter actionDialog code. The
actionDialog code generates a generically abstracted dialog box that incorporates
behaviors used by many Teamcenter dialog boxes, so the code needed to create an
instance of the dialog box is terse.
The description of the form itself is in the form renderer XML format required for
the actionDialog code. The XML data is held within a data island in the HTML
page structure. Many dialogs boxes take a server trip to assemble the appropriate
form (dynamic dialog boxes as opposed to static). This occurs if performance is an
issue (for example, the User Settings dialog box), or if Teamcenter suggests values
based on the selected object (for example, the New Process dialog box).
The following sample shows the generated XML form code:
<form name="New Folder">
<field name="name" displayname="Name" required="true" />
<field name="description" displayname="Description" />
</form>
The createActionDialog method takes this XML code as input and renders it as
HTML. The popupNewFolderDialog() function calls the popup method on the
dialog box instance. This displays the dialog box to the user.
The associated action argument specifies a given script to execute on the server. To
compare it to a function call, the newfolder.xml argument is similar to the API
function name; the rest of the URL is similar to the argument list. This creates a
request object suitable for submission to the XML loader.
Up to this point, all operations are on the client side. The XML loader is the module
that submits requests to the server. Teamcenter allows only a single logical request
to be active at a time with a blocking and queuing mechanism because Web users
prefer to avoid multiple requests, even though JavaScript is inherently threaded
and the Teamcenter pool manager can queue multiple requests and serialize them
on the server side.
If the new folder cannot be created, an errorstack message is returned with the
XML code of the error stack.
After the message is sent, the server script completes and the TcScript process
signals its availability to perform another query.
Basic customization
Basic thin client customization tasks include customizing the menus, style sheets,
and icons.
Tip
A free Firefox add-on called Firebug is especially useful. The three most
useful features are:
• Net
View the HTTP requests and responses.
• Console
View the in-page XMLHTTPRequest (XHR) calls and the XML
responses.
• Script
Debug your JavaScript.
Top-level pages
Top-level pages are Teamcenter Web requests that are returned within an HTML
wrapper. Every Teamcenter Web application, such as My Teamcenter and Structure
Manager, has a top-level page that initializes the client. Most actions do not
depend on how the browser achieves this initial state. After the top-level page
loads, subsequent actions within the page, such as tree expansions and dialog box
instantiations, result in requests for XML that are handled within the page. The
initial HTML returned consists of the following:
• JavaScript files to cache on the client (client-side components)
• In-page JavaScript for rendering the current page from the Teamcenter data
XML
• XML menus
• Another data island containing the XML description of the static forms worth
caching on the client
To see the HTML code, view the browser source for one of the pages. Most HTML code
is generated by the TC_ROOT\web\htdocs\tc\common\head.ish file. If you
need to include common HTML elements across the entire HTML layout, add them
to the TC_ROOT\web\htdocs\tc\custom\custom_head.ish file. The in-page
JavaScript contains an onLoad() function initiated by the browser onLoad event.
This function renders the Teamcenter XML data island as displayable HTML code.
Directory structure
There are two kinds of files: static and dynamic.
Static files are consumed directly and cached by the browser. These include .js
files, image files (.gif, .jpg, and .png), some static .xml files for menus (all in
the intl directory), and .css files. You choose the thin client staging directory
(staging_location) during the J2EE Web tier installation.
For more information, see the Installation on Windows Servers Guide. You can
find JavaScript files in the subdirectories of the staging_location\webapp_root
directory.
For example, the formrender.js file is located in the
staging_location\webapp_root\teamcenter\dhtml\common directory. The
following table shows the directories that contain the various types of static files.
Dynamic files are written in the TcScript language and interpreted at run time by
the tcserver process. They have .xml, .isx, .ish, .html, and .is extensions and
reside in the TC_ROOT\web\htdocs\tc directory. The directory for dynamic files
is created when Teamcenter is installed. The following table shows the directories
that contain the various types of dynamic files.
Customization recommendations
When customizing Teamcenter, put as much of your customization into the core code
and as little into the user interface as possible. If your installation uses multiple
interfaces, this minimizes duplication. Also, use simpler configuration and tailoring
techniques before using custom code.
Whenever possible, avoid making changes to existing source files. Instead,
create new custom JavaScript files for implementing new functionality under the
staging_location\webapp_root\teamcenter\dhtml\custom directory. When
including custom JavaScript files (for example, custom_form1.js), add them to the
TC_ROOT\web\htdocs\tc\custom\custom_head.ish file (shown in following
code sample) instead of the head.ish file:
print ’<script type="text/javascript"
src="teamcenter/dhtml/custom/custom_form1.js"></script>’ + NL
If you do this, you do not need to merge the old and new head.ish files when you
apply a maintenance patch or upgrade to a new version.
Deploying changes
In the thin client, files are either static or dynamic:
• Static files are deployed in the Web tier and are consumed directly and cached by
the browser. These files include JavaScript (.js), images (.png, .gif, .jpg), a few
static XMLs for menus under the intl directory, and cascading style sheets (.css).
To deploy static file changes to the thin client, regenerate the tc.ear file
using the Web Application Manager, and deploy the updated file to your Web
application server.
• Dynamic files are written in TcScript, used only on the server, and interpreted
at run time by the tcserver process. These files have .xml, .isx, .ish, .html,
and .is extensions.
To deploy dynamic file changes, restart your tcserver process to pick up changes.
2. Regenerate the tc.ear file and deploy in the application server domain.
2. Restart your tcserver process to pick up changes. Either restart the pool
manager or log off Teamcenter and log on again. You can avoid this step by
setting the TC_WEB_NO_CACHE environment variable to TRUE.
For more information, see Customizing Teamcenter with TcScript.
Preference Definition
CR_allow_alternate_procedures Determines if only assigned processes are
permitted.
ECM_delivered_engine_status Defines the status used on delivered
engine changes.
Preference Definition
ECM_form_relation Specifies the relation by which EC forms
are attached to the EC.
EPM_adhoc_signoffs Enables or disables ad hoc signoff.
WEB_auto_assign_ds_id Determines if dataset IDs are
auto-assigned.
WEB_core_help_server Sets the URL location of the general
Teamcenter help collection; it is used
to create the Help→General Collection
menu command.
WEB_dataset_shown_relations Controls the contents displayed on the
Dataset page (for example, show reference
objects and show multiple file versions).
WEB_dataset_upload_mode Sets the default dataset upload mode for
the site. Set to 0 if the dataset does not
need to be checked out to upload a file to
it (auto-checkout). Set to 1 if the dataset
must be checked out explicitly to upload a
file to it.
WEB_default_site_server Specifies the address of the Web server; set
this to generate visualization bookmarks.
WEB_displayed_new_menu_objects Defines the list of items in the New menu.
WEB_help_server Defines the URL location of the
Teamcenter Web help collection; it is used
to create the Help→Web Collection menu
command.
WEB_max_search_results Sets the maximum number of results to
show in the search page.
WEB_processes Defines the EPM processes to be listed
from the Web (if not set, processes are not
filtered).
WEB_protocol Sets the protocol used by the Web server
(default is http:\\).
The following table contains important preference that affect visualization in the
thin client.
Preference Definition
SecondaryVMUDatasets Lists the non-VMU dataset types that could
contain VMU datasets.
VMU_Datasets Visualization dataset types that should be
launched using VMU.
Preference Definition
VMU_FileSearchOrder Defines the valid named reference types for
VMU datasets.
• ui-core.css
Defines core widget styles, including styles for page header, layout, and
multicolumn support.
• yui-core.css
Defines core widget styles for fonts, grids, containers, resize components, data
tables, menus, layout manager, tab views, and tree views.
Common changes such as font sizes, colors, and background colors are achieved by
modifying the skin.css file. For example, the default style for the top menu bar
menus defined in the following code examples from the skin.css file:
.siemens-skin .yuimenuitemlabel {
color: #000000;
cursor: default;
font-size: 85%;
padding: 0 15px 0 7px;
text-decoration: none;
And:
.siemens-skin .yuimenu .bd
background-color: #EFEFEF;
border: 1px solid #808080;
The following figure shows the menu using the CSS in the previous code examples.
Default menu
To change the background color of the menu to red and to change the font, set the
style in CSS as shown in the following code examples:
.siemens-skin .yuimenuitemlabel {
color: #000000;
cursor: default;
font-size: 100%; // font size increased
font-weight: bold; //added style for bolder text
padding: 0 15px 0 7px;
text-decoration: none;
And:
.siemens-skin .yuimenu .bd
background-color: #DD6464; // changed to reddish
border: 1px solid #000000; //changed to black
Customized menu
Menu system
The menus and left-hand navigation (LHN) toolbar are configured using static XML
from the Web tier. The top menus retain the contextual actions (application or
selection context specific). There is one menu for each application or top-level page.
The LHN provides a consistent location for a simple set of context-free actions. The
LHN is consistent throughout the applications. There are three basic types of actions:
• Navigate to a new URL, either replacing the current page or opening a new
browser (for example, go to the Home folder).
• Execute an action within the current page (for example, clipboard actions).
The behavior of all three types may depend on the current selection within the tree,
though the default LHN actions generally do not. The menu XML files are in the
staging_location\webapp_root\teamcenter\dhtml\common\intl\language
directory. There is one LHN definition file (toolbar.xml) and one top-level menu
definitions file for each application (applicationmenu.xml). For example, the
following code from the wsomenu.xml file renders the menu in the following figure:
<menu type="Connection" title="Connection">
<menuentry ID="Revisable" title="Revisable..." key="newPSConnectionAction"
url="javascript:popupNewBusinessObject(’PSConnection’, true, false);"
image="teamcenter/dhtml/icons/PSConnection.png"/>
<menuentry ID="Non-Revisable" title="Non-Revisable..."
key="newGDELinkAction" url="javascript:popupNewBusinessObject(’GeneralDesignElementLink’,
true, true);" image="teamcenter/dhtml/icons/GeneralDesignElementLink.png"/>
</menu>
• key
Specifies the name used for menu entry suppression configuration.
• url
Specifies the URL or arbitrary section of JavaScript.
Note
The menu style is controlled by a CSS style sheet. The LHN uses different
tags with similar attributes in the toolbar.xml file.
For more information, see Cascading style sheets (CSS).
To deploy menu changes, regenerate the .ear or .war files.
For more information, see Deploying changes.
To make changes across an entire site, you can manually add, remove,
or modify menu commands by editing the *menu.xml files in the
staging_location\webapp_root\teamcenter\dhtml\common\intl\language
directory.
With the target attribute set, if you return to the browser displaying your Home
folder and choose Help→Web Collection again, the already opened help browser is
displayed. The target attribute is used only if the menu command is listed in the
WEB_menu_entry_new_window preference; otherwise it is ignored.
Customizing menus
To add common menus commands to all applications, add the menu
details in the custom_menu_additions.xml file found in the
staging_location\webapp_root\teamcenter\dhtml\intl\language directory.
Custom menu files are defined for each application. For example, the standard menu
file for the My Teamcenter application is wsomenu.xml, and the custom menu file is
wsomenu_custom.xml. If you add menu commands to the wsomenu_custom.xml
file, those menu commands are rendered.
The action attribute in the menu node of the XML code defines the behavior. If the
action attribute value is replace, the entire menu is replaced. If the value is add
or the attribute is not defined, the menu commands are added to the existing menu.
To add custom menu commands in all applications, define the commands in the
custom_menu_additions.xml file. Custom static menu files take precedence over
standard static menu files.
Note
To deploy the changes, regenerate the .ear or .war files.
For more information, see Deploying changes.
4. Regenerate the tc.ear file using the Web Application Manager, and deploy the
updated file to your Web application server.
When you open the New menu, the custom business object is displayed.
Note
When you add a new business object icon, add it in the PNG format.
For instructions about changing business object icons in the rich client, see the
Business Modeler IDE Guide.
Customizing forms
Forms can be customized in the following ways:
• XML rendering template (XRT)
For more information, see Using style sheets.
You can customize Teamcenter forms in many ways. A general strategy is to put as
much of your customization into the core and as little into the user interface as
possible. If your site uses multiple interfaces, as most do, you minimize duplicated
effort. Some custom forms can be done completely in the core and are inherently
supported by all Teamcenter interfaces. Other customizations require user interface
effort, particularly forms with specialized display or interaction requirements.
Forms are used to store information. You can create a class with the required
attributes and create a form based on the class. When you click a form object in the
thin client, a request is sent to the Teamcenter server to retrieve the form object
attributes, fields, and their values. Response XML code is sent to the client with
the details. The XML is parsed to get the field details and render them as various
components.
The following are the data types and components supported by forms:
Multiple choices –
buttons
• On the client, the XML code is transformed by removing the custom nodes and
integrating with the standard form XML.
• While rendering, the attributes in <custom> field nodes are given preference
when the same set of nodes exist in the standard form XML.
The resulting XML code looks like the following on the server side:
<form>
<field name=attr1 …></field>
<field name=attr2 …></field>
<field name=attr3 …></field>
<custom>
<field name=attr3 ….><lov>values…</lov></field>
<field name=attr4 ….></field>
</custom>
</form>
After transformation on the client, the XML looks like the following:
<form>
<field name=attr1 …></field>
<field name=attr2 …></field>
<field name=attr3 ….><lov>values…</lov></field>
<field name=attr4 ….></field>
</form>
Overriding parameters
Several characteristics summarize Teamcenter dialog boxes.
These characteristics are factored and parameterized as
arguments to the createActionDialog() function in the
staging_location\webapp_root\teamcenter\dhtml\common\actiondialog.js
file. The arguments are:
• actionCall
• actionScript
• applyButton
• formNode
• numCols
• renderer
• resizable
• takeSelection
These parameters are not listed in the order they are used. To better understand
their usage, think about them in the order they are used. The formNode,
applyButton, resizable, numCols, and renderer parameters are used for creating
the form. Then, on submission, the actionCall function is called, which uses the
takeSelection parameter and makes a request to the server file, actionScript.
You can override these parameters by initializing new values in a special
multidimensional associative array called globalCustomDialogType. Additionally
in this file, you must define any new functions you mention in the renderer or
actionCall parameters.
You do not need to initialize parameters to their default values; you only need to set
the ones you want to override.
In section 1 of the customform.js file, add a new parameter array to
globalCustomDialogType, keyed by the type name. For each parameter you want
to override, add the value to the parameter array, keyed by the parameter name. An
example is shown in the following figure.
In section 2, if you are overriding renderer or actionCall, define your new
functions. Your new renderer is passed two parameters automatically: the DOM
reference to the XML dialog node and the DOM reference to the div table the dialog
box is created in. Therefore, your renderer should accept two inputs. Your new
actionCall does not take any arguments. An example is shown in the following
code example:
/ SECTION 1 //
// create and initialize associative arrays
// associative area of custom dialog types and renderers
var globalCustomDialogType = new Array(); //instantiate global array
// instantiate inner arrays for any dialog types you want to override here...
// remark form example:
globalCustomDialogType[ "remark form" ] = new Array();
// parameter array for "remark form" type
//note no quotes
// SECTION 2 //
// define your renderer here
// example:
// Of course calling processFORM is exactly what you do not want to
// actually do because this renders your form XML using our default renderer.
// But you could use this skeleton to test that you have hooked everything
// up properly.
function mightyMightyActionCall()
{
alert( "Call successful" );
}
// create the dialog box title and also the header rows within the tbody
// table thead tr
row = dialog.headtable.firstChild.firstChild;
row.firstChild.innerHTML = irmFormNode.getAttribute( "name" );
row = document.createElement( "tr" );
tbody.appendChild( row );
var column1 = document.createElement( "td" );
var column2 = document.createElement( "td" );
var column3 = document.createElement( "td" );
var column4 = document.createElement( "td" );
row.appendChild( column1 );
row.appendChild( column2 );
row.appendChild( column3 );
row.appendChild( column4 );
row.modifiable = true;
column1.innerHTML = irmFormNode.firstChild.getAttribute("displayname");
column1.name = irmFormNode.firstChild.getAttribute( "name" );
var input = document.createElement( "input" );
input.type = "text";
input.value = irmFormNode.firstChild.getAttribute( "value" );
column2.appendChild( input );
column3.innerHTML = irmFormNode.firstChild.nextSibling.getAttribute("displayname");
column3.name = irmFormNode.firstChild.nextSibling.getAttribute( "name" );
if ( table.takeSelection )
{
if( table.takeSelection == ’top’ )
{
request += "&parent_uid=" + getTopLine().iman_parent_uid;
}
else
{
request += "&parent_uid=" + firstSelectedRowOrTopLine().iman_parent_uid;
this.url = request;
this.dialog = getDialog(table);
this.callback = updateCallback;
this.popDownOnSuccess = popDownOnSuccess;
}
Write TcScript
TcScript has its own structure and command syntax, but its most important
characteristic is that it has a binding layer to Teamcenter ITK. You must be familiar
with ITK to develop TcScript. For further information and examples using TcScript,
see the existing code. One broad end-to-end example is described in Generating
a thin client page.
TcScript sections of pages are interpreted by the thin client. To identify these
sections, you must enclose TcScript in <script> tags. In this particular example, the
entire file is written in TcScript.
1. Begin with the following line:
<script type="text/IMAN">
2. Include useful TcScript helper functions using paths relative to the htdoc root
directory:
include ’common/basic.isx’
include ’actions/relations.isx’
include ’actions/update.isx’
4. Make the first ITK call. Most ITK functions are available in TcScript.
POM_place_markpoint( ’mymark’ )
This function places a mark point in the database that you can roll back to if
anything goes wrong.
TcScript supports try/catch blocks. This makes error handling much simpler.
Instead of checking the return value of each ITK function, wrap anything that
could potentially fail in a try block and handle the potential error in the catch
block.
6. Add the first comment. Use the hash (#) character to denote TcScript comments.
# Must have a name....
Note that the quotation marks are single quotation marks. Always use single
quotation marks in TcScript to denote string literals. If no name is supplied, an
error is stored on the stack and thrown directly to the catch, skipping the lines
in between.
8. Split the parent_uid argument in two. This parent_uid is the Teamcenter UID
(or tag) of the line selected as the insertion point for the new item concatenated
with the relation type UID (tag). Thin client UIDs are Web-safe versions of
tag_t. The UID and tag_t are essentially the same, because the conversions
are handled in the bindings to the ITK. Therefore, they are referred to as tags.
The ITK output parameters are passed as literals. This is synonymous with
passing a pointer.
WEB_decompose_double_tag( parent_uid, ’parent’, ’relation’ )
10. Call ITK to validate or create them, and then handle the response.
USER_validate_item_rev_id (item_id, rev_id, _type, ’modified_item_id’,
’modified_rev_id’, ’status’)
# USER_invalid_id -- reject
# USER_valid_id -- create as given
# USER_override_id -- create as modified (silent change, for example,
# for case conversion)
# USER_modified_id -- may create as given, has returned a better version
if status == ’USER_invalid_id’
then
# Failed to create item -- invalid id supplied
EMH_store_error( 1, 63080 )
throw ’error’
elif status == ’USER_override_id’
then
if modified_item_id != ’’
then
item_id = modified_item_id
endif
if modified_rev_id != ’’
then
rev_id = modified_rev_id
endif
11. Call the ITK to create the item. The newItem and newRev tags are set as
output.
# create the item with default rev id
ITEM_create_item( item_id, _name, _type, rev_id, ’newItem’, ’newRev’ )
12. Set the description for the item and revision and save them.
WSOM_set_description( newItem, _description )
WSOM_set_description( newRev, _description )
AOM_save( newRev )
AOM_save( newItem )
AOM_refresh( newRev, 0 )
AOM_refresh( newItem, 0 )
14. If there are no ITK errors or a thrown error, you can assume success and can
send an XML message to the browser asking for the parent line to be refreshed
(in case any displayed properties have changed) and for the new item to be
inserted into the tree.
This message is discussed in more detail in Processing on the Teamcenter server.
print ’<update>’
+ RefreshUpdate( WSOLine( parent ) )
+ InsertUpdate( parent_uid, WSOLine( newItem ) )
+ ’</update>’
15. Delete the mark point because yo do not need to roll back.
POM_forget_markpoint( mymark )
If a thrown error was caught, you roll back to preserve the all-or-nothing nature
of the transaction.
16. Add a contextual error message to the stack and print the XML error stack. This
function is defined in the basic.isx file.
catch error
POM_roll_to_markpoint( mymark, ’stateChanged’ )
EMH_store_error( 1, 63009 )
print ErrorStack( ’’ ) + NL
17. Close the try block with an endtry statement and close the script tag. This
concludes the script. The XML message sent to the client is interpreted.
endtry
</script>
Values
TcScript requires the use of specific values in the following elements:
• Types
• Strings
• System constants
• Variables
• Reserved variables
Types
Type Definition
Array Array of TcScript values of any type
Date Teamcenter date
Integer Integer number
Logical Logical or Boolean value (TRUE or FALSE)
Object Teamcenter object (in other words, a Teamcenter tag)
String Literal text string
In most cases, the value type is not relevant to the author of a Teamcenter Web
page because TcScript automatically converts values to a suitable type in the ITK
bindings. There is one exception: the string to integer conversion. All HTTP
arguments are strings, so if you have &index=22 in your URL, the variable index is
set to the string 22 in your TcScript environment. If you then need this value as an
integer to pass to ITK, you must explicitly convert it using the WEB_string_to_int
ITK function.
Strings
String literals are enclosed by single quotation marks. All whitespace (including new
lines) between the quotes is included verbatim in the string. For example:
String Description
’hello world’ Literal text string
" Empty string
’ New line character
’
’<table> Literal segment of HTML
<tr>
<td>NW</td>
<td>NE</td>
</tr>
<tr>
<td>SW</td>
<td>SE</td>
</tr>
</table>’
System constants
Constants Definition
EMPTYARRAY Empty array
FALSE Logical value false
NL Literal new line
NULLTAG Object value representing a Teamcenter NULLTAG
TRUE Logical value true
Variables
Values can be assigned to a variable. For example:
id = IMAN_user.user_id
The variable id is created automatically if it does not exist before the assignment.
The variable can then be used or reassigned throughout the rest of the page.
Array variables can be assigned in requests as follows:
selection[0]=a&selection[1]=b
This creates an array selection with two elements in it. This array notation is only
valid in requests. TcScript does not have a mechanism for dereferencing particular
elements of an array. Instead, arrays are generally looped through incrementally. In
TcScript, arrays can be formed using the :: concatenation operator. For example:
selection = a :: b
Reserved variables
The following metavariables are defined by TcScript. Their values are set
appropriately immediately before each page is processed:
Metavariable Definition
IMAN_user Current user’s tag
IMAN_role Current user’s role tag
IMAN_group Current user’s group
IMAN_config_rule Current configuration rule tag
IMAN_site_name Name of the site
MANGLED_QUERY Query with standard mangling (to allow POST/GET)
QUERY Page query tag
TC_VERSION Teamcenter version string
Operators
TcScript includes the following types of operators:
• String operators
• Integer operators
• Array operators
String operators
The only string operator in TcScript is the concatenation operator (+). This operator
converts its left and right hand operands to strings and concatenates them.
Integer operators
TcScript does not implement any mathematical functions directly. To perform
addition, subtraction, multiplication, or division of TcScript integers, call the
WEB_arithmetic ITK function:
WEB_arithmetic( num_left, op, num_right, output )
• –
• *
• \
For example:
index = 0
WEB_arithmetic( index, ’+’, 1, ’index’ )
Array operators
There are four specialized TcScript functions for manipulating arrays:
• LENGTH
• REVERSE
• SORT
• SPLICE
• dates
{ ’05-Apr-1998’, ’23-Nov-1997’,’17-Jun-1998’ }
LENGTH
The LENGTH function returns the number of elements in an array. For example:
Example Result
LENGTH( animals ) ’3’
REVERSE
The REVERSE function reverses a list. For example:
Example Result
REVERSE( dates ) { ’17-Jun-1998’, ’23-Nov-1997’, ’05-Apr-1998’ }
SORT
The SORT function sorts a list by a specified property. The syntax is:
SORT( array, criterion )
The criterion argument is a string value giving the name of the property by which
to sort the array: For example:
Example Result
SORT( birthdates, { { ’henry hamster’, ’23-Nov-1997’ },
{ ’laura lion’, ’05-Apr-1998’ },
’individual’ ) { ’vicky vicuna’ , ’17-Jun-1998’ } }
SPLICE
The SPLICE function splices two lists together, returning a single array of objects.
The syntax is:
SPLICE( list1, name1, list2, name2 )
The list1 and list2 arguments have equal lengths. The nth object in the returned
array is a pair of the nth element of the first list, and the nth element of the second
list. The first and second elements of each pair can then be accessed by the name1
and name2 field names, respectively. This provides a mechanism for constructing a
multi-dimensional array from HTTP name/values pairs. The SPLICE function is
rarely used but allows simultaneous iteration over two arrays. Note that several of
the data functions such as FORM and QUERYFIELDS effectively return SPLICE
lists. The following example shows iterating over a SPLICE array. Let birthdates
be SPLICE( animals, ’individual’, dates, ’day’ ). The value of birthdates can
be represented as:
{ { ’laura lion’, ’05-Apr-1998’ },
{ ’henry hamster’, ’23-Nov-1997’ },
{ ’vicky vicuna’ , ’17-Jun-1998’ } }
The following code lists out the animals and their birthdays:
for birthday in birthdates
print <br>
next
The SPLICE3 function is similar to the SPLICE function. It splices three lists
together, returning a single array of objects. The syntax is:
SPLICE3( list1, name1, list2, name2, list3, name3 )
• Specialized TcScript
• Helper functions
Helper functions are written in TcScript and access Teamcenter data using one of
the standard methods, so they are not described. They are used only to conveniently
wrap these methods behind a layer of abstraction. Additionally, Teamcenter data
can be accessed using properties.
Calling ITK
ITK is the preferred method for accessing Teamcenter data in TcScript. Most ITK
functions can be called from TcScript. The function returns a logical value TRUE
or FALSE depending on whether it succeeded or not; errors must be handled by
examining the error stack.
For simplicity in this create folder example, the return value is checked explicitly.
The try/catch block is preferred.
name = ’my folder’
if( FL_create( name, ’my generic description’, ’newFolder’ ) )
then
AOM_save( newFolder )
endif
You can pass the string, object, array of objects, integer, date, and logical input
arguments directly into the ITK function. Input arguments, if defined earlier, should
be referred to in the ITK call without quotation marks. You can also pass an input
argument as a value; in the case of a string, use single quotation marks as shown in
this example. Output arguments are returned by passing the name of a variable as a
string; when the function completes, the output value is set to this variable. In this
example, the newFolder variable is not defined yet and therefore mentioned as a
string within single quotation marks. When the function completes, the newFolder
variable is set to the value of the folder tag.
All memory management issues involving output arguments are handled
automatically by TcScript. Most enum values can be passed in as literal strings.
ITK structure types are not supported.
Properties
Given a Teamcenter object in TcScript, you can access any property of the object
(including any user-defined properties) with the . operator. The syntax is:
objectName[.attr]+
Functions beginning with the WEB_ prefix are a special class of ITK implemented
to perform specific functions for the thin client. They are treated exactly like
standard ITK. They should only be used in cases where standard ITK functions do
not provide the needed capability. The string functions can be used with only a
small amount of data.
Function Description
WEB_arithmetic Performs mathematical operations like +, –, *, and \.
WEB_compare Used to compare numbers.
WEB_string_to_int Converts a string to an integer.
LOG function
The LOG function is a useful debugging tool to keep data and debugging separate.
For example:
my_val = ’blue’
LOG( ’the sky is ’ + my_val + NL )
g. Click Next.
TC_ROOT\sample
3. Open the user_web.c file and follow the directions in the commented text.
Statements
TcScript statements include for, if, include, and def\enddef.
for
The for statement is used to iterate over an array. The syntax is:
Each value in an array is assigned to variable in turn, and body is processed for
each value.
if
The syntax of the if statement is:
if cond
then
# body
[ elif cond then body] *
[ else body ]
endif
The body segment can be any arbitrary set of TcScript statements, and cond is
a logical expression. Logical expressions can contain logical variables, logical
operators, and parentheses.
The binary logical operators are of the form: lvalue op rvalue, where op is one of
the following:
• and
True if lvalue and rvalue are both true.
• or
True if lvalue or rvalue is true.
• ==
True if lvalue is equal to rvalue.
• !=
True if lvalue is not equal to rvalue.
• isa
True if lvalue is an instance of the class defined by rvalue.
• hasa
True if rvalue is the name of a valid property of the object defined by lvalue.
The and and or operators use short circuit evaluation; that is, rvalue is not evaluated
if the final value of the expression can be established by only evaluating lvalue.
The only unary logical operator is not, which negates the value of its argument. The
precedence of the operators in decreasing order is:
1. ==, !=, isa, hasa
2. not
3. and
4. or
Note
The optional elif keyword often simplifies complex if statements.
include
The syntax of the include statement is:
include ’filename’
The filename argument is the full file name of another thin client page relative to
the document root. The included page is interpreted in line, as if it were textually
inserted into the including page. This means that the included page must not have
<script> tags.
def/enddef
This statement is used to define your own functions in TcScript. The syntax is:
def saveWorld( world )
# do stuff here
saveWorld = TRUE
enddef
Note that enddef has two ds. Also note that a value can be retuned by setting it
equal to the function name, as illustrated in the syntax.
Error handling
The easiest way to manage error handling in TcScript is to use try/catch statements.
The syntax for a typical case looks like the following:
# print my header (document type, encoding)
print XMLDefaultHeader()
# potentially place a DB mark point
POM_place_markpoint( ’mymark’ )
try
output = ...
# perform some ITK functions
...
output += ...
...
print output
catch error
# potentially rollback to markpoint
POM_roll_to_markpoint( mymark, ’stateChanged’ )
# potentially add contextual error to stack
EMH_store_error( 1, 63xxx )
# print error stack
print ErrorStack( ’’ ) + NL
endtry
This format is convenient because you do not have to check every return code at
every potential point of failure. Instead, a block that includes n points of failure can
be wrapped between the try and catch statements. Any error within that block
halts execution of the try block statements and jumps to the catch block. If ITK
fails, it puts its own error on the stack; it is still useful to add your own error for
context. Another important point is that no output is printed to the client until
the last point of failure is passed. This is done by building up the response as a
variable (output in this case). This allows two possible responses: success (in the
form of some XML to be rendered), or failure (in the form of an XML error stack to be
rendered). You generally do not want to mix the two responses. If you are building
an HTML response, this is not as important because most browsers are tolerant
of broken HTML. However, if you are building an XML response, it is important
because XML parsers are not tolerant of broken XML. Therefore, in the thin client
interface, most requests return either success or failure and nothing in between.
Teamcenter errors
Teamcenter errors can be caused by property access, saved query execution, or any
TcScript or ITK function call.
ERRORS
The ERRORS function returns an array representing the current state of the
Teamcenter error stack. The information is returned as an array of errors, where
each error has three pseudo-properties: the ifail integer, the error text message,
and the severity integer. The syntax is:
ERRORS()
More conveniently, you can call the TcScript helper functions that wrap this call,
defined in the TC_ROOT\web\htdocs\tc\common\basic.isx file. The most
common is:
ErrorStack( text )
It takes a contextual text message as input and returns the error stack as XML. The
contextual message is displayed to the user, but it is not added to the Teamcenter
error stack. If you opt to add a contextual error to the stack before displaying the
error, you would typically pass an empty string as input.
Two similar functions of limited use are alertErrorStack(text) and
HTMLErrorStack(text). The alertErrorStack function wraps the error stack
with some alert display logic, while the HTMLErrorStack function returns the
stack in displayable HTML. This is used with top-level page errors where there is no
guarantee that the error stack rendered is available on the client side.
CLEARERRORS
The CLEARERRORS procedure clears the Teamcenter error stack. The syntax is:
CLEARERRORS()
This procedure is useful if there are specific errors you want to handle. If you know
a particular ITK function may return an error you can recover from or handle
non-fatally, wrap that function in its own try block. This usually means that you
have nested try statements. In the catch section of the inner try statement, you
attempt to handle the error. If successful, call CLEARERRORS and continue. If
unsuccessful, use the throw statement to jump to your outer catch section. Another
useful helper function in this case is throwIfErrorNotArray (see the basic.isx
file).
car
DESCRIPTION
Returns the first element of an array.
SYNTAX
car( list )
ARGUMENTS
• list
Array.
RETURN
VALUE
Returns the first element of the array.
Class
DESCRIPTION
Returns the name of the Teamcenter class of an object.
SYNTAX
Class( object )
ARGUMENTS
• object
contains
DESCRIPTION
Checks whether list contains value.
SYNTAX
contains( list, value )
ARGUMENTS
• list
Array that may have the specified value.
• value
Value to look for.
RETURN
VALUE
Returns either true or false.
ErrorStack
DESCRIPTION
Returns the error stack details in XML format.
SYNTAX
ErrorStack( text )
ARGUMENTS
• text
Contextual text message.
RETURN
VALUE
Returns the error stack as XML.
HTMLDefaultHeader
DESCRIPTION
Returns a header appropriate to an HTML document including a localized encoding
string. Encoding string comes from the UID string table.
SYNTAX
HTMLDefaultHeader()
ARGUMENTS
None.
RETURN
VALUE
Returns an HTML header string.
HTMLErrorStack
Description
Returns XML with the error messages; used for potential top-level page errors.
Syntax
HTMLErrorStack( text )
Arguments
• text
Contextual text message.
Return value
Returns the error stack as XML.
imanText
DESCRIPTION
Returns a localized Teamcenter string from the UID table.
SYNTAX
imanText( key )
ARGUMENTS
• key
Teamcenter key string.
RETURN
VALUE
Returns the localized Teamcenter string from the UID table.
Message
DESCRIPTION
Returns the message in XML format. The Teamcenter Web renderer knows how to
renderer this XML format into a user message.
SYNTAX
Message( text )
ARGUMENTS
• text
Message string to be displayed.
RETURN
VALUE
Returns an XML-formatted message.
Preference
DESCRIPTION
Looks up multivalued preferences.
SYNTAX
Preference( pref, scope, optional )
ARGUMENTS
• pref
Name of the option to retrieve.
• scope
One of the following strings depending on the desired search scope:
o TC_preference_all
o TC_preference_user
o TC_preference_role
o TC_preference_group
o TC_preference_site
• optional
Whether or not to display an error if the preference cannot be found in the
database. Set to TRUE or FALSE.
RETURN
VALUE
Returns an array of preference values.
quote
DESCRIPTION
Escapes special XML characters within a string.
SYNTAX
quote( unquoted )
ARGUMENTS
• unquoted
String to be quoted.
RETURN
VALUE
Returns the XML-safe representation of the string.
quoteImanText
DESCRIPTION
Returns a localized Teamcenter string from the UID table encased in quotation
marks.
SYNTAX
quoteImanText( key )
ARGUMENTS
• key
Teamcenter key string.
RETURN
VALUE
Returns a localized and quoted Teamcenter string from the UID table.
removeArrayElement
DESCRIPTION
Removes the given element from the array.
SYNTAX
removeArrayElement( element, list )
ARGUMENTS
• element
Element to remove.
• list
Array that contains the element.
RETURN
VALUE
Returns the modified array.
replaceArrayElement
DESCRIPTION
Replaces the specified element of an array with the new element.
SYNTAX
replaceArrayElement( oldElement, newElement, list )
ARGUMENTS
• oldElement
Existing element of the input array.
• newElement
New element to replace the existing element.
• list
Array with element to be replaced.
RETURN
VALUE
Returns the modified array.
replaceChar
DESCRIPTION
Replaces a character in the string with another character.
SYNTAX
replaceChar( string, oldchar, newchar, front )
ARGUMENTS
• string
Input string.
• oldchar
Existing character in the input string.
• newchar
New character to replace existing character.
• front
Empty string as ”.
RETURN
VALUE
Returns the modified string.
replaceString
DESCRIPTION
Replaces a substring in the string with another substring.
SYNTAX
replaceString( string, oldstring, newstring )
ARGUMENTS
• string
Input string.
• oldstring
Existing string in the input string.
• newstring
New string to replace existing string.
RETURN
VALUE
Returns the modified string.
SetPreference
DESCRIPTION
Sets values to the preference
SYNTAX
SetPreference( pref, index, prefValue, scope )
ARGUMENTS
• pref
Name of the option to set.
• index
Length of the array.
• prefValue
Array of values to be set.
• scope
One of the following:
o TC_preference_all
o TC_preference_user
o TC_preference_site
o TC_preference_role
o TC_preference_group
RETURN
VALUE
None.
SinglePreference
DESCRIPTION
Looks up options (preferences) indirectly from the .tc_env file.
SYNTAX
SinglePreference( pref, scope, optional )
ARGUMENTS
• pref
Name of the option to retrieve.
• scope
o TC_preference_all
o TC_preference_user
o TC_preference_role
o TC_preference_group
o TC_preference_site
• optional
Whether or not to display an error if the preference cannot be found in the
database. Set to TRUE or FALSE.
RETURN
VALUE
Returns the preference value.
startsWith
DESCRIPTION
Checks if a string starts with a substring.
SYNTAX
startsWith( str, subStr )
ARGUMENTS
• str
Input string.
• subStr
Substring to check.
RETURN
VALUE
Returns either TRUE or FALSE.
throwIfErrorNot
DESCRIPTION
Either rethrows your error or clears it depending on whether or not it is in your
expectedValues array.
SYNTAX
throwIfErrorNot( caughtError, expectedValue )
ARGUMENTS
• caughtError
Input to the catch block.
• expectedValue
Value to compare with caughtError.
RETURN
VALUE
Returns an error if caughtError is not the expectedValue.
throwIfErrorNotArray
DESCRIPTION
Either rethrows your error or clears it depending on whether or not it is in your
expectedValues array.
SYNTAX
throwIfErrorNotArray( caughtError, expectedValues )
ARGUMENTS
• caughtError
Input to the catch block.
• expectedValues
Array of error codes to suppress.
RETURN
VALUE
Returns an error if caughtError is not in the expectedValues array.
tokenize
DESCRIPTION
Divides the input string into tokens using separator.
SYNTAX
tokenize( input, separator )
ARGUMENTS
• input
Input string.
• separator
Character to use as a separator.
RETURN
VALUE
Returns an array of tokens.
XMLDefaultHeader
DESCRIPTION
Adds a header appropriate to an XML document. The encoding string comes from
the UID string table.
SYNTAX
XMLDefaultHeader( )
ARGUMENTS
None.
RETURN
VALUE
Returns a header appropriate to an XML document including a localized encoding
string.
A Glossary
A Glossary
AIF
See Application Integration Framework (AIF).
class
Set of objects that share the same list of attributes but distinguishable by the value
the attributes acquire for specific objects. For example, the Automobile class can be
defined by the brand, color, and price, but each car associated to the Automobile
class has a different brand, color, and price combination.
class hierarchy
Structure defining subclasses that inherit the attributes of their superclasses, also
called their parents or ancestors.
Client
Role played by a software component of a system when it requests particular services
be performed on its behalf by another entity, a server. See also server.
client tier
Teamcenter architectural tier that comprises the Teamcenter clients, Teamcenter
integrations with third-party applications, and the third-party applications
associated with the integrations.
corporate server
Host computer at the center of a Teamcenter network. This host contains the
Teamcenter application root directory, Teamcenter data directory, licensing, File
Management System (FMS), and volumes. For installations that include the Web
tier (four-tier architecture), the corporate server also contains the Teamcenter server
manager. Multiple application clients can map to or mount the corporate server.
form
Teamcenter workspace object used to display product information (properties) in a
predefined template. Forms are often used to create an electronic facsimile of a
hardcopy form in Teamcenter. See also master form.
four-tier architecture
Teamcenter architecture that includes four tiers: resource tier, client tier, Web tier,
and enterprise tier.
master form
Teamcenter workspace object used to display product information (properties) in
a predefined template. Master forms are used to display product information in
a standardized format.
My Teamcenter
Teamcenter rich client application that is the main access point for managing
product information. My Teamcenter provides the functionality for creating objects
in the Teamcenter database, querying the database for objects, checking in and
checking out objects, and managing tasks. Users can also open objects, automatically
launching the related application.
Each user has a personal My Teamcenter window that displays product information
as graphical objects. Although users share product information across the enterprise,
they organize this information individually in personal workspaces.
navigation pane
Rich client framework component that displays buttons of the applications available
for use in the rich client. Clicking the application button launches the application.
preference
Configuration variable stored in a Teamcenter database and read when a Teamcenter
session is initiated. Preferences allow administrators and users to configure many
aspects of a session, such as user logon names and the columns displayed by default
in a properties table.
properties
Keys and values that specify the configuration settings for an application in the
Teamcenter rich client.
properties file
File containing the attributes (keys and values) that specify how an application is to
behave in the Teamcenter rich client.
Registry Editor
Teamcenter application that enables editing Teamcenter rich client registry
files. This application is used only for editing registry files that are used for
internationalization, dynamic class invocation, and configuration in the rich client
framework.
registry file
Properties (.properties) file that contains the user-defined configuration settings
(keys and values) that are relative to how the application displays and performs
in the Teamcenter rich client. Each application registered in the rich client has a
.properties file known as a registry file.
rich client
Java-based user interface to Teamcenter installed on user workstations. The rich
client accesses Teamcenter databases using a remote or local server.
server
System software component that performs a specifically defined set of software
services on behalf of one or more clients. In a typical Teamcenter installation,
servers are centralized on dedicated hosts that support a large number of clients.
Clients are distributed on hosts connected to the servers via various networking
techniques. See also Client.
two-tier architecture
Teamcenter architecture that includes a resource tier and a client tier. The resource
tier comprises the database server and database. The client tier comprises the
Teamcenter rich client, third-party applications that integrate with the rich client,
and a local server. This architecture supports only the Teamcenter rich client.
Web Browser
Teamcenter application that provides access to Internet Web pages from within
the rich client framework. The Web browser is a rich client window that acts as a
Web browser, enabling you to navigate and view Web pages within the rich client
rather than switching to a separate Web browser. The Web browser also provides
the ability to access MIME (Multipurpose Internet Mail Extension) file types and to
view files created in other applications, such as Microsoft Word and Excel, through
the Web browser.
Workbench . . . . . . . . . . . . . . . . . . 3-251 F
ECM_delivered_engine_status
Files
preference . . . . . . . . . . . . . . . . . . . . . . 4-9
actions.properties . . . . . . . . . . . . . . 3-253
ECM_form_relation preference . . . . . . . . 4-9
com.teamcenter.rac.stylesheet.stylesheet_
Enabling rich client customization . . . . . 1-2
user.properties . . . . . . . . . . . . . 3-139
enddef TcScript function . . . . . . . . . . . 4-38
Organization conventions . . . . . . . . 3-181
endtry TcScript error handling
filesSelector extension point . . . . . . . . 3-159
statement . . . . . . . . . . . . . . . . . . . . . 4-38
Firebug . . . . . . . . . . . . . . . . . . . . . . . . 4-6
Environment variables
Firefox . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
IMAN_SDL_MAGIC . . . . . . . . . . . . . 4-40
fireSelectionEvent() method . . . . . . . . 3-254
TC_WEB_NO_CACHE . . . . . . . . 4-9, 4-27
firstcolumn XML element . . . . . . . . . . 2-64
EPM_adhoc_signoffs preference . . . . . . . 4-9
FL_create function . . . . . . . . . . . . . . . . 4-5
Errors . . . . . . . . . . . . . . . . . . . . . . . . 4-39
Font conventions . . . . . . . . . . . . . . . . 3-183
ErrorStack helper function . . . . . . . . . 4-41
for TcScript function . . . . . . . . . . . . . . 4-36
errorstack message . . . . . . . . . . . . . 4-5–4-6
Form content . . . . . . . . . . . . . . . . . . . 4-21
Examples
formrenderer.js file . . . . . . . . . . . . . . . . 4-4
AbstractDialog class . . . . . . . . . . . . 3-218
Forms . . . . . . . . . . . . . . . . . . . . . . . . 4-18
AbstractPopupButton code . . . . . . . 3-219
Abstract rendering . . . . . . . . . . . . . 3-132
AbstractProgressDialog
Automatic . . . . . . . . . . . . . . . . . . . 3-132
component . . . . . . . . . . . . . . . . 3-204
Comments . . . . . . . . . . . . . . . . . . . 3-147
GenericTableModel component . . . . 3-220
Customizing . . . . . . . . . . . . . . . . . 3-131
GroupPanel component . . . . . . . . . . 3-216
Definition . . . . . . . . . . . . . . . . . . . 3-131
HorizontalButtonLayout layout
Developing . . . . . . . . . . . . . 3-133, 3-141
manager . . . . . . . . . . . . . . . . . . 3-222
Developing using XML style sheets . . . 2-2
HorizontalLayout layout manager . . 3-228
Display components . . . . . . . . . . . . 3-149
IDE setup . . . . . . . . . . . . . . . . . . . . . 3-9
Displaying . . . . . . . . . . . . . . . . . . . 3-150
LOVDialog component . . . . . . . . . . 3-206
Events . . . . . . . . . . . . . . . . . . . . . 3-149
LOVPopupButton component . . . . . 3-207
JavaBean . . . . . . . . . . . . . . . . . . . 3-132
MessageBox component . . . . . . . . . 3-240
Performance issues . . . . . . . . . . . . 3-148
MLabel component . . . . . . . . . . . . . 3-241
Property display keys . . . . . . . . . . . . 2-26
MRUButton component . . . . . . . . . 3-209
Rendering . . . . . . . . . . . . . . . . . . . . 2-38
OpenByNameButton component . . . 3-210
Types . . . . . . . . . . . . . . . . . . . . . . 3-132
OrgSelectionDialog component . . . . 3-211
XML style sheet . . . . . . . . . . . . . . . 3-132
PropertyLayout layout manager . . . 3-236
ReferencersPanel component . . . . . . 3-214
Registry file . . . . . . . . . . . . . . . . . . 3-242 G
Registry file references . . . . . . . . . . 3-243 generate_client_meta_cache utility . . . . 2-22
RolePanel component . . . . . . . . . . . 3-215 Generating a page . . . . . . . . . . . . . . . . . 4-1
Separator component . . . . . . . . . . . 3-244 GenericTableModel class . . . . . . . . . . 3-220
SplitPane component . . . . . . . . . . . 3-245 getChildren() method . . . . . . . . . . . . 3-205
StringViewerDialog component . . . . 3-246 getOperations() method . . . . . . . . . . . 3-205
StringViewerPanel component . . . . 3-247 Getting Started button
TCComponentUINode component . . 3-214 Rich client . . . . . . . . . . . . . . . . . . . . . 1-4
TCTypeRenderer class . . . . . . . . . . 3-218 GoverningProperty XML element . . . . . 2-67
UserPanel component . . . . . . . . . . . 3-217 GroupPanel component . . . . . . . . . . . 3-215
VerticalButtonLayout layout
manager . . . . . . . . . . . . . . . . . . 3-225
H
VerticalLayoutManager . . . . . . . . . 3-232
Excel files . . . . . . . . . . . . . . . . . . . . . 3-155 Handlers
Exception class naming conventions . . 3-182 Registering . . . . . . . . . . . . . . . . . . 3-253
ExpansionRule component . . . . . . . . . 3-205 RequiredSelectionHandler . . . . . . . 3-253
Writing . . . . . . . . . . . . . . . . . . . . . 3-254
head.ish file . . . . . . . . . . . . . . . . . . . . . 4-6
header XML element . . . . . . . . . . . . . . 2-68