+2004-08-23 Helge Hess <helge.hess@opengroupware.org>
+
+ * v4.3.5
+
+ * WOContext.m, WOComponent.m: modified component awake handling, should
+ fix some awake-in-context logs
+
+ * WOComponentRequestHandler.m: use _setCurrentContext: method
+
+ * WOApplication.m: added -_setCurrentContext: method to set the global
+ context (should be avoided, but not always possible ..)
+
+ * SoObjects/SoProductClassInfo.m: improved error handling (v4.3.4)
+
2004-08-22 Helge Hess <helge.hess@opengroupware.org>
* v4.3.3
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
+// $Id: SoProductClassInfo.m 1 2004-08-20 10:08:27Z znek $
#include "SoProductClassInfo.h"
#include "SoPageInvocation.h"
- (void)applyOnRegistry:(SoClassRegistry *)_registry {
SoClass *soClass;
id security;
+
+ if (_registry == nil) {
+ [self logWithFormat:@"WARNING(%s): did not pass a registry?!",
+ __PRETTY_FUNCTION__];
+ return;
+ }
if ((soClass = [_registry soClassWithName:[self className]]) == nil) {
[self logWithFormat:
# version file
-SUBMINOR_VERSION:=3
+SUBMINOR_VERSION:=4
# v4.2.413 requires libSaxObjC v4.2.33
# v4.2.341 requires libNGExtensions v4.2.77
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
+// $Id: WOApplication.m 1 2004-08-20 10:08:27Z znek $
#include <NGObjWeb/WOApplication.h>
#include "WOContext+private.h"
/* setup request handlers */
self->defaultRequestHandler =
- [[NSClassFromString([[self class] defaultRequestHandlerClassName]) alloc] init];
+ [[NSClassFromString([[self class] defaultRequestHandlerClassName])
+ alloc] init];
self->requestHandlerRegistry =
NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 8);
return self->instanceNumber;
}
+- (void)_setCurrentContext:(WOContext *)_ctx {
+ NSMutableDictionary *info;
+
+ info = [[NSThread currentThread] threadDictionary];
+ if (_ctx != nil)
+ [info setObject:_ctx forKey:@"WOContext"];
+ else
+ [info removeObjectForKey:@"WOContext"];
+}
- (WOContext *)context {
// deprecated in WO4
NSThread *t;
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
+// $Id: WOComponent.m 1 2004-08-20 10:08:27Z znek $
#include <NGObjWeb/WOComponent.h>
#include "WOComponent+private.h"
self->session = [_ctx session];
self->componentFlags.isAwake = 1;
+ [_ctx _addAwakeComponent:self]; /* ensure that sleep is called */
/* awake subcomponents */
{
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#include "WOComponentDefinition.h"
#include "WOComponent+private.h"
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#include "WOComponentRequestHandler.h"
#include "WORequestHandler+private.h"
@interface WOApplication(Privates)
- (WOSession *)_initializeSessionInContext:(WOContext *)_ctx;
+- (void)_setCurrentContext:(WOContext *)_ctx;
@end
@implementation WOComponentRequestHandler
}
context = [WOContext contextWithRequest:_request];
- [[[NSThread currentThread] threadDictionary]
- setObject:context forKey:@"WOContext"];
+ [application _setCurrentContext:context];
/*
parse handler path (URL)
[application unlockRequestHandling];
isLocked = NO;
}
-
- [[[NSThread currentThread] threadDictionary]
- removeObjectForKey:@"WOContext"];
+
+ [application _setCurrentContext:nil];
return response;
}
/*
- Copyright (C) 2000-2003 SKYRIX Software AG
+ Copyright (C) 2000-2004 SKYRIX Software AG
- This file is part of OGo
+ This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#ifndef __NGObjWeb_WOContext_private_H__
#define __NGObjWeb_WOContext_private_H__
@interface WOContext(NGObjWebInternal)
+- (void)_addAwakeComponent:(WOComponent *)_component;
+
- (void)enterComponent:(WOComponent *)_component content:(WOElement *)_content;
- (void)leaveComponent:(WOComponent *)_component;
- (void)sleepComponents;
/* components */
+- (void)_addAwakeComponent:(WOComponent *)_component {
+ if (_component == nil)
+ return;
+
+ if ([self->awakeComponents containsObject:_component])
+ return;
+
+ /* wake up component */
+ if (debugComponentAwake)
+ [self logWithFormat:@"mark component awake: %@", _component];
+
+ [self->awakeComponents addObject:_component];
+}
+
+- (void)_awakeComponent:(WOComponent *)_component {
+ if (_component == nil)
+ return;
+
+ if ([self->awakeComponents containsObject:_component])
+ return;
+
+ /* wake up component */
+ if (debugComponentAwake)
+ [self logWithFormat:@"awake component: %@", _component];
+
+ [_component _awakeWithContext:self];
+
+ [self _addAwakeComponent:_component];
+
+ if (debugComponentAwake)
+ [self logWithFormat:@"woke up component: %@", _component];
+}
+
- (void)sleepComponents {
NSEnumerator *e;
WOComponent *component;
BOOL sendSleepToPage;
+
+ if (debugComponentAwake) {
+ [self logWithFormat:@"sleep %d components ...",
+ [self->awakeComponents count]];
+ }
sendSleepToPage = YES;
e = [self->awakeComponents objectEnumerator];
while ((component = [e nextObject])) {
if (debugComponentAwake)
- [self logWithFormat:@"sleep component: %@", component];
+ [self logWithFormat:@" sleep component: %@", component];
[component _sleepWithContext:self];
if (component == self->page) sendSleepToPage = NO;
}
if (sendSleepToPage && (self->page != nil)) {
if (debugComponentAwake)
- [self logWithFormat:@"sleep page: %@", self->page];
+ [self logWithFormat:@" sleep page: %@", self->page];
[self->page _sleepWithContext:self];
}
+ if (debugComponentAwake) {
+ [self logWithFormat:@"done sleep %d components.",
+ [self->awakeComponents count]];
+ }
[self->awakeComponents removeAllObjects];
}
self->contentStack[(int)self->componentStackCount] = [_content retain];
self->componentStackCount++;
- if (![self->awakeComponents containsObject:_component]) {
- /* wake up component */
- if (debugComponentAwake)
- [self logWithFormat:@"awake component: %@", _component];
-
- [_component _awakeWithContext:self];
- [self->awakeComponents addObject:_component];
-
- if (debugComponentAwake)
- [self logWithFormat:@"woke up component: %@", _component];
- }
+ [self _awakeComponent:_component];
if (parent) {
if ([_component synchronizesVariablesWithBindings])
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#include <NGObjWeb/WOCoreApplication.h>
#include <NGObjWeb/WOAdaptor.h>
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#include "WORequestHandler+private.h"
#include "WOApplication+private.h"
@end
#endif
+@interface WOApplication(Privates)
+- (void)_setCurrentContext:(WOContext *)_ctx;
+@end
+
@implementation WORequestHandler
static BOOL perflog = NO;
WOResponse *response = nil;
WOContext *context = nil;
NSThread *thread;
- NSMutableDictionary *threadDict;
NSString *sessionId = nil;
WOSession *session = nil;
NSString *uri;
thread = [NSThread currentThread];
NSAssert(thread, @"missing current thread ...");
- threadDict = [thread threadDictionary];
- NSAssert(threadDict, @"missing current thread's dictionary ...");
if (_request == nil) return nil;
/* setup context */
context = [WOContext contextWithRequest:_request];
NSAssert(context, @"no context assigned ..");
- NSAssert(threadDict, @"missing current thread's dictionary ...");
- [threadDict setObject:context forKey:@"WOContext"];
+ [app _setCurrentContext:context];
/* check session id */
*(&session) = nil;
}
NS_ENDHANDLER;
- NSAssert(threadDict, @"missing current thread's dictionary ...");
- [threadDict removeObjectForKey:@"WOContext"];
+ [app _setCurrentContext:nil];
}
#if USE_POOLS
[pool release]; pool = nil;
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#include <NGObjWeb/WOResourceManager.h>
#include "WOComponentDefinition.h"
if (DefClass == Nil)
DefClass = [WOComponentDefinition class];
-
+
+ // TODO: is retained response intended?
cdef = [[DefClass alloc] initWithName:_name
path:[_url path]
baseURL:_baseURL frameworkName:_fwname];
/* take a look into the file system */
languagePath = [language stringByAppendingPathExtension:@"lproj"];
- languagePath = [componentPath stringByAppendingPathComponent:languagePath];
+ languagePath =
+ [componentPath stringByAppendingPathComponent:languagePath];
if ([fm fileExistsAtPath:languagePath isDirectory:&isDirectory]) {
NSString *baseUrl = nil;