You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Carsten Eckelmann <ca...@webman.de> on 2001/08/30 15:39:33 UTC
Locking Resources via the WebDavServlet
Hi,
I have 3 questions:
1) I now have the WebDavServlet running with the hSQL database. I can
access the Server with Windows-Webfolders. Now I want the server to
lock a file for reading/writing, but I don't know how to configure the Domain.xml
properly.
I want the following behaviour:
User A: opens file f with e.g. WinWord and edits it.
User B: tries to open the same file --> but gets an access Error, since
this file is read&write-locked by User A.
User A: saves his changes. The file will now be unlocked.
User B: can now open the file and include her changes.
2) I'm using the hSQL db-engine now, but I would rather use Sybase.
Unfortunately the scripts provided on your webpage cannot work with
Sybase because varchar() is limited to 255 and both text/image cannot
be indexed and thus cannot be primary keys. I wonder why the uri
fields have to be so large (4000 chars and more!)? If anybody has
ported the script to sybase, please let me know.
3) Is versioning possible when using the FileContentStore for storing
content and JDBCDesriptorStore for storing structure?
Many thanks in advance,
Carsten.
I will include my Domain.xml.
Re: Re[2]: Locking Resources via the WebDavServlet
Posted by Remy Maucherat <re...@apache.org>.
> Hi,
>
> first of all my thanks for your quick reply!!
>
> Remy wrote:
> REMY> Slide has read locks for properties / revision tree / content (but
not for
> REMY> the namespace structure). Since we're allowed by WebDAV to expose
additional
> REMY> lock types, we could expose read locks (but Word wouldn't use them).
>
> Christopher Lenz wrote:
> CHRIS> there is no read-locking in WebDAV. In some applications (MS Office
too, IIRC),
> CHRIS> User B will only be able to open the file in write-protected mode,
because the
> CHRIS> app tries to lock the resource when opening it. normal GET requests
are never
> CHRIS> affected by a lock though.
>
> Do you think it's possible (or sensible) to write my own WebDavServlet
> where I would include the desired locking behaviour in the GET and PUT
> Method?
Yes, that would be a good solution. We won't do it as part of Slide, since
it would be a (minor) violation of the WebDAV specification.
> this is how I would like the GET Method to work:
> - if the resource is not locked, lock it with a given timeout for this
> user
> - if the resource is locked but by the same user, allow GET
> - deny access to all other users
Yes.
> this is how the PUT method should work:
> - if the resource is locked by the same user: perform PUT and unlock
> it
> - deny access to all other users.
That behavior should be equivalent to setting the enforceLockTokens flag to
false in the SlideToken.
The problem here is that Word won't attempt to steal locks.
For example, one can use DAV Explorer to get the locks tokens of the locks
he owns, and then use the lock token to write / unlock.
> With these two changes, I can even get WinWord to work in my way,
> right?
Yes.
Remy
Re[2]: Locking Resources via the WebDavServlet
Posted by Carsten Eckelmann <ca...@webman.de>.
Hi,
first of all my thanks for your quick reply!!
Remy wrote:
REMY> Slide has read locks for properties / revision tree / content (but not for
REMY> the namespace structure). Since we're allowed by WebDAV to expose additional
REMY> lock types, we could expose read locks (but Word wouldn't use them).
Christopher Lenz wrote:
CHRIS> there is no read-locking in WebDAV. In some applications (MS Office too, IIRC),
CHRIS> User B will only be able to open the file in write-protected mode, because the
CHRIS> app tries to lock the resource when opening it. normal GET requests are never
CHRIS> affected by a lock though.
Do you think it's possible (or sensible) to write my own WebDavServlet
where I would include the desired locking behaviour in the GET and PUT
Method?
this is how I would like the GET Method to work:
- if the resource is not locked, lock it with a given timeout for this
user
- if the resource is locked but by the same user, allow GET
- deny access to all other users
this is how the PUT method should work:
- if the resource is locked by the same user: perform PUT and unlock
it
- deny access to all other users.
With these two changes, I can even get WinWord to work in my way,
right?
Greetings,
Carsten.
Re: Locking Resources via the WebDavServlet
Posted by Remy Maucherat <re...@apache.org>.
> Hi,
>
> I have 3 questions:
>
> 1) I now have the WebDavServlet running with the hSQL database. I can
> access the Server with Windows-Webfolders. Now I want the server to
> lock a file for reading/writing, but I don't know how to configure the
Domain.xml
> properly.
>
> I want the following behaviour:
>
> User A: opens file f with e.g. WinWord and edits it.
> User B: tries to open the same file --> but gets an access Error, since
> this file is read&write-locked by User A.
> User A: saves his changes. The file will now be unlocked.
> User B: can now open the file and include her changes.
Some additional info on WebDAV locks in Slide : There were some problems
with locking support in some previous versions of Slide when the lock token
support was added.
Slide has read locks for properties / revision tree / content (but not for
the namespace structure). Since we're allowed by WebDAV to expose additional
lock types, we could expose read locks (but Word wouldn't use them).
> 2) I'm using the hSQL db-engine now, but I would rather use Sybase.
> Unfortunately the scripts provided on your webpage cannot work with
> Sybase because varchar() is limited to 255 and both text/image cannot
> be indexed and thus cannot be primary keys. I wonder why the uri
> fields have to be so large (4000 chars and more!)? If anybody has
> ported the script to sybase, please let me know.
255 chars is very problematic with the current JDBC store, because it stores
the full Uri of the object in that field.
Remy