incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmidd...@apache.org
Subject svn commit: r522662 - in /incubator/yoko/trunk/tools/src: main/java/org/apache/yoko/tools/processors/idl/ test/resources/idl/
Date Mon, 26 Mar 2007 23:33:43 GMT
Author: dmiddlem
Date: Mon Mar 26 16:33:42 2007
New Revision: 522662

URL: http://svn.apache.org/viewvc?view=rev&rev=522662
Log:
Commit for YOKO-269:
* Fix for object reference names
* Fix for object reference schema types
* Update expected object reference WSDL for test

Modified:
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamDclVisitor.java
    incubator/yoko/trunk/tools/src/test/resources/idl/expected_ObjectRef.wsdl

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java?view=diff&rev=522662&r1=522661&r2=522662
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java
(original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java
Mon Mar 26 16:33:42 2007
@@ -125,9 +125,7 @@
         
         // Build and assign the corba:object to the visitor
         Object corbaObject = new Object();
-        corbaObject.setBinding(new QName(""));
-        //corbaObject.setQName(new QName(typeMap.getTargetNamespace(), "CORBA.Object"));
-        corbaObject.setQName(new QName("CORBA.Object"));
+        corbaObject.setQName(new QName(typeMap.getTargetNamespace(), "CORBA.Object"));
         corbaObject.setRepositoryID("IDL:omg.org/CORBA/Object/1.0");
         corbaObject.setType(objectType.getQName());
         setCorbaType(corbaObject);
@@ -192,16 +190,12 @@
             schema.getItems().add(refElement);
         }
 
-        // A schema type is required for visitors.  Create one based on the element we just
added.
-        XmlSchemaType endpointType = new XmlSchemaType(schema);
-        endpointType.setName(referenceName.getLocalPart());
-        setSchemaType(endpointType);
+        setSchemaType(wsaType);
         
         // Build and assign the corba:object to the visitor
         Object corbaObject = new Object();
         corbaObject.setBinding(bindingName);
