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 kranga <kr...@k2d2.org> on 2004/09/15 14:57:50 UTC

Webdav spec question - lock-null and collection

Hi,
    What does the spec say in relation to the following scenario:

- You have a collection A that is locked. You create a lock-null resouce
under A called foo.bar. Now, this has to be created using a LOCK method
execution and you are likely to get a different token or the same token as
the parent collection.

The webdav specs say that any child of a collection that is locked (by
default with depth infinity) should also be automatically added to that
lock. However, if you create it with the same locktoken as the parent, then
an unlock on the parent collection will make the lock-null resource vanish,
which may not be desirable. However, if you create it with a different
lock-token, then it is against the spec that children of a locked collection
should be part of that lock. So do you create multiple locks? One for the
lock-token and one for the collection? In that case how do you honor a PUT
or MKCOL on it? I think you can only specify one lock in the lock-token
header??? What if you only support exclusive locks?

Thanks
K


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Webdav spec question - lock-null and collection

Posted by Stefan Eissing <st...@greenbytes.de>.
I think it should also be compatible when the lock on the collection is 
exclusive, but has depth 0.

//Stefan

Am 16.09.2004 um 14:20 schrieb Stefan Lützkendorf:

>
> Julian Reschke wrote:
>
>> Stefan Lützkendorf wrote:
>>>
>>>>     What does the spec say in relation to the following scenario:
>>>>
>>>> - You have a collection A that is locked. You create a lock-null 
>>>> resouce
>>>> under A called foo.bar. Now, this has to be created using a LOCK 
>>>> method
>>>> execution and you are likely to get a different token or the same 
>>>> token as
>>>> the parent collection.
>>>
>>>
>>> I think you should not be able to create a lock-null resource under 
>>> a locked
>>> collection.
>>> To work on a locked resource (e.g. to add a new member using MKCOL) 
>>> you have to
>>> provide the locktoken in the If header. But with the LOCK method the 
>>> If
>> Correct.
>>> header
>>> is used for refreshing locks (s. 7.8), so I would say you cant lock 
>>> under a
>> That's only partly correct. You need the If header for LOCK refresh, 
>> but that doesn't mean that any LOCK request with an If header is 
>> indeed a refresh request.
>> And yes, that's how you would add a lock-null resource to a locked 
>> collection. Note that this won't work unless the requested lock on 
>> the child is compatible with the one on the parent collection (that 
>> is, it's a shared lock).
> Ok, with shared lock it makes sense to use LOCK and If header. I'v 
> never
> used shared locks and so I always think locks as exclusive.
> Have you ever found a real scenario where shared  locks are usefull?
>
> Best regards,
> Stefan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Webdav spec question - lock-null and collection

Posted by Julian Reschke <ju...@gmx.de>.
Stefan Lützkendorf wrote:

> Ok, with shared lock it makes sense to use LOCK and If header. I'v never
> used shared locks and so I always think locks as exclusive.
> Have you ever found a real scenario where shared  locks are usefull?

Not really. I know that some Adobe clients use them, though.

Julian

-- 
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Webdav spec question - lock-null and collection

Posted by Stefan Lützkendorf <lu...@apache.org>.
Julian Reschke wrote:

> Stefan Lützkendorf wrote:
> 
>>
>>>     What does the spec say in relation to the following scenario:
>>>
>>> - You have a collection A that is locked. You create a lock-null resouce
>>> under A called foo.bar. Now, this has to be created using a LOCK method
>>> execution and you are likely to get a different token or the same 
>>> token as
>>> the parent collection.
>>
>>
>> I think you should not be able to create a lock-null resource under a 
>> locked
>> collection.
>> To work on a locked resource (e.g. to add a new member using MKCOL) 
>> you have to
>> provide the locktoken in the If header. But with the LOCK method the If 
> 
> 
> Correct.
> 
>> header
>> is used for refreshing locks (s. 7.8), so I would say you cant lock 
>> under a
> 
> 
> That's only partly correct. You need the If header for LOCK refresh, but 
> that doesn't mean that any LOCK request with an If header is indeed a 
> refresh request.
> 
> And yes, that's how you would add a lock-null resource to a locked 
> collection. Note that this won't work unless the requested lock on the 
> child is compatible with the one on the parent collection (that is, it's 
> a shared lock).
> 
Ok, with shared lock it makes sense to use LOCK and If header. I'v never
used shared locks and so I always think locks as exclusive.
Have you ever found a real scenario where shared  locks are usefull?

Best regards,
Stefan


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Webdav spec question - lock-null and collection

Posted by Julian Reschke <ju...@gmx.de>.
Stefan Lützkendorf wrote:
> 
>>     What does the spec say in relation to the following scenario:
>>
>> - You have a collection A that is locked. You create a lock-null resouce
>> under A called foo.bar. Now, this has to be created using a LOCK method
>> execution and you are likely to get a different token or the same 
>> token as
>> the parent collection.
> 
> I think you should not be able to create a lock-null resource under a 
> locked
> collection.
> To work on a locked resource (e.g. to add a new member using MKCOL) you 
> have to
> provide the locktoken in the If header. But with the LOCK method the If 

Correct.

> header
> is used for refreshing locks (s. 7.8), so I would say you cant lock under a

That's only partly correct. You need the If header for LOCK refresh, but 
that doesn't mean that any LOCK request with an If header is indeed a 
refresh request.

And yes, that's how you would add a lock-null resource to a locked 
collection. Note that this won't work unless the requested lock on the 
child is compatible with the one on the parent collection (that is, it's 
a shared lock).

 > ...

Best regards,

Julian

-- 
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Webdav spec question - lock-null and collection

Posted by Stefan Lützkendorf <lu...@apache.org>.
kranga wrote:
> Hi,
>     What does the spec say in relation to the following scenario:
> 
> - You have a collection A that is locked. You create a lock-null resouce
> under A called foo.bar. Now, this has to be created using a LOCK method
> execution and you are likely to get a different token or the same token as
> the parent collection.
I think you should not be able to create a lock-null resource under a locked
collection.
To work on a locked resource (e.g. to add a new member using MKCOL) you have to
provide the locktoken in the If header. But with the LOCK method the If header
is used for refreshing locks (s. 7.8), so I would say you cant lock under a
locked resource.  Thats clear for existing resource and I think it is valid
  for Lock-Null resources to.
I'm not sure we have a test case that veriyfies that. I will have a look, ASAP.
> 
> The webdav specs say that any child of a collection that is locked (by
> default with depth infinity) should also be automatically added to that
> lock. However, if you create it with the same locktoken as the parent, then
> an unlock on the parent collection will make the lock-null resource vanish,
> which may not be desirable. However, if you create it with a different
> lock-token, then it is against the spec that children of a locked collection
> should be part of that lock. So do you create multiple locks? One for the
> lock-token and one for the collection? In that case how do you honor a PUT
> or MKCOL on it? I think you can only specify one lock in the lock-token
> header??? What if you only support exclusive locks?
> 
> Thanks
> K
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org