See ChangeLog
Monotone-Parent: 8d42e44b72c2c9e6431e77f6b5c590736449f7d7 Monotone-Revision: bafccbe12139895411068d388269aca400af46ec Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2009-04-01T13:49:24 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
4d8563ac99
commit
8f2318fe52
|
@ -1,3 +1,8 @@
|
|||
2009-04-01 Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||
|
||||
* Dropped worthless tools
|
||||
* Fixed tons of compiler warnings
|
||||
|
||||
2009-03-31 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxCalListingActions.m ([UIxCalListingActions
|
||||
|
|
|
@ -5,7 +5,6 @@ include $(GNUSTEP_MAKEFILES)/common.make
|
|||
include ./Version
|
||||
|
||||
LIBRARY_NAME = libOGoContentStore
|
||||
TOOL_NAME = test_quick_extract
|
||||
|
||||
TYPEMODELS_DIR = $(SOGO_TYPEMODELS)
|
||||
|
||||
|
@ -26,9 +25,6 @@ libOGoContentStore_TYPEMODELS += \
|
|||
appointment-oracle.ocs \
|
||||
contact-oracle.ocs
|
||||
|
||||
test_quick_extract_OBJC_FILES += \
|
||||
test_quick_extract.m
|
||||
|
||||
-include GNUmakefile.preamble
|
||||
ifneq ($(FHS_INSTALL_ROOT),)
|
||||
GNUSTEP_HEADERS=$(DESTDIR)$(FHS_INSTALL_ROOT)/include
|
||||
|
|
|
@ -1,127 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2005 SKYRIX Software AG
|
||||
|
||||
This file is part of SOGo.
|
||||
|
||||
SOGo 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.
|
||||
|
||||
SOGo 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 SOGo; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <Foundation/NSProcessInfo.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
#import <NGExtensions/NSProcessInfo+misc.h>
|
||||
|
||||
#import <GDLContentStore/GCSFieldExtractor.h>
|
||||
|
||||
@interface TestQuickExtract : NSObject
|
||||
|
||||
- (int)runWithArguments:(NSArray *)_args;
|
||||
|
||||
@end
|
||||
|
||||
@implementation TestQuickExtract
|
||||
|
||||
- (int)usage:(NSArray *)_args {
|
||||
fprintf(stderr, "usage: %s <ExtractorClassName> <file1> <file2>\n",
|
||||
[[_args objectAtIndex:0] cString]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (void)extractQuickInfoFromFileAtPath:(NSString *)_path
|
||||
usingExtractorClass:(Class)_clazz
|
||||
{
|
||||
GCSFieldExtractor *extractor;
|
||||
NSString *content;
|
||||
NSDictionary *quickInfo;
|
||||
|
||||
if ((content = [NSString stringWithContentsOfFile:_path]) == nil) {
|
||||
fprintf(stderr, "ERROR: could not open file: %s\n", [_path cString]);
|
||||
return;
|
||||
}
|
||||
|
||||
extractor = [[_clazz alloc] init];
|
||||
quickInfo = [[extractor extractQuickFieldsFromContent:content] retain];
|
||||
[extractor release]; extractor = nil;
|
||||
|
||||
if ([quickInfo count] == 0) {
|
||||
fprintf(stderr, "ERROR: could not extract quickfields from file: %s\n",
|
||||
[_path cString]);
|
||||
return;
|
||||
}
|
||||
|
||||
printf("File: %s\n", [_path cString]);
|
||||
printf("**************************************************\n");
|
||||
printf("%s\n", [[quickInfo description] cString]);
|
||||
|
||||
[quickInfo release];
|
||||
}
|
||||
|
||||
- (void)extractQuickInfoFromFiles:(NSEnumerator *)_pathes
|
||||
usingExtractorClass:(Class)_clazz
|
||||
{
|
||||
NSString *path;
|
||||
|
||||
while ((path = [_pathes nextObject]) != nil)
|
||||
[self extractQuickInfoFromFileAtPath:path usingExtractorClass:_clazz];
|
||||
}
|
||||
|
||||
- (int)runWithArguments:(NSArray *)_args {
|
||||
NSEnumerator *e;
|
||||
Class clazz;
|
||||
|
||||
if ([_args count] < 3)
|
||||
return [self usage:_args];
|
||||
|
||||
if ((clazz = NSClassFromString([_args objectAtIndex:1])) == Nil) {
|
||||
fprintf(stderr, "ERROR: did not find extractor class: %s\n",
|
||||
[[_args objectAtIndex:1] cString]);
|
||||
return 2;
|
||||
}
|
||||
|
||||
e = [_args objectEnumerator];
|
||||
[e nextObject]; // skip toolname
|
||||
[e nextObject]; // skip classname
|
||||
|
||||
[self extractQuickInfoFromFiles:e usingExtractorClass:clazz];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@end /* TestQuickExtract */
|
||||
|
||||
|
||||
int main(int argc, char **argv, char **env) {
|
||||
NSAutoreleasePool *pool;
|
||||
TestQuickExtract *tool;
|
||||
int rc;
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
#endif
|
||||
|
||||
tool = [[TestQuickExtract alloc] init];
|
||||
rc = [tool runWithArguments:
|
||||
[[NSProcessInfo processInfo] argumentsWithoutDefaults]];
|
||||
[tool release];
|
||||
[pool release];
|
||||
return rc;
|
||||
}
|
|
@ -16,8 +16,6 @@ libGDLContentStore_PCH_FILE = common.h
|
|||
libGDLContentStore_INTERFACE_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION)
|
||||
libGDLContentStore_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION)
|
||||
|
||||
TOOL_NAME = gcs_ls gcs_mkdir gcs_cat gcs_recreatequick gcs_gensql
|
||||
|
||||
libGDLContentStore_HEADER_FILES_DIR = .
|
||||
libGDLContentStore_HEADER_FILES_INSTALL_DIR = /GDLContentStore
|
||||
FHS_HEADER_FILES_INSTALL_DIR = $(libGDLContentStore_HEADER_FILES_INSTALL_DIR)
|
||||
|
@ -49,13 +47,6 @@ libGDLContentStore_OBJC_FILES += \
|
|||
GCSFieldExtractor.m \
|
||||
GCSStringFormatter.m \
|
||||
|
||||
gcs_ls_OBJC_FILES += gcs_ls.m
|
||||
gcs_mkdir_OBJC_FILES += gcs_mkdir.m
|
||||
gcs_cat_OBJC_FILES += gcs_cat.m
|
||||
gcs_gensql_OBJC_FILES += gcs_gensql.m
|
||||
gcs_recreatequick_OBJC_FILES += gcs_recreatequick.m
|
||||
|
||||
|
||||
# framework support
|
||||
|
||||
GDLContentStore_PCH_FILE = $(libGDLContentStore_PCH_FILE)
|
||||
|
|
|
@ -1,128 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2004-2005 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <NGExtensions/NSProcessInfo+misc.h>
|
||||
|
||||
#import <GDLContentStore/GCSFolder.h>
|
||||
#import <GDLContentStore/GCSFolderManager.h>
|
||||
|
||||
@class NSUserDefaults, NSArray;
|
||||
@class GCSFolderManager;
|
||||
|
||||
@interface Tool : NSObject
|
||||
{
|
||||
NSUserDefaults *ud;
|
||||
GCSFolderManager *folderManager;
|
||||
}
|
||||
|
||||
+ (int)runWithArgs:(NSArray *)_args;
|
||||
- (int)run;
|
||||
|
||||
@end
|
||||
|
||||
@implementation Tool
|
||||
|
||||
- (id)init {
|
||||
if ((self = [super init])) {
|
||||
self->ud = [[NSUserDefaults standardUserDefaults] retain];
|
||||
self->folderManager = [[GCSFolderManager defaultFolderManager] retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (void)dealloc {
|
||||
[self->ud release];
|
||||
[self->folderManager release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
/* operation */
|
||||
|
||||
- (int)runOnPath:(NSString *)_path {
|
||||
GCSFolder *folder;
|
||||
NSString *dirname, *filename;
|
||||
NSString *content;
|
||||
|
||||
dirname = [_path stringByDeletingLastPathComponent];
|
||||
filename = [_path lastPathComponent];
|
||||
|
||||
if ((folder = [self->folderManager folderAtPath:dirname]) == nil) {
|
||||
[self logWithFormat:@"did not find folder for file: '%@'", dirname];
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((content = [folder fetchContentWithName:filename]) == nil) {
|
||||
[self logWithFormat:@"did not find file: '%@'", _path];
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("%s\n", [content cString]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (int)run {
|
||||
NSEnumerator *e;
|
||||
NSString *path;
|
||||
|
||||
[self logWithFormat:@"manager: %@", self->folderManager];
|
||||
|
||||
if (![self->folderManager canConnect]) {
|
||||
[self logWithFormat:@"cannot connect folder-info database!"];
|
||||
return 1;
|
||||
}
|
||||
|
||||
e = [[[NSProcessInfo processInfo] argumentsWithoutDefaults]
|
||||
objectEnumerator];
|
||||
[e nextObject]; // skip tool name
|
||||
|
||||
while ((path = [e nextObject]))
|
||||
[self runOnPath:path];
|
||||
|
||||
return 0;
|
||||
}
|
||||
+ (int)runWithArgs:(NSArray *)_args {
|
||||
return [(Tool *)[[[self alloc] init] autorelease] run];
|
||||
}
|
||||
|
||||
@end /* Tool */
|
||||
|
||||
int main(int argc, char **argv, char **env) {
|
||||
NSAutoreleasePool *pool;
|
||||
int rc;
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
#endif
|
||||
|
||||
rc = [Tool runWithArgs:
|
||||
[[NSProcessInfo processInfo] argumentsWithoutDefaults]];
|
||||
|
||||
[pool release];
|
||||
return rc;
|
||||
}
|
|
@ -1,121 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2005 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <NGExtensions/NSProcessInfo+misc.h>
|
||||
|
||||
#import <GDLContentStore/GCSFolderType.h>
|
||||
|
||||
|
||||
@class NSUserDefaults, NSArray;
|
||||
@class GCSFolderManager;
|
||||
|
||||
@interface Tool : NSObject
|
||||
{
|
||||
NSUserDefaults *ud;
|
||||
}
|
||||
|
||||
+ (int)runWithArgs:(NSArray *)_args;
|
||||
- (int)run;
|
||||
|
||||
@end
|
||||
|
||||
@implementation Tool
|
||||
|
||||
- (id)init {
|
||||
if ((self = [super init])) {
|
||||
self->ud = [[NSUserDefaults standardUserDefaults] retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (void)dealloc {
|
||||
[self->ud release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
/* operation */
|
||||
|
||||
- (int)runOnTable:(NSString *)_tableName typeName:(NSString *)_typeName {
|
||||
GCSFolderType *folderType;
|
||||
|
||||
if ((folderType = [GCSFolderType folderTypeWithName:_typeName]) != nil) {
|
||||
NSString *s;
|
||||
|
||||
s = [folderType sqlQuickCreateWithTableName:_tableName];
|
||||
|
||||
fwrite([s cString], 1, [s cStringLength], stdout);
|
||||
printf("\n");
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "ERROR: did not find GCS type: '%s'\n",
|
||||
[_typeName cString]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (int)run {
|
||||
NSEnumerator *e;
|
||||
NSString *tableName, *typeName;
|
||||
|
||||
e = [[[NSProcessInfo processInfo] argumentsWithoutDefaults]
|
||||
objectEnumerator];
|
||||
[e nextObject]; // skip tool name
|
||||
|
||||
while ((tableName = [e nextObject]) != nil) {
|
||||
typeName = [e nextObject];
|
||||
if (typeName == nil) {
|
||||
[self logWithFormat:@"got tablename '%@' but no type?!", tableName];
|
||||
break;
|
||||
}
|
||||
|
||||
[self runOnTable:tableName typeName:typeName];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
+ (int)runWithArgs:(NSArray *)_args {
|
||||
return [(Tool *)[[[self alloc] init] autorelease] run];
|
||||
}
|
||||
|
||||
@end /* Tool */
|
||||
|
||||
int main(int argc, char **argv, char **env) {
|
||||
NSAutoreleasePool *pool;
|
||||
int rc;
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
#endif
|
||||
|
||||
rc = [Tool runWithArgs:
|
||||
[[NSProcessInfo processInfo] argumentsWithoutDefaults]];
|
||||
|
||||
[pool release];
|
||||
return rc;
|
||||
}
|
|
@ -1,149 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2004-2005 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSProcessInfo.h>
|
||||
#import <Foundation/NSURL.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <NGExtensions/NSProcessInfo+misc.h>
|
||||
|
||||
#import <GDLContentStore/GCSFolder.h>
|
||||
#import <GDLContentStore/GCSFolderManager.h>
|
||||
|
||||
@class NSUserDefaults, NSArray;
|
||||
@class GCSFolderManager;
|
||||
|
||||
@interface Tool : NSObject
|
||||
{
|
||||
NSUserDefaults *ud;
|
||||
GCSFolderManager *folderManager;
|
||||
}
|
||||
|
||||
+ (int)runWithArgs:(NSArray *)_args;
|
||||
- (int)run;
|
||||
|
||||
@end
|
||||
|
||||
@implementation Tool
|
||||
|
||||
- (id)init {
|
||||
if ((self = [super init])) {
|
||||
self->ud = [[NSUserDefaults standardUserDefaults] retain];
|
||||
self->folderManager = [[GCSFolderManager defaultFolderManager] retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (void)dealloc {
|
||||
[self->ud release];
|
||||
[self->folderManager release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
/* operation */
|
||||
|
||||
- (int)runOnPath:(NSString *)_path {
|
||||
NSArray *subfolders;
|
||||
unsigned i, count;
|
||||
GCSFolder *folder;
|
||||
|
||||
[self logWithFormat:@"ls path: '%@'", _path];
|
||||
|
||||
#if 0 // we do not necessarily need the whole hierarchy
|
||||
if (![self->folderManager folderExistsAtPath:_path])
|
||||
[self logWithFormat:@"folder does not exist: '%@'", _path];
|
||||
#endif
|
||||
|
||||
subfolders = [self->folderManager
|
||||
listSubFoldersAtPath:_path
|
||||
recursive:[ud boolForKey:@"r"]];
|
||||
if (subfolders == nil) {
|
||||
[self logWithFormat:@"cannot list folder: '%@'", _path];
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (i = 0, count = [subfolders count]; i < count; i++) {
|
||||
printf("%s\n", [[subfolders objectAtIndex:i] cString]);
|
||||
}
|
||||
|
||||
folder = [self->folderManager folderAtPath:_path];
|
||||
|
||||
if ([folder isNotNull]) {
|
||||
NSLog(@"folder: %@", folder);
|
||||
|
||||
NSLog(@" can%s connect store: %@", [folder canConnectStore] ? "" : "not",
|
||||
[[folder location] absoluteString]);
|
||||
NSLog(@" can%s connect quick: %@", [folder canConnectQuick] ? "" : "not",
|
||||
[[folder quickLocation] absoluteString]);
|
||||
}
|
||||
else {
|
||||
NSLog(@"ERROR: could not create folder object for path: '%@'", _path);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (int)run {
|
||||
NSEnumerator *e;
|
||||
NSString *path;
|
||||
|
||||
[self logWithFormat:@"manager: %@", self->folderManager];
|
||||
|
||||
if (![self->folderManager canConnect]) {
|
||||
[self logWithFormat:@"cannot connect folder-info database!"];
|
||||
return 1;
|
||||
}
|
||||
|
||||
e = [[[NSProcessInfo processInfo] argumentsWithoutDefaults]
|
||||
objectEnumerator];
|
||||
[e nextObject]; // skip tool name
|
||||
|
||||
while ((path = [e nextObject]) != nil)
|
||||
[self runOnPath:path];
|
||||
|
||||
return 0;
|
||||
}
|
||||
+ (int)runWithArgs:(NSArray *)_args {
|
||||
return [(Tool *)[[[self alloc] init] autorelease] run];
|
||||
}
|
||||
|
||||
@end /* Tool */
|
||||
|
||||
int main(int argc, char **argv, char **env) {
|
||||
NSAutoreleasePool *pool;
|
||||
int rc;
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
#endif
|
||||
|
||||
rc = [Tool runWithArgs:
|
||||
[[NSProcessInfo processInfo] argumentsWithoutDefaults]];
|
||||
|
||||
[pool release];
|
||||
return rc;
|
||||
}
|
|
@ -1,134 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2004-2005 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <NGExtensions/NSProcessInfo+misc.h>
|
||||
|
||||
#import <GDLContentStore/GCSFolder.h>
|
||||
#import <GDLContentStore/GCSFolderManager.h>
|
||||
|
||||
@class NSUserDefaults, NSArray;
|
||||
@class GCSFolderManager;
|
||||
|
||||
@interface Tool : NSObject
|
||||
{
|
||||
NSUserDefaults *ud;
|
||||
GCSFolderManager *folderManager;
|
||||
}
|
||||
|
||||
+ (int)runWithArgs:(NSArray *)_args;
|
||||
- (int)run;
|
||||
|
||||
@end
|
||||
|
||||
@implementation Tool
|
||||
|
||||
- (id)init {
|
||||
if ((self = [super init])) {
|
||||
self->ud = [[NSUserDefaults standardUserDefaults] retain];
|
||||
self->folderManager = [[GCSFolderManager defaultFolderManager] retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (void)dealloc {
|
||||
[self->ud release];
|
||||
[self->folderManager release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
/* operation */
|
||||
|
||||
- (int)runOnPath:(NSString *)_path type:(NSString *)_type {
|
||||
NSException *error;
|
||||
|
||||
[self logWithFormat:@"mkdir %@ at path: '%@'", _type, _path];
|
||||
|
||||
if ([self->folderManager folderExistsAtPath:_path]) {
|
||||
[self logWithFormat:@"folder already exist at path: '%@'", _path];
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((error = [self->folderManager createFolderOfType:_type
|
||||
withName: @"testFolder"
|
||||
atPath:_path])) {
|
||||
[self logWithFormat:@"creation of folder %@ at %@ failed: %@",
|
||||
_type, _path, error];
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ([self->folderManager folderExistsAtPath:_path])
|
||||
[self logWithFormat:@"CREATED."];
|
||||
else
|
||||
[self logWithFormat:@"cannot find fresh folder?"];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (int)run {
|
||||
NSEnumerator *e;
|
||||
NSString *type;
|
||||
NSString *path;
|
||||
|
||||
[self logWithFormat:@"manager: %@", self->folderManager];
|
||||
|
||||
if (![self->folderManager canConnect]) {
|
||||
[self logWithFormat:@"cannot connect folder-info database!"];
|
||||
return 1;
|
||||
}
|
||||
|
||||
e = [[[NSProcessInfo processInfo] argumentsWithoutDefaults]
|
||||
objectEnumerator];
|
||||
[e nextObject]; // skip tool name
|
||||
|
||||
type = [[[e nextObject] copy] autorelease];
|
||||
|
||||
while ((path = [e nextObject]))
|
||||
[self runOnPath:path type:type];
|
||||
|
||||
return 0;
|
||||
}
|
||||
+ (int)runWithArgs:(NSArray *)_args {
|
||||
return [(Tool *)[[[self alloc] init] autorelease] run];
|
||||
}
|
||||
|
||||
@end /* Tool */
|
||||
|
||||
int main(int argc, char **argv, char **env) {
|
||||
NSAutoreleasePool *pool;
|
||||
int rc;
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
#endif
|
||||
|
||||
rc = [Tool runWithArgs:
|
||||
[[NSProcessInfo processInfo] argumentsWithoutDefaults]];
|
||||
|
||||
[pool release];
|
||||
return rc;
|
||||
}
|
|
@ -1,127 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2004-2005 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <NGExtensions/NSProcessInfo+misc.h>
|
||||
|
||||
#import <GDLContentStore/GCSFolder.h>
|
||||
#import <GDLContentStore/GCSFolderManager.h>
|
||||
|
||||
@class NSUserDefaults, NSArray;
|
||||
@class GCSFolderManager;
|
||||
|
||||
@interface Tool : NSObject
|
||||
{
|
||||
NSUserDefaults *ud;
|
||||
GCSFolderManager *folderManager;
|
||||
}
|
||||
|
||||
+ (int)runWithArgs:(NSArray *)_args;
|
||||
- (int)run;
|
||||
|
||||
@end
|
||||
|
||||
@implementation Tool
|
||||
|
||||
- (id)init {
|
||||
if ((self = [super init])) {
|
||||
self->ud = [[NSUserDefaults standardUserDefaults] retain];
|
||||
self->folderManager = [[GCSFolderManager defaultFolderManager] retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (void)dealloc {
|
||||
[self->ud release];
|
||||
[self->folderManager release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
/* operation */
|
||||
|
||||
- (int)runOnPath:(NSString *)_path {
|
||||
GCSFolder *folder;
|
||||
|
||||
[self logWithFormat:@"update quick from store at path: '%@'", _path];
|
||||
|
||||
if (![self->folderManager folderExistsAtPath:_path]) {
|
||||
[self logWithFormat:@"no folder exist at path: '%@'", _path];
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((folder = [self->folderManager folderAtPath:_path]) == nil) {
|
||||
[self logWithFormat:@"got no folder object for path: '%@'", _path];
|
||||
return 2;
|
||||
}
|
||||
[self logWithFormat:@" folder: %@", folder];
|
||||
|
||||
// TODO:
|
||||
[self logWithFormat:@" should recreate folder .."];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (int)run {
|
||||
NSEnumerator *e;
|
||||
NSString *path;
|
||||
|
||||
[self logWithFormat:@"manager: %@", self->folderManager];
|
||||
|
||||
if (![self->folderManager canConnect]) {
|
||||
[self logWithFormat:@"cannot connect folder-info database!"];
|
||||
return 1;
|
||||
}
|
||||
|
||||
e = [[[NSProcessInfo processInfo] argumentsWithoutDefaults]
|
||||
objectEnumerator];
|
||||
[e nextObject]; // skip tool name
|
||||
|
||||
while ((path = [e nextObject]))
|
||||
[self runOnPath:path];
|
||||
|
||||
return 0;
|
||||
}
|
||||
+ (int)runWithArgs:(NSArray *)_args {
|
||||
return [(Tool *)[[[self alloc] init] autorelease] run];
|
||||
}
|
||||
|
||||
@end /* Tool */
|
||||
|
||||
int main(int argc, char **argv, char **env) {
|
||||
NSAutoreleasePool *pool;
|
||||
int rc;
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
#endif
|
||||
|
||||
rc = [Tool runWithArgs:
|
||||
[[NSProcessInfo processInfo] argumentsWithoutDefaults]];
|
||||
|
||||
[pool release];
|
||||
return rc;
|
||||
}
|
|
@ -124,9 +124,9 @@
|
|||
if ([startDate compare: currentStartDate] == NSOrderedAscending ||
|
||||
[startDate compare: currentStartDate] == NSOrderedSame)
|
||||
{
|
||||
unsigned int days, week;
|
||||
int days, week;
|
||||
|
||||
[currentStartDate years:NULL months:NULL days:&days hours:NULL
|
||||
[currentStartDate years:NULL months:NULL days:(int *)&days hours:NULL
|
||||
minutes:NULL seconds:NULL sinceDate:firStart];
|
||||
week = days / 7;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
forRecurrenceId: (NSCalendarDate *) _recurrenceId;
|
||||
|
||||
- (void) takeAttendeeStatus: (iCalPerson *) attendee
|
||||
from: (NSString *) originator
|
||||
from: (SOGoUser *) originator
|
||||
withRecurrenceId: (NSCalendarDate*) recurrenceId;
|
||||
|
||||
- (NSArray *) postCalDAVEventRequestTo: (NSArray *) recipients from: (NSString *) originator;
|
||||
|
|
|
@ -285,9 +285,9 @@
|
|||
iCalEntityObject *currentOccurence;
|
||||
iCalRepeatableEntityObject *event;
|
||||
iCalCalendar *calendar;
|
||||
NSMutableArray *occurences;
|
||||
NSCalendarDate *currentId;
|
||||
NSString *calendarContent;
|
||||
NSArray *occurences;
|
||||
int max, count;
|
||||
|
||||
// Invitations are always written to the personal folder; it's not necessay
|
||||
|
@ -835,7 +835,7 @@
|
|||
{
|
||||
// If no occurence found, create one.
|
||||
recurrenceTime = [NSString stringWithFormat: @"%f", [recurrenceId timeIntervalSince1970]];
|
||||
oldEvent = [oldEventObject newOccurenceWithID: recurrenceTime];
|
||||
oldEvent = (iCalEvent *)[oldEventObject newOccurenceWithID: recurrenceTime];
|
||||
}
|
||||
|
||||
// Add the event as a new occurrence, without the organizer.
|
||||
|
@ -958,13 +958,13 @@
|
|||
// Mozilla Lightning. We assume the SENT-BY has
|
||||
// already been added, if required.
|
||||
//
|
||||
// It is used to updated the status of an attendee.
|
||||
// It is used to update the status of an attendee.
|
||||
// The originator is the actualy owner of the calendar
|
||||
// where the update took place. The status must then
|
||||
// be propagated to the organizer and the other attendees.
|
||||
//
|
||||
- (void) takeAttendeeStatus: (iCalPerson *) attendee
|
||||
from: (NSString *) ownerUser
|
||||
from: (SOGoUser *) ownerUser
|
||||
withRecurrenceId: (NSCalendarDate*) recurrenceId
|
||||
{
|
||||
iCalPerson *localAttendee;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* SOGoAptMailICalReply - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse inc.
|
||||
* Copyright (C) 2007-2009 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
|
@ -35,6 +35,7 @@
|
|||
#import <SoObjects/SOGo/NSString+Utilities.h>
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
|
||||
#import "iCalPerson+SOGo.h"
|
||||
#import "SOGoAptMailICalReply.h"
|
||||
|
||||
@interface SOGoAptMailICalReply (PrivateAPI)
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
/*
|
||||
Copyright (C) 2000-2005 SKYRIX Software AG
|
||||
Copyright (C) 2006-2008 Inverse inc.
|
||||
Copyright (C) 2006-2009 Inverse inc.
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
This file is part of SOGo.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
SOGo 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
|
||||
SOGo 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.
|
||||
|
@ -32,6 +32,7 @@
|
|||
|
||||
#import <SoObjects/SOGo/NSString+Utilities.h>
|
||||
|
||||
#import "iCalPerson+SOGo.h"
|
||||
#import "SOGoAptMailNotification.h"
|
||||
|
||||
@interface SOGoAptMailNotification (PrivateAPI)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* SOGoCalendarComponent.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2006-2008 Inverse inc.
|
||||
* Copyright (C) 2006-2009 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
|
||||
- (NSException *) prepareDelete;
|
||||
{
|
||||
NSMutableArray *occurences;
|
||||
NSArray *occurences;
|
||||
NSCalendarDate *recurrenceId, *currentId;
|
||||
NSException *error;
|
||||
NSString *newContent;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* NSObject+CardDAV.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse inc.
|
||||
* Copyright (C) 2007-2009 Inverse inc.
|
||||
*
|
||||
* Author: Ludovic Marcotte <ludovic@inverse.ca>
|
||||
*
|
||||
|
@ -52,15 +52,15 @@
|
|||
for (count = 0; count < max; count++)
|
||||
{
|
||||
currentFilter = [filters objectAtIndex: count];
|
||||
contacts = [[self lookupContactsWithFilter: [[currentFilter allValues] lastObject]
|
||||
sortBy: @"c_givenname"
|
||||
ordering: NSOrderedDescending]
|
||||
contacts = [[(id<SOGoContactFolder>)self lookupContactsWithFilter: [[currentFilter allValues] lastObject]
|
||||
sortBy: @"c_givenname"
|
||||
ordering: NSOrderedDescending]
|
||||
objectEnumerator];
|
||||
|
||||
while ((contact = [contacts nextObject]))
|
||||
[self appendObject: contact
|
||||
withBaseURL: baseURL
|
||||
toREPORTResponse: response];
|
||||
[(id<SOGoContactFolder>)self appendObject: contact
|
||||
withBaseURL: baseURL
|
||||
toREPORTResponse: response];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@
|
|||
|
||||
parentNode = [filterElement parentNode];
|
||||
|
||||
if ([[parentNode tagName] isEqualToString: @"filter"]
|
||||
if ([[(id)parentNode tagName] isEqualToString: @"filter"]
|
||||
&& [self _isValidFilter: [filterElement attribute: @"name"]])
|
||||
{
|
||||
ranges = [filterElement getElementsByTagName: @"text-match"];
|
||||
|
@ -113,8 +113,8 @@
|
|||
|
||||
filters = [NSMutableArray array];
|
||||
|
||||
children = [[parentNode getElementsByTagName: @"prop-filter"]
|
||||
objectEnumerator];
|
||||
children = [(NSArray *)[parentNode getElementsByTagName: @"prop-filter"]
|
||||
objectEnumerator];
|
||||
while ((node = [children nextObject]))
|
||||
{
|
||||
filter = [self _parseContactFilter: node];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* SOGoUserFolder+Contacts.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2008 Inverse inc.
|
||||
* Copyright (C) 2008-2009 Inverse inc.
|
||||
*
|
||||
* Author: Francis Lachapelle <flachapelle@inverse.ca>
|
||||
*
|
||||
|
@ -37,7 +37,7 @@
|
|||
@interface SOGoUserFolder (private)
|
||||
|
||||
- (SOGoAppointmentFolders *) privateContacts: (NSString *) key
|
||||
inContext: (WOContext *) localContext;
|
||||
inContext: (WOContext *) localContext;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
/*
|
||||
Copyright (C) 2007-2009 Inverse inc.
|
||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
This file is part of SOGo.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
SOGo 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
|
||||
SOGo 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.
|
||||
|
|
|
@ -112,7 +112,7 @@ static BOOL debugOn = NO;
|
|||
id obj;
|
||||
|
||||
if (pathToPart != nil)
|
||||
return [pathToPart isNotNull] ? pathToPart : nil;
|
||||
return ([pathToPart isNotNull] ? (id)pathToPart : nil);
|
||||
|
||||
p = [[NSMutableArray alloc] initWithCapacity:8];
|
||||
for (obj = self; [obj isKindOfClass:[SOGoMailBodyPart class]];
|
||||
|
@ -128,7 +128,7 @@ static BOOL debugOn = NO;
|
|||
- (NSString *) bodyPartIdentifier
|
||||
{
|
||||
if (identifier != nil)
|
||||
return [identifier isNotNull] ? identifier : nil;
|
||||
return ([identifier isNotNull] ? (id)identifier : nil);
|
||||
|
||||
identifier =
|
||||
[[[self bodyPartPath] componentsJoinedByString:@"."] copy];
|
||||
|
|
|
@ -104,6 +104,11 @@
|
|||
- (NSException *) moveToFolderNamed: (NSString *) folderName
|
||||
inContext: (id)_ctx;
|
||||
|
||||
- (void) addRequiredKeysOfStructure: (NSDictionary *) info
|
||||
path: (NSString *) p
|
||||
toArray: (NSMutableArray *) keys
|
||||
acceptedTypes: (NSArray *) types;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* __Mailer_SOGoMailObject_H__ */
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
/*
|
||||
Copyright (C) 2007-2009 Inverse inc.
|
||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
This file is part of SOGo.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
SOGo 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
|
||||
SOGo 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.
|
||||
|
@ -179,7 +180,7 @@ static BOOL debugSoParts = NO;
|
|||
ma = [NSMutableArray arrayWithCapacity:count - i];
|
||||
|
||||
ext = [self keyExtensionForPart:part];
|
||||
key = [[NSString alloc] initWithFormat: @"%d%@", i + 1, ext?ext: @""];
|
||||
key = [[NSString alloc] initWithFormat: @"%d%@", i + 1, ((id)ext?(id)ext: (id)@"")];
|
||||
[ma addObject:key];
|
||||
[key release];
|
||||
}
|
||||
|
@ -552,8 +553,8 @@ static BOOL debugSoParts = NO;
|
|||
for (i = 0; i < count; i++)
|
||||
{
|
||||
sp = (([p length] > 0)
|
||||
? [p stringByAppendingFormat: @".%d", i + 1]
|
||||
: [NSString stringWithFormat: @"%d", i + 1]);
|
||||
? (id)[p stringByAppendingFormat: @".%d", i + 1]
|
||||
: (id)[NSString stringWithFormat: @"%d", i + 1]);
|
||||
|
||||
childInfo = [parts objectAtIndex: i];
|
||||
|
||||
|
@ -570,7 +571,7 @@ static BOOL debugSoParts = NO;
|
|||
if ([sp isEqualToString: @"multipart"])
|
||||
sp = p;
|
||||
else
|
||||
sp = [p length] > 0 ? [p stringByAppendingString: @".1"] : @"1";
|
||||
sp = [p length] > 0 ? (id)[p stringByAppendingString: @".1"] : (id)@"1";
|
||||
[self addRequiredKeysOfStructure: body
|
||||
path: sp toArray: keys
|
||||
acceptedTypes: types];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* SOGoMailReply.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse inc.
|
||||
* Copyright (C) 2007-2009 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
|
@ -38,6 +38,9 @@
|
|||
- (BOOL) outlookMode;
|
||||
- (void) setReplyPlacement: (NSString *) newPlacement;
|
||||
- (BOOL) replyPlacementOnTop;
|
||||
- (void) setSignaturePlacement: (NSString *) newPlacement;
|
||||
- (BOOL) signaturePlacementOnTop;
|
||||
- (NSString *) messageBody;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* SOGoMailReply.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse inc.
|
||||
* Copyright (C) 2007-2009 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
|
|
|
@ -9,12 +9,6 @@ FRAMEWORK_NAME = SOGo
|
|||
|
||||
SOGo_INSTALL_DIR = $(SOGO_LIBDIR)
|
||||
|
||||
TOOL_NAME = \
|
||||
# sogo_email2uid \
|
||||
# sogo_shares4uid \
|
||||
# sogo_emails4uid \
|
||||
# sogo_defaults
|
||||
|
||||
SOGo_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION)
|
||||
|
||||
# SOGoCustomGroupFolder.h \
|
||||
|
@ -125,13 +119,6 @@ SOGoNSUserDefaults_OBJC_FILES = \
|
|||
|
||||
endif
|
||||
|
||||
# tools
|
||||
|
||||
sogo_email2uid_OBJC_FILES += sogo_email2uid.m
|
||||
sogo_shares4uid_OBJC_FILES += sogo_shares4uid.m
|
||||
sogo_emails4uid_OBJC_FILES += sogo_emails4uid.m
|
||||
sogo_defaults_OBJC_FILES += sogo_defaults.m
|
||||
|
||||
ADDITIONAL_TOOL_LIBS += -Lobj -lSOGo$(LIBRARY_NAME_SUFFIX)
|
||||
ADDITIONAL_INCLUDE_DIRS += -I../../SOPE/
|
||||
ADDITIONAL_LIB_DIRS += -L../../SOPE/GDLContentStore/obj/
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSDistributedNotificationCenter.h>
|
||||
|
@ -430,7 +429,7 @@ static NSLock *lock = nil;
|
|||
[d setObject: [newUser objectForKey: @"c_uid"]
|
||||
forKey: @"uid"];
|
||||
|
||||
[[NSDistributedNotificationCenter defaultCenter]
|
||||
[(NSDistributedNotificationCenter *)[NSDistributedNotificationCenter defaultCenter]
|
||||
postNotificationName: @"SOGoUserAttributesHaveLoaded"
|
||||
object: nil
|
||||
userInfo: d
|
||||
|
|
|
@ -374,7 +374,7 @@ static NSMutableCharacterSet *urlStartChars = nil;
|
|||
match];
|
||||
sq = [EOQualifier qualifierWithQualifierFormat: format];
|
||||
|
||||
return [sq evaluateWithObject: self];
|
||||
return [(id<EOQualifierEvaluation>)sq evaluateWithObject: self];
|
||||
}
|
||||
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
|
||||
- (NSString *) displayName
|
||||
{
|
||||
return ((displayName) ? displayName : nameInContainer);
|
||||
return ((id)displayName ? (id)displayName : (id)nameInContainer);
|
||||
}
|
||||
|
||||
- (void) setIsSubscription: (BOOL) newIsSubscription
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
#import "SOGoUserDefaults.h"
|
||||
#import "SOGoUserFolder.h"
|
||||
|
||||
#import "../../Main/SOGo.h"
|
||||
|
||||
#import "SOGoUser.h"
|
||||
|
||||
static NSTimeZone *serverTimeZone = nil;
|
||||
|
@ -490,7 +492,7 @@ _timeValue (NSString *key)
|
|||
[[SOGoCache sharedCache] setDefaults: defaults
|
||||
forLogin: login key: @"defaults"];
|
||||
|
||||
[[NSDistributedNotificationCenter defaultCenter]
|
||||
[(NSDistributedNotificationCenter *)[NSDistributedNotificationCenter defaultCenter]
|
||||
postNotificationName: @"SOGoUserDefaultsHaveLoaded"
|
||||
object: nil
|
||||
userInfo: d
|
||||
|
@ -535,7 +537,7 @@ _timeValue (NSString *key)
|
|||
|
||||
[[SOGoCache sharedCache] setDefaults: settings forLogin: login key: @"settings"];
|
||||
|
||||
[[NSDistributedNotificationCenter defaultCenter]
|
||||
[(NSDistributedNotificationCenter *)[NSDistributedNotificationCenter defaultCenter]
|
||||
postNotificationName: @"SOGoUserSettingsHaveLoaded"
|
||||
object: nil
|
||||
userInfo: d
|
||||
|
|
|
@ -83,6 +83,8 @@
|
|||
|
||||
- (NSString *) jsonRepresentation;
|
||||
|
||||
- (BOOL) fetchProfile;
|
||||
|
||||
/* saving changes */
|
||||
|
||||
- (BOOL) synchronize;
|
||||
|
|
|
@ -304,7 +304,7 @@ static NSString *uidColumnName = @"c_uid";
|
|||
forLogin: uid
|
||||
key: ([fieldName isEqualToString: @"c_defaults"] ? @"defaults" : @"settings")];
|
||||
|
||||
[[NSDistributedNotificationCenter defaultCenter]
|
||||
[(NSDistributedNotificationCenter *)[NSDistributedNotificationCenter defaultCenter]
|
||||
postNotificationName: ([fieldName isEqualToString: @"c_defaults"]
|
||||
? @"SOGoUserDefaultsHaveChanged"
|
||||
: @"SOGoUserSettingsHaveChanged")
|
||||
|
|
|
@ -125,11 +125,11 @@ static NSString *LDAPContactInfoAttribute = nil;
|
|||
|
||||
filter = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||
children = [parentNode getElementsByTagName: @"prop-match"];
|
||||
max = [children count];
|
||||
max = [(NSArray *)children count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
node = [children objectAtIndex: count];
|
||||
componentName = [[node attribute: @"name"] lowercaseString];
|
||||
componentName = [[(id<DOMElement>)node attribute: @"name"] lowercaseString];
|
||||
[filter setObject: [node textValue] forKey: componentName];
|
||||
}
|
||||
|
||||
|
|
|
@ -1,134 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2005 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.
|
||||
*/
|
||||
|
||||
#include "LDAPUserManager.h"
|
||||
#include "common.h"
|
||||
|
||||
static void usage(NSArray *args) {
|
||||
fprintf(stderr, "usage: %s <uid> read|write|info [<key>] [<value>]\n",
|
||||
[[args objectAtIndex:0] cString]);
|
||||
}
|
||||
|
||||
static void doInfo(NSUserDefaults *defaults) {
|
||||
printf("defaults for: '%s'\n", [[defaults valueForKey:@"uid"] cString]);
|
||||
printf(" profile table: '%s'\n",
|
||||
[[[defaults valueForKey:@"tableURL"] absoluteString] cString]);
|
||||
}
|
||||
|
||||
static void doRead(NSUserDefaults *defaults, NSString *key) {
|
||||
id value;
|
||||
|
||||
if (key == nil) {
|
||||
NSArray *defNames;
|
||||
unsigned i, count;
|
||||
|
||||
defNames = [defaults valueForKey:@"primaryDefaultNames"];
|
||||
if ((count = [defNames count]) == 0) {
|
||||
fprintf(stderr, "There are no keys in the SOGo profile!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
printf("%s: %s\n",
|
||||
[[defNames objectAtIndex:i] cString],
|
||||
[[[defaults objectForKey:[defNames objectAtIndex:i]]
|
||||
description] cString]);
|
||||
}
|
||||
}
|
||||
else if ((value = [defaults objectForKey:key]) == nil) {
|
||||
fprintf(stderr, "There is no key '%s' in the SOGo profile!\n",
|
||||
[key cString]);
|
||||
}
|
||||
else
|
||||
printf("%s\n", [[value description] cString]);
|
||||
}
|
||||
|
||||
static void doWrite(NSUserDefaults *defaults, NSString *key, NSString *value) {
|
||||
[defaults setObject:value forKey:key];
|
||||
|
||||
if (![defaults synchronize]) {
|
||||
fprintf(stderr, "Failed to synchronize defaults with profile!\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void doIt(NSArray *args) {
|
||||
LDAPUserManager *userManager;
|
||||
NSUserDefaults *defaults;
|
||||
NSString *uid, *op, *key, *value;
|
||||
|
||||
/* extract arguments */
|
||||
|
||||
if ([args count] < 3) {
|
||||
usage(args);
|
||||
return;
|
||||
}
|
||||
|
||||
uid = [args objectAtIndex:1];
|
||||
op = [args objectAtIndex:2];
|
||||
key = nil;
|
||||
value = nil;
|
||||
|
||||
if ([args count] > 3)
|
||||
key = [args objectAtIndex:3];
|
||||
|
||||
if ([op isEqualToString:@"write"]) {
|
||||
if ([args count] < 5) {
|
||||
usage(args);
|
||||
return;
|
||||
}
|
||||
value = [args objectAtIndex:4];
|
||||
}
|
||||
|
||||
/* run */
|
||||
|
||||
userManager = [LDAPUserManager sharedUserManager];
|
||||
defaults = [userManager getUserDefaultsForUID:uid];
|
||||
|
||||
if (![defaults isNotNull]) {
|
||||
fprintf(stderr, "Error: found no userdefaults for UID: '%s'\n",
|
||||
[uid cString]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ([op isEqualToString:@"read"])
|
||||
doRead(defaults, key);
|
||||
else if ([op isEqualToString:@"write"])
|
||||
doWrite(defaults, key, value);
|
||||
else if ([op isEqualToString:@"info"])
|
||||
doInfo(defaults);
|
||||
else
|
||||
usage(args);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv, char **env) {
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
#endif
|
||||
|
||||
doIt([[NSProcessInfo processInfo] argumentsWithoutDefaults]);
|
||||
|
||||
[pool release];
|
||||
return 0;
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2005 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.
|
||||
*/
|
||||
|
||||
#include "LDAPUserManager.h"
|
||||
#include "common.h"
|
||||
|
||||
static void usage(NSArray *args) {
|
||||
fprintf(stderr, "usage: %s <email1> <email2> <email3>\n",
|
||||
[[args objectAtIndex:0] cString]);
|
||||
}
|
||||
|
||||
static void doIt(NSArray *args) {
|
||||
LDAPUserManager *userManager;
|
||||
NSEnumerator *e;
|
||||
NSString *email;
|
||||
|
||||
if ([args count] < 2) {
|
||||
usage(args);
|
||||
return;
|
||||
}
|
||||
|
||||
userManager = [LDAPUserManager sharedUserManager];
|
||||
|
||||
e = [args objectEnumerator];
|
||||
[e nextObject]; /* consume the command name */
|
||||
|
||||
while ((email = [e nextObject]) != nil) {
|
||||
NSString *uid;
|
||||
|
||||
uid = [userManager getUIDForEmail:email];
|
||||
|
||||
if ([uid isNotNull])
|
||||
printf("%s: %s\n", [email cString], [uid cString]);
|
||||
else {
|
||||
fprintf(stderr, "ERROR: did not find uid for email: '%s'\n",
|
||||
[email cString]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv, char **env) {
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
#endif
|
||||
|
||||
doIt([[NSProcessInfo processInfo] argumentsWithoutDefaults]);
|
||||
|
||||
[pool release];
|
||||
return 0;
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2005 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.
|
||||
*/
|
||||
|
||||
#include "LDAPUserManager.h"
|
||||
#include "common.h"
|
||||
|
||||
static void usage(NSArray *args) {
|
||||
fprintf(stderr, "usage: %s <uid1> <uid2> <uid3>\n",
|
||||
[[args objectAtIndex:0] cString]);
|
||||
}
|
||||
|
||||
static void handleUID(NSString *uid, LDAPUserManager *userManager) {
|
||||
NSArray *emails;
|
||||
NSString *primary;
|
||||
unsigned i, count;
|
||||
|
||||
primary = [userManager getEmailForUID:uid];
|
||||
emails = [userManager getSharedMailboxEMailsForUID:uid];
|
||||
|
||||
printf("%s:", [uid cString]);
|
||||
|
||||
if ([primary length] > 0)
|
||||
printf(" %s\n", [primary cString]);
|
||||
else
|
||||
printf(" <no primary email found>\n");
|
||||
|
||||
if ((count = [emails count]) == 0) {
|
||||
printf(" <no shares with emitter access>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
printf(" %s\n", [[emails objectAtIndex:i] cString]);
|
||||
}
|
||||
|
||||
static void doIt(NSArray *args) {
|
||||
LDAPUserManager *userManager;
|
||||
NSEnumerator *e;
|
||||
NSString *uid;
|
||||
|
||||
if ([args count] < 2) {
|
||||
usage(args);
|
||||
return;
|
||||
}
|
||||
|
||||
userManager = [LDAPUserManager sharedUserManager];
|
||||
|
||||
e = [args objectEnumerator];
|
||||
[e nextObject]; /* consume the command name */
|
||||
|
||||
while ((uid = [e nextObject]) != nil)
|
||||
handleUID(uid, userManager);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv, char **env) {
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
#endif
|
||||
|
||||
doIt([[NSProcessInfo processInfo] argumentsWithoutDefaults]);
|
||||
|
||||
[pool release];
|
||||
return 0;
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2005 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.
|
||||
*/
|
||||
|
||||
#include "LDAPUserManager.h"
|
||||
#include "common.h"
|
||||
|
||||
static void usage(NSArray *args) {
|
||||
fprintf(stderr, "usage: %s <uid1> <uid2> <uid3>\n",
|
||||
[[args objectAtIndex:0] cString]);
|
||||
}
|
||||
|
||||
static void handleUID(NSString *uid, LDAPUserManager *userManager) {
|
||||
NSArray *shares;
|
||||
unsigned i, count;
|
||||
|
||||
shares = [userManager getSharedMailboxAccountStringsForUID:uid];
|
||||
|
||||
printf("%s:", [uid cString]);
|
||||
|
||||
if ((count = [shares count]) == 0) {
|
||||
printf(" <no shares>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
puts("");
|
||||
for (i = 0; i < count; i++)
|
||||
printf(" %s\n", [[shares objectAtIndex:i] cString]);
|
||||
}
|
||||
|
||||
static void doIt(NSArray *args) {
|
||||
LDAPUserManager *userManager;
|
||||
NSEnumerator *e;
|
||||
NSString *uid;
|
||||
|
||||
if ([args count] < 2) {
|
||||
usage(args);
|
||||
return;
|
||||
}
|
||||
|
||||
userManager = [LDAPUserManager sharedUserManager];
|
||||
|
||||
e = [args objectEnumerator];
|
||||
[e nextObject]; /* consume the command name */
|
||||
|
||||
while ((uid = [e nextObject]) != nil)
|
||||
handleUID(uid, userManager);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv, char **env) {
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
#endif
|
||||
|
||||
doIt([[NSProcessInfo processInfo] argumentsWithoutDefaults]);
|
||||
|
||||
[pool release];
|
||||
return 0;
|
||||
}
|
|
@ -26,6 +26,7 @@
|
|||
#import <NGObjWeb/WOResourceManager.h>
|
||||
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SoObjects/SOGo/SOGoUserDefaults.h>
|
||||
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
|
||||
|
||||
#import <Main/build.h>
|
||||
|
@ -416,10 +417,10 @@ static NSString *siteFavicon = nil;
|
|||
|
||||
- (NSString *) userSettings
|
||||
{
|
||||
NSUserDefaults *userSettings;
|
||||
SOGoUserDefaults *userSettings;
|
||||
NSString *jsonResult;
|
||||
|
||||
userSettings = [[context activeUser] userSettings];
|
||||
userSettings = (SOGoUserDefaults *)[[context activeUser] userSettings];
|
||||
if (userSettings)
|
||||
jsonResult = [userSettings jsonRepresentation];
|
||||
else
|
||||
|
@ -430,10 +431,10 @@ static NSString *siteFavicon = nil;
|
|||
|
||||
- (NSString *) userDefaults
|
||||
{
|
||||
NSUserDefaults *userDefaults;
|
||||
SOGoUserDefaults *userDefaults;
|
||||
NSString *jsonResult;
|
||||
|
||||
userDefaults = [[context activeUser] userDefaults];
|
||||
userDefaults = (SOGoUserDefaults *)[[context activeUser] userDefaults];
|
||||
if (userDefaults)
|
||||
jsonResult = [userDefaults jsonRepresentation];
|
||||
else
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
/*
|
||||
Copyright (C) 2007-2009 Inverse inc.
|
||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
This file is part of SOGo.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
SOGo 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
|
||||
SOGo 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.
|
||||
|
@ -146,14 +147,14 @@
|
|||
}
|
||||
|
||||
if ((tb = [pathToConfig objectForKey:path]) != nil)
|
||||
return [tb isNotNull] ? tb : nil;
|
||||
return [tb isNotNull] ? (id)tb : nil;
|
||||
|
||||
if ((tb = [NSArray arrayWithContentsOfFile:path]) == nil)
|
||||
[self errorWithFormat:@"Could not load toolbar resource: %@", _name];
|
||||
|
||||
if (pathToConfig == nil)
|
||||
pathToConfig = [[NSMutableDictionary alloc] initWithCapacity:32];
|
||||
[pathToConfig setObject:(tb ? tb : (id)[NSNull null]) forKey:path];
|
||||
[pathToConfig setObject:(tb ? (id)tb : (id)[NSNull null]) forKey:path];
|
||||
|
||||
return tb;
|
||||
}
|
||||
|
@ -163,7 +164,7 @@
|
|||
id tb;
|
||||
|
||||
if (toolbarConfig != nil)
|
||||
return [toolbarConfig isNotNull] ? toolbarConfig : nil;
|
||||
return [toolbarConfig isNotNull] ? (id)toolbarConfig : nil;
|
||||
|
||||
if (toolbar)
|
||||
tb = toolbar;
|
||||
|
|
|
@ -626,7 +626,7 @@
|
|||
if (![sm validatePermission: SoPerm_AddDocumentsImagesAndFiles
|
||||
onObject: componentAddressBook
|
||||
inContext: context])
|
||||
ex = [contact moveToFolder: componentAddressBook]; // TODO: handle exception
|
||||
ex = [contact moveToFolder: (SOGoGCSFolder *)componentAddressBook]; // TODO: handle exception
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* UIxContactsListViewContainer.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2006 Inverse inc.
|
||||
* Copyright (C) 2006-2009 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
|
@ -147,7 +147,7 @@
|
|||
[self _setupContext];
|
||||
vertical = [moduleSettings objectForKey: @"DragHandleVertical"];
|
||||
|
||||
return ((vertical && [vertical intValue] > 0) ? [vertical stringByAppendingFormat: @"px"] : nil);
|
||||
return ((vertical && [vertical intValue] > 0) ? (id)[vertical stringByAppendingFormat: @"px"] : nil);
|
||||
}
|
||||
|
||||
- (NSString *) horizontalDragHandleStyle
|
||||
|
@ -157,7 +157,7 @@
|
|||
[self _setupContext];
|
||||
horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"];
|
||||
|
||||
return ((horizontal && [horizontal intValue] > 0) ? [horizontal stringByAppendingFormat: @"px"] : nil);
|
||||
return ((horizontal && [horizontal intValue] > 0) ? (id)[horizontal stringByAppendingFormat: @"px"] : nil);
|
||||
}
|
||||
|
||||
- (NSString *) contactsListContentStyle
|
||||
|
@ -167,7 +167,7 @@
|
|||
[self _setupContext];
|
||||
height = [moduleSettings objectForKey: @"DragHandleVertical"];
|
||||
|
||||
return ((height && [height intValue] > 0) ? [NSString stringWithFormat: @"%ipx", ([height intValue] - 27)] : nil);
|
||||
return ((height && [height intValue] > 0) ? (id)[NSString stringWithFormat: @"%ipx", ([height intValue] - 27)] : nil);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
/*
|
||||
Copyright (C) 2007-2009 Inverse inc.
|
||||
Copyright (C) 2004 SKYRIX Software AG
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
This file is part of SOGo.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
SOGo 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
|
||||
SOGo 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.
|
||||
|
@ -83,7 +84,7 @@
|
|||
st = [[[childParts objectAtIndex:i] valueForKey:@"subtype"]
|
||||
lowercaseString];
|
||||
mt = [[mt stringByAppendingString:@"/"] stringByAppendingString:st];
|
||||
[types addObject:mt ? mt : (id)[NSNull null]];
|
||||
[types addObject:mt ? (id)mt : (id)[NSNull null]];
|
||||
}
|
||||
return types;
|
||||
}
|
||||
|
@ -186,8 +187,8 @@
|
|||
|
||||
pp = [self partPath];
|
||||
return [pp count] > 0
|
||||
? [pp arrayByAddingObject:[self childPartName]]
|
||||
: [NSArray arrayWithObject:[self childPartName]];
|
||||
? (id)[pp arrayByAddingObject:[self childPartName]]
|
||||
: (id)[NSArray arrayWithObject:[self childPartName]];
|
||||
}
|
||||
|
||||
/* nested viewers */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* UIxMailPartHTMLViewer.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007, 2008 Inverse inc.
|
||||
* Copyright (C) 2007-2009 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
|
@ -142,7 +142,7 @@ _xmlCharsetForCharset (NSString *charset)
|
|||
return hasExternalImages;
|
||||
}
|
||||
|
||||
- (BOOL) setUnsafe: (BOOL) b
|
||||
- (void) setUnsafe: (BOOL) b
|
||||
{
|
||||
unsafe = b;
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@
|
|||
|
||||
recurrenceTime = [NSString stringWithFormat: @"%f",
|
||||
[[emailEvent recurrenceId] timeIntervalSince1970]];
|
||||
calendarEvent = [*eventObject lookupOccurence: recurrenceTime];
|
||||
calendarEvent = (iCalEvent *)[*eventObject lookupOccurence: recurrenceTime];
|
||||
}
|
||||
else
|
||||
calendarEvent = (iCalEvent *) [*eventObject component: NO
|
||||
|
@ -223,7 +223,7 @@
|
|||
{
|
||||
// We must update main event and all its occurences (if any).
|
||||
calendar = [eventObject calendar: NO secure: NO];
|
||||
event = [calendar firstChildWithTag: [eventObject componentTag]];
|
||||
event = (iCalEvent *)[calendar firstChildWithTag: [eventObject componentTag]];
|
||||
events = [calendar allObjects];
|
||||
}
|
||||
else
|
||||
|
@ -231,11 +231,11 @@
|
|||
// If recurrenceId is defined, find the specified occurence
|
||||
// within the repeating vEvent.
|
||||
recurrenceTime = [NSString stringWithFormat: @"%f", [recurrenceId timeIntervalSince1970]];
|
||||
event = [eventObject lookupOccurence: recurrenceTime];
|
||||
event = (iCalEvent *)[eventObject lookupOccurence: recurrenceTime];
|
||||
|
||||
if (event == nil)
|
||||
// If no occurence found, create one
|
||||
event = [eventObject newOccurenceWithID: recurrenceTime];
|
||||
event = (iCalEvent *)[eventObject newOccurenceWithID: recurrenceTime];
|
||||
|
||||
events = [NSArray arrayWithObject: event];
|
||||
}
|
||||
|
|
|
@ -329,7 +329,7 @@
|
|||
organizer = [storedEvent organizer];
|
||||
if (organizer == nil || [organizer isVoid])
|
||||
{
|
||||
organizer = [[[storedEvent parent] firstChildWithTag: [storedEventObject componentTag]] organizer];
|
||||
organizer = [(iCalEntityObject *)[[storedEvent parent] firstChildWithTag: [storedEventObject componentTag]] organizer];
|
||||
[storedEvent setOrganizer: organizer];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
/*
|
||||
Copyright (C) 2007-2009 Inverse inc.
|
||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
This file is part of SOGo.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
SOGo 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
|
||||
SOGo 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.
|
||||
|
@ -108,8 +109,8 @@
|
|||
|
||||
pp = [self partPath];
|
||||
return (([pp count] > 0)
|
||||
? [pp arrayByAddingObject: @"1"]
|
||||
: [NSArray arrayWithObject: @"1"]);
|
||||
? (id)[pp arrayByAddingObject: @"1"]
|
||||
: (id)[NSArray arrayWithObject: @"1"]);
|
||||
}
|
||||
|
||||
- (id) contentViewerComponent
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
/*
|
||||
Copyright (C) 2007-2009 Inverse inc.
|
||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
This file is part of SOGo.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
SOGo 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
|
||||
SOGo 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.
|
||||
|
@ -74,8 +75,8 @@
|
|||
|
||||
pp = [self partPath];
|
||||
return [pp count] > 0
|
||||
? [pp arrayByAddingObject:[self childPartName]]
|
||||
: [NSArray arrayWithObject:[self childPartName]];
|
||||
? (id)[pp arrayByAddingObject:[self childPartName]]
|
||||
: (id)[NSArray arrayWithObject:[self childPartName]];
|
||||
}
|
||||
|
||||
/* nested viewers */
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
/*
|
||||
Copyright (C) 2007-2009 Inverse inc.
|
||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
This file is part of SOGo.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
SOGo 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
|
||||
SOGo 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.
|
||||
|
@ -105,7 +106,7 @@
|
|||
- (NSData *) flatContent
|
||||
{
|
||||
if (flatContent != nil)
|
||||
return [flatContent isNotNull] ? flatContent : nil;
|
||||
return [flatContent isNotNull] ? (id)flatContent : nil;
|
||||
|
||||
flatContent =
|
||||
[[[context mailRenderingContext] flatContentForPartPath:
|
||||
|
@ -284,8 +285,8 @@
|
|||
|
||||
s = [partPath componentsJoinedByString:@"-"];
|
||||
return ([s length] > 0)
|
||||
? [@"untitled-" stringByAppendingString:s]
|
||||
: @"untitled";
|
||||
? (id)[@"untitled-" stringByAppendingString:s]
|
||||
: (id)@"untitled";
|
||||
}
|
||||
|
||||
- (NSFormatter *) sizeFormatter
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
/*
|
||||
Copyright (C) 2007-2009 Inverse inc.
|
||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
This file is part of SOGo.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
SOGo 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
|
||||
SOGo 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.
|
||||
|
@ -110,7 +111,7 @@ static BOOL showNamedTextAttachmentsInline = NO;
|
|||
NSString *pid;
|
||||
NSData *content;
|
||||
|
||||
pid = _partPath ? [_partPath componentsJoinedByString: @"."] : @"";
|
||||
pid = _partPath ? (id)[_partPath componentsJoinedByString: @"."] : (id)@"";
|
||||
content = [[self flatContents] objectForKey: pid];
|
||||
if (!content && ![pid intValue])
|
||||
content = [flatContents objectForKey: @""];
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
/*
|
||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
Copyright (C) 2008-2009 Inverse inc.
|
||||
|
||||
Copyright (C) 2008 Inverse inc.
|
||||
This file is part of SOGo.
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
SOGo 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
|
||||
SOGo 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.
|
||||
|
@ -52,7 +51,7 @@
|
|||
/*
|
||||
UIxMailEditor
|
||||
|
||||
An mail editor component which works on SOGoDraftObject's.
|
||||
A mail editor component which works on SOGoDraftObject's.
|
||||
*/
|
||||
|
||||
@interface UIxMailEditor : UIxComponent
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
/*
|
||||
Copyright (C) 2007-2009 Inverse inc.
|
||||
Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
This file is part of SOGo.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
SOGo 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
|
||||
SOGo 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.
|
||||
|
@ -44,6 +45,15 @@
|
|||
|
||||
#import "UIxMailMainFrame.h"
|
||||
|
||||
// Avoid compilation warnings
|
||||
@interface SOGoUserFolder (private)
|
||||
|
||||
- (SOGoAppointmentFolders *) privateContacts: (NSString *) key
|
||||
inContext: (WOContext *) localContext;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation UIxMailMainFrame
|
||||
|
||||
- (void) _setupContext
|
||||
|
@ -171,8 +181,8 @@
|
|||
{
|
||||
// Retrieve the email addresses from the specified address book
|
||||
// and contact IDs
|
||||
folders = [[[self clientObject] container] privateContacts: @"Contacts"
|
||||
inContext: nil];
|
||||
folders = (SOGoContactFolders *)[[[self clientObject] container] privateContacts: @"Contacts"
|
||||
inContext: nil];
|
||||
folder = [folders lookupName: folderId
|
||||
inContext: nil
|
||||
acquire: NO];
|
||||
|
@ -266,7 +276,7 @@
|
|||
[self _setupContext];
|
||||
vertical = [moduleSettings objectForKey: @"DragHandleVertical"];
|
||||
|
||||
return ((vertical && [vertical intValue] > 0) ? [vertical stringByAppendingFormat: @"px"] : nil);
|
||||
return ((vertical && [vertical intValue] > 0) ? (id)[vertical stringByAppendingFormat: @"px"] : nil);
|
||||
}
|
||||
|
||||
- (NSString *) horizontalDragHandleStyle
|
||||
|
@ -276,7 +286,7 @@
|
|||
[self _setupContext];
|
||||
horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"];
|
||||
|
||||
return ((horizontal && [horizontal intValue] > 0) ? [horizontal stringByAppendingFormat: @"px"] : nil);
|
||||
return ((horizontal && [horizontal intValue] > 0) ? (id)[horizontal stringByAppendingFormat: @"px"] : nil);
|
||||
}
|
||||
|
||||
- (NSString *) mailboxContentStyle
|
||||
|
@ -286,7 +296,7 @@
|
|||
[self _setupContext];
|
||||
height = [moduleSettings objectForKey: @"DragHandleVertical"];
|
||||
|
||||
return ((height && [height intValue] > 0) ? [NSString stringWithFormat: @"%ipx", ([height intValue] - 27)] : nil);
|
||||
return ((height && [height intValue] > 0) ? (id)[NSString stringWithFormat: @"%ipx", ([height intValue] - 27)] : nil);
|
||||
}
|
||||
|
||||
- (WOResponse *) saveDragHandleStateAction
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
/*
|
||||
Copyright (C) 2007-2009 Inverse inc.
|
||||
Copyright (C) 2000-2005 SKYRIX Software AG
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
This file is part of SOGo.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
SOGo 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
|
||||
SOGo 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.
|
||||
|
@ -106,8 +107,8 @@
|
|||
|
||||
e = [[NSMutableDictionary alloc] initWithCapacity:2];
|
||||
_pathPrefix = (_pathPrefix == nil)
|
||||
? title
|
||||
: [NSString stringWithFormat:@"%@.%@", _pathPrefix, title];
|
||||
? (id)title
|
||||
: (id)[NSString stringWithFormat:@"%@.%@", _pathPrefix, title];
|
||||
[e setObject:_pathPrefix forKey:@"title"];
|
||||
[e setObject:link forKey:@"link"];
|
||||
[_list addObject:e];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* UIxPreferences.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse inc.
|
||||
* Copyright (C) 2007-2009 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
|
@ -31,6 +31,7 @@
|
|||
#import <SoObjects/SOGo/NSArray+Utilities.h>
|
||||
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import "../../Main/SOGo.h"
|
||||
|
||||
#import "UIxPreferences.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* SOGoACLAdvisory.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse inc.
|
||||
* Copyright (C) 2007-2009 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
#import <SoObjects/SOGo/SOGoDateFormatter.h>
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
|
||||
#import "../../Main/SOGo.h"
|
||||
|
||||
#import "UIxCalDayTable.h"
|
||||
|
||||
@class SOGoAppointment;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* UIxCalMainView.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2006 Inverse inc.
|
||||
* Copyright (C) 2006-2009 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
|
@ -22,6 +22,7 @@
|
|||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSCalendarDate.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSTimeZone.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
|
@ -126,7 +127,7 @@
|
|||
[self _setupContext];
|
||||
vertical = [moduleSettings objectForKey: @"DragHandleVertical"];
|
||||
|
||||
return ((vertical && [vertical intValue] > 0) ? [vertical stringByAppendingFormat: @"px"] : nil);
|
||||
return ((vertical && [vertical intValue] > 0) ? (id)[vertical stringByAppendingFormat: @"px"] : nil);
|
||||
}
|
||||
|
||||
- (NSString *) horizontalDragHandleStyle
|
||||
|
@ -136,7 +137,7 @@
|
|||
[self _setupContext];
|
||||
horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"];
|
||||
|
||||
return ((horizontal && [horizontal intValue] > 0) ? [horizontal stringByAppendingFormat: @"px"] : nil);
|
||||
return ((horizontal && [horizontal intValue] > 0) ? (id)[horizontal stringByAppendingFormat: @"px"] : nil);
|
||||
}
|
||||
|
||||
- (NSString *) eventsListViewStyle
|
||||
|
|
|
@ -56,6 +56,8 @@
|
|||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SoObjects/SOGo/SOGoPermissions.h>
|
||||
|
||||
#import "../../Main/SOGo.h"
|
||||
|
||||
#import "UIxComponentEditor.h"
|
||||
#import "UIxDatePicker.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue