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

B25479-01


oracle.workspaces.session
Class CwSession

java.lang.Object
  extended byoracle.workspaces.session.CwSession

All Implemented Interfaces:
java.io.Serializable

public class CwSession
extends java.lang.Object
implements java.io.Serializable

This class represents a valid user session in the workspace application. The reason to make it extend Serializable is to be able to put into HttpSession in the web tier to make the Workspace application cluster-friendly.

For one specific user, there could be more than one session in the workspace.

See Also:
Serialized Form

Method Summary
void addToFavoriteWorkspaces(CwUid[] workspaceUids)
boolean canPerformOperation(CwSystemOperation operation)
Checks if the current session is authorized to perform the specified system operation
boolean canPerformOperation(CwSystemOperation operation, CwApplicationRole[] appRoles)
TBD: Temp Operation to be fixed (see NOTE below) Checks if the current session is authorized to perform the specified system operation
boolean canPerformOperation(CwWorkspaceOperation operation, CwApplicationRole[] appRoles, CwWorkspaceSummary wspcSum)
TBD: Temp Operation to be fixed (see NOTE below) Checks if the current session is authorized to perform the specified workspace operation
CwWorkspace createWorkspace(CwWorkspaceDefinition wsDef)
Create a workspace with the supplied configurations.
java.lang.String createWorkspaceTemplate(CwWorkspaceTemplateDefinition tmplDef)
Creates a template based on a given workspace.
void deleteWorkspaceByPath(java.lang.String path, boolean recursive, boolean ignoreErrors)
Remove an existing workspace given the absolute path to the workspace, analogous to deleteWorkspaceByUid(CwUid, boolean, boolean)
void deleteWorkspaceByPath(java.lang.String path, boolean recursive, boolean ignoreErrors, CwResourceDeletionOptions[] resDelOptions)
Remove an existing workspace given the absolute path to the workspace, analogous to deleteWorkspaceByUid(CwUid, boolean, boolean, CwResourceDeletionOptions[])
void deleteWorkspaceByUid(CwUid workspaceUid, boolean recursive, boolean ignoreErrors)
Drop an existing workspace given the ID of the workspace
void deleteWorkspaceByUid(CwUid workspaceUid, boolean recursive, boolean ignoreErrors, CwResourceDeletionOptions[] resDelOptions)
Drop an existing workspace given the ID of the workspace
void deleteWorkspaceTemplate(java.lang.String templateName)
Deletes the named template
java.util.Map getAllCwApplicationProperties()
Returns the name-value pairs for all CW application properties
CwApplicationRole[] getApplicationRoles(CwIdentity identity)
long getCreatedTime()
Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT.
java.lang.String getCwApplicationPropertyValue(java.lang.String propertyName)
Returns the value of the given CW application property
java.io.Reader getCwTemplateSchema()
Returns the XML schema for CW templates
java.lang.Object getEntityByUid(CwUid uid)
Returns the CW entity with the given CwUid
java.lang.String getId()
Returns a string containing the unique identifier assigned to this session.
java.util.Date getLastLoginTime()
Returns last SSO login time of the connected user
java.util.Date getLastLogoutTime()
Returns last SSO logout time of the connected user
java.util.Locale getLocale()
Returns the locale of the connected user
int getMaxInactiveInterval()
Get the maximum time interval in seconds.
CwApplicationRole[] getMyApplicationRoles()
Returns my own application grant in CW Application
CwUserPresenceStatus[] getPresenceStatus(CwUser[] users)
CwResourceSession getResourceSession(CwResourceType type)
Get the attribute
CwSearchSession getSearchSession()
Gets a search session object
boolean getSystemAdministratorMode()
Get the system administrator mode for the session
CwUser getUser()
Get the user associated with this session
CwWorkspace getWorkspaceByPath(java.lang.String path)
CwWorkspace getWorkspaceByUid(CwUid workspaceUid)
CwWorkspace getWorkspaceByUidForAppAdmin(CwUid workspaceUid)
An app admin can use this method for fetching a ws of which she is not a member.
CwWorkspaceTemplate getWorkspaceTemplate(java.lang.String templateName)
Fetches the named workspace template
void grant(CwApplicationRole appRole, CwIdentity identity)
Grant application role to an identity.
CwWorkspaceSummary[] listAllWorkspaces()
CwWorkspaceRecoveryInfo[] listAllWorkspacesRecoveryInfo()
java.util.Map listApplicationRoles()
List all the application roles have been directly granted in CW application for all the user/members as a map which is keyed from CwIdentity to oracle.workspaces.authorization.CwApplicationRole[].
CwFailedOperationInfo[] listFailedSystemOperationInfo()
CwWorkspaceSummary[] listFavoriteWorkspaces()
CwWorkspaceSummary[] listMyWorkspaces()
CwWorkspaceSummary[] listMyWorkspaces(CwQuerySortContext sortCtx)
List summaries of all workspaces the connected user is a member of.
CwWorkspaceRecoveryInfo[] listMyWorkspacesRecoveryInfo()
CwWorkspaceSummary[] listNonMemberWorkspaces()
Lists the summaries of all publicly listed top-level workspaces of which the connected user is not a member
CwWorkspaceSummary[] listOrphanedWorkspaces()
CwWorkspaceTemplate[] listWorkspaceTemplates()
Returns the list of workspace templates stored in the CwRepository
void recoverOperation(long opInstanceId, boolean force)
void recoverWorkspace(CwUid workspaceUid, boolean force)
void removeFromFavoriteWorkspaces(CwUid[] workspaceUids)
CwResourceSession removeResourceSession(CwResourceType type)
Remove the attribute
void revoke(CwApplicationRole appRole, CwIdentity identity)
Revoke application role from an identity.
CwSearchResults search(oracle.search.Query query)
Searches for workspaces/resource items based on their properties or content.
void setCwApplicationPropertyDefaultValues()
Sets the default values of all CW application properties
void setCwApplicationPropertyDefaultValues(java.lang.String[] propertyNames)
Sets the default values of the given CW application properties
void setCwApplicationPropertyValue(java.lang.String propertyName, java.lang.String propertyValue)
Sets the value of the given CW application property
void setCwApplicationPropertyValues(java.util.Map propertyValueMap)
Sets the values of the given CW application properties
void setResourceSession(CwResourceType type, CwResourceSession session)
Set an object in the session refrerenced by the name.
void setSearchSession(CwSearchSession searchSession)
Sets the search session object
void setSystemAdministratorMode(boolean systemAdminMode)
Get the maximum time interval in seconds.
void storeWorkspaceTemplate(CwWorkspaceTemplate template)
Stores the given template in CwRepository
void storeWorkspaceTemplate(java.lang.String templateSpecification)
Stores the given template in CwRepository

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

