Oracle® Collaboration Suite Workspaces API Reference
10g Release 1 (10.1.2)

B25479-01


oracle.workspaces.container
Class CwWorkspace

java.lang.Object
  extended byoracle.workspaces.container.CwWorkspace

All Implemented Interfaces:
CwEntity

public class CwWorkspace
extends java.lang.Object
implements CwEntity

The object representing a workspace. CwSession provides the methods for creation, deletion and retrieval of the workspaces. This object is the entry point for all methods applicable to a workspace.


Method Summary
void addAttachments(CwUid entityUid, CwAttachmentDefinition attachmentDef)
CwAddWorkspaceMembersResponse addMembers(CwMemberable[] members)
Add the collection of users/groups as the members of the workspace, as well as the roles assigned.
boolean canPerformOperation(CwWorkspaceOperation operation)
Check if the user can perform the specified operation
boolean canPerformOperation(CwWorkspaceOperation operation, CwApplicationRole[] appRoles)
Check if the user can perform the specified operation
CwMemberable createMemberable(CwIdentity identity)
Create an instance CwMemberable to be added into Workspace later.
CwMemberable createMemberable(CwIdentity identity, CwMemberRoleType roleType)
Create an instance CwMemberable to be added into Workspace later with the specific member role type
CwResource createResource(CwResourceDefinition rsrcDef)
Create and add the resource to the workspace.
CwSubgroup createSubgroup(java.lang.String subgroupName, java.lang.String subgroupDisplayName, java.lang.String description, CwMember[] members)
Create and add a subgroup to the workspace.
void deleteResource(CwUid rsrcUid)
void deleteResource(CwUid rsrcUid, boolean recursive)
Delete the specified resource from the current workspace
void deleteResource(CwUid rsrcUid, CwResourceDeletionOptions options)
void deleteResourceIgnoreError(CwUid rsrcUid)
Ingores all errors encountered during the operation and does not mark the workspace for recovery in case of error.
void deleteSubgroup(CwSubgroup subgroup)
Delete a subgroup from the workspace.
CwAnnouncementList getAnnouncementList()
java.lang.String getId()
Returns the workspac id component of the uid of the workspace
CwMember getMemberById(java.lang.String id)
CwMemberRole getMemberRole(CwMemberRoleType roleType)
CwMemberRole getMyRole()
Get my role in the workspace
CwWorkspaceProperties getProperties()
CwResource getResourceByType(CwResourceType rsrcType)
Returns the resource of the specified resource type.
CwResource getResourceByUid(CwUid uid)
Returns the resource with the specified UID.
CwSession getSession()
CwSubgroup getSubgroupById(java.lang.String id)
CwWorkspaceSummary getSummary()
CwUid getUid()
A server-generated unique identifier of the workspace across all workspaces.
CwMember getUserMemberByName(java.lang.String szUserName)
Return the user member based on its name.
boolean isNew()
Returns true if and only if current user's last logout time is < the creation time of this workspace
boolean isNew(java.util.Date startTime)
Returns true if and only if isNew() and the creation time of this workspace > startTime
boolean isUnread()
Returns true if and only if the last modification time of this workspace > current user's last logout time
boolean isUnread(java.util.Date startTime)
Returns true if and only if isUnread() and the last modification time of this workspace > startTime
CwAttachedEntity[] listAllAttachments(CwUid entityUid)
The result is sorted by attachment type
java.util.Map listAllAttachmentsByType(CwUid entityUid)
CwSubgroup[] listAllSubgroups()
Returns the list of workspace subgroups of this workspace.
CwWorkspaceSummary[] listAllSubworkspaces()
Returns the summaries of all subworkspaces.
CwAttachedEntity[] listAttachments(CwUid entityUid)
The result is sorted by attachment type
java.util.Map listAttachmentsByType(CwUid entityUid)
CwMember[] listMembers()
CwSubgroup[] listMySubgroups()
Returns all the subgroups the current use is a member of directly or indirectly.
CwWorkspaceSummary[] listNonMemberSubworkspaces()
Returns the summaries of all publicly listed subworkspaces of which the connected user is not a member
java.util.Map listNumberOfAttachments(CwUid[] entityUids, boolean checkBidirectional)
CwResource[] listResources()
CwAttachedEntity[] listSourceAttachments(CwUid entityUid)
The result is sorted by attachment type
java.util.Map listSourceAttachmentsByType(CwUid entityUid)
CwSubgroup[] listSubgroups(CwMember member)
Returns the list of subgroups of which the given member is directly or indirectly a member of the subgroup.
CwWorkspaceSummary[] listSubworkspaces()
Returns an array of CwWorkspaceSummary of all of the subworkspaces of this workspace to which the calling user has access.
CwMember reassignMemberRole(CwMember member, CwMemberRoleType role)
Assigns the given role to the specified member.
void removeAttachments(CwUid entityUid, CwAttachedEntity[] attachments)
void removeAttachments(CwUid entityUid, CwUid[] attachmentUids)
CwDeleteWorkspaceMembersResponse removeMembers(CwMember[] members)
Delete the collection of users/groups from the workspace.
void storeProperties()
Updates the properties of the workspace.
void syncMembersResourceStatus(CwMember[] members)
Fix the existing members resources status.
void updateAttachments(CwUid entityUid, CwAttachedEntity[] attachments)
void updateAttachments(CwUid entityUid, CwUid[] attachmentUids, java.lang.String[] newDescriptions)

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

