-# Note: could be that it may not fully compile 'inline'
+# GNUstep makefile
-include ./config.make
include $(GNUSTEP_MAKEFILES)/common.make
2005-03-07 Helge Hess <helge.hess@opengroupware.org>
+ * v4.5.131
+
+ * WOElementID.h: lowered max element nesting to 126 due to limited
+ scope of ivar (hopefully doesn't trigger #1281)
+
+ * DynamicElements: added support for empty non-XML tags (generate
+ empty tags without the " />")
+
+ * WOContext.m: changed ivars (bumped class version to 8), added a flag
+ for generating XML empty elements (to be checked by dynamic elements)
+
* DynamicElements/WOForm.m: consume 'multipleSubmit' association for
WO compatibility as requested by Stephane (v4.5.130)
Not implemented yet.
Sample (Client side):
-<MAP NAME="FrontPageMap0">
+ <MAP NAME="FrontPageMap0">
<AREA SHAPE="RECT" COORDS="0, 0, 779, 70" HREF="../index.html">
<AREA SHAPE="RECT" COORDS="632, 76, 732, 87" HREF="../stellen/index.html">
<AREA SHAPE="RECT" COORDS="544, 75, 595, 88" HREF="../kontakt/index.html">
[self->otherTagString stringValueInComponent:
[_ctx component]]);
}
- WOResponse_AddCString(_response, " />\n");
+
+ if (_ctx->wcFlags.xmlStyleEmptyElements) {
+ WOResponse_AddCString(_response, " />\n");
+ }
+ else {
+ WOResponse_AddCString(_response, ">\n");
+ }
}
}
[self->otherTagString stringValueInComponent:
[_ctx component]]);
}
- WOResponse_AddCString(_response, " />");
-
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
+
// the value in a checkbox list is the string besides the checkbox
if (self->value) {
WOResponse_AddHtmlString(_response,
[self->otherTagString stringValueInComponent:
[_ctx component]]);
}
- WOResponse_AddCString(_response, " />");
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
}
}
[self->otherTagString stringValueInComponent:
[_ctx component]]);
}
- WOResponse_AddCString(_response, " />");
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
}
/* description */
[self->otherTagString stringValueInComponent:
[_ctx component]]);
}
- WOResponse_AddCString(_response, " />");
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
}
// description
[self->otherTagString stringValueInComponent:
sComponent]);
}
- WOResponse_AddCString(_response, " />");
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
}
@end /* WOGenericElement */
[self->otherTagString stringValueInComponent:
[_ctx component]]);
}
- WOResponse_AddCString(_response, " />");
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
}
}
}
[_ctx component]]);
}
- WOResponse_AddCString(_response, " />");
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
}
@end /* WOImage */
[self->otherTagString stringValueInComponent:
[_ctx component]]);
}
- WOResponse_AddCString(_response, " />");
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
}
/* description */
[self->otherTagString stringValueInComponent:
[_ctx component]]);
}
- WOResponse_AddCString(_response, " />");
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
}
/* description */
[self->otherTagString stringValueInComponent:
[_ctx component]]);
}
- WOResponse_AddCString(_response, " />");
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
}
/* description */
[self->otherTagString stringValueInComponent:
sComponent]);
}
- WOResponse_AddCString(_response, " />");
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
}
/* description */
[self->otherTagString stringValueInComponent:
[_ctx component]]);
}
- WOResponse_AddCString(_response, " />");
-
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
+
// the value in a radio list is the string besides the button
if (self->value) {
NSString *s;
[self->otherTagString stringValueInComponent:
[_ctx component]]);
}
- WOResponse_AddCString(_response, " />");
+
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
}
@end /* WOResetButton */
[_response performSelector:addSel withObject:obj];
}
else {
- [self _appendStringLines:obj withSeparator:@"<br />"
+ [self _appendStringLines:obj
+ withSeparator:
+ (_ctx->wcFlags.xmlStyleEmptyElements ? @"<br />" : @"<br>")
contentSelector:addSel toResponse:_response inContext:_ctx];
}
[self->otherTagString stringValueInComponent:
[_ctx component]]);
}
- WOResponse_AddCString(_response, " />");
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
}
/* description */
[self->otherTagString stringValueInComponent:
[_ctx component]]);
}
- WOResponse_AddCString(_response, " />");
+ WOResponse_AddEmptyCloseParens(_response, _ctx);
}
/* description */
WOResponse_AddChar(_resp, '"');
[self appendExtraAttributesToResponse:_resp inContext:_ctx];
- WOResponse_AddCString(_resp, " />");
+
+ WOResponse_AddEmptyCloseParens(_resp, _ctx);
}
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
#include <NGExtensions/NGExtensions.h>
+static inline void WOResponse_AddEmptyCloseParens(WOResponse *r,
+ WOContext *ctx)
+{
+ if (ctx->wcFlags.xmlStyleEmptyElements) {
+ WOResponse_AddCString(r, " />");
+ }
+ else {
+ WOResponse_AddChar(r, '>');
+ }
+}
+
#endif /* __NGObjWeb_DynElem_common_H__ */
id contentStack[NGObjWeb_MAX_COMPONENT_NESTING_DEPTH];
signed char componentStackCount;
- /* FORM support */
- BOOL inForm;
- id activeFormElement;
-
+ /* misc */
+ id activeFormElement;
NSString *qpJoin;
- /* tracking component actions */
- BOOL savePageRequired;
+@public /* need fast access to generation flags */
+ /* flags */
+ struct {
+ int savePageRequired:1; /* tracking component actions */
+ int inForm:1;
+ int xmlStyleEmptyElements:1;
+ int reserved:29;
+ } wcFlags;
+@protected
/* SOPE */
id clientObject;
NSMutableArray *traversalStack;
- (NSURL *)serverURL;
- (NSURL *)urlForKey:(NSString *)_key;
+- (void)setGenerateXMLStyleEmptyElements:(BOOL)_flag;
+- (BOOL)generateXMLStyleEmptyElements;
+
/* variables */
- (void)setObject:(id)_obj forKey:(NSString *)_key;
# version file
-SUBMINOR_VERSION:=130
+SUBMINOR_VERSION:=131
# v4.5.122 requires libNGExtensions v4.5.153
# v4.5.91 requires libNGExtensions v4.5.134
@implementation WOContext
+ (int)version {
- return 7;
+ return 8;
}
static Class WOContextClass = Nil;
sprintf(buf, "%03x%08x%08x", ++contextCount, (int)time(NULL), (int)self);
self->ctxId = [[NSString alloc] initWithCString:buf];
+ /* per default close tags in XML style */
+ self->wcFlags.xmlStyleEmptyElements = 1;
+
self->elementID = [[WOElementID alloc] init];
self->awakeComponents = [[NSMutableSet alloc] initWithCapacity:64];
}
- (BOOL)savePageRequired {
- return self->savePageRequired;
+ return self->wcFlags.savePageRequired ? YES : NO;
}
/* cursors */
/* forms */
- (void)setInForm:(BOOL)_form {
- self->inForm = _form;
+ self->wcFlags.inForm = _form ? 1 : 0;
}
- (BOOL)isInForm {
- return self->inForm;
+ return self->wcFlags.inForm ? YES : NO;
}
- (void)addActiveFormElement:(WOElement *)_formElement {
return self->qpJoin;
}
+- (void)setGenerateXMLStyleEmptyElements:(BOOL)_flag {
+ self->wcFlags.xmlStyleEmptyElements = _flag ? 1 : 0;
+}
+- (BOOL)generateXMLStyleEmptyElements {
+ return self->wcFlags.xmlStyleEmptyElements ? YES : NO;
+}
+
- (NSString *)queryStringFromDictionary:(NSDictionary *)_queryDict {
NSEnumerator *keys;
NSString *key;
NSMutableString *qs;
NSString *p;
- self->savePageRequired = YES;
+ self->wcFlags.savePageRequired = 1;
qs = [MutableStrClass stringWithCapacity:64];
[qs appendString:WORequestValueSenderID];
static NSMutableString *url = nil; // THREAD
static IMP addStr = NULL;
NSString *s;
-
- self->savePageRequired = YES;
+
+ self->wcFlags.savePageRequired = 1;
if (url == nil) {
url = [[MutableStrClass alloc] initWithCapacity:256];
addStr = [url methodForSelector:@selector(appendString:)];
element-id. An element id is a "path" to an object kept in a tree.
*/
-#define NGObjWeb_MAX_ELEMENT_ID_COUNT 128
+#define NGObjWeb_MAX_ELEMENT_ID_COUNT 126
@class NSString, NSMutableString;