+2004-08-26 Helge Hess <helge.hess@opengroupware.org>
+
+ * v4.3.14
+
+ * WOComponent.m, WOContext.m: added ivar for _ODCycleCtx, _without_
+ increasing class version (so that we don't need to touch every
+ component in OGo :-| )
+
+ * DynamicElements/WOHtml.m, WOBody.m: minor code cleanups
+
2004-08-25 Helge Hess <helge.hess@opengroupware.org>
* v4.3.13
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#include "WOElement+private.h"
#include "WOHTMLDynamicElement.h"
self->src = OWGetProperty(_config, @"src");
self->value = OWGetProperty(_config, @"value");
- self->template = RETAIN(_c);
+ self->template = [_c retain];
if (self->value) NSLog(@"WARNING: value not yet supported !");
}
return self;
}
-#if !LIB_FOUNDATION_BOEHM_GC
- (void)dealloc {
- RELEASE(self->template);
- RELEASE(self->framework);
- RELEASE(self->filename);
- RELEASE(self->src);
- RELEASE(self->value);
+ [self->template release];
+ [self->framework release];
+ [self->filename release];
+ [self->src release];
+ [self->value release];
[super dealloc];
}
-#endif
-// accessors
+/* accessors */
- (WOElement *)template {
return self->template;
}
-// ******************** responder ********************
+/* handling requests */
- (void)takeValuesFromRequest:(WORequest *)_req inContext:(WOContext *)_ctx {
[self->template takeValuesFromRequest:_req inContext:_ctx];
return [self->template invokeActionForRequest:_req inContext:_ctx];
}
+/* generating response */
+
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
NSString *uUri;
NSString *uFi;
/* description */
- (NSString *)associationDescription {
- NSMutableString *str = [NSMutableString stringWithCapacity:128];
-
+ NSMutableString *str;
+
+ str = [NSMutableString stringWithCapacity:128];
if (self->filename) [str appendFormat:@" filename=%@", self->filename];
if (self->framework) [str appendFormat:@" framework=%@", self->framework];
if (self->src) [str appendFormat:@" src=%@", self->src];
/*
- 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$
-#include "WOElement+private.h"
#include "WOHTMLDynamicElement.h"
-#include <NGObjWeb/WOApplication.h>
-#include <NGObjWeb/WOResourceManager.h>
-#include "common.h"
@class WOAssociation;
}
@end
+#include "WOElement+private.h"
+#include <NGObjWeb/WOApplication.h>
+#include <NGObjWeb/WOResourceManager.h>
+#include "common.h"
+
@implementation WOHtml
- (id)initWithName:(NSString *)_name
template:(WOElement *)_c
{
if ((self = [super initWithName:_name associations:_config template:_c])) {
- self->template = RETAIN(_c);
+ self->template = [_c retain];
}
return self;
}
-#if !LIB_FOUNDATION_BOEHM_GC
- (void)dealloc {
- RELEASE(self->template);
+ [self->template release];
[super dealloc];
}
-#endif
-// accessors
+/* accessors */
- (WOElement *)template {
return self->template;
}
-// ******************** responder ********************
+/* handling requests */
- (void)takeValuesFromRequest:(WORequest *)_req inContext:(WOContext *)_ctx {
[self->template takeValuesFromRequest:_req inContext:_ctx];
return [self->template invokeActionForRequest:_req inContext:_ctx];
}
+/* generating response */
+
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
if ([[_ctx request] isFromClientComponent]) {
[self->template appendToResponse:_response inContext:_ctx];
}
WOResponse_AddCString(_response, "<html>");
-
[self->template appendToResponse:_response inContext:_ctx];
-
WOResponse_AddCString(_response, "</html>");
}
/* description */
- (NSString *)associationDescription {
- NSMutableString *str = [NSMutableString stringWithCapacity:128];
+ NSMutableString *str;
+ str = [NSMutableString stringWithCapacity:128];
if (self->template) [str appendFormat:@" template=%@", self->template];
-
return str;
}
WOSession *session;
NSURL *wocBaseURL;
+ id cycleContext; // was: _ODCycleCtx
}
- (id)initWithContext:(WOContext *)_ctx;
- WORequestStartDate [done: startDate]
- WORequestStartProcStatistics [done: startStatistics]
- WOComponent:
- - _ODCycleCtx (used for cursor) TODO: isn't that a WOComponent ivar?
+ - _ODCycleCtx (used for cursor) [done] TODO: isn't that a WOContext ivar?
=> needs to be documented and explained first
- component definition during init (currently wosVariables)
- WOContext
# version file
-SUBMINOR_VERSION:=12
+SUBMINOR_VERSION:=14
# 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: WOApplication.m 1 2004-08-20 10:08:27Z znek $
#include <NGObjWeb/WOApplication.h>
#include "WOContext+private.h"
static BOOL wakeupPageOnCreation = NO;
+ (int)version {
- // TODO: is really v3 for baseURL ivar change
+ // TODO: is really v4 for baseURL/cycleContext ivar changes
return [super version] + 0 /* v2 */;
}
+ (void)initialize {
if (parent == nil) return nil;
if (action == NULL) return nil;
-
+
NSAssert(parent != self, @"parent component equals current component");
if (![parent respondsToSelector:action]) {
if (debugCursor)
[self logWithFormat:@"enter cursor: %@", _obj];
- if ((ctxStack = [self objectForKey:@"_ODCycleCtx"]) == nil) {
- ctxStack = [NSMutableArray arrayWithCapacity:8];
- [self setObject:ctxStack forKey:@"_ODCycleCtx"];
- }
+ if ((ctxStack = self->cycleContext) == nil)
+ self->cycleContext = [[NSMutableArray alloc] initWithCapacity:8];
/* add to cursor stack */
[ctxStack addObject:(_obj ? _obj : [NSNull null])];
[self setObject:nil forKey:@"_"];
/* restore old ctx */
- if ((ctxStack = [self objectForKey:@"_ODCycleCtx"])) {
+ if ((ctxStack = self->cycleContext) != nil) {
unsigned count;
if ((count = [ctxStack count]) > 0) {
// TODO: why do we check for _ODCycleCtx, if we query '_' ?
- if ((ctxStack = [self objectForKey:@"_ODCycleCtx"]) == nil)
+ if ((ctxStack = self->cycleContext) == nil)
/* no cycle context setup for component ... */
return self;
if ([ctxStack count] == 0)
[self->otherTagString release];
- if ((ea = self->extraAttributes)) { // GC
+ if ((ea = self->extraAttributes) != nil) { // GC
register unsigned short i;
[ea->extraString release];
NSEnumerator *ke;
NSString *key;
NSMutableString *es;
-
+
if ([_extras count] == 0)
/* no extra attributes ... */
return;