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.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 FormEntryDAO
The form entry dao.protected FOAmetysObjectCreationHelper
The FO content creation helperprotected FormDAO
The form dao.protected FormMailHelper
The form mail helperprotected FormWorkflowHelper
The form workflow helperprotected LimitedEntriesHelper
the Handle Limited Entries Helperprotected PageHelper
The page helperprotected AmetysObjectResolver
The ametys object resolver.protected RightManager
The right managerprotected ScheduleOpeningHelper
The schedule opening helperprotected UserManager
The users managerstatic final String
The catpcha keyFields 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 void
_adaptFormValuesForChoiceList
(Form form, Map<String, Object> formInputValues) Remove empty value for choice list because empty value is an other valueprotected boolean
_checkCaptcha
(Request request, Form form, Multimap<String, I18nizableText> formErrors) Check the captcha if neededprotected List<FormQuestion>
_getActiveQuestions
(Form form, Map<String, Object> formInputValues) Get a list of the form questions not being hidden by a ruleprotected View
Get a view without elements hidden by a ruleprotected void
_handleComputedValues
(List<FormQuestion> questions, FormEntry entry) Handle computed values_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.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
CAPTCHA_KEY
The catpcha key- See Also:
-
_resolver
The ametys object resolver. -
_formDAO
The form dao. -
_entryDAO
The form entry dao. -
_foAmetysObjectCreationHelper
The FO content creation helper -
_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 -
_rightManager
The right manager -
_pageHelper
The page helper
-
-
Constructor Details
-
ProcessFormAction
public ProcessFormAction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception - Throws:
Exception
-
_processForm
Process form- Parameters:
request
- the request- Returns:
- the results
-
_adaptFormValuesForChoiceList
Remove empty value for choice list because empty value is an other value- Parameters:
form
- the formformInputValues
- the form inputs to change
-
_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
-
_getRuleFilteredEntryView
protected View _getRuleFilteredEntryView(Form form, View entryView, Map<String, Object> formInputValues) Get a view without elements hidden by a rule- Parameters:
form
- The current formentryView
- The entry view with possibly unwanted viewItemsformInputValues
- The input values- Returns:
- a view with filtered items
-
_getActiveQuestions
Get a list of the form questions not being hidden by a rule- Parameters:
form
- the current formformInputValues
- map of input values- Returns:
- a list of visible questions
-
_handleComputedValues
Handle computed values- Parameters:
questions
- the form questionsentry
- the entry
-
_sendEmails
Send the receipt and notification emails.- Parameters:
entry
- the current entry
-