Class FormService
- java.lang.Object
-
- fr.paris.lutece.plugins.forms.service.FormService
-
public class FormService extends Object
This is the service class related to the form
-
-
Constructor Summary
Constructors Constructor Description FormService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormResponseManagercreateFormResponseManagerFromBackUp(Form form, String strUserGuid)Creates aFormResponseManagerobject from a back upbooleanexistCompositeResponses(FormDisplay formDisplay)Check if responses exist for a composite (question or group of questions)voidfireFormResponseEventCreation(Form form)Fire the create event on all the form responses associated to given formvoidfireFormResponseEventCreation(FormResponse formResponse)Fire the create event on given form ResponsevoidfireFormResponseEventDelete(Form form)Fire the delete event of all the form responses associated to given formvoidfireFormResponseEventDelete(FormResponse formResponse)Fire the form response deletion eventvoidfireFormResponseEventUpdate(Form form)Fire the update event on all the form responses associated to given formvoidfireFormResponseEventUpdate(FormResponse formResponse)Fire the form response event update on given formResponseICompositeDisplayformDisplayToComposite(FormDisplay formDisplay, FormResponse formResponse, int nIterationNumber)Get the right composite from the given formDisplayList<ICompositeDisplay>getStepCompositeList(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 Detail
-
BEAN_NAME
public static final String BEAN_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
saveForm
public void saveForm(Form form, FormResponse formResponse)
Saves the specified form *- Parameters:
form- the form to saveformResponse- the form response to save- Throws:
MaxFormResponseException- the MaxFormResponseException Runtime Exception
-
saveFormResponse
public void saveFormResponse(FormResponse formResponse)
Save the response of form- Parameters:
formResponse- The FormResponse- Throws:
MaxFormResponseException- the MaxFormResponseException Runtime Exception
-
processFormAction
public void processFormAction(Form form, FormResponse formResponse)
Process action on form creation- Parameters:
form- the workflow formformResponse- the form response
-
saveFormResponseWithoutQuestionResponse
public void saveFormResponseWithoutQuestionResponse(FormResponse formResponse)
Saves the form response- Parameters:
formResponse- the form response to save
-
saveFormForBackup
@Transactional("forms.transactionManager") public void saveFormForBackup(FormResponse formResponse)Saves the specified form for a backup- Parameters:
formResponse- The form response to save
-
removeFormBackup
@Transactional("forms.transactionManager") public void removeFormBackup(FormResponse formResponse)Removes the specified form's backup- Parameters:
formResponse- The form response to remove
-
getStepCompositeList
public List<ICompositeDisplay> getStepCompositeList(int nIdStep)
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
public FormResponseManager createFormResponseManagerFromBackUp(Form form, String strUserGuid)
Creates aFormResponseManagerobject from a back up- Parameters:
form- The formstrUserGuid- The user guid- Returns:
- the created
FormResponseManagerobject
-
fireFormResponseEventCreation
public void fireFormResponseEventCreation(FormResponse formResponse)
Fire the create event on given form Response- Parameters:
formResponse- the form Response
-
fireFormResponseEventCreation
public void fireFormResponseEventCreation(Form form)
Fire the create event on all the form responses associated to given form- Parameters:
form- The form
-
fireFormResponseEventUpdate
public void fireFormResponseEventUpdate(FormResponse formResponse)
Fire the form response event update on given formResponse- Parameters:
formResponse- the formResponse
-
fireFormResponseEventUpdate
public void fireFormResponseEventUpdate(Form form)
Fire the update event on all the form responses associated to given form- Parameters:
form- The form
-
fireFormResponseEventDelete
public void fireFormResponseEventDelete(FormResponse formResponse)
Fire the form response deletion event- Parameters:
formResponse- the form response
-
fireFormResponseEventDelete
public void fireFormResponseEventDelete(Form form)
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
public boolean existCompositeResponses(FormDisplay formDisplay)
Check if responses exist for a composite (question or group of questions)- Parameters:
formDisplay- the form display- Returns:
- true if responses exist, false otherwise
-
-