Method Detail

addToFavoriteWorkspaces

public void addToFavoriteWorkspaces(CwUid[] workspaceUids)
                             throws CwException
Throws:
CwException

canPerformOperation

public boolean canPerformOperation(CwSystemOperation operation)
                            throws CwException
Checks if the current session is authorized to perform the specified system operation
Parameters:
operation - The operation to authorize the current session for
Returns:
true if the current session is authorized to perform the operation
Throws:
CwException

canPerformOperation

public boolean canPerformOperation(CwSystemOperation operation,
                                   CwApplicationRole[] appRoles)
                            throws CwException
TBD: Temp Operation to be fixed (see NOTE below) Checks if the current session is authorized to perform the specified system operation
Parameters:
operation - The operation to authorize the current session for
Returns:
true if the current session is authorized to perform the operation NOTE: We are making this method public as a temporary solution to the caching issue. We are pushing the responsibility of maintaining the cache to the UI layer. Eventually, that responsibility has to move to the SDK and then the API below should disappear.
Throws:
CwException

canPerformOperation

public boolean canPerformOperation(CwWorkspaceOperation operation,
                                   CwApplicationRole[] appRoles,
                                   CwWorkspaceSummary wspcSum)
                            throws CwException
TBD: Temp Operation to be fixed (see NOTE below) Checks if the current session is authorized to perform the specified workspace operation
Parameters:
operation - The operation to authorize the current session for
Returns:
true if the current session is authorized to perform the operation NOTE: We are making this method public as a temporary solution to the issue that listMyWorkspaces returns CwWorkspaceSummary[]. In the UI in CwHome, we have check if the user can "DELETE" a workspace - we have to do that using the Summary so as to not do another DB trip. Eventually, when we have the listMyWspcs issue sorted out, this API should disappear and the API oracle.workspaces.CwWorkspace.canPerformOperation() should be used
Throws:
CwException

