Package org.ametys.plugins.forms.helper
Class FormInvitationsHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.forms.helper.FormInvitationsHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
The helper to schedule opening of form
-
Field Summary
Modifier and TypeFieldDescriptionprotected FormDAO
The form DAOprotected I18nUtils
The i18n utilsprotected LimitedEntriesHelper
The limited entries helperprotected AmetysObjectResolver
Ametys object resolver.protected RightManager
The right managerprotected SiteManager
The site managerprotected UserManager
The users managerstatic final String
Avalon ROLE. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
_getFormURI
(String formId, String siteName, String language) Get the form page uriprotected String
_getMailBody
(String formId, String message, String siteName, String language) Get the email bodyprotected String
_getMailSubject
(String language) Get the email subject_getUsersToInvite
(Form form) Get users to invite to the form (user with mail and who are not answered yet to the form)int
getNbOfUsersToInvite
(String formId) Get users to invite to the form (user with mail and who are not answered yet to the form)sendInvitations
(String formId, String message, String siteName, String language) Sends invitations emails.void
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon ROLE. -
_resolver
Ametys object resolver. -
_userManager
The users manager -
_siteManager
The site manager -
_i18nUtils
The i18n utils -
_rightManager
The right manager -
_limitedEntriesHelper
The limited entries helper -
_formDAO
The form DAO
-
-
Constructor Details
-
FormInvitationsHelper
public FormInvitationsHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
sendInvitations
public Map<String,Object> sendInvitations(String formId, String message, String siteName, String language) Sends invitations emails.- Parameters:
formId
- The id of the form.message
- The message content.siteName
- The site name.language
- the language- Returns:
- An empty map
-
_getUsersToInvite
Get users to invite to the form (user with mail and who are not answered yet to the form)- Parameters:
form
- the form- Returns:
- the users to invite
-
getNbOfUsersToInvite
Get users to invite to the form (user with mail and who are not answered yet to the form)- Parameters:
formId
- The id of the form.- Returns:
- The number of users to invite
-
_getMailSubject
Get the email subject- Parameters:
language
- the language- Returns:
- The subject
-
_getMailBody
Get the email body- Parameters:
formId
- The form idmessage
- The messagesiteName
- The site namelanguage
- the language- Returns:
- The text body
-
_getFormURI
Get the form page uri- Parameters:
formId
- The form idsiteName
- The site namelanguage
- the language- Returns:
- The survey absolute uri
-