com.plumtree.portalpages.browsing.login
Class LoginModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.activityspace.AClearModel
      extended by com.plumtree.portalpages.browsing.login.LoginModel
All Implemented Interfaces:
ILoginModelRO, IManagedObject, IModel, IModelRO, IMVCObject

public class LoginModel
extends AClearModel
implements IModel, ILoginModelRO

This class implements the data handling for login.

Author:
BenG

Nested Class Summary
static class LoginModel.TempData
          This class is used to store the login data on the AClearModel.
 
Field Summary
static java.lang.String AUTH_SOURCE_USER_SEPARATOR
           
protected  Redirect redirectAfterLogin
           
static java.lang.String STR_MVC_CLASS_NAME
           
 
Fields inherited from class com.plumtree.uiinfrastructure.activityspace.AClearModel
m_asOwner
 
Constructor Summary
LoginModel()
           
 
Method Summary
 Redirect attemptLogin(IXPRequest request, IWebData webData)
          This method attempts to log the user into the portal.
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 Redirect DoTasksBeforeLogout(IXPRequest request, IWebData webData)
          This method will make a call to the LoginHelper to process tasks that may be needed before the Logout has occurred.
 int GetAccessStyle()
           
 int GetAllowDefaultAuthSourceMode()
          Get Auth Source Mode
 int GetBrowserTokenExpiration()
          Helper method to get the browser token cookie expiration value from the PTconfig files.
 boolean GetDoAttemptLogin()
           
 boolean GetDoAttemptLogout()
           
 java.lang.String GetName()
          Return the name of the MVC object.
 java.lang.Object GetNewTempData()
          This method returns a new temporary data object.
 Redirect GetRedirectAfterLogin()
           
 IPTSession GetSession()
           
 boolean GetShowAuthSources()
           
 Redirect GetSubPortalRedirectAfterLogin(IPTSession _session)
           
 void Logout(IWebData webData)
           
protected  void ProcessFailedLogin(java.lang.String _strErrorMessage, java.lang.String _strUserName, java.lang.Object _oPreviousSessionValidAttribute)
          This helper method raises a UI error and handles failed logins in the LoginModel.
 void SetAccessStyle(int i)
           
 void SetAuthSource(java.lang.String s)
           
 void SetDefaultAuthSourcePrefix(java.lang.String s)
           
 void SetDoAttemptLogin(boolean b)
           
 void SetDoAttemptLogout(boolean b)
           
 void SetLoginAttempted(boolean b)
           
 void SetLoginSucceeded(boolean b)
           
 void SetRedirectAfterLogin(Redirect r)
           
 void SetRememberPassword(boolean b)
           
 void SetSession(IPTSession s)
           
 void SetShowAuthSources(boolean b)
           
 void SetToken(java.lang.String s)
           
 void SetUserName(java.lang.String s)
           
 void SetUserPass(java.lang.String s)
           
 
Methods inherited from class com.plumtree.uiinfrastructure.activityspace.AClearModel
CleanupAllData, CleanupTempData, GetTempData, Init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.plumtree.uiinfrastructure.activityspace.IModel
CleanupAllData, CleanupTempData, Init
 

Field Detail

STR_MVC_CLASS_NAME

public static final java.lang.String STR_MVC_CLASS_NAME
See Also:
Constant Field Values

AUTH_SOURCE_USER_SEPARATOR

public static final java.lang.String AUTH_SOURCE_USER_SEPARATOR
See Also:
Constant Field Values

redirectAfterLogin

protected Redirect redirectAfterLogin
Constructor Detail

LoginModel

public LoginModel()
Method Detail

Create

public java.lang.Object Create()
Description copied from class: AClearModel
This method is used by the ASManager to return new instances of managed objects.

Specified by:
Create in interface IManagedObject
Specified by:
Create in class AClearModel
Returns:
A new instance of the managed class (i.e. return new Foo();)
See Also:
IManagedObject.Create()

DoTasksBeforeLogout

public Redirect DoTasksBeforeLogout(IXPRequest request,
                                    IWebData webData)
This method will make a call to the LoginHelper to process tasks that may be needed before the Logout has occurred.

