Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.RuntimeCollective.publication.action
Class SwitchSubscriptionStatusAction  view SwitchSubscriptionStatusAction download SwitchSubscriptionStatusAction.java

java.lang.Object
  extended byBaseAction
      extended bycom.RuntimeCollective.webapps.action.BaseForwardAction
          extended bycom.RuntimeCollective.webapps.action.BaseUserAction
              extended bycom.RuntimeCollective.permission.action.PermissibleAction
                  extended bycom.RuntimeCollective.permission.action.AuthenticatedAction
                      extended bycom.RuntimeCollective.publication.action.SwitchSubscriptionStatusAction

public class SwitchSubscriptionStatusAction
extends com.RuntimeCollective.permission.action.AuthenticatedAction

Switch the Subscription status of the User to a given Publication. The id of the Publication is passed as a parameter. The action either deletes or creates the/a Subscription for the Publication. Created Subscriptions start now and have no end date.

Version:
$Id: SwitchSubscriptionStatusAction.java,v 1.4 2003/09/30 15:12:51 joe Exp $

Field Summary
protected static java.lang.String SUBSCRIBING_ACTION
           
protected static java.lang.String SUBSCRIBING_SUBJECT
           
protected static java.lang.String UNSUBSCRIBING_ACTION
           
protected static java.lang.String UNSUBSCRIBING_SUBJECT
           
 
Fields inherited from class com.RuntimeCollective.permission.action.PermissibleAction
DENIED, NOT_AUTH
 
Fields inherited from class com.RuntimeCollective.webapps.action.BaseUserAction
USER_KEY
 
Fields inherited from class com.RuntimeCollective.webapps.action.BaseForwardAction
CANCEL, FAILURE, FAILURE_KEY, INVALID, ITERATE, SUCCESS, SUCCESS_FORWARD, SUCCESS_KEY, SUCCESS_PARAM_MAP, TRANSACTION_TOKEN_KEY
 
Constructor Summary
SwitchSubscriptionStatusAction()
           
 
Method Summary
protected  void checkPermissions(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Override this, actually, to send the user to login if he's not authorised.
 void executeLogic(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  java.lang.String getNotificationEmailBody(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request, com.RuntimeCollective.webapps.bean.User user, com.RuntimeCollective.publication.bean.Publication publication, boolean isSubscribing)
           
protected  java.lang.String getNotificationEmailSubject(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request, com.RuntimeCollective.webapps.bean.User user, com.RuntimeCollective.publication.bean.Publication publication, boolean isSubscribing)
           
protected  void sendNotificationEmail(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request, com.RuntimeCollective.webapps.bean.User user, com.RuntimeCollective.publication.bean.Publication publication, boolean isSubscribing)
          Send a notification email to the user.
protected  void validateRequest(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Saves an appropriate error if the request contains invalid data.
 
Methods inherited from class com.RuntimeCollective.permission.action.PermissibleAction
authorisedPreProcess, preProcess
 
Methods inherited from class com.RuntimeCollective.webapps.action.BaseUserAction
execute, getUser
 
Methods inherited from class com.RuntimeCollective.webapps.action.BaseForwardAction
findFailure, findSuccess, forward, getToken, isTokenValid, iterate, resetToken, saveToken, setFailureForward, setSuccessForward, setSuccessForward, setSuccessForward, setToken, validForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUBSCRIBING_SUBJECT

protected static java.lang.String SUBSCRIBING_SUBJECT

UNSUBSCRIBING_SUBJECT

protected static java.lang.String UNSUBSCRIBING_SUBJECT

SUBSCRIBING_ACTION

protected static java.lang.String SUBSCRIBING_ACTION

UNSUBSCRIBING_ACTION

protected static java.lang.String UNSUBSCRIBING_ACTION
Constructor Detail

SwitchSubscriptionStatusAction

public SwitchSubscriptionStatusAction()
Method Detail

checkPermissions

protected void checkPermissions(org.apache.struts.action.ActionMapping mapping,
                                org.apache.struts.action.ActionForm form,
                                javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
Override this, actually, to send the user to login if he's not authorised. Effectively all we do here is set the original request under


validateRequest

protected void validateRequest(org.apache.struts.action.ActionMapping mapping,
                               org.apache.struts.action.ActionForm form,
                               javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response)
Description copied from class: com.RuntimeCollective.permission.action.PermissibleAction
Saves an appropriate error if the request contains invalid data.


executeLogic

public void executeLogic(org.apache.struts.action.ActionMapping mapping,
                         org.apache.struts.action.ActionForm form,
                         javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response)
                  throws java.sql.SQLException

sendNotificationEmail

protected void sendNotificationEmail(org.apache.struts.action.ActionMapping mapping,
                                     javax.servlet.http.HttpServletRequest request,
                                     com.RuntimeCollective.webapps.bean.User user,
                                     com.RuntimeCollective.publication.bean.Publication publication,
                                     boolean isSubscribing)
                              throws javax.mail.internet.AddressException,
                                     javax.mail.MessagingException,
                                     javax.servlet.ServletException
Send a notification email to the user.


getNotificationEmailSubject

protected java.lang.String getNotificationEmailSubject(org.apache.struts.action.ActionMapping mapping,
                                                       javax.servlet.http.HttpServletRequest request,
                                                       com.RuntimeCollective.webapps.bean.User user,
                                                       com.RuntimeCollective.publication.bean.Publication publication,
                                                       boolean isSubscribing)

getNotificationEmailBody

protected java.lang.String getNotificationEmailBody(org.apache.struts.action.ActionMapping mapping,
                                                    javax.servlet.http.HttpServletRequest request,
                                                    com.RuntimeCollective.webapps.bean.User user,
                                                    com.RuntimeCollective.publication.bean.Publication publication,
                                                    boolean isSubscribing)