Hi,

I ran into a few issues related to the resource locations we have in Tuscany 
for various implementation types, such as:

<tuscany:implementation.widget location="<uri>"/>
<implementation.spring location="<uri>"/>
<implementation.jee archive="<uri>"/>

Apparently we don't have a common resource resolver to locate the resources in 
a consistent manner (The SCA spec probably needs to clarify in this area). I'm 
in the position to define a common utility to unify the logic after we agree on 
how the URIs should be resolved based on the following scenario.

Let's assume we have the following contributions for the given SCA domain:

Contribution #1:
uri=c1, file:/contributions/c1.jar

Contribution #2:
uri=c2, file:/contributions/c2.jar

c1.jar contains:
/d1/A.composite
/d2/B.html

c2.jar contains:
/d3/C.composite
/d4/D.xml

Now I have the following requirements (not adding the complexity to use 
classpath searches) :

Case 1: A.composite needs to reference B.html within contribution c1. I could 
try the following URIs:

location="../d2/B.html" (relative to the composite file)
location="/d2/B.html" (relative to the root of the containing contribution)
location="http://example.com/c1/d2/B.html"; (an absolute URI, take it as is)

Case 2: A.composite needs to reference D.xml from contribution c2. I could try 
the following URIs:

location="/d4/D.xml" (relative to the root of contribution c2, hoping that the 
resolver can go to contribution c2 following import/export)
location="contribution:c1!/d4/D.xml" (inventing a new URI scheme for SCA 
domain/contribution/artifacts so that we can explicitly point to a given 
contribution by its uri)
location="http://example.com/c2/d4/D.xml"; (an absolute URI, take it as is)

Does this match your expectations? 

It seems that Spring has some interesting ideas around the resource handling, 
see:

http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/resources.html

Thanks,
Raymond

Reply via email to