On Sep 25, 2006, at 11:58 PM, Raymond Feng wrote:
- After all properties defined in the scdl have been loaded, the
list of
properties in the component type will be checked to see if there
is any
property who 'override' attribute is 'must' and is not defined as
part of
the component defn. If there exists one then an exception is thrown
I think this validation step can only be done at "build" phase, right?
Why can it only be done during build? This should be part of the load
phase. The build phase constructs the runtime artifacts
- I understand that the value of component properties will also be
defined
as xml similar to how the default values are defined in the
component type
file i.e. property values will also be xml document fragments
The current code doesn't handle the property value correctly. The
SCA spec defines the following syntax:
<property name="xs:NCName" source="xs:string"? file="xs:anyURI"?>*
property-value
</property>
The spec takes the order as "source", "file" and content-value.
The property value will represented by a DOM Document which can be
evaluated against the composite property by XPath, loaded from the
file URI, or parsed from the current StAX reader. Can the XPath
evaluation be done at "load" phase? I have the code for the XPath
part.
- Each property has an xml type specified, but where do we
locate the
xsd for this type?
Maybe we can start with "xsi:schemaLocation". By the spec, the
"type" is required. Should we add an attribute to @Property for
xmlType? For simple types, we can use Java2XML mapping in
SimpleTypeMapperExtension.
Just to make sure of one thing here, we should not require a schema
for complex types. Certain data bindings may need it but other's
(e.g. XStream) don't and we need to accommodate both styles as
plugins to the data binding framework.
The current code uses "StAXPropertyFactory" to create the target
property value (for simple types). I have created a Databinding-
based property factory which knows how to create the value out of
the DOM Document.
- The property value as an xml document will be passed to the
ComponentBuilders (js component builder, ruby component
builder...) which
will handle the logic of transforming them into data forms that
can be
injected into the implementations (javascript, rubyscript...).
I'm thinking of adding the following "build" logic to
ComponentBuilderExtension.
For each property in the component type, we either use the default
value (override="no" or override="may" but no property value is
found), or the configured value from the property value
(override="must" or override="may" and a matching property is
found) to create an instance of ObjectFactory which knows how to
transform the DOM Node into the target type using our DataBinding
support).
Yes, but to clarify, "knows" means it delegates to the data binding
framework, right?
The JavaComponentBuilder will inject the property values into the
target POJO instance. Other component builders may have their own
way to pass properties to their implementations.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]