Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install falkolab.ext3.direct

How to install falkolab.ext3.direct

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install falkolab.ext3.direct
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.1.0 Available View build log
Windows (64-bit)
1.1.0 Available View build log
Mac OS X (10.5+)
1.1.0 Available View build log
Linux (32-bit)
1.1.0 Available View build log
Linux (64-bit)
1.1.0 Available View build log
Web
 
License
ZPL 2.1
Lastest release
version 1.1.0 on Sep 27th, 2011

Zope3 Ext.Direct - Server-side Stack for ExtJS 3.

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.1.0 (2010-12-23)
  • Changes to support python 2.6
1.0.1 (2010-11-10)
  • Removed the dependencies on zope.app.intid
  • Changes to support zope.componetnt>=3.6.0
  • Added skipkeys=True for simplejson encoder to prevent raising a TypeError
1.0.0a (2009-08-20)
  • Initial release.

Subscribe to package updates

Last updated Sep 27th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.