Customizing the queries used in a project

You may need to modify variuos lifecycle artifact type definitions for your project. For example, the default values for the Target Milestone attribute may not be appropriate for your project. If you modify the artifact type or attribute definitions provided with the project template, you may also need to customize the query links on the project pages.

The following procedures describe altering queries at the local (project) level. Changes applied at the project level apply only to that project.

Task overview: Creating custom queries

  1. Define the query.
  2. Copy the query URL.
  3. Edit the appropriate subpage to display the new query.

To create a customized query:

  1. Click the Projects tab, and click a project that uses a project template.
  2. Click Project Tracker > Query Artifacts in the left navigation pane.
  3. Click Create New.
  4. Click Advanced Query.
  5. Define the query criteria.
  6. When the query results produce the desired result, copy the query results URL from the browser address bar.
  7. Paste the URL into a text file.
    Note: In the Danube release, you cannot use saved queries in a process page. You must copy the actual query URL.

To edit the subpage to reflect the changes:

  1. If you have not done so already, use Subversion to check out the project template directory.
    For example, you may check out My-Project/trunk/www/cn-project-pages.
  2. Use your version control tool to update the top.html file of the snippets directory of the appropriate subpage in the project template directory.
    For example, you could update My-Project/trunk/www/cn-project-pages/Stages/Definition/snippets/top.html.
    Where My-Project is the name of the current project.
  3. Open this file in an editor.
  4. Paste the query results URL in a list item below the <!-- Start Activity Box --> comment in this file, for example:
    <li><a href="http://almtest2-svn.projectbox.sp.collab.net/servlets/Scarab/
    remcurreport/true/template/Search.vm?nextTemplate=IssueList.vm&action=Search
    &eventSubmit_doSearch=Search &sits=11&sisw=&sisai=&sisp=asc&resultsPerPage=25
    &format=&sindp=1&intake-grp=mv &mv=_0&intake-grp=si&si=&qattdelim=true
    &it=3&mitdelim=true& col=11%2C13%2C2 &coldelim="true" title="View all requirements that have been eliminated from consideration">All excluded </a></li>
    Note: The pasted URL will not be pretty.
  5. Remove the prefix for the query URL.
    The prefix is http or https://project.domain, where project is the name of the project where the query was captured and domain is the domain where the project resides. The URLs should begin with "/servlets/Scarab".
  6. Ensure that special characters in the URL are escaped. For example, replace all instances of ampersand ("&") with the HTML tag "&amp;".
  7. Commit the changes using your version control tool.

The following section summarizes the Project Tracker queries that are used on the CollabNet Project template pages, and the related artifact types and attribute values that are searched using the queries on the default process pages.

Predefined queries for the CollabNet Project template

The following sections summarize the queries that are provided out-of-the-box with the CollabNet Project template.

Cross-subpage queries

The following tables describe queries that appear on all CollabNet Project template subpages. In addition to these cross-subpage queries, many of the subpages in the CollabNet Project template have a link to a Requirement artifact entry form. This is to encourage users to add requirements as they see the need for them.

Query name Requirements (all active)
Artifact type CNALM:Requirement
Status attribute CNALM:Status
Status attribute values Submitted, Started, On hold, Reopened

Query name Active tasks (all active)
Artifact type CNALM:Task request
Status attribute CNALM:Status
Status attribute values Submitted, Started, On hold, Reopened

Query name Tasks for subpage, where subpage means the stage presented on the current page, for example, Definition.
Artifact type CNALM:Task request
Task type attribute CNALM:Task Type
Task type attribute value The task type must be subpage, where subpage means the stage presented on the current page, for example, Definition.
Status attribute CNALM:Status
Status attribute values Submitted, Started, On hold, Reopened

Query name View activities due.
Artifact type All artifact types are represented in this query.
Milestone attribute CNALM:Target Milestone
Milestone attribute value The milestone must be subpage, where subpage means the stage presented on the current page, for example, Definition.
Status attribute CNALM:Status
Status attribute values Submitted, Started, On hold, Reopened