]> err.no Git - sope/commitdiff
minor code cleanups
authorznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Wed, 25 Jan 2006 16:14:16 +0000 (16:14 +0000)
committerznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Wed, 25 Jan 2006 16:14:16 +0000 (16:14 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1204 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-appserver/NGObjWeb/ChangeLog
sope-appserver/NGObjWeb/SoObjects/SoObject+Traversal.m
sope-appserver/NGObjWeb/Version

index 1274dd54d8261ab357e82a2ddf8f577476e3af92..adfb7394c7b650427fcda019b6586343869295e6 100644 (file)
@@ -1,3 +1,7 @@
+2006-01-25  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * SoObjects/SoObject+Traversal.m: minor code cleanups (v4.5.217)
+
 2005-11-21  Helge Hess  <helge.hess@skyrix.com>
 
        * WebDAV/SoObjectWebDAVDispatcher.m: set 'public' header in case the
index 371e8bbe694c91ecda0bbbda016f7e46819564e7..c695ca124917fea4aebdaae6646e33ff460b35d5 100644 (file)
@@ -96,12 +96,14 @@ static BOOL _isDebugOn(void) {
   
   sm = [_ctx soSecurityManager];
   if ((obj = [self traverseKey:_name inContext:_ctx]) != nil) {
-    *_error = [sm validateValue:obj forName:_name ofObject:self 
-                 inContext:_ctx];
+    *_error = [sm validateValue:obj
+                  forName:_name
+                  ofObject:self 
+                             inContext:_ctx];
     if (*_error != nil) {
       /* not allowed ! */
       if (debugTraversal)
-       [self debugWithFormat:@"  value of key '%@' did not validate !",_name];
+        [self debugWithFormat:@"  value of key '%@' did not validate !",_name];
       return nil;
     }
     
@@ -124,20 +126,20 @@ static BOOL _isDebugOn(void) {
       NSException *e;
       
       if ((e = [obj validateName:_name inContext:_ctx])) {
-       /* access restriction */
-       *_error = e;
-       return nil;
+        /* access restriction */
+        *_error = e;
+        return nil;
       }
       
       if ((obj = [obj traverseKey:_name inContext:_ctx])) {
-       /* found .. */
-       e = [sm validateValue:obj forName:_name 
-               ofObject:self inContext:_ctx];
-       if (e) {
-         *_error = e;
-         return nil;
-       }
-       return obj;
+        /* found .. */
+        e = [sm validateValue:obj forName:_name 
+                ofObject:self inContext:_ctx];
+        if (e) {
+          *_error = e;
+          return nil;
+        }
+        return obj;
       }
     }
   }
@@ -172,8 +174,8 @@ static BOOL _isDebugOn(void) {
   
   if (doDebug) {
     [self logWithFormat:@"traverse%s: %@",
-           _acquire ? "(acquire)" : "",
-           [traversalPath componentsJoinedByString:@" => "]];
+                        _acquire ? "(acquire)" : "",
+                        [traversalPath componentsJoinedByString:@" => "]];
   }
   
   /* reset error */
@@ -185,18 +187,19 @@ static BOOL _isDebugOn(void) {
     
     if ((m = [rq method]) != nil) {
       if ([m isEqualToString:@"PUT"])
-       isCreateIfMissingMethod = YES;
+        isCreateIfMissingMethod = YES;
       else if ([m isEqualToString:@"PROPPATCH"])
-       isCreateIfMissingMethod = YES;
+        isCreateIfMissingMethod = YES;
       else if ([m isEqualToString:@"MKCOL"])
-       /* this one is strictly creating */
-       isCreateMethod = YES;
-      // TODO: the following are only create-if-missing on the target!
-      else if ([m isEqualToString:@"MOVE"] ||
-              [m isEqualToString:@"COPY"]) {
-       isCreateIfMissingMethod = 
-         [[(WOContext *)_ctx objectForKey:@"isDestinationPathLookup"] 
-                              boolValue];
+        /* this one is strictly creating */
+        isCreateMethod = YES;
+        // TODO: the following are only create-if-missing on the target!
+        else if ([m isEqualToString:@"MOVE"] ||
+                      [m isEqualToString:@"COPY"])
+        {
+          isCreateIfMissingMethod = 
+            [[(WOContext *)_ctx objectForKey:@"isDestinationPathLookup"] 
+                                boolValue];
       }
     }
   }
@@ -226,16 +229,16 @@ static BOOL _isDebugOn(void) {
     
     if (i == (count - 1)) {
       /* 
-        is last object, special handling for MKCOL, with MKCOL queries
-        the last part of the URI is a collection to be created and not
-        yet in the object tree ...
+        is last object, special handling for MKCOL, with MKCOL queries
+        the last part of the URI is a collection to be created and not
+        yet in the object tree ...
       */
       // TODO: should check whether the resource exists, but access is denied
       if (isCreateMethod) {
-       [_ctx setPathInfo:name];
+        [_ctx setPathInfo:name];
         if (doDebug)
-         [self logWithFormat:@"create-method: PATH_INFO: %@", name];
-       break;
+          [self logWithFormat:@"create-method: PATH_INFO: %@", name];
+        break;
       }
     }
     
@@ -245,39 +248,39 @@ static BOOL _isDebugOn(void) {
                                acquire:_acquire];
     if (nextObject == nil) {
       if (doDebug) {
-       [self logWithFormat:@"  traverse miss: name=%@%s: i=%i,count=%i", 
-               name, _acquire ? ", acquire" : "", i, count];
+        [self logWithFormat:@"  traverse miss: name=%@%s: i=%i,count=%i", 
+                                 name, _acquire ? ", acquire" : "", i, count];
       }
       if (i == (count - 1)) {
-       /* 
-          Is last object, special handling for PUT, with PUT queries
-          the last part of the URI is allowed to be missing. If this
-          is the case, the PUT is actually a "creation" operation.
-          The same goes for PROPPATCH.
-       */
-       // should check whether the resource exists, but access is denied
-       if (isCreateIfMissingMethod) {
-         [_ctx setPathInfo:name];
-         if (doDebug)
-           [self logWithFormat:@"create-if-missing: PATH_INFO: %@", name];
-         break;
-       }
-       if (doDebug) [self logWithFormat:@"    miss is last object."];
+        /* 
+           Is last object, special handling for PUT, with PUT queries
+           the last part of the URI is allowed to be missing. If this
+           is the case, the PUT is actually a "creation" operation.
+           The same goes for PROPPATCH.
+        */
+        // should check whether the resource exists, but access is denied
+        if (isCreateIfMissingMethod) {
+          [_ctx setPathInfo:name];
+          if (doDebug)
+            [self logWithFormat:@"create-if-missing: PATH_INFO: %@", name];
+          break;
+        }
+        if (doDebug) [self logWithFormat:@"    miss is last object."];
       }
       
       if (error != nil) {
-       if (doDebug) [self logWithFormat:@"    handle miss error: %@", error];
-       currentObject = [currentObject handleValidationError:error 
-                                      duringTraveralOfKey:name
-                                      inContext:_ctx];
-       if (currentObject == nil) {
-         if (_error) 
-           *_error = error;
-         else
-           currentObject = error;
-         break;
-       }
-       if (doDebug) [self logWithFormat:@"    miss error continues ..."];
+        if (doDebug) [self logWithFormat:@"    handle miss error: %@", error];
+        currentObject = [currentObject handleValidationError:error 
+                                                              duringTraveralOfKey:name
+                                                              inContext:_ctx];
+        if (currentObject == nil) {
+          if (_error) 
+            *_error = error;
+          else
+            currentObject = error;
+          break;
+        }
+        if (doDebug) [self logWithFormat:@"    miss error continues ..."];
       }
       if (doDebug) [self logWithFormat:@"    got no error for miss."];
     }
@@ -350,9 +353,9 @@ static BOOL _isDebugOn(void) {
     context = [WOContext context];
   
     result = [self traversePathArray:_tp
-                  inContext:context
-                  error:&error
-                  acquire:_acquire];
+                   inContext:context
+                   error:&error
+                              acquire:_acquire];
     result = error ? [error retain] : [result retain];
   }
   [pool release];
index 9498814d132fa87b748b5466644ded3e5dd87592..779d561821398b699a26b79dfc8982f719fee0a7 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=216
+SUBMINOR_VERSION:=217
 
 # v4.5.214 requires libNGExtensions v4.5.179
 # v4.5.122 requires libNGExtensions v4.5.153