diff --git a/ChangeLog b/ChangeLog index fc35cde61..5b754c716 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-04-17 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoAclsFolder.m: removed module because its + methods have been moved into SOGoObject and SOGoFolder during a refactoring. + * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor -iCalParticipantsAndResourcesStringFromQueryParameters]): removed method made useless by the programmatic handling of iCalendar diff --git a/SoObjects/SOGo/GNUmakefile b/SoObjects/SOGo/GNUmakefile index e5e5dc496..15b792769 100644 --- a/SoObjects/SOGo/GNUmakefile +++ b/SoObjects/SOGo/GNUmakefile @@ -23,7 +23,6 @@ libSOGo_HEADER_FILES = \ SOGoObject.h \ SOGoFolder.h \ SOGoContentObject.h \ - SOGoAclsFolder.h \ SOGoUserFolder.h \ SOGoGroupsFolder.h \ SOGoGroupFolder.h \ @@ -47,7 +46,6 @@ libSOGo_OBJC_FILES = \ SOGoObject.m \ SOGoFolder.m \ SOGoContentObject.m \ - SOGoAclsFolder.m \ SOGoUserFolder.m \ SOGoGroupsFolder.m \ SOGoGroupFolder.m \ diff --git a/SoObjects/SOGo/SOGoAclsFolder.h b/SoObjects/SOGo/SOGoAclsFolder.h deleted file mode 100644 index 108db62b5..000000000 --- a/SoObjects/SOGo/SOGoAclsFolder.h +++ /dev/null @@ -1,49 +0,0 @@ -/* SOGoAclsFolder.h - this file is part of SOGo - * - * Copyright (C) 2006 Inverse groupe conseil - * - * Author: Wolfgang Sourdeau - * - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This file 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef SOGOACLSFOLDER_H -#define SOGOACLSFOLDER_H - -#import - -@class NSString; -@class GCSFolder; -@class SOGoObject; - -@interface SOGoAclsFolder : NSObject -{ - NSString *ocsPath; - GCSFolder *ocsFolder; -} - -+ (id) aclsFolder; - -- (NSArray *) aclsForObject: (SOGoObject *) object; -- (NSArray *) aclsForObject: (SOGoObject *) object - forUser: (NSString *) uid; -- (void) setRoleForObject: (SOGoObject *) object - forUsers: (NSArray *) uids - to: (NSString *) role; - -@end - -#endif /* SOGOACLSOBJECT_H */ diff --git a/SoObjects/SOGo/SOGoAclsFolder.m b/SoObjects/SOGo/SOGoAclsFolder.m deleted file mode 100644 index 64c97106e..000000000 --- a/SoObjects/SOGo/SOGoAclsFolder.m +++ /dev/null @@ -1,230 +0,0 @@ -/* SOGoAclsFolder.m - this file is part of SOGo - * - * Copyright (C) 2006 Inverse groupe conseil - * - * Author: Wolfgang Sourdeau - * - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This file 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#import -#import -#import - -#import -#import -#import -#import -#import -#import - -#import "SOGoFolder.h" -#import "SOGoAclsFolder.h" - -@implementation SOGoAclsFolder - -+ (id) aclsFolder -{ - id aclsFolder; - - aclsFolder = [self new]; - [aclsFolder autorelease]; - - return aclsFolder; -} - -- (id) init -{ - if ((self = [super init])) - { - ocsPath = nil; - ocsFolder = nil; - } - - return self; -} - -- (void) dealloc -{ - if (ocsPath) - [ocsPath release]; - if (ocsFolder) - [ocsFolder release]; - [super dealloc]; -} - -- (void) setOCSPath: (NSString *) newOCSPath -{ - if (ocsPath) - [ocsPath release]; - ocsPath = newOCSPath; - if (ocsPath) - [ocsPath retain]; -} - -- (GCSFolderManager *)folderManager { - return [GCSFolderManager defaultFolderManager]; -} - -- (GCSFolder *)ocsFolderForPath:(NSString *)_path { - return [[self folderManager] folderAtPath:_path]; -} - -- (GCSFolder *) ocsFolder { - GCSFolder *folder; - - if (!ocsFolder) - ocsFolder = [[self ocsFolderForPath: ocsPath] retain]; - - if ([ocsFolder isNotNull]) - folder = ocsFolder; - else - folder = nil; - - return folder; -} - -- (NSString *) _ocsPathForObject: (SOGoObject *) object -{ - NSString *pathForObject; - id currentObject; - BOOL done; - - pathForObject = nil; - currentObject = object; - done = NO; - while (currentObject && !done) - if ([currentObject isKindOfClass: [SOGoFolder class]]) - { - pathForObject = [(SOGoFolder *) currentObject ocsPath]; - done = YES; -// if (!pathForObject) -// currentObject = [currentObject container]; - } - else - currentObject = [currentObject container]; - - return pathForObject; -} - -- (NSArray *) aclsForObject: (SOGoObject *) object -{ - EOQualifier *qualifier; - NSString *objectPath; - - [self setOCSPath: [self _ocsPathForObject: object]]; - - objectPath - = [NSString stringWithFormat: @"/%@", - [[object pathArrayToSoObject] componentsJoinedByString: @"/"]]; - qualifier - = [EOQualifier qualifierWithQualifierFormat: @"c_object = %@", objectPath]; - - return [[self ocsFolder] fetchAclMatchingQualifier: qualifier]; -} - -- (NSArray *) aclsForObject: (SOGoObject *) object - forUser: (NSString *) uid -{ - EOQualifier *qualifier; - NSString *objectPath; - NSArray *records; - - [self setOCSPath: [self _ocsPathForObject: object]]; - - objectPath - = [NSString stringWithFormat: @"/%@", - [[object pathArrayToSoObject] componentsJoinedByString: @"/"]]; - qualifier = [EOQualifier - qualifierWithQualifierFormat: @"(c_object = %@) AND (c_uid = %@)", - objectPath, uid]; - - records = [[self ocsFolder] fetchAclMatchingQualifier: qualifier]; - - return [records valueForKey: @"c_role"]; -} - -- (void) removeUsersWithRole: (NSString *) role - forObjectAtPath: (NSString *) objectPath - inFolder: (GCSFolder *) folder -{ - NSString *deleteSQL; - EOAdaptorChannel *channel; - - channel = [folder acquireAclChannel]; - - deleteSQL = [NSString stringWithFormat: @"DELETE FROM %@" - @" WHERE c_object = '%@'" - @" AND c_role = '%@'", - [folder aclTableName], objectPath, role]; - [channel evaluateExpressionX: deleteSQL]; -} - -- (void) setRoleForObjectAtPath: (NSString *) objectPath - forUser: (NSString *) uid - to: (NSString *) role - inFolder: (GCSFolder *) folder -{ - NSString *SQL; - EOAdaptorChannel *channel; - - channel = [folder acquireAclChannel]; - - SQL = [NSString stringWithFormat: @"DELETE FROM %@" - @" WHERE c_object = '%@'" - @" AND c_uid = '%@'", - [folder aclTableName], objectPath, uid]; - [channel evaluateExpressionX: SQL]; - SQL = [NSString stringWithFormat: @"INSERT INTO %@" - @" (c_object, c_uid, c_role)" - @" VALUES ('%@', '%@', '%@')", [folder aclTableName], - objectPath, uid, role]; - [channel evaluateExpressionX: SQL]; -} - -/* FIXME: part of this code should be moved to sope-gdl/GCSFolder.m */ -- (void) setRoleForObject: (SOGoObject *) object - forUsers: (NSArray *) uids - to: (NSString *) role -{ - GCSFolder *aclsFolder; - NSString *objectPath, *currentUID; - NSEnumerator *userUIDs; - - [self setOCSPath: [self _ocsPathForObject: object]]; - aclsFolder = [self ocsFolder]; - - objectPath - = [NSString stringWithFormat: @"/%@", - [[object pathArrayToSoObject] componentsJoinedByString: @"/"]]; - [self removeUsersWithRole: role - forObjectAtPath: objectPath - inFolder: aclsFolder]; - - userUIDs = [uids objectEnumerator]; - currentUID = [userUIDs nextObject]; - while (currentUID) - { - if ([currentUID length] > 0) - [self setRoleForObjectAtPath: objectPath - forUser: currentUID - to: role - inFolder: aclsFolder]; - currentUID = [userUIDs nextObject]; - } -} - -@end