]> err.no Git - sope/commitdiff
minor url optimization
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Fri, 8 Oct 2004 12:48:57 +0000 (12:48 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Fri, 8 Oct 2004 12:48:57 +0000 (12:48 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@233 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-appserver/NGObjWeb/ChangeLog
sope-appserver/NGObjWeb/Version
sope-appserver/NGObjWeb/WebDAV/SoObjectDataSource.m

index 546a80623ccfbcb43e60de4ac7f6ff54c1d2b78e..4313bbe89d0db6d427eb9f2f646c13077ce0929b 100644 (file)
@@ -1,5 +1,8 @@
 2004-10-08  Helge Hess  <helge.hess@opengroupware.org>
 
+       * WebDAV/SoObjectDataSource.m: minor optimization to URL generation
+         (v4.3.56)
+
        * v4.3.55
 
        * WebDAV/SoObjectResultEntry.m, WebDAV/SoWebDAVRenderer.m: improved
index 178036b284ce6d9daa1af4544742313162fb38b2..ccd73ff08953feede4a47471aa6ac4dfebd260c3 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=55
+SUBMINOR_VERSION:=56
 
 # v4.3.42  requires libNGExtensions v4.3.116
 # v4.3.40  requires libNGExtensions v4.3.115
index ba75731373a6a013aebd75f2f7b0d4d0ac982f1f..477ab3d76968950ea1c00711dbdade9b25737214 100644 (file)
@@ -24,6 +24,8 @@
 #include "SoObject+SoDAV.h"
 #include "SoObject.h"
 #include "EOFetchSpecification+SoDAV.h"
+#include <NGObjWeb/WEClientCapabilities.h>
+#include <NGObjWeb/WOContext.h>
 #include <EOControl/EOQualifier.h>
 #include <EOControl/EOSortOrdering.h>
 #include "common.h"
@@ -97,10 +99,21 @@ static BOOL debugOn = NO;
   NSArray      *queriedAttrNames;
   NSArray      *orderings;
   NSString     *childKey;
-  NSString     *tmp;
+  BOOL         doEscape;
+  NSString     *entityURL;
   BOOL         isBrief = YES; // do not encode "sub-errors", just omit the item
   
   [self debugWithFormat:@"performing flat query: %@", _fs];
+
+  /* base URL */
+
+  entityURL = [_fs entityName];
+  if (![entityURL hasSuffix:@"/"]) 
+    entityURL = [entityURL stringByAppendingString:@"/"];
+  
+  doEscape = YES;
+  
+  /* retrieve child names (calls -toOneRelationshipKeys and -toManyRel...) */
   
   childKeys = [self->object davChildKeysInContext:_ctx];
   
@@ -185,11 +198,8 @@ static BOOL debugOn = NO;
        Note: we cannot use NSPathUtilities, those will reformat the string on
              Cocoa Foundation! (eg http://a => http:/a, remove double slashes)
     */
-    childHref = [childKey stringByEscapingURL];
-    tmp = [_fs entityName];
-    if (![tmp hasSuffix:@"/"]) 
-      tmp = [tmp stringByAppendingString:@"/"];
-    childHref = [tmp stringByAppendingString:childHref];
+    childHref = doEscape ? [childKey stringByEscapingURL] : childKey;
+    childHref = [entityURL stringByAppendingString:childHref];
     
     if (debugOn) {
       // TODO: this happens if we access using Goliath