{ "info": { "author": "Quadra Informatique", "author_email": "plone@quadra-informatique.fr", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Plone", "Framework :: Zope2", "Intended Audience :: End Users/Desktop", "Intended Audience :: Information Technology", "Intended Audience :: Other Audience", "Natural Language :: English", "Natural Language :: French", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.4", "Topic :: Utilities" ], "description": ".. contents::\r\n\r\n- Questions and comments to Quadra Informatique \r\n- Report bugs to Quadra Informatique \r\n\r\nIntroduction\r\n============\r\n\r\nThis package was created after encountering a problem with the plone.app.users.userdataschema.IUserDataSchemaProvider utilty override.\r\nAs this utility is unnamed, you can override it only once in all packages. We had to add extra fields on our personal-information form from various packages, so this package was created with the idea of managing multiple sources overrides of the personal-information form and properties.\r\n\r\nThis eggs allows to override as many times as you want the personal preferences of your users by adding extra fields by using adapters.\r\nBy adding extra fields, you can specify your own getters & setters if you don't want your field to be manage as a user property.\r\nYou'll also be able to add comptabile widgets for the personal preferences' form fields.\r\n\r\nThe docs directory contains all necessary steps about server configuration\r\nbefore to install this egg. These documents can be distributed separately under\r\nthe specified license in each of them.\r\n\r\nThese package was initiated by Quadra Informatique .\r\n\r\nHow-to\r\n======\r\n\r\nThere are three interfaces you need to know:\r\n\r\ncollective.customizablePersonalizeForm.adapters.interfaces.IExtendedUserDataSchema(Interface):\r\n\r\n def getSchema(self,):\r\n\r\ncollective.customizablePersonalizeForm.adapters.interfaces.IExtendedUserDataPanel(Interface):\r\n \r\n def getProperties(self,):\r\n\r\ncollective.customizablePersonalizeForm.adapters.interfaces.IExtendedUserDataWidgets(Interface):\r\n\r\n def getWidgets(self,):\r\n\r\nAn adapter providing the IExtendedUserDataSchema allows to add additional fields by returning an Interface through its getSchema method.\r\n\r\nCarefull !\r\nIf you ever add a field on your form, you'll also need to declare a property with the same name as your field, allowing you to get and set your property.\r\nThat's why we use IExtendedUserDataPanel. An adapter providing this interface will return a list of strings through the getProperties method. \r\nThese strings are the names of the fields provided by your custom interface, like 'portrait' or 'fullname'.\r\nBy default the getters and setters of your fields will use Plone's member.getProperty and member.setProperty methods, using the memberdata to store the values. If you ever need to use your own getters and setters, you can return a dict instead of the name of your field, using this format:\r\n\r\n {'name' : 'your_field_name', 'getter': your_own_getter_method, 'setter': your_own_setter_method}\r\n\r\nSimple Override Example\r\n-----------------------\r\n\r\nA simple interface providing our field:\r\n\r\nclass ITestAdditionalDataSchema(Interface):\r\n\r\n test_field = schema.Bool(\r\n title=_(u'label_test_field_title', default=u'Test field'),\r\n description=_(u'label_test_field_description', default=u''),\r\n required=False,\r\n )\r\n\r\nA simple adapter that adapts the context and request, returning our interface\r\n\r\nclass TestSchemaAdapter(object):\r\n adapts(object, IBrowserRequest)\r\n implements(IExtendedUserDataSchema)\r\n\r\n def __init__(self, context, request):\r\n self.context = context\r\n self.request = request\r\n\r\n def getSchema(self):\r\n return ITestAdditionalDataSchema\r\n\r\nNow we create an adapter that will declare a 'test_field' property, we didn't specify a getter and setter so this property will act as a memberdata property (be sure to declare it via memberdata_properties.xml)\r\n\r\nclass TestPropertiesAdapter(object):\r\n adapts(object, IBrowserRequest)\r\n implements(IExtendedUserDataPanel)\r\n\r\n def __init__(self, context, request):\r\n self.context = context\r\n self.request = request\r\n\r\n def getProperties(self):\r\n return ['test_field']\r\n\r\nLet's susbscribe to the collective.customizablePersonalizeForm's interfaces to provide the personal-information form with our field\r\n\r\n \r\n\r\n \r\n\r\nCongratulations, a simple boolean field named 'test_field' should now be displayed in your form.\r\n\r\nCustom Widgets\r\n--------------\r\n\r\nYou may want to use a widget for your field. It can be done through the IExtendedUserDataWidgets interface.\r\nAll you have to do is mapping a field id with a valid custom_widget factory like the following example.\r\n\r\nclass TestWidgetAdapter(object):\r\n adapts(object, IBrowserRequest)\r\n implements(IExtendedUserDataWidgets)\r\n\r\n def __init__(self, context, request):\r\n self.context = context\r\n self.request = request\r\n\r\n def getWidgets(self):\r\n return [{'field': 'test_field', 'factory' : CheckBoxWidget},\r\n ]\r\n\r\n \r\n\r\nYour test_field will now use the widget factory you declared in the getWidgets method. You can also override the default Plone fields widgets using this method if you ever need to.\r\n\r\n\r\nChangelog\r\n=========\r\n\r\n2.0 (2011-09-07)\r\n----------------\r\n\r\n- Now working for Plone 4.x [jstegle]\r\n- Added 3 interfaces for subscription, provider schema, properties and widgets overrides [jstegle]\r\n- Overrides the default personal-information to manage widget customization [jstegle]\r\n- Overrides the default IUserDataSchemaProvider [jstegle]\r\n- Overrides the account-macro view to manage FileUpload fields that handles pictures [jstegle]\r\n- Added isImage constraint on the portrait field, allowing only images to be uploaded [jstegle]\r\n- Added tests and examples [jstegle]\r\n\r\n1.0.1 (2011-05-04)\r\n------------------\r\n\r\n- Added documentation [jstegle]\r\n\r\n1.0 (2011-04-XX)\r\n----------------\r\n\r\n- Added viewletmanager for the personalize_form [jstegle]\r\n- Added adaptor interfaces for validators and actions [jstegle]\r\n- Added self personalize_form, validation and action scripts [jstegle]\r\n- Works for Plone 3.x [jstegle]", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "personalize_form,customization", "license": "GPL", "maintainer": "Quadra Informatique", "maintainer_email": "plone@quadra-informatique.fr", "name": "collective.customizablePersonalizeForm", "package_url": "https://pypi.org/project/collective.customizablePersonalizeForm/", "platform": "all", "project_url": "https://pypi.org/project/collective.customizablePersonalizeForm/", "project_urls": { "Download": "UNKNOWN" }, "release_url": "https://pypi.org/project/collective.customizablePersonalizeForm/2.0/", "requires_dist": null, "requires_python": null, "summary": "Customizable personalize form for Plone", "version": "2.0" }, "last_serial": 787742, "releases": { "2.0": [ { "comment_text": "", "digests": { "md5": "1e27f417fb893fc11fb9b0e167b1b9e3", "sha256": "41d04687afcc79e62cb86f9b8ef2f9a7718e6f6db24db8359316f443e1938703" }, "downloads": -1, "filename": "collective.customizablePersonalizeForm-2.0-py2.6.egg", "has_sig": false, "md5_digest": "1e27f417fb893fc11fb9b0e167b1b9e3", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 29537, "upload_time": "2011-09-08T10:35:50", "url": "https://files.pythonhosted.org/packages/fb/d8/4434316e4b494df715e0907233d9c29c988c3076f1c7c4fc3c2ea487d0f0/collective.customizablePersonalizeForm-2.0-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "d3f09ac5d5bea684e2d2b21aaa992787", "sha256": "4f89082e248cbd779073be4b6db05c3dc9810e3c459b1659d2cfcc7e86cdf1cb" }, "downloads": -1, "filename": "collective.customizablePersonalizeForm-2.0.tar.gz", "has_sig": false, "md5_digest": "d3f09ac5d5bea684e2d2b21aaa992787", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13704, "upload_time": "2011-09-08T10:35:49", "url": "https://files.pythonhosted.org/packages/b0/e8/7e30b637e0e92c5d3d40d814a41a96d195c3a6559efd6ac28b01d2e974da/collective.customizablePersonalizeForm-2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1e27f417fb893fc11fb9b0e167b1b9e3", "sha256": "41d04687afcc79e62cb86f9b8ef2f9a7718e6f6db24db8359316f443e1938703" }, "downloads": -1, "filename": "collective.customizablePersonalizeForm-2.0-py2.6.egg", "has_sig": false, "md5_digest": "1e27f417fb893fc11fb9b0e167b1b9e3", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 29537, "upload_time": "2011-09-08T10:35:50", "url": "https://files.pythonhosted.org/packages/fb/d8/4434316e4b494df715e0907233d9c29c988c3076f1c7c4fc3c2ea487d0f0/collective.customizablePersonalizeForm-2.0-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "d3f09ac5d5bea684e2d2b21aaa992787", "sha256": "4f89082e248cbd779073be4b6db05c3dc9810e3c459b1659d2cfcc7e86cdf1cb" }, "downloads": -1, "filename": "collective.customizablePersonalizeForm-2.0.tar.gz", "has_sig": false, "md5_digest": "d3f09ac5d5bea684e2d2b21aaa992787", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13704, "upload_time": "2011-09-08T10:35:49", "url": "https://files.pythonhosted.org/packages/b0/e8/7e30b637e0e92c5d3d40d814a41a96d195c3a6559efd6ac28b01d2e974da/collective.customizablePersonalizeForm-2.0.tar.gz" } ] }