|
Expresso 5-5-0 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.controller.State
com.jcorporate.expresso.services.controller.dbmaint.DynamicCmd
Base class for all command classes. This class provides the execute() method which all subclasses need to override. IT does some basic functionality that all the DBMaint states need, such as load the given DBObject as specified.
| Field Summary | |
protected boolean |
countTotalRecords
Allows counting total records to be skipped so we can improve performance on large tables. |
static String |
masterObjKey
If we are handing master/detail DB objects, then the block containing /* the transitions to navigate the master/detail records is stored in session /* under this key |
protected boolean |
showNext
Flag to determine if we need to show the 'next page' icon |
protected boolean |
showPrev
Flag to determine if we need to show the 'previous page' icon |
| Fields inherited from class com.jcorporate.expresso.core.controller.State |
NOTEMPTY_MASK, secure |
| Constructor Summary | |
DynamicCmd()
Default constructor |
|
DynamicCmd(String code,
String descrip)
Constructor most often used |
|
| Method Summary | |
protected void |
addParams(Transition t)
Add the fields, details, search and dbobj parameters to a given transition object |
protected String |
decode(String orig)
Remove %20 from a string replacing it with spaces |
protected String |
getControllerName()
Retrieve the name of the controller we use. |
protected DBObject |
getCurrentDBObj()
Deprecated. Since Expresso 5.1 Use getDataObject() for compatibility with AutoDBObject, JoinedDataObject, etc. Will be removed in Expresso 5.2 |
protected DataObject |
getDataObject()
Retrieve the data object |
protected String |
getFieldsParam()
Return the "decoded" 'fields' parameter, consisting of a series of pipe-delimited fields and values |
protected Map |
getFixedFields()
Fixed fields are a hastable of field values keyed to field names that should not be modified. |
protected String |
getKeyParameter(DataObject srcDBObj)
Create a key parameter for locating the DBObject. |
protected DataObject |
getMyDataObject()
Retrieves an instance of my dataobject instance. |
int |
getPageNumber()
Returns the current page number as specified in the 'page' parameter |
protected String |
getSearchParam()
Return the "decoded" search parameter, consisting of a series of fields and values pipe-delimited |
protected void |
initializeDBObj()
Given a class name that contains a DBObject, instantiate an instance of the object & return it. |
protected boolean |
isKeyField(String fieldName)
Base class Is this field a key in the given database object? |
protected DataObject |
retrieveMyDBObject()
Retrieves the DBObject as specified in the criteria key fields passed to the DBMaint controller. |
void |
run(ControllerRequest newParams,
ControllerResponse newResponse)
All of the sub-classes of DynamicCmd extend the run method to perform their functionality. |
protected void |
setFields(DataObject myDBObj,
String fieldPairs)
Sets the fields in the production environment. |
protected void |
setFieldsParam(String newParam)
Set a encoded 'fields' parameter, consisting of a series of pipe-delimited fields and values |
protected void |
setMyDataObject(DataObject myDBObj)
Set the 'myDBObj' variable which is, in turn, used by the rest of the DBMaint controller. |
protected void |
setSearchParam(String newParam)
|
protected void |
showBlobViewLink(String fieldName,
DataObject dbobj,
Input myElement,
String controller)
Create a link that is nested to myElement that is for displaying a BLOB field. |
protected void |
showEditLink(String fieldName,
String oneFieldValue,
DataObject currentRecord,
Output myElement)
Show the edit link as often used by the List state or updateupdate state. |
protected void |
showEditLink(String fieldName,
String oneFieldValue,
DataObject currentRecord,
Output myElement,
String controller)
Write a hyperlink command that allows edit of the current key |
protected void |
showOptions()
Display a small table of icons giving the user the option to proceed directly to a search, add, or list function from this form. |
protected void |
showUserName(String theDescrip)
|
| Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected boolean showNext
protected boolean showPrev
public static String masterObjKey
protected boolean countTotalRecords
| Constructor Detail |
public DynamicCmd()
public DynamicCmd(String code,
String descrip)
code - The internal name of the statedescrip - The friendly name of the state| Method Detail |
protected void setSearchParam(String newParam)
newParam - The new searching paramter String
protected String getSearchParam()
throws ControllerException
ControllerException - upon errorprotected void setFieldsParam(String newParam)
newParam - ??
protected String getFieldsParam()
throws ControllerException
ControllerException
protected Map getFixedFields()
throws ControllerException
Fixed fields are a hastable of field values keyed to field names that should not be modified. The Input of a fixed field should be rendered read only.
The fields that are fixed can be defined in the 'fields' parameter by specifying which fields should be fixed. This is useful for master/ detail relationship specifications
ControllerExceptionprotected String decode(String orig)
orig - Original string
public void run(ControllerRequest newParams,
ControllerResponse newResponse)
throws ControllerException,
NonHandleableException
This part of run is an important part in the it adds what is known as the 'nav block' to the jsp pages. It also loads a dbobject into memory corresponding to the dbobject specified by the DBMaint parameters
run in class StatenewParams - The ControllerRequest objectnewResponse - The ControllerResponse object
ControllerException
NonHandleableException - upon fatal error
protected boolean isKeyField(String fieldName)
throws DBException,
ControllerException
fieldName - The name of the field to check
DBException - If unable to determine if the field is a key
due to other errors
ControllerException
protected void showOptions()
throws DBException,
ControllerException
Display a small table of icons giving the user the option to proceed directly to a search, add, or list function from this form. Only the functions this user are allowed to do are shown
If the record being displayed is a 'detail' record, then 'search' and 'fields' paramters are added. This helps specify the criteria (meaning all items here must have the same key as the master
*
DBException - If an error occurrs determining what functions
this user is allowed to perform
ControllerException
protected void showUserName(String theDescrip)
throws ControllerException
theDescrip - The Page header to add as String
ControllerException
protected void initializeDBObj()
throws ControllerException
ControllerException - if the object cannot be created or set up
protected DBObject getCurrentDBObj()
throws ControllerException
ControllerException - if there is no dbobject associated with the
controller state
protected DataObject getDataObject()
throws ControllerException
ControllerException - upon exception
public int getPageNumber()
throws ControllerException
ControllerException
protected void setFields(DataObject myDBObj,
String fieldPairs)
throws DBException
myDBObj - the data object to set the fields tofieldPairs - the piped field name|field value parameters
DBException - upon error
protected void addParams(Transition t)
throws ControllerException
t - The Transition to add the appropriate parameters to.
ControllerException - upon error
protected void showEditLink(String fieldName,
String oneFieldValue,
DataObject currentRecord,
Output myElement)
throws DBException,
ControllerException
fieldName - the name of the field to render as a linkoneFieldValue - the field's valuecurrentRecord - the current data object that the field should be
retrieved from.myElement - the output element that is going to be decorated
DBException - upon data access error
ControllerException - upon controller error
protected void showBlobViewLink(String fieldName,
DataObject dbobj,
Input myElement,
String controller)
throws DBException,
ControllerException
fieldName - The name of the field to render the link for.dbobj - The DBobject that the field nests in.myElement - The Input object that is getting the nested Transitioncontroller - The name of the controller to link to
DBException
ControllerException
protected void showEditLink(String fieldName,
String oneFieldValue,
DataObject currentRecord,
Output myElement,
String controller)
throws DBException,
ControllerException
fieldName - The name of the field to have the hyperlinkoneFieldValue - The value of the fieldcurrentRecord - A DBObject of the current recordmyElement - The cell in the table representing the current
field of the current recordcontroller - the name of the controller to use for the edit link (may
be null)
DBException - If the information to build the link cannot be
retrieved from the database object
ControllerException
protected String getKeyParameter(DataObject srcDBObj)
throws ControllerException
srcDBObj - the DBObject to generate the key for.
ControllerException - upon error getting the keys for the DBObject
protected DataObject retrieveMyDBObject()
throws DBException,
ControllerException
DBException - if unable to retrieve the object
ControllerException - for non-database related errorsprotected void setMyDataObject(DataObject myDBObj)
myDBObj - the new dataobject to set.protected DataObject getMyDataObject()
protected String getControllerName()
throws ControllerException
ControllerException - upon error
|
Expresso 5-5-0 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||