Class FormResponseManager
- java.lang.Object
-
- fr.paris.lutece.plugins.forms.web.FormResponseManager
-
public class FormResponseManager extends Object
Class for breadcrumb management and responses history
-
-
Constructor Summary
Constructors Constructor Description FormResponseManager(Form form)ConstructorFormResponseManager(FormResponse formResponse)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Step step)Adds the specified stepvoidaddResponses(List<FormQuestionResponse> listFormQuestionResponse)Adds the specified responsesList<FormQuestionResponse>findAllResponses()Finds all responsesList<FormQuestionResponse>findResponsesFor(Step step)Finds the responses for the specified stepStepgetCurrentStep()Gives the current stepFormResponsegetFormResponse()Gives the form responseTimestampgetFormResponseUpdateDate()Return the form Response update dateBooleangetIsBackupResponseAlreadyInitiated()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 responseBooleangetIsResponseLoadedFromBackup()Gives a boolean indicating if the response is loaded from backupList<Step>getValidatedSteps()Gives the validated stepsStepgoTo(int nStepIndex)Goes to the step of the specified indexSteppopStep()Pops the last stepvoidsetBackupResponseAlreadyInitiated(Boolean isBackupResponseAlreadyInitiated)voidsetFormResponseUpdateDate(Timestamp updateDate)voidsetIsResponseLoadedFromBackup(Boolean bIsResponseLoadedFromBackup)booleanvalidateFormResponses()
-
-
-
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 Timestamp getFormResponseUpdateDate()
Return the form Response update date- Returns:
-
setFormResponseUpdateDate
public void setFormResponseUpdateDate(Timestamp updateDate)
-
getIsBackupResponseAlreadyInitiated
public 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(Boolean isBackupResponseAlreadyInitiated)
-
getIsResponseLoadedFromBackup
public 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(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 List<FormQuestionResponse> findResponsesFor(Step step)
Finds the responses for the specified step- Parameters:
step- the step- Returns:
- the found responses
-
findAllResponses
public List<FormQuestionResponse> findAllResponses()
Finds all responses- Returns:
- the found responses
-
addResponses
public void addResponses(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
nullif there no step to pop
-
getValidatedSteps
public List<Step> getValidatedSteps()
Gives the validated steps- Returns:
- the validated steps
-
validateFormResponses
public boolean validateFormResponses()
- Returns:
- the form validation result
-
-