Class FormService
java.lang.Object
fr.paris.lutece.plugins.forms.service.FormService
This is the service class related to the form
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFormResponseManagerFromBackUp(Form form, String strUserGuid) Creates aFormResponseManagerobject from a back upbooleanexistCompositeResponses(FormDisplay formDisplay) Check if responses exist for a composite (question or group of questions)voidFire the create event on all the form responses associated to given formvoidfireFormResponseEventCreation(FormResponse formResponse) Fire the create event on given form ResponsevoidFire the delete event of all the form responses associated to given formvoidfireFormResponseEventDelete(FormResponse formResponse) Fire the form response deletion eventvoidFire the update event on all the form responses associated to given formvoidfireFormResponseEventUpdate(FormResponse formResponse) Fire the form response event update on given formResponsevoidfireFormResponseEventUpdate(FormResponse formResponse, boolean updateDateFormResponse) Fire the form response event update on given formResponseformDisplayToComposite(FormDisplay formDisplay, FormResponse formResponse, int nIterationNumber) Get the right composite from the given formDisplaygetStepCompositeList(int nIdStep) Get the full children composite list of the given stepbooleanisFileAccessAuthorized(jakarta.servlet.http.HttpServletRequest request, int nIdResponse, int nIdFile) Check if a user is authorized to access a File from its given identifiervoidprocessFormAction(Form form, FormResponse formResponse) Process action on form creationvoidremoveBackupsByForm(int nIdForm) Removes all backup form responses (from_save = 1) linked to a given Form, including their question responsesvoidremoveForm(int nIdForm, fr.paris.lutece.portal.business.user.AdminUser adminUser) Remove a given Form, all its steps and composites, workflow resources.voidremoveFormBackup(FormResponse formResponse) Removes the specified form's backupvoidsaveForm(Form form, FormResponse formResponse) Saves the specified form *voidsaveFormForBackup(FormResponse formResponse) Saves the specified form for a backupvoidsaveFormResponse(FormResponse formResponse) Save the response of formvoidsaveFormResponseWithoutQuestionResponse(FormResponse formResponse) Saves the form responsevoidsaveOrUpdateField(fr.paris.lutece.plugins.genericattributes.business.Entry entry, String fieldName, String title, String value) Save or update the field of the entry
-
Field Details
-
BEAN_NAME
- See Also:
-
-
Constructor Details
-
FormService
public FormService()
-
-
Method Details
-
saveForm
Saves the specified form *- Parameters:
form- the form to saveformResponse- the form response to save- Throws:
MaxFormResponseException- the MaxFormResponseException Runtime Exception
-
saveFormResponse
Save the response of form- Parameters:
formResponse- The FormResponse- Throws:
MaxFormResponseException- the MaxFormResponseException Runtime Exception
-
processFormAction
Process action on form creation- Parameters:
form- the workflow formformResponse- the form response
-
saveFormResponseWithoutQuestionResponse
Saves the form response- Parameters:
formResponse- the form response to save
-
saveFormForBackup
Saves the specified form for a backup- Parameters:
formResponse- The form response to save
-
removeFormBackup
Removes the specified form's backup- Parameters:
formResponse- The form response to remove
-
removeBackupsByForm
public void removeBackupsByForm(int nIdForm) Removes all backup form responses (from_save = 1) linked to a given Form, including their question responses- Parameters:
nIdForm- The identifier of the form
-
getStepCompositeList
Get the full children composite list of the given step- Parameters:
nIdStep- The step primary key- Returns:
- the Html of the given step
-
formDisplayToComposite
public ICompositeDisplay formDisplayToComposite(FormDisplay formDisplay, FormResponse formResponse, int nIterationNumber) Get the right composite from the given formDisplay- Parameters:
formDisplay- The formDisplayformResponse- the form responsenIterationNumber- the iteration number- Returns:
- the right composite
-
removeForm
public void removeForm(int nIdForm, fr.paris.lutece.portal.business.user.AdminUser adminUser) Remove a given Form, all its steps and composites, workflow resources. Also remove all the related formResponses, QuestionsResposes, EntryResponses and entries. A deletion event is fired for each removed form response, as for a response removed alone, so that the indexes (elasticdata, search) drop them.- Parameters:
nIdForm- The identifier of the form to be deletedadminUser- the user
-
isFileAccessAuthorized
public boolean isFileAccessAuthorized(jakarta.servlet.http.HttpServletRequest request, int nIdResponse, int nIdFile) Check if a user is authorized to access a File from its given identifier- Parameters:
request- The request to use to retrieve information of the current usernIdResponse- The identifier of the Response which have the filenIdFile- The identifier of the file to access- Returns:
- the boolean which tell if the user is authorize to access the given File or not
-
createFormResponseManagerFromBackUp
Creates aFormResponseManagerobject from a back up- Parameters:
form- The formstrUserGuid- The user guid- Returns:
- the created
FormResponseManagerobject
-
fireFormResponseEventCreation
Fire the create event on given form Response- Parameters:
formResponse- the form Response
-
fireFormResponseEventCreation
Fire the create event on all the form responses associated to given form- Parameters:
form- The form
-
fireFormResponseEventUpdate
Fire the form response event update on given formResponse- Parameters:
formResponse- the formResponse
-
fireFormResponseEventUpdate
Fire the form response event update on given formResponse- Parameters:
formResponse- the formResponseupdateDateFormResponse- true if the update date of the form response must be updated
-
fireFormResponseEventUpdate
Fire the update event on all the form responses associated to given form- Parameters:
form- The form
-
fireFormResponseEventDelete
Fire the form response deletion event- Parameters:
formResponse- the form response
-
fireFormResponseEventDelete
Fire the delete event of all the form responses associated to given form- Parameters:
form- the form
-
saveOrUpdateField
public void saveOrUpdateField(fr.paris.lutece.plugins.genericattributes.business.Entry entry, String fieldName, String title, String value) Save or update the field of the entry- Parameters:
entry-fieldName-title-value-
-
existCompositeResponses
Check if responses exist for a composite (question or group of questions)- Parameters:
formDisplay- the form display- Returns:
- true if responses exist, false otherwise
-