com.ibm.commerce.collaboration.workspaces.commands
Class CreateSpaceCtrlCmdImpl

com.ibm.commerce.command.AbstractECTargetableCommand
  |
  +--com.ibm.commerce.command.ControllerCommandImpl
        |
        +--com.ibm.commerce.tools.command.ToolsControllerCommandImpl
              |
              +--com.ibm.commerce.collaboration.workspaces.commands.CreateSpaceCtrlCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, CreateSpaceCtrlCmd, ECCommand, ECTargetableCommand, Protectable, ToolsControllerCommand

public class CreateSpaceCtrlCmdImpl
extends ToolsControllerCommandImpl
implements CreateSpaceCtrlCmd

Creates a new collaborative workspace. The QuickPlace associated with the collaborative workspace will be created on the QuickPlace server, and the corresponding LDAP entries will be created in the LDAP directory.

Behaviour

The command does the following:

  1. Generates a unique collaborative workspace Id based on the date of creation and a string of random numbers.
  2. Gets the DN (distinguished name) of the user requesting the new collaborative workspace.
  3. Creates an instance of the CollabManagerAccessBean.
  4. Creates an instance of the CollabSpaceBean.
  5. Sets the CollabSpaceBean with the following fields: Creator DN, collaborative workspace Id, collaborative workspace name, collaborative workspace description, process Id, process Type, template name, and account Id.
  6. Calls the createCollabSpace method in the access bean to create a new collaborative workspace.
  7. If the collaborative workspace is created successfully, the command returns the URL associated with the new QuickPlace in the responseProperties object.

Exception Conditions

If the collaborative workspace name or template name parameters are missing, the command sets the _ERR_MISSING_CMD_PARAMETER exception task to handle the error.

If the collaborative workspace cannot be created due to an LDAP error, the command sets the EC_ERROR_LDAP_DOWN exception task to handle the error.

If the collaborative workspace cannot be created due to a QuickPlace server error, the command sets the EC_ERROR_QP_DOWN exception task to handle the error.


Field Summary
static java.lang.String CLASSNAME
           
static java.lang.String COPYRIGHT
           
 
Fields inherited from class com.ibm.commerce.command.ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
 
Fields inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.collaboration.workspaces.commands.CreateSpaceCtrlCmd
defaultCommandClassName, NAME
 
Constructor Summary
CreateSpaceCtrlCmdImpl()
           
 
Method Summary
 int generateANumber()
          Generates a random string of numbers.
 java.lang.String generateCollabSpaceName(java.lang.String bProcType, java.lang.String bProcID)
          Generates a unique collaborative workspace Id based on the date of creation and a random string of numbers.
 java.lang.String getAccountId()
          Gets the unique identifier of the account associated with the collaborative workspace.
 java.lang.String getCollabSpaceDescription()
          Gets the description of the collaborative workspace.
 java.lang.String getCollabSpaceName()
          Gets the name of the collaborative workspace.
 java.lang.String getProcessId()
          Gets the unique identifier of the process associated with the collaborative workspace.
 java.lang.String getProcessType()
          Gets the process type of the collaborative workspace.
 AccessVector getResources()
          Gets the access control resources corresponding to the command.
 java.lang.String getTemplateName()
          Gets the name of the QuickPlace template that will be used to create the collaborative workspace.
 void performExecute()
          Contains the business logic for the command.
 void setAccountId(java.lang.String newAccountId)
          Sets the unique identifier of the account associated with the collaborative workspace to a local variable.
 void setCollabSpaceDescription(java.lang.String newCollabSpaceDescription)
          Sets the description of the collaborative workspace to a local variable.
 void setCollabSpaceName(java.lang.String newCollabSpaceName)
          Sets the name of the collaborative workspace to a local variable.
 void setProcessId(java.lang.String newProcessId)
          Sets the unique identifier of the process associated with the collaborative workspace to a local variable.
 void setProcessType(java.lang.String newProcessType)
          Sets the process type associated with the collaborative workspace Id.
 void setRequestProperties(TypedProperty reqParms)
          Gets the input parameters from the requestProperties object and sets each parameter to a local variable.
 void setTemplateName(java.lang.String newTemplateName)
          Sets the name of the QuickPlace template that will be used to create the collaborative workspace.
 void validateParameters()
          Validates that the syntax of the input parameters are correct.
 
