{
"info": {
"author": "Jean-Francois Roche",
"author_email": "jfroche@affinitic.be",
"bugtrack_url": null,
"classifiers": [
"Environment :: Web Environment",
"Framework :: Zope2",
"Framework :: Zope3",
"License :: OSI Approved :: Zope Public License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Internet :: WWW/HTTP :: Site Management",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "AMF/Flash Support in Zope 2\n===========================\n\nIntroduction\n------------\n\nThis package allows you to query Zope 2 from a flash using Flex with\nActionscript 2 or Actionscript 3 throught AMF0 or AMF3.\n\nWe are just providing here the Zope layer. The lower layer has been done\nusing the PyAMF package (see http://pyamf.org).\n\nLet's write a simple AMF view that echoes various types of input:\n\n >>> from Products.Five import BrowserView\n >>> from datetime import datetime\n >>> import elementtree.ElementTree as etree\n >>> class EchoView(BrowserView):\n ...\n ... def echoString(self, value):\n ... return \"%s\" % value\n ...\n ... def echoProtectedString(self, value):\n ... return \"%s\" % value\n ...\n ... def echoList(self, value):\n ... return list(value)\n ...\n ... def echoDict(self, value):\n ... return dict(value)\n ...\n ... def echoVoid(self, value):\n ... pass\n ...\n ... def echoTuple(self, value):\n ... return tuple(value)\n ...\n ... def echoParams(self, value1, value2):\n ... return \"%s-%s\" % (value1, value2)\n ...\n ... def echoDate(self):\n ... return datetime(2008, 11, 17, 11, 11)\n ...\n ... def echoXML(self, value):\n ... root = etree.Element(\"html\")\n ... body = etree.SubElement(root, 'body')\n ... body.text = value\n ... return root\n\nNow we'll register it as a Flash view. For now we'll just register the\nview for folder objects and call it on the default folder of the user:\n\n >>> from zope.configuration import xmlconfig\n >>> ignored = xmlconfig.string(\"\"\"\n ... \n ...\n ... \n ... \n ... \n ...\n ... \n ...\n ... \n ...\n ... \n ... \"\"\")\n\nWe create some helper functions.\nFor Requests:\n\n >>> def createAMFRequest(target, body, username=None, password=None, multiParameters=False):\n ... envelope = remoting.Envelope(pyamf.AMF0, pyamf.ClientTypes.Flash9)\n ... if username is not None and password is not None:\n ... envelope.headers['Credentials'] = dict(userid=unicode(username),\n ... password=unicode(password))\n ... if multiParameters:\n ... request = remoting.Request(target, body, envelope)\n ... else:\n ... request = remoting.Request(target, [body], envelope)\n ... envelope[u'/1'] = request\n ... amfRequest = remoting.encode(envelope)\n ... amfRequest.seek(0)\n ... return amfRequest.read()\n\nFor Responses:\n\n >>> import pyamf\n >>> from pyamf import remoting\n >>> def printAMFResponse(response):\n ... context = pyamf.amf0.Context\n ... requests = remoting.decode(response.body, context())\n ... for name, value in requests.items():\n ... print (name, value, type(value.body))\n\nBasic Types\n-----------\n\nString\n\n >>> amfRequest = createAMFRequest(target='echoString', body='Hello World!')\n >>> amfRequest\n '\\x00\\x03\\x00\\x00\\x00\\x01\\x00\\nechoString\\x00\\x02/1\\x00\\x00\\x00\\x00\\n\\x00\\x00\\x00\\x01\\x02\\x00\\x0cHello World!'\n >>> response = http(r\"\"\"\n ... POST /test_folder_1_ HTTP/1.0\n ... Content-Length: 102\n ... Content-Type: application/x-amf\n ...\n ... %s\"\"\" % amfRequest)\n >>> printAMFResponse(response)\n (u'/1', Hello World!, )\n\nList\n\n >>> amfRequest = createAMFRequest(target='echoList', body=[u'H\u00e9', u'Ho'])\n >>> response = http(r\"\"\"\n ... POST /test_folder_1_ HTTP/1.0\n ... Content-Length: 102\n ... Content-Type: application/x-amf\n ...\n ... %s\"\"\" % amfRequest)\n >>> printAMFResponse(response)\n (u'/1', [u'H\\xc3\\xa9', u'Ho'],\n )\n\nDictionary\n\n >>> amfRequest = createAMFRequest(target='echoDict',\n ... body={'fruit': 'orange'})\n >>> response = http(r\"\"\"\n ... POST /test_folder_1_ HTTP/1.0\n ... Content-Length: 102\n ... Content-Type: application/x-amf\n ...\n ... %s\"\"\" % amfRequest)\n >>> printAMFResponse(response)\n (u'/1', {u'fruit': u'orange'},\n )\n\nWithout return\n\n >>> amfRequest = createAMFRequest(target='echoVoid', body='Hello World!')\n >>> response = http(r\"\"\"\n ... POST /test_folder_1_ HTTP/1.0\n ... Content-Length: 102\n ... Content-Type: application/x-amf\n ...\n ... %s\"\"\" % amfRequest)\n >>> printAMFResponse(response)\n (u'/1', None, )\n\nTuple\n\n >>> amfRequest = createAMFRequest(target='echoTuple', body=['foo', 'bar'])\n >>> response = http(r\"\"\"\n ... POST /test_folder_1_ HTTP/1.0\n ... Content-Length: 102\n ... Content-Type: application/x-amf\n ...\n ... %s\"\"\" % amfRequest)\n >>> printAMFResponse(response)\n (u'/1', [u'foo', u'bar'],\n )\n\nDatetime\n\n >>> amfRequest = createAMFRequest(target='echoDate', body=None)\n >>> response = http(r\"\"\"\n ... POST /test_folder_1_ HTTP/1.0\n ... Content-Length: 102\n ... Content-Type: application/x-amf\n ...\n ... %s\"\"\" % amfRequest)\n >>> printAMFResponse(response)\n (u'/1', 2008-11-17 11:11:00,\n )\n\nXML\n\n >>> amfRequest = createAMFRequest(target='echoXML', body='It works!')\n >>> response = http(r\"\"\"\n ... POST /test_folder_1_ HTTP/1.0\n ... Content-Length: 102\n ... Content-Type: application/x-amf\n ...\n ... %s\"\"\" % amfRequest)\n >>> printAMFResponse(response)\n (u'/1', ,\n )\n\nMulti Parameters\n----------------\n\n >>> amfRequest = createAMFRequest(target='echoParams', body=['foo', 'bar'],\n ... multiParameters=True)\n >>> response = http(r\"\"\"\n ... POST /test_folder_1_ HTTP/1.0\n ... Content-Length: 102\n ... Content-Type: application/x-amf\n ...\n ... %s\"\"\" % amfRequest)\n >>> printAMFResponse(response)\n (u'/1', foo-bar, )\n\nErrors\n------\n\n\n >>> amfRequest = createAMFRequest(target='echoUnknown', body=['foo', 'bar'])\n >>> response = http(r\"\"\"\n ... POST /test_folder_1_ HTTP/1.0\n ... Content-Length: 102\n ... Content-Type: application/x-amf\n ...\n ... %s\"\"\" % amfRequest)\n >>> printAMFResponse(response)\n (u'/1', >> amfRequest = createAMFRequest(target='echoProtectedString',\n ... body='It works!')\n >>> response = http(r\"\"\"\n ... POST /test_folder_1_ HTTP/1.0\n ... Content-Length: 102\n ... Content-Type: application/x-amf\n ...\n ... %s\"\"\" % amfRequest)\n >>> printAMFResponse(response)\n (u'/1', ,\n )\n\n\nNow try to access with login/pass:\n\n >>> from Testing.ZopeTestCase import user_name, user_password\n >>> amfRequest = createAMFRequest(target='echoProtectedString',\n ... body=\"Hello World!\", username=user_name,\n ... password=user_password)\n >>> response = http(r\"\"\"\n ... POST /test_folder_1_ HTTP/1.0\n ... Content-Length: 200\n ... Content-Type: application/x-amf\n ...\n ... %s\"\"\" % amfRequest)\n >>> printAMFResponse(response)\n (u'/1', Hello World!, )\n\nPath in service\n---------------\n\n >>> amfRequest = createAMFRequest(target='test_folder_1_.echoProtectedString',\n ... body='It works!', username=user_name,\n ... password=user_password)\n >>> response = http(r\"\"\"\n ... POST / HTTP/1.0\n ... Content-Length: 200\n ... Content-Type: application/x-amf\n ...\n ... %s\"\"\" % amfRequest)\n >>> printAMFResponse(response)\n (u'/1', It works!, )\n\nChangelog\n=========\n\n0.2 - (2008-11-25)\n------------------\n\n* Handle path change in service\n\n* register crossdomain.xml view\n\n0.1 - (2008-11-17)\n------------------\n\n* Initial release",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://svn.zope.org/z3c.amf",
"keywords": "Zope2 Zope AMF Flash Flex",
"license": "ZPL 2.1",
"maintainer": null,
"maintainer_email": null,
"name": "z3c.amf",
"package_url": "https://pypi.org/project/z3c.amf/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/z3c.amf/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "http://svn.zope.org/z3c.amf"
},
"release_url": "https://pypi.org/project/z3c.amf/0.2/",
"requires_dist": null,
"requires_python": null,
"summary": "Zope support for Flash messages (AMF)",
"version": "0.2"
},
"last_serial": 801991,
"releases": {
"0.1": [
{
"comment_text": "",
"digests": {
"md5": "6747351d33997b2857f8f931ca7f2874",
"sha256": "1b449f22102c2b4e45e8e1e8b0a2d182fb553ec63434cb65ed07c64645c28d2d"
},
"downloads": -1,
"filename": "z3c.amf-0.1.tar.gz",
"has_sig": false,
"md5_digest": "6747351d33997b2857f8f931ca7f2874",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 20571,
"upload_time": "2008-11-18T09:08:21",
"url": "https://files.pythonhosted.org/packages/7f/5a/129048685ff07e71fd1fe086128707d0920b013e77f4169c7273cf27ad80/z3c.amf-0.1.tar.gz"
}
],
"0.2": [
{
"comment_text": "",
"digests": {
"md5": "1f89e3e345c46c95e4bc7f0d47d1d903",
"sha256": "71717476062744dba6d8cbccb84804d3087922644c820a5fe2b2c4f8c798aa6a"
},
"downloads": -1,
"filename": "z3c.amf-0.2.tar.gz",
"has_sig": false,
"md5_digest": "1f89e3e345c46c95e4bc7f0d47d1d903",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 22358,
"upload_time": "2008-11-25T14:31:03",
"url": "https://files.pythonhosted.org/packages/7c/0d/c4e1409b33da70922732afdb22515894ac4ad2cb4e88f92bca2f879fea1c/z3c.amf-0.2.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "1f89e3e345c46c95e4bc7f0d47d1d903",
"sha256": "71717476062744dba6d8cbccb84804d3087922644c820a5fe2b2c4f8c798aa6a"
},
"downloads": -1,
"filename": "z3c.amf-0.2.tar.gz",
"has_sig": false,
"md5_digest": "1f89e3e345c46c95e4bc7f0d47d1d903",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 22358,
"upload_time": "2008-11-25T14:31:03",
"url": "https://files.pythonhosted.org/packages/7c/0d/c4e1409b33da70922732afdb22515894ac4ad2cb4e88f92bca2f879fea1c/z3c.amf-0.2.tar.gz"
}
]
}