addAttachments

public void addAttachments(CwUid entityUid,
                           CwAttachmentDefinition attachmentDef)
                    throws CwException
Throws:
CwException

addMembers

public CwAddWorkspaceMembersResponse addMembers(CwMemberable[] members)
                                         throws CwException
Add the collection of users/groups as the members of the workspace, as well as the roles assigned.

If a user/group is already a member of the workspace, the method will assign additional roles (if any) to the user/group specified in the method.

Throws:
CwException - if the user does not have the privilege to change the membership of the workspace.
CwException - if any of the user/group specified does not exist.

canPerformOperation

public boolean canPerformOperation(CwWorkspaceOperation operation)
                            throws CwException
Check if the user can perform the specified operation
Parameters:
operation - The operation to check for authorization
Returns:
true if the user is authorized to perform the operation
Throws:
CwException

canPerformOperation

public boolean canPerformOperation(CwWorkspaceOperation operation,
                                   CwApplicationRole[] appRoles)
                            throws CwException
Check if the user can perform the specified operation
Parameters:
operation - The operation to check for authorization
Returns:
true if the user is authorized to perform the operation
Throws:
CwException

createMemberable

public CwMemberable createMemberable(CwIdentity identity)
Create an instance CwMemberable to be added into Workspace later. The member role is set to be the default role in workspace.

createMemberable

public CwMemberable createMemberable(CwIdentity identity,
                                     CwMemberRoleType roleType)
Create an instance CwMemberable to be added into Workspace later with the specific member role type

createResource

public CwResource createResource(CwResourceDefinition rsrcDef)
                          throws CwException
Create and add the resource to the workspace.
Returns:
the created resource
Throws:
CwException - if the user does not have the privilege to create the resource
CwException - if the resource to be created does not pass the valiation rules, e.g., the name must be unique across all resources of the workspace.

createSubgroup

public CwSubgroup createSubgroup(java.lang.String subgroupName,
                                 java.lang.String subgroupDisplayName,
                                 java.lang.String description,
                                 CwMember[] members)
                          throws CwException
Create and add a subgroup to the workspace. A subgroup, identified by is name, is unique within a workspace, but not in its subworkspaces.
Parameters:
subgroupName - the name of the subgroup to be added.
members - the members of the subgroup to be created
Returns:
the subgroup created
Throws:
CwException - if the user does not have the privilege to add a subgroup
CwException - if the subgroup to be created already exists in the workspace.

deleteResource

public void deleteResource(CwUid rsrcUid)
                    throws CwException
Throws:
CwException

deleteResource

public void deleteResource(CwUid rsrcUid,
                           boolean recursive)
                    throws CwException
Delete the specified resource from the current workspace
Parameters:
rsrcUid - the ID of the resource
recursive - if true, delete the resource and the resources of the same type in all descendant sub-workspaces.
Throws:
CwException - if the resource does not exist. If the user does not have the access[tbd] privilege to the workspace, the user will get the same exception.
CwException - If the user does not have the privlege to delete the workspace

deleteResource

public void deleteResource(CwUid rsrcUid,
                           CwResourceDeletionOptions options)
                    throws CwException
Throws:
CwException

deleteResourceIgnoreError

public void deleteResourceIgnoreError(CwUid rsrcUid)
                               throws CwException
Ingores all errors encountered during the operation and does not mark the workspace for recovery in case of error.
Throws:
CwException

deleteSubgroup

public void deleteSubgroup(CwSubgroup subgroup)
                    throws CwException
Delete a subgroup from the workspace.
Throws:
CwException - if the user does not have the privilege to delete the subgroup.
CwException - if the subgroup to be deleted does not exist in the workspace

