From: wolfgang Date: Tue, 22 Apr 2008 19:28:07 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1401 d1b88da0-ebda-0310... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5690cda04b1485876034c3eb0031a5f17d0d1614;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1401 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ChangeLog b/ChangeLog index ef99e9b1..327220f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-04-22 Wolfgang Sourdeau + * UI/Scheduler/UIxCalendarSelector.m ([UIxCalendarSelector + -contrastingTextColor]): new method (code taken from Lightning) + that returns a foreground color easily readible based on the + brightness of the background color. + * SoObjects/SOGo/SOGoGCSFolder.m ([SOGoGCSFolder -setDavDisplayName:newName]): deny the renaming of the folder if not owner. diff --git a/SOPE/sope-patchset-r1619.diff b/SOPE/sope-patchset-r1620.diff similarity index 89% rename from SOPE/sope-patchset-r1619.diff rename to SOPE/sope-patchset-r1620.diff index 85da01a1..e164659d 100644 --- a/SOPE/sope-patchset-r1619.diff +++ b/SOPE/sope-patchset-r1620.diff @@ -1,184 +1,6 @@ -Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m -=================================================================== ---- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1619) -+++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (copie de travail) -@@ -713,6 +713,39 @@ - return ms; - } - -+/* GCSEOAdaptorChannel protocol */ -+static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n" \ -+ @" c_name VARCHAR (256) NOT NULL,\n" -+ @" c_content VARCHAR (100000) NOT NULL,\n" -+ @" c_creationdate INT4 NOT NULL,\n" -+ @" c_lastmodified INT4 NOT NULL,\n" -+ @" c_version INT4 NOT NULL,\n" -+ @" c_deleted INT4 NULL\n" -+ @")"); -+static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n" \ -+ @" c_uid VARCHAR (256) NOT NULL,\n" -+ @" c_object VARCHAR (256) NOT NULL,\n" -+ @" c_role VARCHAR (80) NOT NULL\n" -+ @")"); -+ -+- (NSException *) createGCSFolderTableWithName: (NSString *) tableName -+{ -+ NSString *sql; -+ -+ sql = [NSString stringWithFormat: sqlFolderFormat, tableName]; -+ -+ return [self evaluateExpressionX: sql]; -+} -+ -+- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName -+{ -+ NSString *sql; -+ -+ sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName]; -+ -+ return [self evaluateExpressionX: sql]; -+} -+ - @end /* PostgreSQL72Channel */ - - @implementation PostgreSQL72Channel(PrimaryKeyGeneration) -Index: sope-gdl1/Oracle8/OracleAdaptorChannel.m -=================================================================== ---- sope-gdl1/Oracle8/OracleAdaptorChannel.m (révision 1619) -+++ sope-gdl1/Oracle8/OracleAdaptorChannel.m (copie de travail) -@@ -30,6 +30,7 @@ - - #import - -+static BOOL debugOn = NO; - // - // - // -@@ -41,10 +42,19 @@ - - @implementation OracleAdaptorChannel (Private) - --- (void) _cleanup -++ (void) initialize - { -+ NSUserDefaults *ud; -+ -+ ud = [NSUserDefaults standardUserDefaults]; -+ debugOn = [ud boolForKey: @"OracleAdaptorDebug"]; -+} -+ -+- (void) _cleanup -+{ - column_info *info; - int c; -+ sword result; - - [_resultSetProperties removeAllObjects]; - -@@ -58,11 +68,29 @@ - // so we just free the value instead. - if (info->value) - { -- if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS) -+ if (info->type == SQLT_CLOB -+ || info->type == SQLT_BLOB -+ || info->type == SQLT_BFILEE -+ || info->type == SQLT_CFILEE) -+ { -+ result = OCIDescriptorFree((dvoid *)info->value, (ub4) OCI_DTYPE_LOB); -+ if (result != OCI_SUCCESS) -+ { -+ NSLog (@"value was not a LOB descriptor"); -+ abort(); -+ } -+ } -+ else - free(info->value); - info->value = NULL; - } -- free(info); -+ else -+ { -+ NSLog (@"trying to free an already freed value!"); -+ abort(); -+ } -+ free(info); -+ - [_row_buffer removeObjectAtIndex: c]; - } - -@@ -231,6 +259,9 @@ - - [self _cleanup]; - -+ if (debugOn) -+ [self logWithFormat: @"expression: %@", theExpression]; -+ - if (!theExpression || ![theExpression length]) - { - [NSException raise: @"OracleInvalidExpressionException" -@@ -302,7 +333,9 @@ - // We read the maximum width of a column - info->max_width = 0; - status = OCIAttrGet((dvoid*)param, (ub4)OCI_DTYPE_PARAM, (dvoid*)&(info->max_width), (ub4 *)0, (ub4)OCI_ATTR_DATA_SIZE, (OCIError *)_oci_err); -- -+ -+ if (debugOn) -+ NSLog(@"name: %s, type: %d", cname, info->type); - attribute = [EOAttribute attributeWithOracleType: info->type name: cname length: clen width: info->max_width]; - [_resultSetProperties addObject: attribute]; - -Index: sope-gdl1/Oracle8/OracleAdaptorChannelController.m -=================================================================== ---- sope-gdl1/Oracle8/OracleAdaptorChannelController.m (révision 1619) -+++ sope-gdl1/Oracle8/OracleAdaptorChannelController.m (copie de travail) -@@ -31,6 +31,8 @@ - #import - #import - -+static BOOL debugOn = NO; -+ - // - // - // -@@ -48,6 +50,14 @@ - // - @implementation OracleAdaptorChannelController - -++ (void) initialize -+{ -+ NSUserDefaults *ud; -+ -+ ud = [NSUserDefaults standardUserDefaults]; -+ debugOn = [ud boolForKey: @"OracleAdaptorDebug"]; -+} -+ - - (EODelegateResponse) adaptorChannel: (id) theChannel - willInsertRow: (NSMutableDictionary *) theRow - forEntity: (EOEntity *) theEntity -@@ -56,7 +66,8 @@ - NSArray *keys; - int i, c; - -- NSLog(@"willInsertRow: %@ %@", [theRow description], [theEntity description]); -+ if (debugOn) -+ NSLog(@"willInsertRow: %@ %@", [theRow description], [theEntity description]); - - s = AUTORELEASE([[NSMutableString alloc] init]); - -@@ -101,7 +112,8 @@ - NSArray *keys; - int i, c; - -- NSLog(@"willUpdatetRow: %@ %@", [theRow description], [theQualifier description]); -+ if (debugOn) -+ NSLog(@"willUpdateRow: %@ %@", [theRow description], [theQualifier description]); - - s = AUTORELEASE([[NSMutableString alloc] init]); - Index: sope-mime/NGImap4/NGImap4Connection.m =================================================================== ---- sope-mime/NGImap4/NGImap4Connection.m (révision 1619) +--- sope-mime/NGImap4/NGImap4Connection.m (révision 1620) +++ sope-mime/NGImap4/NGImap4Connection.m (copie de travail) @@ -381,7 +381,7 @@ @@ -191,7 +13,7 @@ Index: sope-mime/NGImap4/NGImap4Connection.m [self errorWithFormat:@"Could not list mailbox hierarchy!"]; Index: sope-mime/NGImap4/NGImap4ResponseNormalizer.m =================================================================== ---- sope-mime/NGImap4/NGImap4ResponseNormalizer.m (révision 1619) +--- sope-mime/NGImap4/NGImap4ResponseNormalizer.m (révision 1620) +++ sope-mime/NGImap4/NGImap4ResponseNormalizer.m (copie de travail) @@ -648,14 +648,13 @@ enumerator = [_flags objectEnumerator]; @@ -217,7 +39,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseNormalizer.m if (objs) free(objs); Index: sope-mime/NGImap4/NGImap4ResponseParser.m =================================================================== ---- sope-mime/NGImap4/NGImap4ResponseParser.m (révision 1619) +--- sope-mime/NGImap4/NGImap4ResponseParser.m (révision 1620) +++ sope-mime/NGImap4/NGImap4ResponseParser.m (copie de travail) @@ -84,6 +84,8 @@ static NSDictionary *_parseMultipartBody(NGImap4ResponseParser *self, @@ -442,7 +264,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m { Index: sope-mime/NGMail/NGSmtpClient.m =================================================================== ---- sope-mime/NGMail/NGSmtpClient.m (révision 1619) +--- sope-mime/NGMail/NGSmtpClient.m (révision 1620) +++ sope-mime/NGMail/NGSmtpClient.m (copie de travail) @@ -24,6 +24,82 @@ #include "NGSmtpReplyCodes.h" @@ -598,7 +420,7 @@ Index: sope-mime/NGMail/NGSmtpClient.m reply = [self receiveReply]; Index: sope-mime/NGMail/NGMimeMessageGenerator.m =================================================================== ---- sope-mime/NGMail/NGMimeMessageGenerator.m (révision 1619) +--- sope-mime/NGMail/NGMimeMessageGenerator.m (révision 1620) +++ sope-mime/NGMail/NGMimeMessageGenerator.m (copie de travail) @@ -86,37 +86,40 @@ char *des = NULL; @@ -664,7 +486,7 @@ Index: sope-mime/NGMail/NGMimeMessageGenerator.m unsigned isoEndLen = 2; Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m =================================================================== ---- sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (révision 1619) +--- sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (révision 1620) +++ sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (copie de travail) @@ -19,88 +19,45 @@ 02111-1307, USA. @@ -958,7 +780,7 @@ Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m + hours += 10 * (*p - 48) + *(p + 1) - 48; + break; + default: -+ NSLog (@"%s: cannot parse time notation '%s'", p); ++ NSLog (@"parseTimeZone: cannot parse time notation '%s'", newString); } - else if (len == 3) { - if (strcasecmp((char *)s, "GMT") == 0) return gmt; @@ -1059,7 +881,7 @@ Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m #if 0 Index: sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m =================================================================== ---- sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m (révision 1619) +--- sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m (révision 1620) +++ sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m (copie de travail) @@ -77,6 +77,7 @@ [rfc822Set setGenerator:gen forField:@"bcc"]; @@ -1071,7 +893,7 @@ Index: sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m Index: sope-mime/NGMime/NGMimeBodyPart.m =================================================================== ---- sope-mime/NGMime/NGMimeBodyPart.m (révision 1619) +--- sope-mime/NGMime/NGMimeBodyPart.m (révision 1620) +++ sope-mime/NGMime/NGMimeBodyPart.m (copie de travail) @@ -31,18 +31,6 @@ return 2; @@ -1109,7 +931,7 @@ Index: sope-mime/NGMime/NGMimeBodyPart.m - (NSString *)contentId { Index: sope-mime/NGMime/GNUmakefile.preamble =================================================================== ---- sope-mime/NGMime/GNUmakefile.preamble (révision 1619) +--- sope-mime/NGMime/GNUmakefile.preamble (révision 1620) +++ sope-mime/NGMime/GNUmakefile.preamble (copie de travail) @@ -5,6 +5,11 @@ -DLIBRARY_MINOR_VERSION=${MINOR_VERSION} \ @@ -1125,7 +947,7 @@ Index: sope-mime/NGMime/GNUmakefile.preamble -I../../sope-core/NGStreams/ \ Index: sope-mime/NGMime/NGMimeBodyParser.m =================================================================== ---- sope-mime/NGMime/NGMimeBodyParser.m (révision 1619) +--- sope-mime/NGMime/NGMimeBodyParser.m (révision 1620) +++ sope-mime/NGMime/NGMimeBodyParser.m (copie de travail) @@ -67,7 +67,10 @@ if (_data == nil) return nil; @@ -1141,7 +963,7 @@ Index: sope-mime/NGMime/NGMimeBodyParser.m Index: sope-mime/NGMime/NGMimePartParser.h =================================================================== ---- sope-mime/NGMime/NGMimePartParser.h (révision 1619) +--- sope-mime/NGMime/NGMimePartParser.h (révision 1620) +++ sope-mime/NGMime/NGMimePartParser.h (copie de travail) @@ -117,6 +117,7 @@ BOOL parserParseRawBodyDataOfPart:1; @@ -1163,7 +985,7 @@ Index: sope-mime/NGMime/NGMimePartParser.h @interface NSObject(NGMimePartParser) Index: sope-mime/NGMime/NGMimePartParser.m =================================================================== ---- sope-mime/NGMime/NGMimePartParser.m (révision 1619) +--- sope-mime/NGMime/NGMimePartParser.m (révision 1620) +++ sope-mime/NGMime/NGMimePartParser.m (copie de travail) @@ -227,7 +227,7 @@ } @@ -1188,7 +1010,7 @@ Index: sope-mime/NGMime/NGMimePartParser.m : [NGMimeType mimeType:[ctype stringValue]]; Index: sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m =================================================================== ---- sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m (révision 1619) +--- sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m (révision 1620) +++ sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m (copie de travail) @@ -130,8 +130,13 @@ @@ -1219,7 +1041,7 @@ Index: sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m bufLen = [data length]; Index: sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m =================================================================== ---- sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (révision 1619) +--- sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (révision 1620) +++ sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (copie de travail) @@ -49,80 +49,70 @@ @@ -1353,9 +1175,314 @@ Index: sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m } return data; } +Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m +=================================================================== +--- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1620) ++++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (copie de travail) +@@ -713,6 +713,39 @@ + return ms; + } + ++/* GCSEOAdaptorChannel protocol */ ++static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n" \ ++ @" c_name VARCHAR (256) NOT NULL,\n" ++ @" c_content VARCHAR (100000) NOT NULL,\n" ++ @" c_creationdate INT4 NOT NULL,\n" ++ @" c_lastmodified INT4 NOT NULL,\n" ++ @" c_version INT4 NOT NULL,\n" ++ @" c_deleted INT4 NULL\n" ++ @")"); ++static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n" \ ++ @" c_uid VARCHAR (256) NOT NULL,\n" ++ @" c_object VARCHAR (256) NOT NULL,\n" ++ @" c_role VARCHAR (80) NOT NULL\n" ++ @")"); ++ ++- (NSException *) createGCSFolderTableWithName: (NSString *) tableName ++{ ++ NSString *sql; ++ ++ sql = [NSString stringWithFormat: sqlFolderFormat, tableName]; ++ ++ return [self evaluateExpressionX: sql]; ++} ++ ++- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName ++{ ++ NSString *sql; ++ ++ sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName]; ++ ++ return [self evaluateExpressionX: sql]; ++} ++ + @end /* PostgreSQL72Channel */ + + @implementation PostgreSQL72Channel(PrimaryKeyGeneration) +Index: sope-gdl1/Oracle8/OracleAdaptorChannel.m +=================================================================== +--- sope-gdl1/Oracle8/OracleAdaptorChannel.m (révision 1620) ++++ sope-gdl1/Oracle8/OracleAdaptorChannel.m (copie de travail) +@@ -30,6 +30,7 @@ + + #import + ++static BOOL debugOn = NO; + // + // + // +@@ -41,10 +42,19 @@ + + @implementation OracleAdaptorChannel (Private) + +-- (void) _cleanup +++ (void) initialize + { ++ NSUserDefaults *ud; ++ ++ ud = [NSUserDefaults standardUserDefaults]; ++ debugOn = [ud boolForKey: @"OracleAdaptorDebug"]; ++} ++ ++- (void) _cleanup ++{ + column_info *info; + int c; ++ sword result; + + [_resultSetProperties removeAllObjects]; + +@@ -58,11 +68,29 @@ + // so we just free the value instead. + if (info->value) + { +- if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS) ++ if (info->type == SQLT_CLOB ++ || info->type == SQLT_BLOB ++ || info->type == SQLT_BFILEE ++ || info->type == SQLT_CFILEE) ++ { ++ result = OCIDescriptorFree((dvoid *)info->value, (ub4) OCI_DTYPE_LOB); ++ if (result != OCI_SUCCESS) ++ { ++ NSLog (@"value was not a LOB descriptor"); ++ abort(); ++ } ++ } ++ else + free(info->value); + info->value = NULL; + } +- free(info); ++ else ++ { ++ NSLog (@"trying to free an already freed value!"); ++ abort(); ++ } ++ free(info); ++ + [_row_buffer removeObjectAtIndex: c]; + } + +@@ -231,6 +259,9 @@ + + [self _cleanup]; + ++ if (debugOn) ++ [self logWithFormat: @"expression: %@", theExpression]; ++ + if (!theExpression || ![theExpression length]) + { + [NSException raise: @"OracleInvalidExpressionException" +@@ -302,7 +333,9 @@ + // We read the maximum width of a column + info->max_width = 0; + status = OCIAttrGet((dvoid*)param, (ub4)OCI_DTYPE_PARAM, (dvoid*)&(info->max_width), (ub4 *)0, (ub4)OCI_ATTR_DATA_SIZE, (OCIError *)_oci_err); +- ++ ++ if (debugOn) ++ NSLog(@"name: %s, type: %d", cname, info->type); + attribute = [EOAttribute attributeWithOracleType: info->type name: cname length: clen width: info->max_width]; + [_resultSetProperties addObject: attribute]; + +Index: sope-gdl1/Oracle8/OracleAdaptorChannelController.m +=================================================================== +--- sope-gdl1/Oracle8/OracleAdaptorChannelController.m (révision 1620) ++++ sope-gdl1/Oracle8/OracleAdaptorChannelController.m (copie de travail) +@@ -31,6 +31,8 @@ + #import + #import + ++static BOOL debugOn = NO; ++ + // + // + // +@@ -48,6 +50,14 @@ + // + @implementation OracleAdaptorChannelController + +++ (void) initialize ++{ ++ NSUserDefaults *ud; ++ ++ ud = [NSUserDefaults standardUserDefaults]; ++ debugOn = [ud boolForKey: @"OracleAdaptorDebug"]; ++} ++ + - (EODelegateResponse) adaptorChannel: (id) theChannel + willInsertRow: (NSMutableDictionary *) theRow + forEntity: (EOEntity *) theEntity +@@ -56,7 +66,8 @@ + NSArray *keys; + int i, c; + +- NSLog(@"willInsertRow: %@ %@", [theRow description], [theEntity description]); ++ if (debugOn) ++ NSLog(@"willInsertRow: %@ %@", [theRow description], [theEntity description]); + + s = AUTORELEASE([[NSMutableString alloc] init]); + +@@ -101,7 +112,8 @@ + NSArray *keys; + int i, c; + +- NSLog(@"willUpdatetRow: %@ %@", [theRow description], [theQualifier description]); ++ if (debugOn) ++ NSLog(@"willUpdateRow: %@ %@", [theRow description], [theQualifier description]); + + s = AUTORELEASE([[NSMutableString alloc] init]); + +Index: sope-core/NGExtensions/NGExtensions/NSString+Ext.h +=================================================================== +--- sope-core/NGExtensions/NGExtensions/NSString+Ext.h (révision 1620) ++++ sope-core/NGExtensions/NGExtensions/NSString+Ext.h (copie de travail) +@@ -30,6 +30,7 @@ + + @interface NSString(GSAdditions) + ++#if !GNUSTEP + - (NSString *)stringWithoutPrefix:(NSString *)_prefix; + - (NSString *)stringWithoutSuffix:(NSString *)_suffix; + +@@ -39,6 +40,7 @@ + - (NSString *)stringByTrimmingLeadSpaces; + - (NSString *)stringByTrimmingTailSpaces; + - (NSString *)stringByTrimmingSpaces; ++#endif /* !GNUSTEP */ + + /* the following are not available in gstep-base 1.6 ? */ + - (NSString *)stringByTrimmingLeadWhiteSpaces; +@@ -47,6 +49,8 @@ + + @end /* NSString(GSAdditions) */ + ++#if !GNUSTEP ++ + @interface NSMutableString(GNUstepCompatibility) + + - (void)trimLeadSpaces; +@@ -55,6 +59,8 @@ + + @end /* NSMutableString(GNUstepCompatibility) */ + ++#endif /* !GNUSTEP */ ++ + #endif + + /* specific to libFoundation */ +Index: sope-core/NGExtensions/FdExt.subproj/NSString+Ext.m +=================================================================== +--- sope-core/NGExtensions/FdExt.subproj/NSString+Ext.m (révision 1620) ++++ sope-core/NGExtensions/FdExt.subproj/NSString+Ext.m (copie de travail) +@@ -39,18 +39,6 @@ + : (NSString *)[[self copy] autorelease]; + } + +-- (NSString *)stringByReplacingString:(NSString *)_orignal +- withString:(NSString *)_replacement +-{ +- /* very slow solution .. */ +- +- if ([self rangeOfString:_orignal].length == 0) +- return [[self copy] autorelease]; +- +- return [[self componentsSeparatedByString:_orignal] +- componentsJoinedByString:_replacement]; +-} +- + - (NSString *)stringByTrimmingLeadWhiteSpaces + { + // should check 'whitespaceAndNewlineCharacterSet' .. +@@ -96,6 +84,25 @@ + return [[self copy] autorelease]; + } + ++- (NSString *)stringByTrimmingWhiteSpaces ++{ ++ return [[self stringByTrimmingTailWhiteSpaces] ++ stringByTrimmingLeadWhiteSpaces]; ++} ++ ++#ifndef GNUSTEP ++- (NSString *)stringByReplacingString:(NSString *)_orignal ++ withString:(NSString *)_replacement ++{ ++ /* very slow solution .. */ ++ ++ if ([self rangeOfString:_orignal].length == 0) ++ return [[self copy] autorelease]; ++ ++ return [[self componentsSeparatedByString:_orignal] ++ componentsJoinedByString:_replacement]; ++} ++ + - (NSString *)stringByTrimmingLeadSpaces + { + unsigned len; +@@ -117,6 +124,7 @@ + else + return [[self copy] autorelease]; + } ++ + - (NSString *)stringByTrimmingTailSpaces + { + unsigned len; +@@ -139,19 +147,17 @@ + return [[self copy] autorelease]; + } + +-- (NSString *)stringByTrimmingWhiteSpaces +-{ +- return [[self stringByTrimmingTailWhiteSpaces] +- stringByTrimmingLeadWhiteSpaces]; +-} + - (NSString *)stringByTrimmingSpaces + { + return [[self stringByTrimmingTailSpaces] + stringByTrimmingLeadSpaces]; + } ++#endif + + @end /* NSString(GSAdditions) */ + ++#if !GNUSTEP ++ + @implementation NSMutableString(GNUstepCompatibility) + + - (void)trimLeadSpaces +@@ -169,6 +175,8 @@ + + @end /* NSMutableString(GNUstepCompatibility) */ + ++#endif /* !GNUSTEP */ ++ + @implementation NSString(lfNSURLUtilities) + + - (BOOL)isAbsoluteURL Index: sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m =================================================================== ---- sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (révision 1619) +--- sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (révision 1620) +++ sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (copie de travail) @@ -140,8 +140,12 @@ @@ -1398,7 +1525,7 @@ Index: sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m static char *iconv_wrapper(id self, char *_src, unsigned _srcLen, Index: sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m =================================================================== ---- sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m (révision 1619) +--- sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m (révision 1620) +++ sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m (copie de travail) @@ -19,6 +19,7 @@ 02111-1307, USA. @@ -1410,7 +1537,7 @@ Index: sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h =================================================================== ---- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h (révision 1619) +--- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h (révision 1620) +++ sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h (copie de travail) @@ -19,6 +19,8 @@ 02111-1307, USA. @@ -1432,7 +1559,7 @@ Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h id entityResolver; Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m =================================================================== ---- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m (révision 1619) +--- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m (révision 1620) +++ sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m (copie de travail) @@ -30,6 +30,12 @@ #include @@ -1490,9 +1617,31 @@ Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m self->doc = NULL; } - (void)tearDownParser { +Index: sope-xml/libxmlSAXDriver/libxmlSAXDriver.m +=================================================================== +--- sope-xml/libxmlSAXDriver/libxmlSAXDriver.m (révision 1620) ++++ sope-xml/libxmlSAXDriver/libxmlSAXDriver.m (copie de travail) +@@ -614,7 +614,7 @@ + xmlParseDocument(ctxt); + + if (!(((xmlParserCtxtPtr)self->ctxt)->wellFormed)) +- NSLog(@"%@: not well formed", _sysId); ++ NSLog(@"%@: not well formed 1", _sysId); + + if (((xmlParserCtxtPtr)self->ctxt)->input != NULL && [_sysId length] > 0) { + ((xmlParserInputPtr)((xmlParserCtxtPtr)self->ctxt)->input)->filename +@@ -737,7 +737,7 @@ + } + + if (!(((xmlParserCtxtPtr)self->ctxt)->wellFormed)) +- NSLog(@"%@: not well formed", _sysId); ++ NSLog(@"%@: not well formed 2", _sysId); + + ((xmlParserCtxtPtr)self->ctxt)->sax = NULL; + xmlFreeParserCtxt(self->ctxt); Index: sope-appserver/mod_ngobjweb/config.c =================================================================== ---- sope-appserver/mod_ngobjweb/config.c (révision 1619) +--- sope-appserver/mod_ngobjweb/config.c (révision 1620) +++ sope-appserver/mod_ngobjweb/config.c (copie de travail) @@ -21,7 +21,7 @@ @@ -1503,21 +1652,9 @@ Index: sope-appserver/mod_ngobjweb/config.c static char *_makeString(char *buf, char *str, int max) { if (buf == NULL) -Index: sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c -=================================================================== ---- sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c (révision 1619) -+++ sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c (copie de travail) -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include "common.h" - #include "NGBufferedDescriptor.h" - - // returns the number of bytes which where read from the buffer Index: sope-appserver/mod_ngobjweb/GNUmakefile =================================================================== ---- sope-appserver/mod_ngobjweb/GNUmakefile (révision 1619) +--- sope-appserver/mod_ngobjweb/GNUmakefile (révision 1620) +++ sope-appserver/mod_ngobjweb/GNUmakefile (copie de travail) @@ -82,7 +82,7 @@ @@ -1528,102 +1665,31 @@ Index: sope-appserver/mod_ngobjweb/GNUmakefile LDFLAGS = $(APXS_LDFLAGS) $(APR_LDFLAGS) -shared -fPIC LDLIBS = $(APXS_LIBS) $(APR_LIBS) -Index: sope-appserver/mod_ngobjweb/handler.c -=================================================================== ---- sope-appserver/mod_ngobjweb/handler.c (révision 1619) -+++ sope-appserver/mod_ngobjweb/handler.c (copie de travail) -@@ -646,7 +646,10 @@ - - writeErrorHandler: - if (writeError == 1) { -- if (toApp) NGBufferedDescriptor_free(toApp); -+ if (toApp) { -+ NGBufferedDescriptor_free(toApp); -+ toApp = NULL; -+ } - - ap_log_error(__FILE__, __LINE__, APLOG_ERR, 0, r->server, - "socket write error during transfer of HTTP header section"); -@@ -659,7 +662,10 @@ - if (!NGBufferedDescriptor_safeWrite(toApp, - requestBody, - requestContentLength)) { -- if (toApp) NGBufferedDescriptor_free(toApp); -+ if (toApp) { -+ NGBufferedDescriptor_free(toApp); -+ toApp = NULL; -+ } - ap_log_error(__FILE__, __LINE__, APLOG_ERR, 0, r->server, - "couldn't transfer HTTP req body to app server (%i bytes)", - contentLength); -@@ -677,7 +683,10 @@ - /* read response line */ - - if (!NGScanResponseLine(toApp, NULL, &statusCode, NULL)) { -- if (toApp) NGBufferedDescriptor_free(toApp); -+ if (toApp) { -+ NGBufferedDescriptor_free(toApp); -+ toApp = NULL; -+ } - ap_log_error(__FILE__, __LINE__, APLOG_ERR, 0, r->server, - "error during reading of response line .."); - return 500; -@@ -716,13 +725,8 @@ - } - - // read whole response -- if (!NGBufferedDescriptor_safeRead(toApp, buffer, contentLength)) { -- if (toApp != NULL) { NGBufferedDescriptor_free(toApp); toApp = NULL; } -- } -+ NGBufferedDescriptor_safeRead(toApp, buffer, contentLength); +@@ -111,8 +111,7 @@ + apache-dir : + $(MKDIRS) $(GNUSTEP_INSTALLATION_DIR) -- // close connection to app -- if (toApp != NULL) { NGBufferedDescriptor_free(toApp); toApp = NULL; } -- - ap_log_error(__FILE__, __LINE__, APLOG_INFO, 0, r->server, - "send response (size=%i)", - contentLength); -@@ -736,15 +740,14 @@ - int result = 0; - int writeCount = 0; - -- do { -- result = NGBufferedDescriptor_read(toApp, buffer, sizeof(buffer)); -- if (result > 0) { -- ap_rwrite(buffer, result, r); -- ap_rflush(r); -- writeCount += result; -- } -+ while ((result = NGBufferedDescriptor_read(toApp, -+ buffer, -+ sizeof(buffer)) -+ > 0)) { -+ ap_rwrite(buffer, result, r); -+ ap_rflush(r); -+ writeCount += result; - } -- while (result > 0); +-install :: apache-dir all +- $(INSTALL_PROGRAM) $(product) $(GNUSTEP_INSTALLATION_DIR) ++install :: - if (HEAVY_LOG && (writeCount > 0)) { - ap_log_error(__FILE__, __LINE__, APLOG_INFO, 0, r->server, -@@ -753,7 +756,13 @@ - } - } - } -- -+ -+ // close connection to app -+ if (toApp) { -+ NGBufferedDescriptor_free(toApp); -+ toApp = NULL; -+ } -+ - return OK; - } + install-usr-libexec :: all + $(INSTALL_PROGRAM) $(product) /usr/libexec/httpd/ +Index: sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c +=================================================================== +--- sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c (révision 1620) ++++ sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c (copie de travail) +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include "common.h" + #include "NGBufferedDescriptor.h" + // returns the number of bytes which where read from the buffer Index: sope-appserver/NGObjWeb/GNUmakefile.postamble =================================================================== ---- sope-appserver/NGObjWeb/GNUmakefile.postamble (révision 1619) +--- sope-appserver/NGObjWeb/GNUmakefile.postamble (révision 1620) +++ sope-appserver/NGObjWeb/GNUmakefile.postamble (copie de travail) @@ -23,14 +23,20 @@ @@ -1655,7 +1721,7 @@ Index: sope-appserver/NGObjWeb/GNUmakefile.postamble + $(DESTDIR)/$(GNUSTEP_MAKEFILES)/wobundle.make Index: sope-appserver/NGObjWeb/WOContext.m =================================================================== ---- sope-appserver/NGObjWeb/WOContext.m (révision 1619) +--- sope-appserver/NGObjWeb/WOContext.m (révision 1620) +++ sope-appserver/NGObjWeb/WOContext.m (copie de travail) @@ -64,11 +64,13 @@ static BOOL testNSURLs = NO; @@ -1695,7 +1761,7 @@ Index: sope-appserver/NGObjWeb/WOContext.m serverURL = [@"http://" stringByAppendingString:host]; Index: sope-appserver/NGObjWeb/DAVPropMap.plist =================================================================== ---- sope-appserver/NGObjWeb/DAVPropMap.plist (révision 1619) +--- sope-appserver/NGObjWeb/DAVPropMap.plist (révision 1620) +++ sope-appserver/NGObjWeb/DAVPropMap.plist (copie de travail) @@ -120,17 +120,21 @@ "{http://ucb.openoffice.org/dav/props/}IsRemoveable" = isOOoRemoveable; @@ -1721,9 +1787,28 @@ Index: sope-appserver/NGObjWeb/DAVPropMap.plist /* CardDAV */ "{urn:ietf:params:xml:ns:carddav}supported-address-data" = +@@ -138,13 +142,13 @@ + "{urn:ietf:params:xml:ns:carddav}addressbook-description" = davDescription; + + /* Apple CalServer */ +- "{http://apple.com/ns/calendarserver/}dropbox-home-URL" = +- davDropboxHomeURL; +- "{http://apple.com/ns/calendarserver/}notifications-URL" = +- davNotificationsURL; +- "{com.apple.ical:}calendarcolor" = davCalendarColor; ++ "{http://calendarserver.org/ns/}dropbox-home-URL" = davDropboxHomeURL; ++ "{http://calendarserver.org/ns/}notifications-URL" = davNotificationsURL; + "{http://calendarserver.org/ns/}getctag" = davCollectionTag; + ++ /* Apple extensions */ ++ "{http://apple.com/ns/ical/}calendar-color" = davCalendarColor; ++ + /* GroupDAV */ + "{http://www.groupdav.org/}component-set" = gdavComponentSet; + "{http://groupdav.org/}component-set" = gdavComponentSet; Index: sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m =================================================================== ---- sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m (révision 1619) +--- sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m (révision 1620) +++ sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m (copie de travail) @@ -655,6 +655,7 @@ if (self->responses == nil) @@ -1735,7 +1820,7 @@ Index: sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m case 'n': Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m =================================================================== ---- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (révision 1619) +--- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (révision 1620) +++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (copie de travail) @@ -216,6 +216,12 @@ assocCount++; @@ -1752,7 +1837,7 @@ Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m Index: sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m =================================================================== ---- sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (révision 1619) +--- sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (révision 1620) +++ sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (copie de travail) @@ -41,6 +41,7 @@ WOAssociation *string; @@ -1785,7 +1870,7 @@ Index: sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m return NO; Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h =================================================================== ---- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (révision 1619) +--- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (révision 1620) +++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (copie de travail) @@ -41,7 +41,8 @@ WOAssociation *pageName; @@ -1799,7 +1884,7 @@ Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h /* 'ivar' associations */ Index: sope-appserver/NGObjWeb/SoObjects/SoObject.m =================================================================== ---- sope-appserver/NGObjWeb/SoObjects/SoObject.m (révision 1619) +--- sope-appserver/NGObjWeb/SoObjects/SoObject.m (révision 1620) +++ sope-appserver/NGObjWeb/SoObjects/SoObject.m (copie de travail) @@ -39,22 +39,34 @@ static int debugLookup = -1; @@ -1950,7 +2035,7 @@ Index: sope-appserver/NGObjWeb/SoObjects/SoObject.m Index: sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m =================================================================== ---- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (révision 1619) +--- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (révision 1620) +++ sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (copie de travail) @@ -32,6 +32,7 @@ #include diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 89d6b7f0..db9b6dcb 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -687,6 +687,7 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; { NSMutableArray *rolesForObject; NSArray *sogoRoles; + NSString *rqMethod; rolesForObject = [NSMutableArray new]; [rolesForObject autorelease]; @@ -708,6 +709,11 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; [rolesForObject addObject: SOGoRole_AuthorizedSubscriber]; } +#warning this is a hack to work-around the poor implementation of PROPPATCH in SOPE + rqMethod = [[context request] method]; + if ([rqMethod isEqualToString: @"PROPPATCH"]) + [rolesForObject addObject: @"PROPPATCHer"]; + return rolesForObject; } diff --git a/TODO b/TODO new file mode 100644 index 00000000..895f10a5 --- /dev/null +++ b/TODO @@ -0,0 +1,6 @@ +Rendering of multi-status responses is suboptimal in SOPE: + PROPPATCH "subresponses" indicates either complete failure or success + REPORT responses are handled by SOGo +Therefore it would be nice to refactor those things a little bit and maybe put +some code from SOGo up into SOPE. + -- wsourdeau@inverse.ca, Tue, 22 Apr 2008 15:21:32 -0400 diff --git a/UI/MainUI/product.plist b/UI/MainUI/product.plist index 952e5474..d00f74aa 100644 --- a/UI/MainUI/product.plist +++ b/UI/MainUI/product.plist @@ -20,7 +20,7 @@ defaultAccess = "allow"; defaultRoles = { "View" = ( "Owner", "ObjectViewer" ); - "Change Images And Files" = ( "Owner", "ObjectEditor" ); + "Change Images And Files" = ( "Owner", "ObjectEditor", "PROPPATCHer" ); "Access Object" = ( "Owner", "AuthorizedSubscriber" ); "Access Contents Information" = ( "Owner", "ObjectViewer" ); "Add Documents, Images, and Files" = ( "Owner", "ObjectCreator" ); @@ -55,7 +55,7 @@ superclass = "SOGoObject"; protectedBy = "Access Object"; defaultRoles = { - "Change Images And Files" = ( "Owner", "ObjectEditor" ); + "Change Images And Files" = ( "Owner", "ObjectEditor", "PROPPATCHer" ); "View" = ( "Owner", "ObjectViewer", "ObjectEditor" ); "Access Contents Information" = ( "Owner", "ObjectViewer", "ObjectEditor" ); "WebDAV Access" = ( "Authenticated", "AuthorizedSubscriber" ); diff --git a/UI/Scheduler/UIxCalendarSelector.m b/UI/Scheduler/UIxCalendarSelector.m index 82086547..a4ec65ef 100644 --- a/UI/Scheduler/UIxCalendarSelector.m +++ b/UI/Scheduler/UIxCalendarSelector.m @@ -36,6 +36,35 @@ #import "UIxCalendarSelector.h" +static inline unsigned int +_intValueFromHexChar (unichar hexChar) +{ + unichar base; + + if (hexChar >= '0' && hexChar <= '9') + base = '0'; + else if (hexChar >= 'A' && hexChar <= 'F') + base = 'A' - 10; + else + base = 'a' - 10; + + return (hexChar - base); +} + +static inline unsigned int +_intValueFromHex (NSString *hexString) +{ + unsigned int value, count, max; + + value = 0; + max = [hexString length]; + for (count = 0; count < max; count++) + value = (value * 16 + + _intValueFromHexChar([hexString characterAtIndex: count])); + + return value; +} + @implementation UIxCalendarSelector - (id) init @@ -87,8 +116,7 @@ forKey: @"id"]; [calendar setObject: fDisplayName forKey: @"displayName"]; [calendar setObject: folderName forKey: @"folder"]; - [calendar setObject: [folder calendarColor] - forKey: @"color"]; + [calendar setObject: [folder calendarColor] forKey: @"color"]; isActive = [NSNumber numberWithBool: [folder isActive]]; [calendar setObject: isActive forKey: @"active"]; [calendar setObject: [folder ownerInContext: context] @@ -124,6 +152,22 @@ keysWithFormat: @"color: %{color}; background-color: %{color};"]; } +/* code taken from Lightning 0.7 */ +- (NSString *) contrastingTextColor +{ + NSString *bgColor; + unsigned int red, green, blue; + float brightness; + + bgColor = [[currentCalendar objectForKey: @"color"] substringFromIndex: 1]; + red = _intValueFromHex ([bgColor substringFromRange: NSMakeRange (0, 2)]); + green = _intValueFromHex ([bgColor substringFromRange: NSMakeRange (2, 2)]); + blue = _intValueFromHex ([bgColor substringFromRange: NSMakeRange (4, 2)]); + brightness = (0.299 * red) + (0.587 * green) + (0.114 * blue); + + return ((brightness < 144) ? @"white" : @"black"); +} + - (WOResponse *) calendarsListAction { WOResponse *response; diff --git a/UI/Templates/SchedulerUI/UIxCalendarSelector.wox b/UI/Templates/SchedulerUI/UIxCalendarSelector.wox index a02893ff..245f7a8f 100644 --- a/UI/Templates/SchedulerUI/UIxCalendarSelector.wox +++ b/UI/Templates/SchedulerUI/UIxCalendarSelector.wox @@ -9,7 +9,7 @@