Java Doc for DefaultAutoElement.java in  » J2EE » Expresso » com » jcorporate » expresso » services » controller » ui » 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.ui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jcorporate.expresso.services.controller.ui.DefaultAutoElement

All known Subclasses:   com.jcorporate.expresso.services.controller.ui.CacheAutoElement,
DefaultAutoElement
public class DefaultAutoElement implements AutoControllerElement(Code)
Default implementation of the AutoController Element. Provides a default unified method for rendering/parsing Inputs from DBObjects
author:
   Michael Rimov, portions from Adam Rossi, Michael Nash, Shash
author:
   Chatterjee
since:
   Expresso 5.0


Field Summary
final public static  StringBLOCK_TITLE
    
final public static  StringCLASS_HANDLER_NAME
    
final public static  StringDBOBJECT_LABEL
    
final public static  StringDEFAULT_CLASS_HANDLER
    
final public static  StringDEFAULT_STYLE
    
final public static  StringERROR_STYLE
    
final public static  StringREQUIRED_STYLE
    
final public static  StringSESSION_KEY
    
protected static  Loggerlog
    
protected static  AutoControllerElementtheDefault
    

Constructor Summary
protected  DefaultAutoElement()
     The constructor here is protected.

Method Summary
public  BlockcreateDBObjectBlock(ControllerRequest request, ControllerResponse response, DataObject dbobj)
     Creates a DBObject Block that contains all the non-secret fields for the DBObject.
public  BlockcreateDBObjectBlock(ControllerRequest request, ControllerResponse response, String title, DataObject dbobj)
     Creates a DBObject Block that contains all the non-secret fields for the DBObject.
Parameters:
  response - The ControllerResponse object
Parameters:
  request - The ControllerRequest Object
Parameters:
  title - The title to give this block.
protected  StringdisplayValue(DataFieldMetaData metaData, Date dt, Locale l)
     Same as display value but for Date/DateTime types.
protected  StringdisplayValue(DataFieldMetaData metaData, String fieldValue, String fieldName, Locale l)
     Format a value for display in the HTML being returned to the client
Parameters:
  metaData - The Field Metadata
Parameters:
  fieldValue - The value of the field
Parameters:
  fieldName - the name of the field to render
Parameters:
  l - The Locale to display the value for.
public static synchronized  AutoControllerElementgetAutoControllerElement()
     Constructor.
public  StringgetErrorStyle()
     Returns the style to be used if the Input field has an error with it.
public  StringgetNormalStyle()
    
public  StringgetRequiredDecorator()
     Returns the string to append to a field label if it is required.
public  StringgetRequiredStyle()
    
public  DataObjectparseBlock(ControllerRequest request, DataObject oneObject, ErrorCollection ec)
     Convienence method if you only expect one DBObject to be returned from a particular form.
public  DataObject[]parseBlocks(ControllerRequest request, DataObject[] theObjects, ErrorCollection ec)
     Parses the appropriate DBObject from the block.
public  DataObjectparseDBObject(ControllerRequest request, DataObject oneObject, ErrorCollection ec, boolean validate)
     Parses a dbobject
Parameters:
  request - The ControllerRequest that contains all the parametersfor parsing.
Parameters:
  oneObject - The DBObject to populate.
Parameters:
  ec - An error Collection to send in for any parsing errors to besaved to.
Parameters:
  validate - Set to true if you want the DBObject validated.Sometimes, like for the DBMaint search form, this is not adesired feature.
public  DataObjectparseDBObject(ControllerRequest request, DataObject oneObject, ErrorCollection ec)
     Convienence method if you only expect one DBObject to be returned from a particular form, and unlike the ParseBlock, there is no DBOBject name prefix attached to the parameter names.
public  StringparseSingleInput(ControllerRequest request, DataObject dbobj, String fieldName, String parameterName, ErrorCollection ec)
     Takes the Controller Request and appropriately parses a string for a particular field.
public  InputrenderDBObjectField(ControllerResponse response, DataObject dbobj, String fieldName, String cachedValue, boolean readOnly)
     Renders a DBOBject Field as either an Input or an Output.
protected  InputrenderReadOnlyInput(ControllerResponse response, Input oneField, DataObject dbobj, String fieldName, String oneFieldValue)
     Modifies an already instantiated Input to be a finished read only control.
Parameters:
  response - The ControllerResponse object
Parameters:
  oneField - The input to flesh out.
