@interface SOGoContentObject : SOGoObject
{
+ NSString *ocsPath;
}
+/* accessors */
+
+- (void)setOCSPath:(NSString *)_path;
+- (NSString *)ocsPath;
+
@end
#endif /* __SOGo_SOGoContentObject_H__ */
@implementation SOGoContentObject
- (void)dealloc {
+ [self->ocsPath release];
[super dealloc];
}
+/* accessors */
+
+- (BOOL)isFolderish {
+ return NO;
+}
+
+- (void)setOCSPath:(NSString *)_path {
+ if ([self->ocsPath isEqualToString:_path])
+ return;
+
+ if (self->ocsPath)
+ [self logWithFormat:@"WARNING: OCS path is already set! '%@'", _path];
+
+ ASSIGNCOPY(self->ocsPath, _path);
+}
+- (NSString *)ocsPath {
+ return self->ocsPath;
+}
+
@end /* SOGoContentObject */
@interface SOGoFolder : SOGoObject
{
+ NSString *ocsPath;
}
+/* accessors */
+
+- (void)setOCSPath:(NSString *)_Path;
+- (NSString *)ocsPath;
+
@end
#endif /* __SOGo_SOGoFolder_H__ */
@implementation SOGoFolder
- (void)dealloc {
+ [self->ocsPath release];
[super dealloc];
}
return YES;
}
+- (void)setOCSPath:(NSString *)_path {
+ if ([self->ocsPath isEqualToString:_path])
+ return;
+
+ if (self->ocsPath)
+ [self logWithFormat:@"WARNING: OCS path is already set! '%@'", _path];
+
+ ASSIGNCOPY(self->ocsPath, _path);
+}
+- (NSString *)ocsPath {
+ return self->ocsPath;
+}
+
@end /* SOGoFolder */
return [self->container lookupUserFolder];
}
+/* KVC hacks */
+
+- (id)valueForUndefinedKey:(NSString *)_key {
+ return nil;
+}
+
@end /* SOGoObject */
#include <SOGo/SOGoFolder.h>
+@class NSString;
+
@interface SOGoUserFolder : SOGoFolder
{
}
- (NSString *)login;
+/* pathes */
+
+- (NSString *)ocsUserPath;
+- (NSString *)ocsPrivateCalendarPath;
+
@end
#endif /* __SOGo_SOGoUserFolder_H__ */
return self;
}
+/* pathes */
+
+- (void)setOCSPath:(NSString *)_path {
+ [self logWithFormat:
+ @"WARNING: rejected attempt to reset user-folder path: '%@'",
+ _path];
+}
+- (NSString *)ocsPath {
+ return [@"/Users/" stringByAppendingString:[self login]];
+}
+
+- (NSString *)ocsUserPath {
+ return [self ocsPath];
+}
+- (NSString *)ocsPrivateCalendarPath {
+ return [[self ocsUserPath] stringByAppendingString:@"/Calendar"];
+}
+
+/* name lookup */
+
+- (id)privateCalendar:(NSString *)_key inContext:(id)_ctx {
+ static Class calClass = Nil;
+ id calendar;
+
+ if (calClass == Nil)
+ calClass = NSClassFromString(@"SOGoAppointmentFolder");
+ if (calClass == Nil) {
+ [self logWithFormat:@"ERROR: missing SOGoAppointmentFolder!"];
+ return nil;
+ }
+
+ calendar = [[calClass alloc] initWithName:_key inContainer:self];
+ [calendar setOCSPath:[self ocsPrivateCalendarPath]];
+ return [calendar autorelease];
+}
+
+- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
+ id obj;
+
+ /* first check attributes directly bound to the application */
+ if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]))
+ return obj;
+
+ if ([_key isEqualToString:@"Calendar"])
+ return [self privateCalendar:_key inContext:_ctx];
+
+ /* return 404 to stop acquisition */
+ return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
+}
+
@end /* SOGoUserFolder */
2004-06-30 Helge Hess <helge.hess@opengroupware.org>
+ * UIxCalView.h, UIxAppointmentView.h, UIxAppointmentEditor.m: include
+ UIxComponent from SOGoUI
+
* removed backend stuff from some sources
* product.plist: bind things on SOGoAppointmentXXX instead of SX...
/*
Copyright (C) 2000-2004 SKYRIX Software AG
- This file is part of OGo
+ 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
#include "common.h"
-#include <Common/UIxComponent.h>
+#include <SOGoUI/UIxComponent.h>
#include <SOGoLogic/SOGoAppointment.h>
#include <NGiCal/NGiCal.h>
/* TODO: CLEAN THIS MESS UP */
+@interface NSDate(UsedPrivates)
+- (NSString *)icalString; // TODO: this is in NGiCal
+@end
@interface NSObject (AppointmentHack)
- (BOOL)isAppointment;
#ifndef __ZideStoreUI_UIxAppointmentView_H__
#define __ZideStoreUI_UIxAppointmentView_H__
-#include <Common/UIxComponent.h>
+#include <SOGoUI/UIxComponent.h>
@interface UIxAppointmentView : UIxComponent
{
#ifndef __ZideStoreUI_UIxCalView_H__
#define __ZideStoreUI_UIxCalView_H__
-#include <Common/UIxComponent.h>
+#include <SOGoUI/UIxComponent.h>
@class NSArray, NSCalendarDate;