[patch]webdav properties to metadata

Best, Jan-Pascal van j.p.vanbest at tbm.tudelft.nl
Wed May 29 08:15:28 BST 2002


Hi all,

Back for another request, and thanks for the co-operation on webdav
search. 
I'm still working on using webdav to access an exchange 2000 server, see
the 
kde-pim list. For this I need to access the data that PROPFIND or SEARCH

returns (in kioslave/http.c/HTTPProtocol::davStatList). WebDAV servers 
return an XML structure containing properties of the resource. For
calendar
items this includes things like recurrence information, location,
attendees,
busy status etc.

In my opinion there are two ways to make this data available to
user programs:
- Either somehow export the XML tree (a QDomNodeList) of items. This
would mean 
a change in interface, maybe adding an extra UDSAtom type? It would
allow the
user program access to all the richness of the webdav reply.
- Or take the easy way, export the data to the metadata. This would lose
some
of the XML structure, since we can export only string key:value pairs,
but it's
far easier to implement. I used this approach in the patch below.

Patch:
- Unignore properties from namespaces other than DAV:, since I'm
interested in
e.g. urn:schemas:calendar:instancetype
- When we encounter an unknown propstat, add it to the metadata. Use as
key
"DAVPROP/"+tag name and as value the property text.

Concerns:
- Maybe we should add ALL properties to the metadata, not just the
"unknown"
ones. How would a user-level program know which ones are unknown?
- Should we add the namespace to the metadata and not just the tag name?
I think so.
- This would add a LOT of information to each STAT. Maybe we should make
this behaviour
configurable? On the other hand, if you do a webdav STAT, this is
probably exactly what
you want.

Your opinions?

Cheers

Jan-Pascal


Index: http.cc
===================================================================
RCS file: /home/kde/kdelibs/kioslave/http/http.cc,v
retrieving revision 1.503
diff -u -3 -p -r1.503 http.cc
--- http.cc     23 May 2002 23:37:33 -0000      1.503
+++ http.cc     29 May 2002 06:42:47 -0000
@@ -599,13 +599,6 @@ void HTTPProtocol::davParsePropstats( co
           !property.isNull();
           property = property.nextSibling().toElement() )
     {
-
-      if ( property.namespaceURI() != "DAV:" )
-      {
-        // break out - we're only interested in properties from the DAV
namespace
-        continue;
-      }
-
       if ( property.tagName() == "creationdate" )
       {
         // Resource creation date. Should be is ISO 8601 format.
@@ -734,6 +727,7 @@ void HTTPProtocol::davParsePropstats( co
       else
       {
         kdDebug(7113) << "Found unknown webdav property: " <<
property.tagName() << endl;
+        setMetaData( "DAVPROP/"+property.tagName(), property.text() );
       }
     }
   }




More information about the kfm-devel mailing list