Class GuideValidationResult


  • public class GuideValidationResult
    extends java.lang.Object
    Class representing the result of server side validation performed for an adaptive form. This class provides APIs to access the list of errors in the submitted adaptive form
    Since:
    AEM 6.1
    • Constructor Detail

      • GuideValidationResult

        public GuideValidationResult()
      • GuideValidationResult

        public GuideValidationResult​(java.util.List<GuideError> guideErrorList)
        Deprecated.
        from 6.3 use GuideValidationResult(List guideErrorList, GuideSubmitErrorCause errorCausedBy) instead.
        Parameters:
        guideErrorList - : list of Guide errors
      • GuideValidationResult

        public GuideValidationResult​(java.util.List<GuideError> guideErrorList,
                                     GuideSubmitErrorCause errorCausedBy)
        Parameters:
        guideErrorList - : list of Guide errors
        errorCausedBy - : cause of error
      • GuideValidationResult

        public GuideValidationResult​(GuideSubmitErrorCause errorCausedBy,
                                     java.lang.String errorMessage)
      • GuideValidationResult

        public GuideValidationResult​(GuideSubmitErrorCause errorCausedBy,
                                     java.lang.String errorMessage,
                                     java.util.List<GuideError> guideErrorList)
        Parameters:
        guideErrorList - : list of Guide errors
        errorCausedBy - : cause of error
        errorMessage - : top level error message sent by service. This is not localized.
      • GuideValidationResult

        public GuideValidationResult​(GuideSubmitErrorCause errorCausedBy,
                                     java.lang.String originCode,
                                     java.lang.String originMessage)
        Parameters:
        errorCausedBy - : cause of error
        originCode - : Error code sent by invoked service:String
        originMessage - : Error message sent by invoked service
      • GuideValidationResult

        public GuideValidationResult​(java.util.Map<java.lang.String,​java.lang.String>[] errorList,
                                     java.lang.String excludeFromDorData,
                                     GuideSubmitErrorCause errorCausedBy)
      • GuideValidationResult

        public GuideValidationResult​(GuideSubmitErrorCause errorCausedBy,
                                     int originCode,
                                     java.lang.String originMessage)
        Parameters:
        errorCausedBy - : cause of error
        originCode - : Error code sent by invoked service: Integer
        originMessage - : Error message sent by invoked service
    • Method Detail

      • getGuideErrorList

        public java.util.List<GuideError> getGuideErrorList()
        Returns the list of error messages in the server side validation
        Returns:
        List of error messages
      • setGuideErrorList

        public void setGuideErrorList​(java.util.List<GuideError> guideErrorList)
        Deprecated.
        from 6.3 use setGuideErrorList(List guideErrorList, GuideSubmitErrorCause errorCausedBy) instead.
        This setter should be used when errors occurred due to server side validation.
      • getErrorList

        public java.util.Map<java.lang.String,​java.lang.String>[] getErrorList()
      • setErrorList

        public void setErrorList​(java.util.Map<java.lang.String,​java.lang.String>[] errorList)
      • getExcludeFromDorData

        public java.lang.String getExcludeFromDorData()
      • setExcludeFromDorData

        public void setExcludeFromDorData​(java.lang.String excludeFromDorData)
      • setOriginDetails

        public void setOriginDetails​(java.lang.String originCode,
                                     java.lang.String originDetails)
      • setErrorMessage

        public void setErrorMessage​(java.lang.String errorMessage)
      • setOriginCode

        public void setOriginCode​(java.lang.String originCode)
        Parameters:
        originCode - : error code sent by service
      • setOriginMessage

        public void setOriginMessage​(java.lang.String originMessage)
        Parameters:
        originMessage - : error message sent by service
      • setGuideErrorList

        public void setGuideErrorList​(java.util.List<GuideError> guideErrorList,
                                      GuideSubmitErrorCause errorCausedBy)
        This sets List of error and the cause of error
        Parameters:
        guideErrorList - : list of Guide errors
        errorCausedBy - : cause of error
      • getErrorMessage

        public java.lang.String getErrorMessage()
        Returns:
        top level error message not localized.
      • getOriginCode

        public java.lang.String getOriginCode()
        Returns:
        The error code sent by service
      • getOriginMessage

        public java.lang.String getOriginMessage()
        Returns:
        The error message sent by service
      • hasErrors

        public boolean hasErrors()
        Identify if there are any server side validation errors
        Returns:
        true if the list contains error, false otherwise.
      • getValidationPayload

        public org.apache.sling.commons.json.JSONObject getValidationPayload()