From 480f773d5bca45121e5c2d9a6afb2872daea36f1 Mon Sep 17 00:00:00 2001 From: wolfgang Date: Mon, 12 Feb 2007 20:56:24 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1021 d1b88da0-ebda-0310-925b-ed51d893ca5b --- ChangeLog | 44 ++++++- OGoContentStore/appointment.ocs | 5 + OGoContentStore/contact.ocs | 5 + OGoContentStore/sql/folderinfo-create.sqlite | 62 ---------- .../foldertablecreate-helge-privcal.sqlite | 36 ------ ...enerate-folderinfo-sql-for-users-sqlite.sh | 114 ------------------ ...e-folderinfo-sql-for-users-sqlite1table.sh | 109 ----------------- SOPE/NGCards/CardGroup.m | 9 +- SOPE/NGCards/ChangeLog | 7 ++ SOPE/NGCards/versitCardsSaxDriver/GNUmakefile | 2 +- .../Appointments/SOGoAppointmentFolder.m | 11 +- SoObjects/Contacts/SOGoContactFolders.h | 3 + SoObjects/Contacts/SOGoContactFolders.m | 74 +++++++++++- SoObjects/Contacts/SOGoContactGCSFolder.m | 5 + SoObjects/Contacts/SOGoContactLDAPFolder.m | 2 +- SoObjects/Mailer/SOGoMailFolder.m | 8 +- SoObjects/SOGo/GNUmakefile | 1 + SoObjects/SOGo/GNUmakefile.preamble | 17 +-- SoObjects/SOGo/SOGoFolder.h | 2 + SoObjects/SOGo/SOGoFolder.m | 31 ++++- SoObjects/common.make | 3 +- UI/Contacts/English.lproj/Localizable.strings | 5 +- UI/Contacts/French.lproj/Localizable.strings | 5 +- UI/Contacts/UIxContactFoldersView.m | 16 +++ UI/Contacts/product.plist | 5 + UI/SOGoUI/UIxComponent.m | 10 +- UI/Scheduler/French.lproj/Localizable.strings | 2 +- UI/Scheduler/UIxCalDayTable.m | 7 +- UI/Scheduler/UIxCalView.m | 2 +- .../UIxContactsListViewContainer.wox | 22 ++-- UI/Templates/MailerUI/UIxMailFilterPanel.wox | 1 + UI/Templates/MailerUI/UIxMailMainFrame.wox | 9 +- .../SchedulerUI/UIxAppointmentProposal.wox | 2 +- UI/Templates/SchedulerUI/UIxTaskProposal.wox | 4 +- UI/WebServerResources/ContactsUI.js | 67 ++++++++-- .../UIxAppointmentEditor.css | 6 +- UI/WebServerResources/UIxContactEditor.css | 3 +- 37 files changed, 310 insertions(+), 406 deletions(-) delete mode 100644 OGoContentStore/sql/folderinfo-create.sqlite delete mode 100644 OGoContentStore/sql/foldertablecreate-helge-privcal.sqlite delete mode 100755 OGoContentStore/sql/generate-folderinfo-sql-for-users-sqlite.sh delete mode 100755 OGoContentStore/sql/generate-folderinfo-sql-for-users-sqlite1table.sh diff --git a/ChangeLog b/ChangeLog index 2b5cfc95..bab0b29e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,42 @@ +2007-02-09 Wolfgang Sourdeau + + * SoObjects/Contacts/SOGoContactFolders.m ([SOGoContactFolders + -appendPersonalSourcesInContext:context]): release connectoin + channel when everything is done. + + * UI/Contacts/UIxContactFoldersView.m ([UIxContactFoldersView + -newAbAction]): new action method to crate a new contact folder + from the web UI. + + * SoObjects/SOGo/SOGoFolder.m ([SOGoFolder -create]): new method + that requests the folder manager to create a folder table with the + specified type at the specified path. The type is taken from [self + folderType]. + + * SoObjects/Contacts/SOGoContactGCSFolder.m ([SOGoContactGCSFolder + -folderType]): implemented. + + * SoObjects/Appointments/SOGoAppointmentFolder.m + ([SOGoAppointmentFolder -folderType]): implemented. + + * SoObjects/Contacts/SOGoContactFolders.m ([SOGoContactFolders + -appendPersonalSourcesInContext:context]): we now fetch all + folders with type "Contact" that belong to the current user. + ([SOGoContactFolders -newFolderWithName:name]): new method to + create a new contact folder. + + * UI/SOGoUI/UIxComponent.m ([UIxComponent -userFolderPath]): treat + resulting url with [NSString+Utilities hostlessURL] instead of + using NSURL. This is because the url in question sometimes has a + hostname and sometimes not. "hostlessURL" ensure the hostname is + removed anyway. + ([UIxComponent -applicationPath]): same as above. + +2007-02-08 Ludovic Marcotte + + * SoObjects/Mailer/SOGoMailFolder.m: priorize the lookup of + folders before doing the one on messages. + 2007-02-08 Wolfgang Sourdeau * SoObjects/SOGo/NSArray+Utilities.m: added an implementation of @@ -10,9 +49,8 @@ 2007-02-07 Ludovic Marcotte - * UI/Scheduler/English.lproj/Localizable.strings - Fixed typo for "Agendas" - + * UI/Scheduler/English.lproj/Localizable.strings: fixed typo for + "Agendas" 2007-02-05 Wolfgang Sourdeau diff --git a/OGoContentStore/appointment.ocs b/OGoContentStore/appointment.ocs index b1d267e2..8e014e4a 100644 --- a/OGoContentStore/appointment.ocs +++ b/OGoContentStore/appointment.ocs @@ -4,6 +4,11 @@ extractorClassName = "OCSiCalFieldExtractor"; fields = ( + { + columnName = c_name; + sqlType = "VARCHAR(256)"; + allowsNull = NO; + }, { columnName = uid; sqlType = "VARCHAR(256)"; diff --git a/OGoContentStore/contact.ocs b/OGoContentStore/contact.ocs index a08d2234..29fa9915 100644 --- a/OGoContentStore/contact.ocs +++ b/OGoContentStore/contact.ocs @@ -4,6 +4,11 @@ extractorClassName= "OCSContactFieldExtractor"; fields = ( + { + columnName = c_name; + sqlType = "VARCHAR(256)"; + allowsNull = NO; + }, { columnName = givenname; sqlType = "VARCHAR(256)"; diff --git a/OGoContentStore/sql/folderinfo-create.sqlite b/OGoContentStore/sql/folderinfo-create.sqlite deleted file mode 100644 index cb5e5854..00000000 --- a/OGoContentStore/sql/folderinfo-create.sqlite +++ /dev/null @@ -1,62 +0,0 @@ --- --- (C) 2005 SKYRIX Software AG --- --- TODO: --- add a unique constraints on path - --- DROP TABLE SOGo_folder_info; - -CREATE TABLE SOGo_folder_info ( - c_folder_id INTEGER PRIMARY KEY, - c_path VARCHAR(255) NOT NULL, /* the full path to the folder */ - c_path1 VARCHAR(255) NOT NULL, /* parts (for fast queries) */ - c_path2 VARCHAR(255) NULL, /* parts (for fast queries) */ - c_path3 VARCHAR(255) NULL, /* parts (for fast queries) */ - c_path4 VARCHAR(255) NULL, /* parts (for fast queries) */ - c_foldername VARCHAR(255) NOT NULL, /* last path component */ - c_location VARCHAR(2048) NOT NULL, /* URL to folder */ - c_quick_location VARCHAR(2048) NULL, /* URL to quicktable of folder */ - c_folder_type VARCHAR(255) NOT NULL /* the folder type ... */ -); - -INSERT INTO SOGo_folder_info - ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, - c_location, c_quick_location, c_folder_type ) -VALUES - ( '/Users', - 'Users', - NULL, - NULL, - NULL, - 'Users', - 'sqlite://localhost/tmp/sogo-registry.sqlite/SOGo_user_folder_blob', - 'sqlite://localhost/tmp/sogo-registry.sqlite/SOGo_user_folder_quick', - 'Container' ); - -INSERT INTO SOGo_folder_info - ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, - c_location, c_quick_location, c_folder_type ) -VALUES - ( '/Users/helge', - 'Users', - 'helge', - NULL, - NULL, - 'helge', - 'sqlite://localhost/tmp/sogo-registry.sqlite/SOGo_user_folder_blob', - 'sqlite://localhost/tmp/sogo-registry.sqlite/SOGo_user_folder_quick', - 'Container' ); - -INSERT INTO SOGo_folder_info - ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, - c_location, c_quick_location, c_folder_type ) -VALUES - ( '/Users/helge/Calendar', - 'Users', - 'helge', - 'Calendar', - NULL, - 'Calendar', - 'sqlite://localhost/tmp/sogo-registry.sqlite/SOGo_helge_privcal_blob', - 'sqlite://localhost/tmp/sogo-registry.sqlite/SOGo_helge_privcal_quick', - 'Appointment' ); diff --git a/OGoContentStore/sql/foldertablecreate-helge-privcal.sqlite b/OGoContentStore/sql/foldertablecreate-helge-privcal.sqlite deleted file mode 100644 index 4b324bbe..00000000 --- a/OGoContentStore/sql/foldertablecreate-helge-privcal.sqlite +++ /dev/null @@ -1,36 +0,0 @@ -/* - (C) 2005 SKYRIX Software AG -*/ - -DROP TABLE SOGo_helge_privcal_quick; -DROP TABLE SOGo_helge_privcal; - -CREATE TABLE SOGo_helge_privcal_quick ( - c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */ - uid VARCHAR(256) NOT NULL, - startdate INT NOT NULL, - enddate INT NOT NULL, - cycleenddate INT NULL, /* enddate for cyclic events */ - title VARCHAR(1000) NOT NULL, - cycleinfo VARCHAR(1000) NULL, /* property list with cycle infos */ - participants VARCHAR(100000) NOT NULL, /* the CNs of the participants */ - isallday INT NULL, - iscycle INT NULL, /* client needs to fetch to resolve */ - ispublic INT NOT NULL, - status INT NOT NULL, - isopaque INT NULL, - priority INT NOT NULL, -- for marking high prio apts - location VARCHAR(256) NULL, - orgmail VARCHAR(256) NULL, - partmails VARCHAR(100000) NOT NULL, /* the emails of the participants */ - partstates VARCHAR(256) NOT NULL, /* the status of each participant */ - sequence INT NULL /* the iCal sequence */ -); - -CREATE TABLE SOGo_helge_privcal_blob ( - c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */ - c_content VARCHAR(100000) NOT NULL, /* the BLOB */ - c_creationdate INT NOT NULL, /* creation date */ - c_lastmodified INT NOT NULL, /* last modification (UPDATE) */ - c_version INT NOT NULL /* version counter */ -); diff --git a/OGoContentStore/sql/generate-folderinfo-sql-for-users-sqlite.sh b/OGoContentStore/sql/generate-folderinfo-sql-for-users-sqlite.sh deleted file mode 100755 index 19b702c3..00000000 --- a/OGoContentStore/sql/generate-folderinfo-sql-for-users-sqlite.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# -# Usage: generate-folderinfo-sql-for-users user1 [user2] [user3] [...] -# - -DB="/tmp/sogo-registry.sqlite" - -while [ "$1" != "" ]; do -USER_ID=$1 -USER_TABLE=`echo $USER_ID | tr -s [:punct:] _` -cat << EOF -DELETE FROM SOGo_folder_info WHERE c_path2 = '${USER_ID}'; - -INSERT INTO SOGo_folder_info - ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, - c_location, c_quick_location, c_folder_type ) -VALUES - ( '/Users/${USER_ID}', - 'Users', - '${USER_ID}', - NULL, - NULL, - '${USER_ID}', - 'sqlite://localhost${DB}/SOGo_user_folder_blob', - 'sqlite://localhost${DB}/SOGo_user_folder_quick', - 'Container' ); - -INSERT INTO SOGo_folder_info - ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, - c_location, c_quick_location, c_folder_type ) -VALUES - ( '/Users/${USER_ID}/Calendar', - 'Users', - '${USER_ID}', - 'Calendar', - NULL, - 'Calendar', - 'sqlite://localhost${DB}/SOGo_${USER_TABLE}_privcal_blob', - 'sqlite://localhost${DB}/SOGo_${USER_TABLE}_privcal_quick', - 'Appointment' ); - -INSERT INTO SOGo_folder_info - ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, - c_location, c_quick_location, c_folder_type ) -VALUES - ( '/Users/${USER_ID}/Contacts', - 'Users', - '${USER_ID}', - 'Contacts', - NULL, - 'Contacts', - 'sqlite://localhost${DB}/SOGo_${USER_TABLE}_contacts_blob', - 'sqlite://localhost${DB}/SOGo_${USER_TABLE}_contacts_quick', - 'Contact' ); - -DROP TABLE SOGo_${USER_TABLE}_privcal_quick; -DROP TABLE SOGo_${USER_TABLE}_privcal_blob; - -CREATE TABLE SOGo_${USER_TABLE}_privcal_quick ( - c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */ - uid VARCHAR(256) NOT NULL, - startdate INT NOT NULL, - enddate INT NOT NULL, - cycleenddate INT NULL, /* enddate for cyclic events */ - title VARCHAR(1000) NOT NULL, - cycleinfo VARCHAR(1000) NULL, /* property list with cycle infos */ - participants VARCHAR(100000) NOT NULL, /* the CNs of the participants */ - isallday INT NULL, - iscycle INT NULL, /* client needs to fetch to resolve */ - ispublic INT NOT NULL, - status INT NOT NULL, - isopaque INT NULL, - priority INT NOT NULL, -- for marking high prio apts - location VARCHAR(256) NULL, - orgmail VARCHAR(256) NULL, - partmails VARCHAR(100000) NOT NULL, /* the emails of the participants */ - partstates VARCHAR(256) NOT NULL, /* the status of each participant */ - sequence INT NULL /* the iCal sequence */ -); - -CREATE TABLE SOGo_${USER_TABLE}_privcal_blob ( - c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */ - c_content VARCHAR(100000) NOT NULL, /* the BLOB */ - c_creationdate INT NOT NULL, /* creation date */ - c_lastmodified INT NOT NULL, /* last modification (UPDATE) */ - c_version INT NOT NULL /* version counter */ -); - -DROP TABLE SOGo_${USER_TABLE}_contacts_quick; -DROP TABLE SOGo_${USER_TABLE}_contacts_blob; - -CREATE TABLE SOGo_${USER_TABLE}_contacts_quick ( - c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */ - givenname VARCHAR(256), - cn VARCHAR(256), - sn VARCHAR(256), - l VARCHAR(256), - mail VARCHAR(256), - o VARCHAR(256), - ou VARCHAR(256), - telephonenumber VARCHAR(256) -); - -CREATE TABLE SOGo_${USER_TABLE}_contacts_blob ( - c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */ - c_content VARCHAR(100000) NOT NULL, /* the BLOB */ - c_creationdate INT NOT NULL, /* creation date */ - c_lastmodified INT NOT NULL, /* last modification (UPDATE) */ - c_version INT NOT NULL /* version counter */ -); - -EOF -shift -done diff --git a/OGoContentStore/sql/generate-folderinfo-sql-for-users-sqlite1table.sh b/OGoContentStore/sql/generate-folderinfo-sql-for-users-sqlite1table.sh deleted file mode 100755 index 3b1a7a96..00000000 --- a/OGoContentStore/sql/generate-folderinfo-sql-for-users-sqlite1table.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/bash -# -# Usage: generate-folderinfo-sql-for-users user1 [user2] [user3] [...] -# - -DB="/tmp/sogo-registry.sqlite" - -while [ "$1" != "" ]; do -USER_ID=$1 -USER_TABLE=`echo $USER_ID | tr -s [:punct:] _` - -cat << EOF -DELETE FROM SOGo_folder_info WHERE c_path2 = '${USER_ID}'; - -INSERT INTO SOGo_folder_info - ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, - c_location, c_quick_location, c_folder_type ) -VALUES - ( '/Users/${USER_ID}', - 'Users', - '${USER_ID}', - NULL, - NULL, - '${USER_ID}', - 'sqlite://localhost${DB}/SOGo_user_folder_blob', - 'sqlite://localhost${DB}/SOGo_user_folder_quick', - 'Container' ); - -INSERT INTO SOGo_folder_info - ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, - c_location, c_quick_location, c_folder_type ) -VALUES - ( '/Users/${USER_ID}/Calendar', - 'Users', - '${USER_ID}', - 'Calendar', - NULL, - 'Calendar', - 'sqlite://localhost${DB}/SOGo_${USER_TABLE}_privcal', - 'sqlite://localhost${DB}/SOGo_${USER_TABLE}_privcal', - 'Appointment' ); - -INSERT INTO SOGo_folder_info - ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, - c_location, c_quick_location, c_folder_type ) -VALUES - ( '/Users/${USER_ID}/Contacts', - 'Users', - '${USER_ID}', - 'Contacts', - NULL, - 'Contacts', - 'sqlite://localhost${DB}/SOGo_${USER_TABLE}_contacts', - 'sqlite://localhost${DB}/SOGo_${USER_TABLE}_contacts', - 'Contact' ); - - -DROP TABLE SOGo_${USER_TABLE}_privcal; -CREATE TABLE SOGo_${USER_TABLE}_privcal ( - c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */ - c_content VARCHAR(100000) NOT NULL, /* the BLOB */ - c_creationdate INT NOT NULL, /* creation date */ - c_lastmodified INT NOT NULL, /* last modification (UPDATE) */ - c_version INT NOT NULL, /* version counter */ - - /* quick fields */ - uid VARCHAR(256) NOT NULL, - startdate INT NOT NULL, - enddate INT NOT NULL, - cycleenddate INT NULL, /* enddate for cyclic events */ - title VARCHAR(1000) NOT NULL, - cycleinfo VARCHAR(1000) NULL, /* property list with cycle infos */ - participants VARCHAR(100000) NOT NULL, /* the CNs of the participants */ - isallday INT NULL, - iscycle INT NULL, /* client needs to fetch to resolve */ - ispublic INT NOT NULL, - status INT NOT NULL, - priority INT NOT NULL, -- for marking high prio apts - isopaque INT NULL, - location VARCHAR(256) NULL, - orgmail VARCHAR(256) NULL, - partmails VARCHAR(100000) NOT NULL, /* the emails of the participants */ - partstates VARCHAR(256) NOT NULL, /* the status of each participant */ - sequence INT NULL /* the iCal sequence */ -); - - -DROP TABLE SOGo_${USER_TABLE}_contacts; -CREATE TABLE SOGo_${USER_TABLE}_contacts ( - c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */ - c_content VARCHAR(100000) NOT NULL, /* the BLOB */ - c_creationdate INT NOT NULL, /* creation date */ - c_lastmodified INT NOT NULL, /* last modification (UPDATE) */ - c_version INT NOT NULL, /* version counter */ - - /* quick fields */ - givenname VARCHAR(256), - cn VARCHAR(256), - sn VARCHAR(256), - l VARCHAR(256), - mail VARCHAR(256), - o VARCHAR(256), - ou VARCHAR(256), - telephonenumber VARCHAR(256) -); - -EOF -shift -done diff --git a/SOPE/NGCards/CardGroup.m b/SOPE/NGCards/CardGroup.m index 90700c8a..b7b60ca7 100644 --- a/SOPE/NGCards/CardGroup.m +++ b/SOPE/NGCards/CardGroup.m @@ -43,10 +43,15 @@ static NGCardsSaxHandler *sax = nil; if (!parser) { +#if 1 + parser = [[SaxXMLReaderFactory standardXMLReaderFactory] + createXMLReaderWithName: @"VSCardSaxDriver"]; + [parser retain]; +#else parser = [[[SaxXMLReaderFactory standardXMLReaderFactory] - createXMLReaderForMimeType:@"text/x-vcard"] - retain]; + createXMLReaderForMimeType:@"text/x-vcard"] retain]; +#endif if (parser) { [parser setContentHandler:sax]; diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index 5dc47b5e..e5dea661 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,10 @@ +2007-02-09 Wolfgang Sourdeau + + * CardGroup.m ([CardGroup +cardParser]): find the correct parser + by requesting a parser by name instead of by mime-type. This way, + any parser which would declare the same types would not + enter in conflict. + 2007-02-08 Wolfgang Sourdeau * CardElement.m ([CardElement -namedValue:aValueName]): use diff --git a/SOPE/NGCards/versitCardsSaxDriver/GNUmakefile b/SOPE/NGCards/versitCardsSaxDriver/GNUmakefile index 82c2d316..0782266b 100644 --- a/SOPE/NGCards/versitCardsSaxDriver/GNUmakefile +++ b/SOPE/NGCards/versitCardsSaxDriver/GNUmakefile @@ -8,7 +8,7 @@ BUNDLE_NAME = versitCardsSaxDriver BUNDLE_EXTENSION = .sax BUNDLE_INSTALL_DIR = $(GNUSTEP_INSTALLATION_DIR)/Library/SaxDrivers-$(MAJOR_VERSION).$(MINOR_VERSION)/ -versitCardsSaxDriver_PRINCIPAL_CLASS = VSSaxDriver +versitCardsSaxDriver_PRINCIPAL_CLASS = VSCardSaxDriver versitCardsSaxDriver_PCH_FILE = common.h diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index a85e2900..9d4ceb74 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -23,9 +23,11 @@ #import #import #import +#import +#import #import -#import +// #import #import #import #import @@ -58,7 +60,7 @@ static NSNumber *sharedYes = nil; { NGLoggerManager *lm; static BOOL didInit = NO; - SoClassSecurityInfo *securityInfo; +// SoClassSecurityInfo *securityInfo; if (didInit) return; didInit = YES; @@ -1081,6 +1083,11 @@ static NSNumber *sharedYes = nil; /* folder type */ +- (NSString *) folderType +{ + return @"Appointment"; +} + - (NSString *) outlookFolderClass { return @"IPF.Appointment"; diff --git a/SoObjects/Contacts/SOGoContactFolders.h b/SoObjects/Contacts/SOGoContactFolders.h index f75db750..0272f3bb 100644 --- a/SoObjects/Contacts/SOGoContactFolders.h +++ b/SoObjects/Contacts/SOGoContactFolders.h @@ -27,6 +27,7 @@ @class NSMutableDictionary; @class NSString; +@class WOResponse; @interface SOGoContactFolders : SOGoObject { @@ -40,6 +41,8 @@ - (NSArray *) contactFolders; +- (WOResponse *) newFolderWithName: (NSString *) name; + @end #endif /* SOGOCONTACTFOLDERS_H */ diff --git a/SoObjects/Contacts/SOGoContactFolders.m b/SoObjects/Contacts/SOGoContactFolders.m index e47adecb..4e57d72d 100644 --- a/SoObjects/Contacts/SOGoContactFolders.m +++ b/SoObjects/Contacts/SOGoContactFolders.m @@ -36,6 +36,11 @@ #import #import +#import +#import +#import +#import + #import #import "common.h" @@ -69,13 +74,70 @@ - (void) appendPersonalSourcesInContext: (WOContext *) context; { SOGoContactGCSFolder *ab; + GCSChannelManager *cm; + EOAdaptorChannel *fc; + NSURL *folderLocation; + NSString *sql; + NSArray *attrs; + NSDictionary *row; + + cm = [GCSChannelManager defaultChannelManager]; + folderLocation + = [[GCSFolderManager defaultFolderManager] folderInfoLocation]; + fc = [cm acquireOpenChannelForURL: folderLocation]; + if (fc) + { + sql + = [NSString stringWithFormat: @"SELECT c_path4, c_foldername FROM %@" + @" WHERE c_path2 = '%@' AND c_folder_type = 'Contact'", + [folderLocation gcsTableName], + [self ownerInContext: nil]]; + [fc evaluateExpressionX: sql]; + attrs = [fc describeResults: NO]; + row = [fc fetchAttributes: attrs withZone: NULL]; + while (row) + { + ab = [SOGoContactGCSFolder contactFolderWithName: [row objectForKey: @"c_path4"] + andDisplayName: [row objectForKey: @"c_foldername"] + inContainer: self]; + [ab setOCSPath: [NSString stringWithFormat: @"%@/%@", + OCSPath, [row objectForKey: @"c_path4"]]]; + [contactFolders setObject: ab forKey: [row objectForKey: @"c_path4"]]; + row = [fc fetchAttributes: attrs withZone: NULL]; + } + + [cm releaseChannel: fc]; +// sql = [sql stringByAppendingFormat:@" WHERE %@ = '%@'", +// uidColumnName, [self uid]]; + } +} + +- (WOResponse *) newFolderWithName: (NSString *) name +{ + SOGoContactGCSFolder *newFolder; + WOResponse *response; + + newFolder = [SOGoContactGCSFolder contactFolderWithName: name + andDisplayName: name + inContainer: [self clientObject]]; + if ([newFolder isKindOfClass: [NSException class]]) + response = (WOResponse *) newFolder; + else + { + [newFolder setOCSPath: [NSString stringWithFormat: @"%@/%@", + OCSPath, name]]; + if ([newFolder create]) + { + response = [WOResponse new]; + [response setStatus: 201]; + [response autorelease]; + } + else + response = [NSException exceptionWithHTTPStatus: 400 + reason: @"The new folder could not be created"]; + } - ab = [SOGoContactGCSFolder contactFolderWithName: @"personal" - andDisplayName: @"Personal Addressbook" - inContainer: self]; - [ab setOCSPath: [NSString stringWithFormat: @"%@/%@", - OCSPath, @"personal"]]; - [contactFolders setObject: ab forKey: @"personal"]; + return response; } - (void) appendSystemSourcesInContext: (WOContext *) context; diff --git a/SoObjects/Contacts/SOGoContactGCSFolder.m b/SoObjects/Contacts/SOGoContactGCSFolder.m index 6dd136bb..828be57a 100644 --- a/SoObjects/Contacts/SOGoContactGCSFolder.m +++ b/SoObjects/Contacts/SOGoContactGCSFolder.m @@ -200,6 +200,11 @@ /* folder type */ +- (NSString *) folderType +{ + return @"Contact"; +} + - (NSString *)outlookFolderClass { return @"IPF.Contact"; } diff --git a/SoObjects/Contacts/SOGoContactLDAPFolder.m b/SoObjects/Contacts/SOGoContactLDAPFolder.m index 07305567..b14734e8 100644 --- a/SoObjects/Contacts/SOGoContactLDAPFolder.m +++ b/SoObjects/Contacts/SOGoContactLDAPFolder.m @@ -90,7 +90,7 @@ if ((self = [self initWithName: aName inContainer: aContainer])) [self setDisplayName: aDisplayName]; - + return self; } diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index d6bf24cd..cf537404 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -294,15 +294,15 @@ static BOOL useAltNamespace = NO; */ return [self lookupImap4Message:_key inContext:_ctx]; } + + obj = [self lookupImap4Folder:_key inContext:_ctx]; + if (obj != nil) + return obj; /* check attributes directly bound to the app */ if ((obj = [super lookupName:_key inContext:_ctx acquire:NO])) return obj; - obj = [self lookupImap4Folder:_key inContext:_ctx]; - if (obj != nil) - return obj; - /* return 404 to stop acquisition */ return _acquire ? [NSException exceptionWithHTTPStatus:404 /* Not Found */] diff --git a/SoObjects/SOGo/GNUmakefile b/SoObjects/SOGo/GNUmakefile index ffcc0cb0..e5e5dc49 100644 --- a/SoObjects/SOGo/GNUmakefile +++ b/SoObjects/SOGo/GNUmakefile @@ -78,6 +78,7 @@ agenor_defaults_OBJC_FILES += agenor_defaults.m ADDITIONAL_TOOL_LIBS += -Lobj -lSOGo$(LIBRARY_NAME_SUFFIX) -include GNUmakefile.preamble +include ../common.make include $(GNUSTEP_MAKEFILES)/library.make include $(GNUSTEP_MAKEFILES)/tool.make -include GNUmakefile.postamble diff --git a/SoObjects/SOGo/GNUmakefile.preamble b/SoObjects/SOGo/GNUmakefile.preamble index 0a7155d9..f49ab0b7 100644 --- a/SoObjects/SOGo/GNUmakefile.preamble +++ b/SoObjects/SOGo/GNUmakefile.preamble @@ -2,18 +2,7 @@ libSOGo_INCLUDE_DIRS += -I.. -I../../.. -ifneq ($(GNUSTEP_BUILD_DIR),) - RELBUILD_DIR_libOGoContentStore = \ - $(GNUSTEP_BUILD_DIR)/../../OGoContentStore/$(GNUSTEP_OBJ_DIR_NAME) -else - RELBUILD_DIR_libOGoContentStore = \ - ../../OGoContentStore/$(GNUSTEP_OBJ_DIR) -endif - -SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib - -libSOGo_LIB_DIRS += \ - -L$(RELBUILD_DIR_libOGoContentStore) -L$(RELBUILD_DIR_libOGoContentStore)/../../SOPE/NGCards/$(GNUSTEP_OBJ_DIR) +SYSTEM_LIB_DIR += -L/usr/local/lib libSOGo_LIBRARIES_DEPEND_UPON += \ -lOGoContentStore \ @@ -27,9 +16,9 @@ libSOGo_LIBRARIES_DEPEND_UPON += \ ADDITIONAL_TOOL_LIBS += \ -L$(GNUSTEP_OBJ_DIR)/ \ - $(libSOGO_LIB_DIRS) \ + -lSOGo \ -lGDLContentStore -lGDLAccess \ + -lNGCards \ -lNGLdap \ -lNGExtensions -lEOControl \ -lDOM -lSaxObjC - diff --git a/SoObjects/SOGo/SOGoFolder.h b/SoObjects/SOGo/SOGoFolder.h index b4a6b92b..50c9f8e4 100644 --- a/SoObjects/SOGo/SOGoFolder.h +++ b/SoObjects/SOGo/SOGoFolder.h @@ -62,6 +62,8 @@ - (NSString *)outlookFolderClass; +- (BOOL) create; + @end @interface SOGoFolder (GroupDAVExtensions) diff --git a/SoObjects/SOGo/SOGoFolder.m b/SoObjects/SOGo/SOGoFolder.m index d60a8981..27eabcca 100644 --- a/SoObjects/SOGo/SOGoFolder.m +++ b/SoObjects/SOGo/SOGoFolder.m @@ -20,13 +20,14 @@ */ #import +#import +#import +#import -#include "SOGoFolder.h" -#include "common.h" -#include -#include -#include -#include +#import "SOGoFolder.h" +#import "common.h" +#import +#import #import "SOGoAclsFolder.h" @@ -83,6 +84,7 @@ ASSIGNCOPY(self->ocsPath, _path); } + - (NSString *)ocsPath { return self->ocsPath; } @@ -109,6 +111,23 @@ return folder; } +- (NSString *) folderType +{ + return @""; +} + +- (BOOL) create +{ + NSException *result; + + [GCSFolderType setFolderNamePrefix: @"SOGo_"]; + + result = [[self folderManager] createFolderOfType: [self folderType] + atPath: ocsPath]; + + return (result == nil); +} + - (NSArray *)fetchContentObjectNames { NSArray *fields, *records; diff --git a/SoObjects/common.make b/SoObjects/common.make index 064352a9..096c7a6d 100644 --- a/SoObjects/common.make +++ b/SoObjects/common.make @@ -14,7 +14,8 @@ WOBUNDLE_INSTALL_DIR = $(BUNDLE_INSTALL_DIR) ADDITIONAL_INCLUDE_DIRS += \ -I.. \ - -I../.. + -I../.. \ + -I../../SOPE ADDITIONAL_LIB_DIRS += \ -L../SOGo/$(GNUSTEP_OBJ_DIR)/ \ diff --git a/UI/Contacts/English.lproj/Localizable.strings b/UI/Contacts/English.lproj/Localizable.strings index 95e560d9..c29237cc 100644 --- a/UI/Contacts/English.lproj/Localizable.strings +++ b/UI/Contacts/English.lproj/Localizable.strings @@ -86,5 +86,8 @@ "Add Assistant" = "Add Assistant"; "Add Delegate" = "Add Delegate"; -"Add an Addressbook..." = "Add an Addressbook..."; +"New Addressbook..." = "New Addressbook..."; +"Subscribe to an Addressbook..." = "Subscribe to an Addressbook..."; "Remove the selected Addressbook" = "Remove the selected Addressbook"; + +"Name of the Address Book" = "Name of the Address Book"; diff --git a/UI/Contacts/French.lproj/Localizable.strings b/UI/Contacts/French.lproj/Localizable.strings index dd95584b..7ecdeb34 100644 --- a/UI/Contacts/French.lproj/Localizable.strings +++ b/UI/Contacts/French.lproj/Localizable.strings @@ -88,5 +88,8 @@ "Add Assistant" = "Ajouter comme assistant"; "Add Delegate" = "Ajouter comme délégué"; -"Add an Addressbook..." = "Ajouter un carnet d'adresses..."; +"New Addressbook..." = "Nouveau carnet d'adresses..."; +"Subscribe to an Addressbook..." = "S'inscrire à un carnet d'adresses..."; "Remove the selected Addressbook" = "Enlever le carnet d'adresses sélectionné"; + +"Name of the Address Book" = "Nom du carnet d'adresses"; diff --git a/UI/Contacts/UIxContactFoldersView.m b/UI/Contacts/UIxContactFoldersView.m index 4219446d..6a1b106a 100644 --- a/UI/Contacts/UIxContactFoldersView.m +++ b/UI/Contacts/UIxContactFoldersView.m @@ -25,6 +25,7 @@ #import #import #import +#import #import #import @@ -68,6 +69,21 @@ return [self _selectActionForApplication: @"new"]; } +- (id ) newAbAction +{ + id response; + NSString *name; + + name = [self queryParameterForKey: @"name"]; + if ([name length] > 0) + response = [[self clientObject] newFolderWithName: name]; + else + response = [NSException exceptionWithHTTPStatus: 400 + reason: @"The name is missing"]; + + return response; +} + - (id) selectForSchedulerAction { return [self _selectActionForApplication: @"scheduler-contacts"]; diff --git a/UI/Contacts/product.plist b/UI/Contacts/product.plist index 7dce9f59..a3424d7b 100644 --- a/UI/Contacts/product.plist +++ b/UI/Contacts/product.plist @@ -17,6 +17,11 @@ pageName = "UIxContactFoldersView"; actionName = "new"; }; + newAb = { + protectedBy = "View"; + pageName = "UIxContactFoldersView"; + actionName = "newAb"; + }; scheduler-contacts = { protectedBy = "View"; pageName = "UIxContactFoldersView"; diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index 59ab845d..9c179e8b 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -285,7 +285,6 @@ static BOOL uixDebugEnabled = NO; - (NSString *) userFolderPath { WOContext *ctx; - NSString *url, *path; NSEnumerator *objects; SOGoObject *currentObject; BOOL found; @@ -301,16 +300,12 @@ static BOOL uixDebugEnabled = NO; else currentObject = [objects nextObject]; - url = [currentObject baseURLInContext:ctx]; - path = [[NSURL URLWithString:url] path]; - - return path; + return [[currentObject baseURLInContext:ctx] hostlessURL]; } - (NSString *) applicationPath { SOGoObject *currentClient, *parent; - NSString *url; BOOL found; Class objectClass, groupFolderClass, userFolderClass; WOContext *ctx; @@ -333,9 +328,8 @@ static BOOL uixDebugEnabled = NO; } ctx = [self context]; - url = [currentClient baseURLInContext: ctx]; - return [[NSURL URLWithString: url] path]; + return [[currentClient baseURLInContext:ctx] hostlessURL]; } - (NSString *) resourcesPath diff --git a/UI/Scheduler/French.lproj/Localizable.strings b/UI/Scheduler/French.lproj/Localizable.strings index 6c797a61..348dcb48 100644 --- a/UI/Scheduler/French.lproj/Localizable.strings +++ b/UI/Scheduler/French.lproj/Localizable.strings @@ -27,7 +27,7 @@ "Week" = "Semaine"; "this week" = "cette semaine"; -"Week %d" = "Semaine nú %d"; +"Week %d" = "Semaine nº %d"; /* Month */ diff --git a/UI/Scheduler/UIxCalDayTable.m b/UI/Scheduler/UIxCalDayTable.m index 59fea714..9357b8e3 100644 --- a/UI/Scheduler/UIxCalDayTable.m +++ b/UI/Scheduler/UIxCalDayTable.m @@ -243,6 +243,7 @@ NSEnumerator *aptsEnumerator; NSDictionary *currentDayAppointment; NSCalendarDate *start, *end; + int endHour; if (!allAppointments) { @@ -254,7 +255,11 @@ [filteredAppointments autorelease]; start = [currentTableDay hour: [self dayStartHour] minute: 0]; - end = [currentTableDay hour: [self dayEndHour] minute: 0]; + endHour = [self dayEndHour]; + if (endHour < 24) + end = [currentTableDay hour: [self dayEndHour] minute: 0]; + else + end = [[currentTableDay tomorrow] hour: 0 minute: 0]; aptsEnumerator = [allAppointments objectEnumerator]; currentDayAppointment = [aptsEnumerator nextObject]; diff --git a/UI/Scheduler/UIxCalView.m b/UI/Scheduler/UIxCalView.m index ea5fedf0..b56c2429 100644 --- a/UI/Scheduler/UIxCalView.m +++ b/UI/Scheduler/UIxCalView.m @@ -401,7 +401,7 @@ static BOOL shouldDisplayWeekend = NO; - (unsigned) dayEndHour { - return 24; + return 23; } - (BOOL) shouldDisplayWeekend diff --git a/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox b/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox index f0a71c13..084a6630 100644 --- a/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox +++ b/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox @@ -35,23 +35,27 @@
- - + +
-
- + + >
    @@ -81,7 +85,7 @@
-
+
diff --git a/UI/Templates/MailerUI/UIxMailFilterPanel.wox b/UI/Templates/MailerUI/UIxMailFilterPanel.wox index 0e3805a4..c3647767 100644 --- a/UI/Templates/MailerUI/UIxMailFilterPanel.wox +++ b/UI/Templates/MailerUI/UIxMailFilterPanel.wox @@ -3,6 +3,7 @@ xmlns="http://www.w3.org/1999/xhtml" xmlns:var="http://www.skyrix.com/od/binding" xmlns:const="http://www.skyrix.com/od/constant" + xmlns:label="OGo:label" > - + +
diff --git a/UI/Templates/SchedulerUI/UIxAppointmentProposal.wox b/UI/Templates/SchedulerUI/UIxAppointmentProposal.wox index 8c7f0ece..ddbe269c 100644 --- a/UI/Templates/SchedulerUI/UIxAppointmentProposal.wox +++ b/UI/Templates/SchedulerUI/UIxAppointmentProposal.wox @@ -150,7 +150,7 @@ + ! use '1' instead of 'YES', otherwise breaks on OSX --> + use '1' instead of 'YES', otherwise breaks on OSX -->