Class SendNewsPublicationNotificationFunction
- java.lang.Object
-
- org.ametys.plugins.workflow.AbstractWorkflowComponent
-
- org.ametys.cms.workflow.AbstractContentWorkflowComponent
-
- org.ametys.cms.workflow.SendMailFunction
-
- org.ametys.web.workflow.SendMailFunction
-
- org.ametys.plugins.workspaces.project.notification.SendNewsPublicationNotificationFunction
-
- All Implemented Interfaces:
com.opensymphony.workflow.FunctionProvider
,PluginAware
,Initializable
,Contextualizable
,LogEnabled
,Serviceable
public class SendNewsPublicationNotificationFunction extends SendMailFunction
Function to notify news publication
-
-
Field Summary
-
Fields inherited from class org.ametys.cms.workflow.SendMailFunction
_context, _currentUserProvider, _i18nUtils, _pluginName, _rightManager, _sourceResolver, _userManager, _workflowProvider, BODY_KEY, RIGHTS_KEY, SEND_MAIL, SUBJECT_KEY
-
Fields inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
_contentHelper, CONTENT_KEY, HAS_CHANGED_KEY
-
Fields inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
_logger, _manager, CONTEXT_PARAMETERS_KEY, FAIL_CONDITIONS_KEY, RESULT_MAP_KEY, WORKFLOW_ERRORS_KEY, WORKFLOW_WARNS_KEY
-
-
Constructor Summary
Constructors Constructor Description SendNewsPublicationNotificationFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<UserIdentity>
_getUsers(WorkflowAwareContent content, Set<String> rights)
Get the user logins.protected void
_sendMails(String subject, String body, Set<String> recipients, String from)
Send the notification emails.protected String
getMailBody(String bodyI18nKey, User user, WorkflowAwareContent content, Map transientVars)
Get the text body of mailprotected List<String>
getSubjectI18nParams(User user, WorkflowAwareContent content)
Get the i18n parameters of mail subjectvoid
initialize()
-
Methods inherited from class org.ametys.web.workflow.SendMailFunction
_getContentUri, _getPage, _getSite, getBodyI18nParams, service
-
Methods inherited from class org.ametys.cms.workflow.SendMailFunction
_getContentUri, _getRequest, _getRequestUri, contextualize, execute, getCaller, getMailSubject, getRecipients, getSender, setPluginInfo
-
Methods inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
getContent
-
Methods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
addWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser
-
-
-
-
Constructor Detail
-
SendNewsPublicationNotificationFunction
public SendNewsPublicationNotificationFunction()
-
-
Method Detail
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classSendMailFunction
- Throws:
Exception
-
getSubjectI18nParams
protected List<String> getSubjectI18nParams(User user, WorkflowAwareContent content)
Description copied from class:SendMailFunction
Get the i18n parameters of mail subject- Overrides:
getSubjectI18nParams
in classSendMailFunction
- Parameters:
user
- the callercontent
- the content- Returns:
- the i18n parameters
-
getMailBody
protected String getMailBody(String bodyI18nKey, User user, WorkflowAwareContent content, Map transientVars)
Description copied from class:SendMailFunction
Get the text body of mail- Overrides:
getMailBody
in classSendMailFunction
- Parameters:
bodyI18nKey
- the i18n key to use for bodyuser
- the callercontent
- the contenttransientVars
- the transient variables- Returns:
- the text body
-
_sendMails
protected void _sendMails(String subject, String body, Set<String> recipients, String from)
Description copied from class:SendMailFunction
Send the notification emails.- Overrides:
_sendMails
in classSendMailFunction
- Parameters:
subject
- the e-mail subject.body
- the e-mail body.recipients
- the recipients emails address.from
- the address sending the e-mail.
-
_getUsers
protected Set<UserIdentity> _getUsers(WorkflowAwareContent content, Set<String> rights) throws com.opensymphony.workflow.WorkflowException
Description copied from class:SendMailFunction
Get the user logins.- Overrides:
_getUsers
in classSendMailFunction
- Parameters:
content
- the content.rights
- the set of rights to check.- Returns:
- the users.
- Throws:
com.opensymphony.workflow.WorkflowException
- If an error occurred
-
-