Setting up a property request
A Rational®
ClearQuest® CM API client
application must first get a proxy to a resource before it can read or update
properties.
Before a client can access properties from a proxy
it must read those properties from the resource into a proxy. The
client application must include the name of the properties in a property
request when reading them from the resource into a proxy. For example:
// Create a PropertyRequest - specify the names of
// properties wanted from the resource.
PropertyRequest myPropList1 =
new PropertyRequest(Resource.COMMENT,
Resource.CONTENT_LENGTH,
Resource.CONTENT_TYPE,
Resource.CREATOR_DISPLAY_NAME,
Resource.DISPLAY_NAME);
For a specific resource interface, you can specify properties defined in the interface itself or
any of the interfaces it extends. For example, for a Rational
ClearQuest query you can specify properties that are
defined in the CqQuery interface, the CqContextResource interface, the CqResource interface, the
StpResource interface, or the Resource
interface:
PropertyRequest myPropListr =
new PropertyRequest(StpResource.USER_FRIENDLY_LOCATION,
Resource.DISPLAY_NAME,
// include properties specific to the Query
CqQuery.DISPLAY_FIELDS,
CqQuery.DYNAMIC_FILTERS);
After you include the property names in a PropertyRequest, you can pass this request to the doReadProperties() method of the Resource proxy to read the specified properties.