-        //corbaObject.setQName(new QName(typeMap.getTargetNamespace(), customScope.toString()));
-        corbaObject.setQName(new QName(customScope.toString()));
+        corbaObject.setQName(new QName(typeMap.getTargetNamespace(), customScope.toString()));
         corbaObject.setRepositoryID(repositoryID);
         corbaObject.setType(wsaType.getQName());
         setCorbaType(corbaObject);

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java?view=diff&rev=522662&r1=522661&r2=522662
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java
(original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java
Mon Mar 26 16:33:42 2007
@@ -300,17 +300,10 @@
 
     private XmlSchemaElement addElement(XmlSchemaSequence schemaSequence,
                                         XmlSchemaType schemaType,
-                                        String name,
-                                        boolean isCustomObjectReference) {
+                                        String name) {
         XmlSchemaElement element = new XmlSchemaElement();
         element.setName(name);
-        // REVISIT: An object reference requires that we use a ref name.  An element type
produces
-        // a wsdltojava error.
-        if (isCustomObjectReference) {
-            element.setRefName(schemaType.getQName());
-        } else {
-            element.setSchemaTypeName(schemaType.getQName());
-        }
+        element.setSchemaTypeName(schemaType.getQName());
         
         schemaSequence.getItems().add(element);
         
@@ -330,13 +323,7 @@
             XmlSchemaType schemaType = visitor.getSchemaType();
             CorbaTypeImpl corbaType = visitor.getCorbaType();
             
-            boolean isCustomObjectReference = false;
-            if (corbaType instanceof org.apache.schemas.yoko.bindings.corba.Object
-                && !(corbaType.getQName().getLocalPart().equals("CORBA.Object")))
{
-                isCustomObjectReference = true;
-            }
-            
-            addElement(outputWrappingSequence, schemaType, RETURN_PARAMETER, isCustomObjectReference);
+            addElement(outputWrappingSequence, schemaType, RETURN_PARAMETER);
             addCorbaReturn(corbaType, RETURN_PARAMETER);
         }
     }

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamDclVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamDclVisitor.java?view=diff&rev=522662&r1=522661&r2=522662
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamDclVisitor.java
(original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamDclVisitor.java
Mon Mar 26 16:33:42 2007
@@ -74,24 +74,18 @@
         XmlSchemaType schemaType = visitor.getSchemaType();
         CorbaTypeImpl corbaType = visitor.getCorbaType();
         
-        boolean isCustomObjectReference = false;
-        if (corbaType instanceof org.apache.schemas.yoko.bindings.corba.Object 
-            && !(corbaType.getQName().getLocalPart().equals("CORBA.Object"))) {
-            isCustomObjectReference = true;
-        }
-        
         switch (node.getType()) {
         case IDLTokenTypes.LITERAL_in: 
-            addElement(inWrappingSequence, schemaType, nameNode.toString(), isCustomObjectReference);
+            addElement(inWrappingSequence, schemaType, nameNode.toString());
             addCorbaParam(corbaType, ModeType.IN, nameNode.toString());
             break;
         case IDLTokenTypes.LITERAL_out:
-            addElement(outWrappingSequence, schemaType, nameNode.toString(), isCustomObjectReference);

+            addElement(outWrappingSequence, schemaType, nameNode.toString()); 
             addCorbaParam(corbaType, ModeType.OUT, nameNode.toString());
             break;
         case IDLTokenTypes.LITERAL_inout:
-            addElement(inWrappingSequence, schemaType, nameNode.toString(), isCustomObjectReference);
-            addElement(outWrappingSequence, schemaType, nameNode.toString(), isCustomObjectReference);
+            addElement(inWrappingSequence, schemaType, nameNode.toString());
+            addElement(outWrappingSequence, schemaType, nameNode.toString());
             addCorbaParam(corbaType, ModeType.INOUT, nameNode.toString());
             break;
         default:
@@ -104,17 +98,10 @@
 
     private XmlSchemaElement addElement(XmlSchemaSequence schemaSequence,
                                         XmlSchemaType schemaType,
-                                        String name,
-                                        boolean isCustomObjectReference) {
+                                        String name) {
         XmlSchemaElement element = new XmlSchemaElement();
         element.setName(name);
-        // REVISIT: An object reference requires that we use a ref name.  An element type
produces
-        // a wsdltojava error.
-        if (isCustomObjectReference) {
-            element.setRefName(schemaType.getQName());
-        } else {
-            element.setSchemaTypeName(schemaType.getQName());
-        }
+        element.setSchemaTypeName(schemaType.getQName());
         schemaSequence.getItems().add(element);
         return element;
     }

Modified: incubator/yoko/trunk/tools/src/test/resources/idl/expected_ObjectRef.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_ObjectRef.wsdl?view=diff&rev=522662&r1=522661&r2=522662
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_ObjectRef.wsdl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_ObjectRef.wsdl Mon Mar 26 16:33:42
2007
@@ -19,8 +19,8 @@
 -->
 <wsdl:definitions targetNamespace="http://schemas.apache.org/yoko/idl/ObjectRef" xmlns:tns="http://schemas.apache.org/yoko/idl/ObjectRef"
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/ObjectRef/typemap">
-    <corba:object xmlns:ns4="http://www.w3.org/2005/08/addressing" xmlns="" binding=""
repositoryID="IDL:omg.org/CORBA/Object/1.0" name="CORBA.Object" type="ns4:EndpointReferenceType"
/>
-    <corba:object xmlns:ns5="http://www.w3.org/2005/08/addressing" xmlns:ns4="http://schemas.apache.org/yoko/idl/ObjectRef"
xmlns="" binding="ns4:TestObjectCORBABinding" repositoryID="IDL:TestObject:1.0" name="TestObject"
type="ns5:EndpointReferenceType" />
+    <corba:object xmlns:ns4="http://www.w3.org/2005/08/addressing" xmlns="http://schemas.apache.org/yoko/idl/ObjectRef/typemap"
repositoryID="IDL:omg.org/CORBA/Object/1.0" name="CORBA.Object" type="ns4:EndpointReferenceType"
/>
+    <corba:object xmlns:ns5="http://www.w3.org/2005/08/addressing" xmlns:ns4="http://schemas.apache.org/yoko/idl/ObjectRef/typemap"
xmlns="http://schemas.apache.org/yoko/idl/ObjectRef" binding="TestObjectCORBABinding" repositoryID="IDL:TestObject:1.0"
name="ns4:TestObject" type="ns5:EndpointReferenceType" />
   </corba:typeMapping>
   <wsdl:types>
     <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://schemas.apache.org/yoko/idl/ObjectRef"
xmlns="http://schemas.apache.org/yoko/idl/ObjectRef" xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
@@ -87,7 +87,7 @@
       <xs:element name="testCustomObjectParam">
         <xs:complexType>
           <xs:sequence>
-            <xs:element ref="TestObjectRef">
+            <xs:element name="param" type="wsa:EndpointReferenceType">
             </xs:element>
           </xs:sequence>
         </xs:complexType>
@@ -115,7 +115,7 @@
       <xs:element name="testCustomObjectReturnResponse">
         <xs:complexType>
           <xs:sequence>
-            <xs:element ref="TestObjectRef">
+            <xs:element name="return" type="wsa:EndpointReferenceType">
             </xs:element>
           </xs:sequence>
         </xs:complexType>
@@ -214,7 +214,7 @@
     <corba:binding repositoryID="IDL:TestInterface:1.0" />
     <wsdl:operation name="testDefaultObjectParam">
       <corba:operation name="testDefaultObjectParam">
-        <corba:param xmlns="" mode="in" name="param" idltype="CORBA.Object" />
+        <corba:param xmlns="http://schemas.apache.org/yoko/idl/ObjectRef/typemap" mode="in"
name="param" idltype="CORBA.Object" />
         <corba:return name="return" idltype="corba:boolean" />
       </corba:operation>
       <wsdl:input name="testDefaultObjectParamRequest">
@@ -224,7 +224,7 @@
     </wsdl:operation>
     <wsdl:operation name="testDefaultObjectReturn">
       <corba:operation name="testDefaultObjectReturn">
-        <corba:return xmlns="" name="return" idltype="CORBA.Object" />
+        <corba:return xmlns="http://schemas.apache.org/yoko/idl/ObjectRef/typemap" name="return"
idltype="CORBA.Object" />
       </corba:operation>
       <wsdl:input name="testDefaultObjectReturnRequest">
       </wsdl:input>
@@ -233,7 +233,7 @@
     </wsdl:operation>
     <wsdl:operation name="testCustomObjectParam">
       <corba:operation name="testCustomObjectParam">
-        <corba:param xmlns="" mode="in" name="param" idltype="TestObject" />
+        <corba:param xmlns="http://schemas.apache.org/yoko/idl/ObjectRef/typemap" mode="in"
name="param" idltype="TestObject" />
         <corba:return name="return" idltype="corba:boolean" />
       </corba:operation>
       <wsdl:input name="testCustomObjectParamRequest">
@@ -243,7 +243,7 @@
     </wsdl:operation>
     <wsdl:operation name="testCustomObjectReturn">
       <corba:operation name="testCustomObjectReturn">
-        <corba:return xmlns="" name="return" idltype="TestObject" />
+        <corba:return xmlns="http://schemas.apache.org/yoko/idl/ObjectRef/typemap" name="return"
idltype="TestObject" />
       </corba:operation>
       <wsdl:input name="testCustomObjectReturnRequest">
       </wsdl:input>



Mime
View raw message