Forum OpenACS Q&A: Customizing File Storage to encorporate exclusive-write access

Hi,

I would like to modify the File Storage application to enable one person at a time to write-lock a file (or folder).

Here's the usage scenario. There might have 6 people that have write access to a Microsoft Project file. But we only want one person at a time to modify this file. What would be nice is to have two additional columns in the file page that shows the file is write-locked and the name of the person that has it locked. If it isn't write-locked, a person with write privileges can down-load the file. As a result of the download action, the file becomes write-locked. The person who has the exclusive write-lock on the file can check-off a box indicating the write-lock should be released.

Has anyone done something along these lines? Any suggestions as to how this could be accomplished by someone who has done minor tweaking of the code base?

Or, maybe the functionality is already available in another package and I'm just not seeing it.

Suggestions much appreciated.

Frank

Hi Frank,

great idea. This is a functionality that should make it into the content repository and be provided to all packages easily. You might not only want to lock files, but also content items in the CMS (to be build) or in the blogger....

OTOH, it is probably considerably easier to just implement it for file-storage.

I had done this on a documentation system I put together.

I created a checked_out_object table that consisted of the object_id, user_id, date when the item was checked out.  I then added a checked_out permission to the permission system.

I actually had an adminstravite group that checked things back in (configuration and documentation process rules).

I'll look around and see if I still have the code, but I have my doubts as that company was a bunch of SOBs.

If you do implement this for file-storage it would be "a good thing" if you looked at the WebDAV example and implemented it with that in mind. Eventually we want WebDAV working in file-storage and you could be a big help if you did.

Search for "Locking" on this page (HTTP Extensions for Distributed Authoring -- WEBDAV):
http://asg.web.cmu.edu/rfc/rfc2518.html