The Gravey 2.0 Framework

Class XMLreq

Object
   |
   +--XMLreq

class XMLreq


Constructor for XMLreq "object" which encapsulates a REST-style request/reply transaction that returns XML or Text. This class makes multiple simultaneous requests possible, however, a separate instance of this class is required for each request. This constructor will automatically cause this request to be immediately launched unless launch is suppressed.

If post data is defined then this request is made via a POST (otherwise via a GET) HTTP request.

Any instance of this class can be created in "test mode" that reads XML directly from an XML file rather than making a POST/GET request for XML. This class has helper methods that will transform the response XML via an XSL document specified via filename or URL.
Version: 2.0

Author: Bruce Wallace (PolyGlotInc.com)
Defined in grvAJAX.js


Constructor Summary
XMLreq ()
           
 
Method Summary
 void cbwrapper()
           callback wrapper method to relieve user callback from gory details of XMLHttpRequest state transition handling.
 String getResponseText()
           get text returned in the reply to "this" xml request
 Object getResponseXML()
           get XML returned in the reply to "this" xml request
 void konstructor( <String> url, <Function> userCallbackFunction, <String> optPostData, <boolean> optWaitFlag, <boolean> optTestFlag, <boolean> optSuppressLaunchFlag )
          
 void launch()
           method to launch "this" request using the following logic;
 To send CGI variables using the GET request method, we have to
 hardcode the variables into the open URL parameter:
    this.open("GET", "/query.cgi?name=Bob&email=bob@example.com"); 
    this.send(null);
 To send CGI variables using the POST request method, we have to
 pass the variables to the send() method:
    this.open("POST", "/query.cgi");
    this.send("name=Bob&email=bob@example.com");
 Object newRequestObj()
           method to create new XMLHttpRequest object for "this" request
 String toString()
           method to return "this" as a human-readable string
 String xform( xslURL )
           return the output from transforming the response XML with the XSL in the specified URL/filename
 String xform2( xslDOM )
           return the output from transforming the response XML with the XSL in the specified XSL DOM

Constructor Detail

XMLreq

XMLreq()

Method Detail

cbwrapper

void cbwrapper()

getResponseText

String getResponseText()

getResponseXML

Object getResponseXML()

konstructor

void konstructor( <String> url, <Function> userCallbackFunction, <String> optPostData, <boolean> optWaitFlag, <boolean> optTestFlag, <boolean> optSuppressLaunchFlag )

launch

void launch()

newRequestObj

Object newRequestObj()

toString

String toString()

xform

String xform( xslURL )

xform2

String xform2( xslDOM )

The Gravey 2.0 Framework

Documentation generated by JSDoc on Sat Dec 8 21:51:44 2007