|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.controller.ControllerRequest
ControllerRequest is a simple "wrapper" object that holds the parameters and data required
for a controller to be able to transition to a new state.
Developer Notes Because this class can be cloned, please make sure that
you add any fields to this class to the clone function.
| Constructor Summary | |
ControllerRequest()
Default Constructor. |
|
| Method Summary | |
Object |
clone()
Returns a clone of this object. |
Object |
getAttrib(String attrib)
get the named attribute of this Controller |
String |
getAttribute(String attrib)
Deprecated. v5.5, 4/2004; use getAttrib() instead, and cast to string |
Map |
getAttributes()
Get the attributes Map |
String |
getDataContext()
Return the name of the database connection we use - or null for the default connection |
String |
getDBName()
Deprecated. 10/2004 v.5.6 use getDataContext instead |
ErrorCollection |
getErrorCollection()
Returns the Error collection that exists in the current session. |
String |
getFileName(String paramName)
If a particular parameter represents an uploaded file (which can be determined by the isFileParameter(String) method) then this method retrieves the server-side file name - e.g. the location that has the data that was uploaded stored in it. |
String |
getFormAttribute()
|
String |
getInitParameter(String paramName)
Retrieve the initialization parameter |
Locale |
getLocale()
Returns the locale of this request. |
Object |
getObjectParameter(String paramName)
|
String |
getParameter(String paramCode)
Fetch the value for the given parameter. |
Hashtable |
getParameters()
Return the complete hashtable of parameters all keyed by parameter names |
PersistentSession |
getSession()
Returns the Persistant Session Wrapper object to store requests between environments. |
int |
getUid()
Get the user id as an integer |
String |
getUser()
Get the user name |
User |
getUserInfo()
get requesting user |
boolean |
isFileParameter(String paramName)
Does a specified parameter refer to an uploaded file? |
boolean |
isParameter(String paramName)
Checks if the described parameter is a defined parameter for this request |
void |
populate(DBObject myDBObj)
Convenience method to populate a dbobject from the parameters supplied, by looking for parameters with the same name as the field name in the db object |
void |
removeAttrib(String key)
remove the attribute |
void |
removeParameter(String paramName)
Remove a parameter from this controller request. |
void |
setAttrib(String attrib,
Object val)
Set the named attribute to the given value |
void |
setAttribute(String attrib,
String val)
Deprecated. v5.5, 4/2004; use setAttrib() instead |
void |
setAttributes(Map attributes)
Set the attributes Map to the supplied Map |
void |
setDataContext(String newDBName)
Set this DB Controller to operate on a database other than the default |
void |
setDBName(String newDBName)
Set this DB Controller to operate on a database other than the default |
void |
setFileParameter(String paramName,
String paramValue,
String fileName)
|
void |
setFormAttribute(String newAttribute)
|
void |
setInitParameter(String paramName,
String paramValue)
Our caller can pass us initialization parameters. |
void |
setLocale(Locale newLocale)
Sets the Locale of this request |
void |
setObjectParameter(String paramName,
Object paramValue)
Set a parameter as an object |
void |
setParameter(String paramName,
String paramValue)
|
void |
setParameters(Hashtable h)
Set the parameters for this request. |
void |
setSession(PersistentSession newSession)
Provide the controller with a PersitentSession object, which it can use to hold values between invokations. |
void |
setUid(int newUid)
Sets the current integer user id. |
void |
setUser(String newUser)
The client of the controller must tell us who is accessing us, and we decide if they're allowed to access the given state. |
void |
validateDBField(String dbFieldName,
DBObject oneObject,
ErrorCollection ec)
Convenience method that retrieves the validates against that one database object field. |
void |
validateDBObject(DBObject oneObject,
ErrorCollection ec)
Convenience method that retrieves parameters/field values and populates a specified db object. |
void |
validateField(String dbFieldName,
String reqFieldName,
DBObject oneObject,
ErrorCollection ec)
Convenience method that retrieves the validates against that one database object field. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ControllerRequest()
| Method Detail |
public void setFileParameter(String paramName,
String paramValue,
String fileName)
throws ControllerException
ControllerExceptionpublic String getFileName(String paramName)
paramName - the name of the paramter to get the filename for.
public void setAttribute(String attrib,
String val)
attrib - The name of an "attribtue" for this ControllerElement itemval - The value for this attribute
public void setAttrib(String attrib,
Object val)
attrib - The name of an "attribtue" for this ControllerElement itemval - The value for this attributepublic String getAttribute(String attrib)
attrib - The name of an "attribute" for this ControllerElement item
public Object getAttrib(String attrib)
attrib - The name of an "attribute" for this ControllerElement item
public Map getAttributes()
public void setAttributes(Map attributes)
attributes - a Map of attribute valuespublic void removeAttrib(String key)
key - the name of the attribute to remove
public void setInitParameter(String paramName,
String paramValue)
paramName - the name of the parameterparamValue - the value of the parameter
public void setParameter(String paramName,
String paramValue)
throws ControllerException
paramName - The name of the parameterparamValue - The value of the parameter
ControllerException - upon error
public void setObjectParameter(String paramName,
Object paramValue)
throws ControllerException
paramName - The name of the parameterparamValue - The value object
ControllerException - upon error
public Object getObjectParameter(String paramName)
throws ControllerException
paramName - The name of the parameter to retrieve
ControllerException - if unable to get the object parameterspublic void setParameters(Hashtable h)
h - The hashtable for the bulk copies.public void setUser(String newUser)
newUser - The user's string id to set this user to.public void setUid(int newUid)
newUid - - the user ID integer to set this request to.
public void setSession(PersistentSession newSession)
throws ControllerException
newSession - A PersistentSession object
ControllerException
public PersistentSession getSession()
throws ControllerException
ControllerException - upon errorpublic String getInitParameter(String paramName)
paramName - the name of the parameter to retrieve
public String getUser()
public int getUid()
getUid in interface RequestContextpublic Hashtable getParameters()
public String getParameter(String paramCode)
paramCode - Code of the parameter desired
public boolean isFileParameter(String paramName)
paramName - the name of the parameter to check if it is a file
public String getDBName()
getDBName in interface RequestContextpublic String getDataContext()
public void setDBName(String newDBName)
newDBName - The dbcontext to set this request to.public void setDataContext(String newDBName)
newDBName - The dbcontext to set this request to.
public void populate(DBObject myDBObj)
throws ControllerException
myDBObj - the dbobject to populate
ControllerException - upon error
public ErrorCollection getErrorCollection()
throws ControllerException
ControllerException - if there is an error getting the Session objectpublic void setFormAttribute(String newAttribute)
public String getFormAttribute()
public boolean isParameter(String paramName)
paramName - the parameter to check against.
public void validateDBObject(DBObject oneObject,
ErrorCollection ec)
throws ControllerException,
ValidationException
oneObject - the object to validateec - The error collection that gets filled out.
ControllerException - upon internal or data error
ValidationException - if there is an error validating the object
public void validateDBField(String dbFieldName,
DBObject oneObject,
ErrorCollection ec)
throws ControllerException,
DBException
dbFieldName - the name of the field to validateoneObject - the DBOBject to validateec - The ErrorCollection to fill out if there is an error
DBException - upon data error
ControllerException - upon internal error
public void validateField(String dbFieldName,
String reqFieldName,
DBObject oneObject,
ErrorCollection ec)
throws ControllerException,
DBException
dbFieldName - the name of the field to validatereqFieldName - ???oneObject - the DBOBject to validateec - The ErrorCollection to fill out if there is an error
DBException - upon data error
ControllerException - upon internal errorpublic void setLocale(Locale newLocale)
newLocale - the new Locale to set this request to.public Locale getLocale()
getLocale in interface RequestContextpublic Object clone()
public void removeParameter(String paramName)
paramName - the name of the parameter to remove
public User getUserInfo()
throws DBException
DBException
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||