Sebastien, Pete,
I may have misunderstood the base note, however, it looks to me that you are
trying to make changes to the metadata - by adding types - after creating a
data object.
so we already have in hand a DataObject representing the
<component>, containing a list of <property> DataObjects.
Now I need to dynamically create a new SDO type containing
If I'm right then this is a known restricion. We have a JIRA (TUSCANY-474)
that explains it. Bascally, as soon as you create a data object the type
system is frozen. Pete, is that why you are suggesting creating a
DataFactory for each componenType?
Geoff.
On 23/08/06, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
Pete Robbins wrote:
> Sebastien, I'm fixing this. It shouldn't take long.
>
> Cheers,
>
>
> On 22/08/06, Pete Robbins <[EMAIL PROTECTED]> wrote:
>>
>> ah!
>>
>> On 22/08/06, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
>>
>> >
>> > It doesn't work at all now. With SCDL 0.9 a component declaration
>> looked
>> > like that:
>> > <component>
>> > <properties>
>> > <v:Fred>abc</v:Fred>
>> > <v:Joe>xyz</v:Joe>
>> > <v:Joe>tuv</v:Joe>
>> > </properties>
>> > </component>
>> >
>> > The DataObject loaded from that looked exactly like what the client
>> Cpp
>> > code expected, allowing you to code
>> > ComponentContext.getProperties()->getCString("Fred")...
>> >
>> > SCDL 0.95 now looks pretty different:
>> > <component>
>> > <property name="Fred">abc</property>
>> > <property name="Joe">xyz</property>
>> > <property name="Joe">tuv</property>
>> > </component>
>> >
>> > ... missing the convenient <properties> parent element and in a very
>> > different form now. I'm guessing that we don't want the client code
to
>> > change, so we need to massage the DataObject loaded from SCDL to look
>> > like what the client code wants to see. The other thing is that we
>> > should use the property types specified in the component type
>> instead of
>> > guessing the types from the instance properties in the component
>> > declaration.
>> >
>> > So I'm basically trying to fix ModelLoader to created the expected
>> > DataObject from what we get from SCDL. In the SupplyChain scenario I
>> > have multiple Manufacturer and Warehouse components, same
>> implementation
>> > but configured with different properties so I need to get this
>> property
>> > stuff working...
>>
>>
>> Ok I understand the problem. I wasn't up to date with the latest
>> definition of properties. If the current interface to properties is not
>> workable then we can always feed that back to the spec group. Anyho...
>>
>> I think what we need to do is
>> 1)create a DataFactory for the properties and populate it with the
types
>> required for the properties (basic xml types will be there by default
>> but
>> any user defined complex types will have to be defined in a schema
>> somewhere
>> so lets stick to simple types for now).
>> 2) When loading the definitions of the properties from the
componentType
>> we need to create a new SDO Type for properties associated with this
>> component and add it to the DataFactory. So we would do something like:
>>
>> dataFactory->addType("someNamespace", "componentProperties", ....)
>> dataFactory->addPropertyToType((<propertyName>, <propType>.... for
>> each of
>> the properties defined)
>>
>> 3) create a DO of "someNamespace", "componentProperties" type and
>> save the
>> DOPtr in the Component defintion in the model
>> 4) For each property set
>> propertyDO->set(<propertyName>, value)
>> 5) ComponentContext::GetProperties will return the propertyDO from the
>> Component
>>
>> voila!
>>
>> So we need to create a datafactory per componentType I think.
>>
>> --
>> Pete
>>
>
>
>
Cool, Thanks!
--
Jean-Sebastien
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]