Parameters:
  dbobj - The data source object
Parameters:
  fieldName - The field name in the dbobj to render.
Parameters:
  oneFieldValue - The value to add to the input control.
protected  voidrenderReadWriteBlob(ControllerResponse response, Input oneField, DataObject dbobj, String fieldName, String oneFieldValue, String oneFieldSize)
     Modifies an already instantiated Input to be a finished Input control specifically for a blob field.
protected  InputrenderReadWriteInput(ControllerResponse response, Input oneField, DataObject dbobj, String fieldName, String oneFieldValue, String oneFieldSize)
     Modifies an already instantiated Input to be a finished Input control
Parameters:
  response - The ControllerResponse object
Parameters:
  oneField - The input to flesh out.
Parameters:
  dbobj - The data source object
Parameters:
  fieldName - The field name in the dbobj to render.
Parameters:
  oneFieldValue - The value to add to the input control.
Parameters:
  oneFieldSize - The size of the Input control when finished.
protected  voidretrieveCachedValueInForm(ControllerResponse response, String oneFieldName, Input i)
     Used to set values in created db objects to the values found (if any) in the form cache.

Field Detail
BLOCK_TITLE
final public static String BLOCK_TITLE(Code)



CLASS_HANDLER_NAME
final public static String CLASS_HANDLER_NAME(Code)



DBOBJECT_LABEL
final public static String DBOBJECT_LABEL(Code)



DEFAULT_CLASS_HANDLER
final public static String DEFAULT_CLASS_HANDLER(Code)



DEFAULT_STYLE
final public static String DEFAULT_STYLE(Code)



ERROR_STYLE
final public static String ERROR_STYLE(Code)



REQUIRED_STYLE
final public static String REQUIRED_STYLE(Code)



SESSION_KEY
final public static String SESSION_KEY(Code)



log
protected static Logger log(Code)



theDefault
protected static AutoControllerElement theDefault(Code)
singleton instance




Constructor Detail
DefaultAutoElement
protected DefaultAutoElement()(Code)
The constructor here is protected. Use getAutoControllerElement() instead to get the instance of this class.




Method Detail
createDBObjectBlock
public Block createDBObjectBlock(ControllerRequest request, ControllerResponse response, DataObject dbobj) throws ControllerException(Code)
Creates a DBObject Block that contains all the non-secret fields for the DBObject. The Block will have a nested Output that matches DBObject's description unless one is not supplied in which case the nested Output will have the title "Untitled"
Parameters:
  response - The ControllerResponse object
Parameters:
  request - The ControllerRequest Object
Parameters:
  dbobj - The dbObject to automatically render. a rendered block
throws:
  ControllerException - if there's an error rendering the DBObject



createDBObjectBlock
public Block createDBObjectBlock(ControllerRequest request, ControllerResponse response, String title, DataObject dbobj) throws ControllerException(Code)
Creates a DBObject Block that contains all the non-secret fields for the DBObject.
Parameters:
  response - The ControllerResponse object
Parameters:
  request - The ControllerRequest Object
Parameters:
  title - The title to give this block. The system renders a nestedOutput called "block-title" for the block that contains thisdata.
Parameters:
  dbobj - The dbObject to automatically render. a rendered Block object
throws:
  ControllerException - if there's an error rendering the DBObject



displayValue
protected String displayValue(DataFieldMetaData metaData, Date dt, Locale l)(Code)
Same as display value but for Date/DateTime types. Formats things appropriate to the user's locale
Parameters:
  metaData - the Data Field's metadata
Parameters:
  dt - The date value to format
Parameters:
  l - the User's Locale gathered from the ControllerResponse object a properly formatted date



displayValue
protected String displayValue(DataFieldMetaData metaData, String fieldValue, String fieldName, Locale l) throws ControllerException(Code)
Format a value for display in the HTML being returned to the client
Parameters:
  metaData - The Field Metadata
Parameters:
  fieldValue - The value of the field
Parameters:
  fieldName - the name of the field to render
Parameters:
  l - The Locale to display the value for. String The formatted field
throws:
  ControllerException - If the field format information could not bedetermined



getAutoControllerElement
public static synchronized AutoControllerElement getAutoControllerElement() throws ControllerException(Code)
Constructor. Allows for a classHandler to be used from the expresso-config.xml if you really need something completely different. an instantiated AutoControllerElement
throws:
  ControllerException - upon error



