Trashcan for Plone. By Ecreall.
Project description
This is an implementation of a trashcan for Plone. This product monkey patch PloneCatalog.searchResults and PloneCatalog.__call__. Since version 1.2, this product works only on Plone >= 3.3 (included Plone 4.x).
This product adds a “move to trashcan”/”restore” actions and a “open trashcan”/”close trashcan” links at the bottom of the page.
When you move an object to the trashcan, the object is actually not moved anywhere. It is just hidden from the search. What the action does is setting a marker interface ITrashed on the object and on sub-objects if the object trashed is a folder. It excludes the object from navigation too.
To see the trashed objects, you have to activate the trashcan mode with the “open trashcan” link at the bottom of your page. You can see it as a parallel world. You will see only trashed objects and the search now search only on trashed content.
In this mode you can restore objects. You can’t restore object if the parent is trashed. In this case you have to cut and paste the object in a non trashed folder to restore it.
When you are in trashcan mode, there is some verifications which takes place. You can’t paste an object in a trashed folder for example.
To come back to the normal mode, click on the “close trashcan” link at the bottom of the page. When trahscan mode is closed, it returns to the nearest parent not trashed.
Code repository: https://svn.ecreall.com/public/ecreall.trashcan/
Integration with CacheFu
In the plone-containers rule, edit “ETag Expression”, replace:
python:request.get('__cp',None) is not None
by:
python:str(request.get('__cp',None) is not None) +'|'+ str(request.SESSION.get('trashcan', None))
Integration with plone.app.caching
If you have a cache on folder views with plone.app.caching, add ‘trashed’ to your etags.
Changelog
1.7.2 (2017-01-04)
In isTrashcanOpened, use get_session instead of request.SESSION to avoid to create a session object if none exist currently. [vincentfretin]
1.7.1 (2016-12-05)
Better fix for getting the session in etag trashed. [vincentfretin]
1.7 (2016-12-02)
Fix getting the session in etag trashed. [vincentfretin]
Fix : don’t crash if we don’t have session_data_manager (e.g. in tests). [cedricmessiant]
1.6 (2014-11-14)
Use session_data_manager.getSessionData(create=False) to retrieve the session instead of doing request.SESSION because it uses session_data_manager.getSessionData(create=1) and so create a TransientObject for each webdav request (because it doesn’t use cookie) and you get finally a “MaxTransientObjectsExceeded: 1000 exceeds maximum number of subobjects 1000”
1.5.2 (2014-06-02)
HTML: remove title from action img. [thomasdesvenain]
Doesn’t try to no longer provide ITrashed in pasteObject subscriber if we are actually in a RemovedObjectEvent. This fixes removing collective.alias content. [vincentfretin]
1.5.1 (2013-10-02)
Fix use BooleanIndex. [thomasdesvenain]
1.5 (2013-09-18)
Trash and restore notify events on content. [thomasdesvenain]
Added more metadata package. [macagua]
Rename README file. [macagua]
Updated master template and translations. [macagua]
Added Spanish translation. [macagua]
Added more improvements about i18n. [macagua]
Added genericsetup uninstall profile. [macagua]
Updated bash script for update and generate gettext files. [macagua]
Added .gitignore file. [macagua]
Added ajax mode for object_restore and object_trash scripts. [thomasdesvenain]
Safe unicode for portal messages. [thomasdesvenain]
Added api module with shortcut methods. [thomasdesvenain]
We can force trashed index search. [thomasdesvenain]
1.4.1 (2012-09-17)
Fixed MANIFEST.in.
1.4 (2012-09-17)
Optimization: reindex only trashed and object_provides index at trash or restore. [thomasdesvenain]
Remove grok dependency. [thomasdesvenain]
4.2.1 Compatibility. [thomasdesvenain]
New UI to open / close trashcan. [thomasdesvenain]
Fix security issue. [thomasdesvenain]
1.3.1 (2011-12-22)
Use BooleanIndex for trashed index. [thomasdesvenain]
1.3.0 (2011-09-22)
Plone 4.x compatibility.
Added an Etag for plone.app.registry. [thomasdesvenain]
We may not acquire a REQUEST in searchResults, fixed it. [vincentfretin]
1.2.1 (2010-09-23)
Trashcan message is of ‘warning’ class.
Changed label of trashcan warning: exit trashcan button “may not be at the bottom of the page”
Replaced “five:implements class” directive by “class implements” directive.
Test if SESSION exists in REQUEST before getting it. It’s needed for test environment where you don’t have SESSION.
1.2 (2009-12-18)
Removed livesearch_reply.py, queryCatalog.py. Now patch directly PloneCatalog with collective.monkeypatcher. This fixes trashed elements seen in collections. This version requires Plone 3.3. [vincentfretin]
1.1 (2009-03-11)
Initial public release.
Add an empty canTrash script, you can overwrite it in another product.
Exclude from nav trashed objects. [vincentfretin]
1.0 (2009-02-23)
Created product with ZopeSkel. [Vincent Fretin and Michael Launay]
Download
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ecreall.trashcan-1.7.2.tar.gz
.
File metadata
- Download URL: ecreall.trashcan-1.7.2.tar.gz
- Upload date:
- Size: 32.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 770d74815040da99ab45757bb31221b82bb687b769e1c02ba66a9c279c68e4cf |
|
MD5 | dd4bb0623f408a7dc4e099a289b48c45 |
|
BLAKE2b-256 | 56c3946a5eefd5f6bbb6d810b2bb09dc30d07bd86db2c292c71cf3c3ffc34aa7 |