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 updateDate) 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(javax.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 creationvoidremoveForm(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
-
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
@Transactional("forms.transactionManager") 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.- Parameters:
nIdForm- The identifier of the form to be deletedadminUser- the user
-
isFileAccessAuthorized
public boolean isFileAccessAuthorized(javax.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 formResponseupdateDate- asks the listener to update the response update date
-
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
-