You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2009/08/05 21:46:22 UTC

svn commit: r801384 - in /cxf/branches/2.2.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/wsdl11/AbstractWrapperWSDLLocator.java rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java

Author: dkulp
Date: Wed Aug  5 19:46:22 2009
New Revision: 801384

URL: http://svn.apache.org/viewvc?rev=801384&view=rev
Log:
Merged revisions 801381 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r801381 | dkulp | 2009-08-05 15:36:37 -0400 (Wed, 05 Aug 2009) | 1 line
  
  [CXF-2380] Have imports check the ResourceResolvers as well
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/AbstractWrapperWSDLLocator.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Aug  5 19:46:22 2009
@@ -1 +1 @@
-/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553,790637-790644,790868,791301,791354,791538,791753,791947,792007,792096,792183,792261-792265,792271,792604,792683-792685,792975,792985,793059,793570,794297,794396,794680,794728,794771,794778-794780,794892,795044,795104,795160,795583,795907,796022-796023,796352,796593,796741,796780,796994-796997,797117,797159,797192,797194,797231-797233,797442,797505,797517,797534,797581-797583,797587,797640,797651,797699,797882-797883,798344-798346,798363,798461,798479,798533,798551,798557,798561-798562,798570,798573,79858
 4,798654,798748-798749,798891,798929-798930,799245,799267,799439,799448,799637,799723-799724,799792,800453,800497-800498,801380
+/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553,790637-790644,790868,791301,791354,791538,791753,791947,792007,792096,792183,792261-792265,792271,792604,792683-792685,792975,792985,793059,793570,794297,794396,794680,794728,794771,794778-794780,794892,795044,795104,795160,795583,795907,796022-796023,796352,796593,796741,796780,796994-796997,797117,797159,797192,797194,797231-797233,797442,797505,797517,797534,797581-797583,797587,797640,797651,797699,797882-797883,798344-798346,798363,798461,798479,798533,798551,798557,798561-798562,798570,798573,79858
 4,798654,798748-798749,798891,798929-798930,799245,799267,799439,799448,799637,799723-799724,799792,800453,800497-800498,801380-801381

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/AbstractWrapperWSDLLocator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/AbstractWrapperWSDLLocator.java?rev=801384&r1=801383&r2=801384&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/AbstractWrapperWSDLLocator.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/AbstractWrapperWSDLLocator.java Wed Aug  5 19:46:22 2009
@@ -28,6 +28,7 @@
     String wsdlUrl;
     InputSource last;
     String baseUri;
+    String lastImport;
     boolean fromParent;
     
     public AbstractWrapperWSDLLocator(String wsdlUrl,
@@ -50,6 +51,7 @@
     }
 
     public abstract InputSource getInputSource();
+    public abstract InputSource getInputSource(String parentLocation, String importLocation);
     
     public InputSource getBaseInputSource() {
         InputSource is = parent.getBaseInputSource();
@@ -80,10 +82,21 @@
     }
 
     public InputSource getImportInputSource(String parentLocation, String importLocation) {
-        return parent.getImportInputSource(parentLocation, importLocation);
+        InputSource src = parent.getImportInputSource(parentLocation, importLocation);
+        lastImport = null;
+        if (src == null || (src.getByteStream() == null && src.getCharacterStream() == null)) {
+            src = getInputSource(parentLocation, importLocation);
+            if (src != null) {
+                lastImport = src.getSystemId(); 
+            }
+        }
+        return src;
     }
 
     public String getLatestImportURI() {
+        if (lastImport != null) {
+            return lastImport;
+        }
         return parent.getLatestImportURI();
     }
 

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java?rev=801384&r1=801383&r2=801384&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java Wed Aug  5 19:46:22 2009
@@ -45,19 +45,23 @@
         this.bus = bus;
     }
 
-
     public InputSource getInputSource() {
-        InputStream ins = bus.getExtension(ResourceManager.class).getResourceAsStream(wsdlUrl);
+        InputSource src = getInputSource(null, wsdlUrl);
+        baseUri = src.getPublicId();
+        return src;
+    }
+
+    public InputSource getInputSource(String parentLocation, String importLocation) {
+        InputStream ins = bus.getExtension(ResourceManager.class).getResourceAsStream(importLocation);
         InputSource is = new InputSource(ins);
-        is.setSystemId(wsdlUrl);
-        is.setPublicId(wsdlUrl);
+        is.setSystemId(importLocation);
+        is.setPublicId(importLocation);
 
-        URL url = bus.getExtension(ResourceManager.class).resolveResource(wsdlUrl, URL.class);
+        URL url = bus.getExtension(ResourceManager.class).resolveResource(importLocation, URL.class);
         if (url != null) {
             is.setSystemId(url.toString());
             is.setPublicId(url.toString());
         }
-        baseUri = is.getPublicId();
         return is;
     }