PostNuke

Flexible Content Management System

News

Stop overwriting my work!

Contributed by on Mar 19, 2007 - 02:58 PM

One of the new core features in PostNuke .8 is the "PageLock" module. This module can be used to restrict access to a certain page in such a way that only one user at a time has access to it. This can be used to avoid our classic concurrency problem:

  1. User A starts editing an article.

  2. User B edits the same article.

  3. User A saves his work.

  4. User B saves his work and thereby overwrites user A's work without knowing it.

If we add a page locking feature to the editing page then this would happen instead:

  1. User A starts editing an article.

  2. User B edits the same article. But the page is overlaid with a dark transparent skin that blocks the interface. In the middle there's a message "This page is locked by another user" plus some more detailed information about the lock.

  3. User B waits until A is finished editing.

  4. After some time user A commits his work and user B's window automatically reloads with the new data ready to edit.

This is what the PageLock module will do for you. When user A opens his window it will register it and start pinging the server (using AJAX) every X sec. to ensure the lock is kept. When user B opens his window then it is blocked, but keep pinging the server (also using AJAX) until user A releases the lock.

If you want to use this feature in your modules then please read more in the wiki.

The PageLock module has not yet been used in any of the AddOns modules except the HowToPnForms demo module. The reason is that it potentially may break something and we don't want yet another feature to postpone the .8 release.

Have fun!

1670