$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
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
-
* 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.
"<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");