#145: Locking
- Proposed by
- Raphael Ritz
- Seconded by
- Alexander Limi
- Proposal type
- Architecture
- Assigned to release
- Repository branch
- plip_145_TTWLocking
- State
- completed
Motivation
Prevent concurrent editing through-the-web.
Proposal
- Introduce a new marker interface for TTW-triggered locking support "ITTWLockable"
- Introduce an event "EditBeginsEvent" that's fired whenever someone starts working on any item.
- Introduce an event "EditEndsEvent" that's fired whenever someone finishes working on any item.
- Provide an event subscriber that triggers the locking from "EditBeginsEvent" if appropriate
- Put meta data into object annotations (like who and when). Follow-up: turns out this is not needed as DAV locks do that already.
- Release the lock on the "EditEndsEvent" and also when people press 'cancel' or browse away from the edit form
- Include a means to easily remove the lock through the Plone UI
- Expose locking status information on the object's view.
Implementation
- look at PloneLockManager from Enfold
- use Zope 2's dav locks
- use Zope 3 interfaces and events
Risks
- side effects on sharing etc (general object modifications)
- is locking the right thing or would a lease be better?
Progress log
Apr 28, 5pm: Almost completed exept for time-out configuration and keep-alive checks.
Participants
- Jean-Francois Roche
- Osman Tartamoglu
- Alex Limi
- Danny Bloemendaal
- Raphael Ritz
Yup, but...
The versioning, custom lock types etc is all fine and dandy, but let's get the basic use case in place first.
The big challenge here is as much in how you present it to the user as in the actual implementation. Locking sucks, and we need to minimize that pain. :)
explicit and compatible is less pain.
Sounds good
Implicit locking is a necessity for any kind of usable experience when it comes to locking, though.
But by all means, making it more consistent with the current semantics is a good thing - go ahead. :)
please join in
Hi Kapil,
just a few comments from my side:
(i) as of now, we didn't introduce any new locking mechanism - all we do is to trigger the WebDAV locks for TTW edits as well.
(ii) WRT to the names of the events: I was kind of desperately seeking names that reflect the process (editing) more than the action (locking) assuming it might be more obvious to others who might also want to subscribe to these events - but I couldn't care less - if there are better names for this they should of course be used.
(ii) WRT lock managing: any contribution enhancing the lock manager is more than welcome ;-)
Just my 2 cents
Raphael
Zope 3's WebDAV improved
http://www.mail-archive.com/zope3-dev@zope.org/msg05982.html
Looks like we might soon be able to use the Z3 webdav machinery for locking right away.
needs work imo