Webdav Client Examples?

14 messages Options
Embed this post
Permalink
ossi petz-2

Webdav Client Examples?

Reply Threaded More More options
Print post
Permalink
Hallo

Has anyone made some examples on how to use HttpClient with the
Jackrabbit Webdav Client?

  - list files/folders
  - read files
  - write files
  - delete files

i wasnt able to find any starting point, tutorial, step-by-step guide,
test-case at all :(


some pointer where to look at would be cool! (a fool-proof link if possible)


thanks

ossi

Jukka Zitting

Re: Webdav Client Examples?

Reply Threaded More More options
Print post
Permalink
Hi,

On Nov 14, 2007 11:26 AM, ossi petz <[hidden email]> wrote:
> Has anyone made some examples on how to use HttpClient with the
> Jackrabbit Webdav Client?

Not really. The WebDAV support in Jackrabbit is more focused on
server-side implementations than clients.

The best there is for clients is a collection of WebDAV method classes
in the jackrabbit-webdav component. See [1] for a list of the
available methods that you can use together with the HttpClient
library.

[1] http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/webdav/client/methods/package-summary.html

BR,

Jukka Zitting
Angela Schreiber

Re: Webdav Client Examples?

Reply Threaded More More options
Print post
Permalink
Jukka Zitting wrote:
> Hi,
>
> On Nov 14, 2007 11:26 AM, ossi petz <[hidden email]> wrote:
>> Has anyone made some examples on how to use HttpClient with the
>> Jackrabbit Webdav Client?

there is an example in the sandbox/spi/spi2dav project.

> Not really. The WebDAV support in Jackrabbit is more focused on
> server-side implementations than clients.

> The best there is for clients is a collection of WebDAV method classes
> in the jackrabbit-webdav component.

... which are only waiting for somebody having time to put them
together to a complete dav client :).

regards
angela

dhartford-2

RE: Webdav Client Examples?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Jukka Zitting
Some work got started a long time ago here:
http://wiki.apache.org/jackrabbit/WebDAV

However, I ran out of time.  Over the past year or so, there wasn't that
much interest in WebDAV support with Jackrabbit, but with Slide now
officially closing the doors it may be time to increase support for
WebDAV (documentation/examples as well as implementation when needed).

> -----Original Message-----
> From: Jukka Zitting [mailto:[hidden email]]
>
> Hi,
>
> On Nov 14, 2007 11:26 AM, ossi petz <[hidden email]> wrote:
> > Has anyone made some examples on how to use HttpClient with the
> > Jackrabbit Webdav Client?
>
> Not really. The WebDAV support in Jackrabbit is more focused on
> server-side implementations than clients.
>
> The best there is for clients is a collection of WebDAV method classes
> in the jackrabbit-webdav component. See [1] for a list of the
> available methods that you can use together with the HttpClient
> library.
>
> [1]
>
http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/webdav/client
/m
> ethods/package-summary.html
>
> BR,
>
> Jukka Zitting
MikeOliverAZ

RE: Webdav Client Examples?

Reply Threaded More More options
Print post
Permalink
As a Slide committer I might be interested to pitch in, but I need to get my
arms around this before I volunteer.

Ollie

-----Original Message-----
From: Darren Hartford [mailto:[hidden email]]
Sent: Tuesday, November 20, 2007 6:21 AM
To: [hidden email]
Subject: RE: Webdav Client Examples?

Some work got started a long time ago here:
http://wiki.apache.org/jackrabbit/WebDAV

However, I ran out of time.  Over the past year or so, there wasn't that
much interest in WebDAV support with Jackrabbit, but with Slide now
officially closing the doors it may be time to increase support for
WebDAV (documentation/examples as well as implementation when needed).

> -----Original Message-----
> From: Jukka Zitting [mailto:[hidden email]]
>
> Hi,
>
> On Nov 14, 2007 11:26 AM, ossi petz <[hidden email]> wrote:
> > Has anyone made some examples on how to use HttpClient with the
> > Jackrabbit Webdav Client?
>
> Not really. The WebDAV support in Jackrabbit is more focused on
> server-side implementations than clients.
>
> The best there is for clients is a collection of WebDAV method classes
> in the jackrabbit-webdav component. See [1] for a list of the
> available methods that you can use together with the HttpClient
> library.
>
> [1]
>
http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/webdav/client
/m
> ethods/package-summary.html
>
> BR,
>
> Jukka Zitting

