public abstract class AbstractPageSubscriptionObserver extends AbstractLogEnabled implements Observer, Serviceable
Modifier and Type | Field and Description |
---|---|
protected I18nUtils |
_i18nUtils
The i18n utils
|
protected AmetysObjectResolver |
_resolver
The Ametys object resolver
|
protected UserManager |
_userManager
The user manager
|
static String |
SUBSCRIBERS_PROPERTY_NAME
Constant for the attachment node name.
|
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description |
---|
AbstractPageSubscriptionObserver() |
Modifier and Type | Method and Description |
---|---|
protected String |
_getAbsolutePageUrl(Page page)
Get the absolute URL of a page
|
protected abstract String |
_getMailBody(Event event,
Page page)
Create the mail body depend on the event
|
protected abstract String |
_getMailSubject(Event event,
Page page)
Create the mail subject depend on the event
|
protected abstract Collection<Page> |
_getPages(Event event)
Get the pages linked to the event
|
protected Set<String> |
_getSubscribers(JCRAmetysObject page)
Get the page's subscribers
|
int |
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 |
getSiteParameterId()
Id of the site parameter to enable/disable the notification
|
protected boolean |
isNotificationEnabled(Page page)
Determines if the notification is currently enabled
|
void |
observe(Event event,
Map<String,Object> transientVars)
Observes an event.
|
void |
service(ServiceManager smanager) |
getLogger, setLogger
public static final String SUBSCRIBERS_PROPERTY_NAME
protected UserManager _userManager
protected AmetysObjectResolver _resolver
protected I18nUtils _i18nUtils
public AbstractPageSubscriptionObserver()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
ServiceException
public int getPriority(Event event)
Observer
getPriority
in interface Observer
event
- the event.public void observe(Event event, Map<String,Object> transientVars)
Observer
protected boolean isNotificationEnabled(Page page)
page
- The pageprotected abstract String getSiteParameterId()
protected Set<String> _getSubscribers(JCRAmetysObject page)
page
- the pageprotected String _getAbsolutePageUrl(Page page)
page
- The page to retrieve the urlprotected abstract String _getMailSubject(Event event, Page page)
event
- the eventpage
- the pageprotected abstract String _getMailBody(Event event, Page page)
event
- the eventpage
- the pageprotected abstract Collection<Page> _getPages(Event event)
event
- the event