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

Quick Search    Search Deep

com.RuntimeCollective.webapps.form
Class TrackedUserForm  view TrackedUserForm download TrackedUserForm.java

java.lang.Object
  extended byorg.apache.struts.action.ActionForm
      extended bycom.RuntimeCollective.webapps.form.TrackedUserForm
All Implemented Interfaces:
BeanForm, java.io.Serializable

public class TrackedUserForm
extends org.apache.struts.action.ActionForm
implements BeanForm

Object that represents basic user details. Can be used for registering a new user, or logging in or editing a new one.

Version:
$Id: TrackedUserForm.java,v 1.6 2003/09/30 15:13:14 joe Exp $

Field Summary
protected  java.lang.String email
          The email address of the user.
static int EMAIL_LENGTH
          Maximum email length
protected  java.lang.String first
          First name.
static int FIRST_LENGTH
          Maximum first length
protected  java.lang.String formAction
          Type of action the form is being used for : default is "editUser".
protected  java.util.Date lastLoginDate
          Last login date
protected  int noLogins
          Number of Logins
static int PASSWORD_LENGTH
          Maximum password name length
static int PASSWORD_LENGTH_MIN
          Minimum password name length
protected  java.lang.String passwordConfirm
          Password confirmation.
protected  java.lang.String sessionString
          Simultaneous sessions as a String.
protected  int simultaneousSessions
          Simultaneous sessions.
protected  java.lang.String surname
          Surname name.
static int SURNAME_LENGTH
          Maximum surname length
protected  java.lang.String thePassword
          The password.
 
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
 
Constructor Summary
TrackedUserForm()
          Constructs a user form.
 