ossi petz-3

Re: Webdav Client Examples?

Reply Threaded More More options
Print post
Permalink
Hallo

thanks for the replies.

Yet i find it rather difficult to start with a jackrabbit webdav client :/
my plans where to patch commons-vfs with ssl-webdav from jakarta-slide.
but well the plan died with the retirement of slide.

i am not familiar with http client either. so without any examples it's
just too time consuming to start with for me.

yet i could help with some tests (as the infrastructure is set up).
maybe unit tests.

since slide has retired a new webdavclient would be cool :)


thanks

ossi


Mike Oliver schrieb:

> As a Slide committer I might be interested to pitch in, but I need to get my
> arms around this before I volunteer.
>
> Ollie
>
> -----Original Message-----
> From: Darren Hartford [mailto:[hidden email]]
> Sent: Tuesday, November 20, 2007 6:21 AM
> To: [hidden email]
> Subject: RE: Webdav Client Examples?
>
> Some work got started a long time ago here:
> http://wiki.apache.org/jackrabbit/WebDAV
>
> However, I ran out of time.  Over the past year or so, there wasn't that
> much interest in WebDAV support with Jackrabbit, but with Slide now
> officially closing the doors it may be time to increase support for
> WebDAV (documentation/examples as well as implementation when needed).
>
>> -----Original Message-----
>> From: Jukka Zitting [mailto:[hidden email]]
>>
>> Hi,
>>
>> On Nov 14, 2007 11:26 AM, ossi petz <[hidden email]> wrote:
>>> Has anyone made some examples on how to use HttpClient with the
>>> Jackrabbit Webdav Client?
>> Not really. The WebDAV support in Jackrabbit is more focused on
>> server-side implementations than clients.
>>
>> The best there is for clients is a collection of WebDAV method classes
>> in the jackrabbit-webdav component. See [1] for a list of the
>> available methods that you can use together with the HttpClient
>> library.
>>
>> [1]
>>
> http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/webdav/client
> /m
>> ethods/package-summary.html
>>
>> BR,
>>
>> Jukka Zitting
>
>

Hamid Reza Sahlolbey

Re: Webdav Client Examples?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Angela Schreiber



Angela Schreiber <anchela <at> day.com> writes:

>
> Jukka Zitting wrote:
> > Hi,
> >
> > On Nov 14, 2007 11:26 AM, ossi petz <ossipetz <at> hallo.ms> wrote:
> >> Has anyone made some examples on how to use HttpClient with the
> >> Jackrabbit Webdav Client?
>
> there is an example in the sandbox/spi/spi2dav project.
>
> > Not really. The WebDAV support in Jackrabbit is more focused on
> > server-side implementations than clients.
>
> > The best there is for clients is a collection of WebDAV method classes
> > in the jackrabbit-webdav component.
>
> ... which are only waiting for somebody having time to put them
> together to a complete dav client :).
>
> regards
> angela
>
>
Hi;
Can you please refer to a link that I can access "sandbox/spi/spi2dav project"
I couldn't find it by googling.

Cheers,
Hamid



Angela Schreiber

Re: Webdav Client Examples?

Reply Threaded More More options
Print post
Permalink
hi hamid

Hamid Reza Sahlolbey wrote:
> Can you please refer to a link that I can access "sandbox/spi/spi2dav project"
> I couldn't find it by googling.

here
http://svn.apache.org/repos/asf/jackrabbit/sandbox/spi/spi2dav

please be aware that the code there is not intended to be
an end-user dav client. but you can get an idea how
to make usage of dav-method-extensions in conjunction with
apache-httpclient.

regards
angela

florinmarcus

Re: Webdav Client Examples?

Reply Threaded More More options
Print post
Permalink
Hello,

I have managed to create a new Document inside webdav using jackrabbit webdav client:
[code]

            HostConfiguration hostConfig = new HostConfiguration();
            hostConfig.setHost("localhost", 8082);
            //hostConfig.
            HttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
            HttpConnectionManagerParams params = new HttpConnectionManagerParams();
            int maxHostConnections = 20;
            params.setMaxConnectionsPerHost(hostConfig, maxHostConnections);
            connectionManager.setParams(params);    
            HttpClient client = new HttpClient(connectionManager);
            Credentials creds = new UsernamePasswordCredentials("scanner1", "scanner1");
            client.getState().setCredentials(AuthScope.ANY, creds);
            client.setHostConfiguration(hostConfig);
            return client;




            PutMethod pm = new PutMethod("http://localhost:8082/webdav/scanner1_queque/uploader/image_" + i + ".txt");
            String text = "this is the document content";
            pm.setRequestBody(text);
            httpClient.executeMethod(pm);

