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
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user providerprotected FormMailHelper
The form mail helperprotected FormWorkflowHelper
The form workflow helperprotected LimitedEntriesHelper
the Handle Limited Entries Helperprotected PageHelper
The page helperprotected ScheduleOpeningHelper
The schedule opening helperprotected UserManager
The users managerstatic final String
The catpcha keyFields inherited from class org.ametys.plugins.forms.actions.AbstractProcessFormAction
_entryDAO, _foAmetysObjectCreationHelper, _formDAO, _formQuestionDAO, _resolver, _rightManager
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
_checkCaptcha
(Request request, Form form, Multimap<String, I18nizableText> formErrors) Check the captcha if neededprotected List<FormQuestion>
_getRuleFilteredQuestions
(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) void
service
(ServiceManager serviceManager) Methods inherited from class org.ametys.plugins.forms.actions.AbstractProcessFormAction
_adaptFormValuesForChoiceList, _getRuleFilteredEntryView, _handleComputedValues
Methods 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
-
-
Constructor Details
-
ProcessFormAction
public ProcessFormAction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in 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(Form form, FormQuestionDAO.FormEntryValues entryValues, Optional<Long> currentStepId) Description copied from class:AbstractProcessFormAction
Get the list of active question depending of the form rules- Specified by:
_getRuleFilteredQuestions
in classAbstractProcessFormAction
- Parameters:
form
- 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:
true
if 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
-