Attachment objects

In Rational® ClearQuest® the user can attach files to a record (that is, an Entity object) in an attachment field. A record representing a defect can have multiple attachment fields, and each field can have multiple attached files. For example, a record might have three separate attachment fields: one for source code files, one for engineering specifications, and one for documentation.

To manage attachment fields, each Entity object has an AttachmentFields object. To manage individual attachments, each AttachmentField has an Attachments object.

To traverse from an Entity object to an Attachment, you must first get the AttachmentFields object. As you traverse, you can distinguish a general path using the AttachmentField names. Once you are at the level of an actual collection of attachments, you can identify individual attachments using Description and FileName values.

Attachment objects
Description
AttachmentField Object
Represents a single attachment field in a record
AttachmentFields Object
Collection object that represents the attachment fields in a record
Attachment Object
Stores an attachment file and information about it
Attachments Object
Collection object that represents a set of attachments in one attachment field of a record

The AttachmentFields object is a collection of AttachmentField objects. It represents all of the attachment fields associated with a record. There can be only one AttachmentFields object associated with a record. This object contains one or more AttachmentField objects. Its methods provide access to the fields containing attachments.

The AttachmentField object represents a single attachment field in a record. A record can have multiple AttachmentField objects, each of which includes a single Attachments object. An AttachmentField can hold a collection of files, each stored in an individual Attachment object.

The Attachments object is a container object that stores one or more Attachment objects. An Attachments object is always associated with a single AttachmentField object. This object contains all collections the corresponding attachment field has and provides methods to count, get, add, and delete attachments.

An Attachment object contains a single attached file. An Attachment object contains information about a particular attachment such as its description, the original file name, file size, and provides ways to manipulate the attachment.

The following Entity object methods are used to store and manage attachments.

For more information, see AttachmentFields of the Entity Object and "Getting and setting attachment information"