Question & Answer
Question
How do you add a field for a new attribute to Task Dialogs in IBM Rational Synergy?
Cause
If a new attribute has been added to a task, a simple customization can be made to add this attribute to the Rational Synergy dialogs to allow the attribute to be viewed, modified or queried.
This document provides an example of such a customization for the Java and Classic Classic Clients.
The sample attribute added is called 'ref_number'
, with a label 'Reference'. All tasks, which are created after this modification has been made, will have this attribute.
Answer
Section 1: Java Client
- Adding the attribute to the task's properties
Add the attribute to the task type'scvtype
info_attrs
attribute. %ccm set role ccm_admin
%ccm query -n task -t cvtype
1) base/cvtype/task/1 ac_rel ccm_root cvtype base
%ccm attr -c info_attrs -t text @1
%ccm attr -m info_attrs @1
- This command will start an editor on the text of this attribute. Add the following line for the new "
ref_number
" attribute to the end of the file and save:
ref_number:string:Reference
- Adding the attribute to the query dialog
- Edit the
$CCM_HOME/etc/ccm.properties
file (%CCM_HOME%/etc/ccm.properties
on Windows).
- The are two definitions:
ccm.querypane.task.attributes.all = ...
ccm.querypane.task.attributes.default = ...
- Add the
ref_number
to them, for example:
ccm.querypane.task.attributes.all=task_number|priority|platform|task_synopsis|release|status|resolver|owner|completion_date|
ref_number
ccm.querypane.task.attributes.default=task_number|priority|task_synopsis|ref_number
- Adding the attribute to the create task dialog.
Currently this is only possible if the attribute is made required. This means, users will be forced to enter a value for this attribute. %ccm set role ccm_admin
%ccm query -n task -t cvtype
1) base/cvtype/task/1 ac_rel ccm_root cvtype base
%ccm attr -c required_attributes -t text @1
%ccm attr -m required_attributes @1
- This command will start an editor on the text of this attribute. Add the following line for the new "
ref_number
" attribute to the end of the file and save:
ref_number
- Restart the Java Client session for the changes to take effect.
- Restart CCM server if you are using web mode clients.
1.
Note: Changes that are made to the installed database are overwritten when a model install is performed. Check the release notes of all patches to see if the modified files will be affected.
Note: To change the default GUI you can modify the attribute ccm.attributes.object.all
Section 2: Classic Client
All the modifications are made as the user ccm_root
in user interface definition files in the pt
directory of the database. These files are written in the GUILD layout language. A copy of the relevant files should be saved before they are changed. The description here is intended to provide guidelines for some simple modifications but it is not a complete description of the GUILD language. GUILD is a proprietary language used exclusively for the Rational Synergy classic client.
In this example, a string attribute called "ref_number
" is first added to the task type. This attribute is then added to the task create and task query dialogs. The files, which need to be changed, are tsk.qr
, tskcrdb.ui
and tskqydb.ui
.
- Add the attribute to the task type's
cvtype source_attrs attribute.
Thesource_attrs
attribute contains a list of the attributes that are created whenever a new object of this type is created. - Change your role to
ccm_admin
% ccm set role ccm_admin
- Query for the task cvtype:
% ccm query -n task -t cvtype
1) base/cvtype/task/1 ac_rel ccm_root cvtype <void> base <void>
- Modify the
source_attrs
attribute on the task cvtype:
% ccm attr -m source_attrs @
- This command will start an editor on the text of this attribute. Add the following line for the new "
ref_number
" attribute to the end of the file and save:
ref_number:string
- A string attribute "
ref_number
" will exist on all subsequently created task objects.
- Add a field for this attribute to the create task dialog.
- Edit the file
tskcrdb.ui
in thept
directory of the database. Add a new item at the position where the widget should appear. For example,ref_number
should appear below "release" in the dialog. Search for this choice widget:
choice "tacr_release"
{
....
}
- Add these new items for "
ref_number
":
message "tacr_
ref_number_lbl"
{
label "Reference:"
row $next
column 40
dither_when_readonly "True"
write_when_state "task:new registered modify"
}
string "tacr_ref_number"
{
label ""
row "$current"
column 50
length 26
attribute "task:ref_number"
dither_when_readonly "True"
write_when_state "task:new registered modify"
init_when_state "task:new"
}
The arguments "row
" and "column
" are co-ordinates in units of character width and height. It is easiest to set rows relative to the previous position. Here the value "$next
" means the label will appear in the next row in the GUI. "$current
" means that the field will appear on the same line.
The argument "attribute
" refers to the attribute that will be displayed.
"dither_when_readonly
" "True
" means that the field is grayed out when it is read only.
The arguments "init_when_state
" and "write_when_state
" use particular object states to initialize and update fields.
- Add the field to the query task dialog.
- Edit the file
tskqydb.ui
in thept
directory of the database. Add a new widget at the position where the widget will appear. For example, search for this item:
string "taqy_string22"
{
....
}
- Add these two widgets:
message "taqy_
ref_number_msg"
{
label "Reference:"
row "$add 1.75"
column 32
alignment "right"
}
string "taqy_ref_number"
{
row "$current"
column 47
length 18
query_attribute "task:ref_number"
callback "probtrac:Add_query_clause_callback"
}
Here the value "$add 1.75
" for row means the label will appear in a row 1.75 character units below the previous row in the GUI.
The "query_attribute
" shows the attribute that is to be used for the query.
The "callback
" argument causes the function "Add_query_clause_callback
" to add this attribute to the query.
- Allow the new attribute to be added to the query by adding a new query rule.
- Edit the file
tsk.qr
and add a section for the new attribute. The easiest way to do this is to copy the section for "release" and just edit it. Substitute "ref_number
" for "release
" and "taqy_ref_number
" for "taqy_release
".
query "taskrule"
release
{
attr
conditions NULL NULL NULL
oper equality NULL "NULL|=" NULL
const NULL taqy_release string
}
- Add this to the
mailatts file which contains the list of possible attributes which PT can expect to receive during electronic problem submission.
task:
ref_number:
- Stop and Start the client session.
When a new session is started, the new field should appear in the dialogs. You should be able to enter a string in that field in the create dialog and query for tasks with a particularref_number
in the query dialog.
Note: Changes that are made to the installed database are overwritten when a model install is performed.
Was this topic helpful?
Document Information
Modified date:
22 December 2020
UID
swg21325216