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 ListBase  view ListBase download ListBase.java

java.lang.Object
  extended bycom.jcorporate.expresso.core.controller.State
      extended bycom.jcorporate.expresso.services.controller.dbmaint.DynamicCmd
          extended bycom.jcorporate.expresso.services.controller.dbmaint.ListBase
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
List, SearchList

public abstract class ListBase
extends DynamicCmd

Base class for the DBMaint commands that display lists of records, such as Search and List.


Field Summary
private  com.jcorporate.expresso.core.misc.RecordPaginator paginator
           
private  long totalRecordCount
           
 
Fields inherited from class com.jcorporate.expresso.services.controller.dbmaint.DynamicCmd
countTotalRecords, masterObjKey, showNext, showPrev
 
Fields inherited from class com.jcorporate.expresso.core.controller.State
NOTEMPTY_MASK, secure
 
Constructor Summary
ListBase()
           
ListBase(java.lang.String code, java.lang.String descrip)
          Constructor
 
Method Summary
protected  void addRecordsToBlock(java.util.ArrayList i_AllRecords, com.jcorporate.expresso.core.controller.Block myTable)
          Given an interator containing database objects add all of those objects to the given output block as rows.
private  void autoList()
          Base class Search the database for a list of records that match the given criteria and display them in a table.
private  java.lang.String displayDateValue(com.jcorporate.expresso.core.dataobjects.DataFieldMetaData metaData, java.util.Date dt, java.util.Locale l)
          Same as display value but for Date/DateTime types.
protected  com.jcorporate.expresso.core.controller.Block generatePageTransitions(com.jcorporate.expresso.core.controller.ControllerRequest request, com.jcorporate.expresso.core.misc.RecordPaginator rp, int pageLimit)
          Generates an arrayList of transitions to allow direct jumping to a page.
protected  com.jcorporate.expresso.core.misc.RecordPaginator getRecordPaginator()
          Gets the currently used paginator
protected  java.lang.String getSortKey()
          This method determines how the list is sorted.
protected  long listRecords(java.lang.String sortKey, com.jcorporate.expresso.core.controller.Block myTable)
          Lists the records for display
private  java.text.DateFormat modifyDateFormat(java.text.DateFormat df)
          Gleaned from http://www.jguru.com/faq/view.jsp?EID=429821 to make the SimpleDateFormat give us 4 year dates instead.
protected  void setupListSearchCriteria()
          This method sets the search conditions on the current DBObject.
protected  void showList()
          Base class Show a list of database records to the user, allowing the key to be clicked on to request an edit of the object
 
Methods inherited from class com.jcorporate.expresso.services.controller.dbmaint.DynamicCmd
addParams, decode, getControllerName, getCurrentDBObj, getDataObject, getFieldsParam, getFixedFields, getKeyParameter, getMyDataObject, getPageNumber, getSearchParam, initializeDBObj, isKeyField, retrieveMyDBObject, run, setFields, setFieldsParam, setMyDataObject, setSearchParam, showBlobViewLink, showEditLink, showEditLink, showOptions, showUserName
 
Methods inherited from class com.jcorporate.expresso.core.controller.State
add, addAutoInput, addAutoInput, addAutoInput, addBlock, addError, addInput, addOptionalParameter, addOutput, addParameter, addParameter, addParameter, addRequiredParameter, addTransition, autoValidate, autoValidate, calculateHandlerName, checkMask, checkParamMasks, clearFormCache, clone, equals, getAttribute, getController, getControllerRequest, getControllerResponse, getDataContext, getDBController, getDBName, getDescription, getErrors, getErrorState, getErrorTransition, getFileName, getFormCache, getHandlerName, getInitParameter, getName, getObjectParameter, getOptionalParameters, getOptionalParametersList, getParameter, getParameters, getPatternMatcher, getRequiredParametersList, getResponse, getReturnToSender, getSession, getStateFormClass, getString, getString, getSuccessTransition, getUid, getUser, hashCode, isFileParameter, isParameter, isSecure, perform, saveErrors, setController, setDescription, setErrorState, setErrorTransition, setFormCache, setHandlerName, setMask, setMask, setMaskError, setName, setResponse, setReturnToSender, setSecure, setStateFormClass, setSuccessTransition, toString, transition
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

totalRecordCount

private long totalRecordCount

paginator

private com.jcorporate.expresso.core.misc.RecordPaginator paginator
Constructor Detail

ListBase

public ListBase()

ListBase

public ListBase(java.lang.String code,
                java.lang.String descrip)
Constructor

Method Detail

autoList

private void autoList()
               throws com.jcorporate.expresso.core.db.DBException,
                      com.jcorporate.expresso.core.controller.ControllerException
Base class Search the database for a list of records that match the given criteria and display them in a table. Key fields are made clickable for the user to edit/delete the current record (security permitting).


modifyDateFormat

private java.text.DateFormat modifyDateFormat(java.text.DateFormat df)
Gleaned from http://www.jguru.com/faq/view.jsp?EID=429821 to make the SimpleDateFormat give us 4 year dates instead.


displayDateValue

private java.lang.String displayDateValue(com.jcorporate.expresso.core.dataobjects.DataFieldMetaData metaData,
                                          java.util.Date dt,
                                          java.util.Locale l)
Same as display value but for Date/DateTime types. Formats things appropriate to the user's locale


getRecordPaginator

protected com.jcorporate.expresso.core.misc.RecordPaginator getRecordPaginator()
                                                                        throws com.jcorporate.expresso.core.controller.ControllerException
Gets the currently used paginator


listRecords

protected long listRecords(java.lang.String sortKey,
                           com.jcorporate.expresso.core.controller.Block myTable)
                    throws com.jcorporate.expresso.core.db.DBException,
                           com.jcorporate.expresso.core.controller.ControllerException
Lists the records for display


getSortKey

protected java.lang.String getSortKey()
                               throws com.jcorporate.expresso.core.db.DBException,
                                      com.jcorporate.expresso.core.controller.ControllerException
This method determines how the list is sorted. The default sort order is by the key fields of the underlying DBObject. To change the default just override this method in a derived class.


setupListSearchCriteria

protected void setupListSearchCriteria()
                                throws com.jcorporate.expresso.core.db.DBException,
                                       com.jcorporate.expresso.core.controller.ControllerException
This method sets the search conditions on the current DBObject. The implementation at this level uses the searchParam if it has been set, you can override this method to use other criteria, like a custom where clause.


generatePageTransitions

protected com.jcorporate.expresso.core.controller.Block generatePageTransitions(com.jcorporate.expresso.core.controller.ControllerRequest request,
                                                                                com.jcorporate.expresso.core.misc.RecordPaginator rp,
                                                                                int pageLimit)
                                                                         throws com.jcorporate.expresso.core.controller.ControllerException
Generates an arrayList of transitions to allow direct jumping to a page.


addRecordsToBlock

protected void addRecordsToBlock(java.util.ArrayList i_AllRecords,
                                 com.jcorporate.expresso.core.controller.Block myTable)
                          throws com.jcorporate.expresso.core.db.DBException,
                                 com.jcorporate.expresso.core.controller.ControllerException
Given an interator containing database objects add all of those objects to the given output block as rows. All non-secret fields of each object should be added to the row.


showList

protected void showList()
                 throws com.jcorporate.expresso.core.db.DBException,
                        com.jcorporate.expresso.core.controller.ControllerException
Base class Show a list of database records to the user, allowing the key to be clicked on to request an edit of the object