[/code]



What I still don't manage to do is to create a new folder using the same API.
Can sombody give me a hint?

Thanks,
Florin
Julian Reschke

Re: Webdav Client Examples?

Reply Threaded More More options
Print post
Permalink
florinmarcus wrote:
> ...
> What I still don't manage to do is to create a new folder using the same
> API.
> Can sombody give me a hint?
> ...

Did you already look at MkColMethod?

Best regards, Julian
florinmarcus

Re: Webdav Client Examples?

Reply Threaded More More options
Print post
Permalink
Hello Julien,
I will do that right away,

Thanks a lot,

Florin

Julian Reschke wrote:
florinmarcus wrote:
> ...
> What I still don't manage to do is to create a new folder using the same
> API.
> Can sombody give me a hint?
> ...

Did you already look at MkColMethod?

Best regards, Julian
Kurz Wolfgang

Problem with Date Comparisons

Reply Threaded More More options
Print post
Permalink
In reply to this post by florinmarcus
Hello everyone,

I am having trouble searching for Content before or after a certain date in my Repository.

I have a attribute in my repository that's called "wiedervorlageAsDate" which is a Calendar Type.

Now when I do a Search on my Repository like the following:

I always get a full result-set when I use <= xs:dateTime or < and I always get a empty resultset when ever is use >= or >

Somehow it doesn't matter at all what the value I compare to is.

This is the query I am using:
/jcr:root/*/*/*[(@artikelDokument = 'false') and (@freigegeben = 'true') and (@aktiv = 'true') and (@wiedervorlageAsDate <= xs:dateTime('2008-02-25T14:18:26.516+01:00'))and (@tempContent = 'false')]/*//element(*, nt:unstructured) [(@menuid = '1067') and  ( @ocm_classname='de.gwvs.tos.commons.jackrabbit.domain.JCRMenuId')]

Anyone have an idea on what I am doing wrong?

There has to be a solution cause I can't imagine any use of jackrabbit if you can't compare dates that are stored inside.

Would be awesome if anyone had some hints for me!

Thx a lot in advance!

Wolfgang
florinmarcus

Re: Webdav Client Examples?

Reply Threaded More More options
Print post
Permalink
In reply to this post by florinmarcus
Hello again,
I have test it and is working,
Thanks Julian,

Florin

Julian Reschke wrote:
florinmarcus wrote:
> ...
> What I still don't manage to do is to create a new folder using the same
> API.
> Can sombody give me a hint?
> ...

Did you already look at MkColMethod?

Best regards, Julian

Alexander Klimetschek

Re: Problem with Date Comparisons

Reply Threaded More More options
Print post
Permalink
In reply to this post by Kurz Wolfgang
On Wed, Feb 25, 2009 at 2:59 PM, Kurz Wolfgang <[hidden email]> wrote:
> I always get a full result-set when I use <= xs:dateTime or < and I always get a empty resultset when ever is use >= or >
>
> Somehow it doesn't matter at all what the value I compare to is.
>
> This is the query I am using:
> /jcr:root/*/*/*[(@artikelDokument = 'false') and (@freigegeben = 'true') and (@aktiv = 'true') and (@wiedervorlageAsDate <= xs:dateTime('2008-02-25T14:18:26.516+01:00'))and (@tempContent = 'false')]/*//element(*, nt:unstructured) [(@menuid = '1067') and  ( @ocm_classname='de.gwvs.tos.commons.jackrabbit.domain.JCRMenuId')]
>
> Anyone have an idea on what I am doing wrong?

No idea yet. Did you check the field is actually stored as DATE
property? What values are stored in those dates (it could be that they
actually are all before the date given in your query....)?

When you mention "<=", "<", ">=" and ">", do you mean you always used
the xs:dateTime() function for the comparison?

You have to use that function for comparing to dates and it must
always include the full ISO8601 string (date + "T" + time +
"Z"/offset), but your query above looks good in this respect.

Reards,
Alex

--
Alexander Klimetschek
[hidden email]