createWorkspace

public CwWorkspace createWorkspace(CwWorkspaceDefinition wsDef)
                            throws CwException
Create a workspace with the supplied configurations.

Note: To create a sub workspace under an existing workspace. either set existing workspace ID in the parentId property of wsDef parameter or specify the complete path name of the workspace

Parameters:
wsDef - contains name, description, template, initial set of members etc.
Throws:
CwException - if the user does not have the privilege to create the workspace
CwException - if the workspace to be created does not pass the valiation rules, e.g., the name must be unique.

createWorkspaceTemplate

public java.lang.String createWorkspaceTemplate(CwWorkspaceTemplateDefinition tmplDef)
                                         throws CwException
Creates a template based on a given workspace. The template is not stored in the CW repository (use storeWorkspaceTemplate for storing the template).
Parameters:
tmplDef - options for creating the template
Returns:
XML string for the template

open: templatizing options

Throws:
CwException - if the user is not a workspace administrator or invalid template properties are sepcified

deleteWorkspaceByPath

public void deleteWorkspaceByPath(java.lang.String path,
                                  boolean recursive,
                                  boolean ignoreErrors)
                           throws CwException
Remove an existing workspace given the absolute path to the workspace, analogous to deleteWorkspaceByUid(CwUid, boolean, boolean)
Throws:
CwException

deleteWorkspaceByPath

public void deleteWorkspaceByPath(java.lang.String path,
                                  boolean recursive,
                                  boolean ignoreErrors,
                                  CwResourceDeletionOptions[] resDelOptions)
                           throws CwException
Remove an existing workspace given the absolute path to the workspace, analogous to deleteWorkspaceByUid(CwUid, boolean, boolean, CwResourceDeletionOptions[])
Throws:
CwException

deleteWorkspaceByUid

public void deleteWorkspaceByUid(CwUid workspaceUid,
                                 boolean recursive,
                                 boolean ignoreErrors)
                          throws CwException
Drop an existing workspace given the ID of the workspace
Parameters:
workspaceUid - the UID of the workspace to be removed
recursive - drop the workspace even if the workspace contains resources or sub workspaces.
ignoreErrors - drop the workspace even if errors are encountered. Note: ignoreErrors -> recursive
Throws:
CwException - if the user does not have the privilege to delete the workspace
CwException - if the workspace contains resources or sub workspaces, and the caller specify force to false.
CwException - open: if there are active sessions connected to the workspace.
CwException - if a SQL exception is encountered in accessing the CW Repository

deleteWorkspaceByUid

public void deleteWorkspaceByUid(CwUid workspaceUid,
                                 boolean recursive,
                                 boolean ignoreErrors,
                                 CwResourceDeletionOptions[] resDelOptions)
                          throws CwException
Drop an existing workspace given the ID of the workspace
Parameters:
workspaceUid - the UID of the workspace to be removed
recursive - drop the workspace even if the workspace contains resources or sub workspaces.
ignoreErrors - drop the workspace even if errors are encountered. Note: ignoreErrors -> recursive
resDelOptions - resource deletion options
Throws:
CwException - if the user does not have the privilege to delete the workspace
CwException - if the workspace contains resources or sub workspaces, and the caller specify force to false.
CwException - open: if there are active sessions connected to the workspace.
CwException - if a SQL exception is encountered in accessing the CW Repository

deleteWorkspaceTemplate

public void deleteWorkspaceTemplate(java.lang.String templateName)
                             throws CwException
