Class SendCalendarNotificationFunction
- java.lang.Object
- 
- org.ametys.plugins.workflow.AbstractWorkflowComponent
- 
- org.ametys.plugins.explorer.workflow.AbstractExplorerNodeWorkflowComponent
- 
- org.ametys.plugins.workspaces.project.notification.SendCalendarNotificationFunction
 
 
 
- 
- All Implemented Interfaces:
- com.opensymphony.workflow.FunctionProvider,- PluginAware,- Initializable,- Contextualizable,- LogEnabled,- Serviceable
 
 public class SendCalendarNotificationFunction extends AbstractExplorerNodeWorkflowComponent implements com.opensymphony.workflow.FunctionProvider, Initializable, PluginAware, Contextualizable OS workflow function to send mail after an action is triggered.
- 
- 
Field SummaryFields Modifier and Type Field Description protected Context_contextContext available to subclasses.protected I18nUtils_i18nUtilsI18nUtilsprotected String_pluginNameThe plugin name.protected ProjectManager_projectManagerThe project resolverprotected RenderingContextHandler_renderingContextHandlerThe rendering context handlerprotected AmetysObjectResolver_resolverThe ametys resolverprotected RightManager_rightManagerThe right manager.protected UserManager_userManagerThe users manager.protected WorkflowProvider_workflowProviderThe workflow providerprotected static StringBODY_KEYThe mail body key.protected static StringRIGHTSThe mail subject key.static StringSEND_MAILProvide "false" to prevent the function sending the mail.protected static StringSUBJECT_KEYThe mail subject key.- 
Fields inherited from class org.ametys.plugins.explorer.workflow.AbstractExplorerNodeWorkflowComponentEXPLORERNODE_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 SummaryConstructors Constructor Description SendCalendarNotificationFunction()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String_getRecurrentDateInfo(CalendarEvent event, DateFormat dayFormat)Get the recurrent information on a eventvoidcontextualize(Context context)voidexecute(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps)protected List<String>getBodyI18nParams(Project project, User issuer, CalendarEvent event)Get the i18n parameters of mail body textprotected PagegetCalendarModulePage(Project project)Get the module's pageprotected StringgetDefaultLanguage()Get the default language to resolve module's pageprotected StringgetEventUrl(Project project, String calendarId, Date eventStartDate)Get the absolute full url of the eventprotected StringgetProjectUrl(Project project)Get the absolute url of projectprotected List<String>getSubjectI18nParams(Project project, User issuer, CalendarEvent event)Get the i18n parameters of mail subjectprotected List<UserIdentity>getUsersToNotify(AmetysObject object, String[] rightsId)Get the users allowed to be notifiedvoidinitialize()protected voidsendMail(Project project, CalendarEvent event, User issuer, String mailSubjecti18nKey, String mailBodyi18nKey, String[] rightIds)Sent an emailvoidsetPluginInfo(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.plugins.explorer.workflow.AbstractExplorerNodeWorkflowComponentgetExplorerNode
 - 
Methods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponentaddWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser, service
 
- 
 
- 
- 
- 
Field Detail- 
SEND_MAILpublic static final String SEND_MAIL Provide "false" to prevent the function sending the mail. Useful when making large automatic workflow operations (for instance, when bulk importing and proposing in one action).- See Also:
- Constant Field Values
 
 - 
SUBJECT_KEYprotected static final String SUBJECT_KEY The mail subject key.- See Also:
- Constant Field Values
 
 - 
RIGHTSprotected static final String RIGHTS The mail subject key.- See Also:
- Constant Field Values
 
 - 
BODY_KEYprotected static final String BODY_KEY The mail body key.- See Also:
- Constant Field Values
 
 - 
_rightManagerprotected RightManager _rightManager The right manager.
 - 
_userManagerprotected UserManager _userManager The users manager.
 - 
_workflowProviderprotected WorkflowProvider _workflowProvider The workflow provider
 - 
_pluginNameprotected String _pluginName The plugin name.
 - 
_i18nUtilsprotected I18nUtils _i18nUtils I18nUtils
 - 
_resolverprotected AmetysObjectResolver _resolver The ametys resolver
 - 
_projectManagerprotected ProjectManager _projectManager The project resolver
 - 
_renderingContextHandlerprotected RenderingContextHandler _renderingContextHandler The rendering context handler
 
- 
 - 
Constructor Detail- 
SendCalendarNotificationFunctionpublic SendCalendarNotificationFunction() 
 
- 
 - 
Method Detail- 
initializepublic void initialize() throws Exception - Specified by:
- initializein interface- Initializable
- Throws:
- Exception
 
 - 
setPluginInfopublic void setPluginInfo(String pluginName, String featureName, String id) Description copied from interface:PluginAwareSets 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:
- setPluginInfoin interface- PluginAware
- Parameters:
- pluginName- Unique identifier for the plugin hosting the extension
- featureName- Unique feature identifier (unique for a given pluginName)
- id- Unique identifier of this component
 
 - 
contextualizepublic void contextualize(Context context) throws ContextException - Specified by:
- contextualizein interface- Contextualizable
- Throws:
- ContextException
 
 - 
executepublic void execute(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps) throws com.opensymphony.workflow.WorkflowException - Specified by:
- executein interface- com.opensymphony.workflow.FunctionProvider
- Throws:
- com.opensymphony.workflow.WorkflowException
 
 - 
sendMailprotected void sendMail(Project project, CalendarEvent event, User issuer, String mailSubjecti18nKey, String mailBodyi18nKey, String[] rightIds) Sent an email- Parameters:
- project- The project
- event- The calendar event
- issuer- The issuer
- mailSubjecti18nKey- The i18n key for subject
- mailBodyi18nKey- The i18n key for body
- rightIds- The rights to check
 
 - 
getUsersToNotifyprotected List<UserIdentity> getUsersToNotify(AmetysObject object, String[] rightsId) Get the users allowed to be notified- Parameters:
- object- The object responsible of the notification
- rightsId- The id of rights to check
- Returns:
- The allowed users
 
 - 
getSubjectI18nParamsprotected List<String> getSubjectI18nParams(Project project, User issuer, CalendarEvent event) Get the i18n parameters of mail subject- Parameters:
- project- the the project
- issuer- the issuer
- event- the event
- Returns:
- the i18n parameters
 
 - 
getBodyI18nParamsprotected List<String> getBodyI18nParams(Project project, User issuer, CalendarEvent event) Get the i18n parameters of mail body text- Parameters:
- project- The project
- issuer- the issuer
- event- the event
- Returns:
- the i18n parameters
 
 - 
_getRecurrentDateInfoprotected String _getRecurrentDateInfo(CalendarEvent event, DateFormat dayFormat) Get the recurrent information on a event- Parameters:
- event- the event
- dayFormat- the date format for day
- Returns:
- the recurrent information or empty if the event is not recurrent
 
 - 
getEventUrlprotected String getEventUrl(Project project, String calendarId, Date eventStartDate) Get the absolute full url of the event- Parameters:
- project- The project
- calendarId- The id of parent calendar
- eventStartDate- The start date of the event
- Returns:
- The full uri
 
 - 
getProjectUrlprotected String getProjectUrl(Project project) Get the absolute url of project- Parameters:
- project- The project
- Returns:
- the project's url
 
 - 
getDefaultLanguageprotected String getDefaultLanguage() Get the default language to resolve module's page- Returns:
- The default language
 
 - 
getCalendarModulePageprotected Page getCalendarModulePage(Project project) Get the module's page- Parameters:
- project- The project
- Returns:
- The page or nullif not found
 
 
- 
 
-