Java Doc for DynamicCmd.java in  » J2EE » Expresso » com » jcorporate » expresso » services » controller » dbmaint » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Expresso » com.jcorporate.expresso.services.controller.dbmaint 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jcorporate.expresso.core.controller.State
      com.jcorporate.expresso.services.controller.dbmaint.DynamicCmd

All known Subclasses:   com.jcorporate.expresso.services.controller.dbmaint.ViewBlob,  com.jcorporate.expresso.services.controller.dbmaint.GetBase,  com.jcorporate.expresso.services.controller.dbmaint.ListBase,  com.jcorporate.expresso.services.controller.dbmaint.UpdateBase,
DynamicCmd
abstract public class DynamicCmd extends State (Code)
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.
author:
   Michael Nash, contributions by Kevin King et al


Field Summary
protected  booleancountTotalRecords
     Allows counting total records to be skipped so we can improve performance on large tables.
public static  StringmasterObjKey
    
protected  booleanshowNext
    
protected  booleanshowPrev
    

Constructor Summary
public  DynamicCmd()
    
public  DynamicCmd(String code, String descrip)
    

Method Summary
protected  voidaddParams(Transition t)
    
protected  Stringdecode(String orig)
    
protected  StringgetControllerName()
     Retrieve the name of the controller we use.
protected  DBObjectgetCurrentDBObj()
     Return the current database object.
protected  DataObjectgetDataObject()
    
protected  StringgetFieldsParam()
    
protected  MapgetFixedFields()
    

Fixed fields are a hastable of field values keyed to field names that should not be modified.

protected  StringgetKeyParameter(DataObject srcDBObj)
     Create a key parameter for locating the DBObject.
protected  DataObjectgetMyDataObject()
     Retrieves an instance of my dataobject instance.
public  intgetPageNumber()
    
protected  StringgetSearchParam()
    
protected  voidinitializeDBObj()
     Given a class name that contains a DBObject, instantiate an instance of the object & return it.
protected  booleanisKeyField(String fieldName)
    
protected  DataObjectretrieveMyDBObject()
     Retrieves the DBObject as specified in the criteria key fields passed to the DBMaint controller.
public  voidrun(ControllerRequest newParams, ControllerResponse newResponse)
     All of the sub-classes of DynamicCmd extend the run method to perform their functionality.

This part of run is an important part in the it adds what is known as the 'nav block' to the jsp pages.

protected  voidsetFields(DataObject myDBObj, String fieldPairs)
     Sets the fields in the production environment.
protected  voidsetFieldsParam(String newParam)
    
protected  voidsetMyDataObject(DataObject myDBObj)
     Set the 'myDBObj' variable which is, in turn, used by the rest of the DBMaint controller.
protected  voidsetSearchParam(String newParam)
    
protected  voidshowBlobViewLink(String fieldName, DataObject dbobj, Input myElement, String controller)
     Create a link that is nested to myElement that is for displaying a BLOB field.
protected synchronized  voidshowEditLink(String fieldName, String oneFieldValue, DataObject currentRecord, Output myElement)
     Show the edit link as often used by the List state or updateupdate state.
protected synchronized  voidshowEditLink(String fieldName, String oneFieldValue, DataObject currentRecord, Output myElement, String controller)
    
protected  voidshowOptions()
    

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  voidshowUserName(String theDescrip)
    

Field Detail
countTotalRecords
protected boolean countTotalRecords(Code)
Allows counting total records to be skipped so we can improve performance on large tables.



masterObjKey
public static String masterObjKey(Code)
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



showNext
protected boolean showNext(Code)
Flag to determine if we need to show the 'next page' icon



showPrev
protected boolean showPrev(Code)
Flag to determine if we need to show the 'previous page' icon




Constructor Detail
DynamicCmd
public DynamicCmd()(Code)
Default constructor



DynamicCmd
public DynamicCmd(String code, String descrip)(Code)
Constructor most often used
Parameters:
  code - The internal name of the state
Parameters:
  descrip - The friendly name of the state




Method Detail
addParams
protected void addParams(Transition t) throws ControllerException(Code)
Add the fields, details, search and dbobj parameters to a given transition object
Parameters:
  t - The Transition to add the appropriate parameters to.
