FileDocCategorySizeDatePackage
TableBean.javaAPI DocGlassfish v2 API3880Fri May 04 22:34:20 BST 2007cal

TableBean

public class TableBean extends Object

Fields Summary
Hashtable
table
JspCalendar
JspCal
Entries
entries
String
date
String
name
String
email
boolean
processError
Constructors Summary
public TableBean()


     
    this.table = new Hashtable (10);
    this.JspCal = new JspCalendar ();
    this.date = JspCal.getCurrentDate ();
  
Methods Summary
public java.lang.StringgetDate()

    return this.date;
  
public java.lang.StringgetEmail()

    return this.email;
  
public EntriesgetEntries()

    return this.entries;
  
public java.lang.StringgetName()

    return this.name;
  
public booleangetProcessError()

    return this.processError;
  
public voidprocessRequest(javax.servlet.http.HttpServletRequest request)


    // Get the name and e-mail.
    this.processError = false;
    if (name == null || name.equals("")) setName(request.getParameter ("name"));  
    if (email == null || email.equals("")) setEmail(request.getParameter ("email"));
    if (name == null || email == null ||
		name.equals("") || email.equals("")) {
      this.processError = true;
      return;
    }

    // Get the date.
    String dateR = request.getParameter ("date");
    if (dateR == null) date = JspCal.getCurrentDate ();
    else if (dateR.equalsIgnoreCase("next")) date = JspCal.getNextDate ();
    else if (dateR.equalsIgnoreCase("prev")) date = JspCal.getPrevDate ();

    entries = (Entries) table.get (date);
    if (entries == null) {
      entries = new Entries ();
      table.put (date, entries);
    }

    // If time is provided add the event.
	String time = request.getParameter("time");
    if (time != null) entries.processRequest (request, time);
  
public voidsetEmail(java.lang.String mail)

    this.email = mail;
  
public voidsetName(java.lang.String nm)

    this.name = nm;