cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r667167 - in /cxf/branches/2.0.x-fixes: ./ api/ api/src/main/java/org/apache/cxf/ws/addressing/wsdl/ api/src/main/java/org/apache/cxf/wsdl/ common/schemas/src/main/resources/schemas/wsdl/ common/xsd/src/main/java/org/apache/cxf/maven_plugin...
Date Thu, 12 Jun 2008 17:25:15 GMT
Author: dkulp
Date: Thu Jun 12 10:25:15 2008
New Revision: 667167

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

........
  r667156 | dkulp | 2008-06-12 12:50:09 -0400 (Thu, 12 Jun 2008) | 2 lines
  
  Use the ws-addressing UsingAddressing type already in the api package for the wsdl extensor.
  Removes the org.w3 stuff from the jar/bundle 
........

Added:
    cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/
      - copied from r667156, cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/
    cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/UsingAddressing.java
      - copied unchanged from r667156, cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/UsingAddressing.java
    cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/jaxb.index
      - copied unchanged from r667156, cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/jaxb.index
Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    cxf/branches/2.0.x-fixes/api/pom.xml
    cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
    cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/Messages.properties
    cxf/branches/2.0.x-fixes/common/schemas/src/main/resources/schemas/wsdl/ws-addr-wsdl.xjb
    cxf/branches/2.0.x-fixes/common/xsd/src/main/java/org/apache/cxf/maven_plugin/XSDToJavaMojo.java
    cxf/branches/2.0.x-fixes/distribution/bundle/pom.xml
    cxf/branches/2.0.x-fixes/parent/pom.xml

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

Modified: cxf/branches/2.0.x-fixes/api/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/api/pom.xml?rev=667167&r1=667166&r2=667167&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/api/pom.xml (original)
+++ cxf/branches/2.0.x-fixes/api/pom.xml Thu Jun 12 10:25:15 2008
@@ -153,6 +153,7 @@
                                 <xsdOption>
                                     <xsd>${basedir}/target/schemas/schemas/wsdl/ws-addr-wsdl.xsd</xsd>
                                     <bindingFile>${basedir}/target/schemas/schemas/wsdl/ws-addr-wsdl.xjb</bindingFile>
+                                    <extension>true</extension>
                                 </xsdOption>
                             </xsdOptions>
                         </configuration>

Modified: cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java?rev=667167&r1=667166&r2=667167&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
(original)
+++ cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
Thu Jun 12 10:25:15 2008
@@ -23,6 +23,8 @@
 import java.lang.reflect.Method;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import javax.wsdl.Definition;
 import javax.wsdl.WSDLException;
@@ -36,12 +38,16 @@
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSchema;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamWriter;
 
 import org.w3c.dom.Element;
 
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.PackageUtils;
+import org.apache.cxf.common.util.StringUtils;
 
 
 /**
@@ -50,6 +56,8 @@
  *
  */
 public class JAXBExtensionHelper implements ExtensionSerializer, ExtensionDeserializer {
+    private static final Logger LOG = LogUtils.getL7dLogger(JAXBExtensionHelper.class);
+
     JAXBContext context;
     final Class<? extends TExtensibilityElementImpl> typeClass;
       
@@ -71,7 +79,7 @@
                                      Class<? extends TExtensibilityElementImpl> cls)
throws JAXBException {
         
         JAXBExtensionHelper helper = new JAXBExtensionHelper(cls);
-        
+        boolean found = false;
         try {
             Class<?> objectFactory = Class.forName(PackageUtils.getPackageName(cls)
+ ".ObjectFactory",
                                                    true, cls.getClassLoader());
@@ -85,15 +93,44 @@
                         QName elementType = new QName(elementDecl.namespace(), elementDecl.name());
                         registry.registerDeserializer(parentType, elementType, helper); 
                         registry.registerSerializer(parentType, elementType, helper);   
                     
-                        registry.mapExtensionTypes(parentType, elementType, cls);       
                
+                        registry.mapExtensionTypes(parentType, elementType, cls);
+                        found = true;
                     }                    
                 }
             }        
             
         } catch (ClassNotFoundException ex) {
-            // TODO
-            ex.printStackTrace();            
+            //ignore
         }        
