Hello Jerome,

Indeed, I've found out about it the 'hard way' :-)

I've managed to create the needed annotation and handle PROPFIND fine.

I've taken a look at the annotation you've added on incubator (yours
is called PropFind, mine is called Propfind), got Restlet source code,
and run:

ant -f build/build.xml

but the incubator extensions are not built. How can I do to build 'em
too and deploy 'my own' restlet snapshot with my app with your
someday-to-be-standard-dav-extension jar?

Thanks.

On Wed, Feb 17, 2010 at 8:17 AM, Jerome Louvel
<[email protected]> wrote:
> Hi Fabian,
>
> Don't know if you were able to fix the issue but the ServerResource class 
> introduced in Restlet 2.0 doesn't support extension methods using the 
> handle*() pattern. This only works for the now deprecated Resource class.
>
> The 2.0 way to support this is to leverage method annotations. I've recently 
> created a basic WebDAV extension in the incubator with such annotations:
> http://restlet.tigris.org/source/browse/restlet/trunk/incubator/org.restlet.ext.webdav/src/org/restlet/ext/webdav/
>
> Best regards,
> Jerome Louvel
> --
> Restlet ~ Founder and Technical Lead ~ http://www.restlet.org
> Noelios Technologies ~ http://www.noelios.com
>
>
> -----Message d'origine-----
> De : Fabian Mandelbaum [mailto:[email protected]]
> Envoyé : samedi 16 janvier 2010 15:52
> À : [email protected]
> Objet : Re: handlePropfind() not being called when PROPFIND request is 
> received (to add WebDAV support to a ServerResource)
>
> arrhghghgh, yes, it was, thanks for pointing me to my "crossed fingers
> while typing". Ok, this last test for intermediate resources can be
> ignored. Behaviour still prevails though, 405 returned for PROPFIND on
> the resource.
>
> On Sat, Jan 16, 2010 at 11:45 AM, Rob Heittman
> <[email protected]> wrote:
>> Is the workpsaces/workspaces typo below significant?
>>
>> On Jan 16, 2010, at 9:39 AM, Fabian Mandelbaum <[email protected]>
>> wrote:
>>
>>> Hum... one more thing I've found out while testing, I've removed
>>> OPTIONS support from the RootFolderResource (serving the / URI) and
>>> now the error is different:
>>>
>>> [fab...@laptop ~]$ cadaver http://localhost:9000/workpsaces/W1/content
>>> Could not open collection:
>>> 405 The method specified in the request is not allowed for the
>>> resource identified by the request URI
>>> dav:/workpsaces/W1/content/? quit
>>> [fab...@laptop ~]$
>>>
>>> So, I'm wondering... maybe the problem is that all 'intermediate'
>>> resources should implement at least the OPTIONS method too in order
>>> for the 'deeper' resource to work?
>>>
>>> Thanks again...
>>>
>>> 2010/1/16 Fabián Mandelbaum <[email protected]>:
>>>> Thanks Rob (and sorry for miswritting your lastname ;)).
>>>>
>>>> For all it's worth I've just tried with cadaver (DAV command line
>>>> client), and got the same results, CLI 'session' and excerpt from the
>>>> logs follow:
>>>>
>>>> [fab...@laptop ~]$ cadaver http://localhost:9000/workpsaces/W1/
>>>> content
>>>> Could not access /workpsaces/W1/content/ (not WebDAV-enabled?):
>>>> 405 The method specified in the request is not allowed for the
>>>> resource identified by the request URI
>>>> Connection to `localhost' closed.
>>>> dav:!> quit
>>>> [fab...@laptop ~]$
>>>>
>>>> Jan 16, 2010 12:06:26 PM com.calenco.resource.RootFolderResource
>>>> options
>>>> INFO: OPTIONS request processed in 0.000 sec.
>>>> Jan 16, 2010 12:06:26 PM org.restlet.engine.log.LogFilter afterHandle
>>>> INFO: 2010-01-16        12:06:26        0:0:0:0:0:0:0:1 -
>>>> -       9000    OPTIONS /workpsaces/W1/content/ -       200
>>>> 0       -       8       http://localhost:9000   cadaver/0.23.2
>>>> neon/0.29.0     -
>>>> Jan 16, 2010 12:06:26 PM org.restlet.engine.http.HttpServerAdapter
>>>> commit
>>>> WARNING: A response with an unavailable entity was returned. Ignoring
>>>> the entity for resource
>>>> "http://localhost:9000/workpsaces/W1/content/";.
>>>> Jan 16, 2010 12:06:26 PM org.restlet.engine.log.LogFilter afterHandle
>>>> INFO: 2010-01-16        12:06:26        0:0:0:0:0:0:0:1 -
>>>> -       9000    PROPFIND        /workpsaces/W1/content/ -
>>>> 405     402     288     7       http://localhost:9000   cadaver/
>>>> 0.23.2
>>>> neon/0.29.0     -
>>>>
>>>> Thanks in advance
>>>>
>>>> On Sat, Jan 16, 2010 at 11:00 AM, Rob Heittman
>>>> <[email protected]> wrote:
>>>>> I ran into similar trouble porting it myself, but that was many
>>>>> milestones ago ... Will retry with M6 and see if I get the same
>>>>> results as you!
>>>>>
>>>>> On Jan 16, 2010, at 8:17 AM, Fabian Mandelbaum <[email protected]
>>>>> >
>>>>> wrote:
>>>>>
>>>>>> Hello there, I'm trying (fighting and learning, bah ;)) to add
>>>>>> WebDAV
>>>>>> support to a ServerResource. To test, I'm using the Nautilus/GNOME
>>>>>> "Connect to Server" WebDAV client. I've seen that 1st an OPTIONS
>>>>>> (HTTP) request is issued, then a PROPFIND (DAV) request is issued.
>>>>>>
>>>>>> My resource has options() overriden and it's being called properly;
>>>>>> however, there's no propfind() method in ServerResource, so reading
>>>>>> the docs a bit I've found that to implement handlers for 'new'
>>>>>> methods
>>>>>> (or for not-yet-handled-by-any-out-of-the-box-handler method),
>>>>>> simply
>>>>>> a handleMethodName() is needed, so I've added handlePropfind() to
>>>>>> my
>>>>>> resource, like this:
>>>>>>
>>>>>> public Representation handlePropfind() throws ResourceException {
>>>>>>   return new StringRepresentation("PROPFIND called!");
>>>>>> }
>>>>>>
>>>>>> And I'm seeing this on the logs (together with the error message of
>>>>>> the DAV client stating "the method is not supported by the
>>>>>> requested
>>>>>> resource URI", without saying *which* method is not supported,
>>>>>> but I
>>>>>> know it's PROPFIND, from the logs):
>>>>>>
>>>>>> Jan 16, 2010 11:08:31 AM org.restlet.engine.log.LogFilter
>>>>>> afterHandle
>>>>>> INFO: 2010-01-16    11:08:31    0:0:0:0:0:0:0:1    -    -    9000
>>>>>> OPTIONS    /workspaces/W1/content    -    200    0    -    207    
>>>>>> http://localhost:9000
>>>>>>     gvfs/1.4.3    -
>>>>>> Jan 16, 2010 11:08:31 AM org.restlet.engine.http.HttpServerAdapter
>>>>>> commit
>>>>>> WARNING: A response with an unavailable entity was returned.
>>>>>> Ignoring
>>>>>> the entity for resource "http://localhost:9000/workspaces/W1/content
>>>>>> ".
>>>>>> Jan 16, 2010 11:08:31 AM org.restlet.engine.log.LogFilter
>>>>>> afterHandle
>>>>>> INFO: 2010-01-16    11:08:31    0:0:0:0:0:0:0:1    -    -    9000
>>>>>> PROPFIND    /workspaces/W1/content    -    405    402    124
>>>>>> 14    http://localhost:9000    gvfs/1.4.3    -
>>>>>> Jan 16, 2010 11:08:31 AM org.restlet.engine.log.LogFilter
>>>>>> afterHandle
>>>>>>
>>>>>> So, the OPTIONS request is succeeding, but the PROPFIND one is not,
>>>>>> even if there is a handlePropfind() in the resource.
>>>>>>
>>>>>> Restlet 2.0M6 here, and my work on DAV support is being based on
>>>>>> Rob
>>>>>> Heitman's Dav1VFSResource class, which seems to be the only
>>>>>> 'documented' stuff about how DAV clients work.
>>>>>>
>>>>>> Thanks in advance for your help
>>>>>>
>>>>>> --
>>>>>> Fabián Mandelbaum
>>>>>> IS Engineer
>>>>>>
>>>>>> ------------------------------------------------------
>>>>>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2437628
>>>>>
>>>>> ------------------------------------------------------
>>>>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2437629
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Fabián Mandelbaum
>>>> IS Engineer
>>>>
>>>
>>>
>>>
>>> --
>>> Fabián Mandelbaum
>>> IS Engineer
>>>
>>> ------------------------------------------------------
>>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2437639
>>
>> ------------------------------------------------------
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2437640
>>
>
>
>
> --
> Fabián Mandelbaum
> IS Engineer
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2437641
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2448327
>



-- 
Fabián Mandelbaum
IS Engineer

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2448336

Reply via email to