+2007-03-16 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * v4.7.5
+
+ * WOContext.[hm]: added fragmentID API from JOPE. This API provides a
+ means for conditionally suppressing the rendering of WOElements -
+ this is triggered by a 'wofid' URL parameter; comes in very
+ handy when dealing with AJAX.
+
+ * WORequest.[hm]: added -fragmentID API.
+
+ * WOResponse+private.h: added new convenience macros
+
+ * DynamicElements/WOFragment.[m,api]: new dynamic element for
+ triggering render state
+
+ * WOChildComponentReference.m, WEClientCapabilities.m,
+ DynamicElements/*.m: all elements obey WOContext's new
+ -isRenderingDisabled flag now
+
2007-03-13 Marcus Mueller <znek@mulle-kybernetik.com>
* WORepetition.m: Reverted 'list' binding extensions as this had side
WOComponent *sComponent;
NSString *queryString = nil;
- if ([[_ctx request] isFromClientComponent])
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) {
+ [self->template appendToResponse:_response inContext:_ctx];
return;
+ }
sComponent = [_ctx component];
NSString *uUri;
NSString *uFi;
- if ([[_ctx request] isFromClientComponent]) {
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) {
[self->template appendToResponse:_response inContext:_ctx];
return;
}
NSString *v;
BOOL isChecked;
- if ([[_ctx request] isFromClientComponent])
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent])
return;
v = [self->value stringValueInComponent:[_ctx component]];
unsigned cnt;
BOOL canSetIndex, canSetItem;
- if ([[_ctx request] isFromClientComponent])
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent])
return;
sComponent = [_ctx component];
else if (debugOn) {
[self debugWithFormat:@"missing component for reference: %@",
self->activeComponent];
- [_response appendContentHTMLString:@"[missing component for reference: "];
- [_response appendContentHTMLString:[self->activeComponent description]];
- [_response appendContentHTMLString:@"]"];
+ if (![_ctx isRenderingDisabled]) {
+ [_response appendContentHTMLString:@"[missing component for reference: "];
+ [_response appendContentHTMLString:[self->activeComponent description]];
+ [_response appendContentHTMLString:@"]"];
+ }
}
}
#define StrVal(__x__) [self->__x__ stringValueInComponent:sComponent]
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- if (![[_ctx request] isFromClientComponent]) {
+ if (!([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent])) {
WOComponent *sComponent = [_ctx component];
NSString *uUri = [self->src stringValueInComponent:sComponent];
NSString *uFi = [self->filename stringValueInComponent:sComponent];
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
NSString *s;
- if ([[_ctx request] isFromClientComponent])
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent])
return;
s = [self->name stringValueInComponent:[_ctx component]];
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
NSString *v;
- if ([[_ctx request] isFromClientComponent])
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent])
return;
v = [self->value stringValueInComponent:[_ctx component]];
WOComponent *sComponent;
NSString *queryString = nil;
- if ([[_ctx request] isFromClientComponent]) {
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) {
[self->template appendToResponse:_response inContext:_ctx];
return;
}
--- /dev/null
+<?xml version="1.0" standalone="yes"?>
+
+<wo class="WOFragment">
+ <binding name="name" />
+ <binding name="onlyOnMatch" defaults="YES/NO" />
+ <binding name="id" />
+ <binding name="elementName" />
+</wo>
--- /dev/null
+/*
+ Copyright (C) 2007 OpenGroupware.org.
+
+ This file is part of SOPE.
+
+ SOPE 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; either version 2, or (at your option) any
+ later version.
+
+ SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with SOPE; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+
+/*
+ * WOFragment
+ *
+ * This element is used to mark rendering fragments. If SOPE receives a URL
+ * which contains the 'wofid' request parameter, it will disable rendering in
+ * the WOContext. This element can be used to reenable rendering for a certain
+ * template subsection.
+ *
+ * Note that request handling is NOT affected by fragments! This is necessary
+ * to ensure a proper component state setup. If you wish, you can further
+ * reduce processing overhead using WOConditionals in appropriate places (if
+ * you know that those sections do not matter for processing)
+ *
+ * Fragments can be nested. WOFragment sections _never_ disable rendering or
+ * change template control flow, they only enable rendering when fragment ids
+ * match. This way it is ensured that "sub fragments" will get properly
+ * accessed.
+ * This can be overridden by setting the "onlyOnMatch" binding. If this is set
+ * the content will only get accessed in case the fragment matches OR not
+ * fragment id is set.
+ *
+ * Sample:
+ * <#WOFragment name="tableview" />
+ *
+ * Renders:
+ * This element can render a container tag if the elementName is specified.
+ *
+ * Bindings:
+ * name [in] - string name of fragment
+ * onlyOnMatch [in] - boolean enable/disable processing for other frags
+ * elementName [in] - string optional name of container element
+ * <all other bindings are extra-attrs for elementName>
+ */
+#include "decommon.h"
+#include <NGObjWeb/WODynamicElement.h>
+#include "WOElement+private.h"
+
+@interface WOFragment : WODynamicElement
+{
+ WOElement *template;
+ WOAssociation *name;
+ WOAssociation *eid;
+ WOAssociation *onlyOnMatch;
+ WOAssociation *elementName;
+}
+
+- (BOOL)isFragmentActiveInContext:(WOContext *)_ctx;
+
+@end /* WOFragment */
+
+@implementation WOFragment
+
+- (id)initWithName:(NSString *)_name
+ associations:(NSDictionary *)_assocs
+ template:(WOElement *)_c
+{
+ if ((self = [super initWithName:_name associations:_assocs template:_c])) {
+ self->template = RETAIN(_c);
+ self->name = OWGetProperty(_assocs, @"name");
+ self->eid = OWGetProperty(_assocs, @"id");
+ self->onlyOnMatch = OWGetProperty(_assocs, @"onlyOnMatch");
+ self->elementName = OWGetProperty(_assocs, @"elementName");
+ }
+ return self;
+}
+- (void)dealloc {
+ [self->template release];
+ [self->name release];
+ [self->eid release];
+ [self->onlyOnMatch release];
+ [self->elementName release];
+ [super dealloc];
+}
+
+/* support */
+
+- (BOOL)isFragmentActiveInContext:(WOContext *)_ctx {
+ NSString *fragName;
+ NSString *fragID = [_ctx fragmentID];
+
+ if (fragID == nil) /* yes, active, no fragment is set */
+ return YES;
+
+ fragName = self->name == nil
+ ? [_ctx elementID]
+ : [self->name stringValueInComponent:[_ctx cursor]];
+ if (fragName == nil) /* we have no fragid in the current state */
+ return YES;
+
+ return [fragID isEqualToString:fragName];
+}
+
+/* request handling */
+
+- (void)takeValuesFromRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
+ if (self->template == nil) return;
+
+ if (self->onlyOnMatch == nil)
+ [self->template takeValuesFromRequest:_rq inContext:_ctx];
+ else if (![self->onlyOnMatch boolValueInComponent:[_ctx cursor]])
+ [self->template takeValuesFromRequest:_rq inContext:_ctx];
+ else if ([self isFragmentActiveInContext:_ctx])
+ [self->template takeValuesFromRequest:_rq inContext:_ctx];
+}
+
+- (id)invokeActionForRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
+ NSString *fragID;
+
+ if (self->template == nil)
+ return nil;
+
+ fragID = [_ctx fragmentID];
+
+ if (self->onlyOnMatch == nil || fragID == nil)
+ return [self->template invokeActionForRequest:_rq inContext:_ctx];
+
+ if (![self->onlyOnMatch boolValueInComponent:[_ctx cursor]])
+ return [self->template invokeActionForRequest:_rq inContext:_ctx];
+
+ if ([self isFragmentActiveInContext:_ctx])
+ return [self->template invokeActionForRequest:_rq inContext:_ctx];
+
+ /* onlyOnMatch is on and fragment is not active, do not call template */
+ return nil;
+}
+
+/* rendering */
+
+- (void)appendToResponse:(WOResponse *)_r inContext:(WOContext *)_ctx {
+ id cursor = [_ctx cursor];
+ BOOL wasDisabled = [_ctx isRenderingDisabled];
+ BOOL isFragActive = [self isFragmentActiveInContext:_ctx];
+ BOOL doRender = YES;
+ NSString *en = nil;
+
+ if (!isFragActive) {
+ /* we are not active (no match) */
+ if (self->onlyOnMatch != nil)
+ doRender = ![self->onlyOnMatch boolValueInComponent:cursor];
+ }
+
+ /* enable rendering if we are active */
+
+ if (isFragActive)
+ [_ctx enableRendering];
+
+ /* start container element if we have no frag */
+
+ if (!wasDisabled && self->elementName != nil)
+ en = [self->elementName stringValueInComponent:cursor];
+
+ if (en != nil) {
+ NSString *leid;
+
+ WOResponse_AppendBeginTag(_r, en);
+
+ /* add id of fragment element */
+
+ if (self->eid != nil)
+ leid = [self->eid stringValueInComponent:cursor];
+ else if (self->name != nil)
+ leid = [self->name stringValueInComponent:cursor];
+ else
+ leid = [_ctx elementID];
+ if (leid != nil)
+ WOResponse_AppendAttribute(_r, @"id", leid);
+
+ /* additional bindings not specifically tracked by the element*/
+ [self appendExtraAttributesToResponse:_r inContext:_ctx];
+
+ WOResponse_AppendBeginTagEnd(_r);
+ }
+
+ /* do content */
+
+ if (doRender && self->template != nil)
+ [self->template appendToResponse:_r inContext:_ctx];
+
+ /* close tag if we have one */
+
+ if (en != nil)
+ WOResponse_AppendEndTag(_r, en);
+
+ /* reestablish old rendering state */
+
+ if (isFragActive && wasDisabled)
+ [_ctx disableRendering];
+}
+
+@end /* WOFragment */
}
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- WOComponent *sComponent = [_ctx component];
- NSString *queryString = nil;
- if ([[_ctx request] isFromClientComponent])
+ WOComponent *sComponent;
+ NSString *queryString;
+
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent])
return;
+ sComponent = [_ctx component];
+ queryString = nil;
+
WOResponse_AddCString(_response, "<frame src=\"");
if ([self _appendHrefToResponse:_response inContext:_ctx]) {
WOResponse_AddChar(_response, ' ');
WOResponse_AddString(_response,
[self->otherTagString stringValueInComponent:
- [_ctx component]]);
+ sComponent]);
}
WOResponse_AddEmptyCloseParens(_response, _ctx);
}
WOComponent *sComponent;
NSString *tag;
- if ([[_ctx request] isFromClientComponent])
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) {
+ [self->template appendToResponse:_response inContext:_ctx];
return;
-
+ }
+
sComponent = [_ctx component];
switch (self->tagNameType) {
case TagNameType_Assoc:
WOComponent *sComponent;
NSString *tag;
- if ([[_ctx request] isFromClientComponent])
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent])
return;
sComponent = [_ctx component];
NSString *v;
BOOL isDisabled;
- if ([[_ctx request] isFromClientComponent])
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent])
return;
isDisabled = [self->disabled boolValueInComponent:[_ctx component]];
/* generating response */
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- if ([[_ctx request] isFromClientComponent]) {
- [self->template appendToResponse:_response inContext:_ctx];
- return;
- }
+ BOOL doRender = !([_ctx isRenderingDisabled] ||
+ [[_ctx request] isFromClientComponent]);
- WOResponse_AddCString(_response, "<html>");
+ if (doRender)
+ WOResponse_AddCString(_response, "<html>");
[self->template appendToResponse:_response inContext:_ctx];
- WOResponse_AddCString(_response, "</html>");
+ if (doRender)
+ WOResponse_AddCString(_response, "</html>");
}
/* description */
}
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- if (![[_ctx request] isFromClientComponent]) {
- WOComponent *sComponent = [_ctx component];
- NSString *queryString = nil;
+ WOComponent *sComponent;
+ NSString *queryString;
- WOResponse_AddCString(_response, "<iframe src=\"");
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
- if ([self _appendHrefToResponse:_response inContext:_ctx]) {
- queryString = [self queryStringForQueryDictionary:
- [self->queryDictionary valueInComponent:sComponent]
- andQueryParameters:self->queryParameters
- inContext:_ctx];
- }
+ sComponent = [_ctx component];
+ queryString = nil;
- if (queryString) {
- [_response appendContentCharacter:'?'];
- WOResponse_AddString(_response, queryString);
- }
- WOResponse_AddChar(_response, '"');
-
- [self appendExtraAttributesToResponse:_response inContext:_ctx];
-
- if (self->otherTagString) {
- WOResponse_AddChar(_response, ' ');
- WOResponse_AddString(_response,
- [self->otherTagString stringValueInComponent:
- [_ctx component]]);
- }
- WOResponse_AddChar(_response, '>');
+ WOResponse_AddCString(_response, "<iframe src=\"");
- [self->template appendToResponse:_response inContext:_ctx];
-
- WOResponse_AddCString(_response, "</iframe>");
+ if ([self _appendHrefToResponse:_response inContext:_ctx]) {
+ queryString = [self queryStringForQueryDictionary:
+ [self->queryDictionary valueInComponent:sComponent]
+ andQueryParameters:self->queryParameters
+ inContext:_ctx];
}
+
+ if (queryString) {
+ WOResponse_AddChar(_response, '?');
+ WOResponse_AddString(_response, queryString);
+ }
+ WOResponse_AddChar(_response, '"');
+
+ [self appendExtraAttributesToResponse:_response inContext:_ctx];
+
+ if (self->otherTagString) {
+ WOResponse_AddChar(_response, ' ');
+ WOResponse_AddString(_response,
+ [self->otherTagString stringValueInComponent:
+ [_ctx component]]);
+ }
+ WOResponse_AddChar(_response, '>');
+
+ [self->template appendToResponse:_response inContext:_ctx];
+
+ WOResponse_AddCString(_response, "</iframe>");
+
}
// description
}
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- if ([[_ctx request] isFromClientComponent])
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent])
return;
WOResponse_AddCString(_response, "<img src=\"");
/* generating response */
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- WOComponent *sComponent = [_ctx component];
+ WOComponent *sComponent;
NSString *uUri = nil;
NSString *uFi = nil;
BOOL isDisabled;
- uUri = [self->src stringValueInComponent:sComponent];
-
+ if ([_ctx isRenderingDisabled]) return;
+
+ sComponent = [_ctx component];
+ uUri = [self->src stringValueInComponent:sComponent];
+
if ((isDisabled = [self->disabled boolValueInComponent:sComponent])) {
uFi = [self->disabledFilename stringValueInComponent:sComponent];
if (uFi == nil)
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
WOComponent *sComponent;
- NSString *st;
- BOOL hide;
-
- if ([[_ctx request] isFromClientComponent])
+ NSString *st;
+ BOOL hide;
+
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent])
return;
-
+
sComponent = [_ctx component];
- hide = [self->hideInComment boolValueInComponent:sComponent];
-
+ hide = [self->hideInComment boolValueInComponent:sComponent];
+
WOResponse_AddCString(_response, "<script");
-
+
if ((st = [self->type stringValueInComponent:sComponent]) != nil) {
WOResponse_AddCString(_response, " type=\"");
[_response appendContentHTMLAttributeValue:st];
else {
WOResponse_AddCString(_response, " type=\"text/javascript\"");
}
-
+
/* add URL to script */
if (self->scriptSource != nil) {
st = [self->scriptSource stringValueInComponent:sComponent];
WOComponent *sComponent;
int to;
NSString *url;
- NSString *queryString = nil;
- BOOL addSID;
+ NSString *queryString;
+ BOOL addSID;
- if ([[_ctx request] isFromClientComponent])
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent])
return;
- sComponent = [_ctx component];
+ sComponent = [_ctx component];
+ queryString = nil;
to = [self->timeout intValueInComponent:sComponent];
WOResponse_AddCString(_response, "<meta http-equiv=\"refresh\" content=\"");
WOResponse_AddInt(_response, to);
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
NSArray *top;
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent])
+ return;
+
top = [self->list valueInComponent:[_ctx component]];
if ([top count] > 0) {
[self appendList:top
#include "WONoContentElement.h"
#include <NGObjWeb/WOComponentDefinition.h>
#include <NGObjWeb/WOResponse.h>
+#include <NGObjWeb/WOContext.h>
#include "common.h"
@implementation WONoContentElement
}
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
+ if ([_ctx isRenderingDisabled]) return;
[_response appendContentHTMLString:@"<<missing element '"];
[_response appendContentHTMLString:self->element];
[_response appendContentHTMLString:@"' in component '"];
NSString *v;
unsigned int s;
+ if ([_ctx isRenderingDisabled]) return;
+
v = [self->value stringValueInComponent:[_ctx component]];
s = [self->size unsignedIntValueInComponent:[_ctx component]];
st = [[NSDateClass date] timeIntervalSince1970];
#endif
- WOResponse_AddCString(_response, "<select name=\"");
- [_response appendContentHTMLAttributeValue:OWFormElementName(self, _ctx)];
- WOResponse_AddChar(_response, '"');
-
- [self appendExtraAttributesToResponse:_response inContext:_ctx];
-
- if (self->otherTagString != nil) {
- WOResponse_AddChar(_response, ' ');
- WOResponse_AddString(_response,
- [self->otherTagString stringValueInComponent:
- [_ctx component]]);
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
}
-
- if ([self->disabled boolValueInComponent:[_ctx component]])
- WOResponse_AddCString(_response, " disabled=\"disabled\"");
+ else {
+ WOResponse_AddCString(_response, "<select name=\"");
+ [_response appendContentHTMLAttributeValue:OWFormElementName(self, _ctx)];
+ WOResponse_AddChar(_response, '"');
+
+ [self appendExtraAttributesToResponse:_response inContext:_ctx];
+
+ if (self->otherTagString != nil) {
+ WOResponse_AddChar(_response, ' ');
+ WOResponse_AddString(_response,
+ [self->otherTagString stringValueInComponent:
+ [_ctx component]]);
+ }
+
+ if ([self->disabled boolValueInComponent:[_ctx component]])
+ WOResponse_AddCString(_response, " disabled=\"disabled\"");
- WOResponse_AddChar(_response, '>');
-
- [self appendOptionsToResponse:_response inContext:_ctx];
- [self->template appendToResponse:_response inContext:_ctx];
+ WOResponse_AddChar(_response, '>');
+
+ [self appendOptionsToResponse:_response inContext:_ctx];
+ [self->template appendToResponse:_response inContext:_ctx];
- WOResponse_AddCString(_response, "</select>");
-
+ WOResponse_AddCString(_response, "</select>");
+ }
#if DEBUG
if (profElements) {
NSTimeInterval diff;
WOComponent *sComponent;
NSString *lvalue;
+ if ([_ctx isRenderingDisabled]) return;
+
sComponent = [_ctx component];
lvalue = self->checked
? [_ctx elementID]
id sel;
BOOL canSetIndex, canSetItem;
+ if ([_ctx isRenderingDisabled]) return;
+
sComponent = [_ctx component];
array = [self->list valueInComponent:sComponent];
goCount = [array count];
WOComponent *sComponent;
NSArray *array;
unsigned aCount, goCount, startIdx;
+ BOOL doRender;
#if DEBUG
if (descriptiveIDs)
pool = [[NSAutoreleasePool alloc] init];
+
+ doRender = ![_ctx isRenderingDisabled];
sComponent = [_ctx component];
array = [self->list valueInContext:_ctx];
aCount = [array count];
#if HTML_DEBUG
// append debugging info
- WOResponse_AddString(_response,
- [NSString stringWithFormat:
- @"<!-- WORep. count=%d arraySize=%d -->\n",
- goCount, [array count]]);
+ if (doRender)
+ WOResponse_AddString(_response,
+ [NSString stringWithFormat:
+ @"<!-- WORep. count=%d arraySize=%d -->\n",
+ goCount, [array count]]);
#endif
if (self->identifier == nil) {
id ident = nil;
id lItem;
- if ((cnt != startIdx) && (self->separator != nil)) {
+ if ((cnt != startIdx) && (self->separator != nil) && doRender) {
WOResponse_AddString(_response,
[self->separator stringValueInComponent:
sComponent]);
#if HTML_DEBUG
/* append debugging info */
- WOResponse_AddString(_response, [NSString stringWithFormat:
- @" <!-- iteration=%d -->\n", cnt]);
+ if (doRender)
+ WOResponse_AddString(_response, [NSString stringWithFormat:
+ @" <!-- iteration=%d -->\n", cnt]);
#endif
/* append child elements */
}
#if HTML_DEBUG
else {
- WOResponse_AddCString(_response, "<!-- repetition with no contents -->");
+ if (doRender)
+ WOResponse_AddCString(_response, "<!-- repetition with no contents -->");
}
#endif
// ******************** responder ********************
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- NSString *v = [self->value stringValueInComponent:[_ctx component]];
+ NSString *v;
+
+ if ([_ctx isRenderingDisabled]) return;
+
+ v = [self->value stringValueInComponent:[_ctx component]];
if ((self->name != nil) || (self->disabled != nil)) {
- NSLog(@"WARNING: 'name' and 'disabled' properties are "
- @"not supported in WOResetButton !");
+ [self warnWithFormat:@"'name' and 'disabled' properties are "
+ @"not supported in WOResetButton !"];
}
WOResponse_AddCString(_response, "<input type=\"reset\" value=\"");
WOComponent *sComponent;
NSString *uFi;
- if ([[_ctx request] isFromClientComponent])
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) {
+ [self->template appendToResponse:_response inContext:_ctx];
return;
-
+ }
+
sComponent = [_ctx component];
-
- uFi = [self->filename stringValueInComponent:sComponent];
+ uFi = [self->filename stringValueInComponent:sComponent];
if (uFi) {
WOResourceManager *rm;
/* generating response */
-- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- [_response appendContentHTMLString:[self->value stringValueInContext:_ctx]];
+- (void)appendToResponse:(WOResponse *)_resp inContext:(WOContext *)_ctx {
+ if (![_ctx isRenderingDisabled])
+ [_resp appendContentHTMLString:[self->value stringValueInContext:_ctx]];
}
/* description */
/* generating response */
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- WOResponse_AddString(_response, self->value);
+ if (![_ctx isRenderingDisabled])
+ WOResponse_AddString(_response, self->value);
}
/* description */
/* generating response */
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- if (self->value) WOResponse_AddCString(_response, self->value);
+ if (![_ctx isRenderingDisabled] && self->value)
+ if (self->value) WOResponse_AddCString(_response, self->value);
}
/* description */
}
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- WOComponent *sComponent = [_ctx component];
+ WOComponent *sComponent;
NSFormatter *fmt;
id obj = nil;
SEL addSel = NULL;
NSString *styleName;
- fmt = [self _formatterInContext:_ctx];
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent])
+ return;
+
+ sComponent = [_ctx component];
+ fmt = [self _formatterInContext:_ctx];
+
#if DEBUG
if (fmt!=nil && ![fmt respondsToSelector:@selector(stringForObjectValue:)]) {
- [sComponent logWithFormat:
+ [sComponent errorWithFormat:
@"invalid formatter determined by keypath %@: %@",
self->formatter, fmt];
}
formattedObj = [fmt stringForObjectValue:obj];
#if 0
if (formattedObj == nil) {
- NSLog(@"WARNING: formatter %@ returned nil string for object %@",
- fmt, obj);
+ [self warnWithFormat:@"formatter %@ returned nil string for object %@",
+ fmt, obj];
}
#endif
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
NSString *v;
+ if ([_ctx isRenderingDisabled]) return;
+
v = [self->value stringValueInComponent:[_ctx component]];
WOResponse_AddCString(_response, "<input type=\"submit\" name=\"");
[_response appendContentHTMLAttributeValue:OWFormElementName(self, _ctx)];
unsigned r;
unsigned c;
+ if ([_ctx isRenderingDisabled]) return;
+
sComponent = [_ctx component];
v = [self->value valueInComponent:sComponent];
r = [self->rows unsignedIntValueInComponent:sComponent];
id obj;
unsigned s;
+ if ([_ctx isRenderingDisabled]) return;
+
obj = [self->value valueInComponent:[_ctx component]];
s = [self->size unsignedIntValueInComponent:[_ctx component]];
#define StrVal(__x__) [self->__x__ stringValueInComponent:sComponent]
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- if (![[_ctx request] isFromClientComponent]) {
- WOComponent *sComponent = [_ctx component];
- BOOL hide = [self->hideInComment boolValueInComponent:sComponent];
-
- WOResponse_AddCString(_response, "<script language=\"VBScript\" ");
-
- /* add URL to script */
- if (self->scriptSource) {
- WOResponse_AddCString(_response, " src=\"");
- [_response appendContentHTMLAttributeValue:
- [self->scriptSource stringValueInComponent:sComponent]];
- WOResponse_AddCString(_response, "\"");
- }
-
- if (self->otherTagString) {
- WOResponse_AddChar(_response, ' ');
- WOResponse_AddString(_response,
- [self->otherTagString stringValueInComponent:
- [_ctx component]]);
- }
- WOResponse_AddChar(_response, '>');
- if (hide) WOResponse_AddCString(_response, "<!--hide from older browsers");
-
- /* add a script string */
- if (self->scriptString) {
- NSString *s = [self->scriptString stringValueInComponent:sComponent];
-
- if (s) WOResponse_AddString(_response, s);
- }
-
- /* add a script file */
- if (self->scriptFile) {
- NSString *s;
-
- s = [NSString stringWithContentsOfFile:
- [self->scriptFile stringValueInComponent:sComponent]];
- if (s) WOResponse_AddString(_response, s);
- }
+ WOComponent *sComponent;
+ BOOL hide;
+
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent])
+ return;
+
+ sComponent = [_ctx component];
+ hide = [self->hideInComment boolValueInComponent:sComponent];
- if (hide) WOResponse_AddCString(_response, "//hide from older browsers-->");
- WOResponse_AddCString(_response, "</script>");
+ WOResponse_AddCString(_response, "<script language=\"VBScript\" ");
+
+ /* add URL to script */
+ if (self->scriptSource) {
+ WOResponse_AddCString(_response, " src=\"");
+ [_response appendContentHTMLAttributeValue:
+ [self->scriptSource stringValueInComponent:sComponent]];
+ WOResponse_AddCString(_response, "\"");
}
+
+ if (self->otherTagString) {
+ WOResponse_AddChar(_response, ' ');
+ WOResponse_AddString(_response,
+ [self->otherTagString stringValueInComponent:
+ [_ctx component]]);
+ }
+ WOResponse_AddChar(_response, '>');
+ if (hide) WOResponse_AddCString(_response, "<!--hide from older browsers");
+
+ /* add a script string */
+ if (self->scriptString) {
+ NSString *s = [self->scriptString stringValueInComponent:sComponent];
+
+ if (s) WOResponse_AddString(_response, s);
+ }
+
+ /* add a script file */
+ if (self->scriptFile) {
+ NSString *s;
+
+ s = [NSString stringWithContentsOfFile:
+ [self->scriptFile stringValueInComponent:sComponent]];
+ if (s) WOResponse_AddString(_response, s);
+ }
+
+ if (hide) WOResponse_AddCString(_response, "//hide from older browsers-->");
+ WOResponse_AddCString(_response, "</script>");
}
// description
/*
Copyright (C) 2000-2005 SKYRIX Software AG
+ Copyright (C) 2007 OpenGroupware.org.
This file is part of SOPE.
<var:foreach .../> maps to WORepetition
<var:with .../> maps to WOSetCursor
<var:copy-value ../> maps to WOCopyValue
+ <var:fragment ../> maps to WOFragment
*/
@interface WOxControlElemBuilder : WOxTagClassElemBuilder
clazz = NSClassFromString(@"WORepetition");
return clazz;
}
-
+
+ if (c0 == 'f' && len == 8 && [tag isEqualToString:@"fragment"]) {
+ static Class clazz = Nil;
+ if (clazz == Nil)
+ clazz = NSClassFromString(@"WOFragment");
+ return clazz;
+ }
+
if (c0 == 'w' && len == 4 && [tag isEqualToString:@"with"]) {
static Class clazz = Nil;
if (clazz == Nil)
return Nil;
}
-@end /* SxControlElemBuilder */
+@end /* WOxControlElemBuilder */
WOComponent *sComponent;
NSMutableDictionary *qd;
- if ([[_ctx request] isFromClientComponent])
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) {
+ [self->template appendToResponse:_response inContext:_ctx];
return;
+ }
sComponent = [_ctx component];
WOResponse_AddCString(_response, "<a href=\"");
NSString *content;
BOOL doNotDisplay;
- if ([[_ctx request] isFromClientComponent])
+ if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) {
+ [self->template appendToResponse:_response inContext:_ctx];
return;
+ }
content = [self->string valueInContext:_ctx];
doNotDisplay = [self->disabled boolValueInComponent:sComponent];
#include "_WOStaticHTMLElement.h"
#include <NGObjWeb/WOResponse.h>
+#include <NGObjWeb/WOContext.h>
#include "common.h"
@implementation _WOStaticHTMLElement
/* generate response */
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- if (self->text != nil)
- [_response appendContentString:self->text];
+ if ([_ctx isRenderingDisabled] || self->text == nil) return;
+ [_response appendContentString:self->text];
}
@end /* _WOStaticHTMLElement */
AD4D5F9909C83A7D009BFDAF /* SoCookieAuthenticator.m in Sources */ = {isa = PBXBuildFile; fileRef = AD4D5F9509C83A7D009BFDAF /* SoCookieAuthenticator.m */; };
AD4D5F9A09C83A7D009BFDAF /* SoProductLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = AD4D5F9609C83A7D009BFDAF /* SoProductLoader.h */; settings = {ATTRIBUTES = (Public, ); }; };
AD4D5F9B09C83A7D009BFDAF /* SoProductLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = AD4D5F9709C83A7D009BFDAF /* SoProductLoader.m */; };
+ AD4F34B30BAAF5BA00323EB9 /* WOFragment.m in Sources */ = {isa = PBXBuildFile; fileRef = AD4F34B20BAAF5BA00323EB9 /* WOFragment.m */; };
+ AD4F35320BAAF99E00323EB9 /* WOFragment.api in Resources */ = {isa = PBXBuildFile; fileRef = AD4F35310BAAF99E00323EB9 /* WOFragment.api */; };
AD51811406FF7ED0006397CD /* NGImap4.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD51811206FF7ED0006397CD /* NGImap4.framework */; };
AD51811506FF7ED0006397CD /* NGMail.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD51811306FF7ED0006397CD /* NGMail.framework */; };
AD8BF0AA07018CC600EC239A /* WOServerDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = AD8BF0A907018CC600EC239A /* WOServerDefaults.m */; };
AD4D5F9509C83A7D009BFDAF /* SoCookieAuthenticator.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = SoCookieAuthenticator.m; sourceTree = "<group>"; };
AD4D5F9609C83A7D009BFDAF /* SoProductLoader.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = SoProductLoader.h; sourceTree = "<group>"; };
AD4D5F9709C83A7D009BFDAF /* SoProductLoader.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = SoProductLoader.m; sourceTree = "<group>"; };
+ AD4F34B20BAAF5BA00323EB9 /* WOFragment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WOFragment.m; sourceTree = "<group>"; };
+ AD4F35310BAAF99E00323EB9 /* WOFragment.api */ = {isa = PBXFileReference; explicitFileType = text.xml; fileEncoding = 4; path = WOFragment.api; sourceTree = "<group>"; };
AD51811206FF7ED0006397CD /* NGImap4.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NGImap4.framework; path = "$(USER_LIBRARY_DIR)/EmbeddedFrameworks/Wrapper/NGImap4.framework"; sourceTree = "<absolute>"; };
AD51811306FF7ED0006397CD /* NGMail.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NGMail.framework; path = "$(USER_LIBRARY_DIR)/EmbeddedFrameworks/Wrapper/NGMail.framework"; sourceTree = "<absolute>"; };
AD8BF0A907018CC600EC239A /* WOServerDefaults.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = WOServerDefaults.m; sourceTree = "<group>"; };
ADFE54BD06E2493D006628C4 /* WEClientCapabilities.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = WEClientCapabilities.m; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
ADFE54BE06E2493D006628C4 /* WOAdaptor.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = WOAdaptor.m; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
ADFE54BF06E2493D006628C4 /* woapp-gs.make */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 5; indentWidth = 8; path = "woapp-gs.make"; sourceTree = "<group>"; tabWidth = 8; usesTabs = 1; };
- ADFE54C006E2493D006628C4 /* woapp.make */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 5; indentWidth = 8; path = woapp.make; sourceTree = "<group>"; tabWidth = 8; usesTabs = 1; };
ADFE54C106E2493D006628C4 /* WOApplication.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = WOApplication.m; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
ADFE54C206E2493D006628C4 /* WOApplication+defaults.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = "WOApplication+defaults.m"; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
ADFE54C306E2493D006628C4 /* WOApplication+private.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = "WOApplication+private.h"; sourceTree = "<group>"; };
ADFE54C406E2493D006628C4 /* WOApplicationMain.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = WOApplicationMain.m; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
ADFE54C506E2493D006628C4 /* wobundle-gs.make */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 5; indentWidth = 8; path = "wobundle-gs.make"; sourceTree = "<group>"; tabWidth = 8; usesTabs = 1; };
- ADFE54C606E2493D006628C4 /* wobundle.make */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 5; indentWidth = 8; path = wobundle.make; sourceTree = "<group>"; tabWidth = 8; usesTabs = 1; };
ADFE54C706E2493D006628C4 /* WOChildComponentReference.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = WOChildComponentReference.h; sourceTree = "<group>"; };
ADFE54C806E2493D006628C4 /* WOChildComponentReference.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = WOChildComponentReference.m; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
ADFE54C906E2493D006628C4 /* WOComponent.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = WOComponent.m; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
AD084B3E07392CB700D0679C /* WOEntity.api */,
AD084C3D0739380E00D0679C /* WOFileUpload.api */,
AD084C3F0739381C00D0679C /* WOForm.api */,
+ AD4F35310BAAF99E00323EB9 /* WOFragment.api */,
AD084B4007392CD900D0679C /* WOFrame.api */,
AD084B4207392CEF00D0679C /* WOGenericContainer.api */,
AD084B4407392CFB00D0679C /* WOGenericElement.api */,
ADECED40078A4A8300B7221D /* fhs.make */,
ADFE543106E2493C006628C4 /* ngobjweb.make */,
ADFE54BF06E2493D006628C4 /* woapp-gs.make */,
- ADFE54C006E2493D006628C4 /* woapp.make */,
ADFE54C506E2493D006628C4 /* wobundle-gs.make */,
- ADFE54C606E2493D006628C4 /* wobundle.make */,
);
name = Makefiles;
sourceTree = "<group>";
ADFE53BE06E2493C006628C4 /* WOConditional.m */,
ADFE53DE06E2493C006628C4 /* WORepetition.m */,
ADFE53E106E2493C006628C4 /* WOSetCursor.m */,
+ AD4F34B20BAAF5BA00323EB9 /* WOFragment.m */,
);
name = "Control Elements";
sourceTree = "<group>";
AD084C5A073938AB00D0679C /* WOImage.api in Resources */,
ADE763A008BB3BE900F63757 /* WOCopyValue.api in Resources */,
ADE766D908BE836200F63757 /* WOSetHeader.api in Resources */,
+ AD4F35320BAAF99E00323EB9 /* WOFragment.api in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
AD2EC19E08E2E506006B7836 /* WOxTalElemBuilder.m in Sources */,
AD4D5F9909C83A7D009BFDAF /* SoCookieAuthenticator.m in Sources */,
AD4D5F9B09C83A7D009BFDAF /* SoProductLoader.m in Sources */,
+ AD4F34B30BAAF5BA00323EB9 /* WOFragment.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
buildSettings = {
COPY_PHASE_STRIP = NO;
DYLIB_COMPATIBILITY_VERSION = 4.7.0;
- DYLIB_CURRENT_VERSION = 4.7.4;
+ DYLIB_CURRENT_VERSION = 4.7.5;
FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks";
FRAMEWORK_VERSION = A;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
int xmlStyleEmptyElements:1;
int allowEmptyAttributes:1;
int hasNewSession:1; /* session was created during the run */
- int reserved:27;
+ int isRenderingDisabled:1;
+ int reserved:26;
} wcFlags;
@protected
/* SOPE */
+ NSString *fragmentID;
+
+ /* SoObjects */
id clientObject;
NSMutableArray *traversalStack;
NSString *soRequestType; // WebDAV, XML-RPC, METHOD
- (NSArray *)resourceLookupLanguages;
+/* fragments */
+
+- (void)setFragmentID:(NSString *)_fragmentID;
+- (NSString *)fragmentID;
+
+- (void)enableRendering;
+- (void)disableRendering;
+- (BOOL)isRenderingDisabled;
+
@end
#endif /* __NGObjWeb_WOContext_H__ */
NGObjWeb_EXPORT NSString *WORequestValueContextID;
NGObjWeb_EXPORT NSString *WORequestValueSenderID;
NGObjWeb_EXPORT NSString *WORequestValueSessionID;
+NGObjWeb_EXPORT NSString *WORequestValueFragmentID;
NGObjWeb_EXPORT NSString *WONoSelectionString;
@interface WORequest : WOMessage
- (NSString *)cookieValueForKey:(NSString *)_key;
- (NSDictionary *)cookieValues;
+/* SOPE extensions */
+
+- (NSString *)fragmentID;
+- (BOOL)isFragmentIDInRequest;
+
@end
#if COMPILING_NGOBJWEB
# version file
-SUBMINOR_VERSION:=4
+SUBMINOR_VERSION:=5
# v4.5.234 requires libDOM v4.5.21
# v4.5.214 requires libNGExtensions v4.5.179
NSStringFromClass([self class])];
return;
}
-
+
+ if ([_ctx isRenderingDisabled]) return;
+
if (![[[_ctx request] clientCapabilities] isJavaScriptBrowser])
/* only works on JavaScript browsers ... */
return;
-
+
[_response appendContentString:@"<input type='hidden' name='"];
[_response appendContentString:WEClientDetectorFormName];
[_response appendContentString:@"' value='browserConfig' />"];
[self warnWithFormat:
@"did not find child component %@ of parent %@",
self->childName, [parent name]];
+ if ([_ctx isRenderingDisabled]) return;
[_response appendContentString:@"<pre>[missing component: "];
[_response appendContentHTMLString:self->childName];
[_response appendContentString:@"]</pre>"];
@implementation WOContext
+ (int)version {
- return 8;
+ return 9;
}
static Class WOContextClass = Nil;
self->request = [_request retain];
self->response = [[WOResponse responseWithRequest:_request] retain];
+
+ if (_request && [_request isFragmentIDInRequest]) {
+ [self setFragmentID:[_request fragmentID]];
+ [self disableRendering];
+ }
}
return self;
}
[self->urlPrefix release];
[self->elementID release];
[self->reqElementID release];
+ [self->fragmentID release];
[self->activeFormElement release];
[self->page release];
[self->awakeComponents release];
: [[self request] browserLanguages];
}
+/* fragments */
+
+- (void)setFragmentID:(NSString *)_fragmentID {
+ ASSIGNCOPY(self->fragmentID, _fragmentID);
+}
+- (NSString *)fragmentID {
+ return self->fragmentID;
+}
+
+- (void)enableRendering {
+ self->wcFlags.isRenderingDisabled = NO;
+}
+- (void)disableRendering {
+ self->wcFlags.isRenderingDisabled = YES;
+}
+- (BOOL)isRenderingDisabled {
+ return self->wcFlags.isRenderingDisabled;
+}
/* DeprecatedMethodsInWO4 */
@end
#endif
-NGObjWeb_DECLARE NSString *WORequestValueData = @"wodata";
-NGObjWeb_DECLARE NSString *WORequestValueInstance = @"woinst";
-NGObjWeb_DECLARE NSString *WORequestValuePageName = @"wopage";
-NGObjWeb_DECLARE NSString *WORequestValueContextID = @"_c";
-NGObjWeb_DECLARE NSString *WORequestValueSenderID = @"_i";
-NGObjWeb_DECLARE NSString *WORequestValueSessionID = @"wosid";
-NGObjWeb_DECLARE NSString *WONoSelectionString = @"WONoSelectionString";
+NGObjWeb_DECLARE NSString *WORequestValueData = @"wodata";
+NGObjWeb_DECLARE NSString *WORequestValueInstance = @"woinst";
+NGObjWeb_DECLARE NSString *WORequestValuePageName = @"wopage";
+NGObjWeb_DECLARE NSString *WORequestValueContextID = @"_c";
+NGObjWeb_DECLARE NSString *WORequestValueSenderID = @"_i";
+NGObjWeb_DECLARE NSString *WORequestValueSessionID = @"wosid";
+NGObjWeb_DECLARE NSString *WORequestValueFragmentID = @"wofid";
+NGObjWeb_DECLARE NSString *WONoSelectionString = @"WONoSelectionString";
@interface WOCoreApplication(Resources)
+ (NSString *)findNGObjWebResource:(NSString *)_name ofType:(NSString *)_ext;
return values;
}
+/* SOPE extensions */
+
+- (NSString *)fragmentID {
+ NSString *v;
+
+ v = [self formValueForKey:WORequestValueFragmentID];
+ if (v == nil) return nil;
+ v = [v stringByTrimmingWhiteSpaces];
+ return [v isNotEmpty] ? v : nil;
+}
+
+- (BOOL)isFragmentIDInRequest {
+ return [self fragmentID] != nil ? YES : NO;
+}
+
/* logging */
- (BOOL)isDebuggingEnabled {
if (__R__) {__R__->addHStr(__R__, @selector(appendContentHTMLString:), \
__C__);}
+#define WOResponse_AppendBeginTag(__R__,__C__) \
+if (__R__) { \
+ __R__->addChar(__R__, @selector(appendContentCharacter:), '<'); \
+ __R__->addStr(__R__, @selector(appendContentString:), __C__); \
+}
+#define WOResponse_AppendBeginTagEnd(__R__) \
+if (__R__) {__R__->addChar(__R__, @selector(appendContentCharacter:), '>');}
+
+#define WOResponse_AppendEndTag(__R__,__C__) \
+if (__R__) { \
+ __R__->addCStr(__R__, @selector(appendContentCString:), \
+ (const unsigned char *)"</"); \
+ __R__->addStr(__R__, @selector(appendContentString:), __C__); \
+ __R__->addChar(__R__, @selector(appendContentCharacter:), '>'); \
+}
+
+#define WOResponse_AppendAttribute(__R__,__K__,__V__) \
+if (__R__) { \
+ __R__->addChar(__R__, @selector(appendContentCharacter:), ' '); \
+ __R__->addStr(__R__, @selector(appendContentString:), __K__); \
+ __R__->addCStr(__R__, @selector(appendContentCString:), \
+ (const unsigned char *)"=\""); \
+ __R__->addHStr(__R__, @selector(appendContentHTMLString:), __V__); \
+ __R__->addChar(__R__, @selector(appendContentCharacter:), '\"'); \
+}
+
// TODO: performance ! - use static buffer and appendContentCString !
#define WOResponse_AddUInt(__R__,__C__) \
+2007-03-17 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * *.m: ported all elements to honour the new
+ -[WOContext isRenderingDisabled] flag. (v4.7.93)
+
2006-11-08 Helge Hess <helge.hess@opengroupware.org>
* WETableView/WETableCell.m: fixed a MacOS compilation warning
}
- (void)appendToResponse:(WOResponse *)_response
- inContext:(WOContext *)_ctx
+ inContext:(WOContext *)_ctx
{
WOComponent *comp;
NSString *tmp;
NSString *tt; // toolTip
WEClientCapabilities *ccaps;
+ if ([_ctx isRenderingDisabled]) return;
+
comp = [_ctx component];
ccaps = [[_ctx request] clientCapabilities];
tt = [self->toolTip stringValueInComponent:comp];
WEClientCapabilities *ccaps;
BOOL ie, ns;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
eid = [[[_ctx elementID] componentsSeparatedByString:@"."]
componentsJoinedByString:@"_"];
comp = [_ctx component];
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
WOComponent *comp;
NSString *tmp;
- NSString *url = nil;
+ NSString *url;
WEClientCapabilities *ccaps;
BOOL ie, ns;
NSString *eid;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
comp = [_ctx component];
ccaps = [[_ctx request] clientCapabilities];
ie = [ccaps isJavaScriptBrowser] && [ccaps isInternetExplorer];
url = [_ctx componentActionURL];
else if (self->href != nil)
url = [self->href stringValueInComponent:comp];
-
+ else
+ url = nil;
+
if (ie) {
tmp = [[NSString alloc] initWithFormat:
@"<div align=\"left\" class=\"menuItem\" url=\"%@\">"
NSString *eid = nil;
NSString *prfx = nil;
+ if ([_ctx isRenderingDisabled]) return;
+
ccaps = [[_ctx request] clientCapabilities];
eid = [self->identifier stringValueInComponent:[_ctx component]];
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
WOResourceManager *rm;
- WOComponent *sComponent = [_ctx component];
- NSString *lidentifier, *lname, *lfw;
- NSArray *langs;
-
- lname = [self->name stringValueInComponent:sComponent];
+ WOComponent *sComponent;
+ NSString *lidentifier, *lname, *lfw;
+ NSArray *langs;
+
+ if ([_ctx isRenderingDisabled]) return;
+
+ sComponent = [_ctx component];
+ lname = [self->name stringValueInComponent:sComponent];
if (![lname isNotEmpty]) lname = @"Localizable";
lfw = [self->framework stringValueInComponent:sComponent];
# version file
-SUBMINOR_VERSION:=92
+SUBMINOR_VERSION:=93
+# v4.7.93 requires libNGObjWeb v4.7.5
# v4.5.76 requires libNGObjWeb v4.5.176
# v4.5.75 requires libNGObjWeb v4.5.174
# v4.5.65 requires libNGObjWeb v4.5.106
}
- (void)appendToResponse:(WOResponse *)_resp inContext:(WOContext *)_ctx {
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_resp inContext:_ctx];
+ return;
+ }
+
#if 1
[self appendWithScrolling:_resp inContext:_ctx];
#else
}
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
[_response appendContentString:
@"<table border='0' cellpadding='0' cellspacing='0'>"
@"<tr>"
inContext: (WOContext *)_ctx
{
WOComponent *comp;
+
+ if ([_ctx isRenderingDisabled]) return;
+
comp = [_ctx component];
[[self class] appendWEDateFieldScriptToResponse: _response inContext:_ctx
BOOL doScript;
NSString *scriptId;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_resp inContext:_ctx];
+ return;
+ }
+
comp = [_ctx component];
doScript = [self->allowScript boolValueInComponent:comp];
scriptId = [[[_ctx elementID] componentsSeparatedByString:@"."]
NSString *fragId = nil;
NSString *scriptId = nil;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_resp inContext:_ctx];
+ return;
+ }
+
comp = [_ctx component];
fragId = [self->fragmentIdentifier stringValueInComponent:comp];
}
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
[self _appendDateFieldToResponse:_response inContext:_ctx];
}
NSString *ttag;
BOOL doDnD;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
doDnD = [[[_ctx request] clientCapabilities] doesSupportDHTMLDragAndDrop];
if (doDnD) {
NSString *containerID = nil;
BOOL doDnD, doSwap, doAttach;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
doDnD = [[[_ctx request] clientCapabilities] doesSupportDHTMLDragAndDrop];
//doDnD = YES;
}
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
+ if ([_ctx isRenderingDisabled]) return;
+
if ([self isEpozBrowserInContext:_ctx])
[self appendEpozToResponse:_response inContext:_ctx];
else
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>4.5</string>
+ <string>4.7</string>
</dict>
</plist>
ADFE77BA06E2986F006628C4 /* EOControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADD6610D06DA3D1F007161CA /* EOControl.framework */; };
/* End PBXBuildFile section */
-/* Begin PBXBuildStyle section */
- ADD65B6806DA32D6007161CA /* Development */ = {
- isa = PBXBuildStyle;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "APPLE_RUNTIME=1",
- "NeXT_Foundation_LIBRARY=1",
- "COCOA_Foundation_LIBRARY=1",
- "NeXT_RUNTIME=1",
- "COMPILE_AS_FRAMEWORK=1",
- "DEBUG=1",
- );
- };
- name = Development;
- };
- ADD65B6906DA32D6007161CA /* Wrapper */ = {
- isa = PBXBuildStyle;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- DEPLOYMENT_LOCATION = NO;
- DEPLOYMENT_POSTPROCESSING = YES;
- DSTROOT = /;
- DYLIB_INSTALL_NAME_BASE = "@executable_path/../Frameworks/";
- FRAMEWORK_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/EmbeddedFrameworks";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
- GCC_OPTIMIZATION_LEVEL = 3;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "APPLE_RUNTIME=1",
- "NeXT_Foundation_LIBRARY=1",
- "COCOA_Foundation_LIBRARY=1",
- "NeXT_RUNTIME=1",
- "COMPILE_AS_FRAMEWORK=1",
- );
- SKIP_INSTALL = YES;
- SYMROOT = "$(USER_LIBRARY_DIR)/EmbeddedFrameworks";
- TEMP_DIR = "$(SYMROOT)/$(PROJECT_NAME).build";
- UNSTRIPPED_PRODUCT = NO;
- ZERO_LINK = NO;
- };
- name = Wrapper;
- };
-/* End PBXBuildStyle section */
-
/* Begin PBXContainerItemProxy section */
ADFE77B606E297B2006628C4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
);
buildRules = (
);
- buildSettings = {
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 4.7.92;
- FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- FRAMEWORK_VERSION = A;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = common.h;
- GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
- GCC_WARN_UNKNOWN_PRAGMAS = NO;
- INFOPLIST_FILE = "WEExtensions-Info.plist";
- INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = (
- "-seg1addr",
- 0xC4000000,
- "-headerpad_max_install_names",
- );
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = WEExtensions;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = "-Wmost";
- };
dependencies = (
);
name = WEExtensions;
productName = WEExtensions;
productReference = ADD65D5806DA372D007161CA /* WEExtensions.framework */;
- productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>WEExtensions</string>
- <key>CFBundleIdentifier</key>
- <string>org.OpenGroupware.SOPE.WEExtensions</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundlePackageType</key>
- <string>FMWK</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
-</dict>
-</plist>
-";
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
ADD65B6A06DA32D6007161CA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = ADA07980085738E600993825 /* Build configuration list for PBXProject "WEExtensions" */;
- buildSettings = {
- };
- buildStyles = (
- ADD65B6806DA32D6007161CA /* Development */,
- ADD65B6906DA32D6007161CA /* Wrapper */,
- );
hasScannedForEncodings = 0;
mainGroup = ADD65B6606DA32D6007161CA;
productRefGroup = ADD65D5906DA372D007161CA /* Products */;
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
- DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_COMPATIBILITY_VERSION = 4.7.0;
DYLIB_CURRENT_VERSION = 4.7.92;
FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks";
FRAMEWORK_VERSION = A;
DEPLOYMENT_LOCATION = NO;
DEPLOYMENT_POSTPROCESSING = YES;
DSTROOT = /;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 4.7.92;
+ DYLIB_COMPATIBILITY_VERSION = 4.7.0;
+ DYLIB_CURRENT_VERSION = 4.7.93;
DYLIB_INSTALL_NAME_BASE = "@executable_path/../Frameworks/";
FRAMEWORK_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/EmbeddedFrameworks";
FRAMEWORK_VERSION = A;
BOOL hasRightBottom = NO;
BOOL hasCell = NO;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
[self _calcMatrixInContext:_ctx];
comp = [_ctx component];
BOOL isEdge;
int cols;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
orient = [self->orientation stringValueInComponent:[_ctx component]];
isEdge = ([orient rangeOfString:@"/"].length > 0);
NSDictionary *monthViewContextDict;
id tmp;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
if ((tmp = [_ctx monthOverviewQueryObjects]) != nil) {
[(NSMutableArray *)tmp addObject:@"title"];
return;
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
NSString *href;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
href = [_ctx componentActionURL];
[_response appendContentCString:(unsigned char *)"<a href=\""];
[_response appendContentString:href];
NSArray *keys;
unsigned i, count;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
[self updateConfigInContext:_ctx];
doForm = NO; /* generate form controls ? */
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
NSString *tmp;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
if ((tmp = [_ctx objectForKey:WEPageView_HEAD]))
[self appendHead:tmp toResponse:_response inContext:_ctx];
else if ((tmp = [_ctx objectForKey:WEPageView_BODY]))
/* evaluate */
if (![qualifier respondsToSelector:@selector(evaluateWithObject:)]) {
- [self logWithFormat:
- @"ERROR: got a qualifier which does not respond to "
- @"evaluateWithObject: %@", qualifier];
+ [self errorWithFormat:@"got a qualifier which does not respond to "
+ @"evaluateWithObject: %@", qualifier];
doShow = NO;
}
else
NSFormatter *fmt = nil;
id v = nil;
-
+
+ if ([_ctx isRenderingDisabled]) {
+ if (_doShow(self, _ctx)) {
+ [_ctx appendElementIDComponent:@"1"];
+ [self->template appendToResponse:_response inContext:_ctx];
+ [_ctx deleteLastElementIDComponent];
+ }
+ return;
+ }
+
if (!_doShow(self, _ctx)) return;
comp = [_ctx component];
NSString *k = nil;
NSArray *ks = nil;
-
k = [self->key stringValueInComponent:[_ctx component]];
ks = [self->keys valueInComponent:[_ctx component]];
if ((k == nil) && (ks == nil)) {
#if DEBUG
- [[_ctx component] logWithFormat:
- @"Warning! WECase: Neither 'key' nor 'keys' set!!!"];
+ [[_ctx component] warnWithFormat:
+ @"WECase: Neither 'key' nor 'keys' set!!!"];
#endif
return;
}
if ((k != nil) && (ks != nil)) {
#if DEBUG
- [[_ctx component] logWithFormat:
- @"Warning! WECase: Both, 'key' and 'keys' are set!!!"];
+ [[_ctx component] warnWithFormat:
+ @"WECase: Both, 'key' and 'keys' are set!!!"];
#endif
return;
}
NSString *k;
BOOL doForm;
id tmp;
-
+
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
doForm = [_ctx isInForm];
- k = [self->key stringValueInComponent:[_ctx component]];
-
+ k = [self->key stringValueInComponent:[_ctx component]];
+
if ((tmp = [_ctx objectForKey:WETabView_HEAD])) {
if ([tmp isEqual:WETabView_COLLECT]) {
[self _collectInContext:_ctx key:k];
activeKey:tmp key:k];
}
else {
- NSLog(@"WARNING(%s): invalid WETabItem state !!!", __PRETTY_FUNCTION__);
+ [self errorWithFormat:@"(%s): invalid WETabItem state !!!",
+ __PRETTY_FUNCTION__];
[_response appendContentString:@"[invalid state]"];
}
}
NSArray *keys;
int tabViewCount; /* used for image id's and writing script once */
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
doScript = NO; /* perform tab-clicks on browser (use javascript) */
tabViewCount = [[_ctx valueForKey:@"WETabViewScriptDone"] intValue];
cmp = [_ctx component];
NSArray *allSpans;
unsigned rowCount, colCount, count;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
self->component = [_ctx component];
self->objs =
[[[self->list valueInComponent:self->component] copy] autorelease];
if ([self->subElems count] == 0) {
/* no content */
- NSLog(@"WARNING: no sub-elements !");
+ [self warnWithFormat:@"no sub-elements !"];
return;
}
NSString *tag;
int cspan, rspan;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
if ((tmp = [_ctx valueForKey:@"WETableMatrix_Query"])) {
[tmp addObject:[self modeKey]];
return;
NSString *tag;
int ispan;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
pos = [self->position stringValueInComponent:[_ctx component]];
if ((tmp = [_ctx valueForKey:@"WETableMatrix_Query"]) != nil) {
/* responder */
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
if ([_ctx objectForKey:WETableView_CollectMode]) {
[self _collectDataInContext:_ctx];
return;
/* responder */
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
if ([[_ctx objectForKey:WETableView_HeaderMode] boolValue]) {
WOComponent *cmp = nil;
NSString *bg = nil;
*/
WOComponent *cmp;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
[self updateStateInContext:_ctx];
[self updateScriptIdInContext:_ctx];
[self updateConfigInContext:_ctx];
}
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- [self _appendTimeFieldToResponse:_response inContext:_ctx];
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ }
+ else {
+ [self _appendTimeFieldToResponse:_response inContext:_ctx];
+ }
}
@end /* WETimeField */
/* generate response */
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
self->doTable = ([_ctx objectForKey:WETreeView_RenderNoTable] == nil)?YES:NO;
if ([_ctx objectForKey:WETreeView_HEADER_MODE])
BOOL isTree;
BOOL doTable;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
if (![_ctx objectForKey:WETreeView_HEADER_MODE])
return;
BOOL doTable;
int i, cnt, depth;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
[self updateConfigInContext:_ctx];
comp = [_ctx component];
}
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
[self _calcMatrixInContext:_ctx];
[_response appendContentString:@"<table "];
int i;
BOOL showWeekend;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
[self _calcMatrixInContext:_ctx];
comp = [_ctx component];
+2007-03-17 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * WEPrototypeScript.m, WELiveLink.m: obey WOContext's new
+ -isRenderingDisabled flag (v4.7.9)
+
2006-08-28 Marcus Mueller <znek@mulle-kybernetik.com>
* WEPrototypeElemBuilder.m: added "prototype-script" reference to
# version file
-SUBMINOR_VERSION:=8
+SUBMINOR_VERSION:=9
+# v4.7.9 requires libNGObjWeb v4.7.5
# v4.5.1 requires libNGObjWeb v4.5.170
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
NSString *s;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
/* first ensure that prototype is loaded */
[WEPrototypeScript appendToResponse:_response inContext:_ctx];
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
- DYLIB_COMPATIBILITY_VERSION = 4.5.1;
- DYLIB_CURRENT_VERSION = 4.7.8;
+ DYLIB_COMPATIBILITY_VERSION = 4.7.0;
+ DYLIB_CURRENT_VERSION = 4.7.9;
FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks";
FRAMEWORK_VERSION = A;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
NSString *url;
- if ([self wasDeliveredInContext:_ctx])
- return;
+ if ([_ctx isRenderingDisabled]) return;
+ if ([self wasDeliveredInContext:_ctx]) return;
url = [_ctx directActionURLForActionNamed:
@"WEPrototypeScriptAction/default.js"
+2007-03-17 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * *.m: ported all elements to honour the new
+ -[WOContext isRenderingDisabled] flag. (v4.7.31)
+
2006-07-03 Helge Hess <helge.hess@opengroupware.org>
* use %p for pointer formats, fixed gcc 4.1 warnings (v4.5.30)
- (void)appendToResponse:(WOResponse *)_response
inContext:(WOContext *)_ctx
{
- WOComponent *comp;
- NSString *tmp;
- NSArray *languages;
+ WOComponent *comp;
+ NSString *tmp;
+ NSArray *languages;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
comp = [_ctx component];
// link
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
NSString *msg;
WOComponent *comp;
+
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
comp = [_ctx component];
msg = (self->confirmMessage)
NSArray *ta;
NSString *s;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
comp = [_ctx component];
tunselected = [self->unselectedImage stringValueInComponent:comp];
tselected = [self->selectedImage stringValueInComponent:comp];
NSString *tmp;
NSArray *languages;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_resp inContext:_ctx];
+ return;
+ }
+
comp = [_ctx component];
// link
NSString *obj;
NSRange r;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
comp = [_ctx component];
userAgent = [[_ctx request] headerForKey:@"user-agent"];
normalColor = [self->unselectedColor stringValueInComponent:comp];
NSString *terrMesg, *tformName, *tinput, *ttext;
NSString *s;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
comp = [_ctx component];
elID = [self buildJSSaveID:[_ctx elementID]];
# Version file
-SUBMINOR_VERSION:=30
+SUBMINOR_VERSION:=31
+# v4.7.31 requires libNGObjWeb v4.7.5
# v4.5.23 requires libNGObjWeb v4.5.145
# v4.5.22 requires libNGObjWeb v4.5.106
unsigned r, rowCount; // row index
unsigned cnt;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
cmp = [_ctx component];
colCount = [self->maxColumns unsignedIntValueInComponent:cmp];
array = [self->list valueInComponent:cmp];
else
isCollapsed = ![self->visibility boolValueInComponent:comp];
+ if ([_ctx isRenderingDisabled] && !isCollapsed) {
+ [_ctx appendZeroElementIDComponent];
+ [self->template appendToResponse:_resp inContext:_ctx];
+ [_ctx deleteLastElementIDComponent];
+ return;
+ }
+
img = (isCollapsed)
? [self->closedImageFileName stringValueInComponent:comp]
: [self->openedImageFileName stringValueInComponent:comp];
NSEnumerator *keyEnum;
NSString *k;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_resp inContext:_ctx];
+ return;
+ }
+
comp = [_ctx component];
dict = [self->dictionary valueInComponent:comp];
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>4.5</string>
+ <string>4.7</string>
</dict>
</plist>
ADFE73BF06E28EA1006628C4 /* WOxExtElemBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = ADFE73AA06E28EA1006628C4 /* WOxExtElemBuilder.m */; };
/* End PBXBuildFile section */
-/* Begin PBXBuildStyle section */
- ADD65B6806DA32D6007161CA /* Development */ = {
- isa = PBXBuildStyle;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "APPLE_RUNTIME=1",
- "NeXT_Foundation_LIBRARY=1",
- "COCOA_Foundation_LIBRARY=1",
- "NeXT_RUNTIME=1",
- "COMPILE_AS_FRAMEWORK=1",
- "DEBUG=1",
- );
- };
- name = Development;
- };
- ADD65B6906DA32D6007161CA /* Wrapper */ = {
- isa = PBXBuildStyle;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- DEPLOYMENT_LOCATION = NO;
- DEPLOYMENT_POSTPROCESSING = YES;
- DSTROOT = /;
- DYLIB_INSTALL_NAME_BASE = "@executable_path/../Frameworks/";
- FRAMEWORK_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/EmbeddedFrameworks";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
- GCC_OPTIMIZATION_LEVEL = 3;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "APPLE_RUNTIME=1",
- "NeXT_Foundation_LIBRARY=1",
- "COCOA_Foundation_LIBRARY=1",
- "NeXT_RUNTIME=1",
- "COMPILE_AS_FRAMEWORK=1",
- );
- SKIP_INSTALL = YES;
- SYMROOT = "$(USER_LIBRARY_DIR)/EmbeddedFrameworks";
- TEMP_DIR = "$(SYMROOT)/$(PROJECT_NAME).build";
- UNSTRIPPED_PRODUCT = NO;
- ZERO_LINK = NO;
- };
- name = Wrapper;
- };
-/* End PBXBuildStyle section */
-
/* Begin PBXContainerItemProxy section */
ADFE75EF06E28FE9006628C4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
remoteGlobalIDString = ADFE6FFE06E2765E006628C4;
remoteInfo = "SoCore (SXP)";
};
- ADFE75F806E2905F006628C4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = ADFE73EA06E28FBB006628C4 /* NGObjWeb.xcodeproj */;
- proxyType = 1;
- remoteGlobalIDString = ADD65D5706DA372D007161CA;
- remoteInfo = NGObjWeb;
- };
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
);
buildRules = (
);
- buildSettings = {
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 4.7.30;
- FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- FRAMEWORK_VERSION = A;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = common.h;
- GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
- GCC_WARN_UNKNOWN_PRAGMAS = NO;
- INFOPLIST_FILE = "WOExtensions-Info.plist";
- INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = (
- "-seg1addr",
- 0xC4300000,
- "-headerpad_max_install_names",
- );
- OTHER_REZFLAGS = "";
- PRODUCT_NAME = WOExtensions;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = "-Wmost";
- };
dependencies = (
- ADFE75F906E2905F006628C4 /* PBXTargetDependency */,
);
name = WOExtensions;
productName = WOExtensions;
productReference = ADD65D5806DA372D007161CA /* WOExtensions.framework */;
- productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>WOExtensions</string>
- <key>CFBundleIdentifier</key>
- <string>org.OpenGroupware.SOPE.WOExtensions</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundlePackageType</key>
- <string>FMWK</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
-</dict>
-</plist>
-";
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
ADD65B6A06DA32D6007161CA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = ADA07954085738DC00993825 /* Build configuration list for PBXProject "WOExtensions" */;
- buildSettings = {
- };
- buildStyles = (
- ADD65B6806DA32D6007161CA /* Development */,
- ADD65B6906DA32D6007161CA /* Wrapper */,
- );
hasScannedForEncodings = 0;
mainGroup = ADD65B6606DA32D6007161CA;
productRefGroup = ADD65D5906DA372D007161CA /* Products */;
};
/* End PBXSourcesBuildPhase section */
-/* Begin PBXTargetDependency section */
- ADFE75F906E2905F006628C4 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = "NGObjWeb (from NGObjWeb.xcodeproj)";
- targetProxy = ADFE75F806E2905F006628C4 /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
/* Begin XCBuildConfiguration section */
ADA07951085738DC00993825 /* Development */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 4.7.30;
+ DYLIB_COMPATIBILITY_VERSION = 4.7.0;
+ DYLIB_CURRENT_VERSION = 4.7.31;
FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks";
FRAMEWORK_VERSION = A;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
unsigned r, rowCount; // row index
unsigned cnt;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
cmp = [_ctx component];
colCount = [self->maxColumns unsignedIntValueInComponent:cmp];
array = [self->list valueInComponent:cmp];
- (void)takeValuesFromRequest:(WORequest *)_req inContext:(WOContext *)_ctx {
}
- (id)invokeActionForRequest:(WORequest *)_req inContext:(WOContext *)_ctx {
- [self logWithFormat:@"WARNING: called %s on WORedirect!",
+ [self warnWithFormat:@"called %s on WORedirect!",
__PRETTY_FUNCTION__];
return nil;
}
NSString *loc;
if (![self->url isNotNull]) {
- [self logWithFormat:@"ERROR: missing URL for redirect!"];
+ [self errorWithFormat:@"missing URL for redirect!"];
return;
}
loc = [self->url stringValue];
if ([loc length] == 0) {
- [self logWithFormat:@"ERROR: got invalid URL for redirect: '%@'(%@)",
+ [self errorWithFormat:@"got invalid URL for redirect: '%@'(%@)",
self->url, NSStringFromClass([self->url class])];
return;
}
[_ctx appendElementIDComponent:@"tab"];
{
WOComponent *sComponent;
- NSArray *ttabs;
- unsigned i;
+ NSArray *ttabs;
+ unsigned i;
sComponent = [_ctx component];
- ttabs = [self->tabs valueInComponent:sComponent];
+ ttabs = [self->tabs valueInComponent:sComponent];
[_ctx appendZeroElementIDComponent];
}
- (id)invokeActionForRequest:(WORequest *)_req inContext:(WOContext *)_ctx {
- id result;
+ id result;
NSString *section;
section = [_ctx currentElementID];
unsigned i, selIdx;
NSString *selColor, *unselColor, *s;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
sComponent = [_ctx component];
ttabs = [self->tabs valueInComponent:sComponent];
unsigned cnt;
unsigned ownTDCount = 0;
+ if ([_ctx isRenderingDisabled]) {
+ [self->template appendToResponse:_response inContext:_ctx];
+ return;
+ }
+
cmp = [_ctx component];
colCount = [self->maxColumns unsignedIntValueInComponent:cmp];
array = [self->list valueInComponent:cmp];
NSNumber *v; // value association
NSString *nFormat; // numberFormat association
NSString *color;
- NSString *result = nil;
+ NSString *result;
+
+ if ([_ctx isRenderingDisabled]) return;
comp = [_ctx component];
low = [self->lowColor stringValueInComponent:comp];