From 44b05d1ac6d5e7b47b62e82f007720c913c16000 Mon Sep 17 00:00:00 2001 From: helge Date: Tue, 6 Mar 2007 11:27:52 +0000 Subject: [PATCH] allow component classes in hash tags git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1453 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-appserver/NGObjWeb/ChangeLog | 7 ++++- .../Templates/WOWrapperTemplateBuilder.m | 30 +++++++++++++------ sope-appserver/NGObjWeb/Version | 6 +--- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index b6e99af4..4e57dc3e 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,9 +1,14 @@ +2007-03-06 Helge Hess + + * Templates/WOWrapperTemplateBuilder.m: allow component classes in + <#hash/> references (eg <#Frame>) (v4.7.3) + 2007-02-27 Marcus Mueller * WORepetition.m: minor code cleanup. Extended the 'list' binding so that it's possible now to bind any object as a list - this helps in cases where provided objects are either arrays or ordinary - objects. (v4.7.267) + objects. (v4.7.2) 2007-02-08 Helge Hess diff --git a/sope-appserver/NGObjWeb/Templates/WOWrapperTemplateBuilder.m b/sope-appserver/NGObjWeb/Templates/WOWrapperTemplateBuilder.m index b94b12c8..d6f73460 100644 --- a/sope-appserver/NGObjWeb/Templates/WOWrapperTemplateBuilder.m +++ b/sope-appserver/NGObjWeb/Templates/WOWrapperTemplateBuilder.m @@ -1,5 +1,6 @@ /* - Copyright (C) 2000-2005 SKYRIX Software AG + Copyright (C) 2000-2007 SKYRIX Software AG + Copyright (C) 2007 Helge Hess This file is part of SOPE. @@ -547,14 +548,25 @@ static NSDictionary *defaultAssocMap = nil; attributes:(NSDictionary *)_attributes // not the associations ! contentElements:(NSArray *)_subElements { - /* setup a new child component reference */ + /* + Setup a new child component reference. + + Note: it could be a hash-reference, like <#Frame>, in this case we need to + derive the associations from the attributes. + */ static Class ChildRefClass = Nil; _WODFileEntry *def; WOChildComponentReference *element = nil; - NSString *cname = nil; + NSString *cname = nil; + NSDictionary *assoc; - if ((def = [self->definitions objectForKey:_element]) == nil) - return nil; + if ((def = [self->definitions objectForKey:_element]) != nil) + assoc = def->associations; + else { + assoc = [NSMutableDictionary dictionaryWithCapacity:4]; + [self addAttributes:_attributes + toAssociations:(NSMutableDictionary *)assoc]; + } if (ChildRefClass == Nil) ChildRefClass = NSClassFromString(@"WOChildComponentReference"); @@ -564,8 +576,8 @@ static NSDictionary *defaultAssocMap = nil; /* add subcomponent info */ [self->iTemplate addSubcomponentWithKey:cname - name:def->componentName - bindings:def->associations]; + name:(def != nil ? def->componentName : _element) + bindings:assoc]; /* add subcomponent reference */ element = [[ChildRefClass alloc] @@ -574,7 +586,7 @@ static NSDictionary *defaultAssocMap = nil; contentElements:_subElements]; if (element == nil) { [self errorWithFormat: - @"could not instantiate child component reference."]; + @"could not instantiate child component reference: %@", _element]; } return element; @@ -639,7 +651,7 @@ static NSDictionary *defaultAssocMap = nil; [self errorWithFormat:@"could not instantiate dynamic element of class %@", NSStringFromClass(elementClass)]; } - if ([assoc count] > 0) { + if ([assoc isNotEmpty]) { if (logExtraAssociations) [self logWithFormat:@"remaining definition attributes: %@", assoc]; [element setExtraAttributes:assoc]; diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index a04cfbe7..c765e0e4 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -1,10 +1,6 @@ # version file -ifneq ($(GNUSTEP_HOST_VENDOR),apple) # linker overflow -SUBMINOR_VERSION:=267 -else -SUBMINOR_VERSION:=255 -endif +SUBMINOR_VERSION:=3 # v4.5.234 requires libDOM v4.5.21 # v4.5.214 requires libNGExtensions v4.5.179 -- 2.39.5