I want to access numerous methods/functions on a zope server via Javascript. Zope has xml "built-in" right? So must I write my own XML output? For now, I wrap the existing functions like so: <?xml version="1.0" encoding="utf-8" ?> <ajaxresponse xmlns:tal="http://xml.zope.org/namespaces/tal" > <response type="object" id="clientDetails"> <client tal:repeat="row python:here.client_lookup(clientid=request.clientid)"> <fname tal:content="python:row.fname1">fname1</fname> <lname tal:content="python:row.lname1">lname1</lname> </client> </response> </ajaxresponse> I know i'm missing the obvious here so please, somebody, hit me over the head with it. Thanks.
--On 11. April 2006 14:29:24 -0700 Erik Myllymaki <erik.myllymaki@aviawest.com> wrote:
I want to access numerous methods/functions on a zope server via Javascript. Zope has xml "built-in" right? So must I write my own XML output?
JS is a *client-side* solution and has *nothing* to do with Zope. Of course you can use AJAX or any JS framework that speaks HTTP, XMLRPC to communicate with a Zope server using the supported protocols. -aj -- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: info@zopyx.com - Phone +49 - 7071 - 793376 E-Publishing, Python, Zope & Plone development and consulting
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Erik Myllymaki wrote:
I want to access numerous methods/functions on a zope server via Javascript. Zope has xml "built-in" right?
Zope is about publishing *Python objects*; any available XML support which is focused on that (e.g., you can export objects from the ZODB as XML pickles; you can render an object to XML using a ZopePageTemplate, etc.)
So must I write my own XML output?
If you call a Zope method over XMLRPC, and return Python primitives (lists, dicts, strings, ints, etc.), then Python's XMLRPC library will marshall those objects to the XMLRPC XML dialect for you. (BTW, the "X" in "AJAX"" was originally about =XMLRPC, not about arbitrary XML). Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFEPQu4+gerLs4ltQ4RAmnpAJ9icf/BHfyJWMeLuYPKI293PuawUgCeMRbQ Foojc58g6Vrm/XAu7iJzn9o= =9TCI -----END PGP SIGNATURE-----
participants (3)
-
Andreas Jung -
Erik Myllymaki -
Tres Seaver