Package org.ametys.plugins.forms.actions
Class ProcessFormAction
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.acting.AbstractAction
org.apache.cocoon.acting.ServiceableAction
org.ametys.plugins.forms.actions.AbstractProcessFormAction
org.ametys.plugins.forms.actions.ProcessFormAction
- All Implemented Interfaces:
Component,LogEnabled,Serviceable,Action
- Direct Known Subclasses:
ProcessMiniSurveyAction
Process the user entries to the form.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CurrentUserProviderThe current user providerprotected FormEntryDAOThe form entry DAOprotected FormMailHelperThe form mail helperprotected FormWorkflowHelperThe form workflow helperprotected LimitedEntriesHelperthe Handle Limited Entries Helperprotected PageHelperThe page helperprotected ScheduleOpeningHelperThe schedule opening helperprotected UserManagerThe users managerstatic final StringThe catpcha keyFields inherited from class org.ametys.plugins.forms.actions.AbstractProcessFormAction
_entryDAO, _foAmetysObjectCreationHelper, _formDAO, _formQuestionDAO, _resolver, _rightManagerFields inherited from class org.apache.cocoon.acting.ServiceableAction
managerFields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean_checkCaptcha(Request request, Form form, Multimap<String, I18nizableText> formErrors) Check the captcha if neededprotected List<FormQuestion> _getRuleFilteredQuestions(Request request, Form form, FormQuestionDAO.FormEntryValues entryValues, Optional<Long> currentStepId) Get the list of active question depending of the form rules_processForm(Request request) Process formprotected void_sendEmails(FormEntry entry) Send the receipt and notification emails.protected void_setEntryId(FormEntry entry) Set entry id (auto-incremental id)act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) voidservice(ServiceManager serviceManager) Methods inherited from class org.ametys.plugins.forms.actions.AbstractProcessFormAction
_adaptFormValuesForChoiceList, _getRuleFilteredEntryView, _handleComputedValuesMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
CAPTCHA_KEY
The catpcha key- See Also:
-
_formWorkflowHelper
The form workflow helper -
_currentUserProvider
The current user provider -
_userManager
The users manager -
_limitedEntriesHelper
the Handle Limited Entries Helper -
_formMailHelper
The form mail helper -
_scheduleOpeningHelper
The schedule opening helper -
_pageHelper
The page helper -
_formEntryDAO
The form entry DAO
-
-
Constructor Details
-
ProcessFormAction
public ProcessFormAction()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractProcessFormAction- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception - Throws:
Exception
-
_getRuleFilteredQuestions
protected List<FormQuestion> _getRuleFilteredQuestions(Request request, Form form, FormQuestionDAO.FormEntryValues entryValues, Optional<Long> currentStepId) Description copied from class:AbstractProcessFormActionGet the list of active question depending of the form rules- Specified by:
_getRuleFilteredQuestionsin classAbstractProcessFormAction- Parameters:
request- the requestform- the formentryValues- the entry values to compute rulescurrentStepId- the current step id. Can be empty if the form has no workflow- Returns:
- the list of active question depending of the form rules
-
_processForm
Process form- Parameters:
request- the request- Returns:
- the results
-
_checkCaptcha
protected boolean _checkCaptcha(Request request, Form form, Multimap<String, I18nizableText> formErrors) Check the captcha if needed- Parameters:
request- the requestform- the formformErrors- the form errors- Returns:
trueif the captcha is good
-
_setEntryId
Set entry id (auto-incremental id)- Parameters:
entry- the entry
-
_sendEmails
Send the receipt and notification emails.- Parameters:
entry- the current entry
-