cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r582886 - in /incubator/cxf/branches/2.0.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/catalog/ rt/core/src/main/java/org/apache/cxf/wsdl11/
Date Mon, 08 Oct 2007 17:00:26 GMT
Author: dkulp
Date: Mon Oct  8 10:00:21 2007
New Revision: 582886

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

........
  r578217 | dkulp | 2007-09-21 14:02:19 -0400 (Fri, 21 Sep 2007) | 2 lines
  
  [CXF-1053] Support URI and public types of catalog substitution as well as System
........

Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java
    incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java
    incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
    incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java

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

Modified: incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java?rev=582886&r1=582885&r2=582886&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java
Mon Oct  8 10:00:21 2007
@@ -77,6 +77,13 @@
         String resolvedImportLocation = null;
         try {
             resolvedImportLocation = this.catalogResolver.resolveSystem(importLocation);
+            if (resolvedImportLocation == null) {
+                resolvedImportLocation = catalogResolver.resolveURI(importLocation);
+            }
+            if (resolvedImportLocation == null) {
+                resolvedImportLocation = catalogResolver.resolvePublic(importLocation, parent);
+            }
+        
         } catch (IOException e) {
             throw new RuntimeException("Catalog resolution failed", e);
         }

Modified: incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java?rev=582886&r1=582885&r2=582886&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java
Mon Oct  8 10:00:21 2007
@@ -44,6 +44,13 @@
         String resolvedSchemaLocation = null;
         try {
             resolvedSchemaLocation = this.catalogResolver.resolveSystem(schemaLocation);
+            
+            if (resolvedSchemaLocation == null) {
+                resolvedSchemaLocation = catalogResolver.resolveURI(schemaLocation);
+            }
+            if (resolvedSchemaLocation == null) {
+                resolvedSchemaLocation = catalogResolver.resolvePublic(schemaLocation, baseUri);
+            }
         } catch (IOException e) {
             throw new RuntimeException("Catalog resolution failed", e);
         }

Modified: incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java?rev=582886&r1=582885&r2=582886&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
Mon Oct  8 10:00:21 2007
@@ -18,7 +18,10 @@
  */
 package org.apache.cxf.catalog;
 
+import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -38,9 +41,13 @@
 
 public class OASISCatalogManager {
     public static final String DEFAULT_CATALOG_NAME = "META-INF/jax-ws-catalog.xml";
+    public static final String CATALOG_DEBUG_KEY = "OASISCatalogManager.catalog.debug.level";
 
     private static final Logger LOG =
         LogUtils.getL7dLogger(OASISCatalogManager.class);
+    private static final String DEBUG_LEVEL = System.getProperty(CATALOG_DEBUG_KEY);
+    
+    
 
     private Catalog resolver;
     private Set<URL> loadedCatalogs = Collections.synchronizedSet(new HashSet<URL>());
@@ -51,6 +58,9 @@
         catalogManager.setUseStaticCatalog(false);
         catalogManager.setIgnoreMissingProperties(true);
         CatalogResolver catalogResolver = new CatalogResolver(catalogManager);
+        if (DEBUG_LEVEL != null) {
+            catalogManager.debug.setDebug(Integer.parseInt(DEBUG_LEVEL));            
+        }
         this.resolver = catalogResolver.getCatalog();
     }
 
@@ -103,7 +113,21 @@
 
     public void loadCatalog(URL catalogURL) throws IOException {
         if (!loadedCatalogs.contains(catalogURL)) {
-            this.resolver.parseCatalog(catalogURL);
+            if ("file".equals(catalogURL.getProtocol())) {
+                try {
+                    File file = new File(catalogURL.toURI());
+                    if (file.exists()) {
+                        this.resolver.parseCatalog(file.getAbsolutePath());
+                    } else {
+                        throw new FileNotFoundException(file.getAbsolutePath());
+                    }
+                } catch (URISyntaxException e) {
+                    //just process as is
+                    this.resolver.parseCatalog(catalogURL);
+                }
+            } else {
+                this.resolver.parseCatalog(catalogURL);
+            }
             loadedCatalogs.add(catalogURL);
         }
     }

Modified: incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java?rev=582886&r1=582885&r2=582886&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java
Mon Oct  8 10:00:21 2007
@@ -51,6 +51,13 @@
             String resolvedLocation = null;
             if (catalogResolver != null) {
                 resolvedLocation  = catalogResolver.resolveSystem(target);
+                
+                if (resolvedLocation == null) {
+                    resolvedLocation = catalogResolver.resolveURI(target);
+                }
+                if (resolvedLocation == null) {
+                    resolvedLocation = catalogResolver.resolvePublic(target, base);
+                }                
             }
             if (resolvedLocation == null) {
                 return this.resolver.resolve(target, base);



Mime
View raw message