Methods inherited from class com.ibm.commerce.tools.command.ToolsControllerCommandImpl
getViewInputProperties
 
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command.AccCommand
accessControlCheck, getAccCheck, getForUserId, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
 

Field Detail

CLASSNAME

public static final java.lang.String CLASSNAME

COPYRIGHT

public static final java.lang.String COPYRIGHT
Constructor Detail

CreateSpaceCtrlCmdImpl

public CreateSpaceCtrlCmdImpl()
Method Detail

generateANumber

public int generateANumber()
Generates a random string of numbers.
Returns:
A random number.

generateCollabSpaceName

public java.lang.String generateCollabSpaceName(java.lang.String bProcType,
                                                java.lang.String bProcID)
Generates a unique collaborative workspace Id based on the date of creation and a random string of numbers.
Parameters:
bProcType - The process type associated with the collaborative workspace.
bProcID - The process Id associated with the collaborative workspace.
Returns:
A unique collaborative workspace Id.

getAccountId

public java.lang.String getAccountId()
Gets the unique identifier of the account associated with the collaborative workspace.
Returns:
The account Id associated with the collaborative workspace.

getCollabSpaceDescription

public java.lang.String getCollabSpaceDescription()
Gets the description of the collaborative workspace.
Returns:
The description of the collaborative workspace.

getCollabSpaceName

public java.lang.String getCollabSpaceName()
Gets the name of the collaborative workspace.
Returns:
The name of the collaborative workspace.

getProcessId

public java.lang.String getProcessId()
Gets the unique identifier of the process associated with the collaborative workspace. The default process Id is "CW_" concatenated with date of creation.
Returns:
The process Id of the collaborative workspace.

getProcessType

public java.lang.String getProcessType()
Gets the process type of the collaborative workspace. The default process type is "General".
Returns:
The process type of the collaborative workspace.

getResources

public AccessVector getResources()
                          throws ECException
Gets the access control resources corresponding to the command.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
The access vector associated with the command.
Throws:
ECException - If the access control resources cannot be retrieved.

getTemplateName

public java.lang.String getTemplateName()
Gets the name of the QuickPlace template that will be used to create the collaborative workspace.
Returns:
The name of the QuickPlace template.

performExecute

public void performExecute()
                    throws ECException
Contains the business logic for the command.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

setAccountId

public void setAccountId(java.lang.String newAccountId)
Sets the unique identifier of the account associated with the collaborative workspace to a local variable.
Parameters:
newAccountId - The account Id associated with the collaborative workspace.

setCollabSpaceDescription

public void setCollabSpaceDescription(java.lang.String newCollabSpaceDescription)
Sets the description of the collaborative workspace to a local variable.
Parameters:
newCollabSpaceDescription - The description of the collaborative workspace.

setCollabSpaceName

public void setCollabSpaceName(java.lang.String newCollabSpaceName)
Sets the name of the collaborative workspace to a local variable.
Parameters:
newCollabSpaceName - The name of the collaborative workspace.

setProcessId

public void setProcessId(java.lang.String newProcessId)
Sets the unique identifier of the process associated with the collaborative workspace to a local variable.
Parameters:
newProcessId - The process Id of the collaborative workspace.

setProcessType

public void setProcessType(java.lang.String newProcessType)
Sets the process type associated with the collaborative workspace Id.
Parameters:
newProcessType - The process type of the collaborative workspace.

setRequestProperties

public void setRequestProperties(TypedProperty reqParms)
                          throws ECApplicationException
Gets the input parameters from the requestProperties object and sets each parameter to a local variable.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ToolsControllerCommandImpl
Parameters:
reqParms - The input parameters that are received by the command.
Throws:
ECApplicationException - If the collaborative workspace Id is missing.

setTemplateName

public void setTemplateName(java.lang.String newTemplateName)
Sets the name of the QuickPlace template that will be used to create the collaborative workspace.
Parameters:
newTemplateName - The name of the QuickPlace template.

validateParameters

public void validateParameters()
                        throws ECException
Validates that the syntax of the input parameters are correct.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -