I have created a new user using webdav library.Here my code:

Enumeration enumProp;
  try {
                   // creates user
     String userDir= "/slide/slide/users/"+userName;
    webdavResource.mkcolMethod(userDir);
    webdavResource.setPath(userDir);
PropertyName pn=new PropertyName("http://jakarta.apache.org/slide/","password";);
    webdavResource.proppatchMethod(pn,password,true);

    // Creating Xml of all existing user also
    String roleToAssign="/slide/slide/roles/"+role;
    System.out.println(roleToAssign);
    webdavResource.setPath(roleToAssign);
    enumProp = webdavResource.propfindMethod("group-member-set");

    String val=(String)enumProp.nextElement();
    System.out.println("Group-member-set vale :"+val);
String newProp= "<![CDATA[<D:href xmlns:D='DAV:'>"+userDir+"</D:href>"+val+"]]>";
    webdavResource.proppatchMethod("group-member-set",newProp,true);
   } catch (IOException e) {

    e.printStackTrace();
   }

I hope this can help you!!!


----- Original Message ----- From: "Gabriel Bermudez" <[EMAIL PROTECTED]>
To: "Slide Users Mailing List" <[email protected]>
Sent: Monday, December 05, 2005 9:20 PM
Subject: Unresolved problem with users and passwords


Hi, I've been reading the users mailing list and searching the web but
everywhere I read, seems to have the same problem.
To create a new user in slide, you have to create a colletion uner
/slide/users with the user name, and then set a property with certain
values, you can do it with third parties software like DAVExplorer,
even the slide documentation has a little HOW-TO on that
(jakarta.apache.org/slide/howto-create-users.html), but there is no
WHO-TO example using the webdavclient library :(
Was some one has done this already or you simple can't create users
and set passwords with this library? Ive been trying to use the
PropertyName because the webdav command client uses it to set
properties like this:

   void proppatch(String path, String prop, String value)
   {
       String name=prop;
       try {
           path=checkUri(path);
           out.print("Putting property(" + name + ", " + value +
               ") to '" + path + "': ");
           if (webdavResource.proppatchMethod(
               path, new PropertyName("DAV:",name), value, true)) {
               out.println("succeeded.");
           } else {
               out.println("failed.");
               out.println(webdavResource.getStatusMessage());
           }
       }
       catch (Exception ex) {
           handleException(ex);
       }
   }

Has anyone had a sucessfull creation of a user with a password using
the webdavclient library, did you use the PropertyName class, can you
give some sample code.
Thanks a lot for your help

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to