java.lang.Objecttelosys.objects.ScreenResponse
ScreenResponse object
The request response for "ScreenActions" and "ScreenService"
Constructor Summary | |
protected |
ScreenResponse(object oXHR)
Creates a new ScreenResponse object |
Method Summary | |
boolean |
dataFound()
Return true if the tag "found" is present in the response This flag is automaticaly set by the action "load" ( "found" or "not-found" ) |
boolean |
dataNotFound()
Return true if the tag "not-found" is present in the response This flag is automaticaly set by the action "load" ( "found" or "not-found" ) |
boolean |
dataVoid()
Returns true if there's no data element in the response ( when the tag "data" is void and has an attribute void="true" ) |
object |
getActionInfos()
Returns an object holding the following attributes : . screenName . screenId . action . procName |
string |
getDataFieldValue(string tag,
string attr,
boolean childTag)
Return a tag field value |
ScreenError[] |
getErrors()
Returns an array of ScreenError objects |
string |
getErrorsAsText()
Returns a string containing all the "errors" |
ScreenException[] |
getExceptions()
Returns an array of exceptions, or null if there's no exception in the response |
string |
getExceptionsAsText()
Returns a string containing all the "exceptions" |
number |
getHttpStatusCode()
Returns the HTTP status code ( from the HTTP header, "200" if OK, ... ) |
string |
getHttpStatusText()
Returns the HTTP status message ( from the HTTP header ) |
ScreenMessage[] |
getMessages()
Returns an array of messages, or null if there's no message in the response |
object[] |
getOutputErrors()
Returns an array of objects, or null if there's no "output errors" in the response Each object holds the following attributes : . view ( for a "view-error" only ) . renderer ( for a "view-error" only ) . dataName ( for a "data-error" only ) . dataClass ( for a "data-error" only ) . exception . message |
string |
getOutputErrorsAsText()
Returns a string containing all the "output errors" |
number |
getReadyState()
Returns the technical readyState value ( from XHR ) |
string |
getResponseText()
Returns the reponse content as a string |
object |
getResponseXML()
Returns the reponse content as an XML tree ( DOM ) |
string |
getReturnCode()
Returns the Telosys return code |
string |
getReturnMessage()
Returns the Telosys return message |
string |
getServiceViewContent()
Retuns the content of the unique view ( usable only with a "service response" ) |
string |
getValue(string name)
Return a single value of the response |
object |
getValues()
Return all the values of the response in a single object The object returned can be used as a Map ( value = obj[key] ) |
string |
getViewContent(string viewName)
Returns the content of the given view |
protected object |
getXmlTagData()
Returns the node object for the XML tag "data" ( XML node ) |
boolean |
hasErrors()
Returns a boolean indicating if there's errors in the response |
boolean |
hasExceptions()
Returns a boolean indicating if there's exceptions in the response |
boolean |
hasMessages()
Returns a boolean indicating if there's messages in the response |
boolean |
hasOutputErrors()
Returns a boolean indicating if there's "output errors" in the response Output errors occurs when the server-side tries to generate the response output : . during a view generation ( with a renderer ) . during a data generation ( with an XML mapper ) |
boolean |
hasValues()
Returns a boolean indicating if there's values in the response |
boolean |
hasView()
Returns true if there's a least one view in the response |
boolean |
isOK()
Returns true if the HTTP/AJAX response is OK ( readyState == 4 and http status == 200 ) and if the telosys return code is "0" ( in the XML response ) |
boolean |
reportsErrors()
Returns a boolean indicating if the response reports any kind of error Returns true in the following cases : . an HTTP or AJAX error has occurred . the return code is not "0" . there's an "error" in the response . there's an "exception" in the response . there's an "output error" in the response Returns false only if everything is OK |
void |
show()
Show the response in an alert message box |
void |
showAllErrors()
Shows all the errors (http, return code, errors, exceptions, output errors ) in an alert message box |
void |
showOutputErrors()
Shows all the "output errors" in an alert message box |
void |
showValues()
Shows all the values in an alert message box |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected ScreenResponse(object oXHR)
oXHR
- : a reference on the XMLHttpRequest object used to send the requestMethod Detail |
public boolean isOK()
public string getResponseText()
public object getResponseXML()
public number getReadyState()
public number getHttpStatusCode()
public string getHttpStatusText()
public string getReturnCode()
public string getReturnMessage()
public boolean dataNotFound()
public boolean dataFound()
public boolean dataVoid()
public void show()
protected object getXmlTagData()
public string getDataFieldValue(string tag, string attr, boolean childTag)
tag
- : the tag name ( the "element" name )attr
- : the attribute namechildTag
- : if true returns the child tag content ( usefull for "LONG TEXT" )
public ScreenMessage[] getMessages()
public ScreenException[] getExceptions()
public string getValue(string name)
name
- : the name of the value
public object getValues()
public void showValues()
public boolean hasView()
public string getViewContent(string viewName)
viewName
- : the name of the view
public string getServiceViewContent()
public object getActionInfos()
public boolean hasValues()
public boolean hasErrors()
public ScreenError[] getErrors()
public string getErrorsAsText()
public boolean hasExceptions()
public string getExceptionsAsText()
public boolean hasMessages()
public boolean hasOutputErrors()
public object[] getOutputErrors()
public string getOutputErrorsAsText()
public void showOutputErrors()
public boolean reportsErrors()
public void showAllErrors()