Class FormResponseManager


  • public class FormResponseManager
    extends java.lang.Object
    Class for breadcrumb management and responses history
    • Constructor Detail

      • FormResponseManager

        public FormResponseManager​(Form form)
        Constructor
        Parameters:
        form - the form
      • FormResponseManager

        public FormResponseManager​(FormResponse formResponse)
        Constructor
        Parameters:
        formResponse - the form response
    • Method Detail

      • getCurrentStep

        public Step getCurrentStep()
        Gives the current step
        Returns:
        the current step
      • getFormResponse

        public FormResponse getFormResponse()
        Gives the form response
        Returns:
        the form response
      • getFormResponseUpdateDate

        public java.sql.Timestamp getFormResponseUpdateDate()
        Return the form Response update date
        Returns:
      • setFormResponseUpdateDate

        public void setFormResponseUpdateDate​(java.sql.Timestamp updateDate)
      • getIsBackupResponseAlreadyInitiated

        public java.lang.Boolean getIsBackupResponseAlreadyInitiated()
        Give a boolean indicating that indicates if view (getViewStep) has been initialized from backup So with _isBackupResponseAlreadyInitiated and _bIsResponseLoadedFromBackup we can deduce if it's the first time the getViewStep is loaded with the backup response
        Returns:
        a boolean indicating that indicates if view has been initialized from backup
      • setBackupResponseAlreadyInitiated

        public void setBackupResponseAlreadyInitiated​(java.lang.Boolean isBackupResponseAlreadyInitiated)
      • getIsResponseLoadedFromBackup

        public java.lang.Boolean getIsResponseLoadedFromBackup()
        Gives a boolean indicating if the response is loaded from backup
        Returns:
        a boolean indicating if the response is loaded from backup
      • setIsResponseLoadedFromBackup

        public void setIsResponseLoadedFromBackup​(java.lang.Boolean bIsResponseLoadedFromBackup)
      • add

        public void add​(Step step)
        Adds the specified step
        Parameters:
        step - the step to add
      • goTo

        public Step goTo​(int nStepIndex)
        Goes to the step of the specified index
        Parameters:
        nStepIndex - the step index
        Returns:
        the Step
      • findResponsesFor

        public java.util.List<FormQuestionResponse> findResponsesFor​(Step step)
        Finds the responses for the specified step
        Parameters:
        step - the step
        Returns:
        the found responses
      • findAllResponses

        public java.util.List<FormQuestionResponse> findAllResponses()
        Finds all responses
        Returns:
        the found responses
      • addResponses

        public void addResponses​(java.util.List<FormQuestionResponse> listFormQuestionResponse)
        Adds the specified responses
        Parameters:
        listFormQuestionResponse - the responses to add
      • popStep

        public Step popStep()
        Pops the last step
        Returns:
        the last step, or null if there no step to pop
      • getValidatedSteps

        public java.util.List<Step> getValidatedSteps()
        Gives the validated steps
        Returns:
        the validated steps
      • validateFormResponses

        public boolean validateFormResponses()
        Returns:
        the form validation result