Deletes the named template
Parameters:
templateName - name of the template to be dropped
Throws:
CwException - if the user does not have sufficient privileges to drop the template or properties are sepcified

getAllCwApplicationProperties

public java.util.Map getAllCwApplicationProperties()
                                            throws CwException
Returns the name-value pairs for all CW application properties
Throws:
CwException

getApplicationRoles

public CwApplicationRole[] getApplicationRoles(CwIdentity identity)
                                        throws CwException
Parameters:
identity - a user/group, whose grantables are to be listed.
Returns:
the list of system grantables, e.g., application-level roles, of the grantees. it must be non-null.
Throws:
CwException - if the authenticated user does not have sufficient privileges to perform the action.

getCreatedTime

public long getCreatedTime()
Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT.
Returns:
the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT.

getCwApplicationPropertyValue

public java.lang.String getCwApplicationPropertyValue(java.lang.String propertyName)
                                               throws CwException
Returns the value of the given CW application property
Parameters:
propertyName - The name of the property
Returns:
value of the given CW application property
Throws:
CwException

getCwTemplateSchema

public java.io.Reader getCwTemplateSchema()
                                   throws CwException
Returns the XML schema for CW templates
Returns:
character stream for XML schema for CW templates
Throws:
CwException

getEntityByUid

public java.lang.Object getEntityByUid(CwUid uid)
                                throws CwException
Returns the CW entity with the given CwUid
Returns:
The CW entity with the given CwUid
Throws:
CwException

getId

public java.lang.String getId()
Returns a string containing the unique identifier assigned to this session.
Returns:
a string containing the unique identifier assigned to this session.

getLastLoginTime

public java.util.Date getLastLoginTime()
                                throws CwException
Returns last SSO login time of the connected user
Throws:
CwException

getLastLogoutTime

public java.util.Date getLastLogoutTime()
                                 throws CwException
Returns last SSO logout time of the connected user
Throws:
CwException

getLocale

public java.util.Locale getLocale()
Returns the locale of the connected user

getMaxInactiveInterval

public int getMaxInactiveInterval()
Get the maximum time interval in seconds.
Returns:
the timeout value in milliseconds.

getMyApplicationRoles

public CwApplicationRole[] getMyApplicationRoles()
                                          throws CwException
Returns my own application grant in CW Application
Throws:
CwException

getPresenceStatus

public CwUserPresenceStatus[] getPresenceStatus(CwUser[] users)
                                         throws CwException
Throws:
CwException

getResourceSession

public CwResourceSession getResourceSession(CwResourceType type)
Get the attribute

getSearchSession

public CwSearchSession getSearchSession()
Gets a search session object
Returns:
search session associated with this session

getSystemAdministratorMode

public boolean getSystemAdministratorMode()
Get the system administrator mode for the session
Returns:
the value of the systemAdministratorMode.

getUser

public CwUser getUser()
Get the user associated with this session
Returns:
the user

getWorkspaceByPath

public CwWorkspace getWorkspaceByPath(java.lang.String path)
                               throws CwException
Parameters:
path - the absolute path of the workspace requested
Returns:
the non-null workspace object requested.
Throws:
CwException - if the workspace does not exist. If the user does not have the access privilege to the workspace, the user will also get the same exception, ie, the user cannot differentiate between a workspace that does not exist and a workspace to which the user does not have access privilege.

getWorkspaceByUid

public CwWorkspace getWorkspaceByUid(CwUid workspaceUid)
                              throws CwException
Parameters:
workspaceUid - the UID of the workspace requested
Returns:
the non-null workspace object requested
Throws:
CwException - if the workspace does not exist. If the user does not have the access privilege to the workspace, the user will also get the same exception, ie, the user cannot differentiate between a workspace that does not exist and a workspace to which the user does not have access privilege.

getWorkspaceByUidForAppAdmin

public CwWorkspace getWorkspaceByUidForAppAdmin(CwUid workspaceUid)
                                         throws CwException
