* Completed "folder list" PROPFIND, now listing all rooms set to a
authorArt Cancro <ajc@citadel.org>
Tue, 1 Feb 2005 03:49:09 +0000 (03:49 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 1 Feb 2005 03:49:09 +0000 (03:49 +0000)
  calendar, tasks, or address view, using the GroupDAV properties.

webcit/ChangeLog
webcit/groupdav_propfind.c

index fb090845947703bdf753b5ee4e6f16472bea0e63..a3a33e4ce046c1e5c74ea70d7297b48e6e6b6ee0 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 528.30  2005/02/01 03:49:09  ajc
+* Completed "folder list" PROPFIND, now listing all rooms set to a
+  calendar, tasks, or address view, using the GroupDAV properties.
+
 Revision 528.29  2005/02/01 02:28:32  ajc
 * "time(NULL) mod 60" doesn't work for some reason, so it has been removed.
   When defaulting a new event date/time to now, set the seconds to zero
@@ -2266,4 +2270,3 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
-
index 45626559c37ff4c0b0682a75de6babcfa3fb1e44..76003ffa92b80f40b5af745241c019560bfa906d 100644 (file)
@@ -68,6 +68,10 @@ long locate_message_by_uid(char *uid) {
  * List folders containing interesting groupware objects
  */
 void groupdav_folder_list(void) {
+       char buf[SIZ];
+       char roomname[SIZ];
+       int view;
+
        /*
         * Be rude.  Completely ignore the XML request and simply send them
         * everything we know about.  Let the client sort it out.
@@ -80,19 +84,43 @@ void groupdav_folder_list(void) {
                "<D:multistatus xmlns:D=\"DAV:\">\n"
        );
 
-       wprintf("        <D:response>\n");
-       wprintf("          <D:href>http://splorph.xand.com/groupdav/Calendar/</D:href>\n");
-       wprintf("          <D:propstat>\n");
-       wprintf("            <D:status>HTTP/1.1 200 OK</D:status>\n");
-       wprintf("            <D:prop>\n");
-       wprintf("             <D:displayname>Calendar</D:displayname>\n");
-       wprintf("             <resourcetype xmlns=\"DAV:\" xmlns:G=\"http://groupdav.org/\">\n");
-       wprintf("               <collection />\n");
-       wprintf("               <G:vevent-collection />\n");
-       wprintf("             <resourcetype>\n");
-       wprintf("            </D:prop>\n");
-       wprintf("          </D:propstat>\n");
-       wprintf("        </D:response>\n");
+       serv_puts("LKRA");
+       serv_gets(buf);
+       if (buf[0] == '1') while (serv_gets(buf), strcmp(buf, "000")) {
+
+               extract(roomname, buf, 0);
+               view = extract_int(buf, 6);
+               if ((view == VIEW_CALENDAR) || (view == VIEW_TASKS) || (view == VIEW_ADDRESSBOOK) ) {
+
+                       wprintf(" <D:response>\n");
+                       wprintf("   <D:href>http://splorph.xand.com/groupdav/");
+                       urlescputs(                                     roomname);
+                       wprintf(                                                "/</D:href>\n");
+                       wprintf("   <D:propstat>\n");
+                       wprintf("     <D:status>HTTP/1.1 200 OK</D:status>\n");
+                       wprintf("     <D:prop>\n");
+                       wprintf("      <D:displayname>");
+                       urlescputs(                     roomname);
+                       wprintf(                                "</D:displayname>\n");
+                       wprintf("      <resourcetype xmlns=\"DAV:\" xmlns:G=\"http://groupdav.org/\">\n");
+                       wprintf("        <collection />\n");
+                       switch(view) {
+                               case VIEW_CALENDAR:
+                                       wprintf("        <G:vevent-collection />\n");
+                                       break;
+                               case VIEW_TASKS:
+                                       wprintf("        <G:vtodo-collection />\n");
+                                       break;
+                               case VIEW_ADDRESSBOOK:
+                                       wprintf("        <G:vcard-collection />\n");
+                                       break;
+                       }
+                       wprintf("      <resourcetype>\n");
+                       wprintf("     </D:prop>\n");
+                       wprintf("   </D:propstat>\n");
+                       wprintf(" </D:response>\n");
+               }
+       }
 
        wprintf("</D:multistatus>\n");