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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  xml data

    Posted 12/19/01 03:40 PM

    Hi all,

    I have a big database and I would like to remove all documents stored in my db before a specified date.
    The xml documents don’t include any attributes or elements with tha date field.
    How can I solve the problem ?

    reagrds
    Cristian


    #webMethods
    #Tamino
    #API-Management


  • 2.  RE: xml data

    Posted 12/20/01 12:17 PM

    Right now the only way is to check the lasModified property of each document

    It works like this

    do the query doctype/@ino:id
    for each node build up the URL like this
    collection URL+‘/’+‘doctype’+‘/@’+ino:id
    then do a HEAD on this URI and read the last modified date from the HTTP headers
    If it is too old delete the document

    in JScript DOM API it is something like this

    var client= new TaminoClient(collectionURL,50)
    var result= client.query(doctype/@ino:id);
    while (result and result.nodes()) {
    for (var i=0;i<result.nodes().length;i++){
    var uri=doctype+‘/@’
    + result.nodes().item(i).getAttribute (“ino:id”);
    var r=client.head(uri);
    if (!r.errorNo ) {
    var date=r.getlastModified();
    if (… date…) //too old
    client.deleteDocument(uri);
    }
    }

    result=result.getNext();
    }

    You can do a similar job with the other APIs or the new Java API

    [This message was edited by Nigel Hutchison on 20 Dec 2001 at 12:02.]


    #API-Management
    #webMethods
    #Tamino