How to add a field for a new attribute to Task Dialogs in Rational Synergy

Technote (FAQ)


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

  1. Adding the attribute to the task's properties

    Add the attribute to the task type's cvtype info_attrs attribute.
      1. %ccm set role ccm_admin

      2. %ccm query -n task -t cvtype
          1) base/cvtype/task/1 ac_rel ccm_root cvtype base


      3. %ccm attr -c info_attrs -t text @1

      4. %ccm attr -m info_attrs @1

      5. 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 

  2. Adding the attribute to the query dialog
      1. Edit the $CCM_HOME/etc/ccm.properties file (%CCM_HOME%/etc/ccm.properties on Windows).

      2. The are two definitions:
        ccm.querypane.task.attributes.all = ...
        ccm.querypane.task.attributes.default = ...


      3. 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 



  3. 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.
      1. %ccm set role ccm_admin

      2. %ccm query -n task -t cvtype
          1) base/cvtype/task/1 ac_rel ccm_root cvtype base


      3. %ccm attr -c required_attributes -t text @1

      4. %ccm attr -m required_attributes @1

      5. 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


      1.
  4. Restart the Java Client session for the changes to take effect.

  5. Restart CCM server if you are using web mode clients.


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.

  1. Add the attribute to the task type's cvtype source_attrs attribute.
    The source_attrs attribute contains a list of the attributes that are created whenever a new object of this type is created.
      1. Change your role to ccm_admin
        % ccm set role ccm_admin

      2. Query for the task cvtype:
        % ccm query -n task -t cvtype
          1) base/cvtype/task/1 ac_rel ccm_root cvtype <void> base <void>


      3. Modify the source_attrs attribute on the task cvtype:
        % ccm attr -m source_attrs @

      4. 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

      5. A string attribute "ref_number" will exist on all subsequently created task objects.


  2. Add a field for this attribute to the create task dialog.
    1. Edit the file tskcrdb.ui in the pt 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"
      {
      ....
      }


    2. 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.


  3. Add the field to the query task dialog. 

    1. Edit the file tskqydb.ui in the pt 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"
      {
      ....
      }



    2. 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.


  4. Allow the new attribute to be added to the query by adding a new query rule.

    1. 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".

    2. query "taskrule" 
      {
      attr       
      release 
      conditions  NULL        NULL        NULL
      oper        equality    NULL        "NULL|="    NULL
      const       NULL       
      taqy_release    string



  5. 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:


  6. 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 particular ref_number in the query dialog.

     

Note: Changes that are made to the installed database are overwritten when a model install is performed.

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Rational Synergy
General Information

Software version:

6.3, 6.4, 6.5a, 6.5, 6.6a, 7.0, 7.1, 7.2

Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Reference #:

1325216

Modified date:

2009-12-03

Translate my page

Machine Translation

Content navigation