[Prev] [Next] [TOC]

Customizing ClearDDTS

There are many ways to customize ClearDDTS. For example, you may want to add or delete defect states, modify a screen, add additional pages of information to the display or change the state transitions. This chapter discusses these types of customization and others. If you are the ClearDDTS administrator, read this chapter carefully and refer to it whenever you are making changes to your system. The following topics are covered:



Before making changes

At the lowest level, ClearDDTS is a finite state machine where you can define the defect states and the rules for moving defects from state to state. Because you can define the states and the state transition rules, you can tailor ClearDDTS to suit your own unique needs and methodology.

Before you begin customizing ClearDDTS, however, you should consider the existing system and how simple or difficult it will be to accommodate your changes. You should also work with development engineers, project managers, and quality assurance groups to determine what bug report states should exist, and what data should be collected during each state transition. Be sure to involve your entire user community and show them what ClearDDTS provides and then ask them for input.



Locating files to customize

When you customize ClearDDTS, your changes are reflected in the web-based interface webddts, the character-based program bugs, and the graphical user interface xddts.

Note: For information on how web pages are generated and specific web customizations you can make see "How webddts pages are generated" in Chapter 7, Understanding the Master Template File.
To get started, look at the ~ddts/class/software directory. When you use the ls command on this directory, you should see something like this:

README                  helps/                  states
add.encl                link_semantics/         submit.encl
admin.help/             master.tmpl             summary.print/
admin.tmpl/             notify.tmpl             user.encl
batchbug/               oneofs/                 user.hist
bugmail_ignore_fields   proj.prompt             user.index/
clone.prompt            report_conf             verify.encl
description             resolve.encl            web_conf
editencl.tmpl           statenames              www-helps/
This directory contains all of the files you may want to customize for the software class. Similar directories are available for each class containing the files you can customize for that class. (The only other files we recommend you customize are the awk report scripts located in the ~ddts/bin directory.)

The ~ddts/class/software directory contains the following files and subdirectories:

Name Description
add.encl

