Expresso 5-6

com.jcorporate.expresso.services.controller.dbmaint
Class GetBase

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.GetBase
All Implemented Interfaces:
Cloneable, Serializable
Direct Known Subclasses:
Add, Search, Update

public abstract class GetBase
extends DynamicCmd

Base class for search/add & update operations that were previously carried out in DBMaint.doGet().

Author:
Michael Nash, contributions by Kevin King
See Also:
Serialized Form

Field Summary
 
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
GetBase()
           
GetBase(String code, String descrip)
           
 
Method Summary
protected  void addLookupTransition(DataObjectMetaData metadata, Input oneField, String oneFieldName)
          Adds the lookup transition if the target is a DataObject.
protected abstract  void autoField(String oneFieldName)
          implemented by subclass
protected  String displayValue(String fieldType, String fieldValue)
          Format a value for display in the HTML being returned to the client
protected  void showForm()
          Show the HTML form to the user - this form may be for add/update or search and may or may not be populated with data when presented to the user.
 
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
 

Constructor Detail

GetBase

public GetBase()

GetBase

public GetBase(String code,
               String descrip)
Parameters:
code - internal state name constructor
descrip - Friendly name of the state.
Method Detail

autoField

protected abstract void autoField(String oneFieldName)
                           throws DBException,
                                  ControllerException
implemented by subclass

Parameters:
oneFieldName - the field name to bring up the field
Throws:
DBException - upon error communicating with the DBObject.
ControllerException - upon other errors

displayValue

protected String displayValue(String fieldType,
                              String fieldValue)
                       throws DBException
Format a value for display in the HTML being returned to the client

Parameters:
fieldType - The type of the field to format
fieldValue - The value of the field
Returns:
String The formatted field
Throws:
DBException - If the field format information could not be determined

addLookupTransition

protected void addLookupTransition(DataObjectMetaData metadata,
                                   Input oneField,
                                   String oneFieldName)
                            throws DBException
Adds the lookup transition if the target is a DataObject. And a lookup object is specified. Otherwise, it skips the lookup item.

Parameters:
metadata - the object's metadata
oneField - the input to have a nested transition added to if valid.
oneFieldName - the name of the field to check
Throws:
DBException - upon error

showForm

protected void showForm()
                 throws DBException,
                        ControllerException
Show the HTML form to the user - this form may be for add/update or search and may or may not be populated with data when presented to the user. The descendant of this class must defined this method to show the necessary input form for the user to key in either record data or criteria f or a search. An existing record (if any) will be populated in myDBObj

Throws:
DBException - If a problem occurs with the database connection
ControllerException

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.