Development - Client Customization - Draft
Development - Client Customization - Draft
Customization
Cognizant Technology Solutions
Teamcenter Rich Client Customization
Agenda
• What is client customization?
• Codeful Extensions
• Setup Integrated Development Environment (IDE)
• Create Plugin
• Contributing Commands
• Create Custom Application and View
What is client customization?
• The client is the user interface (UI) layer and is built and customized using the Java language (rich
client) or JavaScript (thin client) and other methods.
• The rich client is based on Eclipse, your customizations have access to all Eclipse extension points
and OSGi services
• Teamcenter extension points and services (for example, the application extension points).
• To use any Eclipse extension point, you must first create a plug-in project using the
plug-in development environment (PDE), which you will do shortly.
• We'll develop a very simple plug-in implementing the Eclipse version of the classic
Hello World sample.
• We're going to add a button to the Tools menu that when pressed, displays
an information dialog containing the string "Hello, Eclipse world".
Pressing OK dismisses the dialog.
Create Rich Client Plugin
Create Plug-in project
The location within the menu bar where the contribution should be added
scheme = the „type‟ of the UI component into which the
contributions will be added
• menu = the main application menu or view pull-down menu
• toolbar = the main application or view toolbar
• popup = a context menu in view or editor
id = the unique identifier of menu, toolbar or popup into
which the contributions should be added
• Eclipse RCP main menu: org.eclipse.ui.main.menu
• Eclipse RCP main toolbar: org.eclipse.ui.main.toolbar
• “Any” context menu: org.eclipse.ui.main.popup.any
Example: <menuContribution locationURI="menu:tools?after=additions">
Contributing Commands to Rich Client
Understanding the When Clauses
A Menu without any visible MenuContributions will itself not be visible: Empty
Menus are invisible.
The Handler with the most specific activeWhen clause that is true will win
control of referenced Command.
Contributing Commands to Rich Client
Contributing a custom Menu Item to the Menu Bar
Here is the handler class for the “Sample Command”, it is coded to display
“Hello, Eclipse world” in a message box that opens on click of the command.
Create Rich Client Plugin
Test by exporting jar file
• 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 when the rich client starts.
• The script takes no arguments and generates a RegistryLoader file for each locale
in the portal\Registry directory. The RegistryLoader file is added during rich
client startup.
Run the following script: TC_ROOT\portal\registry\genregxml.bat
When the script is finished, a new RegistryLoader.xml.gz file is created.
Launch the rich client from Eclipse
Create Launch Configuration
• Project -> Right Click -> RunAs -> RunConfigurations -> Run
Note: Debug configuration settings done will apply for run configuration also, can be launched in either ways.
• Teamcenter is launched
• Enter User ID , Password and Server to Login
Launch the rich client from Eclipse
Verify the customization
SampleItemDialog.java
Contributing Commands to Rich Client
Creating custom item
Your class needs to override the createDialogArea() method to customize your dialog. This method gets a Composite wh
expects to get a GridData object assigned as its layout data Via the super.createDialogArea(parent) method call, you can
create a composite to which you can add your controls.
You can override the createButtonsForButtonBar() to add your customized buttons to your dialog’s Button bar.
Contributing Commands to Rich Client
Creating custom item
Expanding the Item Shows the item revisions associated with that item. Likewise here the Sample Item
contains the item revision (i.e.) 075121/A.
Create Custom Application and View
Define packages and custom perspective class
<extension point="org.eclipse.ui.perspectives">
<perspective id="sample.richclient.perspectives.CustomPerspective"
class="sample.richclient.perspectives.CustomPerspective" name="Custom
Application"/>
</extension>
<extension point="org.eclipse.ui.views">
<view id="sample.richclient.views.CustomView"
class="sample.richclient.views.CustomView" name="Custom View"/>
</extension>
Create Custom Application and View
Test the Changes
Your custom perspective will be found in navigation pane if it is not found you can open it by,
Window->Open perspective->Custom Application.
Custom Application will be opened with it’s associated custom view.
Exercise
Try adding “Custom Item” command in File menu , selecting the command should open a dialog box.
Dialog box should contain following,
Name Label with text field.
Description Label with text field vertical scroll enabled.
Type Label with text field.
Ok and Cancel Buttons.
Clicking Ok button should create an item of type you have given as input.