Class AbstractMemberMailNotifierObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.project.notification.AbstractMemberMailNotifierObserver
- All Implemented Interfaces:
AsyncObserver,Observer,LogEnabled,PluginAware,Prioritizable,Supporter<Event>,Contextualizable,Serviceable
- Direct Known Subclasses:
RemoveMemberMailManagersNotifierObserver,RemoveMemberMailNotifierObserver,WelcomeMemberMailNotifierObserver
public abstract class AbstractMemberMailNotifierObserver
extends AbstractLogEnabled
implements AsyncObserver, PluginAware, Serviceable, Contextualizable
Abstract observer for sending mail to members
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContextThe avalon contextprotected GroupManagerGroup managerprotected I18nUtilsThe i18n utilsprotected StringThe name of current pluginprotected PopulationContextHelperPopulation context helperprotected ProjectManagerProject managerprotected ProjectMemberManagerThe project member managerprotected RenderingContextHandlerThe rendering contextprotected AmetysObjectResolverThe Ametys Object resolverprotected SiteManagerSite managerprotected SourceResolverSource Resolverprotected UserLanguagesManagerThe user languages managerprotected UserManagerUser managerprotected WorkspacesHelperThe workspaces helperFields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextualize(Context context) protected abstract I18nizableTextgetI18nSubject(Event event, Project project) Get theI18nizableTextfor mail subjectprotected StringgetMailBodyURI(Event event, Project project) Returns the URI for HTML mail bodyintGet the priority for the component.getUserToNotifyByLanguage(Event event, Project project) Get recipients' emails sorted by languagevoidObserves an event.voidservice(ServiceManager manager) voidsetPluginInfo(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, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.core.observation.AsyncObserver
parallelizable
-
Field Details
-
_context
The avalon context -
_pluginName
The name of current plugin -
_resolver
The Ametys Object resolver -
_i18nUtils
The i18n utils -
_projectMemberManager
The project member manager -
_projectManager
Project manager -
_siteManager
Site manager -
_populationContextHelper
Population context helper -
_srcResolver
Source Resolver -
_userManager
User manager -
_groupManager
Group manager -
_renderingContextHandler
The rendering context -
_userLanguagesManager
The user languages manager -
_workspacesHelper
The workspaces helper
-
-
Constructor Details
-
AbstractMemberMailNotifierObserver
public AbstractMemberMailNotifierObserver()
-
-
Method Details
-
setPluginInfo
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 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:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
getPriority
Description copied from interface:PrioritizableGet the priority for the component. On components usingPrioritizableinterface, each implementation define the order. In most cases, less is the number, more prior is the component.- Specified by:
getPriorityin interfacePrioritizable- Returns:
- the priority
-
observe
Description copied from interface:ObserverObserves an event.- Specified by:
observein interfaceObserver- Parameters:
event- the event.transientVars- transientVars passed from one Observer to another when processing a single Event. This may allow optimizations between observers.- Throws:
Exception- if an error occurs. All exceptions will be logged but not propagated, as the observation mechanism should never fail.
-
getUserToNotifyByLanguage
Get recipients' emails sorted by language- Parameters:
event- the eventproject- the project- Returns:
- the recipients' emails sorted by language
-
getMailBodyURI
Returns the URI for HTML mail body- Parameters:
event- the eventproject- the project- Returns:
- The URI for HTML mail body
-
getI18nSubject
Get theI18nizableTextfor mail subject- Parameters:
event- the eventproject- the project- Returns:
- the
I18nizableTextfor subject
-