From: znek Date: Sun, 27 Jun 2004 22:12:38 +0000 (+0000) Subject: Plain stupid first version of SOGoLogic X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f107d93f87cd3c88ac735d6ea79b7f36e12a3637;p=scalable-opengroupware.org Plain stupid first version of SOGoLogic git-svn-id: http://svn.opengroupware.org/SOGo/trunk@64 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGoLogic/ChangeLog b/SOGoLogic/ChangeLog new file mode 100644 index 00000000..f66d082c --- /dev/null +++ b/SOGoLogic/ChangeLog @@ -0,0 +1,3 @@ +2004-06-25 Marcus Mueller + + * created. \ No newline at end of file diff --git a/SOGoLogic/GNUmakefile b/SOGoLogic/GNUmakefile new file mode 100644 index 00000000..76e9dfd2 --- /dev/null +++ b/SOGoLogic/GNUmakefile @@ -0,0 +1,23 @@ +# $Id$ + +include $(GNUSTEP_MAKEFILES)/common.make + +include Version + +LIBRARY_NAME = libSOGoLogic + +libSOGoLogic_HEADER_FILES_DIR = . +libSOGoLogic_HEADER_FILES_INSTALL_DIR = /SOGoLogic +libSOGoLogic_SOVERSION=$(MAJOR_VERSION).$(MINOR_VERSION) + +libSOGoLogic_HEADER_FILES += \ + SOGoAppointment.h \ + +libSOGoLogic_OBJC_FILES += \ + SOGoAppointment.m \ + +libSOGoLogic_LIBRARY_DEPENDS_UPON += -lNGiCal + +-include GNUmakefile.preamble +include $(GNUSTEP_MAKEFILES)/library.make +-include GNUmakefile.postamble diff --git a/SOGoLogic/SOGoAppointment.h b/SOGoLogic/SOGoAppointment.h new file mode 100644 index 00000000..a85331bc --- /dev/null +++ b/SOGoLogic/SOGoAppointment.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ +// $Id$ + + +#ifndef __SOGoAppointment_H_ +#define __SOGoAppointment_H_ + + +#import + + +@interface SOGoAppointment : NSObject +{ + id event; +} + +- (id)initWithiCalString:(NSString *)_iCal; + +- (id)event; + +@end + +#endif /* __SOGoAppointment_H_ */ diff --git a/SOGoLogic/SOGoAppointment.m b/SOGoLogic/SOGoAppointment.m new file mode 100644 index 00000000..ede2088e --- /dev/null +++ b/SOGoLogic/SOGoAppointment.m @@ -0,0 +1,72 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ +// $Id$ + + +#include "SOGoAppointment.h" +#include + + +@implementation SOGoAppointment + +- (id)initWithiCalString:(NSString *)_iCal { + if ((self = [self init])) { + id parser; + SaxObjectDecoder *sax; + + parser = + [[[SaxXMLReaderFactory standardXMLReaderFactory] + createXMLReaderForMimeType:@"text/calendar"] + retain]; + if (parser == nil) { + NSLog(@"did not find a parser for text/calendar !"); + [self release]; + return nil; + } + + sax = [[SaxObjectDecoder alloc] initWithMappingNamed:@"NGiCal"]; + if (sax == nil) { + NSLog(@"could not create the iCal SAX handler !"); + [self release]; + return nil; + } + + [parser setContentHandler:sax]; + [parser setErrorHandler:sax]; + + [parser parseFromSource:_iCal]; + self->event = [[sax rootObject] retain]; + [parser release]; + [sax release]; + } + return self; +} + +- (void)dealloc { + [self->event release]; + [super dealloc]; +} + +- (id)event { + return self->event; +} + +@end diff --git a/SOGoLogic/Version b/SOGoLogic/Version new file mode 100644 index 00000000..237a5904 --- /dev/null +++ b/SOGoLogic/Version @@ -0,0 +1,3 @@ +# $Id$ + +SUBMINOR_VERSION:=1