Class AbstractPageSubscriptionObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.pagesubscription.observer.AbstractPageSubscriptionObserver
- All Implemented Interfaces:
Observer
,LogEnabled
,Serviceable
- Direct Known Subclasses:
PageSubscriptionDeletePageObserver
,PageSubscriptionExplorerObserver
,PageSubscriptionValidateContentObserver
public abstract class AbstractPageSubscriptionObserver
extends AbstractLogEnabled
implements Observer, Serviceable
Abstract implementation of the observers of Page Subscription.
-
Field Summary
Modifier and TypeFieldDescriptionprotected I18nUtils
The i18n utilsprotected AmetysObjectResolver
The Ametys object resolverprotected PageSubscriptionDAO
The subscription daoprotected UserManager
The user managerFields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
_getAbsolutePageUrl
(Page page) Get the absolute URL of a pageprotected abstract String
_getMailBody
(Event event, Page page) Create the mail body depend on the eventprotected abstract String
_getMailSubject
(Event event, Page page) Create the mail subject depend on the eventprotected abstract Collection<Page>
Get the pages linked to the eventint
getPriority
(Event event) Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.protected abstract String
Id of the site parameter to enable/disable the notificationprotected boolean
isNotificationEnabled
(Page page) Determines if the notification is currently enabledvoid
Observes an event.void
service
(ServiceManager smanager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_userManager
The user manager -
_resolver
The Ametys object resolver -
_i18nUtils
The i18n utils -
_subscriptionDAO
The subscription dao
-
-
Constructor Details
-
AbstractPageSubscriptionObserver
public AbstractPageSubscriptionObserver()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getPriority
Description copied from interface:Observer
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.- Specified by:
getPriority
in interfaceObserver
- Parameters:
event
- the event.- Returns:
- the priority where 0 the max priority and Integer.MAX_VALUE the min priority.
-
observe
Description copied from interface:Observer
Observes an event. -
isNotificationEnabled
Determines if the notification is currently enabled- Parameters:
page
- The page- Returns:
- true if the notification is enabled
-
getSiteParameterId
Id of the site parameter to enable/disable the notification- Returns:
- The id of site
-
_getAbsolutePageUrl
Get the absolute URL of a page- Parameters:
page
- The page to retrieve the url- Returns:
- The absolute url of the page
-
_getMailSubject
Create the mail subject depend on the event- Parameters:
event
- the eventpage
- the page- Returns:
- the mail subject
-
_getMailBody
Create the mail body depend on the event- Parameters:
event
- the eventpage
- the page- Returns:
- the mail body
-
_getPages
Get the pages linked to the event- Parameters:
event
- the event- Returns:
- the pages linked to the event
-