Overview | File | Class | Tree | Index | Help
| The Gravey 2.5 Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class grvXMLreq

    Object
       |
       +--grvXMLreq

class grvXMLreq

Constructor for grvXMLreq "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.5
Author: Bruce Wallace (PolyGlotInc.com)
Defined in grvAJAX.js

Constructor Summary
`grvXMLreq ()`

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> optSuppressLaunchFlag )`
`void` | `launch()` method to launch "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

### grvXMLreq

    grvXMLreq()

Version: 2.5
Author: Bruce Wallace (PolyGlotInc.com)

Method Detail

### cbwrapper

    void cbwrapper()

callback wrapper method to relieve user callback from gory details of XMLHttpRequest state transition handling.

### getResponseText

    String getResponseText()

get text returned in the reply to "this" xml request

### getResponseXML

    Object getResponseXML()

get XML returned in the reply to "this" xml request

Returns:

XML DOM

### konstructor

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

Parameters:

`url` - the URL to request XML from (or XML file path in test mode)

`userCallbackFunction` - the callback to handle the XML when it arrives [note: The callback will have this grvXMLreq object passed to it via both "this", and, as a single function argument.]

`optPostData` - optional post data string (should be "undefined" if not a POST req.)

`optWaitFlag` - optional "wait for reply" flag (i.e. DONT do this async if true)

`optSuppressLaunchFlag` - optional "suppress launch" flag

Throws:

- ErrMsg if missing required parameter(s)

### launch

    void launch()

method to launch "this" request

### toString

    String toString()

method to return "this" as a human-readable string

### xform

    String xform( xslURL )

return the output from transforming the response XML with the XSL in the specified URL/filename

Throws:

- ErrMsg on fatal error

### xform2

    String xform2( xslDOM )

return the output from transforming the response XML with the XSL in the specified XSL DOM

Throws:

- ErrMsg on fatal error

Overview | File | Class | Tree | Index | Help
| The Gravey 2.5 Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Thu Jan 6 12:47:09 2011