org.sakaiproject.announcement.impl
Class SiteEmailNotificationAnnc

java.lang.Object
  extended by org.sakaiproject.util.EmailNotification
      extended by org.sakaiproject.util.SiteEmailNotification
          extended by org.sakaiproject.announcement.impl.SiteEmailNotificationAnnc
All Implemented Interfaces:
org.sakaiproject.api.app.scheduler.ScheduledInvocationCommand, org.sakaiproject.event.api.NotificationAction

public class SiteEmailNotificationAnnc
extends org.sakaiproject.util.SiteEmailNotification
implements org.sakaiproject.api.app.scheduler.ScheduledInvocationCommand

SiteEmailNotificationAnnc fills the notification message and headers with details from the announcement message that triggered the notification event.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.sakaiproject.util.EmailNotification
org.sakaiproject.util.EmailNotification.RunSendToUsers
 
Field Summary
 
Fields inherited from class org.sakaiproject.util.EmailNotification
m_siteId
 
Constructor Summary
SiteEmailNotificationAnnc()
          Construct.
SiteEmailNotificationAnnc(String siteId)
          Construct.
 
Method Summary
protected  void addSpecialRecipients(List users, org.sakaiproject.entity.api.Reference ref)
          Add to the user list any other users who should be notified about this ref's change.
protected  void disableSecurityAdvisor()
          remove recent add SecurityAdvisor from stack
protected  void enableSecurityAdvisorToGetAnnouncement()
          Establish a security advisor to allow the "embedded" azg work to occur with no need for additional security permissions.
 void execute(String opaqueContext)
          Implementation of command pattern.
protected  String getFromAddress(org.sakaiproject.event.api.Event event)
          Format the announcement notification from address.
protected  List getHeaders(org.sakaiproject.event.api.Event event)
           
protected  String getResourceAbility()
           
protected  String getSubject(org.sakaiproject.event.api.Event event)
          Format the announcement notification subject line.
protected  String getTag(String title, boolean shouldUseHtml)
           
protected  String htmlContent(org.sakaiproject.event.api.Event event)
           
protected  org.sakaiproject.util.EmailNotification makeEmailNotification()
           
 void notify(org.sakaiproject.event.api.Notification notification, org.sakaiproject.event.api.Event event)
           
protected  String plainTextContent(org.sakaiproject.event.api.Event event)
           
 void setScheduledInvocationManager(org.sakaiproject.api.app.scheduler.ScheduledInvocationManager service)
          Inject ScheudledInvocationManager
 
Methods inherited from class org.sakaiproject.util.SiteEmailNotification
getClone, getRecipients, getTo, getToSite, getToSiteNoReply, refineToSiteMembers
 
Methods inherited from class org.sakaiproject.util.EmailNotification
digestRecipients, digestRecipients, findHeader, findHeaderValue, getFrom, getFromEventUser, getFromService, getMessage, getOption, getOption, getSite, htmlEnd, htmlHeaders, htmlPreamble, immediateRecipients, immediateRecipients, isImmediateDeliveryOption, isImmediateDeliveryOption, plainTextHeaders, reNotify, set, set, toXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiteEmailNotificationAnnc

public SiteEmailNotificationAnnc()
Construct.


SiteEmailNotificationAnnc

public SiteEmailNotificationAnnc(String siteId)
Construct.

Method Detail

setScheduledInvocationManager

public void setScheduledInvocationManager(org.sakaiproject.api.app.scheduler.ScheduledInvocationManager service)
Inject ScheudledInvocationManager


getResourceAbility

protected String getResourceAbility()
Overrides:
getResourceAbility in class org.sakaiproject.util.SiteEmailNotification

notify

public void notify(org.sakaiproject.event.api.Notification notification,
                   org.sakaiproject.event.api.Event event)
Specified by:
notify in interface org.sakaiproject.event.api.NotificationAction
Overrides:
notify in class org.sakaiproject.util.EmailNotification

htmlContent

protected String htmlContent(org.sakaiproject.event.api.Event event)
Overrides:
htmlContent in class org.sakaiproject.util.EmailNotification

getHeaders

protected List getHeaders(org.sakaiproject.event.api.Event event)
Overrides:
getHeaders in class org.sakaiproject.util.EmailNotification

getTag

protected String getTag(String title,
                        boolean shouldUseHtml)
Overrides:
getTag in class org.sakaiproject.util.EmailNotification

getSubject

protected String getSubject(org.sakaiproject.event.api.Event event)
Format the announcement notification subject line.

Overrides:
getSubject in class org.sakaiproject.util.EmailNotification
Parameters:
event - The event that matched criteria to cause the notification.
Returns:
the announcement notification subject line.

getFromAddress

protected String getFromAddress(org.sakaiproject.event.api.Event event)
Format the announcement notification from address.

Parameters:
event - The event that matched criteria to cause the notification.
Returns:
the announcement notification from address.

addSpecialRecipients

protected void addSpecialRecipients(List users,
                                    org.sakaiproject.entity.api.Reference ref)
Add to the user list any other users who should be notified about this ref's change.

Overrides:
addSpecialRecipients in class org.sakaiproject.util.SiteEmailNotification
Parameters:
users - The user list, already populated based on site visit and resource ability.
ref - The entity reference.

execute

public void execute(String opaqueContext)
Implementation of command pattern. Will be called by ScheduledInvocationManager for delayed announcement notifications

Specified by:
execute in interface org.sakaiproject.api.app.scheduler.ScheduledInvocationCommand
Parameters:
opaqueContext - reference (context) for message

enableSecurityAdvisorToGetAnnouncement

protected void enableSecurityAdvisorToGetAnnouncement()
Establish a security advisor to allow the "embedded" azg work to occur with no need for additional security permissions.


disableSecurityAdvisor

protected void disableSecurityAdvisor()
remove recent add SecurityAdvisor from stack


makeEmailNotification

protected org.sakaiproject.util.EmailNotification makeEmailNotification()
Overrides:
makeEmailNotification in class org.sakaiproject.util.EmailNotification

plainTextContent

protected String plainTextContent(org.sakaiproject.event.api.Event event)
Overrides:
plainTextContent in class org.sakaiproject.util.EmailNotification


Copyright © 2003-2012 University of Michigan. All Rights Reserved.