telosys.objects
Class ScreenResponse

java.lang.Object
  extended bytelosys.objects.ScreenResponse

public class ScreenResponse
extends java.lang.Object

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" )
 string getDataFieldValue(string tag, string attr, boolean childTag)
          Return a tag field value
 ScreenException[] getExceptions()
          Returns an array of exceptions, or null if there's no exception in the response
 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
 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 content of the unique view ( for a service response )
 string getValue(string name)
          Return a single value of the response
 string getValues()
          Return all the values of the response in a single object
 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 hasView()
          Returns true if there's a least one view in the response
 boolean isOK()
          Returns true if the http response is OK ( readyState == 4 aa http status == 200 ) and if the telosys return code is "0" ( in the XML response )
 void show()
          Show the response in an alert message box
 void showValues()
          Show 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

ScreenResponse

protected ScreenResponse(object oXHR)
Creates a new ScreenResponse object

Parameters:
oXHR - : a reference on the XMLHttpRequest object used to send the request
Method Detail

isOK

public boolean isOK()
Returns true if the http response is OK ( readyState == 4 aa http status == 200 ) and if the telosys return code is "0" ( in the XML response )

Returns:

getResponseText

public string getResponseText()
Returns the reponse content as a string

Returns:

getResponseXML

public object getResponseXML()
Returns the reponse content as an XML tree ( DOM )

Returns:

getReadyState

public number getReadyState()
Returns the technical readyState value ( from XHR )

Returns:

getHttpStatusCode

public number getHttpStatusCode()
Returns the HTTP status code ( from the HTTP header, "200" if OK, ... )

Returns:

getHttpStatusText

public string getHttpStatusText()
Returns the HTTP status message ( from the HTTP header )

Returns:

getReturnCode

public string getReturnCode()
Returns the Telosys return code

Returns:

getReturnMessage

public string getReturnMessage()
Returns the Telosys return message

Returns:

dataNotFound

public 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" )

Returns:
: true if the flag "not-found" has been set (else false)

dataFound

public 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" )

Returns:
: true if the flag "found" has been set (else false)

dataVoid

public 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" )

Returns:

show

public void show()
Show the response in an alert message box


getXmlTagData

protected object getXmlTagData()
Returns the node object for the XML tag "data" ( XML node )

Returns:
: the node (or null)

getDataFieldValue

public string getDataFieldValue(string tag,
                                string attr,
                                boolean childTag)
Return a tag field value

Parameters:
tag - : the tag name ( the "element" name )
attr - : the attribute name
childTag - : if true returns the child tag content ( usefull for "LONG TEXT" )
Returns:

getMessages

public ScreenMessage[] getMessages()
Returns an array of messages, or null if there's no message in the response

Returns:

getExceptions

public ScreenException[] getExceptions()
Returns an array of exceptions, or null if there's no exception in the response

Returns:

getValue

public string getValue(string name)
Return a single value of the response

Parameters:
name - : the name of the value
Returns:
: the value for the given name ( or null )

getValues

public string getValues()
Return all the values of the response in a single object

Returns:
: the values object (or null)

showValues

public void showValues()
Show all the values in an alert message box


hasView

public boolean hasView()
Returns true if there's a least one view in the response

Returns:

getViewContent

public string getViewContent(string viewName)
Returns the content of the given view

Parameters:
viewName - : the name of the view
Returns:
: the content of the view (or null)

getServiceViewContent

public string getServiceViewContent()
Retuns content of the unique view ( for a service response )

Returns:
: the content of the view (or null)