public class SendCalendarNotificationFunction extends AbstractExplorerNodeWorkflowComponent implements com.opensymphony.workflow.FunctionProvider, Initializable, PluginAware, Contextualizable
| Modifier and Type | Field and Description |
|---|---|
protected Context |
_context
Context available to subclasses.
|
protected I18nUtils |
_i18nUtils
I18nUtils
|
protected String |
_pluginName
The plugin name.
|
protected ProjectManager |
_projectManager
The project resolver
|
protected RenderingContextHandler |
_renderingContextHandler
The rendering context handler
|
protected AmetysObjectResolver |
_resolver
The ametys resolver
|
protected RightManager |
_rightManager
The right manager.
|
protected UserManager |
_userManager
The users manager.
|
protected WorkflowProvider |
_workflowProvider
The workflow provider
|
protected static String |
BODY_KEY
The mail body key.
|
protected static String |
RIGHTS
The mail subject key.
|
static String |
SEND_MAIL
Provide "false" to prevent the function sending the mail.
|
protected static String |
SUBJECT_KEY
The mail subject key.
|
EXPLORERNODE_KEY_logger, _manager, CONTEXT_PARAMETERS_KEY, FAIL_CONDITIONS_KEY, RESULT_MAP_KEY, WORKFLOW_ERRORS_KEY, WORKFLOW_WARNS_KEY| Constructor and Description |
|---|
SendCalendarNotificationFunction() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
_getRecurrentDateInfo(CalendarEvent event,
DateFormat dayFormat)
Get the recurrent information on a event
|
void |
contextualize(Context context) |
void |
execute(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 text
|
protected Page |
getCalendarModulePage(Project project)
Get the module's page
|
protected String |
getDefaultLanguage()
Get the default language to resolve module's page
|
protected String |
getEventUrl(Project project,
String calendarId,
Date eventStartDate)
Get the absolute full url of the event
|
protected String |
getProjectUrl(Project project)
Get the absolute url of project
|
protected List<String> |
getSubjectI18nParams(Project project,
User issuer,
CalendarEvent event)
Get the i18n parameters of mail subject
|
protected List<UserIdentity> |
getUsersToNotify(AmetysObject object,
String[] rightsId)
Get the users allowed to be notified
|
void |
initialize() |
protected void |
sendMail(Project project,
CalendarEvent event,
User issuer,
String mailSubjecti18nKey,
String mailBodyi18nKey,
String[] rightIds)
Sent an email
|
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. |
getExplorerNodeaddWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser, servicepublic static final String SEND_MAIL
protected static final String SUBJECT_KEY
protected static final String RIGHTS
protected static final String BODY_KEY
protected RightManager _rightManager
protected UserManager _userManager
protected WorkflowProvider _workflowProvider
protected String _pluginName
protected I18nUtils _i18nUtils
protected AmetysObjectResolver _resolver
protected ProjectManager _projectManager
protected RenderingContextHandler _renderingContextHandler
public SendCalendarNotificationFunction()
public void initialize() throws Exception
initialize in interface InitializableExceptionpublic void setPluginInfo(String pluginName, String featureName, String id)
PluginAwaresetPluginInfo in interface PluginAwarepluginName - Unique identifier for the plugin hosting the extensionfeatureName - Unique feature identifier (unique for a given pluginName)id - Unique identifier of this componentpublic void contextualize(Context context) throws ContextException
contextualize in interface ContextualizableContextExceptionpublic void execute(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps) throws com.opensymphony.workflow.WorkflowException
execute in interface com.opensymphony.workflow.FunctionProvidercom.opensymphony.workflow.WorkflowExceptionprotected void sendMail(Project project, CalendarEvent event, User issuer, String mailSubjecti18nKey, String mailBodyi18nKey, String[] rightIds)
project - The projectevent - The calendar eventissuer - The issuermailSubjecti18nKey - The i18n key for subjectmailBodyi18nKey - The i18n key for bodyrightIds - The rights to checkprotected List<UserIdentity> getUsersToNotify(AmetysObject object, String[] rightsId)
object - The object responsible of the notificationrightsId - The id of rights to checkprotected List<String> getSubjectI18nParams(Project project, User issuer, CalendarEvent event)
project - the the projectissuer - the issuerevent - the eventprotected List<String> getBodyI18nParams(Project project, User issuer, CalendarEvent event)
project - The projectissuer - the issuerevent - the eventprotected String _getRecurrentDateInfo(CalendarEvent event, DateFormat dayFormat)
event - the eventdayFormat - the date format for dayprotected String getEventUrl(Project project, String calendarId, Date eventStartDate)
project - The projectcalendarId - The id of parent calendareventStartDate - The start date of the eventprotected String getProjectUrl(Project project)
project - The projectprotected String getDefaultLanguage()
protected Page getCalendarModulePage(Project project)
project - The projectnull if not found