fr.paris.lutece.plugins.calendar.service
Class AgendaSubscriberService

java.lang.Object
  extended by fr.paris.lutece.plugins.calendar.service.AgendaSubscriberService

public final class AgendaSubscriberService
extends Object

The class responsible for the subscription and unsubscription process


Field Summary
static String JSP_URL_DO_UNSUBSCRIBE
           
 
Method Summary
 void doNotificationSubscription(AgendaResource agenda, javax.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Notify the subscription
 void doSendMail(String strRecipientTo, String strSenderName, String strSenderEmail, String strSubject, String strMessage)
          Send the mail
 void doSubscription(javax.servlet.http.HttpServletRequest request)
          Performs the subscription process Throw a SiteMessage
 void doUnSubscribe(javax.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Performs unsubscription process Throw a SiteMessage
 void doValidationSubscription(javax.servlet.http.HttpServletRequest request)
          Validate subscription
static AgendaSubscriberService getInstance()
          Fetches the singleton instance
 int getSubscriberNumber(int nCalendarId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the number of subscribers of a calendar
 Collection<CalendarSubscriber> getSubscribers(int nCalendarId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of subscribers of a calendar
 String sendFriendMail(javax.servlet.http.HttpServletRequest request)
          Send the calendar to a friend
 void sendSubscriberMail(javax.servlet.http.HttpServletRequest request, Collection<CalendarSubscriber> listSubscribers, Event event, int nCalendarId)
          Send an event to a list of subscribers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JSP_URL_DO_UNSUBSCRIBE

public static final String JSP_URL_DO_UNSUBSCRIBE
See Also:
Constant Field Values
Method Detail

getInstance

public static AgendaSubscriberService getInstance()
Fetches the singleton instance

Returns:
The singleton instance

doSubscription

public void doSubscription(javax.servlet.http.HttpServletRequest request)
                    throws fr.paris.lutece.portal.service.message.SiteMessageException
Performs the subscription process Throw a SiteMessage

Parameters:
request - The Http request
Throws:
fr.paris.lutece.portal.service.message.SiteMessageException - The error message thrown to the user

doUnSubscribe

public void doUnSubscribe(javax.servlet.http.HttpServletRequest request,
                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
                   throws fr.paris.lutece.portal.service.message.SiteMessageException
Performs unsubscription process Throw a SiteMessage

Parameters:
request - The http request
plugin - The plugin
Throws:
fr.paris.lutece.portal.service.message.SiteMessageException - The error message handled by the front office

doSendMail

public void doSendMail(String strRecipientTo,
                       String strSenderName,
                       String strSenderEmail,
                       String strSubject,
                       String strMessage)
Send the mail

Parameters:
strRecipientTo - Subscriber email
strSenderName - The sender name.
strSenderEmail - The sender email address.
strSubject - The message subject.
strMessage - The message.

sendSubscriberMail

public void sendSubscriberMail(javax.servlet.http.HttpServletRequest request,
                               Collection<CalendarSubscriber> listSubscribers,
                               Event event,
                               int nCalendarId)
Send an event to a list of subscribers

Parameters:
request - the http request
listSubscribers - a Collection
event - the event
nCalendarId - The id of the calendar

sendFriendMail

public String sendFriendMail(javax.servlet.http.HttpServletRequest request)
                      throws fr.paris.lutece.portal.service.message.SiteMessageException
Send the calendar to a friend

Parameters:
request - the http request
Returns:
The next URL to redirect to
Throws:
fr.paris.lutece.portal.service.message.SiteMessageException - To display an error

doNotificationSubscription

public void doNotificationSubscription(AgendaResource agenda,
                                       javax.servlet.http.HttpServletRequest request,
                                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
                                throws fr.paris.lutece.portal.service.message.SiteMessageException
Notify the subscription

Parameters:
agenda - The agenda
request - HttpServletRequest
plugin - The plugin
Throws:
fr.paris.lutece.portal.service.message.SiteMessageException - site message exception

doValidationSubscription

public void doValidationSubscription(javax.servlet.http.HttpServletRequest request)
                              throws fr.paris.lutece.portal.service.message.SiteMessageException
Validate subscription

Parameters:
request - HttpServletRequest
Throws:
fr.paris.lutece.portal.service.message.SiteMessageException - site message exception

getSubscriberNumber

public int getSubscriberNumber(int nCalendarId,
                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the number of subscribers of a calendar

Parameters:
nCalendarId - The id of the calendar to get the number of subscribers of
plugin - The plugin
Returns:
The number of subscribers of the calendar

getSubscribers

public Collection<CalendarSubscriber> getSubscribers(int nCalendarId,
                                                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of subscribers of a calendar

Parameters:
nCalendarId - The id of the calendar to get the list of subscribers of
plugin - The plugin
Returns:
The list of subscribers of the calendar


Copyright © 2014 Mairie de Paris. All Rights Reserved.