+2007-03-06 Helge Hess <helge.hess@opengroupware.org>
+
+ * Templates/WOWrapperTemplateBuilder.m: allow component classes in
+ <#hash/> references (eg <#Frame>) (v4.7.3)
+
2007-02-27 Marcus Mueller <znek@mulle-kybernetik.com>
* 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 <helge.hess@opengroupware.org>
/*
- 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.
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");
/* 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]
contentElements:_subElements];
if (element == nil) {
[self errorWithFormat:
- @"could not instantiate child component reference."];
+ @"could not instantiate child component reference: %@", _element];
}
return element;
[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];