getAnnouncementList

public CwAnnouncementList getAnnouncementList()
                                       throws CwException
Throws:
CwException

getId

public java.lang.String getId()
Returns the workspac id component of the uid of the workspace

getMemberById

public CwMember getMemberById(java.lang.String id)
                       throws CwException
Parameters:
id - the id of the user/group
Returns:
return the member (user/group) of the workspace.
Throws:
CwException - if the user does not have the privilege to get the membership of the workspace.
CwException - if the identified user/group does not exist.
CwException - if the identified user/group is not a directly member of the workspace.

getMemberRole

public CwMemberRole getMemberRole(CwMemberRoleType roleType)

getMyRole

public CwMemberRole getMyRole()
                       throws CwException
Get my role in the workspace
Throws:
CwException - if the user does not exist in Workspace.

getProperties

public CwWorkspaceProperties getProperties()
Returns:
basic properties of the workspace: name, description, configuration options, etc.

getResourceByType

public CwResource getResourceByType(CwResourceType rsrcType)
                             throws CwException
Returns the resource of the specified resource type. This method is a conveninet method for the typical case that there is one resource of a type in a workspace.
Parameters:
rsrcType - the type of the resource
Returns:
the resource requested, that is within this workspace
Throws:
CwException - if the user does not have the access privilege to the workspace
CwException - if the resource does not exist.

getResourceByUid

public CwResource getResourceByUid(CwUid uid)
                            throws CwException
Returns the resource with the specified UID.
Parameters:
uid - the UID of the resource
Returns:
the named resource requested, that is within this workspace
Throws:
CwException - if the user does not have the access privilege to the workspace
CwException - if the resource does not exist.

getSession

public CwSession getSession()
Returns:
the user session under which the workspace object is operating.

getSubgroupById

public CwSubgroup getSubgroupById(java.lang.String id)
                           throws CwException
Parameters:
id - the id of the subgroup
Returns:
return the subgroup of the workspace.
Throws:
CwException - if the user does not have the privilege to get the membership of the workspace.
CwException - if the identified subgroup does not exist in the workspace.

getSummary

public CwWorkspaceSummary getSummary()
                              throws CwException
Returns:
summary of the workspace: ID, name, description, etc.
Throws:
CwException

getUid

public CwUid getUid()
A server-generated unique identifier of the workspace across all workspaces.
Returns:
the unique ID of the workspace

getUserMemberByName

public CwMember getUserMemberByName(java.lang.String szUserName)
                             throws CwException
Return the user member based on its name.
Returns:
return the member (users/groups) of the workspace.
Throws:
CwException - if the user does not have the privilege to get the membership of the workspace.
CwException - if the identified user/group does not exist.
CwException - if the identified user/group is not a member of the workspace.

isNew

public boolean isNew()
              throws CwException
Returns true if and only if current user's last logout time is < the creation time of this workspace
Specified by:
isNew in interface CwEntity
Throws:
CwException

isNew

public boolean isNew(java.util.Date startTime)
              throws CwException
Returns true if and only if isNew() and the creation time of this workspace > startTime
Specified by:
isNew in interface CwEntity
Throws:
CwException

isUnread

public boolean isUnread()
                 throws CwException
Returns true if and only if the last modification time of this workspace > current user's last logout time
Specified by:
isUnread in interface CwEntity
Throws:
CwException

isUnread

public boolean isUnread(java.util.Date startTime)
                 throws CwException
Returns true if and only if isUnread() and the last modification time of this workspace > startTime
Specified by:
isUnread in interface CwEntity
Throws:
CwException

listAllAttachments

public CwAttachedEntity[] listAllAttachments(CwUid entityUid)
                                      throws CwException
The result is sorted by attachment type
Throws:
CwException

listAllAttachmentsByType

public java.util.Map listAllAttachmentsByType(CwUid entityUid)
                                       throws CwException
Throws:
CwException

listAllSubgroups

public CwSubgroup[] listAllSubgroups()
                              throws CwException
Returns the list of workspace subgroups of this workspace. The caller must be the workspace member.
Returns:
all workspace subgroups
Throws:
CwException - if the user does not have the privilege

listAllSubworkspaces

public CwWorkspaceSummary[] listAllSubworkspaces()
                                          throws CwException
Returns the summaries of all subworkspaces. The connected user must be a workspace admin.
Throws:
CwException

listAttachments

public CwAttachedEntity[] listAttachments(CwUid entityUid)
                                   throws CwException
