Package org.ametys.plugins.forms.actions
Class AbstractProcessFormAction
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
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
- Direct Known Subclasses:
EditFormEntryAction
,ProcessFormAction
Abstract action to process form entry inputs
-
Field Summary
Modifier and TypeFieldDescriptionprotected FormEntryDAO
The form entry DAOprotected FOAmetysObjectCreationHelper
The FO ametys object creation helperprotected FormDAO
The form DAOprotected FormQuestionDAO
The form question DAOprotected AmetysObjectResolver
The ametys object resolverprotected RightManager
The right managerFields 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 View
_getRuleFilteredEntryView
(Form form, View entryView, FormQuestionDAO.FormEntryValues entryValues, Optional<Long> currentStepId) Get a view without elements hidden by a ruleprotected abstract List<FormQuestion>
_getRuleFilteredQuestions
(Form form, FormQuestionDAO.FormEntryValues entryValues, Optional<Long> currentStepId) Get the list of active question depending of the form rulesprotected void
_handleComputedValues
(List<FormQuestion> questions, FormEntry entry, boolean forEdition) Handle computed valuesvoid
service
(ServiceManager smanager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_resolver
The ametys object resolver -
_foAmetysObjectCreationHelper
The FO ametys object creation helper -
_formDAO
The form DAO -
_entryDAO
The form entry DAO -
_formQuestionDAO
The form question DAO -
_rightManager
The right manager
-
-
Constructor Details
-
AbstractProcessFormAction
public AbstractProcessFormAction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
_adaptFormValuesForChoiceList
Remove empty value for choice list because empty value is an other value- Parameters:
form
- the formformInputValues
- the form inputs to change
-
_getRuleFilteredEntryView
protected View _getRuleFilteredEntryView(Form form, View entryView, FormQuestionDAO.FormEntryValues entryValues, Optional<Long> currentStepId) Get a view without elements hidden by a rule- Parameters:
form
- The current formentryView
- The entry view with possibly unwanted viewItemsentryValues
- The entry valuescurrentStepId
- current step of the entry. Can be empty if the form has no workflow- Returns:
- a view with filtered items
-
_getRuleFilteredQuestions
protected abstract List<FormQuestion> _getRuleFilteredQuestions(Form form, FormQuestionDAO.FormEntryValues entryValues, Optional<Long> currentStepId) Get the list of active question depending of the form rules- 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
-
_handleComputedValues
protected void _handleComputedValues(List<FormQuestion> questions, FormEntry entry, boolean forEdition) Handle computed values- Parameters:
questions
- the form questionsentry
- the entryforEdition
-true
to handle edition
-