{ "info": { "author": "Rafael Oliveira", "author_email": "rafaelbco@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "collective.contentgroup\n========================\n\nOverview\n--------\n\nThis package is a Plone add-on that allows to associate users groups with \ncontent objects. It works this way: the content type class implement \n``IObjectWithGroup``, normally inheriting from ``ObjectWithGroupMixin``,\nand this package takes care of creating a correspondent users group for each new \ncontent object.\n\nCompatibility\n-------------\n\nTested with Plone 3.2.3, *probably* works with 3.x and 4.x.\n\nExample usage\n-------------\n\nUse case: We want to create a ``Company`` content type. Each ``Company`` must \nhave a correspondent users group.\n\nFirst we create the content type class. It could be a common Archetype class,\nbut here we'll create a simpler one, without the AT base classes. We'll use\n``ObjectWithGroupMixin`` from the ``base`` module in order to get associated\ngroup support::\n \n >>> from zope.event import notify\n >>> from zope.app.container.contained import ObjectRemovedEvent\n >>> from Products.Archetypes.event import (ObjectInitializedEvent, \n ... ObjectEditedEvent) \n >>> from collective.contentgroup.base import ObjectWithGroupMixin\n >>> class Company(ObjectWithGroupMixin):\n ... __parent__ = None\n ...\n ... def __init__(self, id, title):\n ... self.id = self.__name__ = id\n ... self.title = title\n ... notify(ObjectInitializedEvent(self)) \n ...\n ... def getId(self):\n ... return self.id\n ...\n ... def Title(self):\n ... return self.title\n ...\n ... def setTitle(self, title):\n ... self.title = title\n ... notify(ObjectEditedEvent(self))\n ...\n ... def delete_me(self):\n ... notify(ObjectRemovedEvent(self))\n ... self.id = self.title = None\n \nNow we can create a ``Company`` instance and see if we get a correspondent\ngroup created::\n \n >>> from Products.CMFCore.utils import getToolByName\n >>> c = Company('acme', 'The ACME Corporation') \n >>> gtool = getToolByName(portal, 'portal_groups')\n >>> group = gtool.getGroupById(c.get_group_name())\n >>> group.getProperty('title') == c.get_group_title()\n True\n\nLet's check if the group's name and title were generated as expected by the\n``ContentWithGroupMixin`` class::\n\n >>> c.getId() in c.get_group_name()\n True\n >>> c.Title() in c.get_group_title()\n True\n \nLet's change the company title and see if the group's title also changes::\n\n >>> c.setTitle('ACME co.')\n >>> group = gtool.getGroupById(c.get_group_name())\n >>> group.getProperty('title') == c.get_group_title()\n True\n \nLet's delete the company and see if the group is also removed::\n\n >>> group_name = c.get_group_name() # Save the group name before it's \n >>> # deleted.\n >>> c.delete_me()\n >>> gtool.getGroupById(group_name) is None\n True\n \nCustomizing aspects of group creation, removal and edition\n----------------------------------------------------------\n\nThe group managing is done through the ``IGroupManager`` interface. An instance\nof this interface is acquired via adaptaion every time a group operation has\nto be done. One can customize the group managing operations by registering an\nadapter for an specific content type, providing ``IGroupManager``.\n\nThe default adapter is registered in ZCML like this::\n\n \n \nIn the ``groupmanager`` module there's also the ``DGPGroupsGroupManager`` which \nuses the DynamicGroupsPlugin.\nIt allows for creation of dynamic groups, i.e, the members of the group are\ndynamically calculated. \n \nCredits\n-------\n\n- Rafael Oliveira : Author. \n\nChangelog\n---------\n\n0.1b3 - 18mai2010\n^^^^^^^^^^^^^^^^^\n\n- Removed buggy cache in DynamicGroupsPlugin method.\n\n\n0.1b2 - 18mai2010\n^^^^^^^^^^^^^^^^^\n\n- Added support to DynamicGroupsPlugin, i.e, an IGroupManager which uses this\n plugin was created.\n- Added @@fix-content-groups view. \n \n0.1b1 - 15feb2010\n^^^^^^^^^^^^^^^^^\n\n- First 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.plone.org/svn/collective/collective.contentgroup", "keywords": "plone groups users", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "collective.contentgroup", "package_url": "https://pypi.org/project/collective.contentgroup/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/collective.contentgroup/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://svn.plone.org/svn/collective/collective.contentgroup" }, "release_url": "https://pypi.org/project/collective.contentgroup/0.1b3/", "requires_dist": null, "requires_python": null, "summary": "Plone add-on that allows to associate users groups with content objects", "version": "0.1b3" }, "last_serial": 787713, "releases": { "0.1b1": [ { "comment_text": "", "digests": { "md5": "32e22dad7ef766ab7725693a82b5229a", "sha256": "189ecc19634239b5bf459b11a721dcef60f9a880ae00a73fca71c142cf4568ea" }, "downloads": -1, "filename": "collective.contentgroup-0.1b1.zip", "has_sig": false, "md5_digest": "32e22dad7ef766ab7725693a82b5229a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13624, "upload_time": "2010-02-15T14:08:26", "url": "https://files.pythonhosted.org/packages/82/ab/17924b87c2dd310563864870ad31152a87989cb3de0858978ae2af2e7afe/collective.contentgroup-0.1b1.zip" } ], "0.1b1dev-r111006": [], "0.1b2": [ { "comment_text": "", "digests": { "md5": "83877382d0a4de4af2b8c0e162065719", "sha256": "3e179eafa3309ac1e45371958502801597c7ea66e7158c9dfbdb78039c8a8e6e" }, "downloads": -1, "filename": "collective.contentgroup-0.1b2.zip", "has_sig": false, "md5_digest": "83877382d0a4de4af2b8c0e162065719", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18099, "upload_time": "2010-05-18T23:05:23", "url": "https://files.pythonhosted.org/packages/77/67/e4e07d9bd4553a71b7bac9e5bd3555b038bced561b7bc4a764f1b63d3d80/collective.contentgroup-0.1b2.zip" } ], "0.1b3": [ { "comment_text": "", "digests": { "md5": "3f922ab8e11c38bc8bea64131a727950", "sha256": "8341dc1630e2c943af76e3047b790b55bc1e978b78da9f43c62c529b6acf61e1" }, "downloads": -1, "filename": "collective.contentgroup-0.1b3.zip", "has_sig": false, "md5_digest": "3f922ab8e11c38bc8bea64131a727950", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17911, "upload_time": "2010-05-19T00:35:31", "url": "https://files.pythonhosted.org/packages/5f/f5/f97fa7d4cf493b8e4aa862bfe187d09124bdcad9d9f986beacc0bf59471f/collective.contentgroup-0.1b3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3f922ab8e11c38bc8bea64131a727950", "sha256": "8341dc1630e2c943af76e3047b790b55bc1e978b78da9f43c62c529b6acf61e1" }, "downloads": -1, "filename": "collective.contentgroup-0.1b3.zip", "has_sig": false, "md5_digest": "3f922ab8e11c38bc8bea64131a727950", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17911, "upload_time": "2010-05-19T00:35:31", "url": "https://files.pythonhosted.org/packages/5f/f5/f97fa7d4cf493b8e4aa862bfe187d09124bdcad9d9f986beacc0bf59471f/collective.contentgroup-0.1b3.zip" } ] }