{ "info": { "author": "Jim Washington and contributors", "author_email": "jwashin@users.sourceforge.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Buildout", "Framework :: Zope3", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "License :: OSI Approved :: Zope Public License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "****************\nzif.jsonserver\n****************\n\nSee 'src/zif/jsonserver/README.txt' for more information.\n\n\nReleases\n********\n\n================\n0.6 (2007/05/25)\n================\n\nUpdated release notes.\n\n\n================\n0.5 (2007/05/25)\n================\n\nCorrections to setup.\n\n\n================\n0.4 (2007/05/25)\n================\n\nIncorporated jsolait into release.\n\n\n================\n0.3 (2007/05/24)\n================\n\nRepackaging to ensure zcml files are included for zope 3.\n\n\n================\n0.2 (2007/04/18)\n================\n\nCorrected setup configuration file to include zif namespace.\n\n\n================\n0.1 (2007/04/13)\n================\n\nInitial release.\n\n\nDetailed Documentation\n**********************\n\n==============\nzif.jsonserver\n==============\n\n\nJSON is javascript object notation. JSON-RPC performs the same service\nas XML-RPC, except the transport is javascript objects instead of XML.\n\njsonserver Project:\n\nThis project provides the additional functionality of listening and responding\nproperly to requests of type \"application/json-rpc\".\n\n\nDependencies\n------------\n\nThis package will work with Zope 3 version 3.3 or greater. The svn version of \njsonserver tries hard to keep up with Zope 3's development version available at \nsvn://svn.zope.org/repos/main/Zope3/trunk.\n\njsolait from http://jsolait.net is the recommended client-side javascript\nlibrary. Installation of jsolait is covered in the README.txt file in this\npackage's jsolait folder.\n\n\nInstallation\n------------\n\nInstall this package in a location accessible to your zope3 instance. The\nlib/python folder of the instance is a good choice.\n\nThe files in the etc folder should go into etc/package-includes.\n\nA README.txt file in the jsolait folder has instructions for installing\na client javascript library.\n\n\nUsage\n-----\n\nSimilar to xmlrpc usage.\n\njsonserver looks for content-type \"application/json-rpc\", and handles those \nrequests as JSON-RPC. Other http requests are not affected and will \npresumably work as expected. Now that there is an official mime-type for JSON,\njsonserver also supports \"application/json\". \"application/json-rpc\" \nmay be considered deprecated.\n\njsonrpc provides another namespace,\n'http://namespaces.zope.org/jsonrpc' for zcml configuration.\nStatements like\n\n::\n\n \n\nare used in zcml to make jsonrpc methods viewable.\n\nYou may create views that appear only if a jsonrpc listener is installed:\n\n::\n\n \n \n \n\nTo make a view class, subclass\nzif.jsonserver.jsonrpc.MethodPublisher like this:\n\n::\n\n from zif.jsonserver import MethodPublisher\n class MyClass(MethodPublisher):\n def myOutput(self):\n blah = 'something cool'\n return blah\n def myOutput1(self,param1):\n blecht = self.context.something(param1)\n return blecht\n\nwhere the return value can be a python simple object\n(int, long, float, string, etc.) or list or dictionary composed of\nsimple objects, lists, and/or dictionaries. Composite built-ins\nlike complex numbers, dates, or classes are not currently\nsupported. Decompose those, and send a list or dictionary instead.\nMultiple returned values will be marshalled into a list.\n\nFor web pages, you will need to include a javascript library for the client side\nin your page template:\n\n::\n\n \n\nwill bring in the recommended jsolait library, if it is installed here. The following javascript examples\nare for jsolait, but any similar javascript library may be used, or you can write your own. The \nxmlHTTPRequest POST must set a content-type of \"application/json-rpc\" for this package to invoke\njson-rpc requests on the server.\n\nFrom your client javascript code, import the jsonrpc module:\n\n::\n\n var jsonrpc = imprt('jsonrpc');\n\nThen, make a jsolait connection proxy (\".\" often works fine for addr):\n\n::\n\n addr=\"address to server object providing jsonrpc view class\";\n //for better error handling, see http://jsolait.net/wiki/documentation\n try{var aServer = new jsonrpc.ServiceProxy(addr, [\"myOutput\"]);\n }catch(e){alert(e);}\n\nthen, for async communication, provide a callback function:\n\n::\n\n function doThis(resp,err){\n if (!err) {do something with resp} else {do something with err}\n }\n\nand call the method:\n\n::\n\n aServer.myOutput(aparam,doThis);\n\nIf you want sync communication, call the method without\nthe name of a function as the last parameter.\n\nFor communication other than in a web browser (javascript), minjson.py\nor other json implementations have functions for reading and writing\nJSON objects.\n\nThe text of a JSON-RPC request (v1.0) looks like:\n\n::\n\n {\"id\":jsonid,\"method\":remotemethod,\"params\":methodparams}\n\nwhere\n\n- jsonid is a string or number that may identify this specific request\n\n- remotemethod is the method to call on the server\n\n- methodparams is a list (javascript Array) of parameters to the method\n\nThe text of a JSON-RPC response looks like:\n\n::\n\n {\"id\":jsonid,\"result\":returnedresult,\"error\":returnederr}\n\nwhere\n\n- jsonid is the same jsonid as sent in the request\n\n- returnedresult is a javascript representation of the result or null\n\n- returnederr is a javascript representation of an error state\n\nEither returnedresult or returnederr will be the javascript null value.\n\nActual implementation using e.g., urllib is left as an exercise for the\nreader. Hint: Use the minjson.write(object) and minjson.read(string)\nmethods for conversion before and after transport.\n\n\nDojo\n----\n\nJSON-RPC in Dojo should work out-of-the-box with jsonserver, since it provides a\ncontent-type supported by jsonserver. A preliminary package that serves a \nper-object \".smd\" file is available at dojosupport.\n\nDojo is available at \"http://dojotoolkit.org\":http://dojotoolkit.org .\n\n\nSimple JSON / Non-POST Views\n----------------------------\n\nJSON Views accessible to HTTP GET are also provided with zif.jsonserver.\nSee \"JSONViews\":/jsonviews_README.html .\n\n\nPage Templates, Form Variables, and Named Parameters\n----------------------------------------------------\n\njsonserver will work with page templates and similar\nsnippets of HTML. Most registered views (browser:page or similar)\nare also accessible to json-rpc clients. The simplest way to use a \npage template is to call it in javascript just as you would call a \njsonrpc:view. jsonserver sets a request variable, JSONRPC_MODE, \nwhich will be True if a template is requested through json-rpc. \nThis may be useful if you need json-rpc-specific behavior.\n\nIf you need form data, jsonserver has a special facility for this. The\ncontents of any client object (dict) passed as a parameter to json-rpc \nthat is (cleverly) named \"pythonKwMaRkEr\" will be available in the request \nas items in request.form. If you call methods with named parameters, \nthose items also will replace the named parameters as appropriate.\n\nA pythonkw module is provided here for use with jsolait on the client side. \nCode like\n\n::\n\n var pythonkw = imprt(\"pythonkw\");\n var kwparams = new pythonkw.PythonKw({'parm1': 'aaa', 'parm2': text_value})\n var result = aServer.my_portlet(kwparams);\n\nwill do the marshalling so you do not have to type \"pythonKwMaRkEr\".\n\nHere is an example of using a page template through a\njsonrpc:view method (ViewPageTemplateFile is in zope.app.pagetemplate)\n\n::\n\n def my_portlet(self,parm1='bbb',parm2=None):\n date = datetime.now()\n rand = random.randint(0,2000)\n portlet = ViewPageTemplateFile(\"my_portlet.pt\")\n return portlet(self,date=date,random=rand,parm1=parm1)\n\nIn the above example, parm1 is available to the template as options/parm1\nand as request/form/parm1. parm2 may be available to the template as \nrequest/form/parm2 if provided in the request.\n\n\nDebugging\n---------\n\nTo get verbose output of requests, responses, and errors,\nset level DEBUG for your event log in etc/zope.conf for your\ninstance. e.g.,\n\n::\n\n \n level DEBUG\n \n path $LOGDIR/z3.log\n \n \n path STDOUT\n \n \n\nYou can get pretty much the same results with tcpwatch, except you get the \nentire request and response with tcpwatch.\n\nCompatibility\n-------------\n\nMost compatibility issues should be about client implementations. \n\njsonserver will accept any valid JSON-RPC request that is a POST with \ncontent-type \"application/json-rpc\" or \"application/json\". Output responses will be of \ncontent-type \"application/x-javascript\" so that browser clients can know\nthat the response will be interpreted in javascript.\n\njsolait should work on any current browser with enabled javascript and\na functioning xmlHTTPRequest POST implementation. This includes most\ngecko browsers (Firefox, Mozilla, and Netscape 6.1+), khtml browsers (Safari and\nkonqueror), recent IEs, and Opera 8.1+. If it will do Google maps, it probably\nwill do jsolait.\n\n\nUnicode Support\n---------------\n\njsonserver supports unicode properly now, I think, (maybe?). If you have a \nproject that depends on unicode, let me know if this does anything unexpected.\n\nDownload\n**********************", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://zif.svn.sourceforge.net/viewvc/zif/zif.jsonserver", "keywords": "jsonserver json zope3", "license": "ZPL2.1 and LGPL", "maintainer": null, "maintainer_email": null, "name": "zif.jsonserver", "package_url": "https://pypi.org/project/zif.jsonserver/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/zif.jsonserver/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://zif.svn.sourceforge.net/viewvc/zif/zif.jsonserver" }, "release_url": "https://pypi.org/project/zif.jsonserver/0.6/", "requires_dist": null, "requires_python": null, "summary": "A json server for zope 3.", "version": "0.6" }, "last_serial": 802288, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "cecaf3e141d8370ab2b2f9d8ccfdcde1", "sha256": "f4e9828dec8102bc8c4e2ce0458741a9989d02ada6a81c84edc3509a868bf0be" }, "downloads": -1, "filename": "zif.jsonserver-0.1-py2.4.egg", "has_sig": false, "md5_digest": "cecaf3e141d8370ab2b2f9d8ccfdcde1", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 68547, "upload_time": "2007-04-14T02:06:03", "url": "https://files.pythonhosted.org/packages/41/2c/423b1e269372b9dd3b37e26fa1b7063bb329a57463f8acd58418973cbe91/zif.jsonserver-0.1-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "aedc2851cf22d3b7af82e8b7e0c6b16f", "sha256": "37bba10d450a0afb38329ace0535c366841b77f32a3ac6c5d23a1ff230723379" }, "downloads": -1, "filename": "zif.jsonserver-0.1.tar.gz", "has_sig": false, "md5_digest": "aedc2851cf22d3b7af82e8b7e0c6b16f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27679, "upload_time": "2007-04-14T02:06:04", "url": "https://files.pythonhosted.org/packages/65/2b/7c6ebd309433bf40f4c92cdd4966532dee0e893b3bf29905575e8fe31a60/zif.jsonserver-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "25bc9ad366268f97c29eb247c8c98f81", "sha256": "0995035590c50be5a262c6f559a2350c7384efb69c4ec44655c0c7d696685451" }, "downloads": -1, "filename": "zif.jsonserver-0.2-py2.4.egg", "has_sig": false, "md5_digest": "25bc9ad366268f97c29eb247c8c98f81", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 68581, "upload_time": "2007-04-18T13:18:01", "url": "https://files.pythonhosted.org/packages/b3/52/9c38b347ec8b7e04da8e8f990d964812c2926ef6c94c1c18c22bc9233ff1/zif.jsonserver-0.2-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "8850813a7863af127b3248848594505e", "sha256": "b2d4567e7cb104d4360c8818e7dfea21845d3fdcf80d64e3aa8864152ce1e290" }, "downloads": -1, "filename": "zif.jsonserver-0.2.tar.gz", "has_sig": false, "md5_digest": "8850813a7863af127b3248848594505e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27752, "upload_time": "2007-04-18T13:18:02", "url": "https://files.pythonhosted.org/packages/71/86/11aa057e2f3fee734320a6e8af86f63cde884690b416dccd787dca3f9ba3/zif.jsonserver-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "84555714e295317f05661cc139c53869", "sha256": "cbbe6f303c4212d56e4b56f0112ece2c66b79ffcc1c087e9ac2797b9fa45dd9c" }, "downloads": -1, "filename": "zif.jsonserver-0.3-py2.4.egg", "has_sig": false, "md5_digest": "84555714e295317f05661cc139c53869", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 86246, "upload_time": "2007-05-25T12:40:55", "url": "https://files.pythonhosted.org/packages/4a/d7/6cc594e46d76fa621a80bec7e4a59ddbe31928210ef699e65f3925d7843d/zif.jsonserver-0.3-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "78860882120afcec919e4ce653491894", "sha256": "5126ba2f87915d79dfb347707269a340201f33418a3291b9b51c9223657a6795" }, "downloads": -1, "filename": "zif.jsonserver-0.3.tar.gz", "has_sig": false, "md5_digest": "78860882120afcec919e4ce653491894", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38939, "upload_time": "2007-05-25T12:40:56", "url": "https://files.pythonhosted.org/packages/6a/0e/d019e30c26e873e915f5128332c44f552480c503747787155de59ae84442/zif.jsonserver-0.3.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "7115eb92f2335ae21d3faf1bdca7af74", "sha256": "408c019f2d1d073f9a4fadc1815210cb42391def0551399de62cd995e08b7f28" }, "downloads": -1, "filename": "zif.jsonserver-0.6-py2.4.egg", "has_sig": false, "md5_digest": "7115eb92f2335ae21d3faf1bdca7af74", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 127240, "upload_time": "2007-05-25T20:55:36", "url": "https://files.pythonhosted.org/packages/01/ed/906d0146e20ce7d5a7f2a4acfad64e3e3f5dae62f8d6b8becb9c8092954c/zif.jsonserver-0.6-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "5b7ed728e4312f4446dcb96df43da982", "sha256": "44400e581a4abb23c6e8b344bfa178d0cb12f9c1f99951829a7e66886f1ab9a1" }, "downloads": -1, "filename": "zif.jsonserver-0.6.tar.gz", "has_sig": false, "md5_digest": "5b7ed728e4312f4446dcb96df43da982", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 72231, "upload_time": "2007-05-25T20:55:37", "url": "https://files.pythonhosted.org/packages/5d/82/942a4f2b339fa0d783f1efb15a68883cb0ba4506839d26a884fc11e611f3/zif.jsonserver-0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7115eb92f2335ae21d3faf1bdca7af74", "sha256": "408c019f2d1d073f9a4fadc1815210cb42391def0551399de62cd995e08b7f28" }, "downloads": -1, "filename": "zif.jsonserver-0.6-py2.4.egg", "has_sig": false, "md5_digest": "7115eb92f2335ae21d3faf1bdca7af74", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 127240, "upload_time": "2007-05-25T20:55:36", "url": "https://files.pythonhosted.org/packages/01/ed/906d0146e20ce7d5a7f2a4acfad64e3e3f5dae62f8d6b8becb9c8092954c/zif.jsonserver-0.6-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "5b7ed728e4312f4446dcb96df43da982", "sha256": "44400e581a4abb23c6e8b344bfa178d0cb12f9c1f99951829a7e66886f1ab9a1" }, "downloads": -1, "filename": "zif.jsonserver-0.6.tar.gz", "has_sig": false, "md5_digest": "5b7ed728e4312f4446dcb96df43da982", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 72231, "upload_time": "2007-05-25T20:55:37", "url": "https://files.pythonhosted.org/packages/5d/82/942a4f2b339fa0d783f1efb15a68883cb0ba4506839d26a884fc11e611f3/zif.jsonserver-0.6.tar.gz" } ] }