com.primix.vlib.pages
Class Login

java.lang.Object
  |
  +--com.primix.tapestry.AbstractComponent
        |
        +--com.primix.tapestry.BaseComponent
              |
              +--com.primix.tapestry.AbstractPage
                    |
                    +--com.primix.tapestry.BasePage
                          |
                          +--com.primix.vlib.pages.Login
All Implemented Interfaces:
IComponent, IErrorProperty, IPage, IRender

public class Login
extends BasePage
implements IErrorProperty

Allows the user to login, by providing email address and password. After succesfully logging in, a cookie is placed on the client browser that provides the default email address for future logins (the cookie persists for a week).

Version:
$Id: Login.java,v 1.20 2001/08/27 22:19:12 hship Exp $
Author:
Howard Ship

Fields inherited from class com.primix.tapestry.AbstractPage
engine, name
 
Fields inherited from class com.primix.tapestry.BaseComponent
outer, OUTER_INIT_SIZE, outerCount
 
Fields inherited from class com.primix.tapestry.AbstractComponent
id, page, specification, wrapped, wrappedCount
 
Constructor Summary
Login()
           
 
Method Summary
 void attemptLogin(IRequestCycle cycle)
          Attempts to login.
 void detach()
          Prepares the page to be returned to the pool.
 ICallback getCallback()
           
 java.lang.String getEmail()
          Gets the email address.
 java.lang.String getError()
           
 java.lang.String getPassword()
           
 IValidationDelegate getValidationDelegate()
           
 void loginUser(Person person, IRequestCycle cycle)
          Sets up the IPerson as the logged in user, creates a cookie for thier email address (for subsequent logins), and redirects to the appropriate page (MyLibrary, or a specified page).
 void setCallback(ICallback value)
           
 void setEmail(java.lang.String value)
           
 void setError(java.lang.String value)
           
protected  void setErrorField(java.lang.String componentId, java.lang.String message)
           
 void setPassword(java.lang.String value)
           
 
Methods inherited from class com.primix.tapestry.BasePage
getResponseWriter
 
Methods inherited from class com.primix.tapestry.AbstractPage
addPageCleanupListener, addPageDetachListener, addPageRenderListener, attach, beginResponse, cleanupPage, firePageBeginRender, firePageCleanup, firePageDetached, firePageEndRender, getChangeObserver, getEngine, getExtendedId, getIdPath, getLocale, getName, getNestedComponent, getPage, getRequestCycle, getVisit, renderPage, setChangeObserver, setLocale, setName, setRequestCycle, validate
 
Methods inherited from class com.primix.tapestry.BaseComponent
addOuter, finishLoad, readTemplate, render
 
Methods inherited from class com.primix.tapestry.AbstractComponent
addAsset, addComponent, addWrapped, cleanupAfterRender, cleanupComponent, finishLoad, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, generateAttributes, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getId, getListeners, getSpecification, prepareForRender, renderWrapped, reset, setBinding, setContainer, setId, setPage, setSpecification, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.primix.tapestry.IComponent
addAsset, addComponent, addWrapped, finishLoad, getAsset, getAssets, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getId, getSpecification, renderWrapped, setBinding, setContainer, setId, setPage, setSpecification
 
Methods inherited from interface com.primix.tapestry.IRender
render
 

Constructor Detail

Login

public Login()
Method Detail

detach

public void detach()
Description copied from class: AbstractPage
Prepares the page to be returned to the pool.

Subclasses may override this method, but must invoke this implementation (usually, last).

Overrides:
detach in class AbstractPage
Following copied from interface: com.primix.tapestry.IPage
See Also:
IPageSource.releasePage(IPage)

getValidationDelegate

public IValidationDelegate getValidationDelegate()

setEmail

public void setEmail(java.lang.String value)

getEmail

public java.lang.String getEmail()
Gets the email address. If not previously set, it is retrieve from the cookie (thus forming the default).

setPassword

public void setPassword(java.lang.String value)

getPassword

public java.lang.String getPassword()

setError

public void setError(java.lang.String value)
Specified by:
setError in interface IErrorProperty

getError

public java.lang.String getError()
Specified by:
getError in interface IErrorProperty

setErrorField

protected void setErrorField(java.lang.String componentId,
                             java.lang.String message)

setCallback

public void setCallback(ICallback value)

getCallback

public ICallback getCallback()

attemptLogin

public void attemptLogin(IRequestCycle cycle)
                  throws RequestCycleException
Attempts to login. If successful, updates the application's user property and redirects to the target page (or the home page if no target page is specified).

Clears the target page property.

If the user name is not known, or the password is invalid, then an error message is displayed.


loginUser

public void loginUser(Person person,
                      IRequestCycle cycle)
               throws RequestCycleException,
                      java.rmi.RemoteException
Sets up the IPerson as the logged in user, creates a cookie for thier email address (for subsequent logins), and redirects to the appropriate page (MyLibrary, or a specified page).