[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tuscany-user
Subject:    RE: http-locations for <import.sdo> element?
From:       "Millies, Sebastian" <Sebastian.Millies () ids-scheer ! com>
Date:       2010-11-16 16:42:40
Message-ID: 59C4DB9FB8BEF942B42DB719BD84D391F59A57 () 49FR-MEEVS1 ! me ! corp ! ids-scheer ! com
[Download RAW message or body]

Thanks. However, I just debugged a bit (in Tuscany 1.7 snapshot), and see the
import.sdo processing being done in class

org.apache.tuscany.sca.databinding.sdo.ImportSDOProcessor

which is deprecated according to its Javadoc. I guess there may be a patch
that never made it into Tuscany 1.x?

Further, although SDOTypesModelResolver is not used, ImportSDOProcessor would seem able
to load XSDs from HTTP-URIs alright in its importWSDL method (which is misleadingly named),
and the same would be true of SDOTypesModelResolver#defineFromXSD.

The trouble is, it never gets a chance, because the ArtifactModelResolver only
checks against resource imports (which in turn are checked only against exports
from other contributions), cf. the following excerpt from the resolveModel() method:

    // If not found, delegate the resolution to the imports (in this case based on the resource imports)
    for (Import import_ : this.contribution.getImports()) {
        if (import_ instanceof ResourceImport) {

I feel I do not know enough about Tuscany to decide where to apply a change.

Would it seem alright to change ArtifactModelResolver#resolveModel() to
explicitly create an SDOTypesModelResolver and try to resolve the artifact 
using that instance, if the existing resolution through the imports fails?


-- Sebastian


PS: On second thoughts, I believe it would be simpler for me to create a special
contribution holding the XSD-files, load that contribution into every node together
with all my other global libraries and make the XSD-files available for <import.sdo> 
through export.resource/import.resource in sca-contribution.xml. 

It wouldn't be as simple as making them available on a webserver, but less 
complicated than copying them to specific directories in every contribution,
which was the situation I was facing. However, it's still a bore having to
distribute the XSD's at all...


-----Original Message-----
From: ant elder [mailto:ant.elder@gmail.com] 
Sent: Tuesday, November 16, 2010 2:33 PM
To: user@tuscany.apache.org
Subject: Re: http-locations for <import.sdo> element?

On Tue, Nov 16, 2010 at 1:25 PM, Millies, Sebastian
<Sebastian.Millies@ids-scheer.com> wrote:
> Hello there,
>
> I am unsatisfied with the <import.sdo> XML element only
> taking a local file path as the location attribute value.
> It would be much nicer if it were possible to specify an
> HTTP-URL from which to retrieve the XSD file.
>
> Has anyone given thought to this? Where could I find the
> relevant source code if I wanted to attempt to code this
> myself?
>
> -- Sebastian
>
>

Its in the databinding-sdo module -
https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/databinding-sdo/

See the classes such as SDOTypesProcessor and SDOTypesModelResolver

   ...ant

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic