java.lang.Objectorg.objectweb.telosys.common.TelosysObject
org.objectweb.telosys.rpl.ScreenRequest
Request object for a Screen Action Request
It contains all informations sent by the client side,
the request is built by parsing the XML input flow.
Constructor Summary | |
ScreenRequest(javax.servlet.http.HttpServletRequest httpRequest)
Constructor |
Method Summary | |
void |
addView(ScreenRequestView v)
Adds a view to the request |
boolean |
elementsAttributeContains(java.lang.String sArgElementName)
Returns true if the "elements" attribute of the request contains the given element name |
java.lang.String |
getAction()
Returns the action attribute of the request |
ScreenDataElement |
getDataElement(java.lang.String sElementName)
Returns the element having the given name (or null if not found) If there's multiple elements with the same name, the first element found is returned. |
java.lang.Object |
getDataElementInstance(java.lang.String sElementName)
Returns the element object having the given name (or null if not found) If there's multiple elements with the same name, the first element found is returned. |
java.lang.Object |
getDataElementInstance(java.lang.String sElementName,
java.lang.Class clazz)
Returns the element object having the given name and an instance of the given class (or null if not found) If there's multiple elements with the same name, the first element found is returned. |
ScreenDataElements |
getDataElements()
Returns the Screen Data Elements held by the request NB : returns null if there's no DataElements in the request |
java.lang.String |
getElements()
Returns the "elements" attribute of the request |
java.lang.String[] |
getElementsArray()
Returns an array of elements name containing each element of the "elements" attribute |
boolean |
getFlagClearData()
Returns the status of the "clear" flag |
boolean |
getFlagGetData()
Returns the status of the "GET" flag |
boolean |
getFlagSetData()
Returns the status of the "SET" flag |
javax.servlet.http.HttpServletRequest |
getHttpRequest()
Returns the standard HTTP servlet request |
javax.servlet.http.HttpSession |
getHttpSession()
Returns the standard HTTP session or null if the Http Session doesn't exist It cannot returns null, unless the HttpSession has been invalidate by an external way |
java.lang.String |
getHttpSessionId()
Returns the ID of the standard HTTP session or null if the Http Session doesn't exist It cannot returns null, unless the HttpSession has been invalidate by an external way |
int |
getIntParameter(java.lang.String sParamName)
Deprecated. use getParamAsInt |
boolean |
getParamAsBoolean(java.lang.String paramName)
Returns the boolean value of the given parameter name. |
boolean |
getParamAsBoolean(java.lang.String paramName,
boolean defaultValue)
Returns the boolean value of the given parameter name. |
byte |
getParamAsByte(java.lang.String paramName)
Returns the byte value of the given parameter name. |
byte |
getParamAsByte(java.lang.String paramName,
byte defaultValue)
Returns the byte value of the given parameter name. |
char |
getParamAsChar(java.lang.String paramName)
Returns the char value of the given parameter name. |
char |
getParamAsChar(java.lang.String paramName,
char defaultValue)
Returns the char value of the given parameter name. |
java.util.Date |
getParamAsDate(java.lang.String paramName)
Returns the date/time/datetime value of the given parameter name. |
java.util.Date |
getParamAsDate(java.lang.String paramName,
java.util.Date defaultValue)
Returns the date/time/datetime value of the given parameter name. |
double |
getParamAsDouble(java.lang.String paramName)
Returns the double value of the given parameter name. |
double |
getParamAsDouble(java.lang.String paramName,
double defaultValue)
Returns the double value of the given parameter name. |
float |
getParamAsFloat(java.lang.String paramName)
Returns the float value of the given parameter name. |
float |
getParamAsFloat(java.lang.String paramName,
float defaultValue)
Returns the float value of the given parameter name. |
int |
getParamAsInt(java.lang.String paramName)
Returns the int value of the given parameter name. |
int |
getParamAsInt(java.lang.String paramName,
int defaultValue)
Returns the int value of the given parameter name. |
long |
getParamAsLong(java.lang.String paramName)
Returns the long value of the given parameter name. |
long |
getParamAsLong(java.lang.String paramName,
long defaultValue)
Returns the long value of the given parameter name. |
short |
getParamAsShort(java.lang.String paramName)
Returns the short value of the given parameter name. |
short |
getParamAsShort(java.lang.String paramName,
short defaultValue)
Returns the short value of the given parameter name. |
java.lang.String |
getParameter(java.lang.String sParamName)
Returns the value of the given parameter name, or NULL if not found |
java.lang.String |
getParameter(java.lang.String paramName,
java.lang.String defaultValue)
Returns the value of the given parameter name, or the default value if not found |
java.util.Map |
getParameterMap()
Returns the parameters as a Map instance |
ScreenRequestParameters |
getParameters()
|
java.lang.String |
getProcName()
Returns the procedure attribute of the request |
ScreenApplication |
getScreenApplication()
Returns the ScreenApplication object associated with the current web app or null if the ScreenApplication has not yet been created (opened) It cannot returns null, unless the ServletContext has been corrupted by an external way |
java.lang.String |
getScreenId()
|
java.lang.String |
getScreenName()
|
ScreenSession |
getScreenSession()
Returns the current ScreenSession associated with the request or null if the HttpSession doesn't exist or if it doesn't contain a ScreenSession attribute It cannot returns null, unless the HttpSession has been corrupted by an external way |
javax.servlet.ServletContext |
getServletContext()
Returns the standard web app ServletContext or null if the Http Session doesn't exist It cannot returns null, unless the HttpSession has been invalidate by an external way |
ScreenRequestView[] |
getViews()
Returns the "views" of the request, or null if none |
boolean |
hasElementsAttribute()
Returns true if the request has an "element" attribute |
boolean |
hasParameter()
Returns true if there's at least one parameter in the request |
boolean |
hasViews()
Returns true if the request has one or more "view" |
void |
setAction(java.lang.String action)
Set the action attribute of the request |
void |
setElements(java.lang.String v)
Set the "elements" attribute of the request |
void |
setFlagClearData(java.lang.String v)
Sets the status of the "clear" flag |
void |
setFlagGetData(java.lang.String v)
Sets the status of the "GET" flag |
void |
setFlagSetData(java.lang.String v)
Sets the status of the "SET" flag |
void |
setParameter(java.lang.String sParamName,
java.lang.String sParamValue)
Sets a parameter in the request |
void |
setProcName(java.lang.String procName)
Set the procedure attribute of the request |
void |
setScreenId(java.lang.String screenId)
|
void |
setScreenName(java.lang.String screenName)
|
void |
storeDataElement(java.lang.String sTagName,
java.lang.Object objData)
Adds a new element in the request elements list |
java.lang.String |
toString()
|
Methods inherited from class org.objectweb.telosys.common.TelosysObject |
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ScreenRequest(javax.servlet.http.HttpServletRequest httpRequest)
httpRequest
- Method Detail |
public javax.servlet.http.HttpServletRequest getHttpRequest()
public javax.servlet.http.HttpSession getHttpSession()
public java.lang.String getHttpSessionId()
public javax.servlet.ServletContext getServletContext()
public ScreenSession getScreenSession()
public ScreenApplication getScreenApplication()
public java.lang.String getAction()
public void setAction(java.lang.String action)
action
- the action to set.public java.lang.String getProcName()
public void setProcName(java.lang.String procName)
procName
- the name of the procedurepublic java.lang.String getScreenId()
public void setScreenId(java.lang.String screenId)
screenId
- the Screen Id to set.public void setScreenName(java.lang.String screenName)
screenName
- the Screen Name to set.public java.lang.String getScreenName()
public void setElements(java.lang.String v)
v
- public java.lang.String getElements()
public boolean hasElementsAttribute()
public java.lang.String[] getElementsArray()
public boolean elementsAttributeContains(java.lang.String sArgElementName)
sArgElementName
-
public void addView(ScreenRequestView v)
v
- public ScreenRequestView[] getViews()
public boolean hasViews()
public ScreenRequestParameters getParameters()
public java.util.Map getParameterMap()
getParameterMap
in interface IRequestParameters
public boolean getFlagSetData()
public void setFlagSetData(java.lang.String v)
v
- public boolean getFlagGetData()
public void setFlagGetData(java.lang.String v)
v
- public boolean getFlagClearData()
public void setFlagClearData(java.lang.String v)
v
- public void setParameter(java.lang.String sParamName, java.lang.String sParamValue)
sParamName
- parameter namesParamValue
- parameter valuepublic boolean hasParameter()
IRequestParameters
hasParameter
in interface IRequestParameters
public java.lang.String getParameter(java.lang.String sParamName)
IRequestParameters
getParameter
in interface IRequestParameters
sParamName
-
public java.lang.String getParameter(java.lang.String paramName, java.lang.String defaultValue)
IRequestParameters
getParameter
in interface IRequestParameters
paramName
- defaultValue
- : the default value used if the parameter is not found
public int getParamAsInt(java.lang.String paramName)
getParamAsInt
in interface IRequestParameters
paramName
-
TelosysRuntimeException
- if not found or invalidpublic int getParamAsInt(java.lang.String paramName, int defaultValue)
IRequestParameters
getParamAsInt
in interface IRequestParameters
paramName
- defaultValue
-
public long getParamAsLong(java.lang.String paramName)
getParamAsLong
in interface IRequestParameters
paramName
-
TelosysRuntimeException
- if not found or invalidpublic long getParamAsLong(java.lang.String paramName, long defaultValue)
IRequestParameters
getParamAsLong
in interface IRequestParameters
paramName
- defaultValue
-
public short getParamAsShort(java.lang.String paramName)
getParamAsShort
in interface IRequestParameters
paramName
-
TelosysRuntimeException
- if not found or invalidpublic short getParamAsShort(java.lang.String paramName, short defaultValue)
IRequestParameters
getParamAsShort
in interface IRequestParameters
paramName
- defaultValue
-
public float getParamAsFloat(java.lang.String paramName)
getParamAsFloat
in interface IRequestParameters
paramName
-
TelosysRuntimeException
- if not found or invalidpublic float getParamAsFloat(java.lang.String paramName, float defaultValue)
IRequestParameters
getParamAsFloat
in interface IRequestParameters
paramName
- defaultValue
-
public double getParamAsDouble(java.lang.String paramName)
getParamAsDouble
in interface IRequestParameters
paramName
-
TelosysRuntimeException
- if not found or invalidpublic double getParamAsDouble(java.lang.String paramName, double defaultValue)
IRequestParameters
getParamAsDouble
in interface IRequestParameters
paramName
- defaultValue
-
public byte getParamAsByte(java.lang.String paramName)
IRequestParameters
getParamAsByte
in interface IRequestParameters
paramName
-
public byte getParamAsByte(java.lang.String paramName, byte defaultValue)
IRequestParameters
getParamAsByte
in interface IRequestParameters
paramName
- defaultValue
-
public char getParamAsChar(java.lang.String paramName)
IRequestParameters
getParamAsChar
in interface IRequestParameters
paramName
-
public char getParamAsChar(java.lang.String paramName, char defaultValue)
IRequestParameters
getParamAsChar
in interface IRequestParameters
paramName
- defaultValue
-
public boolean getParamAsBoolean(java.lang.String paramName)
IRequestParameters
getParamAsBoolean
in interface IRequestParameters
paramName
-
public boolean getParamAsBoolean(java.lang.String paramName, boolean defaultValue)
IRequestParameters
getParamAsBoolean
in interface IRequestParameters
paramName
- defaultValue
-
public java.util.Date getParamAsDate(java.lang.String paramName)
IRequestParameters
getParamAsDate
in interface IRequestParameters
paramName
-
public java.util.Date getParamAsDate(java.lang.String paramName, java.util.Date defaultValue)
IRequestParameters
getParamAsDate
in interface IRequestParameters
paramName
- defaultValue
-
public int getIntParameter(java.lang.String sParamName) throws TelosysException
sParamName
-
TelosysException
public ScreenDataElements getDataElements()
public ScreenDataElement getDataElement(java.lang.String sElementName)
sElementName
-
public java.lang.Object getDataElementInstance(java.lang.String sElementName)
sElementName
-
public java.lang.Object getDataElementInstance(java.lang.String sElementName, java.lang.Class clazz)
sElementName
- clazz
- if null the type of the object is not checked
public void storeDataElement(java.lang.String sTagName, java.lang.Object objData)
sTagName
- objData
- public java.lang.String toString()