com.ibm.commerce.command

Class AbstractViewCommand

    • Constructor Detail

      • AbstractViewCommand

        public AbstractViewCommand()
        This is the default constructor for this class. It calls the constructor from the superclass.
    • Method Detail

      • getForUserId

        public java.lang.Long getForUserId()
        This method gets the user id if the command is to be executed on behalf of a customer. This method is for internal use only.
        Specified by:
        getForUserId in interface AccCommand
        Returns:
        This method returns the "for user id".
      • getOwner

        public java.lang.Long getOwner()
                                throws java.lang.Exception
        This method gets the owner of the protectable resource. This method is part of the Protectable interface. This is required for command level access control where the command is the protectable resource.
        Specified by:
        getOwner in interface Protectable
        Returns:
        This method returns the owner id of the command.
        Throws:
        java.lang.Exception
      • getRequestProperties

        public TypedProperty getRequestProperties()
        This method gets the request properties of this view command.
        Specified by:
        getRequestProperties in interface ViewCommand
        Returns:
        This method returns the request properties.
      • getResourceOwners

        public java.lang.Long[] getResourceOwners()
                                           throws ECException
        This method gets all the organization units that own the resources accessed by this command. It will return null if no resource is being accessed by this command. This method was used in 5.1 for command level access control checking. It is no longer required. It is kept for backward compatibility. The default implementation returns null.
        Specified by:
        getResourceOwners in interface AccCommand
        Returns:
        This method returns an array of Long objects containing all organization unit reference numbers. A site owner is represented by an organization unit value of -1.
        Throws:
        ECException
      • getResponseProperties

        public TypedProperty getResponseProperties()
        This method gets the response properties of this view command. This method is part of the command interface. This method will not be called for view commands.
        Specified by:
        getResponseProperties in interface ViewCommand
        Returns:
        This method returns the response properties.
      • getViewName

        public final java.lang.String getViewName()
        This method gets the view task name for this view command. This is an internal method used by the command framework.
        Specified by:
        getViewName in interface ViewCommand
        Returns:
        This method returns the view name.
      • mergeProperties

        public TypedProperty mergeProperties(TypedProperty reqProp,
                                             TypedProperty resProp)
        The method merges three sets of properties passed to this view command. They are the request properties, the response properties and the default properties set in the VIEWREG. As the default behaviour, this method first merges the request properties with the response properties. It then merges the default properties with the response properties. Priority is given to the response properties. The default properties in the URL configuration have the lowest priority. For performance reasons, the original ResponseProperties object passed to this command will not be preserved but will contain the merged data. Individual view commands can overwrite this method if they need a different merging policy.
        Specified by:
        mergeProperties in interface ViewCommand
        Parameters:
        reqProp - This is an object that represents the request properties passed to the controller command.
        resProp - This is an object that represents the response properties returned by the controller command.
        Returns:
        This method returns the merged properties to be used as input to this view command .
      • setForUserId

        public void setForUserId(java.lang.Long value)
        This method sets the "for user id" for a customer agent command.
        Specified by:
        setForUserId in interface AccCommand
        Parameters:
        value - This is the value of the "for user id".
      • setOwner

        public void setOwner(java.lang.Long value)
        This method sets the owner for this command.
        Specified by:
        setOwner in interface AccCommand
        Parameters:
        value - This is the owner ID.
      • setViewName

        public final void setViewName(java.lang.String value)
        This method sets the view task name for this view command. This is an internal method used by the command framework.
        Specified by:
        setViewName in interface ViewCommand
        Parameters:
        value - This is the view name as a String object.
      • fulfills

        public boolean fulfills(java.lang.Long member,
                                java.lang.String relationship)
                         throws java.lang.Exception
        This method determines whether a given member fulfills a given relationship with the resource.
        Specified by:
        fulfills in interface Protectable
        Parameters:
        member - This is the member id of the member.
        relationship - This is the relationship the member has with the resource.
        Returns:
        This method returns true if the member fulfills the relationship with the resource and false otherwise.
        Throws:
        java.lang.Exception
        RemoteException
      • setViewCommandContext

        public void setViewCommandContext(ViewCommandContext aCommandContext)
        This method sets the view command context.
        Parameters:
        aCommandContext - This is the view command context.
      • getViewCommandContext

        public ViewCommandContext getViewCommandContext()
        This method gets the view command context.
        Returns:
        This method returns the view command context.