Author: rr
Date: Tue Nov 24 13:35:04 2009
New Revision: 883689

URL: http://svn.apache.org/viewvc?rev=883689&view=rev
Log:
New feature: resolving bpel imports using classpath deps (import 
location="classpath:some.wsdl")

Modified:
    
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/DefaultResourceFinder.java
    
ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/pom.xml
    
ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/src/main/resources/Ping.bpel
    
ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/src/main/resources/Pong.bpel

Modified: 
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/DefaultResourceFinder.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/DefaultResourceFinder.java?rev=883689&r1=883688&r2=883689&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/DefaultResourceFinder.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/DefaultResourceFinder.java
 Tue Nov 24 13:35:04 2009
@@ -88,18 +88,26 @@
         // Note that if we get an absolute URI, the relativize operation will 
simply
         // return the absolute URI.
         URI relative = _relativeDir.toURI().relativize(uri);
-        if (relative.isAbsolute() && !relative.getScheme().equals("urn")) {
-           __log.fatal("openResource: invalid scheme (should be urn:)  " + 
uri);
-           return null;
-        }
+        if (relative.isAbsolute() && relative.getScheme().equals("classpath")) 
{
+            InputStream r = 
Thread.currentThread().getContextClassLoader().getResourceAsStream(relative.getSchemeSpecificPart());
+            if (r == null) {
+                __log.error("classpath resource not found " + absolute);
+            }
+            return r;
+        } else {
+            if (relative.isAbsolute() && 
!(relative.getScheme().equals("urn"))) {
+               __log.fatal("openResource: invalid scheme (should be urn: or 
classpath:)  " + uri);
+               return null;
+            }
 
-        File f = new File(absolute.getPath(), relative.getPath());
-        if (!f.exists()) {
-            __log.debug("fileNotFound: " + f);
-            return null;
-        }
+            File f = new File(absolute.getPath(), relative.getPath());
+            if (!f.exists()) {
+                __log.debug("fileNotFound: " + f);
+                return null;
+            }
 
-        return new FileInputStream(f);
+            return new FileInputStream(f);
+        }
     }
     
     public URI getBaseResourceURI() {

Modified: 
ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/pom.xml
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/pom.xml?rev=883689&r1=883688&r2=883689&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/pom.xml
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/pom.xml
 Tue Nov 24 13:35:04 2009
@@ -41,34 +41,4 @@
         <componentName>OdeBpelEngine</componentName>
     </properties>
 
-  <build>
-    <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>unpack</id>
-                        <phase>generate-resources</phase>
-                        <goals>
-                            <goal>unpack</goal>
-                        </goals>
-                        <configuration>
-                            <artifactItems>
-                                <artifactItem>
-                                    <groupId>${project.groupId}</groupId>
-                                    <artifactId>common</artifactId>
-                                    <version>${project.version}</version>
-                                    <type>jar</type>
-                                    <overWrite>true</overWrite>
-                                    
<outputDirectory>${project.build.directory}/classes</outputDirectory>
-                                    <includes>**/*.*</includes>
-                                </artifactItem>
-                            </artifactItems>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-  </build>
 </project>

Modified: 
ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/src/main/resources/Ping.bpel
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/src/main/resources/Ping.bpel?rev=883689&r1=883688&r2=883689&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/src/main/resources/Ping.bpel
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/src/main/resources/Ping.bpel
 Tue Nov 24 13:35:04 2009
@@ -28,11 +28,11 @@
            xmlns:fun="java:org.apache.ode.ping.AttachPing"
         expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
 
-    <import location="Ping.wsdl"
+    <import location="classpath:Ping.wsdl"
             namespace="urn:/Ping.wsdl"
             importType="http://schemas.xmlsoap.org/wsdl/"; />
 
-    <import location="Pong.wsdl"
+    <import location="classpath:Pong.wsdl"
             namespace="urn:/Pong.wsdl"
             importType="http://schemas.xmlsoap.org/wsdl/"; />
 

Modified: 
ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/src/main/resources/Pong.bpel
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/src/main/resources/Pong.bpel?rev=883689&r1=883688&r2=883689&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/src/main/resources/Pong.bpel
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/distro/src/examples-jbi/maven2/ping-pong/ode-su/src/main/resources/Pong.bpel
 Tue Nov 24 13:35:04 2009
@@ -26,11 +26,7 @@
         xmlns:pong="urn:/Pong.wsdl"
         expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
 
-    <import location="Pong.wsdl"
-            namespace="urn:/Pong.wsdl"
-            importType="http://schemas.xmlsoap.org/wsdl/"; />
-
-    <import location="Pong.wsdl"
+    <import location="classpath:Pong.wsdl"
             namespace="urn:/Pong.wsdl"
             importType="http://schemas.xmlsoap.org/wsdl/"; />
 


Reply via email to