Returns:
Redirect - The location that a user will be redirected to after logout.
See Also:
LoginHelper.DoTasksBeforeLogout(com.plumtree.uiinfrastructure.activityspace.AActivitySpace, IXPRequest, com.plumtree.uiinfrastructure.activityspace.IWebData)

GetAccessStyle

public int GetAccessStyle()
Specified by:
GetAccessStyle in interface ILoginModelRO
Returns:

GetAllowDefaultAuthSourceMode

public int GetAllowDefaultAuthSourceMode()
Get Auth Source Mode

Specified by:
GetAllowDefaultAuthSourceMode in interface ILoginModelRO
Returns:
int the AllowDefaultLoginPageAuthSource value from PTConfig.xml

GetDoAttemptLogin

public boolean GetDoAttemptLogin()
Returns:

GetDoAttemptLogout

public boolean GetDoAttemptLogout()
Returns:

GetName

public java.lang.String GetName()
Description copied from interface: IMVCObject
Return the name of the MVC object.

Specified by:
GetName in interface ILoginModelRO
Specified by:
GetName in interface IMVCObject
Specified by:
GetName in class AClearModel
Returns:
the name of the object.
See Also:
com.plumtree.xpshared.activityspace.IModel#GetName()

GetNewTempData

public java.lang.Object GetNewTempData()
Description copied from class: AClearModel
This method returns a new temporary data object. It is called at the beginning of a new HTTP Request. This method can perform initialization on the data object if necessary.

Specified by:
GetNewTempData in class AClearModel
Returns:

GetRedirectAfterLogin

public Redirect GetRedirectAfterLogin()
Returns:

GetSession

public IPTSession GetSession()
Returns:

GetShowAuthSources

public boolean GetShowAuthSources()
Specified by:
GetShowAuthSources in interface ILoginModelRO
Returns:

GetSubPortalRedirectAfterLogin

public Redirect GetSubPortalRedirectAfterLogin(IPTSession _session)
Returns:

SetAccessStyle

public void SetAccessStyle(int i)
Parameters:
i -

SetDefaultAuthSourcePrefix

public void SetDefaultAuthSourcePrefix(java.lang.String s)
Parameters:
i -

SetDoAttemptLogin

public void SetDoAttemptLogin(boolean b)
Parameters:
b -

SetDoAttemptLogout

public void SetDoAttemptLogout(boolean b)
Parameters:
b -

SetLoginAttempted

public void SetLoginAttempted(boolean b)
Parameters:
b -

SetLoginSucceeded

public void SetLoginSucceeded(boolean b)
Parameters:
b -

SetRedirectAfterLogin

public void SetRedirectAfterLogin(Redirect r)
Parameters:
r -

SetSession

public void SetSession(IPTSession s)
Parameters:
s -

SetShowAuthSources

public void SetShowAuthSources(boolean b)
Parameters:
b -

Logout

public void Logout(IWebData webData)
Parameters:
webData -

SetAuthSource

public void SetAuthSource(java.lang.String s)
Parameters:
s -

SetRememberPassword

public void SetRememberPassword(boolean b)
Parameters:
b -

SetToken

public void SetToken(java.lang.String s)
Parameters:
s -

SetUserName

public void SetUserName(java.lang.String s)
Parameters:
s -

SetUserPass

public void SetUserPass(java.lang.String s)
Parameters:
s -

attemptLogin

public Redirect attemptLogin(IXPRequest request,
                             IWebData webData)
This method attempts to log the user into the portal.

Parameters:
webData - Pass an IWebData. Cookies may be added to this object if the user wishes to save the username and password.
Returns:
Redirect A redirect, if applicable.

ProcessFailedLogin

protected void ProcessFailedLogin(java.lang.String _strErrorMessage,
                                  java.lang.String _strUserName,
                                  java.lang.Object _oPreviousSessionValidAttribute)
This helper method raises a UI error and handles failed logins in the LoginModel.

Parameters:
_strErrorMessage - The failure error message.
_strUserName - The user name.
_oPreviousSessionValidAttribute - The previous value of the USERSESSIONVALID attribute.

GetBrowserTokenExpiration

public int GetBrowserTokenExpiration()
Helper method to get the browser token cookie expiration value from the PTconfig files. Logs an error and returns a reasonable default value if there are problems.

Parameters:
_tempData -
Returns:
int nExpiration in minutes - -1 means do not set the cookie, 0 means browser token.



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.