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

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

public class ResGrpDeleteCmdImpl
extends ToolsControllerCommandImpl
implements ResGrpDeleteCmd

Deletes Resource Groups from the datasource. Following is the list of parameters the command accepts from the User Interface:

This command first parses the comma delimited String containing the resource group ids of all the resource groups to be deleted and then iteratively calls the ResGrpDeleteTaskCmd task command to delete the individual resource groups from the datasource.


Field Summary
protected  java.lang.String resGrpIds
          Comma delimited string containing ids of resource groups 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.ResGrpDeleteCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command.ECTargetableCommand
COPYRIGHT
 
Constructor Summary
ResGrpDeleteCmdImpl()
           
 
Method Summary
 java.lang.String getResGrpIds()
          Gets the list of resource group ids to be deleted.
 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.
 void performExecute()
          Deletes the specified Resource Groups from the datasource.
 void setRequestProperties(TypedProperty reqParms)
          Sets the various properties of the command with the parameters received
 void setResGrpIds(java.lang.String resGrpIds)
          Sets the list of resource group ids to be deleted.
 void setViewTask(java.lang.String newViewTask)
          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

resGrpIds

protected java.lang.String resGrpIds
Comma delimited string containing ids of resource groups to be deleted
Constructor Detail

ResGrpDeleteCmdImpl

public ResGrpDeleteCmdImpl()
Method Detail

getResGrpIds

public java.lang.String getResGrpIds()
Gets the list of resource group ids to be deleted.
Specified by:
getResGrpIds in interface ResGrpDeleteCmd
Returns:
The comma delimited String of resGrpIds

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.
Specified by:
getViewTask in interface ResGrpDeleteCmd
Returns:
View that is executed upon completion of the command

performExecute

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

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

setResGrpIds

public void setResGrpIds(java.lang.String resGrpIds)
Sets the list of resource group ids to be deleted.
Specified by:
setResGrpIds in interface ResGrpDeleteCmd
Parameters:
resGrpIds - The comma delimited String of resGrpIds

setViewTask

public void setViewTask(java.lang.String newViewTask)
Sets the view task name to be returned to the caller.
Specified by:
setViewTask in interface ResGrpDeleteCmd
Parameters:
viewTask - View that is executed upon completion of the command

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. -