IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

How can I access, modify or change the Properties for a File

  • 1.  How can I access, modify or change the Properties for a File

    Posted Thu January 15, 2004 10:46 AM

    Tamino WebDav says:
    “To help to make resources more transparent, WebDAV allows properties, or “metadata”, to be assigned to any type of data. With increasing diversification of resources the possible number of properties can be infinite”.

    How can I access, modify or change this properties . Is there a Tool that can help me to
    do this ?


    #webMethods
    #Tamino
    #API-Management


  • 2.  RE: How can I access, modify or change the Properties for a File

    Posted Thu January 15, 2004 02:07 PM

    Hi,

    programmatically you can achieve this
    with the aid of a WebDAV-Client implementation,
    issuing a PROPPATCH (this is a HTTP-Extension)
    Request. The body of the PROPPATCH request
    contains the properties to be updated.

    See for example
    DAV4J
    or the currently not activley supported WebDAV
    stack form eclipse
    Eclipse WebDAV

    Regards,

    Matthias.


    #API-Management
    #Tamino
    #webMethods


  • 3.  RE: How can I access, modify or change the Properties for a File

    Posted Wed January 21, 2004 08:09 AM

    Hi Jegnet,

    A tool to set properties is the WebDAV Basic Client, which you can download from the Tamino web site.
    In there you can send HTTP requests to the webdavserver and experiment with the header and content of the request that you need.

    The same can also be done from any other client that can sent http requests.
    Below an example of JScript that can be used to set the lock property of a file and set the lock-owner and lock-timeout.

    function LockFile(DatabaseURL,Collection,doctype,filename,user,password) {
    var url=DatabaseURL+“/”+Collection+“/”+docytype+“/”+filename
    var PostData=“<?xml version=\"1.0\" encoding=\"utf-8\" ?><D:lockinfo xmlns:D=‘DAV:’><D:lockscope><D:exclusive/></D:lockscope><D:locktype><D:write/></D:locktype><D:owner><D:xmetal>”+user+“</D:xmetal></D:owner></D:lockinfo>”

    var xmlhttp = new ActiveXObject(“Microsoft.XMLHTTP”);
    xmlhttp.Open(“LOCK”,url,false,user,passw);
    xmlhttp.setRequestHeader(“Content-Type”,“text/xml; charset="utf-8"”);
    xmlhttp.setRequestHeader(“Timeout”,“Second-28800”);//set timout to reset the lock after 28800 sec
    xmlhttp.send(PostData);
    var status = xmlhttp.Status;
    var responsetext = xmlhttp.responseText
    xmlhttp = null;
    if (status==423) {
    Alert(“Document already locked.\n”+status+“\n”+responsetext);
    }
    }

    Regards, Kees


    #Tamino
    #API-Management
    #webMethods