{ "info": { "author": "4teamwork AG", "author_email": "mailto:info@4teamwork.ch", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Framework :: Plone :: 4.3", "Framework :: Plone :: 5.1", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "``ftw.trash`` is a Plone addon modifying the behavior when deleting content.\nWhen a user deletes content, it will actually not be deleted but marked as trashed.\nTrashed content can then be restored when needed.\n\n.. contents:: Table of Contents\n\nInstallation and usage\n======================\n\n- Be aware that ``ftw.trash`` requires and installs ``collective.deletepermission``.\n- Add ``ftw.trash`` to the eggs in your buildout configuration:\n\n ::\n\n [instance]\n eggs +=\n ...\n ftw.trash\n\n- Install the ``ftw.trash`` addon in Plone (Addons control panel or portal_setup or quickinstaller).\n- Deleting content looks exactly as in standard Plone, but it does not actually delete the content\n but only hide it.\n- Administrators can restore content with a global trash view, accessible via the user menu.\n- Personal trashes are not implemented at the moment.\n\n.. image:: https://github.com/4teamwork/ftw.trash/raw/master/docs/trash.png\n\n\nQuerying\n--------\n\nThe catalog is patched, so that it includes the default query ``{'trashed': False}``.\nThis makes sure that we only work with not trashed objects by default.\n\nIf you want to access trashed objects, you can simply use the query keyword ``trashed``\nwith one of these values:\n\n- ``False``: only return objects which are not trashed.\n- ``True``: only return objects which are trashed.\n- ``None``: do not apply \"trashed\" filter, return trashed and not trashed objects.\n\nThese filters only apply when ``portal_catalog.searchResults`` is used.\nWhen using ``portal_catalog.unrestrictedSearchResults`` the behavior is different,\nespecially for ``trashed=None``, since this method is not patched.\n\n\nMethods for trashing and deleting\n---------------------------------\n\n``ftw.trash`` patches ``manage_delObjects`` so that it trashes the content instead of deleting\nit. ``ftw.trash`` also adds new methods:\n\n- ``parent.manage_trashObjects([id1, id2, ..])``: trashes the contents.\n- ``parent.manage_immediatelyDeleteObjects(([id1, id2, ..])``: immediately deletes the contents\n without trashing it.\n- ``parent.manage_delObjects([id1, id2, ..])``: trashes the contents. If called from ZMI (or\n within link integrity checker), the content is immediately deleted.\n\nThe patches are applied on the site root, on DX- and on AT-folders when ``ftw.trash``\nis installed in the path.\nFor the methods to work properly, the Generic Setup profile must be installed as well.\n\nManipulate condition for restoring\n==================================\n\nBy default, restoring a page can be compared to adding a new page to its container.\nTherefore we require the ``Add portal content`` permission on the parent.\nThis may depend on the application and the content type though: there are content types\nwhich can be seen as part of the content of their parents, in which case we'd like to\nrequire the ``Modify portal content`` permission for restoring instead.\nTherefore this behavior can be manipulated by simply registering an adapter for the restored\ncontent for which we want to change the behavior.\n\nExample:\n\n.. code::python\n\n @implementer(IIsRestoreAllowedAdapter)\n @adapter(IMyType, IMyBrowserLayer)\n def is_restore_allowed_for_my_type(context, request):\n parent = aq_parent(aq_inner(context))\n return getSecurityManager().checkPermission('Modify portal content', parent)\n\n\nEvents\n------\n\nThese object events are fired:\n\n- `ftw.trash.interfaces.IBeforeObjectTrashedEvent`: the object will be trashed.\n- `ftw.trash.interfaces.IObjectTrashedEvent`: the object has been trashed.\n- `ftw.trash.interfaces.IBeforeObjectRestoredEvent`: the object will be restored.\n- `ftw.trash.interfaces.IObjectRestoredEvent`: the object has been restored.\n\n\nInternals\n=========\n\n- When content is deleted, it is marked as ``ITrashed`` and ``IRestorable``, children are only\n marked as ``ITrashed``.\n- Only the root node of the deleted structure can be restored and thus provides ``IRestorable``.\n Restoring children without their deleted parents cannot work since the parent is missing.\n- Trashed content is not moved.\n- The catalog's ``searchResults`` method is patched so that it filters trashed objects by default.\n- The ``contentItems`` method is patched to exclude trashed content.\n It is used for ``listFolderContents`` and ``getFolderContents``.\n- Trashed content is prevented from beeing published / accessible through the browser unless\n the user has the ``Manager`` role.\n- For restoring content, the permissions ``Restore trashed content`` and ``Add portal content``\n are required. The ``Restore trashed content`` is granted by default to the roles\n ``Manager`` and ``Site Administrator`` on the site root.\n\nDevelopment\n===========\n\n1. Fork this repo\n2. Clone your fork\n3. Shell: ``ln -s development.cfg buildout.cfg``\n4. Shell: ``python bootstrap.py``\n5. Shell: ``bin/buildout``\n\nRun ``bin/test`` to test your changes.\n\nOr start an instance by running ``bin/instance fg``.\n\n\nLinks\n=====\n\n- Github: https://github.com/4teamwork/ftw.trash\n- Issues: https://github.com/4teamwork/ftw.trash/issues\n- Pypi: http://pypi.python.org/pypi/ftw.trash\n\n\nCopyright\n=========\n\nThis package is copyright by `4teamwork `_.\n\n``ftw.trash`` is licensed under GNU General Public License, version 2.\n\nChangelog\n=========\n\n\n1.5.1 (2019-10-18)\n------------------\n\n- Do not check security recursively when trashing in order to have\n the same behavior as standard Plone. [jone]\n\n\n1.5.0 (2019-10-02)\n------------------\n\n- Let ``contentItems``, ``listFolderContents`` and ``getFolderContents`` no longer return trashed content. [jone]\n\n\n1.4.1 (2019-07-25)\n------------------\n\n- Make it possible to delete single items in the trash view. [jone]\n\n\n1.3.1 (2019-04-23)\n------------------\n\n- Clean trash, even if there is not enough permission to delete the actual item. [mathias.leimgruber]\n\n\n1.3.0 (2018-12-17)\n------------------\n\n- Add Plone 5.1 support. [jone]\n\n\n1.2.1 (2018-11-13)\n------------------\n\n- Patch `Products.PloneFormGen` to make it aware of trashed objects [Nachtalb]\n\n\n1.2.0 (2018-08-16)\n------------------\n\n- When restoring a file, redirect to /view so that the file is not downloaded. [jone]\n- Provide a manage_immediatelyDeleteObjects method. [jone]\n- Fix cleaning trash when there is a parent and a child in the trash at once. [jone]\n- Fix and translate error message when trying to restore child of trashed parent. [jone]\n\n1.1.1 (2018-08-03)\n------------------\n\n- Show changelog on pypi. [jone]\n\n1.1.0 (2018-08-03)\n------------------\n\n- Do not restore earlier trashed children when restoring parent. [jone]\n- Allow deleting content from ZMI. [jone]\n- Fire events when trashing and restoring object. [jone]\n- Do not intercept link integrity checker. [jone]\n- Add \"clean trash\" functionality to trash view. [jone]\n\n\n1.0.0 (2018-07-05)\n------------------\n\n- Initial implementation [jone]", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/4teamwork/ftw.trash", "keywords": "ftw trash", "license": "GPL2", "maintainer": "", "maintainer_email": "", "name": "ftw.trash", "package_url": "https://pypi.org/project/ftw.trash/", "platform": "", "project_url": "https://pypi.org/project/ftw.trash/", "project_urls": { "Homepage": "https://github.com/4teamwork/ftw.trash" }, "release_url": "https://pypi.org/project/ftw.trash/1.5.1/", "requires_dist": null, "requires_python": "", "summary": "A Plone addon introducing a trash with restore functionality.", "version": "1.5.1" }, "last_serial": 5995384, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "b853c9c8632f793c3a4cd425cf30d305", "sha256": "d15157055e27430ce365838e05eb730359808bc45c95aafdca532e933ee019f3" }, "downloads": -1, "filename": "ftw.trash-1.0.0.tar.gz", "has_sig": false, "md5_digest": "b853c9c8632f793c3a4cd425cf30d305", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 269009, "upload_time": "2018-07-05T11:46:15", "url": "https://files.pythonhosted.org/packages/d3/2a/2f4eb2ecb15d3c26c100665b97ef8a9e3b39e0225508f03a68ec54bcd763/ftw.trash-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "57932d2aa3f48ec7dbfcfc19d61e8011", "sha256": "43bcddc8acde860997f8d725d75be89e68a43f827123ef92deb83ea0617ce824" }, "downloads": -1, "filename": "ftw.trash-1.1.0.tar.gz", "has_sig": false, "md5_digest": "57932d2aa3f48ec7dbfcfc19d61e8011", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 274580, "upload_time": "2018-08-03T07:50:59", "url": "https://files.pythonhosted.org/packages/ff/65/2ecb71168ebdbaa518db88221820fc5799b8811cc1980039f2d937a9e6a0/ftw.trash-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "ade11c98125848eea709cda960d4ead6", "sha256": "10c380e9790f0f1505de247c55ad2213defc2e0bab69edc5c7863b7b398bf94d" }, "downloads": -1, "filename": "ftw.trash-1.1.1.tar.gz", "has_sig": false, "md5_digest": "ade11c98125848eea709cda960d4ead6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 274981, "upload_time": "2018-08-03T08:04:55", "url": "https://files.pythonhosted.org/packages/32/95/a54847e2d044788780e769b9aa50a86daa7d96d0c543ba5da53103616987/ftw.trash-1.1.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "4680838148bc17272ad01bb76628a9ba", "sha256": "4f49b9ca17ee54c6e43ed3a103efbf81d1a55e798aefcbe8aa38fc4202412f1d" }, "downloads": -1, "filename": "ftw.trash-1.2.0.tar.gz", "has_sig": false, "md5_digest": "4680838148bc17272ad01bb76628a9ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 274239, "upload_time": "2018-08-16T12:29:31", "url": "https://files.pythonhosted.org/packages/e2/83/3075bc78c66f0eb782e97853cf791c50392eba8e228bc1b64dec29945ede/ftw.trash-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "bccbf44418cf63303f757779388f1dff", "sha256": "ccea76e74fe65de22dfaaaf04949f96db67ab9b3c69cc2579be92f58cacb60e2" }, "downloads": -1, "filename": "ftw.trash-1.2.1.tar.gz", "has_sig": false, "md5_digest": "bccbf44418cf63303f757779388f1dff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 277474, "upload_time": "2018-11-13T08:38:20", "url": "https://files.pythonhosted.org/packages/2d/32/3ee355be354c2581195229a9e51ab9307e422b7bb73565b944cf3a09eda5/ftw.trash-1.2.1.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "3b764754b2799474362b2d9e15b980c3", "sha256": "dc8a6ff42519484f2ab0025a0cd69c8b5a26da6f0779bdb2ede96173e51d1939" }, "downloads": -1, "filename": "ftw.trash-1.3.0.tar.gz", "has_sig": false, "md5_digest": "3b764754b2799474362b2d9e15b980c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 277812, "upload_time": "2018-12-17T11:23:52", "url": "https://files.pythonhosted.org/packages/6f/20/7fa582e36079ba632829f0237bc315b9e1b796fe47d6d392c8e42f260011/ftw.trash-1.3.0.tar.gz" } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "7156bdd76d05b20e412271cb916d73db", "sha256": "d6d0635594159e26dabe76b25d93234357d1c9fc26484e1ce0a6a14594a6e722" }, "downloads": -1, "filename": "ftw.trash-1.3.1.tar.gz", "has_sig": false, "md5_digest": "7156bdd76d05b20e412271cb916d73db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 278151, "upload_time": "2019-04-23T15:15:25", "url": "https://files.pythonhosted.org/packages/91/bc/f83f0e92663b2114022278a69ad50f3676e45de8eaf3dfd50877b691c135/ftw.trash-1.3.1.tar.gz" } ], "1.4.1": [ { "comment_text": "", "digests": { "md5": "d0a32439377b51acbf9a78e62a29cdaa", "sha256": "ed48693199d12aa0272ef999875ab67b0a62246c03d22db29f4f6b2647a32348" }, "downloads": -1, "filename": "ftw.trash-1.4.1.tar.gz", "has_sig": false, "md5_digest": "d0a32439377b51acbf9a78e62a29cdaa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 278716, "upload_time": "2019-07-25T13:42:10", "url": "https://files.pythonhosted.org/packages/56/61/b997b4ba14e34c9700b40d541d3d7ff4142a922b9fd38e6062f03208d62a/ftw.trash-1.4.1.tar.gz" } ], "1.5.0": [ { "comment_text": "", "digests": { "md5": "96f3566ec5f5e663553264383c9742d5", "sha256": "ff87a3e55c819a71ed3130cf2d26127b8573d13149dd190d39d83559aff2e81a" }, "downloads": -1, "filename": "ftw.trash-1.5.0.tar.gz", "has_sig": false, "md5_digest": "96f3566ec5f5e663553264383c9742d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 279719, "upload_time": "2019-10-02T15:06:11", "url": "https://files.pythonhosted.org/packages/9b/66/40985d0a42f2adb1211c80a259e91738e7b74bc009215d9664631795dda7/ftw.trash-1.5.0.tar.gz" } ], "1.5.1": [ { "comment_text": "", "digests": { "md5": "c8a02bc87d1ca5e03829bcc2e19d564d", "sha256": "835686875a62005be983660ab902e52cb53c669b3e15466cea6d899b2d4c8374" }, "downloads": -1, "filename": "ftw.trash-1.5.1.tar.gz", "has_sig": false, "md5_digest": "c8a02bc87d1ca5e03829bcc2e19d564d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 280145, "upload_time": "2019-10-18T12:29:31", "url": "https://files.pythonhosted.org/packages/a3/32/70289718c8bfe980b23990202acceaedde508a3cb3248ea691549c071cdf/ftw.trash-1.5.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c8a02bc87d1ca5e03829bcc2e19d564d", "sha256": "835686875a62005be983660ab902e52cb53c669b3e15466cea6d899b2d4c8374" }, "downloads": -1, "filename": "ftw.trash-1.5.1.tar.gz", "has_sig": false, "md5_digest": "c8a02bc87d1ca5e03829bcc2e19d564d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 280145, "upload_time": "2019-10-18T12:29:31", "url": "https://files.pythonhosted.org/packages/a3/32/70289718c8bfe980b23990202acceaedde508a3cb3248ea691549c071cdf/ftw.trash-1.5.1.tar.gz" } ] }