From: znek Date: Sat, 17 Mar 2007 16:55:15 +0000 (+0000) Subject: Ported "fragmentID" stuff from JOPE to SOPE. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58f59bc99b1f84bf907764ba0e6929863956a1c1;p=sope Ported "fragmentID" stuff from JOPE to SOPE. git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1458 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index fd215036..1faa09bd 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,3 +1,23 @@ +2007-03-16 Marcus Mueller + + * 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 * WORepetition.m: Reverted 'list' binding extensions as this had side diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOActionURL.m b/sope-appserver/NGObjWeb/DynamicElements/WOActionURL.m index bc766ad4..b0139641 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOActionURL.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOActionURL.m @@ -184,8 +184,10 @@ 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]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOBody.m b/sope-appserver/NGObjWeb/DynamicElements/WOBody.m index 4fe6a3be..0e2a9a9e 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOBody.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOBody.m @@ -91,7 +91,7 @@ NSString *uUri; NSString *uFi; - if ([[_ctx request] isFromClientComponent]) { + if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) { [self->template appendToResponse:_response inContext:_ctx]; return; } diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOCheckBox.m b/sope-appserver/NGObjWeb/DynamicElements/WOCheckBox.m index 0fffe99e..2030517b 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOCheckBox.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOCheckBox.m @@ -83,7 +83,7 @@ NSString *v; BOOL isChecked; - if ([[_ctx request] isFromClientComponent]) + if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) return; v = [self->value stringValueInComponent:[_ctx component]]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOCheckBoxList.m b/sope-appserver/NGObjWeb/DynamicElements/WOCheckBoxList.m index 1e8c64fe..86d9863d 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOCheckBoxList.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOCheckBoxList.m @@ -146,7 +146,7 @@ unsigned cnt; BOOL canSetIndex, canSetItem; - if ([[_ctx request] isFromClientComponent]) + if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) return; sComponent = [_ctx component]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOComponentReference.m b/sope-appserver/NGObjWeb/DynamicElements/WOComponentReference.m index cdac56a7..5b9b239e 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOComponentReference.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOComponentReference.m @@ -190,9 +190,11 @@ _updateComponent(WOComponentReference *self, WOContext *_ctx) 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:@"]"]; + } } } diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOEmbeddedObject.m b/sope-appserver/NGObjWeb/DynamicElements/WOEmbeddedObject.m index 7edefac1..e7ad0129 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOEmbeddedObject.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOEmbeddedObject.m @@ -122,7 +122,7 @@ #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]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOEntity.m b/sope-appserver/NGObjWeb/DynamicElements/WOEntity.m index 4d699a01..8960f86d 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOEntity.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOEntity.m @@ -108,7 +108,7 @@ - (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]]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOFileUpload.m b/sope-appserver/NGObjWeb/DynamicElements/WOFileUpload.m index 9e763c9d..03a37377 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOFileUpload.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOFileUpload.m @@ -158,7 +158,7 @@ static NGMimeType *multipartFormData = nil; - (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]]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOForm.m b/sope-appserver/NGObjWeb/DynamicElements/WOForm.m index 32f7fbfc..dbe4ddfb 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOForm.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOForm.m @@ -346,7 +346,7 @@ static int debugTakeValues = -1; WOComponent *sComponent; NSString *queryString = nil; - if ([[_ctx request] isFromClientComponent]) { + if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) { [self->template appendToResponse:_response inContext:_ctx]; return; } diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOFragment.api b/sope-appserver/NGObjWeb/DynamicElements/WOFragment.api new file mode 100644 index 00000000..6562ab74 --- /dev/null +++ b/sope-appserver/NGObjWeb/DynamicElements/WOFragment.api @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOFragment.m b/sope-appserver/NGObjWeb/DynamicElements/WOFragment.m new file mode 100644 index 00000000..2b88def2 --- /dev/null +++ b/sope-appserver/NGObjWeb/DynamicElements/WOFragment.m @@ -0,0 +1,211 @@ +/* + 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 + * + */ +#include "decommon.h" +#include +#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 */ diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOFrame.m b/sope-appserver/NGObjWeb/DynamicElements/WOFrame.m index 1aae347e..da82f8e2 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOFrame.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOFrame.m @@ -141,11 +141,15 @@ } - (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, "otherTagString stringValueInComponent: - [_ctx component]]); + sComponent]); } WOResponse_AddEmptyCloseParens(_response, _ctx); } diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOGenericContainer.m b/sope-appserver/NGObjWeb/DynamicElements/WOGenericContainer.m index 45c5c4be..f673bbc6 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOGenericContainer.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOGenericContainer.m @@ -80,9 +80,11 @@ 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: diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOGenericElement.m b/sope-appserver/NGObjWeb/DynamicElements/WOGenericElement.m index 9c756760..f97fe28d 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOGenericElement.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOGenericElement.m @@ -209,7 +209,7 @@ typedef struct { WOComponent *sComponent; NSString *tag; - if ([[_ctx request] isFromClientComponent]) + if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) return; sComponent = [_ctx component]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOHiddenField.m b/sope-appserver/NGObjWeb/DynamicElements/WOHiddenField.m index e5be4c2c..356a746b 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOHiddenField.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOHiddenField.m @@ -42,7 +42,7 @@ NSString *v; BOOL isDisabled; - if ([[_ctx request] isFromClientComponent]) + if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) return; isDisabled = [self->disabled boolValueInComponent:[_ctx component]]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOHtml.m b/sope-appserver/NGObjWeb/DynamicElements/WOHtml.m index 27925b0b..6bf32c94 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOHtml.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOHtml.m @@ -72,14 +72,14 @@ /* 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, ""); + if (doRender) + WOResponse_AddCString(_response, ""); [self->template appendToResponse:_response inContext:_ctx]; - WOResponse_AddCString(_response, ""); + if (doRender) + WOResponse_AddCString(_response, ""); } /* description */ diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOIFrame.m b/sope-appserver/NGObjWeb/DynamicElements/WOIFrame.m index 98632ba6..81f8333e 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOIFrame.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOIFrame.m @@ -146,39 +146,46 @@ } - (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, ""); + 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, ""); + } // description diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOImage.m b/sope-appserver/NGObjWeb/DynamicElements/WOImage.m index e51a99a6..a4b03fba 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOImage.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOImage.m @@ -89,7 +89,7 @@ } - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { - if ([[_ctx request] isFromClientComponent]) + if ([_ctx isRenderingDisabled] || [[_ctx request] isFromClientComponent]) return; WOResponse_AddCString(_response, "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) diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOJavaScript.m b/sope-appserver/NGObjWeb/DynamicElements/WOJavaScript.m index 69510418..cb62d29d 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOJavaScript.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOJavaScript.m @@ -117,17 +117,17 @@ - (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, "type stringValueInComponent:sComponent]) != nil) { WOResponse_AddCString(_response, " type=\""); [_response appendContentHTMLAttributeValue:st]; @@ -136,7 +136,7 @@ else { WOResponse_AddCString(_response, " type=\"text/javascript\""); } - + /* add URL to script */ if (self->scriptSource != nil) { st = [self->scriptSource stringValueInComponent:sComponent]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOMetaRefresh.m b/sope-appserver/NGObjWeb/DynamicElements/WOMetaRefresh.m index 8c64ed98..8f68a644 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOMetaRefresh.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOMetaRefresh.m @@ -148,13 +148,14 @@ 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, "list valueInComponent:[_ctx component]]; if ([top count] > 0) { [self appendList:top diff --git a/sope-appserver/NGObjWeb/DynamicElements/WONoContentElement.m b/sope-appserver/NGObjWeb/DynamicElements/WONoContentElement.m index fa95763b..f6ae7a61 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WONoContentElement.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WONoContentElement.m @@ -22,6 +22,7 @@ #include "WONoContentElement.h" #include #include +#include #include "common.h" @implementation WONoContentElement @@ -43,6 +44,7 @@ } - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { + if ([_ctx isRenderingDisabled]) return; [_response appendContentHTMLString:@"<element]; [_response appendContentHTMLString:@"' in component '"]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOPasswordField.m b/sope-appserver/NGObjWeb/DynamicElements/WOPasswordField.m index ef37ab4e..9f99f63c 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOPasswordField.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOPasswordField.m @@ -58,6 +58,8 @@ NSString *v; unsigned int s; + if ([_ctx isRenderingDisabled]) return; + v = [self->value stringValueInComponent:[_ctx component]]; s = [self->size unsignedIntValueInComponent:[_ctx component]]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOPopUpButton.m b/sope-appserver/NGObjWeb/DynamicElements/WOPopUpButton.m index 9e013d02..65d59552 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOPopUpButton.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOPopUpButton.m @@ -455,29 +455,33 @@ static BOOL debugPopUp = NO; st = [[NSDateClass date] timeIntervalSince1970]; #endif - WOResponse_AddCString(_response, "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, ""); - + WOResponse_AddCString(_response, ""); + } #if DEBUG if (profElements) { NSTimeInterval diff; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WORadioButton.m b/sope-appserver/NGObjWeb/DynamicElements/WORadioButton.m index 57d7c06e..6e61045d 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WORadioButton.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WORadioButton.m @@ -109,6 +109,8 @@ WOComponent *sComponent; NSString *lvalue; + if ([_ctx isRenderingDisabled]) return; + sComponent = [_ctx component]; lvalue = self->checked ? [_ctx elementID] diff --git a/sope-appserver/NGObjWeb/DynamicElements/WORadioButtonList.m b/sope-appserver/NGObjWeb/DynamicElements/WORadioButtonList.m index 63f78216..d79044cd 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WORadioButtonList.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WORadioButtonList.m @@ -121,6 +121,8 @@ id sel; BOOL canSetIndex, canSetItem; + if ([_ctx isRenderingDisabled]) return; + sComponent = [_ctx component]; array = [self->list valueInComponent:sComponent]; goCount = [array count]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WORepetition.m b/sope-appserver/NGObjWeb/DynamicElements/WORepetition.m index 83e369f4..36013322 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WORepetition.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WORepetition.m @@ -467,6 +467,7 @@ _applyIndex(_WOComplexRepetition *self, WOComponent *sComponent, unsigned _idx) WOComponent *sComponent; NSArray *array; unsigned aCount, goCount, startIdx; + BOOL doRender; #if DEBUG if (descriptiveIDs) @@ -475,6 +476,8 @@ _applyIndex(_WOComplexRepetition *self, WOComponent *sComponent, unsigned _idx) pool = [[NSAutoreleasePool alloc] init]; + + doRender = ![_ctx isRenderingDisabled]; sComponent = [_ctx component]; array = [self->list valueInContext:_ctx]; aCount = [array count]; @@ -489,10 +492,11 @@ _applyIndex(_WOComplexRepetition *self, WOComponent *sComponent, unsigned _idx) #if HTML_DEBUG // append debugging info - WOResponse_AddString(_response, - [NSString stringWithFormat: - @"\n", - goCount, [array count]]); + if (doRender) + WOResponse_AddString(_response, + [NSString stringWithFormat: + @"\n", + goCount, [array count]]); #endif if (self->identifier == nil) { @@ -514,7 +518,7 @@ _applyIndex(_WOComplexRepetition *self, WOComponent *sComponent, unsigned _idx) 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]); @@ -545,8 +549,9 @@ _applyIndex(_WOComplexRepetition *self, WOComponent *sComponent, unsigned _idx) #if HTML_DEBUG /* append debugging info */ - WOResponse_AddString(_response, [NSString stringWithFormat: - @" \n", cnt]); + if (doRender) + WOResponse_AddString(_response, [NSString stringWithFormat: + @" \n", cnt]); #endif /* append child elements */ @@ -572,7 +577,8 @@ _applyIndex(_WOComplexRepetition *self, WOComponent *sComponent, unsigned _idx) } #if HTML_DEBUG else { - WOResponse_AddCString(_response, ""); + if (doRender) + WOResponse_AddCString(_response, ""); } #endif diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOResetButton.m b/sope-appserver/NGObjWeb/DynamicElements/WOResetButton.m index bb6522a9..745f9034 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOResetButton.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOResetButton.m @@ -39,11 +39,15 @@ // ******************** 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, "template appendToResponse:_response inContext:_ctx]; return; - + } + sComponent = [_ctx component]; - - uFi = [self->filename stringValueInComponent:sComponent]; + uFi = [self->filename stringValueInComponent:sComponent]; if (uFi) { WOResourceManager *rm; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOString.m b/sope-appserver/NGObjWeb/DynamicElements/WOString.m index 8df7a2ed..2d3d1e8f 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOString.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOString.m @@ -133,8 +133,9 @@ /* 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 */ @@ -246,7 +247,8 @@ /* generating response */ - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { - WOResponse_AddString(_response, self->value); + if (![_ctx isRenderingDisabled]) + WOResponse_AddString(_response, self->value); } /* description */ @@ -367,7 +369,8 @@ /* 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 */ @@ -540,16 +543,21 @@ static WOAssociation *yesAssoc = nil; } - (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]; } @@ -566,8 +574,8 @@ static WOAssociation *yesAssoc = nil; 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 diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOSubmitButton.m b/sope-appserver/NGObjWeb/DynamicElements/WOSubmitButton.m index 94481f9e..2dcac290 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOSubmitButton.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOSubmitButton.m @@ -163,6 +163,8 @@ static BOOL WOSubmitButtonEnableValueSync = NO; - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { NSString *v; + if ([_ctx isRenderingDisabled]) return; + v = [self->value stringValueInComponent:[_ctx component]]; WOResponse_AddCString(_response, "value valueInComponent:sComponent]; r = [self->rows unsignedIntValueInComponent:sComponent]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOTextField.m b/sope-appserver/NGObjWeb/DynamicElements/WOTextField.m index 9b56f442..7144b4a6 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOTextField.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOTextField.m @@ -173,6 +173,8 @@ static inline NSFormatter *_getFormatter(WOTextField *self, WOContext *_ctx) { id obj; unsigned s; + if ([_ctx isRenderingDisabled]) return; + obj = [self->value valueInComponent:[_ctx component]]; s = [self->size unsignedIntValueInComponent:[_ctx component]]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOVBScript.m b/sope-appserver/NGObjWeb/DynamicElements/WOVBScript.m index 88a57c87..faee7274 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOVBScript.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOVBScript.m @@ -68,48 +68,52 @@ #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, ""); + WOResponse_AddCString(_response, ""); } // description diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOxControlElemBuilder.m b/sope-appserver/NGObjWeb/DynamicElements/WOxControlElemBuilder.m index 6424b7c2..8e3e52ad 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOxControlElemBuilder.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOxControlElemBuilder.m @@ -1,5 +1,6 @@ /* Copyright (C) 2000-2005 SKYRIX Software AG + Copyright (C) 2007 OpenGroupware.org. This file is part of SOPE. @@ -31,6 +32,7 @@ maps to WORepetition maps to WOSetCursor maps to WOCopyValue + maps to WOFragment */ @interface WOxControlElemBuilder : WOxTagClassElemBuilder @@ -81,7 +83,14 @@ 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) @@ -99,4 +108,4 @@ return Nil; } -@end /* SxControlElemBuilder */ +@end /* WOxControlElemBuilder */ diff --git a/sope-appserver/NGObjWeb/DynamicElements/_WOCommonStaticDAHyperlink.m b/sope-appserver/NGObjWeb/DynamicElements/_WOCommonStaticDAHyperlink.m index 56b99c57..e6545f65 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/_WOCommonStaticDAHyperlink.m +++ b/sope-appserver/NGObjWeb/DynamicElements/_WOCommonStaticDAHyperlink.m @@ -88,8 +88,10 @@ 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, "template appendToResponse:_response inContext:_ctx]; return; + } content = [self->string valueInContext:_ctx]; doNotDisplay = [self->disabled boolValueInComponent:sComponent]; diff --git a/sope-appserver/NGObjWeb/DynamicElements/_WOStaticHTMLElement.m b/sope-appserver/NGObjWeb/DynamicElements/_WOStaticHTMLElement.m index e4a6e2dd..d6463ae6 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/_WOStaticHTMLElement.m +++ b/sope-appserver/NGObjWeb/DynamicElements/_WOStaticHTMLElement.m @@ -21,6 +21,7 @@ #include "_WOStaticHTMLElement.h" #include +#include #include "common.h" @implementation _WOStaticHTMLElement @@ -52,8 +53,8 @@ static Class StrClass = Nil; /* 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 */ diff --git a/sope-appserver/NGObjWeb/NGObjWeb.xcodeproj/project.pbxproj b/sope-appserver/NGObjWeb/NGObjWeb.xcodeproj/project.pbxproj index 78bac319..6436348f 100644 --- a/sope-appserver/NGObjWeb/NGObjWeb.xcodeproj/project.pbxproj +++ b/sope-appserver/NGObjWeb/NGObjWeb.xcodeproj/project.pbxproj @@ -110,6 +110,8 @@ 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 */; }; @@ -547,6 +549,8 @@ AD4D5F9509C83A7D009BFDAF /* SoCookieAuthenticator.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = SoCookieAuthenticator.m; sourceTree = ""; }; AD4D5F9609C83A7D009BFDAF /* SoProductLoader.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = SoProductLoader.h; sourceTree = ""; }; AD4D5F9709C83A7D009BFDAF /* SoProductLoader.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = SoProductLoader.m; sourceTree = ""; }; + AD4F34B20BAAF5BA00323EB9 /* WOFragment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WOFragment.m; sourceTree = ""; }; + AD4F35310BAAF99E00323EB9 /* WOFragment.api */ = {isa = PBXFileReference; explicitFileType = text.xml; fileEncoding = 4; path = WOFragment.api; sourceTree = ""; }; AD51811206FF7ED0006397CD /* NGImap4.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NGImap4.framework; path = "$(USER_LIBRARY_DIR)/EmbeddedFrameworks/Wrapper/NGImap4.framework"; sourceTree = ""; }; AD51811306FF7ED0006397CD /* NGMail.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NGMail.framework; path = "$(USER_LIBRARY_DIR)/EmbeddedFrameworks/Wrapper/NGMail.framework"; sourceTree = ""; }; AD8BF0A907018CC600EC239A /* WOServerDefaults.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = WOServerDefaults.m; sourceTree = ""; }; @@ -806,13 +810,11 @@ ADFE54BD06E2493D006628C4 /* WEClientCapabilities.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = WEClientCapabilities.m; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; ADFE54BE06E2493D006628C4 /* WOAdaptor.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = WOAdaptor.m; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; ADFE54BF06E2493D006628C4 /* woapp-gs.make */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 5; indentWidth = 8; path = "woapp-gs.make"; sourceTree = ""; tabWidth = 8; usesTabs = 1; }; - ADFE54C006E2493D006628C4 /* woapp.make */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 5; indentWidth = 8; path = woapp.make; sourceTree = ""; tabWidth = 8; usesTabs = 1; }; ADFE54C106E2493D006628C4 /* WOApplication.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = WOApplication.m; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; ADFE54C206E2493D006628C4 /* WOApplication+defaults.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = "WOApplication+defaults.m"; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; ADFE54C306E2493D006628C4 /* WOApplication+private.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = "WOApplication+private.h"; sourceTree = ""; }; ADFE54C406E2493D006628C4 /* WOApplicationMain.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = WOApplicationMain.m; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; ADFE54C506E2493D006628C4 /* wobundle-gs.make */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 5; indentWidth = 8; path = "wobundle-gs.make"; sourceTree = ""; tabWidth = 8; usesTabs = 1; }; - ADFE54C606E2493D006628C4 /* wobundle.make */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 5; indentWidth = 8; path = wobundle.make; sourceTree = ""; tabWidth = 8; usesTabs = 1; }; ADFE54C706E2493D006628C4 /* WOChildComponentReference.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = WOChildComponentReference.h; sourceTree = ""; }; ADFE54C806E2493D006628C4 /* WOChildComponentReference.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = WOChildComponentReference.m; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; ADFE54C906E2493D006628C4 /* WOComponent.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = WOComponent.m; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; @@ -1016,6 +1018,7 @@ AD084B3E07392CB700D0679C /* WOEntity.api */, AD084C3D0739380E00D0679C /* WOFileUpload.api */, AD084C3F0739381C00D0679C /* WOForm.api */, + AD4F35310BAAF99E00323EB9 /* WOFragment.api */, AD084B4007392CD900D0679C /* WOFrame.api */, AD084B4207392CEF00D0679C /* WOGenericContainer.api */, AD084B4407392CFB00D0679C /* WOGenericElement.api */, @@ -1082,9 +1085,7 @@ ADECED40078A4A8300B7221D /* fhs.make */, ADFE543106E2493C006628C4 /* ngobjweb.make */, ADFE54BF06E2493D006628C4 /* woapp-gs.make */, - ADFE54C006E2493D006628C4 /* woapp.make */, ADFE54C506E2493D006628C4 /* wobundle-gs.make */, - ADFE54C606E2493D006628C4 /* wobundle.make */, ); name = Makefiles; sourceTree = ""; @@ -1492,6 +1493,7 @@ ADFE53BE06E2493C006628C4 /* WOConditional.m */, ADFE53DE06E2493C006628C4 /* WORepetition.m */, ADFE53E106E2493C006628C4 /* WOSetCursor.m */, + AD4F34B20BAAF5BA00323EB9 /* WOFragment.m */, ); name = "Control Elements"; sourceTree = ""; @@ -2026,6 +2028,7 @@ AD084C5A073938AB00D0679C /* WOImage.api in Resources */, ADE763A008BB3BE900F63757 /* WOCopyValue.api in Resources */, ADE766D908BE836200F63757 /* WOSetHeader.api in Resources */, + AD4F35320BAAF99E00323EB9 /* WOFragment.api in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2276,6 +2279,7 @@ AD2EC19E08E2E506006B7836 /* WOxTalElemBuilder.m in Sources */, AD4D5F9909C83A7D009BFDAF /* SoCookieAuthenticator.m in Sources */, AD4D5F9B09C83A7D009BFDAF /* SoProductLoader.m in Sources */, + AD4F34B30BAAF5BA00323EB9 /* WOFragment.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2314,7 +2318,7 @@ 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; diff --git a/sope-appserver/NGObjWeb/NGObjWeb/WOContext.h b/sope-appserver/NGObjWeb/NGObjWeb/WOContext.h index b2725626..ca6319cc 100644 --- a/sope-appserver/NGObjWeb/NGObjWeb/WOContext.h +++ b/sope-appserver/NGObjWeb/NGObjWeb/WOContext.h @@ -80,11 +80,15 @@ 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 @@ -184,6 +188,15 @@ - (NSArray *)resourceLookupLanguages; +/* fragments */ + +- (void)setFragmentID:(NSString *)_fragmentID; +- (NSString *)fragmentID; + +- (void)enableRendering; +- (void)disableRendering; +- (BOOL)isRenderingDisabled; + @end #endif /* __NGObjWeb_WOContext_H__ */ diff --git a/sope-appserver/NGObjWeb/NGObjWeb/WORequest.h b/sope-appserver/NGObjWeb/NGObjWeb/WORequest.h index 874d7a8a..17e033af 100644 --- a/sope-appserver/NGObjWeb/NGObjWeb/WORequest.h +++ b/sope-appserver/NGObjWeb/NGObjWeb/WORequest.h @@ -36,6 +36,7 @@ NGObjWeb_EXPORT NSString *WORequestValuePageName; NGObjWeb_EXPORT NSString *WORequestValueContextID; NGObjWeb_EXPORT NSString *WORequestValueSenderID; NGObjWeb_EXPORT NSString *WORequestValueSessionID; +NGObjWeb_EXPORT NSString *WORequestValueFragmentID; NGObjWeb_EXPORT NSString *WONoSelectionString; @interface WORequest : WOMessage @@ -108,6 +109,11 @@ NGObjWeb_EXPORT NSString *WONoSelectionString; - (NSString *)cookieValueForKey:(NSString *)_key; - (NSDictionary *)cookieValues; +/* SOPE extensions */ + +- (NSString *)fragmentID; +- (BOOL)isFragmentIDInRequest; + @end #if COMPILING_NGOBJWEB diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index b415afdf..3e15b7be 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=4 +SUBMINOR_VERSION:=5 # v4.5.234 requires libDOM v4.5.21 # v4.5.214 requires libNGExtensions v4.5.179 diff --git a/sope-appserver/NGObjWeb/WEClientCapabilities.m b/sope-appserver/NGObjWeb/WEClientCapabilities.m index cdb6950b..13659033 100644 --- a/sope-appserver/NGObjWeb/WEClientCapabilities.m +++ b/sope-appserver/NGObjWeb/WEClientCapabilities.m @@ -889,11 +889,13 @@ static NSString *WEClientDetectorFormName = @"WEClientDetect"; NSStringFromClass([self class])]; return; } - + + if ([_ctx isRenderingDisabled]) return; + if (![[[_ctx request] clientCapabilities] isJavaScriptBrowser]) /* only works on JavaScript browsers ... */ return; - + [_response appendContentString:@""]; diff --git a/sope-appserver/NGObjWeb/WOChildComponentReference.m b/sope-appserver/NGObjWeb/WOChildComponentReference.m index ef20f81f..e381fd9e 100644 --- a/sope-appserver/NGObjWeb/WOChildComponentReference.m +++ b/sope-appserver/NGObjWeb/WOChildComponentReference.m @@ -174,6 +174,7 @@ static Class NSDateClass = Nil; [self warnWithFormat: @"did not find child component %@ of parent %@", self->childName, [parent name]]; + if ([_ctx isRenderingDisabled]) return; [_response appendContentString:@"
[missing component: "];
     [_response appendContentHTMLString:self->childName];
     [_response appendContentString:@"]
"]; diff --git a/sope-appserver/NGObjWeb/WOContext.m b/sope-appserver/NGObjWeb/WOContext.m index 1b089057..1aa18d61 100644 --- a/sope-appserver/NGObjWeb/WOContext.m +++ b/sope-appserver/NGObjWeb/WOContext.m @@ -50,7 +50,7 @@ static Class WOAppClass = Nil; @implementation WOContext + (int)version { - return 8; + return 9; } static Class WOContextClass = Nil; @@ -115,6 +115,11 @@ static NSString *WOApplicationSuffix = nil; self->request = [_request retain]; self->response = [[WOResponse responseWithRequest:_request] retain]; + + if (_request && [_request isFragmentIDInRequest]) { + [self setFragmentID:[_request fragmentID]]; + [self disableRendering]; + } } return self; } @@ -277,6 +282,7 @@ static NSString *WOApplicationSuffix = nil; [self->urlPrefix release]; [self->elementID release]; [self->reqElementID release]; + [self->fragmentID release]; [self->activeFormElement release]; [self->page release]; [self->awakeComponents release]; @@ -1043,6 +1049,24 @@ void WOContext_leaveComponent(WOContext *self, WOComponent *_component) { : [[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 */ diff --git a/sope-appserver/NGObjWeb/WORequest.m b/sope-appserver/NGObjWeb/WORequest.m index afd8a8eb..a8c6f465 100644 --- a/sope-appserver/NGObjWeb/WORequest.m +++ b/sope-appserver/NGObjWeb/WORequest.m @@ -37,13 +37,14 @@ @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; @@ -675,6 +676,21 @@ static BOOL debugOn = NO; 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 { diff --git a/sope-appserver/NGObjWeb/WOResponse+private.h b/sope-appserver/NGObjWeb/WOResponse+private.h index 789e3bf9..a9ed103b 100644 --- a/sope-appserver/NGObjWeb/WOResponse+private.h +++ b/sope-appserver/NGObjWeb/WOResponse+private.h @@ -40,6 +40,32 @@ 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 *)"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__) \ diff --git a/sope-appserver/WEExtensions/ChangeLog b/sope-appserver/WEExtensions/ChangeLog index ba7377b3..56763d45 100644 --- a/sope-appserver/WEExtensions/ChangeLog +++ b/sope-appserver/WEExtensions/ChangeLog @@ -1,3 +1,8 @@ +2007-03-17 Marcus Mueller + + * *.m: ported all elements to honour the new + -[WOContext isRenderingDisabled] flag. (v4.7.93) + 2006-11-08 Helge Hess * WETableView/WETableCell.m: fixed a MacOS compilation warning diff --git a/sope-appserver/WEExtensions/JSClipboard.m b/sope-appserver/WEExtensions/JSClipboard.m index 06d2f939..ebab28f0 100644 --- a/sope-appserver/WEExtensions/JSClipboard.m +++ b/sope-appserver/WEExtensions/JSClipboard.m @@ -77,13 +77,15 @@ } - (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]; diff --git a/sope-appserver/WEExtensions/JSMenu.m b/sope-appserver/WEExtensions/JSMenu.m index 2aebd423..f3f4581d 100644 --- a/sope-appserver/WEExtensions/JSMenu.m +++ b/sope-appserver/WEExtensions/JSMenu.m @@ -83,6 +83,11 @@ WEClientCapabilities *ccaps; BOOL ie, ns; + if ([_ctx isRenderingDisabled]) { + [self->template appendToResponse:_response inContext:_ctx]; + return; + } + eid = [[[_ctx elementID] componentsSeparatedByString:@"."] componentsJoinedByString:@"_"]; comp = [_ctx component]; diff --git a/sope-appserver/WEExtensions/JSMenuItem.m b/sope-appserver/WEExtensions/JSMenuItem.m index bc2e690b..2233de93 100644 --- a/sope-appserver/WEExtensions/JSMenuItem.m +++ b/sope-appserver/WEExtensions/JSMenuItem.m @@ -65,11 +65,16 @@ - (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]; @@ -82,7 +87,9 @@ url = [_ctx componentActionURL]; else if (self->href != nil) url = [self->href stringValueInComponent:comp]; - + else + url = nil; + if (ie) { tmp = [[NSString alloc] initWithFormat: @"
" diff --git a/sope-appserver/WEExtensions/JSShiftClick.m b/sope-appserver/WEExtensions/JSShiftClick.m index 1813fc06..c216d071 100644 --- a/sope-appserver/WEExtensions/JSShiftClick.m +++ b/sope-appserver/WEExtensions/JSShiftClick.m @@ -135,6 +135,8 @@ static NSString *JSShiftClick_Script = NSString *eid = nil; NSString *prfx = nil; + if ([_ctx isRenderingDisabled]) return; + ccaps = [[_ctx request] clientCapabilities]; eid = [self->identifier stringValueInComponent:[_ctx component]]; diff --git a/sope-appserver/WEExtensions/JSStringTable.m b/sope-appserver/WEExtensions/JSStringTable.m index 053f6211..0b8be037 100644 --- a/sope-appserver/WEExtensions/JSStringTable.m +++ b/sope-appserver/WEExtensions/JSStringTable.m @@ -122,11 +122,14 @@ - (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]; diff --git a/sope-appserver/WEExtensions/Version b/sope-appserver/WEExtensions/Version index be1c9298..2e14700b 100644 --- a/sope-appserver/WEExtensions/Version +++ b/sope-appserver/WEExtensions/Version @@ -1,7 +1,8 @@ # 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 diff --git a/sope-appserver/WEExtensions/WEBrowser.m b/sope-appserver/WEExtensions/WEBrowser.m index cee8103d..a91343e2 100644 --- a/sope-appserver/WEExtensions/WEBrowser.m +++ b/sope-appserver/WEExtensions/WEBrowser.m @@ -413,6 +413,11 @@ _applyPathAppenedByItem(WEBrowser *self, NSArray *path, id obj, id cmp) { } - (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 diff --git a/sope-appserver/WEExtensions/WECalendarField.m b/sope-appserver/WEExtensions/WECalendarField.m index c08ed813..c6b120fb 100644 --- a/sope-appserver/WEExtensions/WECalendarField.m +++ b/sope-appserver/WEExtensions/WECalendarField.m @@ -127,6 +127,11 @@ static NSString *retStr02ForInt(int i) { } - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { + if ([_ctx isRenderingDisabled]) { + [self->template appendToResponse:_response inContext:_ctx]; + return; + } + [_response appendContentString: @"" @"" @@ -870,6 +875,9 @@ static NSString *retStr02ForInt(int i) { inContext: (WOContext *)_ctx { WOComponent *comp; + + if ([_ctx isRenderingDisabled]) return; + comp = [_ctx component]; [[self class] appendWEDateFieldScriptToResponse: _response inContext:_ctx diff --git a/sope-appserver/WEExtensions/WECollapsibleComponentContent.m b/sope-appserver/WEExtensions/WECollapsibleComponentContent.m index 995cffc4..f4ac452a 100644 --- a/sope-appserver/WEExtensions/WECollapsibleComponentContent.m +++ b/sope-appserver/WEExtensions/WECollapsibleComponentContent.m @@ -146,6 +146,11 @@ static NSString *No = @"NO"; 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:@"."] @@ -399,6 +404,11 @@ static NSString *No = @"NO"; NSString *fragId = nil; NSString *scriptId = nil; + if ([_ctx isRenderingDisabled]) { + [self->template appendToResponse:_resp inContext:_ctx]; + return; + } + comp = [_ctx component]; fragId = [self->fragmentIdentifier stringValueInComponent:comp]; diff --git a/sope-appserver/WEExtensions/WEDateField.m b/sope-appserver/WEExtensions/WEDateField.m index 146fcb60..81e93c97 100644 --- a/sope-appserver/WEExtensions/WEDateField.m +++ b/sope-appserver/WEExtensions/WEDateField.m @@ -49,6 +49,10 @@ } - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { + if ([_ctx isRenderingDisabled]) { + [self->template appendToResponse:_response inContext:_ctx]; + return; + } [self _appendDateFieldToResponse:_response inContext:_ctx]; } diff --git a/sope-appserver/WEExtensions/WEDragContainer.m b/sope-appserver/WEExtensions/WEDragContainer.m index 6572791f..191a10f3 100644 --- a/sope-appserver/WEExtensions/WEDragContainer.m +++ b/sope-appserver/WEExtensions/WEDragContainer.m @@ -137,6 +137,11 @@ static BOOL debugTakeValues = NO; NSString *ttag; BOOL doDnD; + if ([_ctx isRenderingDisabled]) { + [self->template appendToResponse:_response inContext:_ctx]; + return; + } + doDnD = [[[_ctx request] clientCapabilities] doesSupportDHTMLDragAndDrop]; if (doDnD) { diff --git a/sope-appserver/WEExtensions/WEDropContainer.m b/sope-appserver/WEExtensions/WEDropContainer.m index 5ea76213..1bd742ca 100644 --- a/sope-appserver/WEExtensions/WEDropContainer.m +++ b/sope-appserver/WEExtensions/WEDropContainer.m @@ -258,6 +258,11 @@ NSString *containerID = nil; BOOL doDnD, doSwap, doAttach; + if ([_ctx isRenderingDisabled]) { + [self->template appendToResponse:_response inContext:_ctx]; + return; + } + doDnD = [[[_ctx request] clientCapabilities] doesSupportDHTMLDragAndDrop]; //doDnD = YES; diff --git a/sope-appserver/WEExtensions/WEEpozEditor.m b/sope-appserver/WEExtensions/WEEpozEditor.m index c783045b..f5cc7843 100644 --- a/sope-appserver/WEExtensions/WEEpozEditor.m +++ b/sope-appserver/WEExtensions/WEEpozEditor.m @@ -414,6 +414,8 @@ static NSString *OWFormElementName(WEEpozEditor *self, WOContext *_ctx) { } - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { + if ([_ctx isRenderingDisabled]) return; + if ([self isEpozBrowserInContext:_ctx]) [self appendEpozToResponse:_response inContext:_ctx]; else diff --git a/sope-appserver/WEExtensions/WEExtensions-Info.plist b/sope-appserver/WEExtensions/WEExtensions-Info.plist index 694134b0..4b3d2ac4 100644 --- a/sope-appserver/WEExtensions/WEExtensions-Info.plist +++ b/sope-appserver/WEExtensions/WEExtensions-Info.plist @@ -19,6 +19,6 @@ CFBundleSignature????CFBundleVersion - 4.5 + 4.7 diff --git a/sope-appserver/WEExtensions/WEExtensions.xcodeproj/project.pbxproj b/sope-appserver/WEExtensions/WEExtensions.xcodeproj/project.pbxproj index 8a92970e..82ed28f2 100644 --- a/sope-appserver/WEExtensions/WEExtensions.xcodeproj/project.pbxproj +++ b/sope-appserver/WEExtensions/WEExtensions.xcodeproj/project.pbxproj @@ -154,53 +154,6 @@ 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; @@ -789,55 +742,11 @@ ); 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 = " - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - WEExtensions - CFBundleIdentifier - org.OpenGroupware.SOPE.WEExtensions - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - FMWK - CFBundleSignature - ???? - CFBundleVersion - 1.0 - - -"; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -846,12 +755,6 @@ 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 */; @@ -1017,7 +920,7 @@ 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; @@ -1058,8 +961,8 @@ 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; diff --git a/sope-appserver/WEExtensions/WEMonthOverview.m b/sope-appserver/WEExtensions/WEMonthOverview.m index 3e0c4f5f..df5159f9 100644 --- a/sope-appserver/WEExtensions/WEMonthOverview.m +++ b/sope-appserver/WEExtensions/WEMonthOverview.m @@ -552,6 +552,11 @@ _takeValuesInCell(WEMonthOverview *self, WORequest *request, BOOL hasRightBottom = NO; BOOL hasCell = NO; + if ([_ctx isRenderingDisabled]) { + [self->template appendToResponse:_response inContext:_ctx]; + return; + } + [self _calcMatrixInContext:_ctx]; comp = [_ctx component]; @@ -1122,6 +1127,11 @@ _takeValuesInCell(WEMonthOverview *self, WORequest *request, 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); @@ -1233,6 +1243,11 @@ _takeValuesInCell(WEMonthOverview *self, WORequest *request, NSDictionary *monthViewContextDict; id tmp; + if ([_ctx isRenderingDisabled]) { + [self->template appendToResponse:_response inContext:_ctx]; + return; + } + if ((tmp = [_ctx monthOverviewQueryObjects]) != nil) { [(NSMutableArray *)tmp addObject:@"title"]; return; diff --git a/sope-appserver/WEExtensions/WEPageLink.m b/sope-appserver/WEExtensions/WEPageLink.m index 184f8581..4b25f135 100644 --- a/sope-appserver/WEExtensions/WEPageLink.m +++ b/sope-appserver/WEExtensions/WEPageLink.m @@ -162,6 +162,11 @@ - (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 *)"template appendToResponse:_response inContext:_ctx]; + return; + } + [self updateConfigInContext:_ctx]; doForm = NO; /* generate form controls ? */ @@ -796,6 +801,11 @@ static inline NSString *WEPageLabelForKey(NSString *_key, WOContext *_ctx) { - (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])) diff --git a/sope-appserver/WEExtensions/WEQualifierConditional.m b/sope-appserver/WEExtensions/WEQualifierConditional.m index 767e7a6f..9877ddb8 100644 --- a/sope-appserver/WEExtensions/WEQualifierConditional.m +++ b/sope-appserver/WEExtensions/WEQualifierConditional.m @@ -153,9 +153,8 @@ /* 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 diff --git a/sope-appserver/WEExtensions/WERichString.m b/sope-appserver/WEExtensions/WERichString.m index f061a995..85abab02 100644 --- a/sope-appserver/WEExtensions/WERichString.m +++ b/sope-appserver/WEExtensions/WERichString.m @@ -150,7 +150,16 @@ static inline BOOL _doShow(WERichString *self, WOContext *_ctx) { 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]; diff --git a/sope-appserver/WEExtensions/WESwitch.m b/sope-appserver/WEExtensions/WESwitch.m index 9a98f56f..3b2ce0cb 100644 --- a/sope-appserver/WEExtensions/WESwitch.m +++ b/sope-appserver/WEExtensions/WESwitch.m @@ -323,7 +323,6 @@ static NSString *WESwitchDict = @"WESwitchDict"; NSString *k = nil; NSArray *ks = nil; - k = [self->key stringValueInComponent:[_ctx component]]; ks = [self->keys valueInComponent:[_ctx component]]; @@ -338,15 +337,15 @@ static NSString *WESwitchDict = @"WESwitchDict"; 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; } diff --git a/sope-appserver/WEExtensions/WETabItem.m b/sope-appserver/WEExtensions/WETabItem.m index 41b26ef2..4ed61601 100644 --- a/sope-appserver/WEExtensions/WETabItem.m +++ b/sope-appserver/WEExtensions/WETabItem.m @@ -397,10 +397,15 @@ static NSString *retStrForInt(int i) { 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]; @@ -415,7 +420,8 @@ static NSString *retStrForInt(int i) { 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]"]; } } diff --git a/sope-appserver/WEExtensions/WETabView.m b/sope-appserver/WEExtensions/WETabView.m index d7546e3f..1d46628d 100644 --- a/sope-appserver/WEExtensions/WETabView.m +++ b/sope-appserver/WEExtensions/WETabView.m @@ -819,6 +819,11 @@ static NSNumber *YesNumber; 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]; diff --git a/sope-appserver/WEExtensions/WETableMatrix.m b/sope-appserver/WEExtensions/WETableMatrix.m index 744565b6..473c6fb1 100644 --- a/sope-appserver/WEExtensions/WETableMatrix.m +++ b/sope-appserver/WEExtensions/WETableMatrix.m @@ -219,6 +219,11 @@ static NSNumber *numForUInt(unsigned int i) { 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]; @@ -245,7 +250,7 @@ static NSNumber *numForUInt(unsigned int i) { if ([self->subElems count] == 0) { /* no content */ - NSLog(@"WARNING: no sub-elements !"); + [self warnWithFormat:@"no sub-elements !"]; return; } diff --git a/sope-appserver/WEExtensions/WETableMatrixContent.m b/sope-appserver/WEExtensions/WETableMatrixContent.m index 95add03f..8f58f3f6 100644 --- a/sope-appserver/WEExtensions/WETableMatrixContent.m +++ b/sope-appserver/WEExtensions/WETableMatrixContent.m @@ -78,6 +78,11 @@ 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; diff --git a/sope-appserver/WEExtensions/WETableMatrixLabel.m b/sope-appserver/WEExtensions/WETableMatrixLabel.m index 3e4f3052..c4376fbd 100644 --- a/sope-appserver/WEExtensions/WETableMatrixLabel.m +++ b/sope-appserver/WEExtensions/WETableMatrixLabel.m @@ -99,6 +99,11 @@ static NSString *retStrForInt(int i) { 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) { diff --git a/sope-appserver/WEExtensions/WETableView/WETableData.m b/sope-appserver/WEExtensions/WETableView/WETableData.m index 530f7eee..71e684cd 100644 --- a/sope-appserver/WEExtensions/WETableView/WETableData.m +++ b/sope-appserver/WEExtensions/WETableView/WETableData.m @@ -257,6 +257,10 @@ /* 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; diff --git a/sope-appserver/WEExtensions/WETableView/WETableHeader.m b/sope-appserver/WEExtensions/WETableView/WETableHeader.m index 1a1aa710..50d3dd0b 100644 --- a/sope-appserver/WEExtensions/WETableView/WETableHeader.m +++ b/sope-appserver/WEExtensions/WETableView/WETableHeader.m @@ -37,6 +37,10 @@ /* 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; diff --git a/sope-appserver/WEExtensions/WETableView/WETableView.m b/sope-appserver/WEExtensions/WETableView/WETableView.m index e62b5908..0f52a734 100644 --- a/sope-appserver/WEExtensions/WETableView/WETableView.m +++ b/sope-appserver/WEExtensions/WETableView/WETableView.m @@ -1621,6 +1621,11 @@ static inline void _applyState_(WETableView *self, WOComponent *cmp) { */ WOComponent *cmp; + if ([_ctx isRenderingDisabled]) { + [self->template appendToResponse:_response inContext:_ctx]; + return; + } + [self updateStateInContext:_ctx]; [self updateScriptIdInContext:_ctx]; [self updateConfigInContext:_ctx]; diff --git a/sope-appserver/WEExtensions/WETimeField.m b/sope-appserver/WEExtensions/WETimeField.m index a41a4437..c744e01f 100644 --- a/sope-appserver/WEExtensions/WETimeField.m +++ b/sope-appserver/WEExtensions/WETimeField.m @@ -41,7 +41,12 @@ } - (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 */ diff --git a/sope-appserver/WEExtensions/WETreeData.m b/sope-appserver/WEExtensions/WETreeData.m index f03c42e9..4244b2d6 100644 --- a/sope-appserver/WEExtensions/WETreeData.m +++ b/sope-appserver/WEExtensions/WETreeData.m @@ -415,6 +415,11 @@ static Class StrClass = Nil; /* 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]) diff --git a/sope-appserver/WEExtensions/WETreeHeader.m b/sope-appserver/WEExtensions/WETreeHeader.m index 8ad14ca2..93625153 100644 --- a/sope-appserver/WEExtensions/WETreeHeader.m +++ b/sope-appserver/WEExtensions/WETreeHeader.m @@ -93,6 +93,11 @@ BOOL isTree; BOOL doTable; + if ([_ctx isRenderingDisabled]) { + [self->template appendToResponse:_response inContext:_ctx]; + return; + } + if (![_ctx objectForKey:WETreeView_HEADER_MODE]) return; diff --git a/sope-appserver/WEExtensions/WETreeView.m b/sope-appserver/WEExtensions/WETreeView.m index 505d00d3..c893dfea 100644 --- a/sope-appserver/WEExtensions/WETreeView.m +++ b/sope-appserver/WEExtensions/WETreeView.m @@ -684,6 +684,11 @@ NSString *WETreeView_Space = @"WETreeView_Space"; BOOL doTable; int i, cnt, depth; + if ([_ctx isRenderingDisabled]) { + [self->template appendToResponse:_response inContext:_ctx]; + return; + } + [self updateConfigInContext:_ctx]; comp = [_ctx component]; diff --git a/sope-appserver/WEExtensions/WEWeekColumnView.m b/sope-appserver/WEExtensions/WEWeekColumnView.m index f60593a2..e23e5924 100644 --- a/sope-appserver/WEExtensions/WEWeekColumnView.m +++ b/sope-appserver/WEExtensions/WEWeekColumnView.m @@ -770,6 +770,11 @@ _applyIndex(WEWeekColumnView *self, WOComponent *comp, unsigned _idx) } - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { + if ([_ctx isRenderingDisabled]) { + [self->template appendToResponse:_response inContext:_ctx]; + return; + } + [self _calcMatrixInContext:_ctx]; [_response appendContentString:@"
template appendToResponse:_response inContext:_ctx]; + return; + } + [self _calcMatrixInContext:_ctx]; comp = [_ctx component]; diff --git a/sope-appserver/WEPrototype/ChangeLog b/sope-appserver/WEPrototype/ChangeLog index 16bb4480..8fac2c4a 100644 --- a/sope-appserver/WEPrototype/ChangeLog +++ b/sope-appserver/WEPrototype/ChangeLog @@ -1,3 +1,8 @@ +2007-03-17 Marcus Mueller + + * WEPrototypeScript.m, WELiveLink.m: obey WOContext's new + -isRenderingDisabled flag (v4.7.9) + 2006-08-28 Marcus Mueller * WEPrototypeElemBuilder.m: added "prototype-script" reference to diff --git a/sope-appserver/WEPrototype/Version b/sope-appserver/WEPrototype/Version index 81aa8660..34e4bfb1 100644 --- a/sope-appserver/WEPrototype/Version +++ b/sope-appserver/WEPrototype/Version @@ -1,5 +1,6 @@ # version file -SUBMINOR_VERSION:=8 +SUBMINOR_VERSION:=9 +# v4.7.9 requires libNGObjWeb v4.7.5 # v4.5.1 requires libNGObjWeb v4.5.170 diff --git a/sope-appserver/WEPrototype/WELiveLink.m b/sope-appserver/WEPrototype/WELiveLink.m index dae0eae0..a1db500f 100644 --- a/sope-appserver/WEPrototype/WELiveLink.m +++ b/sope-appserver/WEPrototype/WELiveLink.m @@ -177,6 +177,11 @@ - (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]; diff --git a/sope-appserver/WEPrototype/WEPrototype.xcodeproj/project.pbxproj b/sope-appserver/WEPrototype/WEPrototype.xcodeproj/project.pbxproj index 56fa4a85..37d0b0f7 100644 --- a/sope-appserver/WEPrototype/WEPrototype.xcodeproj/project.pbxproj +++ b/sope-appserver/WEPrototype/WEPrototype.xcodeproj/project.pbxproj @@ -412,8 +412,8 @@ 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; diff --git a/sope-appserver/WEPrototype/WEPrototypeScript.m b/sope-appserver/WEPrototype/WEPrototypeScript.m index 57d90819..0b7d5110 100644 --- a/sope-appserver/WEPrototype/WEPrototypeScript.m +++ b/sope-appserver/WEPrototype/WEPrototypeScript.m @@ -39,8 +39,8 @@ static NSString *WEPrototypeScriptKey = @"WEPrototypeScriptKey"; + (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" diff --git a/sope-appserver/WOExtensions/ChangeLog b/sope-appserver/WOExtensions/ChangeLog index 89e017f9..ec192ec1 100644 --- a/sope-appserver/WOExtensions/ChangeLog +++ b/sope-appserver/WOExtensions/ChangeLog @@ -1,3 +1,8 @@ +2007-03-17 Marcus Mueller + + * *.m: ported all elements to honour the new + -[WOContext isRenderingDisabled] flag. (v4.7.31) + 2006-07-03 Helge Hess * use %p for pointer formats, fixed gcc 4.1 warnings (v4.5.30) diff --git a/sope-appserver/WOExtensions/JSAlertPanel.m b/sope-appserver/WOExtensions/JSAlertPanel.m index a4d553a4..493a22b6 100644 --- a/sope-appserver/WOExtensions/JSAlertPanel.m +++ b/sope-appserver/WOExtensions/JSAlertPanel.m @@ -133,10 +133,15 @@ - (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 diff --git a/sope-appserver/WOExtensions/JSConfirmPanel.m b/sope-appserver/WOExtensions/JSConfirmPanel.m index f187ae4a..fc1cd098 100644 --- a/sope-appserver/WOExtensions/JSConfirmPanel.m +++ b/sope-appserver/WOExtensions/JSConfirmPanel.m @@ -250,6 +250,11 @@ - (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) diff --git a/sope-appserver/WOExtensions/JSImageFlyover.m b/sope-appserver/WOExtensions/JSImageFlyover.m index ac0e7af3..6dd887cb 100644 --- a/sope-appserver/WOExtensions/JSImageFlyover.m +++ b/sope-appserver/WOExtensions/JSImageFlyover.m @@ -275,6 +275,11 @@ 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]; diff --git a/sope-appserver/WOExtensions/JSModalWindow.m b/sope-appserver/WOExtensions/JSModalWindow.m index 0e70eb1a..2b2e5b37 100644 --- a/sope-appserver/WOExtensions/JSModalWindow.m +++ b/sope-appserver/WOExtensions/JSModalWindow.m @@ -180,6 +180,11 @@ NSString *tmp; NSArray *languages; + if ([_ctx isRenderingDisabled]) { + [self->template appendToResponse:_resp inContext:_ctx]; + return; + } + comp = [_ctx component]; // link diff --git a/sope-appserver/WOExtensions/JSTextFlyover.m b/sope-appserver/WOExtensions/JSTextFlyover.m index e0b97212..28984d42 100644 --- a/sope-appserver/WOExtensions/JSTextFlyover.m +++ b/sope-appserver/WOExtensions/JSTextFlyover.m @@ -122,6 +122,11 @@ 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]; diff --git a/sope-appserver/WOExtensions/JSValidatedField.m b/sope-appserver/WOExtensions/JSValidatedField.m index afb5ab57..4b594077 100644 --- a/sope-appserver/WOExtensions/JSValidatedField.m +++ b/sope-appserver/WOExtensions/JSValidatedField.m @@ -126,6 +126,11 @@ 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]]; diff --git a/sope-appserver/WOExtensions/Version b/sope-appserver/WOExtensions/Version index f41b16bd..98b8853c 100644 --- a/sope-appserver/WOExtensions/Version +++ b/sope-appserver/WOExtensions/Version @@ -1,6 +1,7 @@ # 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 diff --git a/sope-appserver/WOExtensions/WOCheckBoxMatrix.m b/sope-appserver/WOExtensions/WOCheckBoxMatrix.m index b3a7dbb6..bfb20c8d 100644 --- a/sope-appserver/WOExtensions/WOCheckBoxMatrix.m +++ b/sope-appserver/WOExtensions/WOCheckBoxMatrix.m @@ -237,6 +237,11 @@ void _applyIndex(WOCheckBoxMatrix *self, WOComponent *cmp, unsigned _idx) 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]; diff --git a/sope-appserver/WOExtensions/WOCollapsibleComponentContent.m b/sope-appserver/WOExtensions/WOCollapsibleComponentContent.m index 437441df..dbf72ab5 100644 --- a/sope-appserver/WOExtensions/WOCollapsibleComponentContent.m +++ b/sope-appserver/WOExtensions/WOCollapsibleComponentContent.m @@ -171,6 +171,13 @@ 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]; diff --git a/sope-appserver/WOExtensions/WODictionaryRepetition.m b/sope-appserver/WOExtensions/WODictionaryRepetition.m index 413519a6..0c267f4d 100644 --- a/sope-appserver/WOExtensions/WODictionaryRepetition.m +++ b/sope-appserver/WOExtensions/WODictionaryRepetition.m @@ -151,6 +151,11 @@ NSEnumerator *keyEnum; NSString *k; + if ([_ctx isRenderingDisabled]) { + [self->template appendToResponse:_resp inContext:_ctx]; + return; + } + comp = [_ctx component]; dict = [self->dictionary valueInComponent:comp]; diff --git a/sope-appserver/WOExtensions/WOExtensions-Info.plist b/sope-appserver/WOExtensions/WOExtensions-Info.plist index f9bf6d56..4b7d02ac 100644 --- a/sope-appserver/WOExtensions/WOExtensions-Info.plist +++ b/sope-appserver/WOExtensions/WOExtensions-Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 4.5 + 4.7 diff --git a/sope-appserver/WOExtensions/WOExtensions.xcodeproj/project.pbxproj b/sope-appserver/WOExtensions/WOExtensions.xcodeproj/project.pbxproj index 18074e79..41dce8c3 100644 --- a/sope-appserver/WOExtensions/WOExtensions.xcodeproj/project.pbxproj +++ b/sope-appserver/WOExtensions/WOExtensions.xcodeproj/project.pbxproj @@ -62,53 +62,6 @@ 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; @@ -124,13 +77,6 @@ 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 */ @@ -451,56 +397,11 @@ ); 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 = " - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - WOExtensions - CFBundleIdentifier - org.OpenGroupware.SOPE.WOExtensions - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - FMWK - CFBundleSignature - ???? - CFBundleVersion - 1.0 - - -"; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -509,12 +410,6 @@ 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 */; @@ -604,21 +499,13 @@ }; /* 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; diff --git a/sope-appserver/WOExtensions/WORadioButtonMatrix.m b/sope-appserver/WOExtensions/WORadioButtonMatrix.m index 13444642..2df98764 100644 --- a/sope-appserver/WOExtensions/WORadioButtonMatrix.m +++ b/sope-appserver/WOExtensions/WORadioButtonMatrix.m @@ -213,6 +213,11 @@ void _applyIndex(WORadioButtonMatrix *self, WOComponent *cmp, unsigned _idx) 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]; diff --git a/sope-appserver/WOExtensions/WORedirect.m b/sope-appserver/WOExtensions/WORedirect.m index 1740a9a9..aa0580da 100644 --- a/sope-appserver/WOExtensions/WORedirect.m +++ b/sope-appserver/WOExtensions/WORedirect.m @@ -47,7 +47,7 @@ - (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; } @@ -58,7 +58,7 @@ NSString *loc; if (![self->url isNotNull]) { - [self logWithFormat:@"ERROR: missing URL for redirect!"]; + [self errorWithFormat:@"missing URL for redirect!"]; return; } @@ -68,7 +68,7 @@ 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; } diff --git a/sope-appserver/WOExtensions/WOTabPanel.m b/sope-appserver/WOExtensions/WOTabPanel.m index 0cb4a459..504312a0 100644 --- a/sope-appserver/WOExtensions/WOTabPanel.m +++ b/sope-appserver/WOExtensions/WOTabPanel.m @@ -81,11 +81,11 @@ [_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]; @@ -111,7 +111,7 @@ } - (id)invokeActionForRequest:(WORequest *)_req inContext:(WOContext *)_ctx { - id result; + id result; NSString *section; section = [_ctx currentElementID]; @@ -159,6 +159,11 @@ 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]; diff --git a/sope-appserver/WOExtensions/WOTable.m b/sope-appserver/WOExtensions/WOTable.m index 85eb8724..6f24ef80 100644 --- a/sope-appserver/WOExtensions/WOTable.m +++ b/sope-appserver/WOExtensions/WOTable.m @@ -202,6 +202,11 @@ static inline void _applyIndex(WOTable *self, WOComponent *cmp, unsigned _idx) 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]; diff --git a/sope-appserver/WOExtensions/WOThresholdColoredNumber.m b/sope-appserver/WOExtensions/WOThresholdColoredNumber.m index 38adad54..11336c3f 100644 --- a/sope-appserver/WOExtensions/WOThresholdColoredNumber.m +++ b/sope-appserver/WOExtensions/WOThresholdColoredNumber.m @@ -71,7 +71,9 @@ 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];