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

Quick Search    Search Deep

com.jcorporate.expresso.services.controller.dbmaint
Class Lookup  view Lookup download Lookup.java

java.lang.Object
  extended bycom.jcorporate.expresso.services.controller.dbmaint.Lookup
All Implemented Interfaces:
java.io.Serializable

public class Lookup
extends java.lang.Object
implements java.io.Serializable


Field Summary
static java.lang.String DBF_DB_FILTER_FNAME
           
static java.lang.String DBF_DB_FILTER_VALUE
           
static java.lang.String DBF_DB_FILTER_WHERE
           
static java.lang.String DBF_DBDESC
           
static java.lang.String DBF_DBKEY
           
static java.lang.String DBF_DBNAME
           
static java.lang.String DBM_ACTION_KEY
           
static java.lang.String DBM_ACTION_SEARCH
           
private static org.apache.log4j.Logger log
           
protected  java.util.HashMap theFilter
           
 
Constructor Summary
Lookup()
          Default Constructor
 
Method Summary
static java.util.Vector getLookupValues(com.jcorporate.expresso.core.dbobj.DBObject myDBObj, java.lang.String fieldName, com.jcorporate.expresso.core.controller.session.HTTPPersistentSession mySession)
          Performs the lookup.
 java.util.HashMap getTheFilter()
          Get property: theFilter
private  void readObject(java.io.ObjectInputStream ois)
           
private  void remove(javax.servlet.http.HttpServletRequest request)
          Remove lookup session variable.
 void setFilter(java.lang.String dbname, java.lang.String dbkey, java.lang.String dbdesc, java.lang.String db_filter_where)
          Adding advanced partial lookup filter.
 void setFilter(java.lang.String dbname, java.lang.String dbkey, java.lang.String dbdesc, java.lang.String db_filter_fname, java.lang.String db_filter_value)
          Adding simple partial lookup filter.
 java.lang.String toString()
          Convert this Object to a human-readable String.
private  void writeObject(java.io.ObjectOutputStream oos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private static transient org.apache.log4j.Logger log

DBF_DBNAME

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

DBF_DBKEY

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

DBF_DBDESC

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

DBF_DB_FILTER_FNAME

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

DBF_DB_FILTER_VALUE

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

DBF_DB_FILTER_WHERE

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

DBM_ACTION_KEY

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

DBM_ACTION_SEARCH

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

theFilter

protected java.util.HashMap theFilter
Constructor Detail

Lookup

public Lookup()
Default Constructor

Method Detail

getTheFilter

public java.util.HashMap getTheFilter()
Get property: theFilter


setFilter

public void setFilter(java.lang.String dbname,
                      java.lang.String dbkey,
                      java.lang.String dbdesc,
                      java.lang.String db_filter_fname,
                      java.lang.String db_filter_value)
Adding simple partial lookup filter.

Parameters are: lookup db name, key field name, description field name, filter field name and filter field value.


setFilter

public void setFilter(java.lang.String dbname,
                      java.lang.String dbkey,
                      java.lang.String dbdesc,
                      java.lang.String db_filter_where)
Adding advanced partial lookup filter.

Parameters are: lookup db name, key field name, description field name, filter where clause.


getLookupValues

public static java.util.Vector getLookupValues(com.jcorporate.expresso.core.dbobj.DBObject myDBObj,
                                               java.lang.String fieldName,
                                               com.jcorporate.expresso.core.controller.session.HTTPPersistentSession mySession)
                                        throws com.jcorporate.expresso.core.db.DBException
Performs the lookup.

The basic idea is pre-setting some session variables, i.e., <DBObjectName>_filter_<fieldName>. They are HashMap objects that contain information such as lookup db name, key field name, description field name, filter field name and filter field value, etc. It is used by Lookup.java to return ValidValue pairs.

The Lookup.java object will be intelligent enough to handle cases like full lookup (no filter), partial lookup (with simple/advanced filtering condition(s)), and MultiDBObjects lookups.


toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


writeObject

private void writeObject(java.io.ObjectOutputStream oos)
                  throws java.io.IOException

readObject

private void readObject(java.io.ObjectInputStream ois)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException

remove

private void remove(javax.servlet.http.HttpServletRequest request)
Remove lookup session variable.