This template is used to ask the user for an enclosure name (see user.encl and editencl.tmpl below).
admin.help/*

This directory contains help files that are used by adminbug when creating or modifying project parameters. It contains adminbug help for class-specific states.
admin.tmpl/*

This directory contains template files used by adminbug when creating or modifying project parameters. These files control the state-specific information (such as who gets mail when a defect enters this state) that ClearDDTS requests when you create a project. This information is then saved with the rest of the project-specific parameters.
batchbug/*

This directory contains template files that batchbug may use to do programmatic state transitions. You may find them useful as examples of batchbug processing.
bugmail_ignore_
fields

The file contains a list of fields to be suppressed when sending e-mail notification. For more information on e-mail notification, see Chapter 11, Handling ClearDDTS Mail.
clone.prompt

This template file is used for cloning defects. View the file for information on defining what fields to prompt for when clonging a defect.
description

One line description of this class.
editencl.tmpl

This template file may be used to restrict a user from editing an enclosure.
helps/*

Context sensitive help files used by the master.tmpl file for this class. This type of field level help is available for the xddts and bugs interfaces only. The webddts interface has separate HTML help.
link_semantics/*

This directory contains example implementations of a link semantic. The code in these directories allows you to traverse defect links and perform database actions on the linked records.
master.tmpl

Master template file controls state transitions, interaction, modification, and formatting. This file defines the rules for how bugs move from state to state, how bugs are printed to the screen, and how they are formatted for e-mail. Most of your customizations are done here.
notify.tmpl

The notification template is used to control the format and content of notification mail through a variety of configuration parameters. For more information on e-mail notification, see Chapter 11, Handling ClearDDTS Mail.
oneofs/*

The set of oneof files for this class. These files define the list of valid responses for particular fields.
proj.prompt

This template file defines the first screen displayed and is used to prompt for the project and class a user wants to submit a defect against. (xddts and bugs only)
report_conf

This file is used for xddts and webddts management reports. It defines the reports and menu that is displayed.
resolve.encl

This file can be used to require users to enter the editor when a defect is moved to the resolved state. It contains one line which says "Please describe your resolution to this problem:".
statenames

This file defines state letters, state names, and the attributes of each state. It also defines the "normal" progression of defect states for the class.
states

This file defines the legal state transitions and how a defect report may move from one state to the next.
submit.encl

Example of a file that could be added to an enclosure via editfile command. See the Related-file field in the master.tmpl file. The file can be used if you want to force the user into the editor when submitting a defect.
summary.print/*

Template files, one file per state, used for printing three-line summary reports in ddts.
user.encl

Template file used for printing enclosures.
user.hist

Template file used by bugs for printing history enclosures.
user.index/*

Template files, one per state, that define the format of the index lines.
web_conf

This file configures various aspects of the webddts interface including:
- prompting for a project before submitting a defect
- running reports in serial or parallel mode
- available gif graph display sizes
- x-axis and y-axis labels and tick marks
- acceptable file types for attachments
- ability to turn auto wrapping on or off for enclosures
- width of the enclosure edit window
- viewing expanded enclosure contents
- number of enclosure icons displayed across a page
- ability to make toolbar icons active or inactive
www-helps

This directory is used to store field-level help files for the webddts interface. When defining a field in the master.tpml, you can use the same help file for both the xddts and webddts interfaces, or create specific webddts help files. See the default software class master.tmpl for examples.

As you may have noticed, most of the files are ClearDDTS template files. The format and meaning of these files are described in later sections.



Adding new fields

Adding a new field to a particular state transition is as easy as adding a new field derivation to the master.tmpl file. When you add a new field derivation, only new bugs will have the new data incorporated into the flat defect file located in ~ddts/allbugs/*.

Note: If you are using the web interface and have defined groups of fields, be sure to add any new fields to the appropriate group. See Specific webddts customizations for information on grouping fields.
While adding a new field derivation inserts the new data into the flat file in the allbugs directory, making it available for display, it does not insert it into the ClearDDTS SQL database. If you want to use the new field in defect metrics, sorting, database searching, querying, or index lines, you need to modify the database to include it.

Modifying the database involves editing the database schema and configuration files and running adminbug dbms. See Chapter 13, Managing and Customizing the ClearDDTS Database, for more information.

Note: You can also delete fields from the master.tmpl file or the database. However, care should be taken to avoid deleting special fields that ClearDDTS uses internally. See Appendix A for a complete listing of required fields.


Adding defect states

ClearDDTS comes with several default states and legal state transitions (see Chapter 2 in the ClearDDTS User's Guide for a review of these states and state transitions). This set of states should handle most users' needs. Before adding a new state, you may want to consider simply adding an attribute to an existing state. However, if you feel that a new state is necessary, you can add the new state to ClearDDTS by making some simple modifications to a few text files.

These modifications are summarized below:


Editing the state names file (statenames)

The ~ddts/class/<classname>/statenames file is used to put labels on states. As shipped, this file looks like:

S   s	Submit     Submitted
N   u	New        New
A   a	Assign     Assigned
O   a	Open       Opened
R   r	Resolve    Resolved
V   r	Verify     Verified
D   x	Duplicate  Duplicate
P   o	Postpone   Postponed
F   s	Forward    Forwarded
This file defines the states that exist for this class, and each line consists of four fields as follows:

Placing a New State in the File

ClearDDTS has the notion of a mainline set of states. For example, in the following figure, the mainline states are S, N, A, O, R, and V:

Some ClearDDTS graphs and metrics present defects as they move from state to state. For example, one graph shows a plot of New defects, on top of that are the Assigned defects, on top of that are the Open defects, and so forth. The order used in the graph is determined by the order the states are defined in the statenames file. The xddts interface uses this order to define the natural progression (lifecycle) of a defect. Therefore the order of states in the statenames file is significant.

If you are adding a new state, you need to determine if it is a mainline state and where the state belongs in the overall lifecycle. Then add the new state line at the appropriate place in the file.


Editing the state transitions file (states)

Legal ClearDDTS state transitions are determined by the contents of the ~ddts/class/<classname>/states file. This file consists of ordered triples of capital letters, one triple per line. Each letter represents a different state. Each triple A B C represents one possible transition: "you can get from state A to state B by first going to state C." Taken together, the list of triples represents the state transition diagram for the given class of defects. The order of lines in the states file is significant, because it provides the next logical default value for the States field in the webddts interface. There can also be comments on any line (portions of lines beginning with #). Such comments are ignored.

Here are some of the lines from the class/software/states file as shipped:

N A A
N O A
N R A
N V A
A A A
A O O
A R O
A V O
O A A
O O O
O R R
O V R
R R R
The first line above means that if a bug is in state N (New), it is possible to get to state A (Assigned) simply by entering state A. The second line means that to get from state N (New) to state O (Opened), the bug must first enter state A (Assigned). The fourth line means that you must first Assign bugs that are New as the first step toward the Verified state. Note that you must go through state R (Resolve) to enter state V.

ClearDDTS uses the states file to determine what to do whenever you attempt a state transition. For instance, if a defect is in the N (New) state, and you change to the R (Resolve) state, the defect first moves into state A because of the third line shown in the example above (N R A). ClearDDTS asks for all of the information associated with state A, and then considers how to get to the desired state (R) from the state it is in now (A).

The seventh line in the example above says that to get from state A to state R, the defect must first go through the O state. ClearDDTS then asks for the information associated with the O state and again considers how to get to the desired state (R) from the current state (O). In this case, the line O R R tells ClearDDTS that the defect can be moved to the R state and no more processing is necessary.

If there is no triple that lists the current state in the first position, you can't get out of that state. Similarly, if there is no triple that lists a particular state in the second position, bugs can't get to that state from the current state.

The triples can be in any order. However, if there are contradictory state transition rules in the file, such as:

N P O
N P P
Then only the rule that appears last is used.

As an example, let's add a state called K (perhaps for Killed) to be inserted between Resolved and Verified. Let's assume that entering this state means that a program source has been modified, and the new source code has been checked into whatever place the "official sources" are kept. We'd add the following lines to the states file:

N K A
A K O
O K R
R K K
V K K
P K O
D K O
K O O
K R R
K V V
K P O
K K K
.
.
.
N F F
A F F
O F F
R F F
V F F
These lines define the following state transitions:


Editing the master template file (master.tmpl)

The ~ddts/class/<classname>/master.tmpl file defines the rules for moving from state to state by describing the interactive dialog and data requested to make a state transition. This master.tmpl file controls all of the prompting, screen formatting, and terminal processing in ClearDDTS. If you are adding a new state or changing the terminal dialog in any way, you need to modify this file. For a description and example of the master.tmpl file, field derivations, and the OPERATION and STATE fields, see Chapter 7, Understanding the Master Template File.

Note: The format and interpretation of template files is described in detail in the template(5) man page. Although the template files are discussed in this chapter, you should read and understand the man page after you read this section. Pay particular attention to the syntax of the "built-in" commands.

Modifying the master.tmpl for New States

If you have read and understood Chapter 7, Understanding the Master Template File, you are ready to customize this file. If you decide to add a new state to the master.tmpl file, it is important to ensure that the if match statements are correct for your new state. The easiest way to do this is to find another state that treats each field similarly, and duplicate all of the references to that state in if conditions with the new state. For example, if you're adding state K, and it's similar to state P, you should change lines throughout the master.tmpl file that look like this:

if match $STATE$OPERATION Pm Pv Op Of
to read:

if match $STATE$OPERATION Pm Pv Km Kv Op Of
You must also add code at an appropriate place to change the value of the Status field to the new state. The syntax is:

set Status K
If you do not add the code to change Status into the new state, you have created a pseudo-state. Pseudo-states prompt for information to be added or changed in the current defect record without actually changing the state of the defect.

Another thing to consider when adding states to the master.tmpl file is how to handle the OPERATION codes of p and f. These two codes cause a goto to be executed in the template file. The code fragment is:

       .
       .
       .
# The if statement below does a "go-to X-fields" where X is
# the future state of this defect. It does this ONLY for painting
# the form ($OPERATION == f) of new questions to be filled out
# and for prompting ($OPEATION == p) for the new information
# required to enter this state.

# Other $OPERATION codes (m, v, n, and l) execute each and every 
# field derivation below.

     if match $OPERATION p f# prompt or form
     and not equal "X$STATE" X
           goto $STATE"-fields"
     fi
     .
     .
     .
If your new state is K, you need to create a field called K-fields and insert the appropriate template code at this point in the template file.


Editing administrative template files

If you add a new state, there are four simple adminbug template files that must be edited so that the dialog in adminbug will ask appropriate questions regarding your new state. The files are in ~ddts/class/<classname>/admin.tmpl and are:

aprj2.tmpl
aprj3.tmpl
mprj2.tmpl
mprj3.tmpl
The aprj2.tmpl and mprj2.tmpl files contain fields called O-notify, R-notify, and so forth. These fields list the users to whom mail is sent when a defect enters that state. For example:

O-notify:
        "\nEnter mail address of those to notify when a bug is\n"
        "opened by the assigned engineer:\n"
        "%s\n"
        help aprj06.hlp

R-notify:
        "\nEnter mail address of those to notify when a bug has\n"
        "been resolved:\n"
        "%s\n"
        help aprj07.hlp
If your new state is K, add a field called K-notify with the same derivation lines as you see for the other *- notify fields. You may also want to add a context-sensitive help file (similar to aprj07.hlp) in the class/<classname>/admin.help directory.

In the aprj3.tmpl and mprj3.tmpl files, you see derivations for fields called O-allow, O-allow-group, R-allow, R-allow-group. For example:

O-allow:
      "\nList LOGIN names of users allowed to OPEN (O state) a\n"
      "bug. Just hit return if anyone is allowed to OPEN bugs.\n" 
      "%s"
      help aprj12.hlp
      if not null
          goodusers
      fi
O-allow-group:
      "\nList GROUP names of groups allowed to OPEN (O state) a\n" 
      "bug. Just hit return if any group is allowed to OPEN bugs.\n"
      "%s"
      help aprj13.hlp
      if not null
          goodgroups
      fi
These fields list the login names of the users (O-allow) and the group names of the groups (O-allow-group) that are allowed to make the specified state transition. For example, if your new state is K, add two new fields called K-allow and K-allow-group with the same derivation lines as you see for the other *-allow and *-allow-group fields. You can also add a context sensitive help file (similar to aprj13.hlp) in the class/<classname>/admin.help directory.

As you can see, what you are doing here is adding field derivations (similar to existing ones) regarding the mail notifications and permissions for your new state. The derivations for state P fields are good examples to copy and modify.

After you make these modifications, any new projects created with the adminbug aprj command will ask the appropriate questions concerning who can make state transitions to the new state and who should be sent mail when a defect report enters that new state. However, for projects previously created, anyone will be able to modify them and no mail notifications will be sent, since the new fields were not recorded for those projects. After you have modified the administration template files, you can use adminbug mprj to modify this project information and set it up, if desired.

Note: You should test each of your modified template files with the tmpltest utility to ensure that a new field does what you want before actually using it. For adminbug templates, use the -m option, because those templates do not operate in screen mode. For more information, see Specific xddts customizations.

Modifying the information in a query index

When you submit a request to ClearDDTS to query the database, the results of that query are displayed in a query index. You can determine what information is displayed in the index.

Index display in webddts

The webddts interface displays results in the Query Results index. Selecting fields to display in the index is user controlled (no administator work required). To select which defect fields are displayed, use the webddts Query Builder and click the Show field.

The index contains the selected fields in the order you see them in the Query Builder.

Index display in xddts and bugs

The template files located in ~ddts/class/<classname>/user.index are used to specify the format of the index lines in bugs and xddts. There is one template file for each state defined in the system. If you add a new state to the system you must add a new file to this directory.

A template file for the resolved state is shown below:

Status:            "%-1.1s "
Severity:          "Sv%1d "
Identifier:        "%-10.10s "
Software:          "%-8.8s "
Headline:          "%-35.35s "
Resolver-id:       " %-8.8s"
Enclosure-count:   if equals $Enclosure-count 0
                   then
                   else
                       " +%-2d"
                   fi
Note that this template file just creates one line of 72 characters. (There are no newlines (\n) in the format strings.) This line displays various fields of the defect (Status, Severity, Headline, etc.) and is included in the ClearDDTS index to provide a summary of the defects under examination. As shipped, the line looks like this:

17 N Sv3  QTKqa00633  foo   foo is broken               +2
If you create a new K state, you must add a new file called K to this user.index directory. The contents of the new file should be similar (or identical) to the above.

Note that any field mentioned in this template file must also be defined in the ClearDDTS database. If you modify the ClearDDTS database, you must rebuild it with the adminbug dbms command. See Chapter 13, Managing and Customizing the ClearDDTS Database.


Editing the three-line summary template file

ClearDDTS prints defects in a variety of formats. One format is a three-line summary. The ~ddts/class/<classname>/summary.print directory has a set of template files, one per state, that define the three line summary format. The template files look like:

Status:          "10t=%s, "
Severity:        "Sv=%s, "
Identifier:      "Bug id = %s, "
Version:         "Vers = %s, "
Software:        "Defect in %s\n"
Headline:        "Desc: %s\n"
Engineer:        "Assig Engr = %s ,"
Submitted-on:    "Found: %s, "
These files can be modified to suit your needs. If you add a new state to the system, make sure that you add a file to this directory with the new state letter as the name and containing the code needed to print defects in that state.


Changing the reporting system for new states

If you add a new state, you need to edit four files to report on defects that enter the new state. In ~ddts/bin, edit the awk scripts dawk01, dawk04, dawk08, and the shell script dawk06.sh.

As an example, all of these scripts include code for adding a new E state, and that code has been commented out. In most cases, you only need to uncomment the code and change E to the new state letter that you have defined. See the scripts and Chapter 9, Creating Custom ClearDDTS Reports, for more information.



Further template customization

Besides adding new fields and states, ClearDDTS templates allow you to do many other types of customization. This section provides examples of some of the more common modifications.


Creating field dependencies

You can make the list of valid responses for one field dependent on the value of another field. For example, maybe you would like to link together the Project and the Software fields so that if a user selects the compiler Project, only C, fortran, and pascal are acceptable answers for the Software field. For example:

Begin:     unset Begin
           set Filter-path /usr/bin:/bin:/usr/ucb
           set Oneof-path class/$Class/oneofs
           set Help-path class/$Class/helps
           .
           .
           .
Software:  if match $STATE$OPERATION Sp Sf 
                 "\(1,20)Software: %-20.20s"
           fi
           if match $OPERATION p m 
                 if equals $Project compiler
                       oneof C fortran pascal
                 elif equals $Project admin
                       oneof -f admin
                       help admin.H
                 else 
                       oneof -f others
                       help others.H
                 fi
                 required
           fi
If the value of the Project field is compiler, the template will only accept Software field values of C, fortran, or pascal. In addition, since no help file is specified, the default help built into the oneof filter command (that is, listing the acceptable answers) is used. If the Project entered was admin, the list of acceptable answers is found in the file ~ddts/class/<classname>/oneofs/admin. The path to find files for the oneof filter command is described by the special field value Oneof-path, which was set in the Begin field derivation. So, the path ~ddts/class/<classname>/oneofs/admin is derived from the lines:

set Oneof-path class/$Class/oneofs
oneof -f admin
In the case of the admin projects, the context-sensitive help file for the Software field is located in ~ddts/class/<classname>/helps/admin.H. The location of this file was determined similarly by the lines:

set Help-path class/$Class/helps
help admin.H
If the value of Project is not compiler or admin, the acceptable values for the Software field are defined in ~ddts/class/<classname>/oneofs/others and the context-sensitive help is located in ~ddts/class/<classname>/helps/others.H.

This mechanism is simple to use and quite flexible. There are also comments in the template file to help you understand how it works and how it is used by various ClearDDTS programs.

For more complicated validation or expansion of input values, you can use the UNIX utilities such as grep, cut, and sed. See template(5) for more information on using filter commands.


Prompting for and requiring enclosures

You can prompt users to add and edit an enclosure when submitting a new record. To do this add the following derivation lines in the master.tmpl file:

Related-file: if equal $STATE$OPERATION Sp
                if uniquetitle -f "Related-file" "Problem"
                    editfile -r -i $~/class/$Class/submit.encl "Problem"
                    inc Enclosure-count
                    log Enclosure "$$" added by $Submitter-id
                else
                    editfile -r "Problem"
                    log Enclosure "$$" modified by $Submitter-id
                fi 
              fi
This derivation already exists in the default software class master.tmpl. The title for the enclosure is Problem. The -i option causes ClearDDTS to use the contents of ~ddts/class/<classname>/submit.encl as the initial text in a Problem enclosure file every time the user submits a new record. The -r option requires that the enclosure contain text (making it a required field), and when used with -i, that text must be different from the initial text. Without the -r option, the user is still prompted for the enclosure, but adding text is optional (the enclosure is not required). The rest of the derivation increments the Enclosure-count field which contains the number of enclosures in the defect, and includes the name of the submitter in the History enclosure.

In additon, you can use the -R option to make an enclosure required. This option is similar to -r (the enclosure cannot be empty), but has the additional requirement that the contents of the enclosure before editing cannot match the contents after editing. For example, this could be used to force additions to the Resolution enclosure if a defect is re-opened and then resolved a second time.

You can use a similar mechanism to prompt users to edit existing enclosures or add enclosures at different state changes. See the comments in the master.tmpl file for more examples.


Customizing enclosures, prompts, and e-mail

In addition to the modifications already discussed, ClearDDTS provides some other template files that you may want to customize. The following table summarizes these files and the kinds of modifications you can make. For more information, see the files themselves.

Template File Modifications
clone.prompt

The clone prompt template file clone.prompt is used to control the dialog used when cloning a defect.
notify.tmpl

The notification template is used to control the format and content of notification mail through a variety of configuration parameters. For more information on e-mail notification, see Chapter 11, Handling ClearDDTS Mail.
resolve.encl

The file can be used to prompt for an enclosure upon resolving a defect. This is an xddts only feature.
submit.encl

The file can be used to prompt for an enclosure upon submitting a defect. This is an xddts only feature.
editencl.tmpl

The editencl.tmpl template file is executed before editing an enclosure. It is provided so that you can restrict who may edit enclosures. This is an xddts only feature.


Creating custom filter commands

You can create and use your own filter commands. These commands could be shell scripts or C programs that read a value from standard input, write the value to standard output, write any explanations of why the value is bad to standard error, and exit with a status of zero (good) or non-zero (bad).

These commands can be used for field validation or for initializing system-generated default values. For example, a filter command is used to initialize the Assigned on field with the current date.

By ensuring that the filter command is at a location in the Filter-path (given in the Begin field in the master.tmpl file), you can use your new filter command in your customized template. An example of using a shell script for a user-defined filter command appears in Appendix C, Sample Filter Command Script.



Specific webddts customizations

If you plan on using the webddts interface there are several changes to the user-customizable portions of ClearDDTS, specifically to the master.tmpl and web_conf files, that will enhance the web page display.


Label and type modification via the "www" filter

Some fields do not usually have an appropriate field label in view mode (for example, the Headline field) making the View Defect page hard to understand.

To solve this issue we use a filter called "www". Used with the "if" command, you can effectively control the output of the HTML pages. We have used this in several fields in our default master.tmpl file, specifically in the Headline, Submitted-on, Software, and Resolved-on fields. You can refer to the master.tmpl file in ~ddts/class/software for exact syntax.

A more complete description of the interaction of the HTML generation tools (wtform and wttmpl) and your master.tmpl files is available in a white paper available from Rational Technical Support.


Web layout using field grouping

In the bugs and xddts interfaces the layout of the form is controlled by cursor addressing in the prompt strings. In HTML the layout is in the order of the master.tmpl file. This can be modified by grouping fields into related sections.

The webddts defects are displayed in a grouped table format, similar to the way the submission and modification forms are displayed, except that the values are displayed as static text and not input items. This grouping is configured through the use of the command "set" with the first argument "group_fields".

Group fields are comma separated field specifiers. Each position can have an optional modifier after the field name delimited by a colon (:), as well as multiple modifiers separated by white space (spaces or tabs). Each position must have at least a modifier or a field name. The format looks like:

set group_field [<field>][:<modifiers>][, [<field>][:<modifiers>][, 
[<field>][:<modifiers>] [...] ] ]
Modifiers can be broken down into two categories:

Example

The following example is from the default master.tmpl file shipped with the software class. It shows how the table is created to display the Defect Information group when viewing a defect:

Def-group:
                if www
                        "DEFECT INFORMATION"
                        set group_fields :numcols=2 tablewidth="75%", 
Project, Identifier, Software, Version, Headline : colspan=2 startcol=1, 
Showstopper, Enhancement, Status, STATE, Last-mod, Enclosure-count, 
Problem_encl : colspan=2 startcol=1
                fi
                unset Def-group
The table appears on the view defect page as:


Web display options via the web_conf file

Edit the ~ddts/class/<class>/web_conf file to control various aspects of the webddts interface display including:

project-pre-prompt If you have fields dependent on the Project field, prompting for Project before presenting the rest of the Submit page reduces the JavaScript required (helping to avoid JavaScript errors). To prompt for the project field before displaying the Submit page, set the value of project-pre-prompt to "Y".
report_run_mode Determines if reports are run in "serial" or "parallel" mode. Serial is the default. Depending on your machine, parallel may not provide the best result since it consumes machine resources.
report_gifsize Determines the sizes of gifs produced for graphs, and the default value. It also determines the labels presented in the Size field in the webddts Generate Reports page. See the examples in the web_conf file for more information.
report_scale_labels Sets an autoscaling factor for x-axis and y-axis labels. The higher the number, the fewer the labels.
report_scale_ticks Sets an autoscaling factor for x-axis and y-axis ticks. The higher the number, the fewer the ticks.
attachment-ignore-ext Attachments normally require an extension so the browser knows what to do with them. You can override this behavior by specifying a regular expression to match for exclusions. For example, to attach core file, do the following: attachment-ignore-ext: core.*

auto-encl-wrap Determines whether enclosure text should automatically wrap. If set to Y, enclosure wrapping is allowed, and is saved in the database. If set to N, enclosure text will not automatically wrap. Defaults to enclosure wrapping even if this file or line are missing. The wrapping occurs at the width of the enclosure window.
encl-width Sets the width of the enclosure edit window. Note that if the width is set to anything less than 40 or greater than 132, the window defaults to a width of 72 even if this file or line are missing.
enclosure-icon-wrap Sets the number of enclosure icons you want to appear in a single row across the View Defect page.
expand-enclosures Determines whether to display the expanded contents of enclosures below the defect information on the View Defect page. The default is "N". Users can also set this option on the User Profile page in the web interface.
toolbar-mode The toolbar can be "active", meaning it contains JavaScript to present moving images, or it can be "inactive", where no JavaScript runs, and the images are static. The default is active. Users can also set this option on the User Profile page in the web interface.


Maintaining the cache directory

ClearDDTS uses a caching system to store initial versions of the webddts pages. The cached pages are stored in the ~ddts/www/cache directory. The ClearDDTS cache is completely separate from the browser cache. It is only used for ClearDDTS pages so that they do not need to be generated each time you access them.

Cache files are cleared automatically when changes are made to the master.tmpl file. However, manual clearing may be necessary after certain changes and customizations are made. If you do not see your changes appear, there are files you can create in the cache directory that perform cleanup as necessary. These files include:

NOCACHE Cache files are still created, but are continually reset.

CLEAN Cache files older than the CLEAN file are reset

CLEAN_<class> Cache files specific to the named class are reset if they are older than the CLEAN.<class> file.

Users can also clean their own cache through the webddts interface by clicking the Clean Cache button on the User Profile page.



Specific xddts customizations

This section contains features unique to the xddts interface.


Adding new pages

To support multiple pages in a defect report in xddts, ClearDDTS uses four special commands and one variable.

Note: The webddts pages use scroll bars for viewing information that requires more than one page to display. Multiple pages are not necessary.

Using the PAGE variable and return statement

The PAGE variable is used to distinguish between the various pages associated with a defect report. This variable is used in the master.tmpl file in much the same way as STATE and OPERATION. The template file runs with the value of PAGE set to some value, and is used in conditional statements to display different pages.

The xddts, bugs, bugmail, and dumpbug utilities use the PAGE variable to display multiple pages. This requires a "handshake" between these programs and the execution of the template file so that these applications know which page should be displayed next. This handshake is accomplished through the use of the template file return statement.

To force the display of a different page, the last statement executed in the master.tmpl file must be a return and it must return the name of the next page to be displayed. This name can be any string up to thirty characters. For backwards compatibility, the null string is the first (base) page, and returning null means there are no more pages left to view. This return value is stored internally as RETURNVAL, so you must not use this variable as a field variable name.

Modifying the master template to display other pages

When executing the other pages, you should manually clear the screen, paint the form, prompt for or modify the additional fields, then go back to the first page. To do this, you use:

You can use multiple pages in a variety of ways, but most likely they will fall into three categories:

As an example, assume that you want to add an extra 10 fields to the Verified state in the software class. Since the software class screen is already quite full, you are going to prompt for and display all of the Verified fields on a second page. To do this, you need to modify the software class master.tmpl file as follows:

  1. To make sure that the V-fields are displayed on the second page, you must place a statement at the beginning of the master.tmpl (before the code that does the goto $STATE"-fields").
    # Add these three lines
    
          if equals "$PAGE" VERIFY
                goto V-fields
          fi
    
    # BEFORE these four lines
    
          if match $OPERATION p f      # prompt or form
                and not equal "X$STATE" X
                goto $STATE"-fields"
          fi
    
    In this example, the second page is named VERIFY. You can name a page anything you wish; however, you should make it descriptive. Note the double quotes around $PAGE. This is required because the first page is named with the null string. The equals statement will not work correctly without these quotes.

  2. Modify the code located at the V-fields field derivation. This derivation is a preamble to the actual execution of the various Verify state fields. Make sure that the code will only be executed when the value of PAGE is VERIFY. There are two situations, output mode and input mode, that you must address:

  3. Now you simply need to define the page order for printing. This is for programs like dumpbug that need to print out all defect pages and then print the enclosures. To set up printing order, insert the following code after the Last-mod field derivation and before the Do-enclosures derivation:

    #  This is existing code
    
    Last-mod: if match $OPERATION p m
                    today
              fi
    
    #  Here is the new code
    
    Pages:    unset Pages
              if null "$PAGE"	
                    return VERIFY
              fi
    
    If we are executing the first page, then we return the next page, VERIFY. If we are executing the last page, in this case also VERIFY, then we fall through to the enclosure code so that dumpbug works correctly.

Implementing other customizations

The example above illustrates only one possibility. Other customizations can be done with the same code and additional conditional statements. Placing these three blocks of code in various places within the master.tmpl file will also produce varying effects. For example, placing the first block farther down in the master.tmpl file will produce a sectioned form where some common data would be displayed on every screen (see company class for an example). This will make all pages print some common fields.

You could also make the second page dependent on Verify-check. For example:

if equals $Verify-check Y, 
   pushscreen
   call -o OPERATION f PAGE VERIFY
   call -i PAGE VERIFY
   popscreen -r
fi
This would give you forms-within-forms. An almost unlimited number of combinations can be implemented.



Debugging a custom template file

Once you make changes to the template file, you need to debug these changes without affecting all of the projects on the system. There are two ways to do this:


Setting up a dummy class

One way to debug a custom template file is by creating a dummy class with the adminbug clas command. When you create the new class, ClearDDTS makes a copy of the master.tmpl file in the new class/<classname> directory. You then create a ClearDDTS project that is a member of this class with the adminbug aprj command. After you have created the new class and project, you can modify the class master.tmpl file and submit test defects against the new project to test your changes.


Testing a template file

Another way to debug template files is with tmpltest. This program allows you to test a template with a set of specified STATE and OPERATION values without creating a dummy project or using the bugs program.

For example, recall the foo.template and foo.script files mentioned earlier that demonstrated the interact filter command. The tmpltest utility can be used to test run these scripts. To debug these scripts, you could issue the following commands:

chmod +x foo.script           # make foo.script executable
tmpltest -Xfpv foo.template
The options cause tmpltest to execute the template file foo.template exactly the same way bugs and xddts execute it. That is, once with STATE equal to X and OPERATION equal to f (form), again with STATE equal to X and OPERATION equal to p (prompt), and finally with STATE as X and OPERATION equal to v (view).

As another example suppose you want to test a change to a locally modified version of the master.tmpl file. The following invocation would step through all of the executions of the template file just like bugs would for a newly submitted defect that you immediately decided to resolve. It would also go through all of the steps in modifying a defect for a particular state.

tmpltest -ofpvm -SAORV template.file
This would test all executions for xddts and bugs. See the tmpltest man page for a complete explanation of how tmpltest works.



[Prev] [Next] [TOC]

Copyright © 1999, Rational Software. All rights reserved.