Monotone-Parent: d4ec4c64b7bfb4975be1924516e870493eb766a2
Monotone-Revision: 64bb41288f025d8a85a54ff9d3fa322dc9a6f5bd Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-09-28T17:19:55 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
ac691c1548
commit
cbf3f32b3b
|
@ -19,7 +19,13 @@
|
||||||
02111-1307, USA.
|
02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <NGObjWeb/WODirectAction.h>
|
#import <NGObjWeb/WODirectAction.h>
|
||||||
|
#import "SOGoICalHTTPHandler.h"
|
||||||
|
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
||||||
|
|
||||||
|
#import <NGCards/iCalEvent.h>
|
||||||
|
|
||||||
|
#import "common.h"
|
||||||
|
|
||||||
@interface SOGoICalFileFetch : WODirectAction
|
@interface SOGoICalFileFetch : WODirectAction
|
||||||
{
|
{
|
||||||
|
@ -27,11 +33,6 @@
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#include "SOGoICalHTTPHandler.h"
|
|
||||||
#include <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
|
||||||
#include <SOGo/SOGoAppointment.h>
|
|
||||||
#include "common.h"
|
|
||||||
|
|
||||||
@implementation SOGoICalFileFetch
|
@implementation SOGoICalFileFetch
|
||||||
|
|
||||||
/* clientObject */
|
/* clientObject */
|
||||||
|
@ -45,7 +46,7 @@
|
||||||
- (id)defaultAction {
|
- (id)defaultAction {
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
WOResponse *response;
|
WOResponse *response;
|
||||||
SOGoAppointment *event;
|
iCalEvent *event;
|
||||||
NSEnumerator *e;
|
NSEnumerator *e;
|
||||||
NSArray *events;
|
NSArray *events;
|
||||||
|
|
||||||
|
@ -65,9 +66,8 @@
|
||||||
events = [[self clientObject] fetchAllSOGoAppointments];
|
events = [[self clientObject] fetchAllSOGoAppointments];
|
||||||
[self debugWithFormat:@"generate %d appointments ...", [events count]];
|
[self debugWithFormat:@"generate %d appointments ...", [events count]];
|
||||||
e = [events objectEnumerator];
|
e = [events objectEnumerator];
|
||||||
while ((event = [e nextObject]) != nil) {
|
while ((event = [e nextObject]) != nil)
|
||||||
[response appendContentString:[event vEventString]];
|
[response appendContentString: [event versitString]];
|
||||||
}
|
|
||||||
|
|
||||||
/* vcal postamble */
|
/* vcal postamble */
|
||||||
[response appendContentString:@"END:VCALENDAR\r\n"];
|
[response appendContentString:@"END:VCALENDAR\r\n"];
|
||||||
|
|
|
@ -135,7 +135,6 @@ static SaxObjectDecoder *sax = nil;
|
||||||
|
|
||||||
- (NSException *)writeNewVEvents:(NSArray *)_events {
|
- (NSException *)writeNewVEvents:(NSArray *)_events {
|
||||||
SOGoAppointmentFolder *folder;
|
SOGoAppointmentFolder *folder;
|
||||||
iCalRenderer *renderer;
|
|
||||||
NSException *error;
|
NSException *error;
|
||||||
unsigned i, count;
|
unsigned i, count;
|
||||||
|
|
||||||
|
@ -144,15 +143,13 @@ static SaxObjectDecoder *sax = nil;
|
||||||
reason:@"did not find clientObject?!"];
|
reason:@"did not find clientObject?!"];
|
||||||
}
|
}
|
||||||
|
|
||||||
renderer = [iCalRenderer sharedICalendarRenderer];
|
|
||||||
|
|
||||||
for (i = 0, count = [_events count]; i < count; i++) {
|
for (i = 0, count = [_events count]; i < count; i++) {
|
||||||
SOGoAppointmentObject *object;
|
SOGoAppointmentObject *object;
|
||||||
iCalEvent *event;
|
iCalEvent *event;
|
||||||
NSString *ical;
|
NSString *ical;
|
||||||
|
|
||||||
event = [_events objectAtIndex:i];
|
event = [_events objectAtIndex:i];
|
||||||
ical = [renderer iCalendarStringForEvent:event];
|
ical = [event versitString];
|
||||||
|
|
||||||
if (![ical isNotNull] && ([ical length] == 0)) {
|
if (![ical isNotNull] && ([ical length] == 0)) {
|
||||||
[self logWithFormat:@"ERROR: got no ical representation of event: %@",
|
[self logWithFormat:@"ERROR: got no ical representation of event: %@",
|
||||||
|
|
Loading…
Reference in a new issue