| com.jcorporate.expresso.services.controller.ui.AutoControllerElement
All known Subclasses: com.jcorporate.expresso.services.controller.ui.DefaultAutoElement,
AutoControllerElement | public interface AutoControllerElement (Code) | | This interface is for objects that provide an automatic rendering capability
to the system. It's in sort of a way a bridge between DBObjects and
ControllerElements
author: Michael Rimov, portions from Adam Rossi, Michael Nash, Shash Chatterjee since: Expresso 5.0 |
Method Summary | |
public Block | createDBObjectBlock(ControllerRequest request, ControllerResponse response, DataObject dbobj) Creates a DBObject Block that contains all the non-secret fields for
the DBObject. | public Block | createDBObjectBlock(ControllerRequest request, ControllerResponse response, String title, DataObject dbobj) Creates a DBObject Block that contains all the non-secret fields for
the DBObject.
Parameters: response - a ControllerResponse Object Parameters: request - The ControllerRequest Object Parameters: title - The title to give this block. | public String | getErrorStyle() Allows for easy overriding fo the style name for special customization. | public String | getNormalStyle() | public String | getRequiredStyle() Allows for easy overriding fo the style name for special customization. | public DataObject | parseBlock(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 DataObject | parseDBObject(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 DataObject | parseDBObject(ControllerRequest request, DataObject oneObject, ErrorCollection ec, boolean validate) | public String | parseSingleInput(ControllerRequest request, DataObject dbobj, String fieldName, String parameterName, ErrorCollection ec) Takes the Controller Request and appropriately parses a string for a
particular field. | public Input | renderDBObjectField(ControllerResponse response, DataObject dbobj, String fieldName, String defaultValue, boolean readOnly) Renders an Input in a update method per field name.
Parameters: response - a ControllerResponse Object Parameters: dbobj - A DBObject to transform into an Input Parameters: fieldName - the name of the field to render Parameters: defaultValue - the default value to use in the field Parameters: readOnly - true if the Input should be a read only input. |
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 - a ControllerResponse Object Parameters: request - The ControllerRequest Object Parameters: dbobj - The dbObject to automatically render. an instantiated DBObject block based upon the parameters 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 - a 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 this data. Parameters: dbobj - The dbObject to automatically render. an instantiated DBObject block based upon the parameters throws: ControllerException - if there's an error rendering the DBObject |
getErrorStyle | public String getErrorStyle() throws ControllerException(Code) | | Allows for easy overriding fo the style name for special customization.
the class name that is used for error conditions. |
getNormalStyle | public String getNormalStyle() throws ControllerException(Code) | | Allows for easy overriding of the style name for special customization
a String naming the CSS class to use under normal circumstanes. |
getRequiredStyle | public String getRequiredStyle() throws ControllerException(Code) | | Allows for easy overriding fo the style name for special customization.
a String naming the CSS class to use to render required fields. |
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 to fill into fill out from the block. Parameters: ec - An instantiated ErrorCollection that is filled in with any error an instatiated DBObject throws: ControllerException - if there's an error parsing the block or communicatingwith the underlying DBObject throws: IllegalArgumentException - if request, DBObjectNames, or ec is null |
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 you expectto have the fields overwritten/filled. By using instantiated DBObjects,you can pre-fill any potentially blank fields and thus remove any Errors. Parameters: ec - An instantiated ErrorCollection that is filled in with any error an array of DBObject s throws: ControllerException - if there's an error parsing the block or communicatingwith the underlying DBObject |
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 Single DBObject to fill out. Parameters: ec - An instantiated ErrorCollection that is filled in with any error an instatiated DBObject throws: ControllerException - if there's an error parsing the block or communicatingwith the underlying DBObject throws: IllegalArgumentException - if request, DBObjectNames, or ec is null |
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.
Parameters: request - the ControllerRequest object Parameters: fieldName - the name of the field to parse Parameters: dbobj - The DBObject for which we're going to put the field to Parameters: parameterName - The name of the http paramter to parse May be nullin which case, the funciton will by default use the fieldName as theparameter name. Parameters: ec - An instantiated ErrorCollection object that gets filled outby the function. an properly parsed String throws: ControllerException - if there's an error parsing the block or communicatingwith the underlying DBObject |
renderDBObjectField | public Input renderDBObjectField(ControllerResponse response, DataObject dbobj, String fieldName, String defaultValue, boolean readOnly) throws ControllerException(Code) | | Renders an Input in a update method per field name.
Parameters: response - a ControllerResponse Object Parameters: dbobj - A DBObject to transform into an Input Parameters: fieldName - the name of the field to render Parameters: defaultValue - the default value to use in the field Parameters: readOnly - true if the Input should be a read only input. an instantiated Input object |
|
|