Manage link integrity in Plone.
Project description
plone.app.linkintegrity
Overview
This package tries to integrate PLIP 125, link integrity checking, into Plone. It is making use of the zope3 event system in order to modify Plone itself as little as possible.
Status
The code handles one of the two use cases of PLIP 125, deleting an item. Whenever an object that is referred to by another one via an <a> or <img> tag is going to be deleted, Plone’s regular flow of actions is “interrupted” and a confirmation form is presented to the user. If they then decide to indeed delete the object, the original request will be replayed and this time followed through, thereby breaching link integrity of the site.
This process is implemented independently of how the object is deleted (as long as OFS.ObjectManager’s _delObject is used ultimatively) and what request is used to do it. A more detailed — albeit slightly outdated — explanation of how this works can be found in NOTES.txt.
The second use case of PLIP 125, which provides better handling of moved items, is implemented by plone.app.redirector.
Using plone.app.linkintegrity in a WSGI application using repoze.zope2
If you are deploying Plone using repoze.zope2 in a WSGI pipeline, then the stock LinkIntegrity won’t work. To make it work, you need the following:
repoze.zope2 1.0.2 or later
ZODB 3.8.2 or later
These two will ensure that the “views on exceptions” functionality, which plone.app.linkintegrity uses, is available.
Next, make sure that the repoze.retry#retry middleware is used, and that it will handle stock Retry exceptions. With repoze.retry 0.9.3 or later, that is the default. With earlier versions, you can configure it explicitly. For example:
[app:zope2] paste.app_factory = repoze.obob.publisher:make_obob repoze.obob.get_root = repoze.zope2.z2bob:get_root repoze.obob.initializer = repoze.zope2.z2bob:initialize repoze.obob.helper_factory = repoze.zope2.z2bob:Zope2ObobHelper zope.conf = /Users/optilude/Development/Plone/Code/Build/uber/plone3.x-repoze/parts/instance-debug/etc/zope.conf [filter:retry] use = egg:repoze.retry#retry retryable = ZODB.POSException:ConflictError ZPublisher.Publish:Retry [filter:errorlog] use = egg:repoze.errorlog#errorlog path = /__error_log__ keep = 50 ignore = paste.httpexceptions:HTTPUnauthorized paste.httpexceptions:HTTPNotFound paste.httpexceptions:HTTPFound [pipeline:main] pipeline = retry egg:repoze.tm#tm egg:repoze.vhm#vhm_xheaders errorlog zope2 [server:main] use = egg:Paste#http host = 127.0.0.1 port = 8080 threadpool_workers = 1 threadpool_spawn_if_under = 1
Changelog
1.3a1 - 2009-11-17
Access the subtopics page directly since the tab is now hidden by default. [davisagli]
The [changeset:30835 test] for #7784 was borked after all. While the transaction is properly recorded when testing through-the-web, both with and without ZEO, the test either shows a different transaction (for Plone 3.x) or nothing at all (for Plone 4.0). This might have to do with the way DemoStorage handles undos/aborts, but for now the test simply gets disabled again… :( [witsch]
Add test to verify the [changeset:30810 fix] for the [ticket:7784 missing undo log entries] after removing items via the “delete” action (refs #7784) [witsch]
1.2 - 2009-10-10
Also catch NotFound exceptions when trying to resolve linked objects. [optilude]
1.1 - 2009-08-31
Make compatible with repoze.zope2. See README.txt for notes on how to deploy. [optilude]
Don’t use id() to record confirmed items. It can change on request boundaries. Use an encoded _p_oid instead. [optilude]
Also regard traversal adapters when trying to resolve links into their corresponding objects. [witsch]
Fix some tests to make sure that text values are treated as text/html in Zope 2.12, whose zope.contenttype is stricter when guessing the mimetype. [davisagli]
Don’t install the exception hook in Zope 2.12 where it is no longer needed and breaks exception handling. [davisagli]
1.0.12 - 2009-06-03
Compare UIDs instead of objects during cleanup of breach information in order to avoid expensive hashing in “… in …” expressions. This makes removing linked objects much faster. [regebro]
1.0.11 - 2008-11-15
Fix code to not silently swallow ConflictErrors. [witsch]
Fix issue with dangling references to already removed objects. Fixes http://dev.plone.org/plone/ticket/8349 and http://dev.plone.org/plone/ticket/8390. [witsch]
1.0.10 - 2008-07-07
Fixed the recognizing of links to files (or any object) with a space in the id. Fixes #8167. [maurits]
Updated tests to work with LinguaPlone by unmarking the creation flag on new objects. [maurits]
1.0.9 - 2008-05-08
Use acquisition API to support the “philikon-aq” branch. [witsch]
Fix a problem with updating link integrity references during a request which trying to delete multiple other objects. [witsch]
1.0.8 - 2008-04-21
Added missing i18n markup to confirmation.pt, also fixing http://dev.plone.org/plone/ticket/7995. [witsch]
1.0.7 - 2008-03-27
Fixed accidental removal of references not related to link integrity. [dunny]
1.0.6 - 2008-03-08
Added missing namespace declaration to avoid the warning about it. [wiggy]
1.0.5 - 2008-02-13
Added missing i18n markup to confirmation.pt. This closes http://dev.plone.org/plone/ticket/7688. [hannosch]
1.0.4 - 2008-01-03
Handle IObjectRemovedEvents with no attached request object. [witsch]
Updated tests to work with Plone 4.0. [hannosch]
Referencing items are now listed in alphabetical order [witsch]
1.0.3 - 2007-12-05
Fixed setting up the test layer after GenericSetup update [witsch]
1.0.2 - 2007-11-07
Fixed parser error when handling malformed HTML [witsch]
Fixed security issue due to using pickles (see CVE-2007-5741) [witsch]
1.0.1 - 2007-09-10
Added view for updating link integrity information for all site content [witsch]
Made code in info.py more tolerant when encountering missing property sheets. [hannosch]
1.0 - 2007-08-16
Minor bug fixes and enhancements [witsch]
1.0rc1.1 - 2007-07-12
Bug and test fixes after upgrade to Zope 2.10.4 [witsch]
1.0rc1 - 2007-07-08
Bugfixes & additional tests [witsch]
1.0b3 - 2007-05-04
1.0b2 - 2007-04-30
Integration of Plone’s “delete confirmation” page [witsch]
1.0b1 - 2007-03-03
Fix tests in regard to changed folder_contents and unicode issues [witsch]
Updates to the monkey patch needed for five exceptions [wiggy]
1.0a2 - 2007-02-07
Bugfixes & other minor enhancements [witsch]
Eggification and move into plone.app namespace [optilude]
Proof of concept & initial version [witsch]
Initial package structure. [zopeskel]
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
Hashes for plone.app.linkintegrity-1.3a1.zip
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60f8c92782b0e0c5083b1f6c51e71f0221cec85aa9b1348be859e299fab971ed |
|
MD5 | ea72ccc751c1332562a43bb1344bef3b |
|
BLAKE2b-256 | 0894e8c008a76873d38a1784b4fd718803bfc2b498d615470f12c889908768fd |