The result is sorted by attachment type
Throws:
CwException

listAttachmentsByType

public java.util.Map listAttachmentsByType(CwUid entityUid)
                                    throws CwException
Throws:
CwException

listMembers

public CwMember[] listMembers()
                       throws CwException
Returns:
return all members (users/groups) of the workspace. The collection is of type CwMember. The resource status of each member is not included in the returned instance. To get the resource status for a member, use CwMember.getResourceStatusMap().
Throws:
CwException - if the user does not have the privilege to get the membership of the workspace.

listMySubgroups

public CwSubgroup[] listMySubgroups()
                             throws CwException
Returns all the subgroups the current use is a member of directly or indirectly.
Throws:
CwException

listNonMemberSubworkspaces

public CwWorkspaceSummary[] listNonMemberSubworkspaces()
                                                throws CwException
Returns the summaries of all publicly listed subworkspaces of which the connected user is not a member
Throws:
CwException

listNumberOfAttachments

public java.util.Map listNumberOfAttachments(CwUid[] entityUids,
                                             boolean checkBidirectional)
                                      throws CwException
Throws:
CwException

listResources

public CwResource[] listResources()
Returns:
the collection of resources directly contained by this workspace. The collection is of type CwResource
Throws:
CwException - if the user does not have the access privilege to the workspace

listSourceAttachments

public CwAttachedEntity[] listSourceAttachments(CwUid entityUid)
                                         throws CwException
The result is sorted by attachment type
Throws:
CwException

listSourceAttachmentsByType

public java.util.Map listSourceAttachmentsByType(CwUid entityUid)
                                          throws CwException
Throws:
CwException

listSubgroups

public CwSubgroup[] listSubgroups(CwMember member)
                           throws CwException
Returns the list of subgroups of which the given member is directly or indirectly a member of the subgroup. The caller must be the workspace admin.
Parameters:
member - the member whose subgroups need to be returned
Returns:
the subgroups of the workspace
Throws:
CwException - if the user does not have the privilege to view others subgroup

listSubworkspaces

public CwWorkspaceSummary[] listSubworkspaces()
                                       throws CwException
Returns an array of CwWorkspaceSummary of all of the subworkspaces of this workspace to which the calling user has access.
Returns:
the array of sub workspaces directly contained by this workspace. The array is of type CwWorkspaceSummary
Throws:
CwException - if the user does not have the access privilege to the workspace

reassignMemberRole

public CwMember reassignMemberRole(CwMember member,
                                   CwMemberRoleType role)
                            throws CwException
Assigns the given role to the specified member.
Returns:
the member with the new role
Throws:
CwException - if the member is workspace owner and try to assign to a non-admin role
CwException - if member does not belong to the workspace
java.lang.IllegalArgumentException - if
role
is null.
java.lang.IllegalArgumentException - if
workspace
is not the same as in
member
.

removeAttachments

public void removeAttachments(CwUid entityUid,
                              CwAttachedEntity[] attachments)
                       throws CwException
Throws:
CwException

removeAttachments

public void removeAttachments(CwUid entityUid,
                              CwUid[] attachmentUids)
                       throws CwException
Throws:
CwException

removeMembers

public CwDeleteWorkspaceMembersResponse removeMembers(CwMember[] members)
                                               throws CwException
Delete the collection of users/groups from the workspace.
Parameters:
members - a collection of users/groups of type cwMember to be deleted as the member of the workspace.
Throws:
CwException - if the user does not have the privilege to change the membership of the workspace.
CwException - if any of the user/group specified does not exist.

storeProperties

public void storeProperties()
                     throws CwException
Updates the properties of the workspace.
Throws:
CwException - if the user does not have the privilege to update the workspace
CwException - if the properties to be updated does not pass the validation rules, e.g., the restriction on name.

syncMembersResourceStatus

public void syncMembersResourceStatus(CwMember[] members)
                               throws CwException
Fix the existing members resources status. We do not have the option to fix a specific resource (Files, Calendar, Threaded Discussions) yet. So this call will try to fix all the resources for a given member. The latest resource status is saved in the member instance.
Throws:
CwException - if the user does not have the privilege (ADMIN) to fix the membership of the workspace.

updateAttachments

public void updateAttachments(CwUid entityUid,
                              CwAttachedEntity[] attachments)
                       throws CwException
Throws:
CwException

updateAttachments

public void updateAttachments(CwUid entityUid,
                              CwUid[] attachmentUids,
                              java.lang.String[] newDescriptions)
                       throws CwException
Throws:
CwException

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