/* lookup in object (and acquire from strict parents) */
sm = [_ctx soSecurityManager];
- if ((obj = [self traverseKey:_name inContext:_ctx])) {
- *_error = [sm validateValue:obj forName:_name ofObject:self inContext:_ctx];
- if (*_error) {
+ if ((obj = [self traverseKey:_name inContext:_ctx]) != nil) {
+ *_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];
if (_acquire) {
/* now try to acquire from parents in URL path */
NSEnumerator *e;
-
+
if (debugTraversal) {
[self debugWithFormat:@" try to acquire key '%@' from traversal stack",
_name];
}
/* reset error */
- if (_error) *_error = nil;
+ if (_error != NULL) *_error = nil;
- if ((rq = [(id <WOPageGenerationContext>)_ctx request])) {
+ if ((rq = [(id <WOPageGenerationContext>)_ctx request]) != nil) {
/* isn't that somewhat hackish, directly accessing the HTTP method? */
NSString *m;
- if ((m = [rq method])) {
+ if ((m = [rq method]) != nil) {
if ([m isEqualToString:@"PUT"])
isCreateIfMissingMethod = YES;
else if ([m isEqualToString:@"PROPPATCH"])
if (doDebug) [self logWithFormat:@" miss is last object."];
}
- if (error) {
+ if (error != nil) {
if (doDebug) [self logWithFormat:@" handle miss error: %@", error];
currentObject = [currentObject handleValidationError:error
duringTraveralOfKey:name
r.length = (count - i);
piArray = [traversalPath subarrayWithRange:r];
if (doDebug) [self logWithFormat:@"PATH_INFO: %@", piArray];
+ // TODO: what about escaping?
[_ctx setPathInfo:[piArray componentsJoinedByString:@"/"]];
break;
}
else
clientObject = currentObject;
- if (clientObject) {
+ if (clientObject != nil) {
if (doDebug)
[self logWithFormat:@"set clientObject: %@", clientObject];
[_ctx setClientObject:clientObject];
srvURL = [_ctx serverURL];
- [self debugWithFormat:@"move/copy:\n to: %@\n server: %@)",
- [destURL absoluteString], [srvURL absoluteString]];
+ [self debugWithFormat:@"move/copy:\n to: %@ (%@)\n server: %@)",
+ [destURL absoluteString], absDestURL,
+ [srvURL absoluteString]];
/* check whether URL is on the same server ... */
if (![[srvURL host] isEqualToString:[destURL host]] ||
inContext:_ctx
error:&error
acquire:NO];
- if (error) {
+ if ([*target_ isKindOfClass:[NSException class]])
+ error = *target_;
+ if (error != nil) {
[self logWithFormat:@"could not resolve destination object (%@): %@",
[targetPath componentsJoinedByString:@" => "],
error];
return error;
}
-
- if (name_) *name_ = [[[_ctx pathInfo] copy] autorelease];
+
+ if (name_ != NULL) *name_ = [[[_ctx pathInfo] copy] autorelease];
if (*target_ == nil) {
[self debugWithFormat:@"MOVE/COPY destination could not be found."];
}
[self debugWithFormat:@"SOURCE: %@", self->object];
- [self debugWithFormat:@"TARGET: %@ (PI %@)", *target_, [_ctx pathInfo]];
+ [self debugWithFormat:@"TARGET: %@ (pathinfo %@)",
+ *target_, [_ctx pathInfo]];
return nil;
}