cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r929941 - in /cxf/branches/2.2.x-fixes: ./ rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
Date Thu, 01 Apr 2010 12:15:24 GMT
Author: dkulp
Date: Thu Apr  1 12:15:24 2010
New Revision: 929941

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

........
  r929930 | dkulp | 2010-04-01 07:22:02 -0400 (Thu, 01 Apr 2010) | 1 line
  
  Get xmlbeans databinding to support wsdl imports as well as xsd imports
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java

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

Modified: cxf/branches/2.2.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java?rev=929941&r1=929940&r2=929941&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
Thu Apr  1 12:15:24 2010
@@ -74,6 +74,7 @@ import org.apache.xmlbeans.impl.xb.subst
 import org.apache.xmlbeans.impl.xb.xmlconfig.ConfigDocument;
 import org.apache.xmlbeans.impl.xb.xmlconfig.Extensionconfig;
 import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
+import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument.Schema;
 
 /**
  * 
@@ -283,36 +284,9 @@ public class XMLBeansToolingDataBinding 
             options.setEntityResolver(entResolver);
             options.setGenerateJavaVersion(XmlOptions.GENERATE_JAVA_15);
 
-            
-
-            XmlObject urldoc = loader.parse(url, null, options);
             state.addSourceUri(wsdlFile, null);
+            loadWSDLDoc(loader, url, options, scontentlist, errorListener);
 
-            if (urldoc instanceof org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument)
{
-                org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument wsdldoc = 
-                    (org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument)urldoc;
-                
-                addWsdlSchemas(url.toString(),
-                               wsdldoc,
-                               errorListener, scontentlist);
-                
-                for (TImport imp : wsdldoc.getDefinitions().getImportArray()) {
-                    if (imp.getLocation().toLowerCase().endsWith(".xsd")) {
-                        URL url1 = new URL(url, imp.getLocation());
-                        XmlObject urldoc2 = loader.parse(url1, null, options);
-                        addSchema(url1.toString(), (SchemaDocument)urldoc2, errorListener,
false,
-                                  scontentlist);
-                    }
-                }
-
-            } else if (urldoc instanceof SchemaDocument) {
-                addSchema(url.toString(), (SchemaDocument)urldoc, errorListener, false,
-                          scontentlist);
-            } else {
-                StscState.addError(errorListener, XmlErrorCodes.INVALID_DOCUMENT_TYPE, new
Object[] {
-                    url, "wsdl or schema"
-                }, urldoc);
-            }
 
         } catch (XmlException e) {
             errorListener.add(e.getError());
@@ -414,7 +388,43 @@ public class XMLBeansToolingDataBinding 
     }
 
 
-    
+    private static void loadWSDLDoc(SchemaTypeLoader loader, URL url, 
+                                    XmlOptions options, 
+                                    List<Schema> scontentlist, 
+                                    XmlErrorWatcher errorListener)
+        throws XmlException, IOException {
+        XmlObject urldoc = loader.parse(url, null, options);
+
+        if (urldoc instanceof org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument)
{
+            org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument wsdldoc = 
+                (org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument)urldoc;
+            
+            addWsdlSchemas(url.toString(),
+                           wsdldoc,
+                           errorListener,
+                           scontentlist);
+            
+            for (TImport imp : wsdldoc.getDefinitions().getImportArray()) {
+                URL url1 = new URL(url, imp.getLocation());
+                if (imp.getLocation().toLowerCase().endsWith(".xsd")) {
+                    XmlObject urldoc2 = loader.parse(url1, null, options);
+                    addSchema(url1.toString(), (SchemaDocument)urldoc2, 
+                              errorListener, false,
+                              scontentlist);
+                } else {
+                    loadWSDLDoc(loader, url1, options, scontentlist, errorListener);
+                }
+            }
+
+        } else if (urldoc instanceof SchemaDocument) {
+            addSchema(url.toString(), (SchemaDocument)urldoc, errorListener, false,
+                      scontentlist);
+        } else {
+            StscState.addError(errorListener, XmlErrorCodes.INVALID_DOCUMENT_TYPE, new Object[]
{
+                url, "wsdl or schema"
+            }, urldoc);
+        }        
+    }
   
 
     private static void addSchema(String name, SchemaDocument schemadoc, XmlErrorWatcher
errorListener,



Mime
View raw message