An app admin can use this method for fetching a ws of which she is not a member.
Parameters:
workspaceUid - the UID of the workspace requested
Returns:
the non-null workspace object requested
Throws:
CwException

getWorkspaceTemplate

public CwWorkspaceTemplate getWorkspaceTemplate(java.lang.String templateName)
                                         throws CwException
Fetches the named workspace template
Parameters:
templateName - name of the template to be fetched
Returns:
Java object representing the template
Throws:
CwException - if the user does not have sufficient privileges to fetch the template or the the template does not exist.

grant

public void grant(CwApplicationRole appRole,
                  CwIdentity identity)
           throws CwException
Grant application role to an identity. If the identity already has the role, this call does not complain.
Parameters:
appRole - the application-level role to be granted.
identity - a user/group, to whom the role is granted
Throws:
CwException - if the authenticated user does not have sufficient privileges to perform the action.
CwException - if the identity already has the role

listAllWorkspaces

public CwWorkspaceSummary[] listAllWorkspaces()
                                       throws CwException
Throws:
CwException

listAllWorkspacesRecoveryInfo

public CwWorkspaceRecoveryInfo[] listAllWorkspacesRecoveryInfo()
                                                        throws CwException
Throws:
CwException

listApplicationRoles

public java.util.Map listApplicationRoles()
                                   throws CwException
List all the application roles have been directly granted in CW application for all the user/members as a map which is keyed from CwIdentity to oracle.workspaces.authorization.CwApplicationRole[].
Throws:
CwException - if the retrieval failed

listFailedSystemOperationInfo

public CwFailedOperationInfo[] listFailedSystemOperationInfo()
                                                      throws CwException
Throws:
CwException

listFavoriteWorkspaces

public CwWorkspaceSummary[] listFavoriteWorkspaces()
                                            throws CwException
Throws:
CwException

listMyWorkspaces

public CwWorkspaceSummary[] listMyWorkspaces()
                                      throws CwException
Throws:
CwException

listMyWorkspaces

public CwWorkspaceSummary[] listMyWorkspaces(CwQuerySortContext sortCtx)
                                      throws CwException
List summaries of all workspaces the connected user is a member of. TBD: Do we need methods to list workspace objects/properties instead of summaries

open: supporting paging support deferred.

open: support for search criteria deferred.

Parameters:
sortCtx - sorting specification
Returns:
the collection of workspaces the connected user is a member of
Throws:
CwException

listMyWorkspacesRecoveryInfo

public CwWorkspaceRecoveryInfo[] listMyWorkspacesRecoveryInfo()
                                                       throws CwException
Throws:
CwException

listNonMemberWorkspaces

public CwWorkspaceSummary[] listNonMemberWorkspaces()
                                             throws CwException
Lists the summaries of all publicly listed top-level workspaces of which the connected user is not a member
Throws:
CwException

listOrphanedWorkspaces

public CwWorkspaceSummary[] listOrphanedWorkspaces()
                                            throws CwException
Throws:
CwException

listWorkspaceTemplates

public CwWorkspaceTemplate[] listWorkspaceTemplates()
                                             throws CwException
Returns the list of workspace templates stored in the CwRepository

Open: list only templates matching a given search criteria

Returns:
Array of workspace templates
Throws:
CwException - if the user does not have sufficient privileges to list the templates

recoverOperation

public void recoverOperation(long opInstanceId,
                             boolean force)
                      throws CwException
Parameters:
opInstanceId - id of the failed operation (e.g., grant application role)
force - if true, errors will be ignored
Throws:
CwException - if the authenticated user does not have sufficient privileges to perform the action or if recovery fails

recoverWorkspace

public void recoverWorkspace(CwUid workspaceUid,
                             boolean force)
                      throws CwException
Parameters:
workspaceUid - CwUid of the workspace to be recovered
force - if true, errors will be ignored
Throws:
CwException - if the authenticated user does not have sufficient privileges to perform the action or if recovery fails

removeFromFavoriteWorkspaces

public void removeFromFavoriteWorkspaces(CwUid[] workspaceUids)
                                  throws CwException
