com.ibm.commerce.command
Interface ControllerCommand

All Superinterfaces:
AccCommand
All Known Implementing Classes:
ControllerCommandImpl

public interface ControllerCommand
extends AccCommand

The Controller Command interface has to be implemented by all top level command called by a WebController.


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field.
 
Method Summary
 boolean checkPermission()
          Deprecated. Replaced by ECCommand#getResources()
 void execute()
          Invokes the performExecute() method of the command.
 boolean getGeneric()
          Gets the generic property.
 TypedProperty getRequestProperties()
          Gets the request properties set by the setRequestProperties() method.
 TypedProperty getResolvedRequestProperties()
          Gets the resolved request properties associated with this command.
 TypedProperty getResponseProperties()
          Gets the response properties associated with this command.
 boolean getRetriable()
          Gets the retriable property for this command.
 TypedProperty getViewInputProperties()
          Retrieves the request properties onto the view command.
 boolean isGeneric()
          Checks if this is a generic command.
 boolean isRetriable()
          Checks if this command is retriable on rollback exception
 com.ibm.commerce.datatype.TypedProperty mergeProperties(com.ibm.commerce.datatype.TypedProperty reqProp)
          Merges the properties passed to the request with the default properties defined in the cmdreg.
 void setGeneric(boolean value)
          Sets the generic property of this command.
 void setRequestProperties(TypedProperty requestProperties)
          Sets the request properties.
 void setRetriable(boolean value)
          Sets the retriable property for this command.
 void setViewInputProperties(TypedProperty requestProperties)
          Sets the input properties to be passed to the for the view command.
 
Methods inherited from interface com.ibm.commerce.command. AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM copyright notice field.
Method Detail

checkPermission

public boolean checkPermission()
                        throws ECException
Deprecated. Replaced by ECCommand#getResources()
Performs fine grain level access control. This is replaced by resource level access control or checkResourcePermission() in this version. Command writers should not implement this method but implement the getResources() method instead. The default implementation returns true;
Returns:
true if this user have permission to perform the operation on the reosurce. false if this user do not have permission to perform the operations on resource
Throws:
ECException

execute

public void execute()
             throws ECException
Invokes the performExecute() method of the command.
Throws:
ECException

getGeneric

public boolean getGeneric()
Gets the generic property. A generic command is a command that can be executed by a generic user.
Returns:
true if this command can be called by a generic user false if this command cannot be called by a generic user

getRequestProperties

public TypedProperty getRequestProperties()
Gets the request properties set by the setRequestProperties() method.
Returns:
request properties

getResolvedRequestProperties

public TypedProperty getResolvedRequestProperties()
Gets the resolved request properties associated with this command. This method is called after a controller command has been executed successfully. It return a a hashtable of name value pairs of interpreted request properties. This method needs to be implemented for all commands that accepts wild card parameter values and where user traffic data monitoring is desired. The command will return only the properties with expanded parameter values.
Returns:
request properties

getResponseProperties

public TypedProperty getResponseProperties()
Gets the response properties associated with this command. This method is called after a controller command has been executed successfully. It return a a hashtable of name value pairs. The controller command should normally return a view command name for returning response data. For example, it could contain the following properties: EC_VIEWTASKNAME (viewTaskName) - name of a view command / view task this is a required parameter EC_DOCPATHNAME (docname) - name of a jsp to be forwarded EC_TEXTDOCUMENT (textDocument)- inputStream for the text document to be returned EC_RAWDOCUMENT (rawDocument)- inputStream for the raw document to be returned EC_REDIRECTURL (redirecturl) - name of a redirect url or other additional information to be passed as requestParameters to the view command The response properties are combined with any default parameters defined in the properties column of the viewreg before passing on the the view command.
Returns:
response properties

getRetriable

public boolean getRetriable()
Gets the retriable property for this command. The default implementation is to return false.
Returns:
true if this command is retriable; flase otherwise

getViewInputProperties

public TypedProperty getViewInputProperties()
Retrieves the request properties onto the view command. Command writer can overwrite this method to return all, part or non of the request properties to be passed to the view command
Returns:
input properties

isGeneric

public boolean isGeneric()
Checks if this is a generic command. A generic command is a command that can be invoked by a generic user. The default is false for all controller commands and true for all view commands.
Returns:
true if this command can be called by a generic user false if this command cannot be called by a generic user

isRetriable

public boolean isRetriable()
Checks if this command is retriable on rollback exception
Returns:
true if this command is retriable false if this command is not retriable

mergeProperties

public com.ibm.commerce.datatype.TypedProperty mergeProperties(com.ibm.commerce.datatype.TypedProperty reqProp)
Merges the properties passed to the request with the default properties defined in the cmdreg. The default behavior is to give a higher priority to the properties passed in the request. The default properties is given a lower priority. Command implementators can overwrite this method if they want a different merge policy.
Parameters:
reqProp - request input properties
Returns:
the request properties for this command

setGeneric

public void setGeneric(boolean value)
Sets the generic property of this command. The generic property is initialized by the command factory code based on the properties specified in the cmdreg table.
Parameters:
value - true if the command is a generic command false if this command is not a generic command

setRequestProperties

public void setRequestProperties(TypedProperty requestProperties)
                          throws com.ibm.commerce.exception.ECException
Sets the request properties. The WebController calls this method before invoking the execute method in this command to set the request properties for this command. It is the responsibility of the implementer of the ControllerCommand to extract the required input parameters from the request properties and perform parameter checking.
Parameters:
requestProperties - request properties
Throws:
com.ibm.commerce.exception.ECException.
com.ibm.commerce.exception.ECException

setRetriable

public void setRetriable(boolean value)
Sets the retriable property for this command. The retriable property is initialized command factory based on the properties defined in the cmdreg table.
Parameters:
value - true if retriable false if not retriable

setViewInputProperties

public void setViewInputProperties(TypedProperty requestProperties)
                            throws com.ibm.commerce.exception.ECException
Sets the input properties to be passed to the for the view command. This is initialized to be the request properties for this command. Command writer can overwrite this method to limit the input properties that will be passed on to the view command.
Parameters:
requestProperties - request properties
Throws:
com.ibm.commerce.exception.ECException.
com.ibm.commerce.exception.ECException