Oracle© Collaboration Suite Workspaces Web Services API Reference
10g Release 1 (10.1.2.2)

Part No. B28209-01


oracle.workspaces.ws
Interface AttachmentsService


public interface AttachmentsService

AttachmentsService provides methods to operate on attachments within a workspace.

In a collaborative environment it is useful to attach one collaborative entity with another. For example, a discussion thread can be attached to a file to enable discussion on the file. Multiple entities can be attached to an entity. An entity can be queried for the entities attached to it (target attachments) and the entities to which the given entity is attached (source attachments).

The Axis specific code snippet given below, illustrates how attachments can be added to a given resource item within a workspace.

 // Invoke an instance of attachment service locator and get a handle to attachment service.
 AttachmentsServiceServiceLocator assl = new AttachmentsServiceServiceLocator();
 attachmentService = assl.getAttachmentsService();
 AttachmentDefinition[] aDefArray = new AttachmentDefinition[1];
 AttachmentDefinition aDef1 = new AttachmentDefinition();
 aDef1.setDescription("Adding attachments as links");
 aDef1.setEntityId(taskUid02); // taskUId02 is the UID of task being attached
 attachmentService.addAttachments(wspcUid, m_taskUid01,aDefArray); 
 // wspcUid is the UID of workspace in which attachments are to be created and
 // taskUId01 is the UID of source entity to which the attachments are being added.
 

Method Summary
 void addAttachments(java.lang.String wspcUid, java.lang.String itemUid, AttachmentDefinition[] attDef)
          Adds an attachment for the specified workspace element.
 AttachedItem[] listAllAttachments(java.lang.String wspcUid, java.lang.String itemUid)
          Lists various attachments for the workspace element specified.
 AttachedItem[] listSourceAttachments(java.lang.String wspcUid, java.lang.String itemUid)
          Lists all the source attachments for the workspace element specified.
 AttachedItem[] listTargetAttachments(java.lang.String wspcUid, java.lang.String itemUid)
          Lists all the target attachments for the workspace element specified.
 void removeAttachments(java.lang.String wspcUid, java.lang.String itemUid, AttachedItem[] attachments)
          Removes the attachments for the workspace element specified.
 void updateAttachments(java.lang.String wspcUid, java.lang.String itemUid, AttachedItem[] attachments)
          Updates the attachments for the workspace element specified.

 

Method Detail

addAttachments

public void addAttachments(java.lang.String wspcUid,
                           java.lang.String itemUid,
                           AttachmentDefinition[] attDef)
                    throws CwWSException
Adds an attachment for the specified workspace element.
Parameters:
attDef - - attachment definition representing the attachment properties.
itemUid - - UID representing the workspace element from which the attachment is created
wspcUid - - UID of the workspace in which the attachment is being created.
Throws:
CwWSException - - If objects passed are null or invalid

listAllAttachments

public AttachedItem[] listAllAttachments(java.lang.String wspcUid,
                                         java.lang.String itemUid)
                                  throws CwWSException
Lists various attachments for the workspace element specified.
Parameters:
itemUid - - Item for which the attachments are to be listed.
wspcUid - - workspace in which the attachments are to be listed.
Returns:
AttachedItem[] - array of beans representing the various attachments for this element.
Throws:
CwWSException - - If objects passed are null or invalid

listTargetAttachments

public AttachedItem[] listTargetAttachments(java.lang.String wspcUid,
                                            java.lang.String itemUid)
                                     throws CwWSException
Lists all the target attachments for the workspace element specified.
Parameters:
itemUid - - Item for which the attachments are to be listed.
wspcUid - - workspace in which the attachments are to be listed.
Returns:
AttachedItem[] - array of beans representing the various attachments for this element.
Throws:
CwWSException - - If objects passed are null or invalid

listSourceAttachments

public AttachedItem[] listSourceAttachments(java.lang.String wspcUid,
                                            java.lang.String itemUid)
                                     throws CwWSException
Lists all the source attachments for the workspace element specified.
Parameters:
itemUid - - Item for which the attachments are to be listed.
wspcUid - - workspace in which the attachments are to be listed.
Returns:
- AttachedItem[] - array of beans representing the various attachments for this element.
Throws:
CwWSException - - If objects passed are null or invalid

removeAttachments

public void removeAttachments(java.lang.String wspcUid,
                              java.lang.String itemUid,
                              AttachedItem[] attachments)
                       throws CwWSException
Removes the attachments for the workspace element specified.
Parameters:
attachments - - AttachedItem[] - array of beans representing the various attachments for this element, to be removed.
itemUid - - Item for which the attachments are to be removed
wspcUid - - workspace in which the attachments are to be removed.
Throws:
CwWSException - - If objects passed are null or invalid

updateAttachments

public void updateAttachments(java.lang.String wspcUid,
                              java.lang.String itemUid,
                              AttachedItem[] attachments)
                       throws CwWSException
Updates the attachments for the workspace element specified.
Parameters:
attachments - - AttachedItem[] - array of beans representing the various attachments for this element, to be updated
itemUid - - Item for which the attachments are to be updates
wspcUid - - workspace in which the attachments are to be updated.
Throws:
CwWSException - - If objects passed are null or invalid

Copyright © 2001, 2006, Oracle. All rights reserved.