You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by imadhusudhanan <im...@zohocorp.com> on 2009/01/29 14:45:02 UTC

Re: Re: Failed Login Exception while using Windows WebFolder client ..

HI,

    This is what I like to supply to the user ,
    
    Url supplied :: http://exampledomain.exampleserver.com/webdav/User_Name 

    My repository config file  ::   webapps/domain/wedav/repository.xml
    My repo Home dir     :: webapps/domain/webdav

    The above two will be used to get the repository instance thru JNDI look - up. And the JNDI look up code goes like this ..

    String configFile = "../webapps/domain/webdav/repository.xml";
            String repHomeDir = "../webapps/domain/webdav";
                        Hashtable env = new Hashtable();
            env.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory");
                 env.put(Context.PROVIDER_URL, "localhost");
            InitialContext ctx = new InitialContext(env);
            RegistryHelper.registerRepository(ctx, "repo", configFile, repHomeDir, true);
                        Repository r = (Repository) ctx.lookup("repo");
                        
                        if(r != null) {
                SimpleCredentials cred = new SimpleCredentials(ADMIN_USER_ID, ADMIN_PASS.toCharArray());
                           Session session = r.login(cred, null);
                                JackrabbitWorkspace ws = (JackrabbitWorkspace)session.getWorkspace();
                javax.jcr.Node rn = session.getRootNode();
                                this.rootNode = rn;
                this.session = session;
                               this.repo = r;
                return r;
                       } else {
                System.out.println("Return null");
            }
              
    With this i get a repository created under webdav directory. 

    Also it was easy for me when I gave a workspace to one user so that when I map userX to workspace userX i can supply him the url http:// example_domain.com/webdav/userX 

    And when it goes to userY it is http://example_domain.com/webdav/userY and thats it JR will directly let the user in to the specified workspace defined by the name of the user. 

    So may i know the url u gave,  /repository/<workspace-name>/<repo-path>) ??

    What's the <repo-path> in this ?? Is that the /home/userX u have mentioned  ?? Do let me know I need provide further info .. Take care.
            

        


    
        

Regards,
MadhuSudhanan I.
www.zoho.com
'If you wanna walk quick Walk Alone, if you wanna walk far Walk Together ..."



---- On Thu, 29 Jan 2009 Alexander Klimetschek <ak...@day.com> wrote ---- 

 > Hi, 
 >  
 > in general I think it is much simpler to have nodes for each user in 
 > the main workspace (eg. /home/userX) than to create a new workspace 
 > for each user. I think that solution won't scale well. 
 >  
 > Regarding Windows web folders: AFAIK that one is buggy as hell and not 
 > so conformant to the spec. I would try a different webdav client tool 
 > for Windows. 
 >  
 > I looked at the code and I don't see any direct errors (see below for 
 > a comment). But I wonder how the login page interacts with the Webdav 
 > access? Is the user required to login first via a browser, then his 
 > workspace gets created if it doesn't exist yet and then he switches 
 > over to Webdav to do his work? Do you supply the username/workspace 
 > name in the webdav url (which by default is sth like 
 > /repository/<workspace-name>/<repo-path>)? 
 >  
 > On Thu, Jan 29, 2009 at 6:17 AM, imadhusudhanan 
 > <im...@zohocorp.com> wrote: 
 > >     String enableToUser = request.getParameter("user"); 
 > >     if(enableToUser != null && !enableToUser.equalsIgnoreCase("")) { 
 > >         WebDAVServlet webdavServlet = new WebDAVServlet(); 
 > >         Repository repoCreated = webdavServlet.getRepository(); 
 >  
 > Creating a new WebdavServlet every time only to get the repository 
 > from its configuration is overkill. You should rather use JNDI for 
 > that (or at least a global singleton). This could also be the reason 
 > for errors, but I don't know what happens in the internals of the 
 > webdavservlet code. 
 >  
 >  
 > Regards, 
 > Alex 
 >  
 > --  
 > Alexander Klimetschek 
 > alexander.klimetschek@day.com  

Re: Re: Failed Login Exception while using Windows WebFolder client ..

Posted by Alexander Klimetschek <ak...@day.com>.
On Thu, Jan 29, 2009 at 2:45 PM, imadhusudhanan
<im...@zohocorp.com> wrote:
>     So may i know the url u gave,  /repository/<workspace-name>/<repo-path>)
> ??
>
>     What's the <repo-path> in this ??

It's the JCR path inside the workspace you want to address via webdav.
For the root folder it would be empty, ie. the whole string would be
/repository/<workspace-name>.

Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com