You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Umesh Singh <um...@iogloballtd.com> on 2006/07/12 13:12:41 UTC

WebDav Client Example

Hi,

I am able to configure the JackRabbit on Tomcat. I am also able to 
enable the WebDab servlet using the given war in the samples.

Can someone please point me to some sample client code to access the 
WebDav enabled repository? Cant find any sample to access the WebDav 
enabled repository using client code.

Regards,
Umesh

iO global limited, Registered in England No. 05269056 Reg. Offices: G10 B83 Columba House, Martlesham Heath, Ipswich, Suffolk. IP5 3RE

This electronic message contains information from iO global limited which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately.

This email does not constitute a contract. E&OE

Re: WebDav Client Example

Posted by Shanmugam Gopal <ha...@hotmail.com>.
Hi,

Once the web application is deployed in Tomcat, It will configure the 
repository under ../bin/jackrabit with the workspace called "default".

If you want to programatically add noes or files,
1) Can get the repository by using the code given 
below(RepositoryAccessServlet)
2) Using Jackrabbit API we can add nodes or files to the repository.

Otherwise we can browse the repository via any WebDAV Client.(Dreamweaver, 
FrontPage) etc.
In Dreamweaver, using manage sites option we can browse jackrabbit 
repository.

Also we can browse the repository content from browser by giving the url
http://localhost:8080/<webapp>/repository/<Workspacename>

Ex: http://localhost:8080/jack101/repository/default

Hoe this will help you.

Regards,
Shan




>From: Eric Peukert <er...@mail.inf.tu-dresden.de>
>Reply-To: users@jackrabbit.apache.org
>To: users@jackrabbit.apache.org
>Subject: Re: WebDav Client Example
>Date: Wed, 12 Jul 2006 14:29:52 +0200
>
>
>The WebDav Servlet puts a Repository Object in the JNDI-Context.  
>(Parameters specified in the web.xml)
>
>You can retrieve it from the JNDI-Context and then do what you like  to do 
>on the Repository.
>One idea is taking a look into the sources of the webdav-servlet.
>
>RepositoryAccessServlet:
>    /**
>      * tries to retrieve the repository using RMI
>      */
>     private static Repository getRepositoryByJNDI(ServletContext ctx) {
>         // acquire via JNDI
>         String repositoryName = (String) ctx.getAttribute 
>(CTX_ATTR_REPOSITORY_NAME);
>         InitialContext jndiContext = (InitialContext)  
>ctx.getAttribute(CTX_ATTR_REPOSITORY_JNDI_CONTEXT);
>         if (jndiContext == null) {
>             return null;
>         }
>         try {
>             Repository r = (Repository) jndiContext.lookup 
>(repositoryName);
>             log.info("Acquired repository via JNDI.");
>             return r;
>         } catch (NamingException e) {
>             log.error("Error while retrieving repository using JNDI  
>(name=" + repositoryName + "): " + e);
>             return null;
>         }
>     }
>
>
>Example Code for Repository Access can be found in the wiki:
>http://wiki.apache.org/jackrabbit/ExamplesPage
>
>hope this helps,
>
>Eric
>
>
>
>
>
>Am 12.07.2006 um 13:12 schrieb Umesh Singh:
>
>>Hi,
>>
>>I am able to configure the JackRabbit on Tomcat. I am also able to  enable 
>>the WebDab servlet using the given war in the samples.
>>
>>Can someone please point me to some sample client code to access  the 
>>WebDav enabled repository? Cant find any sample to access the  WebDav 
>>enabled repository using client code.
>>
>>Regards,
>>Umesh
>>
>>iO global limited, Registered in England No. 05269056 Reg. Offices:  G10 
>>B83 Columba House, Martlesham Heath, Ipswich, Suffolk. IP5 3RE
>>
>>This electronic message contains information from iO global limited  which 
>>may be privileged or confidential. The information is  intended to be for 
>>the use of the individual(s) or entity named  above. If you are not the 
>>intended recipient be aware that any  disclosure, copying, distribution or 
>>use of the contents of this  information is prohibited. If you have 
>>received this electronic  message in error, please notify us by telephone 
>>or email (to the  numbers or address above) immediately.
>>
>>This email does not constitute a contract. E&OE
>

_________________________________________________________________
Shah Rukh fan? Know all about the Baadshah of Bollywood. On MSN Search 
http://server1.msn.co.in/profile/shahrukh.asp


Re: WebDav Client Example

Posted by Eric Peukert <er...@mail.inf.tu-dresden.de>.
The WebDav Servlet puts a Repository Object in the JNDI-Context.  
(Parameters specified in the web.xml)

You can retrieve it from the JNDI-Context and then do what you like  
to do on the Repository.
One idea is taking a look into the sources of the webdav-servlet.

RepositoryAccessServlet:
    /**
      * tries to retrieve the repository using RMI
      */
     private static Repository getRepositoryByJNDI(ServletContext ctx) {
         // acquire via JNDI
         String repositoryName = (String) ctx.getAttribute 
(CTX_ATTR_REPOSITORY_NAME);
         InitialContext jndiContext = (InitialContext)  
ctx.getAttribute(CTX_ATTR_REPOSITORY_JNDI_CONTEXT);
         if (jndiContext == null) {
             return null;
         }
         try {
             Repository r = (Repository) jndiContext.lookup 
(repositoryName);
             log.info("Acquired repository via JNDI.");
             return r;
         } catch (NamingException e) {
             log.error("Error while retrieving repository using JNDI  
(name=" + repositoryName + "): " + e);
             return null;
         }
     }


Example Code for Repository Access can be found in the wiki:
http://wiki.apache.org/jackrabbit/ExamplesPage

hope this helps,

Eric





Am 12.07.2006 um 13:12 schrieb Umesh Singh:

> Hi,
>
> I am able to configure the JackRabbit on Tomcat. I am also able to  
> enable the WebDab servlet using the given war in the samples.
>
> Can someone please point me to some sample client code to access  
> the WebDav enabled repository? Cant find any sample to access the  
> WebDav enabled repository using client code.
>
> Regards,
> Umesh
>
> iO global limited, Registered in England No. 05269056 Reg. Offices:  
> G10 B83 Columba House, Martlesham Heath, Ipswich, Suffolk. IP5 3RE
>
> This electronic message contains information from iO global limited  
> which may be privileged or confidential. The information is  
> intended to be for the use of the individual(s) or entity named  
> above. If you are not the intended recipient be aware that any  
> disclosure, copying, distribution or use of the contents of this  
> information is prohibited. If you have received this electronic  
> message in error, please notify us by telephone or email (to the  
> numbers or address above) immediately.
>
> This email does not constitute a contract. E&OE