Question & Answer
How do you specify the query URI for ClearQuest queries in the ClearCase Change Management Interface (CMI) configured for ClearQuest?
ClearQuest queries can be defined on
- A branch type's CMI provider configuration for the base ClearCase integration with ClearQuest
- A stream's CMI provider configuration for the ClearCase UCM integration with ClearQuest
The queries return ClearQuest record results from a specified ClearQuest web server through OSLC. The only supported query format for ClearQuest clients is a static Open Services for Lifecycle Collaboration (OSLC) query. Dynamic (that is, interactively specified) queries and customized OSLC queries are not supported. (For a discussion of customized OSLC queries, refer to https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014785045.)
Specifying the query URI
The ClearQuest query URI is specified in the CMI provider configuration with the queryuri keyword, which takes the form
This form of the queryuri explicitly specifies the connection (the base URL), the repository, dbset, and so on, but the connection and database information can also be established by specifying them in a mkcmprovider operation (refer to the descriptions of the -connection and -context options in the mkcmprovider reference page (http://www-01.ibm.com/support/knowledgecenter/SSSH27_8.0.1/com.ibm.rational.clearcase.cc_ref.doc/topics/ct_mkcmprovider.htm)). In that case, you can specify the queryuri as
- You can test the full query URL in a web browser to ensure it is valid, and then replace with the short form, if you wish.
- Space characters (%20) and any other special characters must be encoded in the URL.
- The rcm.name parameter is required for all supported ClearQuest queries.
- The queryuri key word is case-sensitive (lower-case for CMI configured for ClearQuest).
Configuration for base ClearCase
For the Base ClearCase configuration, the queryuri is specified for the branch type; for example,
cleartool mkcmprovider -brtype main@VOB_NAME -context userdb:SAMPL,dbset:CQWAN,"queryuri:http://cqserver1.com/cqweb/oslc/repo/CQWAN/db/SAMPL/query/?rcm.name=Pub…" CQ_PROV1
cleartool mkcmprovider -brtype main@VOB_NAME -context userdb:SAMPL,dbset:CQWAN,"queryuri:rcm.name=Public%20Queries/All%20Defects" CQ_PROV1
Note that the query section of the mkcmprovider command is enclosed by quotation marks.
Configuration for UCM
For the UCM configuration, the queryuri is specified for the stream; for example,
cleartool mkcmprovider -stream STREAM_NAME@VOB_NAME -context userdb:SAMPL,dbset:CQWAN,"queryuri:http:cqserver1.com/cqweb/oslc/repo/CQWAN/db/SAMPL/query/?rcm.name=Public%20Queries/All%20Defects" -enable "true" CQ_PROV1
cleartool mkcmprovider -stream STREAM_NAME@VOB_NAME -context userdb:SAMPL,dbset:CQWAN,"queryuri:rcm.name=Public%20Queries/All%20Defects" -enable "true" CQ_PROV1
Selecting the query
The query that you select must be visible and executable by all users who are to perform operations on the branch or stream on which CMI is configured. In ClearQuest, the default query folders =in the navigator are "Public Queries" and "Personal Queries." Because personal queries are private to individual users, always specify a query in the "Public Queries" folder.
Running a Change Management Provider's Query
In base ClearCase, once a ClearQuest query URI is specified for the Change Management Provider, it can be used by running a cleartool settask -find command. The results from the query are presented in the following format:
Record ID@Provider Name: Headline
Record ID@Provider Name: Headline
In UCM, a ClearQuest query URI can be used by running a cleartool lsactivity -find command, with results in the same format as shown above.
08 August 2018