Method Summary
 java.lang.String getEmail()
          Get the email address of the user.
 java.lang.String getFirstName()
          Get the user's email address first name.
 java.lang.String getFormAction()
          Get type of action the form is being used for : could be "editUser" or "addUser".
 java.util.Date getLastLoginDate()
          Get the number of Logins.
 java.lang.String getLastName()
          Get the user's email address surname name.
 int getNoOfLogins()
          Get the number of Logins.
 java.lang.String getPasswordConfirm()
          Get password confirmation.
 int getSimultaneousSessions()
          Get the maximum number of simultaneous sessions.
 java.lang.String getSimultaneousSessionsString()
          Get the maximum number of simultaneous sessions as a String.
 java.lang.String getThePassword()
          Get the password.
 com.RuntimeCollective.webapps.bean.EntityBean populateBean(com.RuntimeCollective.webapps.bean.EntityBean bean)
          Populate a TrackedUser bean from this form.
 void populateForm(com.RuntimeCollective.webapps.bean.EntityBean bean)
          Populate this form from a User bean.
 void reset(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
          Reset all properties to default values.
 void setEmail(java.lang.String email)
          Set the email address of the user.
 void setFirstName(java.lang.String first)
          Set the user's first name.
 void setFormAction(java.lang.String formAction)
          Set type of action the form is being used for : could be "editUser" or "addUser".
 void setLastLoginDate(java.util.Date lastLoginDate)
          Set the number of credits.
 void setLastName(java.lang.String surname)
          Set the user's surname name.
 void setNoOfLogins(int noLogins)
          Set the number of credits.
 void setPasswordConfirm(java.lang.String passwordConfirm)
          Set password confirmation.
 void setSimultaneousSessions(int simultaneousSessions)
          Set the maximum number of simultaneous sessions.
 void setSimultaneousSessionsString(java.lang.String sessions)
          Set the maximum number of simultaneous sessions as a String.
 void setThePassword(java.lang.String password)
          Set the password.
 org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
          Validates the form field entries.
static boolean validEmail(java.lang.String email)
          Validates an email address.
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, reset, setMultipartRequestHandler, setServlet, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMAIL_LENGTH

public static final int EMAIL_LENGTH
Maximum email length

See Also:
Constant Field Values

PASSWORD_LENGTH

public static final int PASSWORD_LENGTH
Maximum password name length

See Also:
Constant Field Values

PASSWORD_LENGTH_MIN

public static final int PASSWORD_LENGTH_MIN
Minimum password name length

See Also:
Constant Field Values

FIRST_LENGTH

public static final int FIRST_LENGTH
Maximum first length

See Also:
Constant Field Values

SURNAME_LENGTH

public static final int SURNAME_LENGTH
Maximum surname length

See Also:
Constant Field Values

formAction

protected java.lang.String formAction
Type of action the form is being used for : default is "editUser".


first

protected java.lang.String first
First name.


surname

protected java.lang.String surname
Surname name.


thePassword

protected java.lang.String thePassword
The password.


passwordConfirm

protected java.lang.String passwordConfirm
Password confirmation.


email

protected java.lang.String email
The email address of the user. Also used as the unique login identifier.


simultaneousSessions

protected int simultaneousSessions
Simultaneous sessions. The maximum allowable number of sessions allowed.


sessionString

protected java.lang.String sessionString
Simultaneous sessions as a String.


noLogins

protected int noLogins
Number of Logins


lastLoginDate

protected java.util.Date lastLoginDate
Last login date

Constructor Detail

TrackedUserForm

public TrackedUserForm()
Constructs a user form.

Method Detail

getFormAction

public java.lang.String getFormAction()
Get type of action the form is being used for : could be "editUser" or "addUser".

Specified by:
getFormAction in interface BeanForm

setFormAction

public void setFormAction(java.lang.String formAction)
Set type of action the form is being used for : could be "editUser" or "addUser".

Specified by:
setFormAction in interface BeanForm

getFirstName

public java.lang.String getFirstName()
Get the user's email address first name.


setFirstName

public void setFirstName(java.lang.String first)
Set the user's first name.


getLastName

public java.lang.String getLastName()
Get the user's email address surname name.


setLastName

public void setLastName(java.lang.String surname)
Set the user's surname name.


getThePassword

public java.lang.String getThePassword()
Get the password.


setThePassword

public void setThePassword(java.lang.String password)
Set the password.


getPasswordConfirm

public java.lang.String getPasswordConfirm()
Get password confirmation.


setPasswordConfirm

public void setPasswordConfirm(java.lang.String passwordConfirm)
Set password confirmation.


getEmail

public java.lang.String getEmail()
Get the email address of the user. Also used as the unique login identifier.


setEmail

public void setEmail(java.lang.String email)
Set the email address of the user. Also used as the unique login identifier.


getSimultaneousSessions

public int getSimultaneousSessions()
Get the maximum number of simultaneous sessions.


setSimultaneousSessions

public void setSimultaneousSessions(int simultaneousSessions)
Set the maximum number of simultaneous sessions.


getSimultaneousSessionsString

public java.lang.String getSimultaneousSessionsString()
Get the maximum number of simultaneous sessions as a String.


setSimultaneousSessionsString

public void setSimultaneousSessionsString(java.lang.String sessions)
Set the maximum number of simultaneous sessions as a String.


getNoOfLogins

public int getNoOfLogins()
Get the number of Logins.


setNoOfLogins

public void setNoOfLogins(int noLogins)
Set the number of credits.


getLastLoginDate

public java.util.Date getLastLoginDate()
Get the number of Logins.


setLastLoginDate

public void setLastLoginDate(java.util.Date lastLoginDate)
Set the number of credits.


validate

public org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping,
                                                      javax.servlet.http.HttpServletRequest request)
Validates the form field entries.

Error codes returned:

  • error.user.emailNull - if email is null
  • error.user.invalidEmail - if email is not valid
  • error.user.passwordNull - if the password field is empty
  • error.user.passwordTooLong - if the password is longer than allowed in the DB
  • error.user.passwordTooShort - if the password was less than 6 characters in length
  • error.user.confirm - if the confirmation does not match the password
  • error.user.sessionNotNumber - if the session field is not a number
  • error.user.sessionTooSmall - if max simultaneous sessions less than 1


validEmail

public static boolean validEmail(java.lang.String email)
Validates an email address.


reset

public void reset(org.apache.struts.action.ActionMapping mapping,
                  javax.servlet.http.HttpServletRequest request)
Reset all properties to default values.

Specified by:
reset in interface BeanForm

populateBean

public com.RuntimeCollective.webapps.bean.EntityBean populateBean(com.RuntimeCollective.webapps.bean.EntityBean bean)
                                                           throws java.sql.SQLException
Populate a TrackedUser bean from this form.

Specified by:
populateBean in interface BeanForm

populateForm

public void populateForm(com.RuntimeCollective.webapps.bean.EntityBean bean)
Populate this form from a User bean.

Specified by:
populateForm in interface BeanForm