The Collaboration API contains elements that enable developers to create, store, and manage email and message transactions for use in teamspace operations, such as alerting members to subscribed events. Messages may contain attachments, and may be constructed from templates stored in the Collaboration Store. Key email elements are:
An email object is created when the following information is assembled into an EmailInfo object and added to the target teamspace's email container through the Container object's addContainee method:
The following code describes how an Email object might be created in a known object store and teamspace (for information on teamspace objects, see Teamspaces; for information on creating and managing object stores, see the Content Java API topic, Working With Object Stores).
// create a new EmailInfo object
EmailInfo emailInfo = new EmailInfo(targetTeamspaceObject, messageContent, ownerID);
ContainerManager containerManager = containingTeamspace.getContainerManager();
Container emailContainer = (Container)
containerManager.getContainerByDefinitionID (Collaboration.COLLABORATION_EMAIL_CONTAINER_DEFID);
Email emailObject = (Email)emailContainer.addContainee(emailInfo);
The Collaboration API methods Container.getContainees() and Container.getContaineesXML() should not be used for retrieval of email containee objects. These methods may be used to retrieve top-level containee objects on all containers except the email container. Email objects should only be retrieved using a query filter. Also note that the email container's getContainees() and getContaineesXML() methods throw UnsupportedContainerCapabilityException.
For information on how teamspace email objects are created and managed within the Team Collaboration Manager application, see Working with Email Functions.