Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#include <NGObjWeb/WOAssociation.h>
#include "WOValueAssociation.h"
2004-08-24 Helge Hess <helge.hess@opengroupware.org>
+ * v4.3.9
+
+ * DynamicElements/WOConditional.m: added specific WOx initializer to
+ support negative conditionals (if-not)
+
+ * DynamicElements/WOxControlElemBuilder.m: mapped "if-not"/"ifnot" to
+ WOConditional
+
* SoObjects/WOContext+SoObjects.m: added missing
-setObjectPermissionCache: method (v4.3.8)
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
+// $Id: WOComponentReference.m 1 2004-08-20 10:08:27Z znek $
#include "WOComponentReference.h"
#include "WOElement+private.h"
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
WOComponent *parent;
-
+
parent = [_ctx component];
_updateComponent(self, _ctx);
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
+// $Id: WOConditional.m 1 2004-08-20 10:08:27Z znek $
#include <NGObjWeb/WODynamicElement.h>
@end /* WOConditional */
+#include <DOM/EDOM.h>
+#include <NGObjWeb/WOxElemBuilder.h>
#include "common.h"
#include "WOElement+private.h"
return self;
}
+- (id)initWithNegateElement:(id<DOMElement>)_element
+ templateBuilder:(WOxElemBuilder *)_builder
+{
+ /* need an own -init so that we can patch the 'negate' association */
+ NSString *name;
+ NSMutableDictionary *assocs;
+ NSArray *children;
+ id<NSObject,DOMNamedNodeMap> attrs;
+ unsigned count;
+
+ name = [_element tagName];
+
+ /* construct associations */
+
+ assocs = nil;
+ attrs = [_element attributes];
+ if ((count = [attrs length]) > 0)
+ assocs = [_builder associationsForAttributes:attrs];
+
+ if ([assocs objectForKey:@"negate"] != nil) {
+ // TODO: implement
+ [self logWithFormat:@"TODO: if-not with 'negate' binding not supported!"];
+ [self release];
+ return nil;
+ }
+ else {
+ static WOAssociation *yesAssoc = nil;
+ if (yesAssoc == nil) {
+ yesAssoc = [[WOAssociation associationWithValue:
+ [NSNumber numberWithBool:YES]] retain];
+ }
+ [assocs setObject:yesAssoc forKey:@"negate"];
+ }
+
+ /* construct child elements */
+
+ if ([_element hasChildNodes]) {
+ /* look for var:binding tags ... */
+
+ children = [_builder buildNodes:[_element childNodes]
+ templateBuilder:_builder];
+ }
+ else
+ children = nil;
+
+ /* construct self ... */
+ return [self initWithName:name associations:assocs contentElements:children];
+}
+
+- (id)initWithElement:(id<DOMElement>)_element
+ templateBuilder:(WOxElemBuilder *)_builder
+{
+ NSString *tag;
+
+ tag = [_element tagName];
+ if ([tag isEqualToString:@"if-not"] || [tag isEqualToString:@"ifnot"])
+ return [self initWithNegateElement:_element templateBuilder:_builder];
+
+ return [super initWithElement:_element templateBuilder:_builder];
+}
+
- (void)dealloc {
[self->template release];
[self->value release];
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
-#import <NGObjWeb/WOxElemBuilder.h>
+#include <NGObjWeb/WOxElemBuilder.h>
/*
This builder builds control flow elements, eg conditionals and
Supported tags:
<var:if .../> maps to WOConditional
+ <var:if-not .../> maps to WOConditional
<var:foreach .../> maps to WORepetition
<var:with .../> maps to WOSetCursor
*/
tag = [_element tagName];
- if ([tag isEqualToString:@"if"]) {
+ if ([tag isEqualToString:@"if"] ||
+ [tag isEqualToString:@"if-not"] || [tag isEqualToString:@"ifnot"]) {
static Class clazz = Nil;
if (clazz == Nil)
clazz = NSClassFromString(@"WOConditional");
return clazz;
}
+
if ([tag isEqualToString:@"foreach"] || [tag isEqualToString:@"for-each"]) {
static Class clazz = Nil;
if (clazz == Nil)
# version file
-SUBMINOR_VERSION:=8
+SUBMINOR_VERSION:=9
# v4.2.413 requires libSaxObjC v4.2.33
# v4.2.341 requires libNGExtensions v4.2.77
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
+// $Id: WODynamicElement.m 1 2004-08-20 10:08:27Z znek $
#include <NGObjWeb/WODynamicElement.h>
#include "WOElement+private.h"
The new DOM element init function for elements constructed from DOM element
nodes.
- The default method is defined on NSObject instead of WOElement, since some dynamic
- elements are class clusters, which use temporary non-WOElement classes during
- construction.
+ The default method is defined on NSObject instead of WOElement, since some
+ dynamic elements are class clusters, which use temporary non-WOElement
+ classes during construction.
- The default construction process requires no support from existing NGObjWeb elements.
- It maps all tag attributes to element associations and all child nodes to subelements.
+ The default construction process requires no support from existing NGObjWeb
+ elements.
+ It maps all tag attributes to element associations and all child nodes to
+ subelements.
The tagname is used as the dynamic element name.
*/