getErrorStyle
public String getErrorStyle()(Code)
Returns the style to be used if the Input field has an error with it. java.lang.String a Stylesheet class to render to



getNormalStyle
public String getNormalStyle()(Code)
Returns the style to be used if the input has normal non-required characteristics java.lang.String a Stylesheet class to render to



getRequiredDecorator
public String getRequiredDecorator()(Code)
Returns the string to append to a field label if it is required. Default is an "" java.lang.String a Stylesheet class to render to



getRequiredStyle
public String getRequiredStyle()(Code)
Returns the style to be used if the Input is required java.lang.String a Stylesheet class to render to



parseBlock
public DataObject parseBlock(ControllerRequest request, DataObject oneObject, ErrorCollection ec) throws ControllerException(Code)
Convienence method if you only expect one DBObject to be returned from a particular form.
Parameters:
  request - The ControllerRequest object handed down by the framework
Parameters:
  oneObject - a single dbobject ro dumpt the parsed values into.
Parameters:
  ec - An instantiated ErrorCollection that is filled in with anyerror a filled out DBObject
throws:
  ControllerException - if there's an error parsing the block orcommunicating with the underlying DBObject



parseBlocks
public DataObject[] parseBlocks(ControllerRequest request, DataObject[] theObjects, ErrorCollection ec) throws ControllerException(Code)
Parses the appropriate DBObject from the block. Returns the fully constructed DBOBject including any errors in the DBObject
Parameters:
  request - The ControllerRequest object handed down by the framework
Parameters:
  theObjects - A pre-instantiated group of DBObjects in which youexpect to have the fields overwritten/filled. By usinginstantiated DBObjects, you can pre-fill any potentially blankfields and thus remove any Errors.
Parameters:
  ec - An instantiated ErrorCollection that is filled in with anyerror An array of parsed DBObjects
throws:
  ControllerException - if there's an error parsing the block orcommunicating with the underlying DBObject
throws:
  IllegalArgumentException - if request, theObjects, or ec is null



parseDBObject
public DataObject parseDBObject(ControllerRequest request, DataObject oneObject, ErrorCollection ec, boolean validate) throws ControllerException(Code)
Parses a dbobject
Parameters:
  request - The ControllerRequest that contains all the parametersfor parsing.
Parameters:
  oneObject - The DBObject to populate.
Parameters:
  ec - An error Collection to send in for any parsing errors to besaved to.
Parameters:
  validate - Set to true if you want the DBObject validated.Sometimes, like for the DBMaint search form, this is not adesired feature. The parsed DBObject [Although oneObject gets populated since noassignment takes place.] So you can ignore this return valueif you desire.
throws:
  IllegalArgumentException - upon data exception.
throws:
  ControllerException - upon controller-related error.



parseDBObject
public DataObject parseDBObject(ControllerRequest request, DataObject oneObject, ErrorCollection ec) throws ControllerException(Code)
Convienence method if you only expect one DBObject to be returned from a particular form, and unlike the ParseBlock, there is no DBOBject name prefix attached to the parameter names. This is similar to the ControllerRequest validateDBObject functionality, but we're consolodating things here.
Parameters:
  request - The ControllerRequest object handed down by the framework
Parameters:
  oneObject - A DBObject to fill in.
Parameters:
  ec - An instantiated ErrorCollection that is filled in with anyerror a parsed DBObject
throws:
  ControllerException - if there's an error parsing the block orcommunicating with the underlying DBObject



parseSingleInput
public String parseSingleInput(ControllerRequest request, DataObject dbobj, String fieldName, String parameterName, ErrorCollection ec) throws ControllerException(Code)
Takes the Controller Request and appropriately parses a string for a particular field. If the field is a Date, then it parses it as such, if it is money, then it perses it as such. Etc.

As of Expresso 5.1, the system properly parses multi-part request data. If a parameter is a file parameter, then it sets the following field attributes that can be retrieved by:
DataObject.getFieldData(fieldName).getAttribute(attribName);

  • Attribute: fileName - The locally accessible file name to be used for most likely saving to the database. Use new File(fileName) to actually access the uploaded file
  • Attribute: origFileName - The original file name (without path) that was uploaded to the server through the web browser. This will be different from the attribute fileName since Expresso will rename the local file name to prevent naming collisions
  • Attribute: MimeType - The system will make a guess as to the mime type of the file that was uploaded based upon the file name.

