com.ibm.commerce.command

Interface ControllerCommand

    • Field Detail

      • COPYRIGHT

        static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Method Detail

      • checkPermission

        boolean checkPermission()
                         throws ECException
        Deprecated. This method has been replaced by ECCommand.getResources()
        This method 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:
        This method returns true if this user has permission to perform the operation on the resource and false otherwise.
        Throws:
        ECException
      • execute

        void execute()
              throws ECException
        This method invokes the performExecute() method of the command.
        Specified by:
        execute in interface com.ibm.websphere.command.Command
        Specified by:
        execute in interface ECCommand
        Throws:
        ECException
      • getGeneric

        boolean getGeneric()
        This method gets the generic property for this command. A generic command is a command that can be executed by a generic user.
        Returns:
        This method returns true if this command can be called by a generic user and false otherwise.
      • getRequestProperties

        TypedProperty getRequestProperties()
        This method gets the request properties set by the setRequestProperties() method.
        Returns:
        This method returns the request properties.
      • getResolvedRequestProperties

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

        TypedProperty getResponseProperties()
        This method gets the response properties associated with this command. This method is called after a controller command has been executed successfully. It return a Hashtable of name value pairs. The controller command should return a view command name for returning response data.

        For example, it could contain the following properties:

        • EC_VIEWTASKNAME (viewTaskName) - The name of a view command/view task. This is a required parameter.
        • EC_DOCPATHNAME (docname) - The name of a JSP to be forwarded.
        • EC_TEXTDOCUMENT (textDocument)- An InputStream for the text document to be returned.
        • EC_RAWDOCUMENT (rawDocument)- An InputStream for the raw document to be returned.
        • EC_REDIRECTURL (redirecturl) - The name of a redirect url
        It could also contain other information to be passed as request parameters to the view command.

        The response properties are combined with any default parameters defined in the properties column of the URL configuration before passing on to the view command.

        Returns:
        This method returns the response properties.
      • getRetriable

        boolean getRetriable()
        This method gets the retriable property for this command. The default implementation is to return false.
        Returns:
        This method returns true if this command is retriable and false otherwise.
      • getViewInputProperties

        TypedProperty getViewInputProperties()
        This method retrieves the request properties and passes them on to the view command. The command writer can overwrite this method to return all, part or none of the request properties to be passed to the view command.
        Returns:
        This method returns the input properties.
      • isGeneric

        boolean isGeneric()
        This method checks to see whether this is a generic command. A generic command is one that can be invoked by a generic user. The default is false for all controller commands and true for all view commands.
        Returns:
        This method returns true if this command can be called by a generic user and false otherwise.
      • isRetriable

        boolean isRetriable()
        This method checks to see whether this command is retriable on rollback exceptions.
        Returns:
        This method returns true if this command is retriable and false otherwise.
      • mergeProperties

        TypedProperty mergeProperties(TypedProperty reqProp)
        This method merges the properties passed to the request with the default properties defined in the command configuration. The default behavior is to give a higher priority to the properties passed in the request. The default properties are given a lower priority. Command writers can overwrite this method if they want a different merge policy.
        Parameters:
        reqProp - This is an object that represents the request input properties.
        Returns:
        This method returns the request properties for this command.
      • setGeneric

        void setGeneric(boolean value)
        This method sets the generic property of this command. The generic property is initialized by the command factory code based on the properties specified in the command configuration.
        Parameters:
        value - This is a boolean value; true if the command is a generic command and false otherwise.
      • setRequestProperties

        void setRequestProperties(TypedProperty requestProperties)
                           throws ECException
        This method sets the request properties. The WebController calls this method before invoking the execute method to set the request properties for this command. It is the responsibility of the command writer to extract the required input parameters from the request properties and perform parameter checking.
        Parameters:
        requestProperties - This is an object that represents the request properties.
        Throws:
        ECException
      • setRetriable

        void setRetriable(boolean value)
        This method sets the retriable property for this command. The retriable property is initialized by the command factory based on the properties defined in the command configuration. This command configuration at runtime can come from the following two locations in the given order of sequence:
        • 1) CommandRegistryEntry retriable setting is assigned from the retriable properties in the PROPERTIES column of the CMDREG table, only when that entry exists in the database table, otherwise,
        • 2) if an instance property called <CommandRegistryRetriableProperty defaultValue="0" (or "false") /> is defined in the wc-server.xml file, then the command factory will use this setting as the default retriable configuration.
        Parameters:
        value - This is a boolean value; true if retriable and false otherwise.
      • setViewInputProperties

        void setViewInputProperties(TypedProperty requestProperties)
                             throws ECException
        This method sets the input properties to be passed to the view command. The input properties are initialized to be the request properties for this command. The command writer can overwrite this method to limit the input properties that will be passed on to the view command.
        Parameters:
        requestProperties - This is an object that represents the request properties.
        Throws:
        ECException