Class ProjectInvitationHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.members.ProjectInvitationHelper
- All Implemented Interfaces:
LogEnabled
,PluginAware
,Component
,Configurable
,Contextualizable
,Serviceable
public class ProjectInvitationHelper
extends AbstractLogEnabled
implements Serviceable, Component, Configurable, PluginAware, Contextualizable
Helper for invitations by email
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected I18nizableText
_getI18nizableText
(String fullI18nKey, Map<String, I18nizableTextParameter> i18nParams) Get theI18nizableText
from the configured key and i18n parametersvoid
configure
(Configuration configuration) void
contextualize
(Context context) void
Add user as member of all project where it has been invitedgetHtmlBodyForInvitationAcceptedEmail
(Project project, Map<String, I18nizableTextParameter> defaultI18nParams, String language) The email html body for invitation by emailgetHtmlBodyForInvitationEmail
(Map<String, I18nizableTextParameter> defaultI18nParams, String language) The email html body for invitation by emailgetInvitationConfiguration
(String projectName, String lang) Get the configuration to invite users by emailsgetSubjectForInvitationAcceptedEmail
(Map<String, I18nizableTextParameter> defaultI18nParams, String language) The email subject for invitation by emailgetSubjectForInvitationEmail
(Map<String, I18nizableTextParameter> defaultI18nParams, String language) The email subject for invitation by emailgetTextBodyForInvitationAcceptedEmail
(Map<String, I18nizableTextParameter> defaultI18nParams, String language) The email text body for invitation by emailgetTextBodyForInvitationEmail
(Map<String, I18nizableTextParameter> defaultI18nParams, String language) The email text body for invitation by emailinviteEmails
(String projectName, String siteName, String lang, List<String> emails, Map<String, String> allowedProfileByModule) Invite emails to be member of a projectInvite emails to be member of a projectprotected void
sendInvitationAcceptedMail
(Project project, User invitAuthor, User newMember) Send email to the user who initiated the invitationvoid
service
(ServiceManager serviceManager) void
setPluginInfo
(String pluginName, String featureName, String id) Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The role
-
-
Constructor Details
-
ProjectInvitationHelper
public ProjectInvitationHelper()
-
-
Method Details
-
setPluginInfo
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
inviteEmails
public Map<String,Object> inviteEmails(String projectName, List<String> emails, Map<String, String> allowedProfileByModule) throws UserManagementException, NotUniqueUserExceptionInvite emails to be member of a project- Parameters:
projectName
- The project nameemails
- The emailsallowedProfileByModule
- the allowed profiles by module- Returns:
- The result
- Throws:
UserManagementException
- if failed to invit userNotUniqueUserException
- if many users match the given email
-
inviteEmails
public Map<String,Object> inviteEmails(String projectName, String siteName, String lang, List<String> emails, Map<String, String> allowedProfileByModule) throws UserManagementException, NotUniqueUserExceptionInvite emails to be member of a project- Parameters:
projectName
- The project namesiteName
- The site namelang
- the current languageemails
- The emailsallowedProfileByModule
- the allowed profiles by module- Returns:
- The result
- Throws:
UserManagementException
- if failed to invit userNotUniqueUserException
- if many users match the given email
-
getInvitationConfiguration
Get the configuration to invite users by emails- Parameters:
projectName
- The current projectlang
- the current language- Returns:
- the configuration for email invitations
-
createMemberFromInvitations
Add user as member of all project where it has been invited- Parameters:
user
- the new user
-
sendInvitationAcceptedMail
Send email to the user who initiated the invitation- Parameters:
project
- The projectinvitAuthor
- The author of invitationnewMember
- The new member
-
getSubjectForInvitationEmail
public String getSubjectForInvitationEmail(Map<String, I18nizableTextParameter> defaultI18nParams, String language) The email subject for invitation by email- Parameters:
defaultI18nParams
- The default i18n parameterslanguage
- the language- Returns:
- the email subject for invitation by email
-
getTextBodyForInvitationEmail
public String getTextBodyForInvitationEmail(Map<String, I18nizableTextParameter> defaultI18nParams, String language) The email text body for invitation by email- Parameters:
defaultI18nParams
- The default i18n parameters with : siteName the site name email the mail token the token confirmUri the confirmation uri siteTitle the site title siteUrl the site urllanguage
- the language- Returns:
- the email text for invitation by email
-
getHtmlBodyForInvitationEmail
public String getHtmlBodyForInvitationEmail(Map<String, I18nizableTextParameter> defaultI18nParams, String language) The email html body for invitation by email- Parameters:
defaultI18nParams
- The default i18n parameters with : siteName the site name email the mail token the token confirmUri the confirmation uri siteTitle the site title siteUrl the site urllanguage
- the language- Returns:
- the email html for invitation by email
-
getSubjectForInvitationAcceptedEmail
public String getSubjectForInvitationAcceptedEmail(Map<String, I18nizableTextParameter> defaultI18nParams, String language) The email subject for invitation by email- Parameters:
defaultI18nParams
- The default i18n parameterslanguage
- the language- Returns:
- the email subject for invitation by email
-
getTextBodyForInvitationAcceptedEmail
public String getTextBodyForInvitationAcceptedEmail(Map<String, I18nizableTextParameter> defaultI18nParams, String language) The email text body for invitation by email- Parameters:
defaultI18nParams
- The default i18n parameters with :language
- the language- Returns:
- the email text for invitation by email
-
getHtmlBodyForInvitationAcceptedEmail
public String getHtmlBodyForInvitationAcceptedEmail(Project project, Map<String, I18nizableTextParameter> defaultI18nParams, String language) The email html body for invitation by email- Parameters:
project
- The projectdefaultI18nParams
- The default i18n parameters with :language
- the language- Returns:
- the email html for invitation by email
-
_getI18nizableText
protected I18nizableText _getI18nizableText(String fullI18nKey, Map<String, I18nizableTextParameter> i18nParams) Get theI18nizableText
from the configured key and i18n parameters- Parameters:
fullI18nKey
- the configured i18n keyi18nParams
- the i18n parameters- Returns:
- the i18nizable text
-