Module AjaxStub :: Class AjaxStub
[show private | hide private]
[frames | no frames]

Type AjaxStub

      object --+    
               |    
AjaxStubDispatch --+
                   |
                  AjaxStub


Create a stub interface for JavaScript.
Method Summary
  __init__(self, type, methodClassInstance)
Call the constructor of the base class passing it the encoding type.
  getCGIMethod(self)
Return the default CGI method.
  getCGIValue(self, key)
Get the raw CGI value of the provided key.
  getMethodMaps(self)
Get a tuple of the function and method dictionaries.
  getStubMethodNameList(self)
Get a list of the registered functions and/or methods to be turned into JavaScript stubs.
  hasCGIKey(self, key)
Test if the CGI name exists.
  includeTraceback(self)
Enables the including of the traceback in the error result.
  register(self, *args)
Register the functions.
  setCGIMethod(self, method)
Set the CGI method to either 'GET' or 'POST'.
  unregister(self, name)
Remove the object mapped to by the method name from the StubContainer.
    Inherited from AjaxStubDispatch
  addContentType(self, typeMap)
Add new content types to the defaults. (Class method)
  dispatchJavascript(self)
Dispatch the JavaScript request code, of your choice, plus the stubs to standard out.
  initRequest(self)
Send the content type to the client.
  processClientRequest(self)
Print to standard out the results of the requested function or method call.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
str ARGUMENT = 'arg'
str COMMAND = 'cmd'
str GET = 'GET'
str POST = 'POST'
    Inherited from AjaxStubDispatch
str HTML = 'HTML'
str JSON = 'JSON'
str XML = 'XML'

Instance Method Details

__init__(self, type='HTML', methodClassInstance=None)
(Constructor)

  1. Call the constructor of the base class passing it the encoding type.
  2. Save to a private member object the instantiated class instance of the methods in the public API.
  3. Create the CGI FieldStorage instance.
  4. Set the default CGI method to 'GET'.
  5. Create the function map.
  6. Create the method map.
  7. Register the class methods.
Parameters:
type - The transport encoding type. (ie. HTML, JSON, XML)
methodClassInstance - The instance object of the class holding your public API.
Overrides:
AjaxStub.AjaxStubDispatch.__init__

getCGIMethod(self)

Return the default CGI method.
Returns:
The default CGI method.

getCGIValue(self, key)

Get the raw CGI value of the provided key.
Parameters:
key - The CGI name.
Returns:
The CGI value.

getMethodMaps(self)

Get a tuple of the function and method dictionaries.
Returns:
Tuple (method map, function map)

getStubMethodNameList(self)

Get a list of the registered functions and/or methods to be turned into JavaScript stubs.
Returns:
List of functions and/or methods.

hasCGIKey(self, key)

Test if the CGI name exists.
Parameters:
key - The CGI name.
Returns:
True if the name exists else False.

includeTraceback(self)

Enables the including of the traceback in the error result.

register(self, *args)

Register the functions.
Parameters:
args - List of function objects which can be tuples in the form of (object instance, cgiMethod) or just the method object.

setCGIMethod(self, method='GET')

Set the CGI method to either 'GET' or 'POST'.
Parameters:
method - The CGI method.

unregister(self, name)

Remove the object mapped to by the method name from the StubContainer.

NOTE: Only functions can be unregistered.
Parameters:
name - The name of the function to remove from the map.

Class Variable Details

ARGUMENT

Type:
str
Value:
'arg'                                                                  

COMMAND

Type:
str
Value:
'cmd'                                                                  

GET

Type:
str
Value:
'GET'                                                                  

POST

Type:
str
Value:
'POST'                                                                 

Generated by Epydoc 2.1 on Fri Aug 3 23:25:20 2007 http://epydoc.sf.net