incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eno...@apache.org
Subject svn commit: r530443 - in /incubator/yoko/trunk/tools/src: main/java/org/apache/yoko/tools/processors/idl/ test/resources/idl/
Date Thu, 19 Apr 2007 15:08:55 GMT
Author: enolan
Date: Thu Apr 19 08:08:53 2007
New Revision: 530443

URL: http://svn.apache.org/viewvc?view=rev&rev=530443
Log:
Yoko-349 - Support for forward declarations in anon sequence.

Modified:
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceDeferredAction.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java
    incubator/yoko/trunk/tools/src/test/resources/idl/ForwardInterfaceSequence.idl
    incubator/yoko/trunk/tools/src/test/resources/idl/expected_ForwardInterfaceSequence.wsdl

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceDeferredAction.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceDeferredAction.java?view=diff&rev=530443&r1=530442&r2=530443
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceDeferredAction.java
(original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceDeferredAction.java
Thu Apr 19 08:08:53 2007
@@ -21,6 +21,8 @@
 
 import org.apache.schemas.yoko.bindings.corba.Anonsequence;
 import org.apache.schemas.yoko.bindings.corba.Sequence;
+import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaType;
 import org.apache.yoko.wsdl.CorbaTypeImpl;
@@ -30,7 +32,8 @@
     protected Anonsequence anonSequence;
     protected Sequence sequence;
     protected XmlSchemaElement element;
-    
+    protected XmlSchema schema;
+    protected XmlSchemaCollection schemas;    
     
     public SequenceDeferredAction(Sequence sequenceType, Anonsequence anonSequenceType, 
                                   XmlSchemaElement elem, Scope scope) {                 
         
@@ -55,6 +58,14 @@
         element = elem;               
     }
     
+    public SequenceDeferredAction(XmlSchemaCollection xmlSchemas,
+                                  XmlSchema xmlSchema,
+                                  Scope scope) {                           
+        super(scope);
+        schemas = xmlSchemas;
+        schema = xmlSchema;                       
+    }
+    
     public void doDeferredAction(XmlSchemaType stype, CorbaTypeImpl ctype) {
         if (anonSequence != null) {
             anonSequence.setElemtype(ctype.getQName());
@@ -65,6 +76,12 @@
         if (element != null) {
             element.setSchemaTypeName(stype.getQName());
         }        
+        if (schemas != null) {
+            if (schemas.getTypeByQName(stype.getQName()) == null) {
+                schema.getItems().add(stype);
+                schema.addType(stype);
+            }
+        }
     }
         
 }

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java?view=diff&rev=530443&r1=530442&r2=530443
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java
(original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java
Thu Apr 19 08:08:53 2007
@@ -191,11 +191,16 @@
             result.setElemtype(ctype.getQName());        
         }
 
-        // REVISIT - Need to do something here is the type was forward declared.
-        // add schemaType
-        if (schemas.getTypeByQName(schemaType.getQName()) == null) {
-            schema.getItems().add(schemaType);
-            schema.addType(schemaType);
+        // Need to create an action if the type was forward declared.
+        if (schemaType != null) {
+            if (schemas.getTypeByQName(schemaType.getQName()) == null) {
+                schema.getItems().add(schemaType);
+                schema.addType(schemaType);
+            }
+        } else {
+            SequenceDeferredAction anonSeqAction = 
+                new SequenceDeferredAction(schemas, schema, fullyQualifiedName);
+            wsdlVisitor.getDeferredActions().add(anonSeqAction);
         }
         
         // add corbaType

Modified: incubator/yoko/trunk/tools/src/test/resources/idl/ForwardInterfaceSequence.idl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/ForwardInterfaceSequence.idl?view=diff&rev=530443&r1=530442&r2=530443
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/ForwardInterfaceSequence.idl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/ForwardInterfaceSequence.idl Thu Apr
19 08:08:53 2007
@@ -23,6 +23,8 @@
         	    
 	    typedef sequence< IpCall > myIpCallSequence;
 	    
+	    typedef sequence< sequence< sequence < IpCall> > > myCallSeqSeqSeqLong;
+	    
 	    struct anonStruct {
             sequence< sequence< sequence < IpCall> > > structSeqSeqSeqLong;
         };

Modified: incubator/yoko/trunk/tools/src/test/resources/idl/expected_ForwardInterfaceSequence.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_ForwardInterfaceSequence.wsdl?view=diff&rev=530443&r1=530442&r2=530443
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_ForwardInterfaceSequence.wsdl
(original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_ForwardInterfaceSequence.wsdl
Thu Apr 19 08:08:53 2007
@@ -20,6 +20,9 @@
 <wsdl:definitions targetNamespace="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence"
xmlns:tns="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence" xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:corba="http://schemas.apache.org/yoko/bindings/corba" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
   <corba:typeMapping targetNamespace="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence/typemap">
     <corba:sequence xmlns:ns4="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence"
xmlns="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence/typemap" elemtype="org.cc.IpCall"
bound="0" repositoryID="IDL:org/cc/myIpCallSequence:1.0" name="org.cc.myIpCallSequence" type="ns4:org.cc.myIpCallSequence"
/>
+    <corba:anonsequence xmlns="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence/typemap"
elemtype="org.cc.IpCall" bound="0" name="org.cc.myCallSeqSeqSeqLong._1_myCallSeqSeqSeqLong"
/>
+    <corba:anonsequence xmlns:ns4="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence"
xmlns="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence/typemap" elemtype="org.cc.myCallSeqSeqSeqLong._1_myCallSeqSeqSeqLong"
bound="0" name="org.cc._1_myCallSeqSeqSeqLong" type="ns4:org.cc._1_myCallSeqSeqSeqLong" />
+    <corba:sequence xmlns:ns4="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence"
xmlns="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence/typemap" elemtype="org.cc._1_myCallSeqSeqSeqLong"
bound="0" repositoryID="IDL:org/cc/myCallSeqSeqSeqLong:1.0" name="org.cc.myCallSeqSeqSeqLong"
type="ns4:org.cc.myCallSeqSeqSeqLong" />
     <corba:anonsequence xmlns="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence/typemap"
elemtype="org.cc.IpCall" bound="0" name="org.cc.anonStruct._1_anonStruct" />
     <corba:anonsequence xmlns:ns4="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence"
xmlns="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence/typemap" elemtype="org.cc.anonStruct._1_anonStruct"
bound="0" name="org.cc.anonStruct._2_anonStruct" type="ns4:org.cc.anonStruct._2_anonStruct"
/>
     <corba:anonsequence xmlns:ns4="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence"
xmlns="http://schemas.apache.org/yoko/idl/ForwardInterfaceSequence/typemap" elemtype="org.cc.anonStruct._2_anonStruct"
bound="0" name="org.cc._1_anonStruct" type="ns4:org.cc._1_anonStruct" />
@@ -35,6 +38,24 @@
       <xs:complexType name="org.cc.myIpCallSequence">
         <xs:sequence>
           <xs:element maxOccurs="unbounded" minOccurs="0" name="item" type="wsa:EndpointReferenceType">
+          </xs:element>
+        </xs:sequence>
+      </xs:complexType>
+      <xs:complexType name="org.cc.myCallSeqSeqSeqLong._1_myCallSeqSeqSeqLong">
+        <xs:sequence>
+          <xs:element maxOccurs="unbounded" minOccurs="0" name="item" type="wsa:EndpointReferenceType">
+          </xs:element>
+        </xs:sequence>
+      </xs:complexType>
+      <xs:complexType name="org.cc._1_myCallSeqSeqSeqLong">
+        <xs:sequence>
+          <xs:element maxOccurs="unbounded" minOccurs="0" name="item" type="org.cc.myCallSeqSeqSeqLong._1_myCallSeqSeqSeqLong">
+          </xs:element>
+        </xs:sequence>
+      </xs:complexType>
+      <xs:complexType name="org.cc.myCallSeqSeqSeqLong">
+        <xs:sequence>
+          <xs:element maxOccurs="unbounded" minOccurs="0" name="item" type="org.cc._1_myCallSeqSeqSeqLong">
           </xs:element>
         </xs:sequence>
       </xs:complexType>



Mime
View raw message