{ "info": { "author": "Zope Foundation and Contributors", "author_email": "grok-dev@zope.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Zope3", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "grokui.base -- Base components for Grok UI\n******************************************\n\n``grokui.base`` is a base layer to build a zope instance-level set of\nutilities. The package provides a collection of easy-to-use components\nthat will allow you to build your own configuration or admin panels.\n`grokui.base` provides the components that should be used by other\n`grokui` packages to plug into a coherent layout.\n\nUsing `grokui.base` we can provide different UI parts that can be used\nindenpendently from each other, for example a ZODB browser or a\ngeneral admin panel to manage local Grok applications. It is up to the\nadmins to decide what grok UI parts they want to have installed.\n\nIn general, `grokui.base` provides viewlets, menus, layouts and a\nspecial namespace for use by other components.\n\n\n\n.. contents::\n\n\nDetailed Description\n********************\n\n``grokui.base`` provides tools to assemble a coherent environment.\n\n\nThe ``++grokui++`` namespace\n============================\n\nIn order to keep a sane and clean naming policy, the grokui components\nare compartmented in a logical namespace, ``++grokui++``, which is\ndefined and registered in `grokui.base`.\n\nThis namespace is a multi-adapter that will act like a parent for the\nview. It's the natural context of all the grokui pages. Let's get out\nfirst contact with this namespace::\n\n >>> from grokui.base import GrokUINamespace\n >>> from grokui.base import IGrokUIRealm\n\n >>> IGrokUIRealm.implementedBy(GrokUINamespace)\n True\n\nExample\n-------\n\nWe can build a simple admin screen that fits into the environment like\nthis:\n\n >>> from martian.testing import FakeModule\n >>> import grok\n >>> from zope.interface import Interface\n >>> from grokui.base import GrokUILayer\n\n >>> class mymodule(FakeModule):\n ... class MyAdminScreen(grok.View):\n ... grok.layer(GrokUILayer)\n ... grok.name('helloadmin')\n ... grok.context(Interface)\n ... def render(self):\n ... return u'Hello admin!'\n >>> from martiantest.fake.mymodule import MyAdminScreen\n\nThe important thing here is, that we set our view to belong to the\nGrokUI namespace, which is named ``++grokui++`` in URLs.\n\nWe grok this view to register it with the component architechture:\n\n >>> from grokcore.component.testing import grok_component\n >>> grok_component('MyAdminScreen', MyAdminScreen)\n True\n\nLet's create a browser to lookup this view:\n\n >>> from zope.app.wsgi.testlayer import Browser\n >>> browser = Browser()\n >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')\n\nWe can get this screen when we ask for the correct namespace:\n\n >>> browser.open('http://localhost/++grokui++/@@helloadmin')\n >>> print browser.contents\n Hello admin!\n\nIf we ask for this view without the namespace set correctly, the view\nwill not be found:\n\n >>> browser.open('http://localhost/@@helloadmin')\n Traceback (most recent call last):\n ...\n HTTPError: HTTP Error 404: Not Found\n\n\nGrokUI Pages\n============\n\nWe can, however, also create admin pages, that fit completely into the\nGrokUI layout without much hassle, providing a menu bar, images and\nall other parts of the standard grokui layout automatically for your\npage.\n\nTo do so, we derive our admin page from ``GrokUIView``, give it a\ntitle, and optionally set an order number:\n\n >>> from grokui.base.layout import GrokUIView\n >>> from grokui.base.namespace import GrokUILayer\n\n >>> class mymodule(FakeModule):\n ... class CaveManagementScreen(GrokUIView):\n ... # Name where we can access this page via URL:\n ... grok.name('managecave')\n ... # Also optional, but highly recommended:\n ... grok.require('zope.ManageServices')\n ... # Set title of page in menu bar:\n ... grok.title('admin stuff')\n ... # Display this entry very far to the left in menu bar:\n ... grok.order(-1)\n ...\n ... def render(self):\n ... # Instead of render() we could also define a page template\n ... # for the actual contents of this page.\n ... return u'Hello cave manager!'\n >>> from martiantest.fake.mymodule import CaveManagementScreen\n >>> grok_component('CaveManagementScreen', CaveManagementScreen)\n True\n\nWhile the title will be displayed in the main menu bar of the GrokUI\nlayout automatically, the ``order`` tells at which position in the\nmenu we want our page to appear. Pages without a title do not appear\nin the menu bar at all.\n\nInstances of `GrokUIView` are in fact `grok.Page` instances\nthat render the content provided by a template or `render` method\ninto a given layout (here: the general GrokUI layout).\n\nWe can access the page in GrokUI namespace ``++grokui++`` under the\nname given above (``managecave``):\n\n >>> browser.open('http://localhost/++grokui++/managecave')\n >>> print browser.contents\n \n ...\n ...Grok User Interface\n ...\n ...Hello cave manager!...\n ...\n\nMaking your admin page the default target page\n==============================================\n\nThe above admin page was set up with order number ``-1``. That means,\nthat its menu entry will appear at far left position in the menu\nbar. As we have currently no menu entries with a lower order number,\nthe entry will even appear at leftmost position.\n\nFurthermore this leftmost entry is also the default page if someone\nwants to see the index page of the running Zope instance at all:\n\n >>> browser.open('http://localhost/')\n >>> browser.url\n 'http://localhost/++grokui++/@@managecave'\n\nThis means, we've been redirected to our cave admin page.\n\nIf we want to change this default, for instance in order to set\nanother page as default, we simply have to provide a lower order\nnumber for that other admin page. The redirect will then redirect to\nit.\n\n\nCHANGES\n*******\n\n0.7 (2012-05-02)\n================\n\n- Make sure to pick up latest grok and grokcore.layout.\n\n0.6 (2011-07-14)\n================\n\n- Use grokcore.layout and import from grok.\n\n0.5.1 (2011-03-01)\n==================\n\n- Make sure grokcore.view is properly configured.\n\n0.5 (2011-01-12)\n================\n\n- Use `fanstatic` instead of zope DirectoryResource.\n\n0.4.2 (2010-12-16)\n==================\n\n- Update tests to properly with the latests martian releases.\n\n0.4.1 (2010-11-03)\n==================\n\n- Test dependency for zope.login.\n\n0.4 (2010-10-25)\n================\n\n- Set the default view name for IRootFolder to 'index' and register the\n the redirecting view for this name as well.\n\n0.3 (2010-10-18)\n================\n\n* Removed dependency on zope.app.testing.\n\n0.2.1 (2010-05-19)\n==================\n\n* Package modified to comply with repository policy (license, etc.).\n\n* Use own template dir for layout module in order not to provoke\n (erraneous) warnings of template registry.\n\n0.2 (2010-03-06)\n================\n\n* A minor CSS glitch has been corrected.\n\n* The messaging system is now registered via\n ``grokcore.message``. ``grokui.base`` is no longer bound to\n ``z3c.flashmessage``.\n\n* Dependencies have been cleaned up : ``grokui.base`` no longer\n depends on ``zope.app.zcmlfiles`` and can now be used outside the\n ``Grok`` suite. It uses only the `grokcore` packages.\n\n\n0.1 (2010-02-23)\n================\n\nInitial implementation.", "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/grokui.base", "keywords": "zope3 grok grokadmin", "license": "ZPL 2.1", "maintainer": null, "maintainer_email": null, "name": "grokui.base", "package_url": "https://pypi.org/project/grokui.base/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/grokui.base/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://svn.zope.org/grokui.base" }, "release_url": "https://pypi.org/project/grokui.base/0.7/", "requires_dist": null, "requires_python": null, "summary": "The Grok administration and development UI (base)", "version": "0.7" }, "last_serial": 1935488, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "462eddc979185bc7d131d902874cd9cf", "sha256": "0f765e24243216213997aab62726f4a51edd20192ff1932b724686da3d85613c" }, "downloads": -1, "filename": "grokui.base-0.1.tar.gz", "has_sig": false, "md5_digest": "462eddc979185bc7d131d902874cd9cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30471, "upload_time": "2010-02-23T13:57:11", "url": "https://files.pythonhosted.org/packages/d9/08/593dd114416b692360f2169647d80131503f4aa128119e80107d36f27357/grokui.base-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "624e4d676f585281506cd30e5655a76c", "sha256": "0f7990ee38f6584f1fc9089f9143bf9e18c04b87171e0267519bb569b13d1350" }, "downloads": -1, "filename": "grokui.base-0.2.tar.gz", "has_sig": false, "md5_digest": "624e4d676f585281506cd30e5655a76c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33785, "upload_time": "2010-03-06T21:08:11", "url": "https://files.pythonhosted.org/packages/3e/da/5bc5553ff0020658558efcd146b45a6c8387184ba2815b5736c82f2ae2cb/grokui.base-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "217a11517cb987f6437fbe356ee36969", "sha256": "2b1ed4fc100bc053aeeb98165d7a0648452e95358c4a7115781920907c244b4c" }, "downloads": -1, "filename": "grokui.base-0.2.1.tar.gz", "has_sig": false, "md5_digest": "217a11517cb987f6437fbe356ee36969", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33166, "upload_time": "2010-05-19T13:55:13", "url": "https://files.pythonhosted.org/packages/db/e8/a1545bdabbb046320066cc74bf2a3d490e146034f1485e4f1c92c1c2e1c7/grokui.base-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "9d95f56d2d88199fce930c396df5b831", "sha256": "2a8a1eea17d96ae84c50fca193a00c9ccb24e6ec844be0d557e0a4b231437f98" }, "downloads": -1, "filename": "grokui.base-0.2.2.tar.gz", "has_sig": false, "md5_digest": "9d95f56d2d88199fce930c396df5b831", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35871, "upload_time": "2010-05-28T21:15:31", "url": "https://files.pythonhosted.org/packages/26/1a/4adc1c208b8aeba54325af4e5b233910708e2b20d65465db8180b283178d/grokui.base-0.2.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "7159e7453216b2acdea11ca397044e67", "sha256": "dac121b7b5f74206d38f9bbfdce251d7b562c19b59cde7c1b644c4ee4534e1d7" }, "downloads": -1, "filename": "grokui.base-0.3.tar.gz", "has_sig": false, "md5_digest": "7159e7453216b2acdea11ca397044e67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35892, "upload_time": "2010-10-18T14:18:02", "url": "https://files.pythonhosted.org/packages/24/62/bd84122deed46867c05fdd1d8359158b87535e83ede33fcaadfc4a5d14f4/grokui.base-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "4cd58e95ac275ff3f366cffc67cbc45a", "sha256": "2869ed3a819b889ec243de16ac382620d322e86da217cc89443650a1a3b87d41" }, "downloads": -1, "filename": "grokui.base-0.4.tar.gz", "has_sig": false, "md5_digest": "4cd58e95ac275ff3f366cffc67cbc45a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34878, "upload_time": "2010-10-25T18:19:48", "url": "https://files.pythonhosted.org/packages/68/8b/e11309312c634b6de85ac45e52853fe4b0cf858cba96f6326ad0c8606643/grokui.base-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "510380c198b13eb422d4898c364a0009", "sha256": "db3523b67d8ddffbeb7b6d4fb5664e7137ec6569f680deb234608b2b264ead8d" }, "downloads": -1, "filename": "grokui.base-0.4.1.tar.gz", "has_sig": false, "md5_digest": "510380c198b13eb422d4898c364a0009", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34918, "upload_time": "2010-11-03T17:23:24", "url": "https://files.pythonhosted.org/packages/7e/c4/f57082fed6fae65dac4239a71637ff0438524fc5f428549a4d7b3c19c330/grokui.base-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "d2fed41e5852970f9bddd26b7018ff44", "sha256": "83ccb9491719000802bde27cf5fcc21e179afad63340a56fc563316959b7a5b5" }, "downloads": -1, "filename": "grokui.base-0.4.2.tar.gz", "has_sig": false, "md5_digest": "d2fed41e5852970f9bddd26b7018ff44", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36168, "upload_time": "2010-12-16T11:01:31", "url": "https://files.pythonhosted.org/packages/0b/2b/247c6245282841724707259ccc856be061b00ac3eb6dc1466bd0067940c5/grokui.base-0.4.2.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "5bd3d786454cfba71910c12fb878c6a9", "sha256": "017f30c43753e0ad9d41e6fd79fee99c488f83a25a59e0c6d5bbeb2cdaaa24b6" }, "downloads": -1, "filename": "grokui.base-0.5.tar.gz", "has_sig": false, "md5_digest": "5bd3d786454cfba71910c12fb878c6a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35960, "upload_time": "2011-01-12T16:40:27", "url": "https://files.pythonhosted.org/packages/43/2b/a2c094c5d623bc3b94e42a35ddbc106aee7a5102e9a91db9e094ab091e21/grokui.base-0.5.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "e36abe607d5b8af0d5c4a1066e1effe5", "sha256": "99f8476747f252fcbb183b158917e8dea03d6cd6d6107320b0b19e69a82df497" }, "downloads": -1, "filename": "grokui.base-0.5.1.tar.gz", "has_sig": false, "md5_digest": "e36abe607d5b8af0d5c4a1066e1effe5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35990, "upload_time": "2011-03-01T11:16:33", "url": "https://files.pythonhosted.org/packages/86/01/ba957d74bebf9d3370b0b7f60d4c46d2313de55dc3b3b5609a75621995fb/grokui.base-0.5.1.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "ffcb8befbe22855a97a1e9686f72ae06", "sha256": "4cc2f943d7690e907775dbf1634a9276b4df420977a2763a27385ad144bb8dab" }, "downloads": -1, "filename": "grokui.base-0.6.tar.gz", "has_sig": false, "md5_digest": "ffcb8befbe22855a97a1e9686f72ae06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35955, "upload_time": "2011-07-14T15:58:49", "url": "https://files.pythonhosted.org/packages/30/64/bb3a2f1ae32c0294d9d43930a5448ccd5e960d00abba9788255e5b7030af/grokui.base-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "b346ddf5808ccf51fd92432cb08cea15", "sha256": "6daf3f6671e9464eaa5236aa0ed62280e815d68e78bfe5a48c013fec3b4dd974" }, "downloads": -1, "filename": "grokui.base-0.7.tar.gz", "has_sig": false, "md5_digest": "b346ddf5808ccf51fd92432cb08cea15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34465, "upload_time": "2012-05-02T11:28:56", "url": "https://files.pythonhosted.org/packages/41/70/312f34b5fe7fb1aef5bf285ea440bb600340cbc48bb3721704ab2d17e183/grokui.base-0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b346ddf5808ccf51fd92432cb08cea15", "sha256": "6daf3f6671e9464eaa5236aa0ed62280e815d68e78bfe5a48c013fec3b4dd974" }, "downloads": -1, "filename": "grokui.base-0.7.tar.gz", "has_sig": false, "md5_digest": "b346ddf5808ccf51fd92432cb08cea15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34465, "upload_time": "2012-05-02T11:28:56", "url": "https://files.pythonhosted.org/packages/41/70/312f34b5fe7fb1aef5bf285ea440bb600340cbc48bb3721704ab2d17e183/grokui.base-0.7.tar.gz" } ] }