Throws:
CwException

removeResourceSession

public CwResourceSession removeResourceSession(CwResourceType type)
Remove the attribute

revoke

public void revoke(CwApplicationRole appRole,
                   CwIdentity identity)
            throws CwException
Revoke application role from an identity. If the identity does not have the role, this call does not complain at all.
Parameters:
appRole - the application-level role to be revoked.
identity - a user/group, to whom the role is granted
Throws:
CwException - if the authenticated user does not have sufficient privileges to perform the action.

search

public CwSearchResults search(oracle.search.Query query)
                       throws CwException
Searches for workspaces/resource items based on their properties or content.
Parameters:
query - the search query to execute. This method can be used to search for workspaces as well as workspace content. To construct the Query, oracle.search.SimpleQuery object can be instantiated and following set methods cane be used to as described.

setSelectedPropertyNames - currently not supported. A fixed list of properties are returned.
setScope - Please see oracle.workspaces.search.CwSearchContainer class to define the scope.
setBasicSearchTerm - The supplied text string is searched as whole words in NAME, DISPLAY_NAME, DESCRIPTION or CONTENT in resource item or workspace properties, wherever applicable.. The search is not case sensitive. The keywords can be connected by AND/OR conditions.
setPredicate - currently not supported
setOrderBy - currently not supported for content search. Some content type may choose one of the properties as sorting property. For workspace search, CwWorkspace.ORB_ARG_NAME, CwWorkspace.ORB_ARG_PATH, CwWorkspace.ORB_ARG_OWNER can be used as sortable properties. setRowStart - can be used to get results in chunks. This specifies the row number of the first result setRowLimit - the number of results can be limited using this parameter
setParameters - currently not supported

Returns:
Throws:
CwException
See Also:
CwSearchContainer

setCwApplicationPropertyDefaultValues

public void setCwApplicationPropertyDefaultValues()
                                           throws CwException
Sets the default values of all CW application properties
Throws:
CwException

setCwApplicationPropertyDefaultValues

public void setCwApplicationPropertyDefaultValues(java.lang.String[] propertyNames)
                                           throws CwException
Sets the default values of the given CW application properties
Parameters:
propertyNames - Names of the properties whose default values are to be set
Throws:
CwException

setCwApplicationPropertyValue

public void setCwApplicationPropertyValue(java.lang.String propertyName,
                                          java.lang.String propertyValue)
                                   throws CwException
Sets the value of the given CW application property
Parameters:
propertyName - The name of the property
propertyValue - The value of the property
Throws:
CwException

setCwApplicationPropertyValues

public void setCwApplicationPropertyValues(java.util.Map propertyValueMap)
                                    throws CwException
Sets the values of the given CW application properties
Parameters:
propertyValueMap - Map of property name-value pairs
Throws:
CwException

setResourceSession

public void setResourceSession(CwResourceType type,
                               CwResourceSession session)
Set an object in the session refrerenced by the name. All the resource session oracle.workspaces.resource.CwResourceSession could be added here.

setSearchSession

public void setSearchSession(CwSearchSession searchSession)
                      throws CwException
Sets the search session object
Parameters:
searchSession - the search session to be set
Throws:
CwException

setSystemAdministratorMode

public void setSystemAdministratorMode(boolean systemAdminMode)
                                throws CwException
Get the maximum time interval in seconds.
Throws:
CwException

storeWorkspaceTemplate

public void storeWorkspaceTemplate(CwWorkspaceTemplate template)
                            throws CwException
Stores the given template in CwRepository
Parameters:
template - template to be stored
Throws:
CwException - if the user does not have sufficient privileges or the template already exists

storeWorkspaceTemplate

public void storeWorkspaceTemplate(java.lang.String templateSpecification)
                            throws CwException
Stores the given template in CwRepository
Parameters:
templateSpecification - XML specification for the template that conforms to the XML schema for workspace templates (http://www.oracle.com/cw/wstemplate)
Throws:
CwException - if the user does not have sufficient privileges, an invalid template specification is passed or the template already exists

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