Zope3 Ext.Direct - Server-side Stack for ExtJS 3.
Project description
How do I use it ?
Let’s register api and views:
>>> from zope.configuration import xmlconfig >>> context = xmlconfig.string(""" ... <configure ... xmlns="http://namespaces.zope.org/zope" ... xmlns:extdirect="http://namespaces.zope.org/extdirect" ... > ... <include package="falkolab.ext3.direct" file="meta.zcml" /> ... ... <extdirect:api ... for="zope.app.folder.interfaces.IFolder" ... namespace = "my.app" ... /> ... ... <extdirect:view ... for="zope.app.folder.interfaces.IFolder" ... class="falkolab.ext3.direct.testing.AlbumList" ... permission="zope.ManageContent" ... name="albumlist" ... /> ... ... <extdirect:view ... for="zope.app.folder.interfaces.IFolder" ... class="falkolab.ext3.direct.testing.Contact" ... permission="zope.ManageContent" ... /> ... </configure> ... """)
Direct API:
>>> print http(r""" ... GET /@@directapi HTTP/1.1 ... Authorization: Basic bWdyOm1ncnB3 ... """) HTTP/1.1 200 Ok Cache-Control: no-cache Content-Length: ... Content-Type: text/javascript;charset=utf-8 Expires: ... Pragma: no-cache <BLANKLINE> Ext.namespace('my.app'); my.app.REMOTING_API={"url": "http://localhost/@@directrouter", "namespace": "my.app", "type": "remoting", "actions": {"Contact": [{"name": "getInfo", "len": 1}], "albumlist": [{"formHandler": true, "name": "add", "len": 0}, {"name": "getAll", "len": 0}]}};
Auto add provider :
>>> print http(r""" ... GET /@@directapi?add_provider HTTP/1.1 ... Authorization: Basic bWdyOm1ncnB3 ... """) HTTP/1.1 200 Ok Cache-Control: no-cache Content-Length: ... Content-Type: text/javascript;charset=utf-8 Expires: ... Pragma: no-cache <BLANKLINE> Ext.namespace('my.app'); my.app.REMOTING_API={"url": "http://localhost/@@directrouter", "namespace": "my.app", "type": "remoting", "actions": {"Contact": [{"name": "getInfo", "len": 1}], "albumlist": [{"formHandler": true, "name": "add", "len": 0}, {"name": "getAll", "len": 0}]}}; Ext.Direct.addProvider(my.app.REMOTING_API);
And Direct Request hanling (for addition see ROUTER.TXT):
>>> print http(r""" ... POST /@@directrouter HTTP/1.1 ... Authorization: Basic bWdyOm1ncnB3 ... Content-Length: 71 ... Content-Type: application/json; charset=UTF-8 ... Referer: http://localhost/ ... ... {"action":"albumlist","method":"getAll","data":[],"type":"rpc","tid":1}""") HTTP/1.1 200 Ok Content-Length: 89 Content-Type: text/javascript <BLANKLINE> {"action": "albumlist", "tid": 1, "type": "rpc", "method": "getAll", "result": [1, 2, 3]}
CHANGES
1.0.0a (2009-08-20)
Initial release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for falkolab.ext3.direct-1.0.0a-py2.6.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | b35695b5ed6b2ab65d452bdf468e6a4c0579f043769e36214e738c9bdaa04fad |
|
MD5 | a8377b617f3cfbcb34e91b791bf45c96 |
|
BLAKE2b-256 | 668ffc4fce7d82157d3eaf2bd688720050b93b2054fa9da1e592912553927472 |
Close
Hashes for falkolab.ext3.direct-1.0.0a-py2.5.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78b421c9c18e3b9b2214bd0efc7646bba402d943063f553267e815d6eb0ded75 |
|
MD5 | 693be271902a797bcb20d2fdea4c69bb |
|
BLAKE2b-256 | 23396922ad6b6c8713c51d4e799ff4da365d6015e3f662d5311623e374e52d9b |
Close
Hashes for falkolab.ext3.direct-1.0.0a-py2.4.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85d45ef98583118b73e003a2c7c147f2115055f3a2f7748c9c31d18f7412a2ef |
|
MD5 | 380c50f7e800366b825bfda43ba7e3f2 |
|
BLAKE2b-256 | d973009b89c161a1898a6876bf90bc0a1572416a0d781a3c0f67d7674806081e |