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

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

public class ResGrpUpdateCmdImpl
extends ToolsControllerCommandImpl
implements ResGrpUpdateCmd

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

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

The following steps are executed by the command sequentially:

  1. Modifies the name of the resource group and also the description if a description is specified in the user interface.
  2. Parses the list of resource Ids to obtain an array of resCgryIds to be associated with this resource group.
  3. Deletes any existing associations with resources by calling iteratively instantiating the ResGrpResAccessBean access bean.
  4. Adds new associations with resources specified in the resCgryId array by iteratively calling the ResCgryResGrpAddTaskCmd task command.


Field Summary
protected  java.lang.String resCgryIds
          Incoming values of resource 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.ResGrpUpdateCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command.ECTargetableCommand
COPYRIGHT
 
Constructor Summary
ResGrpUpdateCmdImpl()
           
 
Method Summary
 java.lang.String getDescription()
          Gets the description of the resource group
 java.lang.String getResCgryIds()
          Gets the list of resource ids to be added to the resource group.
 java.lang.String getResGrpDisplayName()
          Gets the display name of the resource group.
 java.lang.Integer getResGrpId()
          Gets the resource group Id
 java.lang.String getResGrpName()
          Gets the name of the resource 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 resource group in the datasource.
 void setDescription(java.lang.String description)
          Sets the description of the resource group
 void setRequestProperties(TypedProperty reqParms)
          Sets the various properties of the command with the parameters received
 void setResCgryIds(java.lang.String resCgryIds)
          Sets the list of resource ids to be added to the resource group.
 void setResGrpDisplayName(java.lang.String resGrpDisplayName)
          Sets the display name of the resource group
 void setResGrpId(java.lang.Integer resGrpId)
          Sets the resource group Id
 void setResGrpName(java.lang.String resGrpName)
          Sets the name of the resource group
 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

resCgryIds

protected java.lang.String resCgryIds
Incoming values of resource Ids to be deleted
Constructor Detail

ResGrpUpdateCmdImpl

public ResGrpUpdateCmdImpl()
Method Detail

getDescription

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

getResCgryIds

public java.lang.String getResCgryIds()
Gets the list of resource ids to be added to the resource group.
Specified by:
getResCgryIds in interface ResGrpUpdateCmd
Returns:
The comma delimited string of all the resources to to be associated with this resource group

getResGrpDisplayName

public java.lang.String getResGrpDisplayName()
Gets the display name of the resource group.
Specified by:
getResGrpDisplayName in interface ResGrpUpdateCmd
Returns:
The display name of the resource group

getResGrpId

public java.lang.Integer getResGrpId()
Gets the resource group Id
Specified by:
getResGrpId in interface ResGrpUpdateCmd
Returns:
the resource group Id

getResGrpName

public java.lang.String getResGrpName()
Gets the name of the resource group
Specified by:
getResGrpName in interface ResGrpUpdateCmd
Returns:
The name of the resource 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 ResGrpUpdateCmd
Returns:
The view task name to be returned to the caller.

performExecute

public void performExecute()
                    throws ECException
Updates the resource 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

setDescription

public void setDescription(java.lang.String description)
Sets the description of the resource group
Specified by:
setDescription in interface ResGrpUpdateCmd
Parameters:
description - The description of the resource 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

setResCgryIds

public void setResCgryIds(java.lang.String resCgryIds)
Sets the list of resource ids to be added to the resource group.
Specified by:
setResCgryIds in interface ResGrpUpdateCmd
Parameters:
resCgryIds - The comma delimited string of all the resources to to be associated with this resource group

setResGrpDisplayName

public void setResGrpDisplayName(java.lang.String resGrpDisplayName)
Sets the display name of the resource group
Specified by:
setResGrpDisplayName in interface ResGrpUpdateCmd
Parameters:
resGrpDisplayName - The display name of the resource group

setResGrpId

public void setResGrpId(java.lang.Integer resGrpId)
Sets the resource group Id
Specified by:
setResGrpId in interface ResGrpUpdateCmd
Parameters:
resGrpName - The resource group Id

setResGrpName

public void setResGrpName(java.lang.String resGrpName)
Sets the name of the resource group
Specified by:
setResGrpName in interface ResGrpUpdateCmd
Parameters:
resGrpName - The name of the resource group

setViewTask

public void setViewTask(java.lang.String viewTask)
Sets the view task name to be returned to the caller.
Specified by:
setViewTask in interface ResGrpUpdateCmd
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. -