Class UserDataChange

UserDataChange

public class UserDataChange

The Class is used to change the userdatas

Version:
$Id: UserDataChange.java,v 1.88 2001/07/09 12:40:27 mkranz Exp $
Author:
Erguen Cimen Marco Kranz

Field Summary
private  java.lang.String[] error_matrix
           
 
Constructor Summary
UserDataChange()
           
 
Method Summary
private  boolean changeDataInDB(HttpServletRequest request, UserData user)
          This method changes the userdata in the userdata-object as well as in the db.
 void doGet(HttpServletRequest request, HttpServletResponse response)
          This method just calls doPost().
 void doPost(HttpServletRequest request, HttpServletResponse response)
          This Method generates the HTML-Code depending on wether its the first call or not and also if input is ok or not.
private  void GetErrorFromMatrix(java.io.PrintWriter out)
          This method gets errors from the Array.
private  java.lang.String getSQL(java.lang.String passwd, UserData user, java.lang.String birth)
          This method generates the SQL-statement.
private  boolean inputOkay(HttpServletRequest request, UserData user)
          This method is the Input-parser.
private  java.lang.String output(HttpServletRequest request, UserData user, java.lang.String value, boolean firstcall)
          This method is used to fill the fields in the table with the right userdata-values (if first call take 'em from 'user', otherwise request.getParameter()).
private  java.lang.String parseDateOfBirth(UserData user)
          This method transforms a String with the date-format YYYY-MM-DD to a String with date-format DD.MM.YYYY .
private  void printConfirm(UserData user, java.io.PrintWriter out)
          This method is called when userdata where sucsessfully changed in db.
private  void printForm(HttpServletRequest request, UserData user, java.io.PrintWriter out, boolean firstcall)
          This method generates the HTML-table for inserting the new userdata.
private  void SetErrorToMatrix(java.lang.String error_message)
          This method puts errors into the Array.
 

Field Detail

error_matrix

private java.lang.String[] error_matrix
Constructor Detail

UserDataChange

public UserDataChange()
Method Detail

doGet

public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
           throws ServletException,
                  java.io.IOException
This method just calls doPost().
Parameters:
request -  
response -  

doPost

public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
            throws ServletException,
                   java.io.IOException
This Method generates the HTML-Code depending on wether its the first call or not and also if input is ok or not. It also calls all the other methods.
Parameters:
request -  
response -  
Throws:
ServletException -  
java.io.IOException -  

changeDataInDB

private boolean changeDataInDB(HttpServletRequest request,
                               UserData user)
This method changes the userdata in the userdata-object as well as in the db.
Parameters:
request - the HttpServletRequest
user - The userdata-object that 'belongs' to the actual session
Returns:
returns true if the data are sucsessfully changed in the db, otherwise false

getSQL

private java.lang.String getSQL(java.lang.String passwd,
                                UserData user,
                                java.lang.String birth)
This method generates the SQL-statement.
Parameters:
passwd - the password entered by the user.
user - The userdata-object that 'belongs' to the actual session.
birth - The date of birth entered by the user.
Returns:
returns an SQL-statement as a String.

parseDateOfBirth

private java.lang.String parseDateOfBirth(UserData user)
This method transforms a String with the date-format YYYY-MM-DD to a String with date-format DD.MM.YYYY .
Parameters:
The - userdata-object that 'belongs' to the actual session.
Returns:
returns a String containing the formatted date.

printForm

private void printForm(HttpServletRequest request,
                       UserData user,
                       java.io.PrintWriter out,
                       boolean firstcall)
This method generates the HTML-table for inserting the new userdata.
Parameters:
request - HttpServletRequest
user - The userdata-object that 'belongs' to the actual session.
out - PrintWriter
firstcall - true if first call, otherwise false.

printConfirm

private void printConfirm(UserData user,
                          java.io.PrintWriter out)
This method is called when userdata where sucsessfully changed in db. It generates another table wich shows the new (changed) data.
Parameters:
user - The userdata-object that 'belongs' to the actual session.
out - PrintWriter

inputOkay

private boolean inputOkay(HttpServletRequest request,
                          UserData user)
This method is the Input-parser.
Parameters:
request - HttpServletRequest
user - The userdata-object that 'belongs' to the actual session.
out - PrintWriter
Returns:
Returns true if all input values are 'ok', otherwise false.

output

private java.lang.String output(HttpServletRequest request,
                                UserData user,
                                java.lang.String value,
                                boolean firstcall)
This method is used to fill the fields in the table with the right userdata-values (if first call take 'em from 'user', otherwise request.getParameter()).
Parameters:
request - HttpServletRequest
user - The userdata-object that 'belongs' to the actual session.
value - whatever...
firstcall - true if first call, else false
Returns:
Returns a single userdata-value as a String.

SetErrorToMatrix

private void SetErrorToMatrix(java.lang.String error_message)
This method puts errors into the Array.
Parameters:
error_message - This is an errormessage.

GetErrorFromMatrix

private void GetErrorFromMatrix(java.io.PrintWriter out)
This method gets errors from the Array.
Parameters:
out - PrintWriter