{ "info": { "author": "Robert Niederreiter", "author_email": "dev@bluedynamics.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Plone", "Framework :: Plone :: 5.1", "Framework :: Plone :: 5.2", "Framework :: Plone :: Addon", "Framework :: Zope :: 2", "Framework :: Zope :: 4", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "Integration package\n===================\n\nThis is the plone integration package for\n`bdajax `_.\n\n\nInstallation\n============\n\n- Make egg available in your instance.\n- Apply extension profile.\n\n\nUsage\n=====\n\nFor detailed documentation about ``bdajax`` please refer to\n`bdajax `_.\n\n\nImplement ajax action as browser view\n-------------------------------------\n\nAn ajax action can be implemented as simple browser view. The easiest way is to\nrender a template only. Create template ``tile_a.pt``:\n\n.. code-block:: xml\n\n
\n\n \n
\n\n

I am tile A

\n\n \n alter me\n\n
\n\n
\n\nConfigure via ZCML:\n\n.. code-block:: xml\n\n \n\n\nImplement ajax action as content provider\n-----------------------------------------\n\nCreate a template ``tile_b.pt`` containing the markup:\n\n.. code-block:: xml\n\n
\n\n \n \n
\n\n

I am tile B

\n\n \n alter me\n\n
\n\n
\n\nCreate content provider in ``provider.py``:\n\n.. code-block:: python\n\n from Acquisition import Explicit\n from zope.interface import (\n Interface,\n implementer,\n )\n from zope.component import adapter\n from zope.publisher.interfaces.browser import (\n IBrowserRequest,\n IBrowserView,\n )\n from zope.contentprovider.interfaces import IContentProvider\n from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile\n from bda.plone.ajax import ajax_message\n\n\n @implementer(IContentProvider)\n @adapter(Interface, IBrowserRequest, IBrowserView)\n class Provider(Explicit):\n template = ViewPageTemplateFile(u'tile_b.pt')\n\n def __init__(self, context, request, view):\n self.__parent__ = view\n self.context = context\n self.request = request\n\n def update(self):\n pass\n\n def render(self):\n # set here continuation message. See bda.plone.ajax.__init__ for\n # details.\n ajax_message(self.request, 'Demo continuation message', flavor='info')\n return self.template(self)\n\nConfigure provider via ZCML:\n\n.. code-block:: xml\n\n \n\n\nImplement a wrapper view\n------------------------\n\nThe two ajax action rendering snippets above each render a tile only. now we\nneed to wrap this inside a plone view. Create template ``ploneview.pt``:\n\n.. code-block:: xml\n\n \n \n\n \n \n\n \n\n \n \n\n \n \n\nAnd register via ZCML:\n\n.. code-block:: xml\n\n \n\nNow start instance and navigate to ``@@bdajax_example_view``. You get initially\n``tile a`` rendered switching to ``tile b`` on click and vise versa. This code\nequates the one contained in examples folder.\n\n\nImplement an ajax form\n----------------------\n\nCreate a view which renders a form.\n\nCreate template named ``ajaxform.pt``. The attribute ``ajax:form`` tells\nbdajax to handle this form:\n\n.. code-block:: xml\n\n
\n\n \n\n
\n Error Text\n
\n\n \n\n \n\n
\n\nCreate the view class:\n\n.. code-block:: python\n\n from Products.Five import BrowserView\n from bda.plone.ajax import ajax_continue\n from bda.plone.ajax import ajax_form_fiddle\n from bda.plone.ajax import AjaxMessage\n\n\n class AjaxForm(BrowserView):\n\n @property\n def form_action(self):\n return 'ajaxform?form_name=bdajax_example_form'\n\n @property\n def submitted(self):\n return 'field' in self.request.form\n\n @property\n def error(self):\n if not self.submitted:\n return\n if not self.request.form['field']:\n return u'Field must not be empty'\n\n @property\n def value(self):\n return self.request.form.get('field')\n\n def __call__(self):\n if self.submitted and not self.error:\n ajax_continue(self.request, AjaxMessage('Success!', 'info', None))\n\nRegister view via ZCML:\n\n.. code-block:: xml\n\n \n\nCreate wrapper view for form named ``ajaxformview.pt``:\n\n.. code-block:: xml\n\n \n \n\n \n \n\n \n\n \n \n\n \n \n\nAnd register via ZCML:\n\n.. code-block:: xml\n\n \n\nNow start instance and navigate to ``@@bdajax_example_form_view``.\n\n\nImplement ajax batch\n--------------------\n\nCreate a batch implementation in python, i.e. ``examplebatch.py`` calculating\nbatch vocab:\n\n.. code-block:: python\n\n from Products.Five import BrowserView\n from bda.plone.ajax.batch import Batch\n\n\n RESULTLEN = 45\n SLICESIZE = 10\n\n\n class ExampleBatch(Batch):\n batchname = 'examplebatch'\n\n @property\n def vocab(self):\n ret = list()\n # len result\n count = RESULTLEN\n # entries per page\n slicesize = SLICESIZE\n # number of batch pages\n pages = count / slicesize\n if count % slicesize != 0:\n pages += 1\n # current batch page\n current = self.request.get('b_page', '0')\n for i in range(pages):\n # create query with page number\n query = 'b_page=%s' % str(i)\n # create batch target url\n url = '%s?%s' % (self.context.absolute_url(), query)\n # append batch page\n ret.append({\n 'page': '%i' % (i + 1),\n 'current': current == str(i),\n 'visible': True,\n 'url': url,\n })\n return ret\n\nCreate batched result view:\n\n.. code-block:: python\n\n class BatchedResult(BrowserView):\n\n @property\n def batch(self):\n return ExampleBatch(self.context, self.request)()\n\n @property\n def slice(self):\n result = range(RESULTLEN)\n current = int(self.request.get('b_page', '0'))\n start = current * SLICESIZE\n end = start + SLICESIZE\n return result[start:end]\n\nCreate batched result template, i.e. ``batchedresult.pt``:\n\n.. code-block:: xml\n\n
\n\n \n\n
    \n
  • x
  • \n
\n\n \n\n
\n\nCreate wrapper view, i.e. ``batchview.pt``:\n\n.. code-block:: xml\n\n \n \n\n \n \n\n \n\n \n \n\n \n \n\nAnd register views via ZCML:\n\n.. code-block:: xml\n\n \n\n \n\nNow start instance and navigate to ``@@bdajax_example_batch``. You get an\nexample result rendered batched. This code equates the one contained in\nexamples folder.\n\n\nExamples\n--------\n\nThis package ships with examples, as explained above.\nTo enable examples include ``bda.plone.ajax.examples`` via ZCML.\n\n\nSource Code\n===========\n\nIf you want to help with the development (improvement, update, bug-fixing, ...) of ``bda.plone.ajax`` this is a great idea!\n\nThe code is located in the `github collective `_.\n\nYou can clone it or `get access to the github-collective `_ and work directly on the project.\n\nMaintainers are Robert Niederreiter and the BlueDynamics Alliance developer team.\nWe appreciate any contribution and if a release is needed to be done on pypi, please just contact one of us:\n`dev@bluedynamics dot com `_\n\n\nContributors\n============\n\n- Robert Niederreiter (Autor)\n- Jens W. Klein\n\nChanges\n=======\n\n2.0 (2019-03-10)\n----------------\n\n- Drop Plone 4 support (Needs 5.1+). \n [agitator]\n \n- Add Python 3 support.\n [agitator]\n \n- Minimal custom jquerytools with overlay added, no more dependency on ``plone.app.jquerytools``.\n [agitator]\n\n\n1.8 (2019-02-08)\n----------------\n\n- Depend on ``Products.CMFPlone`` instead of ``Plone`` to not fetch unnecessary dependencies.\n [thet]\n\n- Check whether child is null before searching for elements by tag name in\n ajax form response.\n [rnix]\n\n- Adopt to ``bdajax`` 1.10.\n [rnix]\n\n\n1.7 (2017-03-10)\n----------------\n\n- Add ``_authenticator`` hidden field when rendering ajax forms in order to\n make CSRF protection work properly.\n [rnix]\n\n- Plone 5 Update, registered as legacy bundle\n [agitator, rnix]\n\n\n1.6 (2015-06-25)\n----------------\n\n- give ``ajaxaction`` response explicit ``Content-Type: application/json``\n [jensens, 2015-06-25]\n\n- log formerly catched and hidden exceptions with severity error to error log.\n [jensens, 2015-06-25]\n\n- Disable diazo theming in ``ajaxaction`` and ``ajaxform`` browser views.\n [rnix, 2014-12-10]\n\n- Add ``AjaxPath`` continuation. Can be used as of ``bdajax`` 1.6.\n [rnix, 2014-12-10]\n\n\n1.5\n---\n\n- Add ajaxform convenience browser page.\n [rnix, 2014-02-04]\n\n\n1.4\n---\n\n- Cleanup docs.\n [rnix, 2013-10-21]\n\n- Do not load examples by default.\n [rnix, 2013-10-21]\n\n- Add abstract batch for buidling ajax batches.\n [rnix, 2013-10-20]\n\n\n1.3\n---\n\n- Provide overlay configuration.\n [rnix, 2012-08-06]\n\n- Provide form continuation.\n [rnix, 2012-08-06]\n\n\n1.2.2\n-----\n\n- render viewlet in IPortalTop, so it pops up centered and not at the end of\n the site.\n [jensens, 2011-12-02]\n\n- add z3c.autoinclude entry point.\n [jensens, 2011-12-02]\n\n\n1.2.1\n-----\n\n- display ``bdajax.message`` with traceback if ``ajaxaction`` throws uncaught\n exception.\n [rnix]\n\n\n1.2\n---\n\n- add ajax continuation support and continuation helper objects and functions.\n [rnix]\n\n\n1.1\n---\n\n- add examples.\n [rnix]\n\n- add ajaxaction view.\n [rnix]\n\n\n1.0\n---\n\n- make it work.\n [rnix]\n\nLicense\n=======\n\nCopyright (c) 2010-2019, BlueDynamics Alliance, Austria\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright notice, this\n list of conditions and the following disclaimer in the documentation and/or\n other materials provided with the distribution.\n* Neither the name of the BlueDynamics Alliance nor the names of its\n contributors may be used to endorse or promote products derived from this\n software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY BlueDynamics Alliance ``AS IS`` AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL BlueDynamics Alliance BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://pypi.org/project/bda.plone.ajax/", "keywords": "plone ajax javascript bdajax", "license": "GNU General Public Licence", "maintainer": "", "maintainer_email": "", "name": "bda.plone.ajax", "package_url": "https://pypi.org/project/bda.plone.ajax/", "platform": "", "project_url": "https://pypi.org/project/bda.plone.ajax/", "project_urls": { "Homepage": "https://pypi.org/project/bda.plone.ajax/" }, "release_url": "https://pypi.org/project/bda.plone.ajax/2.0/", "requires_dist": null, "requires_python": "", "summary": "bdajax integration for Plone.", "version": "2.0" }, "last_serial": 4922853, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "7adde8babc3dbb3741694caa14102e9a", "sha256": "7f454e794a9b3345de9593aa0b19c0a766635fcd058e68bcdefe093c1116b75b" }, "downloads": -1, "filename": "bda.plone.ajax-1.0.tar.gz", "has_sig": false, "md5_digest": "7adde8babc3dbb3741694caa14102e9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2738, "upload_time": "2010-07-01T12:06:15", "url": "https://files.pythonhosted.org/packages/35/f0/a2625bdb42c6001199349f1921e0a394e31bfcd6fb75c38cc216f4748067/bda.plone.ajax-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "beaf6994d28fb181c90721615c4e50ef", "sha256": "4756153e1ebd5a5b45c98ea28ccb6c36ac42c911d8d82b602aa6666f9d27186a" }, "downloads": -1, "filename": "bda.plone.ajax-1.1.tar.gz", "has_sig": false, "md5_digest": "beaf6994d28fb181c90721615c4e50ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8533, "upload_time": "2011-01-14T11:43:52", "url": "https://files.pythonhosted.org/packages/7b/aa/6da236aab3bf47381e2797672540d4363cd2f80a9ff573cf7814a699e57f/bda.plone.ajax-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "7213061a4dcb104f65faf5191f5d5524", "sha256": "c214372bc8734a9f9560a013f2829e51e145dd825b7d26170f8bfc299704373d" }, "downloads": -1, "filename": "bda.plone.ajax-1.2.tar.gz", "has_sig": false, "md5_digest": "7213061a4dcb104f65faf5191f5d5524", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7761, "upload_time": "2011-06-03T23:01:07", "url": "https://files.pythonhosted.org/packages/3c/64/c106094b8fc825925fe948fc31312a2cfd54f0c2986013839a5979a1178a/bda.plone.ajax-1.2.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "95b2d187f0f30d1cfd3a34cc58bed2cb", "sha256": "d9e5869b8e3eb67784175fde48f17d7baf1e22f5e593093adbf9a3d2c0f343eb" }, "downloads": -1, "filename": "bda.plone.ajax-1.2.1.tar.gz", "has_sig": false, "md5_digest": "95b2d187f0f30d1cfd3a34cc58bed2cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7414, "upload_time": "2011-09-21T15:00:27", "url": "https://files.pythonhosted.org/packages/fe/c3/06bff921af002f9c5acb9b29f61ad6f11a007e2d30ccb6178e01271ec3e5/bda.plone.ajax-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "a1a05a1df3be0b2d4c38f5287cca8c2c", "sha256": "3614273330d9e56139127481039127169894d488bec71533f4b9fe9f41082baf" }, "downloads": -1, "filename": "bda.plone.ajax-1.2.2.tar.gz", "has_sig": false, "md5_digest": "a1a05a1df3be0b2d4c38f5287cca8c2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6703, "upload_time": "2011-12-02T14:17:21", "url": "https://files.pythonhosted.org/packages/a3/2c/195a1ee33c92716ca3f0c1d61d75fced47fc37c476ffe5c5c1a4ee7b333d/bda.plone.ajax-1.2.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "6d6469c6d257c1494e71ce8550634fd2", "sha256": "85edd0f84fefb7c407408460898aa52fd3d20f473597b42141ae27e90fadc8ae" }, "downloads": -1, "filename": "bda.plone.ajax-1.3.tar.gz", "has_sig": false, "md5_digest": "6d6469c6d257c1494e71ce8550634fd2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9276, "upload_time": "2012-10-07T09:09:09", "url": "https://files.pythonhosted.org/packages/7d/23/e88e4f1c1a37107c7443a72495b1c3ca2f6307b77328d980716bd4d7aae7/bda.plone.ajax-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "5faab54442d2fd9a701a23ca8ba7164d", "sha256": "4dedbdeda313fbd64978beac0872d7869c901f6b9d88ace0224458d9de13c945" }, "downloads": -1, "filename": "bda.plone.ajax-1.4.tar.gz", "has_sig": false, "md5_digest": "5faab54442d2fd9a701a23ca8ba7164d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17915, "upload_time": "2013-10-29T09:48:16", "url": "https://files.pythonhosted.org/packages/d4/73/42d637f9426a7a710936597495fdbc2a6d1723f1b29eb8a4b94478db574f/bda.plone.ajax-1.4.tar.gz" } ], "1.5": [ { "comment_text": "", "digests": { "md5": "dea9b0656206dd729b4f7f4be440d6dc", "sha256": "3e0e8efa4704820b3ffe523bc24ae0394e588fb81d17aea57cf8e3e481a218bd" }, "downloads": -1, "filename": "bda.plone.ajax-1.5.tar.gz", "has_sig": false, "md5_digest": "dea9b0656206dd729b4f7f4be440d6dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20482, "upload_time": "2014-02-04T17:44:17", "url": "https://files.pythonhosted.org/packages/dc/69/a6fceffefa92d670a1ee1d5eb4e243f33ed0f4808e3ed1a3dd7a0281540d/bda.plone.ajax-1.5.tar.gz" } ], "1.6": [ { "comment_text": "", "digests": { "md5": "bdb97528d02846c8ffa0e94dfc9228fa", "sha256": "e1d48d5af176880a7b3ffda79e919929a0ce3799c939602638146d50c5eafc72" }, "downloads": -1, "filename": "bda.plone.ajax-1.6.tar.gz", "has_sig": false, "md5_digest": "bdb97528d02846c8ffa0e94dfc9228fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20410, "upload_time": "2015-06-25T12:49:15", "url": "https://files.pythonhosted.org/packages/18/d3/38648f0084b7618acdad43c4f4ea2bf7af7bb41ba3b80fcef771cf15af8f/bda.plone.ajax-1.6.tar.gz" } ], "1.7": [ { "comment_text": "", "digests": { "md5": "b4b9348128db50820ffcb0c601316911", "sha256": "390c92c7635aa39dd1e0efbbeec95713187ec0fd70f598d3cf44c491d7c27558" }, "downloads": -1, "filename": "bda.plone.ajax-1.7.tar.gz", "has_sig": false, "md5_digest": "b4b9348128db50820ffcb0c601316911", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22343, "upload_time": "2017-03-10T11:18:48", "url": "https://files.pythonhosted.org/packages/d6/de/60cae903e9de86bf3758b69f29d1f7103a10473561e5efe10f3cb96ba181/bda.plone.ajax-1.7.tar.gz" } ], "1.8": [ { "comment_text": "", "digests": { "md5": "ce401a7f94bd1ea9cd5d338dcecb5292", "sha256": "5aef7c7acecf8b3f7d7159faa68d93f915c8ae47af6acc4cd98ad4830a535f55" }, "downloads": -1, "filename": "bda.plone.ajax-1.8.tar.gz", "has_sig": false, "md5_digest": "ce401a7f94bd1ea9cd5d338dcecb5292", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19521, "upload_time": "2019-02-08T09:20:45", "url": "https://files.pythonhosted.org/packages/48/85/f5ff8a81444a2713f7334ac35cec27c8cfad37baed335c1803d0c1c3933b/bda.plone.ajax-1.8.tar.gz" } ], "2.0": [ { "comment_text": "", "digests": { "md5": "7ff5f1e573f30e29289463ad581fd525", "sha256": "f1fee66553cfd7f537e8e78822659eb76bc58bb708523cef3f3669023a40ede4" }, "downloads": -1, "filename": "bda.plone.ajax-2.0.tar.gz", "has_sig": false, "md5_digest": "7ff5f1e573f30e29289463ad581fd525", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24712, "upload_time": "2019-03-10T22:07:02", "url": "https://files.pythonhosted.org/packages/c6/f8/9835ffee5318bd4d51b191ffd5a94b246add7b72159f1245c34e74452ef4/bda.plone.ajax-2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7ff5f1e573f30e29289463ad581fd525", "sha256": "f1fee66553cfd7f537e8e78822659eb76bc58bb708523cef3f3669023a40ede4" }, "downloads": -1, "filename": "bda.plone.ajax-2.0.tar.gz", "has_sig": false, "md5_digest": "7ff5f1e573f30e29289463ad581fd525", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24712, "upload_time": "2019-03-10T22:07:02", "url": "https://files.pythonhosted.org/packages/c6/f8/9835ffee5318bd4d51b191ffd5a94b246add7b72159f1245c34e74452ef4/bda.plone.ajax-2.0.tar.gz" } ] }