throws:
  ControllerException - upon error



decode
protected String decode(String orig)(Code)
Remove %20 from a string replacing it with spaces
Parameters:
  orig - Original string String Result string with %20 replaced by spaces



getControllerName
protected String getControllerName() throws ControllerException(Code)
Retrieve the name of the controller we use. This is much faster than getController().getClass().getName() because we precalc things once. java.lang.String
throws:
  ControllerException - upon error



getCurrentDBObj
protected DBObject getCurrentDBObj() throws ControllerException(Code)
Return the current database object. It is an error to request this if the current database object is not initialized the appropriate DBObject
throws:
  ControllerException - if there is no dbobject associated with thecontroller state



getDataObject
protected DataObject getDataObject() throws ControllerException(Code)
Retrieve the data object the current DataObject for this state
throws:
  ControllerException - upon exception



getFieldsParam
protected String getFieldsParam() throws ControllerException(Code)
Return the "decoded" 'fields' parameter, consisting of a series of pipe-delimited fields and values The fields Parameter as java.lang.String



getFixedFields
protected Map getFixedFields() throws ControllerException(Code)

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

java.util.Map



getKeyParameter
protected String getKeyParameter(DataObject srcDBObj) throws ControllerException(Code)
Create a key parameter for locating the DBObject. Used in generating transitions
Parameters:
  srcDBObj - the DBObject to generate the key for. java.lang.String, the pipe delimited URL encoded keys
throws:
  ControllerException - upon error getting the keys for the DBObject



getMyDataObject
protected DataObject getMyDataObject()(Code)
Retrieves an instance of my dataobject instance. Use this in derived classes to directly access the 'myDataObject' variable. DataObject instance.



getPageNumber
public int getPageNumber() throws ControllerException(Code)
Returns the current page number as specified in the 'page' parameter integer representing the current page number



getSearchParam
protected String getSearchParam() throws ControllerException(Code)
Return the "decoded" search parameter, consisting of a series of fields and values pipe-delimited The decoded URL serach parameter
throws:
  ControllerException - upon error



initializeDBObj
protected void initializeDBObj() throws ControllerException(Code)
Given a class name that contains a DBObject, instantiate an instance of the object & return it. Also associates the current user name (from the session) with the object so that requests to maniupluate the object can be passed through appropriate security (If the DBObject is of type SecuredDBObject)
throws:
  ControllerException - if the object cannot be created or set up



isKeyField
protected boolean isKeyField(String fieldName) throws DBException, ControllerException(Code)
Base class Is this field a key in the given database object?
Parameters:
  fieldName - The name of the field to check boolean True if the fieldname is a key field for thecurrent object
throws:
  DBException - If unable to determine if the field is a keydue to other errors



retrieveMyDBObject
protected DataObject retrieveMyDBObject() throws DBException, ControllerException(Code)
Retrieves the DBObject as specified in the criteria key fields passed to the DBMaint controller. DataObject requested by the request parameters
throws:
  DBException - if unable to retrieve the object
throws:
  ControllerException - for non-database related errors



run
public void run(ControllerRequest newParams, ControllerResponse newResponse) throws ControllerException, NonHandleableException(Code)
All of the sub-classes of DynamicCmd extend the run method to perform their functionality.

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


Parameters:
  newParams - The ControllerRequest object
Parameters:
  newResponse - The ControllerResponse object
throws:
  NonHandleableException - upon fatal error



setFields
protected void setFields(DataObject myDBObj, String fieldPairs) throws DBException(Code)
Sets the fields in the production environment.
Parameters:
  myDBObj - the data object to set the fields to
Parameters:
  fieldPairs - the piped field name|field value parameters
throws:
  DBException - upon error



setFieldsParam
protected void setFieldsParam(String newParam)(Code)
Set a encoded 'fields' parameter, consisting of a series of pipe-delimited fields and values
Parameters:
  newParam - ??



setMyDataObject
protected void setMyDataObject(DataObject myDBObj)(Code)
Set the 'myDBObj' variable which is, in turn, used by the rest of the DBMaint controller. Use this in derived classes to directly manipulate the dbobject.
Parameters:
  myDBObj - the new dataobject to set.



