--- /dev/null
+# $Id$
+
+- add a 'view' page for Groups (SOGoGroupsFolder)
+ (initially empty ...)
+
+- add a 'view' page for custom groups (SOGoCustomGroupFolder)
+ - or: a generic one for groups?
};
};
};
+
+ SOGoGroupsFolder = {
+ superclass = "SOGoObject";
+ methods = {
+ };
+ };
+ SOGoGroupFolder = {
+ superclass = "SOGoObject";
+ methods = {
+ };
+ };
+ SOGoCustomGroupFolder = {
+ superclass = "SOGoGroupFolder";
+ methods = {
+ };
+ };
};
}
+2004-08-11 <helge@agenor.opengroupware.org>
+
+ * v0.9.6
+
+ * SOGoUserFolder.m: added "Groups" folder name and lookup
+
+ * added: SOGoGroupsFolder, SOGoGroupFolder, SOGoCustomGroupFolder
+
2004-07-02 Helge Hess <helge.hess@opengroupware.org>
* SOGoObject.m: added -delete method (but not yet implemented)
SOGoFolder.h \
SOGoContentObject.h \
SOGoUserFolder.h \
+ SOGoGroupsFolder.h \
+ SOGoGroupFolder.h \
+ SOGoCustomGroupFolder.h \
libSOGo_OBJC_FILES = \
SOGoObject.m \
SOGoFolder.m \
SOGoContentObject.m \
SOGoUserFolder.m \
+ SOGoGroupsFolder.m \
+ SOGoGroupFolder.m \
+ SOGoCustomGroupFolder.m \
-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/library.make
Common SOGo objects.
-Note that the SOPE objects are registered by the Main bundle products.plist.
+NOTE: the SOPE objects are registered by the Main bundle products.plist.
Class Hierarchy
===============
SOGoObject
SOGoContentObject
SOGoFolder
- SOGoUserFolder
+ SOGoUserFolder - the "home" directory
+ SOGoGroupsFolder - intermediate folder
+ SOGoGroupFolder - a folder representing a set of people
+ SOGoCustomGroupFolder - a custom group (eg '_custom_helge,znek')
+
+TODO
+====
+- why is SOGoUserFolder an OCS folder?
--- /dev/null
+/*
+ Copyright (C) 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: SOGoCustomGroupFolder.h 107 2004-06-30 10:26:46Z helge $
+
+#ifndef __SOGo_SOGoCustomGroupFolder_H__
+#define __SOGo_SOGoCustomGroupFolder_H__
+
+#include <SOGo/SOGoGroupFolder.h>
+
+/*
+ SOGoCustomGroupFolder
+ same parent/child like SOGoGroupFolder
+
+ This is a specific group folder for 'custom' groups. Group members are
+ currently encoded as the folder name in the URL like
+ _custom_znek,helge
+*/
+
+@class NSArray;
+
+@interface SOGoCustomGroupFolder : SOGoGroupFolder
+{
+ NSArray *uids;
+}
+
+/* accessors */
+
+- (NSArray *)uids;
+
+/* pathes */
+
+@end
+
+#endif /* __SOGo_SOGoCustomGroupFolder_H__ */
--- /dev/null
+/*
+ Copyright (C) 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: SOGoCustomGroupFolder.m 115 2004-06-30 11:57:37Z helge $
+
+#include "SOGoCustomGroupFolder.h"
+#include "common.h"
+
+@implementation SOGoCustomGroupFolder
+
+static NSString *SOGoUIDSeparator = @",";
+
+- (void)dealloc {
+ [self->uids release];
+ [super dealloc];
+}
+
+/* accessors */
+
+- (NSArray *)unescapeURLComponents:(NSArray *)_parts {
+#warning TODO: implement URL UID unescaping if necessary
+ // Note: remember URL encoding!
+ return _parts;
+}
+
+- (NSArray *)uids {
+ NSArray *a;
+ NSString *s;
+
+ if (self->uids != nil)
+ return self->uids;
+
+ s = [self nameInContainer];
+ if (![s hasPrefix:@"_custom_"]) {
+ [self logWithFormat:@"WARNING: incorrect custom group folder name: '%@'",
+ s];
+ return nil;
+ }
+
+ s = [s substringFromIndex:8];
+ a = [s componentsSeparatedByString:SOGoUIDSeparator];
+ a = [self unescapeURLComponents:a];
+ self->uids = [a copy];
+
+ if ([self->uids count] < 2)
+ [self debugWithFormat:@"Note: less than two custom group members!"];
+
+ return self->uids;
+}
+
+@end /* SOGoCustomGroupFolder */
--- /dev/null
+/*
+ Copyright (C) 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: SOGoGroupFolder.h 107 2004-06-30 10:26:46Z helge $
+
+#ifndef __SOGo_SOGoGroupFolder_H__
+#define __SOGo_SOGoGroupFolder_H__
+
+#include <SOGo/SOGoObject.h>
+
+/*
+ SOGoGroupFolder
+ Parent object: the SOGoGroupsFolder
+ Child objects:
+*/
+
+@interface SOGoGroupFolder : SOGoObject
+{
+}
+
+/* accessors */
+
+- (NSArray *)uids;
+
+/* pathes */
+
+@end
+
+#endif /* __SOGo_SOGoGroupFolder_H__ */
--- /dev/null
+/*
+ Copyright (C) 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: SOGoGroupFolder.m 115 2004-06-30 11:57:37Z helge $
+
+#include "SOGoGroupFolder.h"
+#include "common.h"
+
+@implementation SOGoGroupFolder
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+/* accessors */
+
+/* SOPE */
+
+- (BOOL)isFolderish {
+ return YES;
+}
+
+/* looking up shared objects */
+
+- (SOGoGroupFolder *)lookupGroupFolder {
+ return [[self container] lookupGroupFolder];
+}
+
+/* pathes */
+
+/* name lookup */
+
+@end /* SOGoGroupFolder */
--- /dev/null
+/*
+ Copyright (C) 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: SOGoGroupsFolder.h 107 2004-06-30 10:26:46Z helge $
+
+#ifndef __SOGo_SOGoGroupsFolder_H__
+#define __SOGo_SOGoGroupsFolder_H__
+
+#include <SOGo/SOGoObject.h>
+
+/*
+ SOGoGroupsFolder
+ Parent object: the SOGoUserFolder
+ Child objects: SOGoGroupFolder objects
+ '_custom_*': SOGoCustomGroupFolder
+
+ This object represents a collection of groups, its the "Groups" in such a
+ path:
+ /SOGo/so/znek/Groups/sales
+
+ It also acts as a factory for the proper group folders, eg "custom" groups
+ (arbitary person collections) or later on cookie based configured groups or
+ groups stored in LDAP.
+*/
+
+@class NSString;
+
+@interface SOGoGroupsFolder : SOGoObject
+{
+}
+
+/* accessors */
+
+/* looking up shared objects */
+
+- (SOGoGroupsFolder *)lookupGroupsFolder;
+
+/* pathes */
+
+@end
+
+#endif /* __SOGo_SOGoGroupsFolder_H__ */
--- /dev/null
+/*
+ Copyright (C) 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: SOGoGroupsFolder.m 115 2004-06-30 11:57:37Z helge $
+
+#include "SOGoGroupsFolder.h"
+#include "common.h"
+
+@implementation SOGoGroupsFolder
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+/* accessors */
+
+/* SOPE */
+
+- (BOOL)isFolderish {
+ return YES;
+}
+
+/* looking up shared objects */
+
+- (SOGoGroupsFolder *)lookupGroupsFolder {
+ return self;
+}
+
+/* pathes */
+
+/* name lookup */
+
+- (id)customGroup:(NSString *)_key inContext:(id)_ctx {
+ static Class groupClass = Nil;
+ id group;
+
+ if (groupClass == Nil)
+ groupClass = NSClassFromString(@"SOGoCustomGroupFolder");
+ if (groupClass == Nil) {
+ [self logWithFormat:@"ERROR: missing SOGoCustomGroupFolder class!"];
+ return nil;
+ }
+
+ group = [[groupClass alloc] initWithName:_key inContainer:self];
+ return [group 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 hasPrefix:@"_custom_"])
+ return [self customGroup:_key inContext:_ctx];
+
+ /* return 404 to stop acquisition */
+ return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
+}
+
+@end /* SOGoGroupsFolder */
@class NSString, NSMutableString, NSException;
@class OCSFolderManager, OCSFolder;
-@class SOGoUserFolder;
+@class SOGoUserFolder, SOGoGroupsFolder;
@interface SOGoObject : NSObject
{
/* looking up shared objects */
- (SOGoUserFolder *)lookupUserFolder;
+- (SOGoGroupsFolder *)lookupGroupsFolder;
/* operations */
// $Id$
#include "SOGoObject.h"
+#include "SOGoUserFolder.h"
#include "common.h"
@implementation SOGoObject
return [self->container lookupUserFolder];
}
+- (SOGoGroupsFolder *)lookupGroupsFolder {
+ return [[self lookupUserFolder] lookupGroupsFolder];
+}
/* operations */
#include <SOGo/SOGoFolder.h>
+/*
+ SOGoUserFolder
+ Parent object: the root object (SoApplication object)
+ Child objects:
+ 'Groups': SOGoGroupsFolder
+ 'Calendar': SOGoAppointmentFolder
+
+ The SOGoUserFolder is the "home directory" of the user where all his
+ processing starts. It is the 'znek' in such a path:
+ /SOGo/so/znek/Calendar
+*/
+
@class NSString;
@interface SOGoUserFolder : SOGoFolder
- (SOGoUserFolder *)lookupUserFolder {
return self;
}
+- (SOGoGroupsFolder *)lookupGroupsFolder {
+ return [self lookupName:@"Groups" inContext:nil acquire:NO];
+}
/* pathes */
return [calendar autorelease];
}
+- (id)groupsFolder:(NSString *)_key inContext:(id)_ctx {
+ static Class fldClass = Nil;
+ id folder;
+
+ if (fldClass == Nil)
+ fldClass = NSClassFromString(@"SOGoGroupsFolder");
+ if (fldClass == Nil) {
+ [self logWithFormat:@"ERROR: missing SOGoGroupsFolder class!"];
+ return nil;
+ }
+
+ folder = [[fldClass alloc] initWithName:_key inContainer:self];
+ return [folder autorelease];
+}
+
- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
id obj;
if ([_key isEqualToString:@"Calendar"])
return [self privateCalendar:_key inContext:_ctx];
+ if ([_key isEqualToString:@"Groups"])
+ return [self groupsFolder:_key inContext:_ctx];
+
/* return 404 to stop acquisition */
return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
}
--- /dev/null
+# $Id: Version 170 2004-08-11 10:45:40Z helge $
+
+SUBMINOR_VERSION:=6
for (i = 0; i < count; i++) {
NSString *name;
id obj;
-
+
obj = [traversalObjects objectAtIndex:i];
name = [obj davDisplayName];
if (![name hasPrefix:@"sogod"]) {
NSMutableDictionary *c;
NSString *url;
-
+
url = [obj baseURLInContext:[self context]];
- if(![url hasSuffix:@"/"]) {
- url = [url stringByAppendingString:@"/"];
- }
+ if (![url hasSuffix:@"/"])
+ url = [url stringByAppendingString:@"/"];
+
c = [[NSMutableDictionary alloc] initWithCapacity:2];
[c setObject:name forKey:@"name"];
[c setObject:url forKey:@"url"];