]> err.no Git - scalable-opengroupware.org/blob - SOPE/sope-patchset-r1546.diff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1219 d1b88da0-ebda-0310...
[scalable-opengroupware.org] / SOPE / sope-patchset-r1546.diff
1 Index: sope-mime/NGImap4/NGImap4Connection.m
2 ===================================================================
3 --- sope-mime/NGImap4/NGImap4Connection.m       (révision 1546)
4 +++ sope-mime/NGImap4/NGImap4Connection.m       (copie de travail)
5 @@ -381,7 +381,7 @@
6    
7    if (debugCache) [self logWithFormat:@"  no folders cached yet .."];
8    
9 -  result = [[self client] list:(onlyFetchInbox ? @"INBOX" : @"*")
10 +  result = [[self client] list:(onlyFetchInbox ? @"INBOX" : @"")
11                           pattern:@"*"];
12    if (![[result valueForKey:@"result"] boolValue]) {
13      [self errorWithFormat:@"Could not list mailbox hierarchy!"];
14 Index: sope-mime/NGImap4/NGImap4ResponseNormalizer.m
15 ===================================================================
16 --- sope-mime/NGImap4/NGImap4ResponseNormalizer.m       (révision 1546)
17 +++ sope-mime/NGImap4/NGImap4ResponseNormalizer.m       (copie de travail)
18 @@ -648,14 +648,13 @@
19    enumerator = [_flags objectEnumerator];
20    cnt = 0;
21    while ((obj = [enumerator nextObject])) {
22 -    if (![obj isNotEmpty])
23 -      continue;
24 -    
25 -    if (![[obj substringToIndex:1] isEqualToString:@"\\"])
26 -      continue;
27 -
28 -    objs[cnt] = [obj substringFromIndex:1];
29 -    cnt++;
30 +    if ([obj isNotEmpty]) {
31 +      if ([obj hasPrefix:@"\\"])
32 +       objs[cnt] = [obj substringFromIndex:1];
33 +      else
34 +       objs[cnt] = obj;
35 +      cnt++;
36 +    }
37    }
38    result = [NSArray arrayWithObjects:objs count:cnt];
39    if (objs) free(objs);
40 Index: sope-mime/NGImap4/NGImap4ResponseParser.m
41 ===================================================================
42 --- sope-mime/NGImap4/NGImap4ResponseParser.m   (révision 1546)
43 +++ sope-mime/NGImap4/NGImap4ResponseParser.m   (copie de travail)
44 @@ -84,6 +84,8 @@
45  static NSDictionary *_parseMultipartBody(NGImap4ResponseParser *self,
46                                          BOOL isBodyStructure);
47  
48 +static NSArray *_parseLanguages();
49 +
50  static NSString *_parseBodyString(NGImap4ResponseParser *self,
51                                    BOOL _convertString);
52  static NSString *_parseBodyDecodeString(NGImap4ResponseParser *self,
53 @@ -111,6 +113,7 @@
54  static NSNumber *_parseUnsigned(NGImap4ResponseParser *self);
55  static NSString *_parseUntil(NGImap4ResponseParser *self, char _c);
56  static NSString *_parseUntil2(NGImap4ResponseParser *self, char _c1, char _c2);
57 +static BOOL _endsWithCQuote(NSString *_string);
58  
59  static __inline__ NSException *_consumeIfMatch
60    (NGImap4ResponseParser *self, unsigned char _m);
61 @@ -649,12 +652,31 @@
62  }
63  
64  - (NSString *)_parseQuotedString {
65 +  NSMutableString *quotedString;
66 +  NSString *tmpString;
67 +  BOOL stop;
68 +
69    /* parse a quoted string, eg '"' */
70    if (_la(self, 0) == '"') {
71      _consume(self, 1);
72 -    return _parseUntil(self, '"');
73 +    quotedString = [NSMutableString string];
74 +    stop = NO;
75 +    while (!stop) {
76 +      tmpString = _parseUntil(self, '"');
77 +      [quotedString appendString: tmpString];
78 +      if(_endsWithCQuote(tmpString)) {
79 +       [quotedString deleteSuffix: @"\\"];
80 +       [quotedString appendString: @"\""];
81 +      }
82 +      else {
83 +       stop = YES;
84 +      }
85 +    }
86    }
87 -  return nil;
88 +  else {
89 +    quotedString = nil;
90 +  }
91 +  return quotedString;
92  }
93  - (void)_consumeOptionalSpace {
94    if (_la(self, 0) == ' ') _consume(self, 1);
95 @@ -1185,7 +1207,7 @@
96    route   = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace];
97    mailbox = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace];
98    host    = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace];
99 -  
100 +
101    if (_la(self, 0) != ')') {
102      [self logWithFormat:@"WARNING: IMAP4 envelope "
103             @"address not properly closed (c0=%c,c1=%c): %@",
104 @@ -1197,6 +1219,7 @@
105    address = [[NGImap4EnvelopeAddress alloc] initWithPersonalName:pname
106                                             sourceRoute:route mailbox:mailbox
107                                             host:host];
108 +
109    return address;
110  }
111  
112 @@ -1627,6 +1650,29 @@
113    return _parseBodyDecodeString(self, _convertString, NO /* no decode */);
114  }
115  
116 +static NSArray *_parseLanguages(NGImap4ResponseParser *self) {
117 +  NSMutableArray *languages;
118 +  NSString *language;
119 +
120 +  languages = [NSMutableArray array];
121 +  if (_la(self, 0) == '(') {
122 +    while (_la(self, 0) != ')') {
123 +      _consume(self,1);
124 +      language = _parseBodyString(self, YES);
125 +      if ([language length])
126 +       [languages addObject: language];
127 +    }
128 +    _consume(self,1);
129 +  }
130 +  else {
131 +    language = _parseBodyString(self, YES);
132 +    if ([language length])
133 +      [languages addObject: language];
134 +  }
135 +
136 +  return languages;
137 +}
138 +
139  static NSDictionary *_parseBodyParameterList(NGImap4ResponseParser *self)
140  {
141    NSMutableDictionary *list;
142 @@ -1734,10 +1780,11 @@
143                       *encoding, *bodysize;
144    NSDictionary        *parameterList;
145    NSMutableDictionary *dict;
146 +  NSArray            *languages;
147  
148    type = [_parseBodyString(self, YES) lowercaseString];
149    _consumeIfMatch(self, ' ');
150 -  subtype = _parseBodyString(self, YES);
151 +  subtype = [_parseBodyString(self, YES) lowercaseString];
152    _consumeIfMatch(self, ' ');
153    parameterList = _parseBodyParameterList(self);
154    _consumeIfMatch(self, ' ');
155 @@ -1762,7 +1809,8 @@
156      _consumeIfMatch(self, ' ');
157      [dict setObject:_parseBodyString(self, YES) forKey:@"lines"];
158    }
159 -  else if ([type isEqualToString:@"message"]) {
160 +  else if ([type isEqualToString:@"message"]
161 +          && [subtype isEqualToString:@"rfc822"]) {
162      if (_la(self, 0) != ')') {
163        _consumeIfMatch(self, ' ');
164        _consumeIfMatch(self, '(');
165 @@ -1805,14 +1853,9 @@
166               forKey: @"disposition"];
167         if (_la(self, 0) != ')') {
168           _consume(self,1);
169 -         if (_la(self, 0) == '(') {
170 -           [dict setObject: _parseBodyParameterList(self)
171 -                 forKey: @"language"];
172 -         }
173 -         else {
174 -           [dict setObject: _parseBodyString(self, YES)
175 -                 forKey: @"language"];
176 -         }
177 +         languages = _parseLanguages(self);
178 +         if ([languages count])
179 +           [dict setObject: languages forKey: @"languages"];
180           if (_la(self, 0) != ')') {
181             _consume(self,1);
182             [dict setObject: _parseBodyString(self, YES)
183 @@ -1829,6 +1872,7 @@
184  static NSDictionary *_parseMultipartBody(NGImap4ResponseParser *self,
185                                          BOOL isBodyStructure) {
186    NSMutableArray *parts;
187 +  NSArray       *languages;
188    NSString       *kind;
189    NSMutableDictionary *dict;
190  
191 @@ -1854,14 +1898,9 @@
192               forKey: @"disposition"];
193         if (_la(self, 0) != ')') {
194           _consume(self,1);
195 -         if (_la(self, 0) == '(') {
196 -           [dict setObject: _parseBodyParameterList(self)
197 -                 forKey: @"language"];
198 -         }
199 -         else {
200 -           [dict setObject: _parseBodyString(self, YES)
201 -                 forKey: @"language"];
202 -         }
203 +         languages = _parseLanguages(self);
204 +         if ([languages count])
205 +           [dict setObject: languages forKey: @"languages"];
206           if (_la(self, 0) != ')') {
207             _consume(self,1);
208             [dict setObject: _parseBodyString(self, YES)
209 @@ -2170,6 +2209,21 @@
210    }
211  }
212  
213 +static BOOL _endsWithCQuote(NSString *_string){
214 +  unsigned int quoteSlashes;
215 +  int pos;
216 +
217 +  quoteSlashes = 0;
218 +  pos = [_string length] - 1;
219 +  while (pos > -1
220 +        && [_string characterAtIndex: pos] == '\\') {
221 +    quoteSlashes++;
222 +    pos--;
223 +  }
224 +
225 +  return ((quoteSlashes % 2) == 1);
226 +}
227 +
228  - (NSException *)exceptionForFailedMatch:(unsigned char)_match
229    got:(unsigned char)_avail
230  {
231 Index: sope-mime/NGMime/NGMimeBodyPart.m
232 ===================================================================
233 --- sope-mime/NGMime/NGMimeBodyPart.m   (révision 1546)
234 +++ sope-mime/NGMime/NGMimeBodyPart.m   (copie de travail)
235 @@ -31,18 +31,6 @@
236    return 2;
237  }
238  
239 -static NGMimeType *defaultType = nil;
240 -
241 -+ (void)initialize {
242 -  static BOOL isInitialized = NO;
243 -  if (!isInitialized) {
244 -    isInitialized = YES;
245 -    
246 -    defaultType =
247 -      [[NGMimeType mimeType:@"text/plain; charset=us-ascii"] retain];
248 -  }
249 -}
250 -  
251  + (id)bodyPartWithHeader:(NGHashMap *)_header {
252    return [[[self alloc] initWithHeader:_header] autorelease];
253  }
254 @@ -156,13 +144,12 @@
255    if (!Fields)
256      Fields = (NGMimeHeaderNames *)[NGMimePartParser headerFieldNames];
257    
258 -  
259    type = [self->header objectForKey:Fields->contentType];
260    
261    if (![type isKindOfClass:[NGMimeType class]])
262      type = [NGMimeType mimeType:[type stringValue]];
263    
264 -  return (type != nil ? type : (id)defaultType);
265 +  return type;
266  }
267  
268  - (NSString *)contentId {
269 Index: sope-mime/NGMime/NGMimeBodyParser.m
270 ===================================================================
271 --- sope-mime/NGMime/NGMimeBodyParser.m (révision 1546)
272 +++ sope-mime/NGMime/NGMimeBodyParser.m (copie de travail)
273 @@ -67,7 +67,10 @@
274    if (_data == nil) return nil;
275    
276    ctype = [_part contentType];
277 -  
278 +  if (!ctype
279 +      && [_d respondsToSelector: @selector(parser:contentTypeOfPart:)])
280 +    ctype = [_d parser: self contentTypeOfPart: _part];
281 +
282    if (![ctype isKindOfClass:[NGMimeType class]])
283      ctype = [NGMimeType mimeType:[ctype stringValue]];
284    
285 Index: sope-mime/NGMime/NGMimePartParser.h
286 ===================================================================
287 --- sope-mime/NGMime/NGMimePartParser.h (révision 1546)
288 +++ sope-mime/NGMime/NGMimePartParser.h (copie de travail)
289 @@ -117,6 +117,7 @@
290      BOOL parserParseRawBodyDataOfPart:1;
291      BOOL parserBodyParserForPart:1;
292      BOOL parserDecodeBodyOfPart:1;
293 +    BOOL parserContentTypeOfPart:1;
294    } delegateRespondsTo;
295  
296    
297 @@ -275,6 +276,9 @@
298  - (id<NGMimeBodyParser>)parser:(NGMimePartParser *)_parser
299    bodyParserForPart:(id<NGMimePart>)_part;
300  
301 +- (NGMimeType *)parser:(id)_parser
302 +  contentTypeOfPart:(id<NGMimePart>)_part;
303 +
304  @end /* NSObject(NGMimePartParserDelegate) */
305  
306  @interface NSObject(NGMimePartParser)
307 Index: sope-mime/NGMime/NGMimePartParser.m
308 ===================================================================
309 --- sope-mime/NGMime/NGMimePartParser.m (révision 1546)
310 +++ sope-mime/NGMime/NGMimePartParser.m (copie de travail)
311 @@ -1091,7 +1091,10 @@
312    id<NGMimeBodyParser> bodyParser   = nil;
313    
314    ctype = [_p contentType];
315 -  
316 +  if (!ctype
317 +      && self->delegateRespondsTo.parserContentTypeOfPart)
318 +    ctype = [self->delegate parser: self contentTypeOfPart: _p];
319 +
320    contentType = ([ctype isKindOfClass:[NGMimeType class]])
321      ? ctype
322      : [NGMimeType mimeType:[ctype stringValue]];
323 Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m
324 ===================================================================
325 --- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m  (révision 1546)
326 +++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m  (copie de travail)
327 @@ -713,6 +713,39 @@
328    return ms;
329  }
330  
331 +/* GCSEOAdaptorChannel protocol */
332 +static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n"     \
333 +                                   @"  c_name VARCHAR (256) NOT NULL,\n"
334 +                                   @"  c_content VARCHAR (100000) NOT NULL,\n"
335 +                                   @"  c_creationdate INT4 NOT NULL,\n"
336 +                                   @"  c_lastmodified INT4 NOT NULL,\n"
337 +                                   @"  c_version INT4 NOT NULL,\n"
338 +                                   @"  c_deleted INT4 NULL\n"
339 +                                   @")");
340 +static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n"  \
341 +                                      @"  c_uid VARCHAR (256) NOT NULL,\n"
342 +                                      @"  c_object VARCHAR (256) NOT NULL,\n"
343 +                                      @"  c_role VARCHAR (80) NOT NULL\n"
344 +                                      @")");
345 +
346 +- (NSException *) createGCSFolderTableWithName: (NSString *) tableName
347 +{
348 +  NSString *sql;
349 +
350 +  sql = [NSString stringWithFormat: sqlFolderFormat, tableName];
351 +
352 +  return [self evaluateExpressionX: sql];
353 +}
354 +
355 +- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName
356 +{
357 +  NSString *sql;
358 +
359 +  sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName];
360 +
361 +  return [self evaluateExpressionX: sql];
362 +}
363 +
364  @end /* PostgreSQL72Channel */
365  
366  @implementation PostgreSQL72Channel(PrimaryKeyGeneration)
367 Index: sope-gdl1/Oracle8/GNUmakefile
368 ===================================================================
369 --- sope-gdl1/Oracle8/GNUmakefile       (révision 1546)
370 +++ sope-gdl1/Oracle8/GNUmakefile       (copie de travail)
371 @@ -28,15 +28,23 @@
372  SOPE_ROOT=../..
373  ORACLE_VERSION=10.2.0.3
374  #ORACLE_VERSION=11.1.0.1
375 -ADDITIONAL_INCLUDE_DIRS += -I../GDLAccess -I.. -I/usr/include/oracle/$(ORACLE_VERSION)/client
376 +ADDITIONAL_INCLUDE_DIRS += -I../../sope-core -I../../sope-core/NGExtensions -I../GDLAccess -I.. -I/usr/include/oracle/$(ORACLE_VERSION)/client
377  
378 +local_arch = $(subst 64,,$(shell uname -m))
379 +
380 +ifeq ($(local_arch),ppc)
381 +PPC_LDFLAGS=-L/opt/ibmcmp/lib -libmc++ -l$(local_arch)
382 +else
383 +PPC_LDFLAGS=
384 +endif
385 +
386  ifneq ($(frameworks),yes)
387 -Oracle8_BUNDLE_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -lGDLAccess -lEOControl
388 -otest_TOOL_LIBS   += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -lGDLAccess -lEOControl
389 +common_LIBS = -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -L../GDLAccess/obj -lGDLAccess -L../../sope-core/EOControl/obj -lEOControl $(PPC_LDFLAGS)
390  else
391 -Oracle8_BUNDLE_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl
392 -otest_TOOL_LIBS   += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl
393 +common_LIBS = -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl $(PPC_LDFLAGS)
394  endif
395 +Oracle8_BUNDLE_LIBS += $(common_LIBS)
396 +otest_TOOL_LIBS   += $(common_LIBS)
397  
398  # Bundle
399  BUNDLE_NAME = Oracle8
400 Index: sope-gdl1/Oracle8/OracleAdaptorChannel.m
401 ===================================================================
402 --- sope-gdl1/Oracle8/OracleAdaptorChannel.m    (révision 1546)
403 +++ sope-gdl1/Oracle8/OracleAdaptorChannel.m    (copie de travail)
404 @@ -57,10 +57,15 @@
405  
406        // We free our LOB object. If it fails, it likely mean it isn't a LOB
407        // so we just free the value instead.
408 -      if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS)
409 -       {
410 -         free(info->value);
411 -       }
412 +      if (info)
413 +       {
414 +         if (info->value && OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS)
415 +           {
416 +             free(info->value);
417 +             info->value = NULL;
418 +           }
419 +         free(info);
420 +       }
421      }
422  
423    OCIHandleFree(_current_stm, OCI_HTYPE_STMT);
424 @@ -138,6 +143,14 @@
425         {
426           NSLog(@"FAILED: OCITerminate()");
427         }
428 +
429 +      OCIHandleFree(_oci_ctx, OCI_HTYPE_SVCCTX);
430 +      OCIHandleFree(_oci_err, OCI_HTYPE_ERROR);
431 +      OCIHandleFree(_oci_env, OCI_HTYPE_ENV);
432 +
433 +      _oci_ctx = (OCISvcCtx *)0;
434 +      _oci_err = (OCIError *)0;
435 +      _oci_env = (OCIEnv *)0;
436      }
437  }
438  
439 @@ -151,11 +164,6 @@
440    [self _cleanup];
441  
442    RELEASE(_resultSetProperties);
443 -
444 -  OCIHandleFree(_oci_ctx, OCI_HTYPE_SVCCTX);
445 -  OCIHandleFree(_oci_err, OCI_HTYPE_ERROR);
446 -  OCIHandleFree(_oci_env, OCI_HTYPE_ENV);
447 -
448    RELEASE(delegate);
449  
450    [super dealloc];
451 Index: sope-appserver/NGObjWeb/GNUmakefile.postamble
452 ===================================================================
453 --- sope-appserver/NGObjWeb/GNUmakefile.postamble       (révision 1546)
454 +++ sope-appserver/NGObjWeb/GNUmakefile.postamble       (copie de travail)
455 @@ -23,14 +23,20 @@
456  
457  # install makefiles
458  
459 -after-install ::
460 +after-install :: $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/Additional/ngobjweb.make
461 +
462 +ifneq ($(GNUSTEP_MAKE_VERSION),1.3.0)
463 +after-install :: $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/woapp.make $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/wobundle.make
464 +endif
465 +
466 +$(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/Additional/ngobjweb.make: ngobjweb.make
467         $(MKDIRS) $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/Additional/
468         $(INSTALL_DATA) ngobjweb.make $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/Additional/ngobjweb.make
469  
470 -ifneq ($(GNUSTEP_MAKE_VERSION),1.3.0)
471 -after-install ::
472 +$(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/woapp.make: woapp-gs.make
473         $(INSTALL_DATA) woapp-gs.make    \
474                 $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/woapp.make
475 +
476 +$(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/wobundle.make: wobundle-gs.make
477         $(INSTALL_DATA) wobundle-gs.make \
478                 $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/wobundle.make
479 -endif
480 Index: sope-appserver/NGObjWeb/WOContext.m
481 ===================================================================
482 --- sope-appserver/NGObjWeb/WOContext.m (révision 1546)
483 +++ sope-appserver/NGObjWeb/WOContext.m (copie de travail)
484 @@ -64,11 +64,13 @@
485  static BOOL     testNSURLs           = NO;
486  static BOOL     newCURLStyle         = NO;
487  static NSString *WOApplicationSuffix = nil;
488 +static NSURL    *redirectURL         = nil;
489  
490  + (void)initialize {
491    static BOOL    didInit = NO;
492    NSUserDefaults *ud;
493    NSString       *cn;
494 +  NSString       *url;
495  
496    if (didInit) return;
497  
498 @@ -91,6 +93,9 @@
499    debugCursor         = [ud boolForKey:@"WODebugCursor"] ? 1 : 0;
500    debugComponentAwake = [ud boolForKey:@"WODebugComponentAwake"];
501    WOApplicationSuffix = [[ud stringForKey:@"WOApplicationSuffix"] copy];
502 +  url                 = [ud stringForKey:@"WOApplicationRedirectURL"];
503 +  if (url != nil)
504 +    redirectURL       = [NSURL URLWithString: url];
505  }
506  
507  + (id)contextWithRequest:(WORequest *)_r {
508 @@ -503,6 +508,11 @@
509      return nil;
510    }
511    
512 +  if (redirectURL) {
513 +    // Use URL from user defaults (WOApplicationRedirectURL)
514 +    return redirectURL;
515 +  }
516 +  
517    if ((serverURL = [rq headerForKey:@"x-webobjects-server-url"]) == nil) {
518      if ((host = [rq headerForKey:@"host"]))
519        serverURL = [@"http://" stringByAppendingString:host];
520 Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m
521 ===================================================================
522 --- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m   (révision 1546)
523 +++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m   (copie de travail)
524 @@ -216,6 +216,12 @@
525        assocCount++;
526      }
527    }
528 +  if (count > 0) {
529 +    if ((self->isAbsolute = OWGetProperty(_config, @"absolute"))) {
530 +      count--;
531 +      assocCount++;
532 +    }
533 +  }
534    
535    self->rest = _config;
536    
537 Index: sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m
538 ===================================================================
539 --- sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m       (révision 1546)
540 +++ sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m       (copie de travail)
541 @@ -40,6 +40,7 @@
542    WOAssociation *string;
543    WOAssociation *target;
544    WOAssociation *disabled;
545 +  WOAssociation *isAbsolute;
546    WOElement     *template;
547    
548    /* new in WO4: */
549 @@ -359,6 +360,7 @@
550  {
551    if ((self = [super initWithName:_name hyperlinkInfo:_info template:_t])) {
552      self->href = _info->href;
553 +    self->isAbsolute = _info->isAbsolute;
554    }
555    return self;
556  }
557 @@ -374,6 +376,9 @@
558    // TODO: we need a binding to disable rewriting!
559    NSRange  r;
560    
561 +  if ([[self->isAbsolute valueInContext:_ctx] boolValue] == YES)
562 +    return NO;
563 +
564    r = [_s rangeOfString:@":"];
565    if (r.length == 0) 
566      return YES;
567 Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h
568 ===================================================================
569 --- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h   (révision 1546)
570 +++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h   (copie de travail)
571 @@ -41,7 +41,8 @@
572    WOAssociation *pageName;
573    WOAssociation *actionClass;
574    WOAssociation *directActionName;
575 -  
576 +  WOAssociation *isAbsolute;
577 +
578    BOOL          sidInUrl;
579  
580    /* 'ivar' associations */
581 Index: sope-appserver/NGObjWeb/SoObjects/SoObject.m
582 ===================================================================
583 --- sope-appserver/NGObjWeb/SoObjects/SoObject.m        (révision 1546)
584 +++ sope-appserver/NGObjWeb/SoObjects/SoObject.m        (copie de travail)
585 @@ -39,22 +39,34 @@
586  static int debugLookup  = -1;
587  static int debugBaseURL = -1;
588  static int useRelativeURLs = -1;
589 +static int redirectInitted = -1;
590 +static NSURL *redirectURL = nil;
591 +
592  static void _initialize(void) {
593 +  NSString *url;
594 +  NSUserDefaults *ud;
595 +
596 +  ud = [NSUserDefaults standardUserDefaults];
597 +
598    if (debugLookup == -1) {
599 -    debugLookup = [[NSUserDefaults standardUserDefaults]
600 -                                  boolForKey:@"SoDebugKeyLookup"] ? 1 : 0;
601 +    debugLookup = [ud boolForKey:@"SoDebugKeyLookup"] ? 1 : 0;
602      NSLog(@"Note(SoObject): SoDebugKeyLookup is enabled!");
603    }
604    if (debugBaseURL == -1) {
605 -    debugBaseURL = [[NSUserDefaults standardUserDefaults]
606 -                                    boolForKey:@"SoDebugBaseURL"] ? 1 : 0;
607 +    debugBaseURL = [ud boolForKey:@"SoDebugBaseURL"] ? 1 : 0;
608      NSLog(@"Note(SoObject): SoDebugBaseURL is enabled!");
609    }
610    if (useRelativeURLs == -1) {
611 -    useRelativeURLs = [[NSUserDefaults standardUserDefaults]
612 -                                      boolForKey:@"WOUseRelativeURLs"] ?1:0;
613 +    useRelativeURLs = [ud boolForKey:@"WOUseRelativeURLs"] ?1:0;
614      NSLog(@"Note(SoObject): relative base URLs are enabled.");
615    }
616 +  if (redirectInitted == -1) {
617 +    url = [ud stringForKey:@"WOApplicationRedirectURL"];
618 +    if ([url length]) {
619 +      redirectURL = [[NSURL alloc] initWithString: url];
620 +    }
621 +    redirectInitted = 1;
622 +  }
623  }
624  
625  /* classes */
626 @@ -318,56 +330,61 @@
627    
628    rq = [_ctx request];
629    ms = [[NSMutableString alloc] initWithCapacity:128];
630 +
631 +  if (redirectURL) {
632 +    [ms appendString: [redirectURL absoluteString]];
633 +  }
634 +  else {  
635 +    if (!useRelativeURLs) {
636 +      port = [[rq headerForKey:@"x-webobjects-server-port"] intValue];
637    
638 -  if (!useRelativeURLs) {
639 -    port = [[rq headerForKey:@"x-webobjects-server-port"] intValue];
640 -  
641 -    /* this is actually a bug in Apache */
642 -    if (port == 0) {
643 -      static BOOL didWarn = NO;
644 -      if (!didWarn) {
645 -       [self warnWithFormat:@"(%s:%i): got an empty port from Apache!",
646 -              __PRETTY_FUNCTION__, __LINE__];
647 -       didWarn = YES;
648 +      /* this is actually a bug in Apache */
649 +      if (port == 0) {
650 +       static BOOL didWarn = NO;
651 +       if (!didWarn) {
652 +         [self warnWithFormat:@"(%s:%i): got an empty port from Apache!",
653 +               __PRETTY_FUNCTION__, __LINE__];
654 +         didWarn = YES;
655 +       }
656 +       port = 80;
657        }
658 -      port = 80;
659 -    }
660    
661 -    if ((tmp = [rq headerForKey:@"host"]) != nil) { 
662 -      /* check whether we have a host header with port */
663 -      if ([tmp rangeOfString:@":"].length == 0)
664 -       tmp = nil;
665 -    }
666 -    if (tmp != nil) { /* we have a host header with port */
667 -      isHTTPS = 
668 -       [[rq headerForKey:@"x-webobjects-server-url"] hasPrefix:@"https"];
669 -      [ms appendString:isHTTPS ? @"https://" : @"http://"]; 
670 -      [ms appendString:tmp];
671 -    }
672 -    else if ((tmp = [rq headerForKey:@"x-webobjects-server-url"]) != nil) {
673 -      /* sometimes the URL is just wrong! (suggests port 80) */
674 -      if ([tmp hasSuffix:@":0"] && [tmp length] > 2) { // TODO: bad bad bad
675 -       [self warnWithFormat:@"%s: got incorrect URL from Apache: '%@'",
676 -             __PRETTY_FUNCTION__, tmp];
677 -       tmp = [tmp substringToIndex:([tmp length] - 2)];
678 +      if ((tmp = [rq headerForKey:@"host"]) != nil) { 
679 +       /* check whether we have a host header with port */
680 +       if ([tmp rangeOfString:@":"].length == 0)
681 +         tmp = nil;
682        }
683 -      else if ([tmp hasSuffix:@":443"] && [tmp hasPrefix:@"http://"]) {
684 -       /* see OGo bug #1435, Debian Apache hack */
685 -       [self warnWithFormat:@"%s: got 'http' protocol but 443 port, "
686 -             @"assuming Debian/Apache bug (OGo #1435): '%@'",
687 -             __PRETTY_FUNCTION__, tmp];
688 -       tmp = [tmp substringWithRange:NSMakeRange(4, [tmp length] - 4 - 4)];
689 -       tmp = [@"https" stringByAppendingString:tmp];
690 +      if (tmp != nil) { /* we have a host header with port */
691 +       isHTTPS = 
692 +         [[rq headerForKey:@"x-webobjects-server-url"] hasPrefix:@"https"];
693 +       [ms appendString:isHTTPS ? @"https://" : @"http://"]; 
694 +       [ms appendString:tmp];
695        }
696 -      [ms appendString:tmp];
697 -    }
698 -    else {
699 -      // TODO: isHTTPS always no in this case?
700 -      [ms appendString:isHTTPS ? @"https://" : @"http://"]; 
701 +      else if ((tmp = [rq headerForKey:@"x-webobjects-server-url"]) != nil) {
702 +       /* sometimes the URL is just wrong! (suggests port 80) */
703 +       if ([tmp hasSuffix:@":0"] && [tmp length] > 2) { // TODO: bad bad bad
704 +         [self warnWithFormat:@"%s: got incorrect URL from Apache: '%@'",
705 +               __PRETTY_FUNCTION__, tmp];
706 +         tmp = [tmp substringToIndex:([tmp length] - 2)];
707 +       }
708 +       else if ([tmp hasSuffix:@":443"] && [tmp hasPrefix:@"http://"]) {
709 +         /* see OGo bug #1435, Debian Apache hack */
710 +         [self warnWithFormat:@"%s: got 'http' protocol but 443 port, "
711 +               @"assuming Debian/Apache bug (OGo #1435): '%@'",
712 +               __PRETTY_FUNCTION__, tmp];
713 +         tmp = [tmp substringWithRange:NSMakeRange(4, [tmp length] - 4 - 4)];
714 +         tmp = [@"https" stringByAppendingString:tmp];
715 +       }
716 +       [ms appendString:tmp];
717 +      }
718 +      else {
719 +       // TODO: isHTTPS always no in this case?
720 +       [ms appendString:isHTTPS ? @"https://" : @"http://"]; 
721    
722 -      [ms appendString:[rq headerForKey:@"x-webobjects-server-name"]];
723 -      if ((isHTTPS ? (port != 443) : (port != 80)) && port != 0)
724 -       [ms appendFormat:@":%i", port];
725 +       [ms appendString:[rq headerForKey:@"x-webobjects-server-name"]];
726 +       if ((isHTTPS ? (port != 443) : (port != 80)) && port != 0)
727 +         [ms appendFormat:@":%i", port];
728 +      }
729      }
730    }
731    
732 Index: sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m
733 ===================================================================
734 --- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m   (révision 1546)
735 +++ sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m   (copie de travail)
736 @@ -31,6 +31,7 @@
737  #include <NGObjWeb/WOCookie.h>
738  #include <NGExtensions/NSData+gzip.h>
739  #include <NGHttp/NGHttp.h>
740 +#include <NGMime/NGMimeType.h>
741  #include "common.h"
742  
743  #include <string.h>
744 @@ -1016,6 +1017,12 @@
745  - (void)parser:(NGMimePartParser *)_parser didParseHeader:(NGHashMap *)_header {
746  }
747  
748 +- (NGMimeType *)parser:(id)_parser
749 +  contentTypeOfPart:(id<NGMimePart>)_part
750 +{
751 +  return [NGMimeType mimeType: @"text/plain; charset=utf-8"];
752 +}
753 +
754  @end /* WOHttpAdaptor */
755  
756  @implementation WOCoreApplication(SimpleParserSelection)