Hi Hasan
Adriano is correct about the xsd validation. I've made some more comments in
line. Looking at the range of questions you are asking maybe what we could
do is create and itest to cover the range of validation features that
Tuscany should support and we can concentrate there on improving the
usability story and of course on developing the APIs to deliver it.
Regards
Simon
On Tue, Mar 25, 2008 at 4:50 PM, Adriano Crestani
[EMAIL PROTECTED] wrote:
Hi Hasan,
As far as I know, the validation is done by SCA on composite files. It
uses
the tuscany-sca.xsd file. You can find it at:
https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/assembly-xsd/src/main/resources
Regards,
Adriano Crestani
On Tue, Mar 25, 2008 at 8:44 AM, Hasan Muhammad [EMAIL PROTECTED] wrote:
Hi Simon,
I was wondering whether tuscany does any validation of the composites
and
if
so, to what extent? If not, what is the api (if any exists) that we can
use
to do validation ourselves? If not the api, then how can we obtain
information to do this validation? We would to know this in light of
Workspace and ContributionManager.
Currently there are two main types of validation that occur on composites.
- XSD validation - As Adriano points out see the schema in
modules/assembly-xsd. These are applied when contributions are read. If you
look at the ReallySmallRuntimeBuilder you can see how these XSD are loaded
and also what you would have to do to load your own schema for validation
purposes.
- Programatic validation - in the assembly builder it checks that composites
are properly specified as far as possible w.r.t applying rules from the SCA
specification, e.g. missing or duplicate names, reference/service matching
etc. The same builder code is used regardless of how the runtime is being
started. So, for example, in the new workspace code the builder is called
when a configured composite is requested in the
DeployableCompositeCollectionImpl.doGet() method.
In the case of assembly builders you will notice in the builder code that a
CompositeBuilderMonitor is used to capture any validation issues. The
monitor is called through a local warning() method so it looks like this
could do with a bit of a clean up. This is the extent of the API we have for
this at the moment. The Workspace code is not great in this respect and just
logs validation errors to the underlying logger infrastructure. To capture
validation errors this is where you will be plugging into.
Also, can we get a list of all error/warning messages related to the
particular contribution and the respected category? By category, i mean
whether the error/warning is for schema validation, or implementation
type
error, etc.
We don't maintain message catalogs at the moment so we have to search the
code to find the messages. For example, the output (with a little editing)
of
grep -R --include=*.java warning *
assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeConfigurationBuilderImpl.java:
warning(Duplicate component name: + composite.getName()
assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeConfigurationBuilderImpl.java:
warning(Property not found for component property: + component.getName()
assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeConfigurationBuilderImpl.java:
warning(Component property mustSupply attribute incompatible with property:
+ component
assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeConfigurationBuilderImpl.java:
warning(No value configured on a mustSupply property: + component.getName
()
assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeConfigurationBuilderImpl.java:
warning(Component property many attribute incompatible with property: +
component
assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeConfigurationBuilderImpl.java:
warning(No type specified on component property: + component.getName()
assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeConfigurationBuilderImpl.java:
warning(Reference not found for component reference: + component.getName
()
assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeConfigurationBuilderImpl.java:
warning(Component reference multiplicity incompatible with reference
multiplicity: + component
assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeConfigurationBuilderImpl.java:
warning(Component reference interface incompatible with reference
interface: + component
assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeConfigurationBuilderImpl.java:
warning(Service not found for component service: + component.getName()
assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeConfigurationBuilderImpl.java:
warning(Component service interface incompatible with service interface: