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.
-
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 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 entrygetFormEntryModel
(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
-
-
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
-