setSearchParam
protected void setSearchParam(String newParam)(Code)

Parameters:
  newParam - The new searching paramter String



showBlobViewLink
protected void showBlobViewLink(String fieldName, DataObject dbobj, Input myElement, String controller) throws DBException, ControllerException(Code)
Create a link that is nested to myElement that is for displaying a BLOB field.
Parameters:
  fieldName - The name of the field to render the link for.
Parameters:
  dbobj - The DBobject that the field nests in.
Parameters:
  myElement - The Input object that is getting the nested Transition
Parameters:
  controller - The name of the controller to link to



showEditLink
protected synchronized void showEditLink(String fieldName, String oneFieldValue, DataObject currentRecord, Output myElement) throws DBException, ControllerException(Code)
Show the edit link as often used by the List state or updateupdate state.
Parameters:
  fieldName - the name of the field to render as a link
Parameters:
  oneFieldValue - the field's value
Parameters:
  currentRecord - the current data object that the field should beretrieved from.
Parameters:
  myElement - the output element that is going to be decorated
throws:
  DBException - upon data access error
throws:
  ControllerException - upon controller error



showEditLink
protected synchronized void showEditLink(String fieldName, String oneFieldValue, DataObject currentRecord, Output myElement, String controller) throws DBException, ControllerException(Code)
Write a hyperlink command that allows edit of the current key
Parameters:
  fieldName - The name of the field to have the hyperlink
Parameters:
  oneFieldValue - The value of the field
Parameters:
  currentRecord - A DBObject of the current record
Parameters:
  myElement - The cell in the table representing the currentfield of the current record
Parameters:
  controller - the name of the controller to use for the edit link (maybe null)
throws:
  DBException - If the information to build the link cannot beretrieved from the database object



showOptions
protected void showOptions() throws DBException, ControllerException(Code)

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


throws:
  DBException - If an error occurrs determining what functionsthis user is allowed to perform



showUserName
protected void showUserName(String theDescrip) throws ControllerException(Code)

Parameters:
  theDescrip - The Page header to add as String



Fields inherited from com.jcorporate.expresso.core.controller.State
final public static String NOTEMPTY_MASK(Code)(Java Doc)
protected boolean secure(Code)(Java Doc)

