org.apache.shale.examples.mailreader
Class Registration

java.lang.Object
  extended by org.apache.shale.view.AbstractFacesBean
      extended by org.apache.shale.view.AbstractViewController
          extended by org.apache.shale.examples.mailreader.BaseViewController
              extended by org.apache.shale.examples.mailreader.Registration
All Implemented Interfaces:
org.apache.shale.view.ViewController

public class Registration
extends BaseViewController

ViewController for the registration page.


Constructor Summary
Registration()
           
 
Method Summary
 String cancel()
          Return to the appropriate page depending on the current mode.
 String create()
          Create a new subscription.
 String delete()
          Delete an existing subscription.
 void destroy()
          Release our reference to to the retrieved subscriptions (if any).
 String edit()
          Edit an existing subscription.
 String getFromAddress()
           
 String getFullName()
           
 String getPassword()
           
 String getPassword2()
           
 String getReplyToAddress()
           
 org.apache.struts.apps.mailreader.dao.Subscription[] getSubscriptions()
           
 String getUsername()
           
 void preprocess()
          If this is a postback, and we are in EDIT mode, retrieve the subscriptions for the currently logged on user.
 void prerender()
          If this is not a postback, and we are in EDIT mode, prepopulate the field values for the user registration update form and retrieve the subscriptions for the currently logged in user.
 String save()
          Create or update the user information.
 void setFromAddress(String fromAddress)
           
 void setFullName(String fullName)
           
 void setPassword(String password)
           
 void setPassword2(String password2)
           
 void setReplyToAddress(String replyToAddress)
           
 void setSubscriptions(org.apache.struts.apps.mailreader.dao.Subscription[] subscriptions)
           
 void setUsername(String username)
           
 
Methods inherited from class org.apache.shale.examples.mailreader.BaseViewController
getState, getUserDatabase
 
Methods inherited from class org.apache.shale.view.AbstractViewController
init, isPostBack, setPostBack
 
Methods inherited from class org.apache.shale.view.AbstractFacesBean
erase, error, error, fatal, fatal, getApplication, getApplicationMap, getBean, getExternalContext, getFacesContext, getLifecycle, getRequestHeaderMap, getRequestMap, getRequestParameter, getRequestParameterMap, getRequestParameterValues, getSessionMap, getValue, info, info, log, log, retrieveData, saveData, setBean, setValue, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Registration

public Registration()
Method Detail

getFromAddress

public String getFromAddress()
Returns:
Returns the fromAddress.

setFromAddress

public void setFromAddress(String fromAddress)
Parameters:
fromAddress - The fromAddress to set.

getFullName

public String getFullName()
Returns:
Returns the fullName.

setFullName

public void setFullName(String fullName)
Parameters:
fullName - The fullName to set.

getPassword

public String getPassword()
Returns:
Returns the password.

setPassword

public void setPassword(String password)
Parameters:
password - The password to set.

getPassword2

public String getPassword2()
Returns:
Returns the password2.

setPassword2

public void setPassword2(String password2)
Parameters:
password2 - The password2 to set.

getReplyToAddress

public String getReplyToAddress()
Returns:
Returns the replyToAddress.

setReplyToAddress

public void setReplyToAddress(String replyToAddress)
Parameters:
replyToAddress - The replyToAddress to set.

getSubscriptions

public org.apache.struts.apps.mailreader.dao.Subscription[] getSubscriptions()
Returns:
Returns the subscriptions.

setSubscriptions

public void setSubscriptions(org.apache.struts.apps.mailreader.dao.Subscription[] subscriptions)
Parameters:
subscriptions - The subscriptions to set.

getUsername

public String getUsername()
Returns:
Returns the username.

setUsername

public void setUsername(String username)
Parameters:
username - The username to set.

cancel

public String cancel()

Return to the appropriate page depending on the current mode.


create

public String create()

Create a new subscription.


delete

public String delete()

Delete an existing subscription.


edit

public String edit()

Edit an existing subscription.


save

public String save()
            throws org.apache.struts.apps.mailreader.dao.ExpiredPasswordException

Create or update the user information.

Throws:
org.apache.struts.apps.mailreader.dao.ExpiredPasswordException

preprocess

public void preprocess()

If this is a postback, and we are in EDIT mode, retrieve the subscriptions for the currently logged on user. This is required in case the user clicked one of the Delete or Edit buttons in the table, so that the correct row can be positioned to before calling the event handler.

Specified by:
preprocess in interface org.apache.shale.view.ViewController
Overrides:
preprocess in class org.apache.shale.view.AbstractViewController

prerender

public void prerender()

If this is not a postback, and we are in EDIT mode, prepopulate the field values for the user registration update form and retrieve the subscriptions for the currently logged in user. (If this is a postback, we will have done this already in init().)

Specified by:
prerender in interface org.apache.shale.view.ViewController
Overrides:
prerender in class org.apache.shale.view.AbstractViewController

destroy

public void destroy()

Release our reference to to the retrieved subscriptions (if any). If we were using a real database, this is where closing the result set would go.

Specified by:
destroy in interface org.apache.shale.view.ViewController
Overrides:
destroy in class org.apache.shale.view.AbstractViewController


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.