Package org.ametys.plugins.forms.dao
Class FormEntryDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.forms.dao.FormEntryDAO
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
Form entry DAO.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
Record representing a sort with form attribute name and direction -
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user provider.protected LimitedEntriesHelper
The handling limited entries helperprotected ObservationManager
Observer manager.protected ParametersManager
The parameters managerprotected AmetysObjectResolver
Ametys object resolver.protected RightManager
The rights managerprotected SystemPropertyExtensionPoint
The system property extension pointprotected UserManager
The user managerprotected WorkflowProvider
The current user providerstatic final String
The right id to delete form entriesstatic final String
Name for entries root jcr nodestatic final String
The right id to consult form entriesstatic final String
The Avalon role name. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_getColumns
(Form form) Get the columns for search form entries_getCriteria
(Form form) Get criteria to search form entries_getUserRights
(FormEntry entry) Get user rights for the given form entryprotected boolean
_isSortable
(FormQuestion question) true
if the column link to the question is sortablevoid
checkHandleDataRight
(AmetysObject formElement) Check handle data right for a form element as ametys objectclearEntries
(String id) Delete all entries of a formcreateEntry
(Form form) Creates aFormEntry
.deleteEntry
(String id) Deletes aFormEntry
.getCurrentStepId
(FormEntry entry) Retrieves the current step id of the form entrygetFormEntries
(Form form, boolean onlyActiveEntries, List<FormEntryDAO.Sort> sorts) Get the form entriesgetFormEntries
(Form form, boolean onlyActiveEntries, Expression additionalEntryFilterExpr, List<FormEntryDAO.Sort> sorts) Get the form entriesgetFormEntriesUsers
(String formId) Get all users who answer to the form as JSONgetFormEntryModel
(Form form) Get the form entry modelGets properties of a form entrygetFormEntryProperties
(FormEntry entry) Gets properties of a form entrygetSearchModelConfiguration
(String formId) Get the search model configuration to search form entriesboolean
hasHandleDataRightOnForm
(UserIdentity userIdentity, AmetysObject formElement) Check if a user have handle data right on a form element as ametys objectvoid
service
(ServiceManager serviceManager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role name. -
ENTRIES_ROOT
Name for entries root jcr node- See Also:
-
HANDLE_FORMS_ENTRIES_RIGHT_ID
The right id to consult form entries- See Also:
-
DELETE_FORMS_ENTRIES_RIGHT_ID
The right id to delete form entries- See Also:
-
_resolver
Ametys object resolver. -
_parametersManager
The parameters manager -
_observationManager
Observer manager. -
_currentUserProvider
The current user provider. -
_handleLimitedEntriesHelper
The handling limited entries helper -
_rightManager
The rights manager -
_workflowProvider
The current user provider -
_userManager
The user manager -
_systemPropertyEP
The system property extension point
-
-
Constructor Details
-
FormEntryDAO
public FormEntryDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
hasHandleDataRightOnForm
Check if a user have handle data right on a form element as ametys object- Parameters:
userIdentity
- the userformElement
- the form element- Returns:
- true if the user handle data right for a form element
-
checkHandleDataRight
Check handle data right for a form element as ametys object- Parameters:
formElement
- the form element as ametys object
-
getFormEntryProperties
Gets properties of a form entry- Parameters:
id
- The id of the form entry- Returns:
- The properties
-
getFormEntryProperties
Gets properties of a form entry- Parameters:
entry
- The form entry- Returns:
- The properties
-
_getUserRights
Get user rights for the given form entry- Parameters:
entry
- the form entry- Returns:
- the set of rights
-
createEntry
Creates aFormEntry
.- Parameters:
form
- The parent form- Returns:
- return the form entry
-
getSearchModelConfiguration
Get the search model configuration to search form entries- Parameters:
formId
- the identifier of form- Returns:
- The search model configuration
- Throws:
ProcessingException
- If an error occurred
-
_getCriteria
Get criteria to search form entries- Parameters:
form
- the form- Returns:
- the criteria as JSON
-
_getColumns
Get the columns for search form entries- Parameters:
form
- the form- Returns:
- the columns as JSON
- Throws:
ProcessingException
- if an error occurred
-
_isSortable
true
if the column link to the question is sortable- Parameters:
question
- the question- Returns:
true
if the column link to the question is sortable
-
deleteEntry
Deletes aFormEntry
.- Parameters:
id
- The id of the form entry to delete- Returns:
- The entry data
-
clearEntries
Delete all entries of a form- Parameters:
id
- The id of the form- Returns:
- the deleted entries data
-
getCurrentStepId
Retrieves the current step id of the form entry- Parameters:
entry
- The form entry- Returns:
- the current step id
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getFormEntryModel
Get the form entry model- Parameters:
form
- the form- Returns:
- the form entry model
-
getFormEntries
public List<FormEntry> getFormEntries(Form form, boolean onlyActiveEntries, List<FormEntryDAO.Sort> sorts) Get the form entries- Parameters:
form
- the formonlyActiveEntries
-true
to have only active entriessorts
- the list of sort- Returns:
- the form entries
-
getFormEntries
public List<FormEntry> getFormEntries(Form form, boolean onlyActiveEntries, Expression additionalEntryFilterExpr, List<FormEntryDAO.Sort> sorts) Get the form entries- Parameters:
form
- the formonlyActiveEntries
-true
to have only active entriesadditionalEntryFilterExpr
- the additional entry filter expression. Can be null.sorts
- the list of sort- Returns:
- the form entries
-
getFormEntriesUsers
Get all users who answer to the form as JSON- Parameters:
formId
- the form id- Returns:
- all users as JSON
-