Methods inherited from com.jcorporate.expresso.core.controller.State
protected void add(ControllerElement t) throws ControllerException(Code)(Java Doc)
protected void addAutoInput(String fieldName, String friendlyName, String defaultValue, int displayLength, int maxLength, Vector validValues) throws ControllerException(Code)(Java Doc)
protected void addAutoInput(String fieldName, String dbClassName, String defaultValue) throws ControllerException(Code)(Java Doc)
protected void addAutoInput(String fieldName, String friendlyName, String dbClassName, String defaultValue) throws ControllerException(Code)(Java Doc)
protected void addBlock(Block newBlock) throws ControllerException(Code)(Java Doc)
public void addError(String newError) throws ControllerException(Code)(Java Doc)
protected void addInput(Input newInput) throws ControllerException(Code)(Java Doc)
public void addOptionalParameter(String newParam)(Code)(Java Doc)
protected void addOutput(Output newOutput) throws ControllerException(Code)(Java Doc)
public void addParameter(String newParam, String mask)(Code)(Java Doc)
public void addParameter(String newParam, boolean required, String mask)(Code)(Java Doc)
public void addParameter(String newParam, boolean required, String mask, String maskError)(Code)(Java Doc)
public void addRequiredParameter(String newParam)(Code)(Java Doc)
public void addTransition(Transition newTransition) throws ControllerException(Code)(Java Doc)
protected void autoValidate(String checkClassName, ErrorCollection errorCollection) throws ValidationException, ControllerException(Code)(Java Doc)
protected void autoValidate(String checkClassName, ErrorCollection errorCollection, Vector requiredFields) throws ValidationException, ControllerException(Code)(Java Doc)
protected void calculateHandlerName(String stateName)(Code)(Java Doc)
protected void checkMask(String paramName, String paramValue, Pattern compiledRegExp) throws ControllerException(Code)(Java Doc)
public void checkParamMasks() throws ControllerException(Code)(Java Doc)
protected void clearFormCache() throws ControllerException(Code)(Java Doc)
public Object clone() throws java.lang.CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object o)(Code)(Java Doc)
protected String getAttribute(String attrib)(Code)(Java Doc)
public Controller getController() throws ControllerException(Code)(Java Doc)
protected ControllerRequest getControllerRequest()(Code)(Java Doc)
protected ControllerResponse getControllerResponse()(Code)(Java Doc)
protected DBController getDBController() throws ControllerException(Code)(Java Doc)
public String getDBName()(Code)(Java Doc)
public String getDataContext()(Code)(Java Doc)
public String getDescription()(Code)(Java Doc)
public String getErrorState()(Code)(Java Doc)
public Transition getErrorTransition()(Code)(Java Doc)
public ErrorCollection getErrors() throws ControllerException(Code)(Java Doc)
protected String getFileName(String paramName)(Code)(Java Doc)
protected String getFormCache(String fieldName) throws ControllerException(Code)(Java Doc)
public String getHandlerName()(Code)(Java Doc)
public String getInitParameter(String paramName)(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public Object getObjectParameter(String paramName) throws ControllerException(Code)(Java Doc)
public Vector getOptionalParameters()(Code)(Java Doc)
public List getOptionalParametersList()(Code)(Java Doc)
public String getParameter(String paramCode) throws ControllerException(Code)(Java Doc)
public Vector getParameters()(Code)(Java Doc)
protected PatternMatcher getPatternMatcher()(Code)(Java Doc)
public List getRequiredParametersList()(Code)(Java Doc)
public ControllerResponse getResponse()(Code)(Java Doc)
public Transition getReturnToSender()(Code)(Java Doc)
public PersistentSession getSession() throws ControllerException(Code)(Java Doc)
public String getStateFormClass()(Code)(Java Doc)
protected String getString(String key, Object[] args) throws ControllerException(Code)(Java Doc)
protected String getString(String key) throws ControllerException(Code)(Java Doc)
public Transition getSuccessTransition()(Code)(Java Doc)
protected int getUid() throws ControllerException(Code)(Java Doc)
public String getUser()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean isFileParameter(String paramName)(Code)(Java Doc)
protected boolean isParameter(String paramName) throws ControllerException(Code)(Java Doc)
public boolean isSecure()(Code)(Java Doc)
public void perform(StateForm stateForm, ControllerRequest newRequest, ControllerResponse newResponse) throws NonHandleableException, ControllerException(Code)(Java Doc)
public void run(ControllerRequest newRequest, ControllerResponse newResponse) throws ControllerException, NonHandleableException(Code)(Java Doc)
protected void saveErrors(ErrorCollection e) throws ControllerException(Code)(Java Doc)
public void setController(Controller newController) throws ControllerException(Code)(Java Doc)
public void setDescription(String newDescrip)(Code)(Java Doc)
public synchronized void setErrorState(String newErrorState)(Code)(Java Doc)
public void setErrorTransition(Transition newErrorTransition)(Code)(Java Doc)
protected void setFormCache() throws ControllerException(Code)(Java Doc)
public void setHandlerName(String newName)(Code)(Java Doc)
public synchronized void setMask(String paramName, String mask)(Code)(Java Doc)
public synchronized void setMask(String paramName, String mask, String errorMsg)(Code)(Java Doc)
public void setMaskError(String paramName, String errorMsg)(Code)(Java Doc)
public void setName(String newName)(Code)(Java Doc)
protected void setResponse(ControllerResponse res) throws ControllerException(Code)(Java Doc)
public void setReturnToSender(Transition newReturnToSender)(Code)(Java Doc)
public void setSecure(boolean newSecure)(Code)(Java Doc)
public void setStateFormClass(String newStateFormClass)(Code)(Java Doc)
public void setSuccessTransition(Transition newSuccessTransition)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
protected void transition(String newState, ControllerRequest req, ControllerResponse res) throws ControllerException, NonHandleableException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.