Rich Client Customization Programmers Guide
Rich Client Customization Programmers Guide
Publication Number
PLM00075 F
Proprietary and restricted rights notice
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Index-1
Figures
TitledPropertyButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-40
TitledPropertyLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-40
PropertySlider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-41
TitledPropertySlider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-41
PropertyCheckbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-42
TitledPropertyCheckbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-43
PropertyRadioButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-44
TitledPropertyRadioButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-44
PropertyToggleButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-45
TitledPropertyToggleButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-45
LOVPopupButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46
TitledPropertyLOVButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46
PropertyLOVPopupButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-47
TitledPropertyLOVCombobox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-47
PropertyCheckboxOptionLov . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-48
TitledPropertyCheckboxOptionLov . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-48
PropertyRadioButtonOptionLov . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-48
TitledPropertyRadioButtonOptionLov . . . . . . . . . . . . . . . . . . . . . . . . . 3-49
PropertyToggleButtonOptionLov . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-49
TitledPropertyToggleButtonOptionLov . . . . . . . . . . . . . . . . . . . . . . . . 3-49
PropertyObjectLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-50
TitledPropertyObjectLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-50
PropertyLongText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-51
TitledPropertyLongText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-52
TitledPropertyLogicalPanel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-52
PropertyArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-53
TitledPropertyArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-54
PropertyImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-54
Directory structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
Delete dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-8
Expanded Delete dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-8
Progress indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-8
Completion indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-9
LOV dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-11
LOV panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-12
LOVPopupButton with no arguments . . . . . . . . . . . . . . . . . . . . . . . . B-13
LOVPopupButton with arguments and popup window . . . . . . . . . . . . B-14
OrgSelectionDialog component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-15
Organization dialog box search feature . . . . . . . . . . . . . . . . . . . . . . . B-16
Referencers panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-17
Referencers reverse horizontal node layout . . . . . . . . . . . . . . . . . . . . B-17
Referencers tree look node layout . . . . . . . . . . . . . . . . . . . . . . . . . . . B-18
Referencers vertical node layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-18
Item revision UI component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-19
Role panel in the Organization Selection dialog box . . . . . . . . . . . . . . B-20
Group panel in the Organization Selection dialog box . . . . . . . . . . . . . B-21
User panel in the Organization Selection dialog box . . . . . . . . . . . . . . B-22
Usage of the TCTypeRenderer class . . . . . . . . . . . . . . . . . . . . . . . . . B-23
Initial state of an AbstractPopupButton component . . . . . . . . . . . . . . B-24
AbstractPopupButton component popup window . . . . . . . . . . . . . . . . B-24
Table created using GenericTableModel component . . . . . . . . . . . . . . B-25
Horizontal button layout with center alignment . . . . . . . . . . . . . . . . . B-27
Results of resizing the dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . B-27
Horizontal button layout with left alignment and a 20-unit gap . . . . . . B-28
1 Getting started
1 Getting started
The Teamcenter rich client is based on a client-server architecture. Both the client
and server layers can be customized. The client is the user interface (UI) layer and is
built and customized using the Java language. The server layer can be customized
using the Integration Toolkit (ITK) and the C++ programming language. This
manual describes the rich client extensibility features and how to extend the rich
client and the user services technique used to customize the server. It describes
what you need to set up a customization environment, develop customizations, and
deploy the customizations.
Because the rich client is based on Eclipse, your customizations have access to all
Eclipse extension points and OSGi services. They can also use Teamcenter-developed
customization techniques. To customize the rich client, you can use:
• Base Eclipse extension points and services (for example, the
org.eclipse.ui.menus extension point).
• Teamcenter extension points and services (for example, the application extension
points).
http://java.sun.com
http://www.eclipse.org/downloads/
Enable To enable rich client customization, you must install Eclipse and
rich client configure it to run the rich client.
customization
For more information, see Enable rich client customization.
Configure Once you install the prerequisites and set up the Eclipse IDE,
rich client you do not have to do anything else to configure rich client
customization customization.
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 2 Software
Development Kit (SDK) version 1.6.0_14, do so before proceeding further. You
can download this version from the following Web site:
http://java.sun.com
2. Download the Eclipse 3.5 Software Development Kit (SDK) kit for your platform
from the following Web site:
http://download.eclipse.org/eclipse/downloads/drops/R-3.5-200906111540/
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\fcc
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%
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.
3. In the Name box, type RichClient and ensure the correct JRE appears in the
Runtime JRE box.
Also ensure that Run a product is selected and the product is
com.teamcenter.rac.aifrcp.product.
4. Click the Arguments tab and type the following in the VM arguments box:
-Xms256m -Xmx1024m
• You can add and rearrange views to display multiple sets of information
simultaneously within a perspective.
• You can save a rearranged perspective with the current name, or create a
new perspective by saving the new arrangement of views with a new name.
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.
Views
Enable you to navigate a hierarchy of information, display information about
selected objects, open an editor, or display properties.
• Views that work with related information typically react to selection changes
in other views.
• Any view can be opened in any perspective, and any combination of views
can be saved in a current perspective or in a new perspective.
• Objects selected in a view may provide context for a shortcut menu. The
shortcut menu is usually displayed by right-clicking.
For more information about using the shortcut menu, see the Rich Client
Interface Guide.
Note
If your site has online help installed, you can access application and view
help from the rich client Help menu or by pressing F1. Some views, such as
Communication Monitor, Print Object, Outline, Palette, and Progress, are
not specifically associated with a particular perspective.
For more information about unassociated views, see Rich client debugging
tools.
For more information about perspectives and views and changing the layout of your
rich client window, see the Rich Client Interface Guide.
• Menu contribution
• 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
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
• 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.
• 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
• 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
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.
boTypesLoader Contributes extensions used to
load types. The types loader class
decides which base type and its
subtypes to load, the types to be
excluded, and if the most recently
used list (MRU) is enabled.
boTypesPage Contributes extensions that
add custom panels to the types
selection page in New Other dialog
box.
buttonProvider Registers the button providers
with the Clipboard composite area.
extWizard Registers wizards.
extWizardPage Registers pages with the specified
wizard.
extWizardRef Registers pages with the specified
wizard.
• 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.
• 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.
For more information about searching for style sheets, see Search for style sheets. For
sample customizations using style sheets, see Customizations using style sheets. For
more detailed information about style sheets, see Developing forms and customizing
the properties display using XML style sheets.
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.
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, 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)>
• 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.
The Property style sheet type defines the layout of the Properties dialog box. To view
the Properties dialog box, 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, select an instance of a form and
click the Viewer tab.
Sample form
To set a style sheet to the Form type, open the style sheet dataset in the Viewer tab
and in the Stylesheet Type box, select Form.
The Summary style sheet type defines the layout of the Summary tab.
Summary tab
To set a style sheet to the Summary type, open the style sheet dataset in the Viewer
tab and in the Stylesheet Type box, select Summary.
The Create style sheet type 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).
1. Search for a style sheet you can base your new style sheet on.
For more information, see Search for style sheets.
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. Edit the style sheet in the Viewer tab to include the elements you want
displayed in the layout.
c. 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.
3. If you create a custom rich client plug-in, export the plug-in to the
TC_ROOT\portal\plugins directory.
For more information, see Export your custom plug-in to the rich client.
4. Clear cache and register any new plug-in to ensure the customization appears
in 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.
2. 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.
On a Windows client, it is typically the C:\Documents and
Settings\user-name\Teamcenter\RAC directory. On a UNIX client, it is
typically the $HOME/Teamcenter/RAC directory.
3. Edit the portal.bat file to add the -clean and -initialize arguments between
start Teamcenter.exe command and %*. Run the rich client once and then
remove the -initialize argument. (Remove the -clean argument after you finish
developing and testing your customization.)
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.
# sample.jar
#
# [TO]
# plugins
#}
#[COPYFILE]
#{
# [FROM]
# sample2.jar
#
# [TO]
# plugins
#}
#[COPYFILE]
#{
# [FROM]
# sample3.jar
#
# [TO]
# plugins
#}
[COPYFILE]
{
[FROM]
sample.jar
[TO]
plugins
}
#The version of this Sample Solution.
[VERSION]
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]
}
}
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 Browse, 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"/>
<os value="hp-ux" version="11.11"/>
<root value="true"/>
<group value="clientadd"/>
<singular value="true"/>
<guid value="7560C67ED5B01B65C39B8DF7364066C8"/>
<relation>
<depends>
<or value="FF18D25DA73019F880BCFFBC0029CA28"/>
<or value="E2564104E1B964BB23D78078DBA34EEA"/>
<or value="A2564824E1B434AC23D70178DBA34BCA"/>
</depends>
</relation>
<files>
<code>
<unzip file="portal/compressed_files/rac_samplecust.zip"
todir="portal"/>
</code>
</files>
</feature>
• 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.
2 Sample customizations
2 Sample customizations
Common customizations
Commonly performed customizations run the gamut from changing icons all the way
to adding applications to the rich client.
Style sheets are the easiest and most powerful way to change the appearance the
rich client user interface. Use them to change everything from the properties that
are displayed for a selected object to the layout of the Summary view.
For an overview of style sheets, see Introduction to style sheets. For more detailed
information about style sheets, see Developing forms and customizing the properties
display using XML style sheets.
Note
Only three <views> elements are supported on the Summary view:
impactanalysis, viewer, and properties.
• impactanalysis is for where-used/referenced information.
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.
4. 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>
7. Exit the rich client and restart it using the -clean command argument to remove
the old configuration from cache.
The Properties dialog box and the item create panes in the New Business Object
wizard also use style sheet rendering and can be similarly customized. You can also
use this technique to create custom renderings for new custom business objects.
For more information about using style sheets, see Developing forms and customizing
the properties display using XML style sheets.
4. 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>
7. Exit the rich client and restart it using the -clean command argument to remove
the old configuration from cache.
The Summary view and item create panels in the New Business Object wizard also
use style sheet rendering and can be similarly customized. You can also use this
technique to create custom renderings for new custom business objects.
For more information about using style sheets, see Developing forms and customizing
the properties display using XML style sheets.
Modify the item create panels in the New Business Object wizard
You can modify what appears in the New Business Object wizard when you choose
the File→New→Other menu command and its layout 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. 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>
7. Exit the rich client and restart it using the -clean command argument to remove
the old configuration from cache.
When you choose File→New→Other and select Item, you see that the user_data
boxes are removed from the new item create panes.
The Item Master Form with the User Data boxes removed
The Summary view and Properties pane also use style sheet rendering and can be
similarly customized. You can also use this technique to create custom renderings
for new custom business objects.
For more information about using style sheets, see Developing forms and customizing
the properties display using XML style sheets.
To see the default item master form, open the form just under the item.
Note
Notice how this code adds an Advanced link to the form.
8. Exit the rich client and restart it using the -clean command argument to remove
the old configuration from cache.
You can also use this technique to create custom renderings for new custom business
objects forms. You can also create the XMLRenderingStylesheet dataset and
then import an XML style sheet.
For more information about using style sheets, see Developing forms and customizing
the properties display using XML style sheets.
Customize the Teamcenter rich client splash window and logon window
1. To customize the splash window that appears when you start Teamcenter, open
the TC_ROOT\portal\plugins\com.teamcenter.rac.aifrcp_version.jar file
and replace the current splash.bmp file with a new splash.bmp file that
contains your customized splash window graphic.
2. To customize the logon window that appears after the splash window, open the
TC_ROOT\portal\plugins\com.teamcenter.rac.kernel_version.jar file and
replace the current background.png file with a new background.png file
that contains your customized logon window graphic. Ensure you include the
\icons path when replacing the file.
3. Delete the Teamcenter subdirectory in the user’s home directory on the client.
On a Windows client, it is typically the C:\Documents and
Settings\user-name\Teamcenter\RAC directory. On a UNIX client, it is
typically the $HOME/Teamcenter/RAC directory.
You can change the default icon for an existing business object or add an icon to a
newly created business object.
You associate icons with business objects using properties files. To replace the icon
for an existing business object, create a user properties file and wrap it in an Eclipse
plug-in. The user properties file contains a name/value pair that binds the icon to
the business object. The format of the user properties file entry is:
business-object.ICON=image-directory/image-file-name
Note
The icon file name is case sensitive (for example, icon.PNG is not the same as
icon.png). Always verify the case is correct for image icons.
The recommended size for icons is 16 x 16 pixels. Icons become distorted when
they are much larger than 16 x 16 pixels.
The Teamcenter registry looks for entries in properties files in the following order:
1. customer.properties
2. component_user.properties
3. component.properties
b. In the New Project dialog box, select Plug-in Project. Then click Next.
c. In the Project name box, type com.mycom.myicon. Clear the text in the
Source folder box. Click Next.
d. Under Options, ensure the Generate an activator and This plug-in will make
contributions to the UI check boxes are selected.
Under Rich Client Application, click the No button next to Would you like
to create a rich client application?. 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.
k. Click Finish.
l. 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.5"?>
<plugin>
<extension
point="com.teamcenter.rac.util.tc_properties">
</extension>
</plugin>
e. Type the icon entry in the file. It has the following format:
business-object-name.ICON=images/icon-file-name
For example, if you want to use a myFolder.png file as the icon for your
folders, use the following entry:
Folder.ICON=images/myFolder.png
Note
You can extract the folderexpanded_16.png file from
the com.teamcenter.rac.common plug-in to use for your
myFolder.png file. Change the image file as you like and save it
as the myFolder.png file.
h. In the Name box, type the path name where the properties file was originally.
For icons, it is com.teamcenter.rac.common.
i. Click Finish.
l. In the Name box, type the path name where the properties file was originally.
For icons, it is com.teamcenter.rac.common.images.
m. Click Finish.
n. From Windows Explorer, drag your new icon image file (for example,
myFolder.png) and drop it on the com.teamcenter.rac.common.images
package.
p. 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.
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.
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.
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. 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.
* @see org.eclipse.core.commands.AbstractHandler
*/
public class SampleHandler extends AbstractHandler {
/**
* The constructor.
*/
public SampleHandler() {
}
/**
* the command has been executed, so extract extract the needed information
* from the application context.
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
MessageDialog.openInformation(
window.getShell(),
"Customview",
"Hello, from SampleHandler");
return null;
}
}
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.5"?>
<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>
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
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.5"?>
<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>
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.
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.5"?>
<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.
Click the Custom Application button to launch the new application.
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.kernel
Note
To create a package, right-click the project and choose
New→Package. To create a class, right-click the package and
choose New→Class.
• An icons directory.
Note
To create a directory, right-click the project and choose
New→Folder.
super();
Activator.plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start
* (org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop
* (org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
@Override
public IAspectService getLogicService() {
// TODO Auto-generated method stub
return null;
}
@Override
public IAspectUIService getUIService() {
// TODO Auto-generated method stub
return null;
}
@Override
protected void setupServices(BundleContext context) {
// TODO Auto-generated method stub
}
}
.openInformation(window.getShell(),
"CustomOpenService",
"You sent this component to the SendTo Application: "
+ cmp.toString());
}
});
return false;
}
@Override
public boolean open(InterfaceAIFComponent[] cmps) {
// TODO Auto-generated method stub
return false;
}
}
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.5"?>
<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>
a. Choose Run→Run Configurations to start the rich client from your Eclipse
environment. Clear the workspace by selecting the Clear check box in the
launch configuration dialog box.
For information about how to set up Eclipse to run the rich client, see Enable
rich client customization.
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.
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>
c. Ensure that no folder is selected (for example, click the Details tab) and
choose File→New→Item.
The new item dialog box appears normally.
You can create a custom Java form assigned to the ItemRevisionMaster form.
In this example, when a user chooses File→New→Item to launch the New Item
dialog box for a custom Item business object, a new form is displayed on the Define
additional item revision information page of the wizard.
The sample code uses the getRenderingModified, isRenderingModified, and
setValues methods. These methods ensure the values are copied from the New
Item wizard to the form. These methods also ensure that values on the new form
are copied to the new master forms if a save as or revise is performed on the item
revision.
1. Create a custom item business object.
a. In the Business Modeler IDE, create a custom item business object as a child
of the Item business object, for example, A5_MyItem.
For more information about how to use the Business Modeler IDE, see the
Business Modeler IDE Guide.
Note
The A5_ portion of the name is an example of a naming prefix. When
you create a Business Modeler IDE project, you are required to define
a unique prefix that will be affixed to the name of all custom data
model items you create to show that they belong to your custom data
model. You can use your own prefix, but remember that the following
coding examples use this example prefix.
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>
<extension point="com.teamcenter.rac.aifrcp.ActionSetAIFApplicationAssociation">
</extension>
</plugin>
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);
mainPanel.add("2.1.right.center",new JLabel("User Data Two"));
mainPanel.add("2.2.left.center", data2_jtextfield);
add("unbound.bind", mainPanel);
}
}
C. Click Finish.
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.
d. On the Define additional item revision information page, you should see
your new item revision master form.
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.
Miscellaneous customizations
Miscellaneous customizations are not customizations you perform often, but
fill a specific need. Samples show how to perform these less-frequently used
customizations.
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
package com.mycom.exitcommand.handlers;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.handlers.HandlerUtil;
/**
* Our sample handler extends AbstractHandler, an IHandler base class.
* @see org.eclipse.core.commands.IHandler
* @see org.eclipse.core.commands.AbstractHandler
*/
public class SampleHandler extends AbstractHandler {
/**
* The constructor.
*/
public SampleHandler() {
}
/**
* the command has been executed, so extract extract the needed information
* from the application context.
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
HandlerUtil.getActiveWorkbenchWindow(event).close();
return null;
}
}
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.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
</extension>
<extension
point="org.eclipse.ui.bindings">
<key
commandId="com.mycom.tableviewer.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:org.eclipse.ui.main.menu?after=additions">
<menu
label="Viewer"
mnemonic="V"
id="com.mycom.tableviewer.menus.sampleMenu">
<command
commandId="com.mycom.tableviewer.commands.sampleCommand"
id="com.mycom.tableviewer.menus.sampleCommand"
label="TableViewer"
mnemonic="T">
<visibleWhen>
<reference
definitionId="com.teamcenter.rac.ui.inMainPerspective">
</reference>
</visibleWhen>
</command>
</menu>
</menuContribution>
<menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
<toolbar
id="com.mycom.tableviewer.toolbars.sampleToolbar">
<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>
TableLabelProvider.java
TableViewerExample.java
return null;
}
}
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) {
Object result = null;
Row row = (Row) element;
List<String> list = Arrays.asList(COLUMN_HEADINGS);
int columnIndex = list.indexOf(property);
switch (columnIndex) {
case 0:
result = row.getKey();
break;
case 1:
result = row.getValue();
break;
}
return result;
}
public void modify(Object element, String property, Object value) {
List<String> list = Arrays.asList(COLUMN_HEADINGS);
int columnIndex = list.indexOf(property);
TableItem tableItem = (TableItem) element;
Row row = (Row) tableItem.getData();
switch (columnIndex) {
case 0:
String key = (String) value;
if (key.length() > 0) {
row.setKey(key);
}
break;
case 1:
String v = (String) value;
if (v.length() > 0) {
row.setValue(v);
}
break;
}
tableViewer.update(row, null);
}
}
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.
com.teamcenter.rac.util
b. Click the Runtime tab, click the Add button, and select the following:
com.mycom.treeviewer
com.mycom.treeviewer.handlers
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.
TreeViewer button
Tree viewer
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.
com.teamcenter.rac.aifrcp
com.teamcenter.rac.common
com.teamcenter.rac.kernel
com.teamcenter.rac.util
b. Click the Runtime tab, click the Add button, and select the following:
com.mycom.toggle
com.mycom.toggle.handlers
</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>
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;
}
}
Error.TITLE=ToggleError
Error.MESSAGE=Error menu is toggled off
Warn.TITLE=ToggleWarn
Warn.MESSAGE=Warn menu is toggled off
2. In the Query Builder application, create a Find PDFs query with the following
criteria.
b. Open the Quick_Access_Queries preference and add Find PDF to the list
of values in the preference.
4. Test the new Find PDFs 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:
1. customer.properties
2. properties_user.properties
3. 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.5"?>
<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
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.
ex.printStackTrace();
}
}
}
}
c. In the New Process Dialog dialog box, click the Assigned button.
The Filter Based on Status dialog box is displayed.
Note
This is a sample customization. You can create your own customization
by altering the contents of the CustomFiler.java file in the plug-in.
Developing forms and customizing the properties display using XML style
sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 3-13
Using predefined style sheets . . . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 3-14
Verify the registration of forms in the rich client interface . . . . . .... . . . 3-15
Creating form preferences for new business objects . . . . . . . . . . .... . . . 3-15
Modify a predefined style sheet . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 3-16
Create a new style sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 3-16
Accessing the style sheet viewer . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 3-17
Style sheet XML definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 3-18
XML elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 3-19
Display format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 3-29
Rendering style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 3-30
Rendering hints, rendering style, and JavaBeans . . . . . . . . . .... . . . 3-30
Customizing property beans . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 3-32
Default renderers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 3-33
Examples of XML style sheet definitions and renderings . . . . .... . . . 3-33
Set properties to be conditionally mandatory or disabled . . . . .... . . . 3-35
Property beans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 3-36
There are several processes used to create forms in the Teamcenter rich client.
There two perspectives in creating forms. The first perspective is the actual
creation of forms within the rich client. It takes very little work and requires no
programming ability to create and display a form. The second perspective is that
of the programmer, which focuses on the techniques used to develop sophisticated
solutions.
A form is a logical storage mechanism that supports captured, informative, and
derived data. Captured data are the boxes within a form in which users type data;
these are generally required boxes. Business rules often dictate that certain boxes
be populated before the form is created. Informative data are read-only boxes that
appear within the form and cannot be modified by the user. Derived data are the
boxes within a form that are the sum or combination of other boxes, or PDM data
that is composed and displayed within the form. Derived data typically cannot
be modified.
Forms capture information that users reference and view. These forms store data,
such as work order, ECO, or ECN information. Information contained in forms can
be used for queries. Companies typically use forms to:
• Capture and store information for work orders, ECOs, or ECNs. This is the most
common use of forms.
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.
Form model
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.
• 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.
• 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.
• 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.
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.
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.
}
catch ( TCException ex )
{
}
}
/**
* This method is used to construct and initialize the UI of the form
* which will be setup to be populated with data.
*
* @return void
*/
private void initializeUI()
{
setLayout ( new VerticalLayout() );
JPanel mainPanel = new JPanel( new PropertyLayout());
mainPanel.setOpaque(false);
// Create all the text fields and combo boxes
projectId = new JTextField(26);
serialNo = new JTextField(20);
//Add components to Panel
mainPanel.add("1.1.right.center",new JLabel("Project ID"));
mainPanel.add("1.2.left.center", projectId);
mainPanel.add("2.1.right.center",new JLabel("Serial Number"));
mainPanel.add("2.2.left.center", serialNo);
add("unbound.bind", mainPanel);
}
}
3. Register the form with the rich client, by one of the following methods:
• Edit the stylesheet.properties file located in the
com.teamcenter.rac.common.jar file and save it as
stylesheet_user.properties.
If you want to add a red triangle on the form to note a required box, add the following
code:
if (required)
{
propertyRenderer = new JLabel( propValue )
{
public void paint(Graphics g)
{
super.paint(g);
Painter.paintIsRequired(this, g);
}
};
}
The following code shows an example of loading a string array attribute into a
custom form:
package com.teamcenter.rac.form;
import javax.swing.*;
import com.teamcenter.rac.common.propertyrenderer.ArrayPropertyRendererComponent;
import com.teamcenter.rac.kernel.*;
import com.teamcenter.rac.util.*;
/**
* This example shows how to use ArrayPropertyRendererComponent.
* The form has two string array attributes.
*/
public class ArraySampleForm extends AbstractTCForm
{
}
catch (Exception e1)
{
e1.printStackTrace();
}
}
}
try
{
getFormComponent().setTCProperties(formProperties);
}
catch (Exception e)
{
e.printStackTrace();
}
}
/**
* This method is used to construct and initialize the UI of the item master form
* which will be setup to be populated with data.
*
* @return void
*/
private void initializeUI()
{
setLayout ( new PropertyLayout() );
JLabel titlesLabel = new JLabel("Titles");
titlesRender = new ArrayPropertyRendererComponent(getFormComponent(), "titles");
JLabel valuesLabel = new JLabel("Values");
valuesRender = new ArrayPropertyRendererComponent(getFormComponent(), "values");
add ("1.1.left.center",titlesLabel);
add ("1.2.left.center",titlesRender);
add ("2.1.left.center",valuesLabel);
add ("2.2.left.center",valuesRender);
}
}
General comments
Example of a basic user interface form is simplistic but shows the relationship of
the different methods and the purposes they serve. The source code in this example
was created manually.
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.
For example, if the form type is MyFormType and the form display class is named
com.mycompany.forms.MyForm, the entry would be added to the properties
file, as follows:
My\ Form\ Type.FORMJAVARENDERING=com.mycompany.forms.MyForm
Often, a form must obtain the reference to the TCComponentForm component with
which it is rendering. Each form bean has knowledge of the TCComponentForm
class; however, for the JPanel component to recognize the form, you must include a
constructor that includes the TCComponentForm component. When you use your
IDE to create the JPanel component, you may be provided a default constructor,
for example:
public MyPanel()
{
}
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 form bean are described in Property beans.
Once you have created 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 form beans, override the checkObject
method as given follows:
public void checkObject() throws Exception
{
//required checks
}
Note
All IDEs that support JavaBeans work with the form beans.
To increase the efficiency of form beans, Siemens PLM Software recommends that
you also implement the InterfaceBufferedPropertyComponent class. This
requires a method that has the following signature:
public TCFormProperty saveProperty ( TCComponentForm f )
throws Exception
This method should only use the setValue<type>Data calls to the form property
and return it. Therefore, all properties in the form bean system are collected and
saved in one call. This increases the efficiency of the form bean.
Siemens PLM Software provides both save() and saveProperty() methods to allow
for flexibility in form storage. All form beans delivered with Teamcenter use the
saveProperty() method. If you choose to override any of the base form beans,
Siemens PLM Software recommends that you override the saveProperty() method.
If you override the save() method in the base beans, Teamcenter uses your save()
method first over the saveProperty method.
This is accomplished using introspection. The bean is analyzed to determine if
there is an overridden save() method. If so, it is assumed that you want to use this
method over the saveProperty() method. This does not apply when you implement
your own form bean, because your form bean provides the implementation of the
save() method and is not considered to be overridden.
• The customization affects both the rich client and thin client.
For an overview of style sheets, see Introduction to style sheets. For sample
customizations using style sheets, see Customizations using style sheets.
• Form
• Item
• Item revision
• Group
• User
• Role
• Site
• Group member
• Volume
• EPM job
• ImanFile
• Tool
• Reservation
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.
business-object-name.FORMRENDERING
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 Modify a predefined style sheet and Create a new style sheet.
4. Select the object type to which this style sheet will be registered from the
Registered Type list.
5. Select one of the style sheet type options, either Property or Form.
8. Select an object that uses the style sheet and display the properties of the object
or open the form to verify the modifications to the style sheet.
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.
3. If you have DBA access, you can use the viewer to create, modify, and register
the XML definition for a certain type object. If you do not have DBA access, you
can view the XML definition, but you cannot modify it.
The following figure and table describe the viewer components.
The following two figures illustrate how the XML code is rendered in the rich client.
In the thin client, the rendering looks slightly different.
XML elements
New and modified XML elements are added to the XMLRenderingStylesheet
schema. The XML elements topic will be replaced with the following content.
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>
The following table describes the available XML elements and attributes.
For example:
<attachments>
IMAN_reference.MSExcel
</attachments>
commandId
Specifies the command to be
executed. The attribute value must
be a key into a property file. 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.
tooltip
Specifies the tool tip for the
command. The attribute value must
be a key into a property file. This
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.
firstcolumn Applies only to the None.
TwoColumn format.
The properties defined
within this tab are added
to the left column of the
TwoColumn format. This
is supported in both the
rich client and thin client
but not the New Business
Object wizard.
GoverningProperty Specifies the name and propertyname
value of the field that
triggers the Rule element. Specifies the name of the field that
triggers the rule if its value matches.
Caution
propertyvalue
The
GoverningProperty Specifies the property value that
tag is not supported triggers the rule.
in the create
style sheet or the
summary style
sheet.
header Specifies that a header None.
area must be displayed in
the page.
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 tool tip associated with
the image. The attribute value must
be a key into a property file. This is a
string attribute that is optional, but
is required if the source attribute
is specified.
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.
label Specifies a label to be text
rendered.
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.
listDisplay Displays a set of objects in None.
a list format.
name
Indicates the property on which the
current property listens.
objectSet Specifies a set of one or defaultdisplay
more objects to display and
the default display type to Specifies the default format to use
use for rendering. when displaying the set of objects.
Valid values are treeDisplay,
Note tableDisplay, listDisplay, or
thumbnailDisplay. The default
This element is a value is listDisplay. This is a string
replacement for attribute that is optional.
the attachments
element. sortby
Specifies the object property to
sort the set of objects by prior to
rendering. The default value is
object_string. This is a string
attribute that is optional.
sortdirection
Specifies the direction in which
the set of objects should be sorted.
Valid values are ascending or
descending. The default value
is ascending. This is a string
attribute that is optional.
source
Specifies the comma-delimited
set of run-time properties or
relations that return the desired
set of objects. The format for the
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.
column
Applies only to the textfield
and textarea elements. It sets
the number of columns. This is
supported in both the rich client and
thin client.
icon
Specifies the icon for this property.
This attribute is optional.
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.
• Similarly, name=
IMAN_master_form:project_id
displays the project_id
property from the item
master form.
• Also, name=
revision:IMAN_master_form_rev:
serial_number displays the
serial_number property from
the item revision master form.
renderingHint
Specifies the component used to
render this property. This is an
optional attribute. If not defined,
the default render is used based on
the property type.
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.
row
Applies only to the textarea
elements. It sets the number of
the rows for the element. This is
supported in both the rich client and
thin client.
rendering Root element 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.
Rule Applies the rule propertyname
to the field if the
GoverningProperty Specifies the name of the field to
element matches its require or disable.
conditions.
state
Indicates whether to make the
field required or disabled. The
valid values for this attribute are
required and disabled.
secondcolumn Applies only to the None.
TwoColumn format.
The properties defined
within this tab are added
to the right column of the
TwoColumn format. This
is supported in both the
rich client and thin client
but not the New Business
Object wizard.
Display format
There are two display formats: OneColumn and TwoColumn.
OneColumn This is the format used in the current property display. Each row
displays one property. This is the default format if no format is
defined.
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).
All renderer hints are supported in the rich client. If the rendering style is not
defined, the default style is headed.
Renderer Supported in
hint thin client? Rendering style JavaBeans
textfield Yes Headed or headless PropertyTextField
Titled TitledPropertyTextField
textarea Yes Headed or headless PropertyTextArea
Titled TitledPropertyTextArea
Titled TitledPropertyCheckbox
Titled TitledPropertyRadioButton
Renderer Supported in
hint thin client? Rendering style JavaBeans
label Yes Headed or headless PropertyLabel
Titled TitledPropertyLabel
slider No Headed or headless PropertySlider
Titled TitledPropetySlider
panel Yes – Rendered Headed or headless PropertyPanel
using separators
Titled TitledPropertyPanel
objectlink Yes – Rendered Headed or headless PropertyObjectLink
as a text field
Titled TitledPropertyObjectLink
lovbutton Yes – Rendered Headed or headless PropertyLOVButton
as regular LOV
Titled TitledPropertyLOVButton
lovcombobox Yes – Rendered Headed or headless PropertyLOVCombobox
as regular LOV
Titled TitledPropertyLOVCombobox
longtext Yes – Rendered Headed or headless PropertyLongText
as text area
Titled TitledPropertyLongText
array Yes – Date, Headed or headless PropertyArray
String (text
area), String
LOV, typed
reference
(UID) LOV are
supported
Titled TitledPropertyArray
For example:
textfield.DEFINITION=com.teamcenter.rac.stylesheet.
PropertyTextField
textfield_titled.DEFINITION=com.teamcenter.rac.stylesheet.
TitledPropertyTextField
Note
For style sheets, you can use the renderingHint attribute on the <property>
tag. You can specify your own rendering hint, and it renders successfully for
Swing style sheet rendering in My Teamcenter (2007) in the properties dialog
box, the viewer, and the Summary view. However, SWT style sheet rendering
does not support custom rendering hints; therefore, you cannot use it for the
Summary view in My Teamcenter.
Default renderers
The following table displays the default renderer for each type. If the rendering hint
is not provided, the default renderer is used.
The following figure shows the user properties dialog box in the rich client resulting
from the XML definition in the previous figure. In the thin client, the rendering
looks slightly different.
</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 figure shows the item properties dialog box in the rich client resulting
from the XML definition in the previous figure. In the thin client, the rendering
looks slightly different.
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>
• You can add more than one Rule tag to a GoverningProperty tag. If the
GoverningProperty is true, all of its Rule tags are applied.
Caution
The GoverningProperty tag is not supported in the create style
sheet or the summary style sheet.
• 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 the XML elements
table.
4. Select Form in the Stylesheet Type list and select the appropriate object from
the Registered Type list.
Property beans
The following table lists JavaBeans that you can use to customize the properties
display:
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.
mandatory
Indicates whether the property is required. If true, a red
asterisk is displayed in the upper-right corner of the box.
modifiable
Indicates whether the property is modifiable. If not
modifiable, the text box cannot be edited.
JavaBean Description
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.
mandatory
Indicates whether the property is required. If true, a red
asterisk is displayed in the upper-right corner.
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.
PropertyButton
Properties:
property
Indicates the property name presented by the bean. When
a component is provide, the property value is displayed as
the button text.
mandatory
Indicates whether the property is required. If true, a red
asterisk is displayed in the upper-right corner.
JavaBean Description
TitledPropertyButton Displays the property name above the button (as shown in the
following figure). This bean is similar to the PropertyButton
bean and actually contains two beans: PropertyNameLabel
and PropertyButton.
TitledPropertyButton
Properties:
bordered
Indicates whether a border is drawn around the button.
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.
mandatory
Indicates whether the property is required. If true, a red
asterisk is displayed in the upper-right corner.
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.
mandatory
Indicates whether the property is required. If true, a red
asterisk is displayed in the upper-right corner.
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.
JavaBean Description
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.
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.
mandatory
Indicates whether the property is required. If true, a red
asterisk is displayed in the upper-right corner.
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.
JavaBean Description
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.
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.
mandatory
Indicates whether the property is required. If true, a red
asterisk is displayed in the upper-right corner.
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.
JavaBean Description
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.
LOVPopupButton
Properties:
property
The property name presented by the bean. When a
component is provided, the button text is set to the property
value.
mandatory
Indicates whether the property is required. If true, a red
asterisk is displayed in the upper-right corner.
modifiable
Indicates whether the property is modifiable. If not, the
button is disabled.
JavaBean Description
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.
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
mandatory
Indicates whether the property is required. If true, a red
asterisk is displayed in the upper-right corner.
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.
mandatory
Indicates whether the property is required. If true, a red
asterisk is displayed in the upper-right corner.
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
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
JavaBean Description
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.
mandatory
Indicates whether the property is required. If true, a red
asterisk is displayed in the upper-right corner.
modifiable
Indicates whether the property is modifiable. If not, the
shortcut menu is not available.
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.
JavaBean Description
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.
mandatory
Indicates whether the property is required. If true, a red
asterisk is displayed in the upper-right corner.
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.
JavaBean Description
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.
mandatory
Indicates whether the property is required. If true, a red
asterisk is displayed in the upper-right corner.
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.
mandatory
Indicates whether the property is required. If true, a red
asterisk is displayed in the upper-right corner of the box.
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.
PropertyImage
4 Performing advanced
customizations
4 Performing advanced
customizations
Advanced customization procedures allow you to customize the rich client with
greater control.
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.
Clear the text in the Source folder box. 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.5"?>
<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.
<iterate operator="or">
<equals value="com.teamcenter.rac.pasteDuplicate"/>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>
</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.
bar and toolbar that are visible in the perspective. The perspective ID starts with
the bundle symbolic name, for example:
com.mycom.myapp.perspectives.samplePerspectiveId
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>
rev (string type), and item name (string type) as input arguments, creates an
item, and return its tag to the Teamcenter client.
If you want to return the strings from the array, use the
USERSERVICE_return_string_array function.
3. Build the lib_server_exits.so (or .sl or .dll file, depending on which platform
the Teamcenter server is running) file with the modified user_server_exits.c
and place it in the appropriate path.
2. Use the method call to call the user-defined method. For example, to call the
createItem function:
Object objs = new Object[3];
String itemId = new String("1234");
String itemRev = new String (“A”);
String itemName = new String (“Nameof1234”);
objs[0]=itemId;
objs[1] = itemRev;
objs[2]=itemName;
TCComponent itemComp =
(TCComponent) userServ.call (“createItem", objs);
Note
"tag_t" in the ITK layer becomes TCComponent in the Java UIF layer.
The actual tag value will become an UID string value in the client representation:
String tagValue = itemComp.getKey (). toString();
The user service program file can be compiled using the compile script in the
$TC_ROOT/sample directory.
The libserver_exits library can be built using the link_server_exit script.
2. (Optional) Copy the user_init.c file to a location that can have the directory
structure shown in the following figure. For example, the custom/src directory
in UNIX or Linux or the custom\src directory in Windows.
Directory structure
ifail = register_custom_properties();
}
5. Create a new file, for example custom_properties.c, and add the lines shown
in the following example.
#include <tc/tc.h>
#include <property/prop.h>
#include <property/propdesc.h>
#include <tccore/tctype.h>
#include <tccore/method.h>
#include <tc/emh.h>
#include <tccore/custom.h>
int register_custom_properties()
{
int retCode = ITK_ok;
int n_types = 0;
USER_prop_init_entry_t user_types_methods[] =
{
{ "Item", custom_display_all_props, NULL }
};
n_types = sizeof(user_types_methods)/sizeof(USER_prop_init_entry_t);
retCode = TCTYPE_register_properties(user_types_methods, n_types );
if ( retCode != ITK_ok )
{
EMH_store_error( EMH_severity_error, retCode);
Return retCode;
}
return( ifail );
}
int custom_display_all_props( METHOD_message_t* m, va_list args )
{
int retCode = ITK_ok;
char type_name[TCTYPE_name_size_c + 1];
METHOD_id_t method;
tag_t type_tag = (tag_t)va_arg(args, tag_t);
retCode = TCTYPE_ask_name( type_tag, type_name );
if ( retCode != ITK_ok )
{
EMH_store_error( EMH_severity_error, retCode);
Return retCode;
}
retCode = custom_add_all_props ( m, type_tag, type_name );
if ( retCode != ITK_ok )
{
EMH_store_error( EMH_severity_error, retCode);
Return retCode;
}
return( retCode );
}
if ( retCode != ITK_ok )
{
EMH_store_error( EMH_severity_error, retCode);
return retCode;
}
return retCode;
}
• Windows:
%TC_ROOT%\sample\extract_objects %TC_LIBRARY%\libuser_exits.ar.lib
These commands extract the required object files to build the libuser_exits
executable.
• Windows:
set USER_INCLUDE=drive-letter:\custom\inc
10. In the compile script, add the following line to include the customized include
directory:
• UNIX or Linux:
- INCLUDES="-I${USER_INCLUDE} -I${TC_INCLUDE} -I${XINCLDIR1}
-I${XINCLDIR2}"
• Windows:
$INCLUDES = "-I$ENV{USER_INCLUDE} " .
"-I\"$ENV{TC_INCLUDE}\" " .
"-I\"$ENV{USER_INCLUDE}\" " .
"-I\"$ENV{MSDEV_HOME}\\include\"";
11. Compile and link the source files in the custom/src (UNIX or Linux) or
custom\src (Windows) directory using the compile and link_user_exits
scripts to obtain the libuser_exits executable.
14. Open the user_property_names.xml file and add the following entry:
<key id="project_stage">Project Days</key>
Caution
This is an older display text method. Previously, to define
property display names when using ITK, you made this change
in the user_property_names.xml file. You should now call the
PROPDESC_set_display_name function in the property initialization
module function registered for the type on which this property exits.
For more information, see the Server Customization Programmer’s Guide.
• Windows:
set TC_USER_MSG_DIR=path-of-cust—directory
• Solaris or Linux:
- export LD_LIBRARY_PATH=$SHLIB_PATH:$TC_USER_LIB
• Windows:
set PATH=%PATH%;%TC_USER_LIB%
19. Launch the rich client and select an Item business object in the My Teamcenter
application.
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.
To determine the tabs to display, the system checks four criteria:
• The class type of the selected display component, for example:
BOMLine
CfgAttachmentLine
TcItemBOPLine
• 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.
For more information about the general process, see Customize the rich client
properties files.
1. Extract the application.properties file from the appropriate
com.teamcenter.rac.component.jar file using the jar xf command. For
example, if you want to edit the mpp.properties file for Part Planner, the
command looks like this:
jar xf com.teamcenter.rac.cme.legacy.jar com/teamcenter/rac/cme/mpp/mpp.properties
Note
For more information about the jar command, see Sun’s Java
documentation.
3. Save the file as application_user.properties file and insert the 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 mpp.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.
But selecting I1 in the BOM structure matches BOMLine.TABS and
BOMLine.ItemRevision.TABS; therefore, the system shows the References
and ProductAppearance tabs.
Note
The tabs are also defined in the mpp.properties file:
tab.CLASS
tab.ICON
The tab label and tool tip are defined in the mpp_locale.properties file:
tab.TABLABEL
tab.TOOLTIP
• 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.
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;
• Commands
com.teamcenter.rac.cme.commands
• Operations
com.teamcenter.rac.cme.operations
• Dialogs
com.teamcenter.rac.cme.dialogs
The classes that belong to the Resource Manager menu bar and toolbar
tokens are specified in the mrm.properties properties file, located in the
com.teamcenter.rac.cme.mrm package. To override the settings in the
mrm.properties file, create the mrm_user.properties file and make your changes
there.
The class for the action token is specified like this:
newMRMAction=com.teamcenter.rac.cme.actions.MRMNewItemAction
The action command has its own registry token with the following syntax:
action-registry—token.COMMAND=command-registry—token
For example:
newMRMAction.COMMAND=newMRMCommand
The following code shows an example of the Resource Manager action registry
entries:
# File->New->Resource...
# ----------------------
newMRMAction=com.teamcenter.rac.cme.actions.MRMNewItemAction
newMRMAction.ICON=/com/teamcenter/rac/cme/images/mrmnew_16.png
newMRMAction.COMMAND=newMRMCommand
newMRMCommand=com.teamcenter.rac.cme.commands.MRMNewItemCommand
newMRMDialog=com.teamcenter.rac.cme.dialogs.MRMNewItemDialog
newMRMOperation=com.teamcenter.rac.cme.operations.MRMNewItemOperation
Customizing Classification
You can customize Classification using the following packages:
• Actions
com.teamcenter.rac.classification.common.actions
• Commands
com.teamcenter.rac.classification.common.commands
• Operations
com.teamcenter.rac.classification.common.operations
The following code shows an example of the Classification action registry entries:
g4mSave.ICON=images/save_16.png
g4mSave.SHOWLABEL=false
g4mSave.ENABLED=false
g4mSave.ACTION=com.teamcenter.rac.classification.common.actions.G4MSaveAction
g4mSave.COMMAND=com.teamcenter.rac.classification.common.actions
.G4MSaveCommand
g4mSave.ACTIVE=edit,new
Note
All customizations made in the Classification common.properties file are
visible in Resource Manager as well. If you want to customize something in
Classification only and keep the standard behavior in Resource Manager,
you have to add the original action/command entries from the Classification
common.properties file to the Resource Manager mrm.properties file.
2. In the constructor of your new class, call the constructor of the original command.
The following are the exact names of the different command step methods for the
complex commands.
Icon:
Menu: File→New→Resource
Toolbar: Create a new resource
Action: MRMGenericAction
(newMRMAction)
Command: MRMNewItemCommand
(newMRMCommand)
Dialog: MRMNewItemDialog
(newMRMDialog)
Icon:
Icon:
Menu: Edit→Edit Resource
Toolbar: Edit current resource
Action: MRMGenericAction
(editMRMAction)
Command: MRMEditCommand
(editMRMCommand)
Icon:
Menu: Edit→Cancel Edit
Toolbar: Cancel Edit
Action: MRMGenericAction
(cancelMRMAction)
Command: MRMCancelCommand
(cancelMRMCommand)
Icon:
Menu: Edit→Delete Resource
Toolbar: Delete current resource
Action: MRMGenericAction
(deleteMRMAction)
Command: MRMDeleteCommand
(deleteMRMCommand)
Icon:
Menu: Tools→Create Graphics
Toolbar: Create Graphics based on Part Family
Template or TCL Macro
Action: MRMGenericAction
(createPFMember)
Command: MRMCreatePFMemberCommand
(createPFMemberCommand)
Caution
Headless customization techniques will be deprecated in a future Teamcenter
release. Starting a new project with this technique is strongly discouraged.
The preferred choice is to use the Java, C# or C++ client bindings to published
Teamcenter Services.
For directions about using Teamcenter Services (SOA) to create your own
Teamcenter client applications, see the Services Guide.
Set up Eclipse
1. Create a folder on your hard drive for your new headless program. In
that folder, create the plugins and configuration subfolders. For
example, if you create the C:\myprojects\sample1 folder for your
application, also create the C:\myprojects\sample1\plugins and
C:\myprojects\sample1\configuration folder.
3. Open the Eclipse application and select your new project’s folder as the default
workspace. If Eclipse is opened using another workspace, you can change it
by choosing File→Switch Workspace.
You can also open Eclipse from the command line with the following command:
eclipse -data workspace-location
4. Choose Window→Preferences.
5. In the Preferences dialog box, double-click the Plug-in Development node, and
then select the Target Platform node.
6. To the right of the Target Definitions pane, click the Add button and select
Nothing: Start with an empty target definition and click Next.
7. Next to the Locations pane, click the Add button, select Directory, and click
Next.
8. Click the Browse button in the Location box to select the location of your new
project’s folder (for example, sample1). Click Finish.
b. In Target Platform, click an OSGi framework and select Equinox from this
list.
c. Click Next.
b. Click Next.
b. Click Finish.
8. 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.kernel
• com.teamcenter.rac.util
9. Click OK.
The selected plug-ins are added to the MANIFEST.MF file.
10. In Package Explorer under your project, expand the src folder, and then
expand its package (for example, com.mycom.printhome). Double-click the
Activator.java file to open it in the editor.
13. In Package Explorer, right-click the your project’s package (for example,
com.mycom.printhome) and choose New→Class.
14. In the Name box, type the class name (for example, PrintHome) and click Finish.
This generates the PrintHome.java file under the package and opens it in
the editor.
15. Type the Java source code for your program in the editor. The following figure
contains the code that prints the contents of the Teamcenter Home folder. If you
use the code from the figure, ensure that you replace user-name and password
with valid entries from your system.
package com.mycom.printhome;
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
import com.teamcenter.rac.aifrcp.AifrcpPlugin;
import com.teamcenter.rac.kernel.TCComponentFolder;
import com.teamcenter.rac.kernel.TCComponentUser;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.kernel.TcServiceGatewayCorbaConnection;
import com.teamcenter.rac.kernel.TcServiceGatewayWebServiceConnection;
import com.teamcenter.rac.services.ISessionService;
import com.teamcenter.rac.util.Registry;
public class PrintHome {
private static TCSession tcSession;
}
tcSession = (TCSession) iss.getSession(
"com.teamcenter.rac.kernel.TCSession");
if (transportInUse.compareTo("iiop") == 0) {
String serverHost = "localhost";
String serverName = "localserver";
String serverMarker = "localserver";
TcServiceGatewayCorbaConnection serverConnection = new
TcServiceGatewayCorbaConnection(serverHost, serverName);
serverConnection.setMarkerServerName(serverMarker);
serverConnection.setPort(9999);
// Connect if you can
if (serverConnection.connect()) {
tcSession.login(serverConnection, "user-name", "password",
"", "");
}
}
else if (transportInUse.compareTo("http") == 0) {
String URL = "http://localhost:7001/tc";
String serverName = "Teamcenter";
TcServiceGatewayWebServiceConnection connection = new
TcServiceGatewayWebServiceConnection (URL, serverName);
if (connection.connect())
{
tcSession.login(connection, "user-name", "password",
"", "");
}
}
} catch (Exception ex) {
ex.printStackTrace();
System.out.println("Login.login(): FATAL ERROR: Unable to Login...");
System.out.println("Login.login(): Exception message is " + ex.toString());
System.exit(1);
}
}
public static void logout() {
try {
if (tcSession != null) {
tcSession.logout();
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static void print() {
System.out.println("Logging in to Teamcenter...\n");
// login to rich client
login();
if (tcSession == null)
{
return;
}
// print out the contents of home folder
System.out.println( "\n\nPrinting out the contents of the home folder: \n");
try {
TCComponentUser user = tcSession.getUser();
TCComponentFolder homeFolder = user.getHomeFolder();
AIFComponentContext[] homeFolderChildren = homeFolder.getChildren();
for( int i = 0; i < homeFolderChildren.length; i++ )
{
System.out.println(homeFolderChildren[i]);
}
}
catch( TCException ex )
{
}
System.out.println("\n\nDone!");
System.out.println("Logging out of Teamcenter...\n");
// logout
logout();
}
}
16. Your project should build automatically unless you turned off Eclipse’s automatic
build setting. Ensure there are no compile errors in the Problems tab.
4. In the configuration folder, create a text file called config.ini and add the
following code:
org.osgi.framework.bootdelegation=*
osgi.bundles=org.eclipse.equinox.common@2:start,
org.eclipse.update.configurator@3:start,
org.eclipse.core.runtime@start,
com.teamcenter.rac.util@start,
project-package-name@start
osgi.bundles.defaultStartLevel=5
osgi.noShutdown=false
eclipse.ignoreApp=true
Caution
The text for the osgi.bundles= entry must be on a single line, not on
separate lines as shown. If it is on separate lines, the Equinox framework
does not start correctly and a Class not found error is displayed.
5. Open a command window and change the directory to your program folder.
8. On the Windows platform, type the following command in the command window:
eclipsec.exe -nosplash
In print!
WARN : 12:46:28,734 - TcLogger$IC_PrintStream.println:?
Done!
WARN : 12:46:28,828 - TcLogger$IC_PrintStream.println:?
Logging out of Teamcenter...
In logout!
WARN : 12:46:28,828 - TcLogger$IC_PrintStream.println:?
In logout- try!
WARN : 12:46:28,828 - TcLogger$IC_PrintStream.println:?
In logout! - if
In logout - if 2!
WARN : 12:46:28,828 - TcLogger$IC_PrintStream.println:?
In logout- try - 2!
WARN : 12:46:28,828 - TcLogger$IC_PrintStream.println:?
In logout! - 2
WARN : 12:46:28,921 - TcLogger$IC_PrintStream.println:?
stopping..
If errors appear when running the code, ensure the following in your login()
method have the same values in the client_specific.properties file: user
name, password, server host, server name, server marker, and server
port. The client_specific.properties file is located in your project folder’s
plugins\configuration_version subfolder.
import com.teamcenter.rac.kernel.*;
import com.teamcenter.rac.aif.*;
import com.teamcenter.rac.aif.kernel.*;
public class NewFolder
{
private static TCSession tcSession;
private static AIFPortal portal;
public static void main( String args[] )
{
login();
}
public static void login() {
try {
portal = new AIFPortal(false);
// Get the Session Manager
AIFSessionManager sessionManager = portal.getKernel().getSessionManager();
// From the session manager, create a new session (i.e TCSession)
tcSession = (TCSession) sessionManager.getASession(
"com.teamcenter.rac.kernel.TCSession", null);
//Try to login
tcSession.login();
System.out.println("Successfully logged in");
}
catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
}
}
}
2. Write the implementation and plug it into the static method main(). The
following figure shows the structure of the Java source.
// Required import statements
import ……
3. Follow the steps in Writing headless rich client programs that automatically log
on to add your code to Eclipse.
The following code shows a complete sample program that performs the command
line logon to the rich client and uses kernel methods to create a new folder.
import com.teamcenter.rac.kernel.*;
import com.teamcenter.rac.aif.*;
import com.teamcenter.rac.aif.kernel.*;
import com.teamcenter.rac.util.Registry;
import com.teamcenter.rac.kernel.InterfaceServerConnection;
import com.teamcenter.rac.kernel.TcServiceGatewayCorbaConnection;
import com.teamcenter.rac.kernel.TcServiceGatewayWebServiceConnection;
// Command line program to create new folder,
// the name being passed as the command line argument
public class NewFolder
{
private static TCSession tcSession;
private static AIFPortal portal;
public static void main (String[] args)
{
// Login into Portal from command line
login ();
// Create folder by passing the name through command line argument
createFolder (args[0]);
System.exit(0);
}
// This method will be used to do the commandline login to rich client
public static void login()
{
try
{
portal = new AIFPortal(false);
AbstractAIFSession session = portal.getKernel().getSessionManager()
.getASession("com.teamcenter.rac.kernel.TCSession", null);
tcSession = (TCSession)session;
session.login();
}
catch (Exception ex)
{
ex.printStackTrace();
System.exit(1);
}
}
public static void createFolder (String folderName)
{
if ( folderName == null )
return;
TCComponent newFolder = null;
// Get the FolderType component from the session
TCComponentFolderType folderTypeComponent;
try
{
folderTypeComponent = (TCComponentFolderType)
tcSession.getTypeComponent("Folder");
// Create the component from the Folder super-type component
newFolder = folderTypeComponent.create(folderName, null, "Folder");
}
catch ( TCException ex )
{
ex.printStackTrace();
}
// Logout from the session
try
{
if ( tcSession.isLoggedIn() )
tcSession.logout();
}
catch ( Exception ex )
{
ex.printStackTrace();
}
if ( newFolder != null )
2. In the New Project dialog box, select Plug-in Project. Then click Next.
3. In the New Plug-in Project dialog box Plug-in Project pane, type
com.mycom.headlessapp in the Project name box. Click Next.
4. 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.
Note
This application does not make a contribution to the user interface.
Selecting the check box creates a plugin.xml file that is needed later.
b. Click the No button next to Would you like to create a rich client
application?.
c. Click Next.
5. Clear the Create a plug-in using one of these templates check box. Click Finish.
6. Select the Overview tab and select the This plug-in is a singleton check box.
while(!logindone)
{
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public void loginPerformed(IStatus s) {
logindone = true;
}
}
Note
This code is for a two-tier deployment. If you have a four-tier deployment,
change the following line:
credentials.setServerConnection( "localserver@localhost" );
to this line:
credentials.setServerConnection( "Teamcenter" );
headlessapp
configuration
plugins
Caution
The text for the osgi.bundles= entry must be on a single line, not on
separate lines as shown. If it is on separate lines, the Equinox framework
does not start correctly and a Class not found error is displayed.
19. Copy the Teamcenter.exe file from the rich client TC_ROOT\portal directory
to your headlessapp directory.
20. Create a runit.bat file in your headlessapp directory and add the following
on a single line:
• Windows systems:
Teamcenter.exe -application com.mycom.headlessapp.application -console
-nosplash
• HP-UX systems:
eclipse -application com.mycom.headlessapp.application -console
-nosplash -Dosgi.arch=PA_RISC -Dosgi.ws=motif
headlessapp
configuration
config.ini
plugins
Teamcenter.exe
runit.bat
You can use a number of techniques to make working with rich client customization
easier and more effective.
In summary, colors can be obtained in several ways: look and feel (Swing),
SystemColor class (AWT), hard-coded, and registry based. With all of the options,
Siemens PLM Software recommends that the look and feel be used to obtain color,
followed by SystemColor. There are places for the other methods, but their use
should be limited.
• Plug-in
http://www.eclipse.org/articles/Article-Internationalization/how2I18n.html
http://www.eclipse.org/articles/Article-Speak-The-Local-Language/article.html
• Customizations should be placed into Eclipse plug-ins if they are not already.
• 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 8.3
Release Bulletin.
Hide perspectives
1. Log on to Teamcenter as a user that is in the dba group.
For more information about perspectives that can be hidden, see the description
of the HiddenPerspectives preference.
2. Add any new properties you want to be globally defined. You can use the other
properties files in the directory as a model.
3. If there are any properties that already exist that you want to override with a
new value, add the property with the new value.
• Communication Monitor
Shows you the calls between the rich client and server. Use it to determine if
your data is being correctly exchanged between the server and client.
• Performance Monitor
Tracks the calls between the server and the database. Use it to determine how
fast the server and the database are communicating.
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
• 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.
• 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
• Console view
Shows the standard output, standard error, and standard input for your program.
For more information, see the following URL in the Eclipse help:
http://help.eclipse.org/helios/index.jsp?topic=
/org.eclipse.jdt.doc.user/reference/views/console/ref-console_view.htm
• Outline view
Displays the outline of a structured object open in an editor. It is not used by
Teamcenter.
• Palette view
Used with graphic editing applications. It is not used by Teamcenter.
• 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
Display the date of the logging event.
%d{HH:mm:ss,SSS}
• 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.
• It begins to impact performance of the UI, because old components are being
needlessly updated.
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.
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.
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, such as Teamcenter’s Integration for
Microsoft Office and Teamcenter Engineering 2007 Integration for AutoCAD, and
the third-party applications themselves, such as Microsoft Office and AutoCAD.
corporate server
Host computer at the center of a Teamcenter network. This host contains the
Teamcenter application root directory, Teamcenter data directory, licensing, file
managers (Teamcenter File Services and File Management System), 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.
• -attach
Attaches the new client to an existing session.
• -application applicationId
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 needed. If specified, the value overrides the value
supplied by the configuration. If not specified, the Eclipse Workbench is run.
• -clean
Cleans cached data used by the OSGi framework and Eclipse run time. Try to
run Eclipse once with this option if you observe startup errors after install,
update, or using a shared configuration.
• -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. Handy
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
example, when the workspace contains plug-ins being developed, specifying
-dev bin adds a classpath entry for each plug-in project’s directory named
bin, allowing freshly generated class files to be found there. Redundant or
non-existent classpath entries are eliminated.
• -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
Property files can be categorized in three ways:
• Core development
• 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
• 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.
– Set all text area components to the initial size of 3 rows by 30 columns.
– 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.
– If it is not possible to use the default color, use the SystemColor class.
– 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.
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 initialize Dialog sets the methods for the display in the AbstractProgressDialog
public void initializeDialog (AIFComponentContext[] targets)
{
try
{
// set the title for the dialog
setDialogTitle(r.getString("command.TITLE"));
//display the components that are successfully processed
setDisplaySuccessComponents(true);
//Set the icon to be displayed on the dialog
setCommandIcon(r.getImageIcon("delete.ICON"));
//Set the icon that needs to be set if the components is successfully processed
setSuccessIcon(r.getImageIcon("delete.ICON"));
//set the confirmation to true. The user has to press the Yes button
//to initiate the operation.
setConfirmationText(r.getString("confirmationText"));
// for delete, don’t need to show parent
setShowParentFlag(false);
// display objects that needs to be cut and their parents on dialog
setTCComponents(targets);
}
catch ( Exception ex )
{
//Show the messageBox and return
}
}
// ask user’s confirmation before starting operation
setConfirmationFlag(true);
}
//The abstract method to be implemented to execute the selected operation
protected void getOperations ( AIFComponentContext compContext )
{
// In here the developer has to use addOperation method to add the
// operation.
addOperation ( new DeleteOperation( compContext ) );
}
// There’s also an overloaded getOperations() method which can be used by the developers.
protected void getOperations ( TCComponent parentComp, AIFComponentContext[] ctxts )
{
// Create whatever operation you want to based on the parent component
// and the contexts.
// Then use the addOperation() method to add the operation.
addOperation ( createdOperation );
}
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
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.
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.
The code in the following example constructs an LOV dialog that lists all users:
try
{
TCComponent userComponent = session.getUser();
TCProperty userProperty = userComponent.getTCProperty("user_id");
usersLOV = userProperty.getLOV();
}
catch(Exception ex)
{
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
7 Load All button
8 Copy 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
The LOVPopupButton custom component provides different ways to load the
contents of an LOV (List of Values).
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.
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
The MRUButton component is used by applications to maintain a list of previously
referenced InterfaceAIFComponent objects. It is generic and works with any AIF
application within the AIF framework. When one of the objects is clicked, the open
method for the application is invoked with the component.
The MRUButton component maintains a list of components supplied by the
application. The application must populate the components to the MRUButton
component and determine the number of objects to place inside the component.
Different behaviors can be associated with the use of the MRUButton component in
different applications. A purge limit is commonly associated with the MRU button;
however, the MRUButton component shown in the following figure does not employ
a purge limit.
The code in the following example constructs the MRUButton component:
mruButton = new MRUButton ( explorerApp );
mruButton.setSuggestedVerticalAlignment(MRUButton.TOP);
mruButton.loadMRUEntries();
OpenByNameButton
The OpenByNameButton component allows an application to open new objects
that can be manipulated. It also allows users to issue queries and view properties of
the objects located by the query.
The objects that are found by the query are loaded into the table. Instead of loading
all objects, only the first set is loaded. To load the next set, click the Load Next
button. To load all objects, click the Load All button. The Load Previous button
loads the previous set and appends it to the current selection. Once the object is
located, double-click the object to open it in the application.
Objects can be selected in the table and copied to the clipboard. The Copy button is
active only when an item has been selected.
The OpenByNameButton component enforces the limitation that a query can only
be performed on a single object type, for example, item revisions or folders. This
is usually acceptable, as most applications can only support one root object type.
Examples of this are My Teamcenter, which only supports folders as root objects, and
Structure Manager, which only supports occurrences as root objects.
The OpenByNameButton component is subclassed from the
AbstractPopupButton class, which allows it to be inserted into the user interface
where it is treated like any other Java button.
This composition allows you to add things to uniquely identify the button and its
purpose, such as tool tips and icons.
The following code shows how to construct the OpenByNameButton component for
the My Teamcenter application, which only searches on folders:
OpenByNameButton openByNameButton = new OpenByNameButton(explorerApp, "Folder");
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
ReferencersTreeLookNodeLayout
ReferencersVerticalNodeLayout
ReferencerUINode
The ReferencerUINode component is an extension of the TCComponentUINode
component. It adds an attribute that tells if a where-used or where-referenced
expansion is associated with the node.
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 TCComponentUINode component is an extension of the AbstractUINode
class, and creates a UI node based on an TCComponent 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.
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
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.
The following figure shows the ButtonLayout layout manager with horizontal
orientation, left alignment, and a 20-unit gap between the buttons.
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.
The following figure shows the ButtonLayout layout manager with vertical
orientation and center alignment.
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 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" );
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
The VerticalLayout layout manager positions children and attachments vertically
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
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 PropertyLayout layout manager positions children and attachments vertically
within 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.
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.
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.
For more information, see Getting started.
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.
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
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 );
Note
Teamcenter still supports the AIF in the Eclipse RCP. However, you should
make every effort to migrate your customization to use the Eclipse RCP menu,
toolbar, and status bar functionality.
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.
http://www.eclipse.org/articles/Article-UI-Workbench/workbench.html
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 tool tip 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.
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
associated components are enabled. Otherwise, the component is disabled. This is
enabled for many actions that currently appear within the menu bar and toolbar,
more notably the cut, copy, and paste actions.
Use the following steps to write your own handler:
1. Write a class that subclasses the AbstractAIFContextSensitivityHandler
class.
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).