+        if (!found) {
+            //not in object factory or no object factory, try other annotations
+            XmlRootElement elAnnot = cls.getAnnotation(XmlRootElement.class);
+            if (elAnnot != null) {
+                String name = elAnnot.name();
+                String ns = elAnnot.namespace();
+                if (StringUtils.isEmpty(ns)
+                    || "##default".equals(ns)) {
+                    XmlSchema schema = cls.getPackage().getAnnotation(XmlSchema.class);
+                    if (schema != null) {
+                        ns = schema.namespace();
+                    }
+                }
+                if (!StringUtils.isEmpty(ns) && !StringUtils.isEmpty(name)) {
+                    QName elementType = new QName(ns, name);
+                    registry.registerDeserializer(parentType, elementType, helper); 
+                    registry.registerSerializer(parentType, elementType, helper);       
                 
+                    registry.mapExtensionTypes(parentType, elementType, cls);
+                    
+                    helper.getJAXBContext();
+                    found = true;
+                }
+            }
+        }
+        
+        if (!found) {
+            LOG.log(Level.WARNING, "EXTENSION_NOT_REGISTERED", 
+                    new Object[] {cls.getName(), parentType.getName()});
+        }
     }
 
     protected JAXBContext getJAXBContext() {

Modified: cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/Messages.properties?rev=667167&r1=667166&r2=667167&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/Messages.properties (original)
+++ cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/Messages.properties Thu
Jun 12 10:25:15 2008
@@ -22,3 +22,4 @@
 
 COULD_NOT_CREATE_TRANSFORMER = Could not create transformer
 COULD_NOT_POPULATE_EPR = Populating metadata in EPR failed
+EXTENSION_NOT_REGISTERED = Could not register wsdl extension class {0} with parent {1} as
element name could not be determined
\ No newline at end of file

Modified: cxf/branches/2.0.x-fixes/common/schemas/src/main/resources/schemas/wsdl/ws-addr-wsdl.xjb
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/schemas/src/main/resources/schemas/wsdl/ws-addr-wsdl.xjb?rev=667167&r1=667166&r2=667167&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/common/schemas/src/main/resources/schemas/wsdl/ws-addr-wsdl.xjb
(original)
+++ cxf/branches/2.0.x-fixes/common/schemas/src/main/resources/schemas/wsdl/ws-addr-wsdl.xjb
Thu Jun 12 10:25:15 2008
@@ -27,4 +27,7 @@
             <jaxb:package name="org.apache.cxf.ws.addressing.wsdl"/>
         </jaxb:schemaBindings>
     </jaxb:bindings>
+    <jaxb:bindings schemaLocation="ws-addr-wsdl.xsd" node="/xs:schema/xs:element[@name='UsingAddressing']">
+      <jaxb:class ref="org.apache.cxf.ws.addressing.wsdl.UsingAddressingImpl"/>
+    </jaxb:bindings>
 </jaxb:bindings>

Modified: cxf/branches/2.0.x-fixes/common/xsd/src/main/java/org/apache/cxf/maven_plugin/XSDToJavaMojo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/xsd/src/main/java/org/apache/cxf/maven_plugin/XSDToJavaMojo.java?rev=667167&r1=667166&r2=667167&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/common/xsd/src/main/java/org/apache/cxf/maven_plugin/XSDToJavaMojo.java
(original)
+++ cxf/branches/2.0.x-fixes/common/xsd/src/main/java/org/apache/cxf/maven_plugin/XSDToJavaMojo.java
Thu Jun 12 10:25:15 2008
@@ -58,7 +58,6 @@
      * @parameter
      */
     XsdOption xsdOptions[];
-
     
     public void execute() throws MojoExecutionException {
         String outputDir = testSourceRoot == null ? sourceRoot : testSourceRoot;
@@ -159,7 +158,11 @@
                 list.add(it.next().toString());
             }
         }          
-        list.add("-quiet");
+        if (getLog().isDebugEnabled()) {
+            list.add("-verbose");            
+        } else { 
+            list.add("-quiet");
+        }
         list.add("-d");
         list.add(outputDir);
         list.add(option.getXsd());

Modified: cxf/branches/2.0.x-fixes/distribution/bundle/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/distribution/bundle/pom.xml?rev=667167&r1=667166&r2=667167&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/distribution/bundle/pom.xml (original)
+++ cxf/branches/2.0.x-fixes/distribution/bundle/pom.xml Thu Jun 12 10:25:15 2008
@@ -270,8 +270,6 @@
                         <Export-Package>
                             org.apache.cxf.*;version=${pom.version};-split-package:=merge-first,
                             org.xmlsoap.schemas*;version=${pom.version};-split-package:=merge-first,
-                            org.xmlsoap.schemas.wsdl.http.*,
-                            org.w3._2006._05.addressing.wsdl.*,
                             '=META-INF.cxf'
                         </Export-Package>
                         <_failok>true</_failok>

Modified: cxf/branches/2.0.x-fixes/parent/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/parent/pom.xml?rev=667167&r1=667166&r2=667167&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/parent/pom.xml (original)
+++ cxf/branches/2.0.x-fixes/parent/pom.xml Thu Jun 12 10:25:15 2008
@@ -329,6 +329,12 @@
                 <version>2.0.4</version>
             </dependency>
             <dependency>
+                <groupId>org.apache.maven</groupId>
+                <artifactId>maven-core</artifactId>
+                <scope>provided</scope>
+                <version>2.0.4</version>
+            </dependency>
+            <dependency>
                 <groupId>httpunit</groupId>
                 <artifactId>httpunit</artifactId>
                 <version>1.6.2</version>



Mime
View raw message