com.ibm.commerce.accesscontrol.policyeditor.commands
Class ActGrpUpdateCmdImpl

com.ibm.commerce.command.AbstractECTargetableCommand
  |
  +--com.ibm.commerce.command.ControllerCommandImpl
        |
        +--com.ibm.commerce.tools.command.ToolsControllerCommandImpl
              |
              +--com.ibm.commerce.accesscontrol.policyeditor.commands.ActGrpUpdateCmdImpl
All Implemented Interfaces:
AccCommand, ActGrpUpdateCmd, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, ToolsControllerCommand

public class ActGrpUpdateCmdImpl
extends ToolsControllerCommandImpl
implements ActGrpUpdateCmd

Updates the action group data. Following is the list of parameters the command accepts from the User Interface:

This command modifies an existing entry in the action group table.

The following steps are executed by the command sequentially:

  1. Modifies the name of the action group and also the description if a description is specified in the user interface.
  2. Parses the list of actoin Ids to obtain an array of actionIds to be associated with this action group.
  3. Deletes any existing associations with actions by calling iteratively instantiating the ActActGrpAccessBean access bean.
  4. Adds new associations with actions specified in the actionId array by iteratively calling the ActionActGrpAddTaskCmd task command.


Field Summary
protected  java.lang.String actionIds
          Incoming values of action Ids to be deleted
 
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.accesscontrol.policyeditor.commands.ActGrpUpdateCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command.ECTargetableCommand
COPYRIGHT
 
Constructor Summary
ActGrpUpdateCmdImpl()
           
 
Method Summary
 java.lang.String getActGrpDisplayName()
          Gets the display name of the action group.
 java.lang.Integer getActGrpId()
          Gets the action group Id
 java.lang.String getActGrpName()
          Gets the name of the action group.
 java.lang.String getActionIds()
          Gets the list of action ids to be added to the action group.
 java.lang.String getDescription()
          Gets the description of the action group.
 AccessVector getResources()
          Returns the resources accessed by this command It will return null if no resources are being accessed by this command.
 TypedProperty getViewInputProperties()
          This method is called by the web controller to retrieve the request properties set by the setRequestProperties() method.
 java.lang.String getViewTask()
          Gets the view task name to be returned to the caller
 void performExecute()
          Updates the specified action group in the datasource.
 void setActGrpDisplayName(java.lang.String actGrpDisplayName)
          Sets the display name of the action group.
 void setActGrpId(java.lang.Integer actGrpId)
          Sets the action group Id.
 void setActGrpName(java.lang.String actGrpName)
          Sets the name of the action group.
 void setActionIds(java.lang.String actionIds)
          Sets the list of action ids to be added to the action group.
 void setDescription(java.lang.String description)
          Sets the description of the action group.
 void setRequestProperties(TypedProperty reqParms)
          Sets the various properties of the command with the parameters received
 void setViewTask(java.lang.String viewTask)
          Sets the view task name to be returned to the caller.
 void validateParameters()
          Check whether all the parameters are set properly.
 
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, 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

actionIds

protected java.lang.String actionIds
Incoming values of action Ids to be deleted
Constructor Detail

ActGrpUpdateCmdImpl

public ActGrpUpdateCmdImpl()
Method Detail

getActGrpDisplayName

public java.lang.String getActGrpDisplayName()
Gets the display name of the action group.
Specified by:
getActGrpDisplayName in interface ActGrpUpdateCmd
Returns:
The display name of the action group

getActGrpId

public java.lang.Integer getActGrpId()
Gets the action group Id
Specified by:
getActGrpId in interface ActGrpUpdateCmd
Returns:
The action group Id

getActGrpName

public java.lang.String getActGrpName()
Gets the name of the action group.
Specified by:
getActGrpName in interface ActGrpUpdateCmd
Returns:
The name of the action group

getActionIds

public java.lang.String getActionIds()
Gets the list of action ids to be added to the action group.
Specified by:
getActionIds in interface ActGrpUpdateCmd
Returns:
The comma delimied string of all the actions to to be associated with this action group

getDescription

public java.lang.String getDescription()
Gets the description of the action group.
Specified by:
getDescription in interface ActGrpUpdateCmd
Returns:
The description of the action group

getResources

public AccessVector getResources()
                          throws ECException
Returns the resources accessed by this command It will return null if no resources are being accessed by this command.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
Object[] - an array of protectable resources

getViewInputProperties

public TypedProperty getViewInputProperties()
This method is called by the web controller to retrieve the request properties set by the setRequestProperties() method. The command need to override this method because otherwise the properties passed into the controller command would be then passed onto the view command. This is unnecessary for the tools and actually will break us when using the ReDirectView comman because the URL to re-direct to cannot be more than 500 chars. The command calls the getViewInputProperties() method in the ToolsControllerCommandImpl command. This takes care of removing the parameters specific to the tools framework.
Specified by:
getViewInputProperties in interface ControllerCommand
Overrides:
getViewInputProperties in class ToolsControllerCommandImpl
Returns:
com.ibm.commerce.datatype.TypeProperty

getViewTask

public java.lang.String getViewTask()
Gets the view task name to be returned to the caller
Specified by:
getViewTask in interface ActGrpUpdateCmd
Returns:
The view task name to be returned to the caller.

performExecute

public void performExecute()
                    throws ECException
Updates the specified action group in the datasource.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - If an error is encountered while updating the datasource

setActGrpDisplayName

public void setActGrpDisplayName(java.lang.String actGrpDisplayName)
Sets the display name of the action group.
Specified by:
setActGrpDisplayName in interface ActGrpUpdateCmd
Parameters:
actGrpDisplayName - The display name of the action group

setActGrpId

public void setActGrpId(java.lang.Integer actGrpId)
Sets the action group Id.
Specified by:
setActGrpId in interface ActGrpUpdateCmd
Parameters:
actGrpId - The action group Id.

setActGrpName

public void setActGrpName(java.lang.String actGrpName)
Sets the name of the action group.
Specified by:
setActGrpName in interface ActGrpUpdateCmd
Parameters:
actGrpName - The name of the action group

setActionIds

public void setActionIds(java.lang.String actionIds)
Sets the list of action ids to be added to the action group.
Specified by:
setActionIds in interface ActGrpUpdateCmd
Parameters:
actionIds - The comma delimied string of all the actions to to be associated with this action group

setDescription

public void setDescription(java.lang.String description)
Sets the description of the action group.
Specified by:
setDescription in interface ActGrpUpdateCmd
Parameters:
description - The description of the action group

setRequestProperties

public void setRequestProperties(TypedProperty reqParms)
                          throws ECApplicationException
Sets the various properties of the command with the parameters received
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ToolsControllerCommandImpl
Parameters:
reqParms - TypedProperty containing the input parameters.
Throws:
ECApplicationException - If a required parameter is missing

setViewTask

public void setViewTask(java.lang.String viewTask)
Sets the view task name to be returned to the caller.
Specified by:
setViewTask in interface ActGrpUpdateCmd
Parameters:
viewTask - The view task name to be returned to the caller.

validateParameters

public void validateParameters()
                        throws ECException
Check whether all the parameters are set properly.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -