You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Neil de Hoog <ne...@lunatech.com> on 2001/08/02 16:12:47 UTC

problems with webdavui

My continuing effort to get webdavui running learned me that

- the httpclient needs log4j which is not inlcuded.
  I downloaded it and that seems to work so I wondered if all needed
  jars are to be included in the slide archievs or not.
- I cannot use the webdavui client because it crashes in
SPWebFolder.init
  first on line 160 and if I comment it out (it is just debug output)
  on line 166. Before this crash however I get a dialog saying 

     Unable to connect to <my servername>
     null"

-- 

Neil de Hoog

neil@lunatech.com

Re: problems with webdavui

Posted by Neil de Hoog <ne...@lunatech.com>.
and after I added 
  if(p == null)
    continue;
it started working but the chooser only show the dir your start in
(client is running on linux, server is mod_webdav).

-- 

Neil de Hoog

neil@lunatech.com

Re: problems with webdavui

Posted by Neil de Hoog <ne...@lunatech.com>.
Finally I got my directories. My fix for missing
"current-user-privilege-set" property screwed up some of it and a check
on the url prevented it from working if the root is '/'. Here is my
versuin of SPWebFolder.init():

  public void init() throws Exception  {
    SPPropFindMethod propFindMethod = new SPPropFindMethod(client);
    propFindMethod.setPath(resourceUrlPath);
    propFindMethod.execute();

    int statusCode = propFindMethod.getStatusCode();

    if (statusCode != HttpStatus.SC_MULTI_STATUS) {
      final String title = "Remote Failure";
      final String msg = "Unable to access a remote directory
("+statusCode+")";
      SPUtils.showMessageDialog(title, msg);
    }

    children = new ArrayList();
    Enumeration enum = propFindMethod.getAllResponseURLs();

    while (enum.hasMoreElements()){
      String url = (String) enum.nextElement();

      Property p =
(Property)propFindMethod.getProperty("current-user-privilege-set", url);
      if(p!=null) {
        System.err.println("current-user-privilege-set is
"+p.getClass().getName());
        CurrentUserPrivilegeSetProperty userPrivilege =
          //	    (CurrentUserPrivilegeSetProperty)
          //           
propFindMethod.getProperty("current-user-privilege-set", url);
          (CurrentUserPrivilegeSetProperty)p;

        boolean readAccess = userPrivilege.hasReadAccess();
        boolean writeAccess = userPrivilege.hasWriteAccess();
      } else
        System.err.println("current-user-privilege-set returned
nothing");

      LockdiscoveryProperty lockdiscoveryProp =
        (LockdiscoveryProperty)
        propFindMethod.getProperty("lockdiscovery", url);

      boolean readOnly=false;
      if (lockdiscoveryProp != null)  { //is being locked
        String userName = client.getCredentials().getUserName();
        if (lockdiscoveryProp.getLockToken(userName) == null)  {
          // is locked by others
          readOnly = true;
        }
      }

      SPResourceNode newChild;

      // Pending: Waiting for the proper setting of "displayname"
property
      // in the server
      //if( ! url.endsWith(resourceUrlPath) ) {
      if( ! url.equals(resourceUrlPath) ) {
        //if not this SPWebFolder's url
        //create a SPWebFolder or SPWebFile child according to its type

        if (propFindMethod.isCollection(url))  {
          newChild = new SPWebFolder(client, url);
        } else  {
          newChild = new SPWebFile(client, url);
        }

        newChild.setPrivilege(readAccess, writeAccess);
        newChild.setReadOnlyCached(readOnly);
        newChild.setParent(this);
        children.add(newChild);
      } else  {
        this.readAccess = readAccess;
        this.writeAccess = writeAccess;
        accessPrivilegeChecked = true;
      }// if(! url.endsWidth...)
    }// while (enum...)
  }// init()

--

Neil de Hoog

neil@lunatech.com

Re: problems with webdavui

Posted by Remy Maucherat <re...@betaversion.org>.
Quoting Neil de Hoog <ne...@lunatech.com>:

> My continuing effort to get webdavui running learned me that
> 
> - the httpclient needs log4j which is not inlcuded.
>   I downloaded it and that seems to work so I wondered if all needed
>   jars are to be included in the slide archievs or not.

I complained about it, and it should be fixed now (at least at runtime).
I'll commit a stable version of the httpclient source in the Slide CVS to avoid 
that kind of problem in the future.

Remy