Package org.ametys.plugins.forms.dao
Class FormDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.forms.dao.FormDAO
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
The form DAO
-
Field Summary
Modifier and TypeFieldDescriptionprotected FormDirectoryDAO
The form directory DAOprotected FormEntryDAO
The form entry DAOprotected FormPageDAO
The form page DAOprotected I18nUtils
I18n Utilsprotected javax.jcr.Repository
The JCR repository.protected AmetysObjectResolver
The Ametys object resolverprotected RightManager
The right managerprotected ScheduleOpeningHelper
The schedule opening helperprotected ServiceExtensionPoint
The service extension pointprotected SiteManager
The site managerprotected UserHelper
The user helperprotected CurrentUserProvider
The current user providerprotected WorkflowHelper
The workflow helperprotected ZoneDAO
The zone DAOstatic final String
The right id to handle formsstatic final String
The Avalon role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ZonedDateTime
_getLastSubmissionDate
(List<FormEntry> entries) Get the submission date of the last entry to the form_getPagesInfos
(List<SitemapElement> pages) Get the page namesCopies and pastes a form.createForm
(String siteName, String parentId, String name) Creates aForm
.deleteForm
(String id) Deletes aForm
.getAdminDashboardUri
(String siteName) Get the admin dashboard URIgetDashboardUri
(String siteName) Get the dashboard URIgetFormDisplayViews
(String formId, String siteName, String language) Get all the view available for the form display servicegetFormPage
(String formId, String siteName) Get all the page where the form is publishedgetFormProperties
(String formId) Get the form propertiesgetFormProperties
(Form form) Get the form propertiesGet all forms from a siteboolean
hasReadRightOnForm
(UserIdentity userIdentity, Form form) Check if a user have read rights on a formboolean
hasRightAffectationRightOnForm
(UserIdentity userIdentity, Form form) Check if a user have write rights on a formboolean
hasWriteRightOnForm
(UserIdentity userIdentity, Form form) Check if a user have write rights on a formboolean
isFormConfigured
(Form form) true
if the form is well configuredMoves aForm
renameForm
(String id, String newName) Rename aForm
void
service
(ServiceManager manager) setWorkflow
(String formId, String workflowName) Change workflow of aForm
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role -
HANDLE_FORMS_RIGHT_ID
The right id to handle forms- See Also:
-
_resolver
The Ametys object resolver -
_userProvider
The current user provider -
_i18nUtils
I18n Utils -
_formDirectoryDAO
The form directory DAO -
_formPageDAO
The form page DAO -
_formEntryDAO
The form entry DAO -
_userHelper
The user helper -
_repository
The JCR repository. -
_rightManager
The right manager -
_serviceEP
The service extension point -
_zoneDAO
The zone DAO -
_scheduleOpeningHelper
The schedule opening helper -
_workflowHelper
The workflow helper -
_siteManager
The site manager
-
-
Constructor Details
-
FormDAO
public FormDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getForms
Get all forms from a site- Parameters:
siteName
- the site name- Returns:
- the list of form
-
getFormProperties
Get the form properties- Parameters:
formId
- The form's id- Returns:
- The form properties
-
getFormProperties
Get the form properties- Parameters:
form
- The form- Returns:
- The form properties
-
createForm
public Map<String,String> createForm(String siteName, String parentId, String name) throws Exception Creates aForm
. -
renameForm
Rename aForm
- Parameters:
id
- The id of the formnewName
- The new name for the form- Returns:
- A result map
-
copyForm
Copies and pastes a form.- Parameters:
formDirectoryId
- The id of the form directory target of the copyformId
- The id of the form to copy- Returns:
- The results
-
deleteForm
Deletes aForm
.- Parameters:
id
- The id of the form to delete- Returns:
- The id of the form
-
moveForm
Moves aForm
- Parameters:
siteName
- name of the siteid
- The id of the formnewParentId
- The id of the new parent directory of the form.- Returns:
- A result map
-
setWorkflow
Change workflow of aForm
- Parameters:
formId
- The id of the formworkflowName
- The name of new workflow- Returns:
- A result map
-
_getLastSubmissionDate
Get the submission date of the last entry to the form- Parameters:
entries
- A list of form entry- Returns:
- the date of the last submission
-
getFormPage
Get all the page where the form is published- Parameters:
formId
- the form idsiteName
- the site name- Returns:
- the list of page
-
_getPagesInfos
Get the page names- Parameters:
pages
- the list of page- Returns:
- the list of page name
-
getFormDisplayViews
public List<Map<String,Object>> getFormDisplayViews(String formId, String siteName, String language) throws Exception Get all the view available for the form display service- Parameters:
formId
- the form identifiersiteName
- the site namelanguage
- the language- Returns:
- the views as json
- Throws:
Exception
- if an error occurred
-
hasReadRightOnForm
Check if a user have read rights on a form- Parameters:
userIdentity
- the userform
- the form- Returns:
- true if the user have read rights on a form
-
hasWriteRightOnForm
Check if a user have write rights on a form- Parameters:
userIdentity
- the userform
- the form- Returns:
- true if the user have write rights on a form
-
hasRightAffectationRightOnForm
Check if a user have write rights on a form- Parameters:
userIdentity
- the userform
- the form- Returns:
- true if the user have write rights on a form
-
isFormConfigured
true
if the form is well configured- Parameters:
form
- the form- Returns:
true
if the form is well configured
-
getDashboardUri
Get the dashboard URI- Parameters:
siteName
- the site name- Returns:
- the dashboard URI
-
getAdminDashboardUri
Get the admin dashboard URI- Parameters:
siteName
- the site name- Returns:
- the admin dashboard URI
-