com.ibm.commerce.giftregistry.struts

Class GiftRegistryBaseValidatorActionForm

  • java.lang.Object
    • org.apache.struts.action.ActionForm
      • org.apache.struts.action.DynaActionForm
        • org.apache.struts.validator.DynaValidatorForm
          • com.ibm.commerce.giftregistry.struts.GiftRegistryBaseValidatorActionForm
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String CLASS_NAME
      The name of this class
      static java.lang.String COPYRIGHT
      IBM Copyright notice field.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getRulePropertyFileName() 
      MappingResult getServiceMappingResult(org.apache.struts.action.ActionMapping mapping, java.util.Map inMap, javax.servlet.http.HttpServletRequest request)
      Returns a MappingResult object that is corresponding to the given name value pairs.
      java.lang.String getStoreDirectory() 
      java.lang.Integer getStoreId(javax.servlet.http.HttpServletRequest request)
      Retrieves the ID of the store in which the current request this action is handling
      void setRulePropertyFileName(java.lang.String fileName)
      Sets the file name that is going to be used.
      void setStoreDirectory(java.lang.String directory)
      Sets the store directory where the rule property file should be located.
      org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
      Validates parameter values in http request.
      • Methods inherited from class org.apache.struts.validator.DynaValidatorForm

        getPage, getResultValueMap, getValidationKey, getValidatorResults, reset, setPage, setValidatorResults
      • Methods inherited from class org.apache.struts.action.DynaActionForm

        contains, get, get, get, getDynaClass, getMap, getString, getStrings, initialize, initialize, remove, reset, set, set, set, toString
      • Methods inherited from class org.apache.struts.action.ActionForm

        getMultipartRequestHandler, getServletWrapper, setMultipartRequestHandler, setServlet, validate
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.apache.commons.beanutils.DynaBean

        contains, get, get, get, getDynaClass, remove, set, set, set
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
      • CLASS_NAME

        public static final java.lang.String CLASS_NAME
        The name of this class
    • Constructor Detail

      • GiftRegistryBaseValidatorActionForm

        public GiftRegistryBaseValidatorActionForm()
    • Method Detail

      • getStoreId

        public final java.lang.Integer getStoreId(javax.servlet.http.HttpServletRequest request)
        Retrieves the ID of the store in which the current request this action is handling
        Parameters:
        request - the request this action is handling
        Returns:
        the store ID associated with this request. Null if this request is not associated with any store, or this request does not have a context
      • getServiceMappingResult

        public MappingResult getServiceMappingResult(org.apache.struts.action.ActionMapping mapping,
                                                     java.util.Map inMap,
                                                     javax.servlet.http.HttpServletRequest request)
                                              throws ECException
        Returns a MappingResult object that is corresponding to the given name value pairs. The MappingResult will contain the name of a GC1 service, and the service input document, which is instance of BusinessObjectDocument.
        Parameters:
        mapping - the ActionMapping used by this action
        map - the input data of a request. Each entry in the map is of the form key: sObject[]. For example, if a name-value pair in a request query is lastName = Smith, then the corresponding entry in the inMap is lastName->[Smith]. If the query is orderItemId=1&orderItemId=2&orderItemId=3, then the query is orderItemId: [1, 2, 3]
        request - the request object that represents the current request for which this action is called
        Returns:
        The service request information that is mapped from the given request. If there is no corresponding request found, an empty MappingResult will be returned.
        Throws:
        ECException - if the conversion from the map to the BOD fails
      • validate

        public org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping,
                                                              javax.servlet.http.HttpServletRequest request)
        Validates parameter values in http request. Validation errors are put into ActionErrors.
        Overrides:
        validate in class org.apache.struts.validator.DynaValidatorForm
        Parameters:
        mapping - the mapping for the action and the form
        request - the HTTP request to be validated
        Returns:
        ActionErrors all the errors identified by the validation. Empty ActionErrors instance, otherwise.
      • setRulePropertyFileName

        public final void setRulePropertyFileName(java.lang.String fileName)
        Sets the file name that is going to be used. By default, if no file name is given, no validation will be performed by this class. Therefore, a subclass of this form can enable the validation of this class by setting a property file name (and optionally a store directory, setStoreDirectory(String). A typical usage in the subclass would be:
                        setRulePropertyFileName(fileName);
                        super.validate();
         
        Parameters:
        fileName - the name of the property file
      • getRulePropertyFileName

        public final java.lang.String getRulePropertyFileName()
        Returns:
        the name of the rule property file
      • setStoreDirectory

        public final void setStoreDirectory(java.lang.String directory)
        Sets the store directory where the rule property file should be located. The store directory value is not used, the default store directory found in the view context will be used.
        Parameters:
        directory - the directory to be set
      • getStoreDirectory

        public final java.lang.String getStoreDirectory()
        Returns:
        the store directory where the rule property file is located