Translations of this page?:

Default Locking

DokuWiki locks pages, which is a great thing.

My only beef is: since individual sections can be 'edited' - it would be nice if the locking mechanism only locked that section, versus the entire document.

Any thoughts?

See 444
A conflict resolution mechanism like the one used in PHPwiki would be great. It would then be easier to work together on a big page.




Possible Solution (by t.h.):

This is very straight forward. I need someone to build this for me, I currently have a bounty on it. Please help me out, and dokuwiki.

Solution: Partial Locking Anchor Tag

Overview

When a user edits a section, then immediately lock that section by inserting into the document, two timedate-stamped anchor tags surround the section being edited, write that to disk, then when they save, go back and replace the text in between the anchor tags with the new data.


Technical Flowchart

  1. A user clicks to edit a part of a page
  2. System does normal check if this page is locked.
  3. IF page not locked:
    1. Check if a partial lock in this section is in place, by:
      1. checking this section has a ”#!beginlock:” above it AND

> - a ”#!endlock:” below it

  1. To be specific, if there is a ”#!beginlock:” above but no ”#!endlock:” between the beginlock and were the edit is occuring, etc (see example below if you are already lost)
  2. IF ALL these conditions are met, then there is No Partial lock on this section, SO:
  3. LOCK this section by:
  4. placing a ”#!beginlock:TIMESTAMP” directly above the section the user is editing, and
  5. placing a ”#!endlock:TIMESTAMP” directly below the section
  6. Now WRITE the file to the server
  7. Now allow the user to edit that section like it normally would.
  8. When the user saves, open the File he/she is editing.
  9. Find the same ”#!beginlock:” / ”#!endlock:” sections and replace the text within it, with the new text,
  10. Remove the original #!beginlock/#!endlock tags
  11. Write the file back to the server

DONE


EXAMPLE

Here is what the Wiki Data file would look like during all stages of the scenario presented above:



Document data txt before being edited:

====== Header 1 ======
some text
====== Header 2 ======
some text
====== Header 3 ======
some text

\\
Someone clicks “edit” under Header 2:

====== Header 1 ======
some text
#!beginlock:20060615-14:33:09.54
====== Header 2 ======
some text
#!endlock:20060615-14:33:09.54
====== Header 3 ======
some text

\\
During the edit, someone else had edited and saved Section 1 using the same method:

====== Header 1 ======
some text. some more text, 
these lines have been added by another user
blah blah blah
====== a new Header has been added ======
some more text
#!beginedit:20060615-14:33:09.54
====== Header 2 ======
some text
#!endedit:20060615-14:33:09.54
====== Header 3 ======
some text

\\
NOW when this user goes to submit his new edits for section 2, the system just replaces whats between the datestamped keys:

====== Header 1 ======
some text. some more text, 
these lines have been added by another user
blah blah blah
====== a new Header has been added ======
some more text
#!beginedit:20060615-14:33:09.54    <
====== Header 2 ======              <-------- **THIS TEXT IS REPLACED**
some text                           <
#!endedit:20060615-14:33:09.54      <
====== Header 3 ======
some text



contact me if you can make these updates and i'll pay you US $45.00 via paypal. thanks. -tim(.no.s.p.8.m.)(8t)simulat(d07)com

Would be even more efficient if the lock is not inserted in the data page itself but in a separate file. For exemple you can insert in the lock file the beginning and ending line number block. “Just” need to prevent full page editing while partialy editing the page. And prevent partial editing while full editing a page.
I think writing lock data in the page data is agasint the philosophy of having an always hunman readable data file.

Info

Has this plugin been looked into? If not could we hire someone to make this happen e.g. We all contribute to this plugin. I will pay towards this!!!

 
wiki/discussion/locking-unlocking.txt · Last modified: 2007/03/14 20:08 by 74.121.32.142
 
Imprint Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsTranslate