Package Products :: Package ZenUtils :: Package extdirect :: Module router :: Class DirectProviderDefinition |
[hide private]
[frames] | no frames]

# Class DirectProviderDefinition

source code

    object --+
             |
            DirectProviderDefinition

Turns a DirectRouter subclass into JavaScript object representing the config of the client-side API.

Inspects the given subclass and retrieves the names of all public methods, then defines those as actions on the Ext.Direct provider, and creates the JS that adds the provider.

See http://www.sencha.com/products/extjs/extdirect for a full explanation of protocols and features of Ext.Direct.

Instance Methods | [hide private]
__init__(self, routercls, url, timeout, ns=None) | source code
_gen_public_methods(self) | source code
_gen_method_infos(self, strategy) | source code
_extdirect_config(self) | source code
_jsonapi_config(self) | source code
render(self) Generate and return an Ext.Direct provider definition, wrapped in a <script> tag and ready for inclusion in an HTML document. | source code
render_jsonapi(self) Generate an Ext.Direct provider definition for the python client | source code

Method Details | [hide private]

### __init__(self, routercls, url, timeout, ns=None) (Constructor) | source code
Parameters: `routercls` (class) - A DirectRouter subclass `url` (str) - The url at which `routercls` is available `ns` - The client-side namespace in which the provider should live. The provider will be available at [ns].[routercls.__name__]. For example, if ns is 'Zenoss.remote' and routercls is named 'EventConsole', client-side code would call `Zenoss.remote.EventConsole.my_method(params, callback)`. Overrides: object.__init__