{ "info": { "author": "Ross Patterson", "author_email": "me@rpatterson.net", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. -*-doctest-*-\n\n===================\ncollective.nextprev\n===================\n\nThe collective.nextprev package extends Plone's next/previous\nnavigation for folders to collections (AKA topics or smart folders).\nIf a listing view is visited for a collection which has next/previous\nnavigation enabled, a cookie is set to remember the collection used\nand any relevant query terms. When a content item in the result set\nis visited, this cookie will be used to determine the next and\nprevious item links.\n\nStart with the a folder, some content, and a collection.\n\n >>> folder\n \n >>> folder.contentValues()\n [,\n ,\n ,\n ,\n ]\n\nOne item is a page and so doesn't show up in the collection listing.\n\n >>> folder['foo-topic-title'].queryCatalog(full_objects=True)\n [,\n ,\n ,\n ] \n\nNext/previous navigation is enabled for the folder but not for the topic.\n\n >>> folder.getNextPreviousEnabled()\n True\n >>> folder['foo-topic-title'].getNextPreviousEnabled()\n False\n\nOpen a browser at the folder.\n\n >>> from Products.Five.testbrowser import Browser\n >>> browser = Browser()\n >>> browser.handleErrors = False\n >>> browser.open(folder.absolute_url())\n\nVisit one of the news items, the next link points to the next item in\nthe folder but not the next item in the collection.\n\n >>> browser.getLink('Foo News Item Title').click()\n >>> browser.getLink('Next')\n \n\nOpen a browser, log in as some one who can enable the next/previous\nnavigation for the collection, and do so.\n\n >>> from Products.PloneTestCase import ptc\n >>> owner_browser = Browser()\n >>> owner_browser.handleErrors = False\n >>> owner_browser.open(folder['foo-topic-title'].absolute_url())\n >>> owner_browser.getLink('Log in').click()\n >>> owner_browser.getControl(\n ... 'Login Name').value = ptc.portal_owner\n >>> owner_browser.getControl(\n ... 'Password').value = ptc.default_password\n >>> owner_browser.getControl('Log in').click()\n >>> owner_browser.getLink('Edit').click()\n >>> owner_browser.getControl(\n ... 'Enable next previous navigation').selected = True\n >>> owner_browser.getControl('Save').click()\n >>> print owner_browser.contents\n <...\n ...Changes saved...\n\nNow that next/previous navigation is enabled, visiting the collection\nlisting will set the cookie.\n\n >>> browser.open(folder.absolute_url())\n >>> browser.headers['set-cookie']\n 'nextprev.collection=\"/plone/Members/test_user_1_/foo-topic-title\";\n Path=/, nextprev.form=\"test=\"; Path=/'\n\nVisit an item again and now the next link will be the next item in the\ncollection.\n\n >>> browser.getLink('Foo News Item Title').click()\n >>> browser.getLink('Next')\n \n\nIf the folder listing is visited again, the next/previous links\nreflect the folder contents instead of the collection results.\n\n >>> browser.open(folder.absolute_url()+'/folder_listing')\n >>> browser.headers['set-cookie']\n 'nextprev.collection=\"deleted\"; Path=/; Expires=Wed,\n 31-Dec-97 23:59:59 GMT; Max-Age=0, nextprev.form=\"deleted\";\n Path=/; Expires=Wed, 31-Dec-97 23:59:59 GMT; Max-Age=0'\n\n >>> browser.getLink('Foo News Item Title').click()\n >>> browser.getLink('Next')\n \n\nSearch criteria submitted in the request are also preserved in the\ncookies so that the next/previous links will reflect the correct\nresult sets.\n\n >>> browser.open(folder.absolute_url()+'?SearchableText=baz')\n >>> browser.getLink('Baz News Item Title').click()\n >>> browser.getLink('Previous')\n Traceback (most recent call last):\n LinkNotFoundError\n >>> browser.getLink('Next')\n \n\nItems outside the current set can be safely viewed.\n\n >>> browser.open(folder['foo-news-item-title'].absolute_url())\n >>> browser.getLink('Previous')\n Traceback (most recent call last):\n LinkNotFoundError\n >>> browser.getLink('Next')\n Traceback (most recent call last):\n LinkNotFoundError\n\nA topic which is contained in a folder but is not in the current set\ncan also be safely viewed.\n\n >>> browser.open(folder.absolute_url())\n >>> browser.getLink('Previous')\n Traceback (most recent call last):\n LinkNotFoundError\n >>> browser.getLink('Next')\n Traceback (most recent call last):\n LinkNotFoundError\n\nThough next/previous navigation is not available on large folders, the\nnext/previous links will still be rendered when a collection lists\nitems inside a large folder.\n\n >>> browser.open(folder.absolute_url())\n >>> browser.getLink('Blah News Item Title').click()\n >>> browser.getLink('Previous')\n \n >>> browser.getLink('Next')\n Traceback (most recent call last):\n LinkNotFoundError\n\nChangelog\n=========\n\n0.2 - 2009-02-10\n----------------\n\n* Fix a bug so that items contained in large folders will still have\n next/prev links if the cookie is set\n* Refactor the various views and adapters\n\n0.1 - 2009-02-05\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://pypi.python.org/pypi/collective.nextprev", "keywords": "", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "collective.nextprev", "package_url": "https://pypi.org/project/collective.nextprev/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/collective.nextprev/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/collective.nextprev" }, "release_url": "https://pypi.org/project/collective.nextprev/0.2/", "requires_dist": null, "requires_python": null, "summary": "Next/Previous navigation through collection results", "version": "0.2" }, "last_serial": 845322, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "11237d65186f653b59ac37c1859b391d", "sha256": "7991eef80b9547b359dbfdc1e9ed31afc550330e7e6c68e7a2e86e08264b37c2" }, "downloads": -1, "filename": "collective.nextprev-0.1.tar.gz", "has_sig": false, "md5_digest": "11237d65186f653b59ac37c1859b391d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6157, "upload_time": "2009-02-06T07:22:29", "url": "https://files.pythonhosted.org/packages/76/82/a527d93af0783796349d6e158aa07da05a5c81c2dac176a7ac286f9d2de4/collective.nextprev-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "19c513e03bb9409d09302056c96d0092", "sha256": "80134ce2d4b88e2bb42975eece26b8c37b4c4989c8ceaeca7ced2c29d97d7147" }, "downloads": -1, "filename": "collective.nextprev-0.2.tar.gz", "has_sig": false, "md5_digest": "19c513e03bb9409d09302056c96d0092", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7107, "upload_time": "2009-02-11T03:10:19", "url": "https://files.pythonhosted.org/packages/0e/f0/d3e1727679875bb4aa4e2e64574bcbc8194332aa3688ad7dd2adcb121d2a/collective.nextprev-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "19c513e03bb9409d09302056c96d0092", "sha256": "80134ce2d4b88e2bb42975eece26b8c37b4c4989c8ceaeca7ced2c29d97d7147" }, "downloads": -1, "filename": "collective.nextprev-0.2.tar.gz", "has_sig": false, "md5_digest": "19c513e03bb9409d09302056c96d0092", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7107, "upload_time": "2009-02-11T03:10:19", "url": "https://files.pythonhosted.org/packages/0e/f0/d3e1727679875bb4aa4e2e64574bcbc8194332aa3688ad7dd2adcb121d2a/collective.nextprev-0.2.tar.gz" } ] }