How to use COMMON_SETTINGS table

 

 

The user connected to Quality Center has some stardard settings such as the display of the Welcome Form where it is possibile to set the checkbox to don't show the window for next access, or when a testset is selected the right part of the screen show the details of the object instead of the list of test instance.

 

All these informations are stored inside the COMMON_SETTINGS table. The table has these fields:

 

  • CSET_CATEGORY: Category Name (Reqs, Execution, FrameSettings...)
  • CSET_NAME: SubCategory Name (LastReqType, TestLabView, ShowTipOnStartup...)
  • CSET_OWNER: User
  • CSET_VALUE: Value
  • CSET_IS_SYSTEM: Y/N boolean, this fields indicate if Category/Name is System or Not.

 

It is also used to pass data from Run to Defect as in this example

 

_______________________________________________________________________

 

 How to write/read values into/from COMMON_SETTINGS

 

Quality Center allows 2 type of settings: for All Users and for Single User.

 

To work with the elements of the table you need to instance the "Settings" 

object. To do this it is possible to use 2 properties of TDConnection object: UserSettings or CommonSettings.

 

  • UserSettings: settings are valid or for the connected user
  • CommonSettings: settings are valid for all users

_______________________________________________________________________

 

How to use the Settings via OTA Api

 

Settings are values that are set for particular elements. The hierarchy of the elements is this one:

 

Category

    |

    |__  SubCategory      |      Value

 

 

With this schema now we try to set the welcome screen does not appear for all users.

 

1. This operation is for all users so we create the Settings object with the CommonSettings property.

 

set myCset = TDConnection.CommonSettings

 

I need to set the value to "N" for the Category "FrameSettings" and for the SubCategory "ShowTipOnStartUp"

 

2. The first operation is to access the Category through the Open action

 

myCset.Open("FrameSettings")

 

3. Now we can directly set the value of the SubCategory (Name)

 

myCset.Value("ShowTipOnStartup") = "N"

 

4. Post and Refresh to the DB.

 

myCset.Post

myCset.Refresh

 

5. At the end we have to Close the Category

 

myCset.Close

 

 

 

 

Note: it's possible to instance custom Category and SubCategory. If they don't exist they've been created automatically.

 

_______________________________________________________________________