Finally, if the target dbobj is of type MediaDBObject the fields: 'fieldName + "_mimeType"' and 'fieldName + "_fileName"' will be set with the corresponding mimeType and origFileName values


Parameters:
  request - The ControllerRequest object
Parameters:
  dbobj - The DBObject for which we're going to put the field to
Parameters:
  fieldName - The name of the field to parse
Parameters:
  parameterName - The name of the http paramter to parse May be nullin which case, the funciton will by default use the fieldName asthe parameter name.
Parameters:
  ec - An instantiated ErrorCollection object that will be filledwith any parsing errors that may be encountered. java.lang.String for the value.
throws:
  ControllerException - upon parsing error
since:
   Expresso 5.0; Multipart Request Handling since Expresso 5.1




renderDBObjectField
public Input renderDBObjectField(ControllerResponse response, DataObject dbobj, String fieldName, String cachedValue, boolean readOnly) throws ControllerException(Code)
Renders a DBOBject Field as either an Input or an Output. For example, if we're talking updating, then all key fields are outputs and not inputs. This function auto-detects whether we are dealing with a add() or update() situation by checking the DBObject's status. If it's NEW, then we treat this as an add form, if it is
Parameters:
  response - The ControllerResponse object
Parameters:
  dbobj - The parameter to render
Parameters:
  fieldName - The name of the field to render
Parameters:
  cachedValue - Any cached form value to put in the field.
Parameters:
  readOnly - - If set to true, then this is automatically a read-onlyfield... if set to false, this function might still render thefield as read-only if, for example, it's a key field. a created Input
throws:
  ControllerException - if there's an error creating the Input Field



renderReadOnlyInput
protected Input renderReadOnlyInput(ControllerResponse response, Input oneField, DataObject dbobj, String fieldName, String oneFieldValue) throws DBException, ControllerException(Code)
Modifies an already instantiated Input to be a finished read only control.
Parameters:
  response - The ControllerResponse object
Parameters:
  oneField - The input to flesh out.
Parameters:
  dbobj - The data source object
Parameters:
  fieldName - The field name in the dbobj to render.
Parameters:
  oneFieldValue - The value to add to the input control. a read only input
throws:
  DBException - if there's an error communicating with the DBObject
throws:
  ControllerException - if there's an error building the Inputfield.



renderReadWriteBlob
protected void renderReadWriteBlob(ControllerResponse response, Input oneField, DataObject dbobj, String fieldName, String oneFieldValue, String oneFieldSize) throws DBException, ControllerException(Code)
Modifies an already instantiated Input to be a finished Input control specifically for a blob field. If the dbobject is a MediaObject, then it adds the abilities to view the fields and creates an appropriate icon.
Parameters:
  response - The ControllerResponse object
Parameters:
  oneField - The input to flesh out.
Parameters:
  dbobj - The data source object
Parameters:
  fieldName - The field name in the dbobj to render.
Parameters:
  oneFieldValue - The value to add to the input control.
Parameters:
  oneFieldSize - The size of the Input control when finished.
throws:
  DBException - if there's an error communicating with the DBObject
throws:
  ControllerException - if there's an error building the Inputfield.



renderReadWriteInput
protected Input renderReadWriteInput(ControllerResponse response, Input oneField, DataObject dbobj, String fieldName, String oneFieldValue, String oneFieldSize) throws DBException, ControllerException(Code)
Modifies an already instantiated Input to be a finished Input control
Parameters:
  response - The ControllerResponse object
Parameters:
  oneField - The input to flesh out.
Parameters:
  dbobj - The data source object
Parameters:
  fieldName - The field name in the dbobj to render.
Parameters:
  oneFieldValue - The value to add to the input control.
Parameters:
  oneFieldSize - The size of the Input control when finished. a rendered Read/Write Input
throws:
  DBException - if there's an error communicating with the DBObject
throws:
  ControllerException - if there's an error building the Inputfield.



retrieveCachedValueInForm
protected void retrieveCachedValueInForm(ControllerResponse response, String oneFieldName, Input i) throws ControllerException(Code)
Used to set values in created db objects to the values found (if any) in the form cache. (the form cache is what people type into an HTML form, and if there is an error, we cache those values in order to send back the form (with error message) and have their typing preserved for the next try.)
Parameters:
  response - ?
Parameters:
  oneFieldName - ?
Parameters:
  i - The Input to retrieve.
See Also:   CacheAutoElement



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.