[savara-commits] savara SVN: r560 - in branches/experimental/2.0.x: bundles/org.savara.bpel.tests/src/test/java/org/savara/bpel/generator and 10 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Jan 7 18:15:36 EST 2011


Author: objectiser
Date: 2011-01-07 18:15:35 -0500 (Fri, 07 Jan 2011)
New Revision: 560

Added:
   branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/util/PropertyName.java
   branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/util/TypeSystem.java
   branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/ContractObject.java
Removed:
   branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/util/PropertyNames.java
Modified:
   branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/java/org/savara/bpel/generator/GeneratorTest.java
   branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/ESBBroker at Broker.bpel
   branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/ESBBroker at SupplierQuoteEngine.bpel
   branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/PurchaseGoods at CreditAgency.bpel
   branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/PurchaseGoods at Store.bpel
   branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/ReqRespFault at Seller.bpel
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionPatterns.java
   branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/generator/impl/ContractIntrospector.java
   branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Contract.java
   branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/FaultDetails.java
   branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Interface.java
   branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/MessageExchangePattern.java
   branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Namespace.java
   branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/OneWayRequestMEP.java
   branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/RequestResponseMEP.java
   branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Type.java
   branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/TypeDefinition.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/InteractionConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java
   branches/experimental/2.0.x/bundles/org.savara.wsdl/.classpath
   branches/experimental/2.0.x/bundles/org.savara.wsdl/META-INF/MANIFEST.MF
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/tools/wsdl/tests/WSDLGeneratorTest.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/Generator.java
Log:
More refactoring, to separate out the type definitions used in the contracts rather than duplicating the information, and to centralise the property names (definitions) used in the protocol model. Issue remains about the best way to store type information across contract and protocol models.

Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionPatterns.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionPatterns.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionPatterns.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -17,8 +17,8 @@
  */
 package org.savara.bpel.model.change;
 
-import org.savara.bpel.util.BPELInteractionUtil;
 import org.savara.common.model.util.InteractionUtil;
+import org.savara.common.model.util.PropertyName;
 import org.scribble.protocol.model.*;
 
 /**
@@ -27,10 +27,6 @@
  */
 public class InteractionPatterns {
 
-	private static final String FAULT_NAME = "faultName";
-	private static final String MESSAGE_TYPE_LOCALPART = "messageTypeLocalPart";
-	private static final String MESSAGE_TYPE_NAMESPACE = "messageTypeNameSpace";
-
 	/**
 	 * This method checks whether the supplied interaction
 	 * is a request that requires a scope with associated
@@ -337,7 +333,7 @@
 		
 		if (InteractionUtil.isRequest(interaction) == false &&
 				interaction.getMessageSignature().getProperties().
-						keySet().contains(FAULT_NAME)) {
+						keySet().contains(PropertyName.FAULT_NAME)) {
 			ret = true;
 		}
 
@@ -349,7 +345,7 @@
 		
 		if (InteractionUtil.isRequest(interaction) == false &&
 				interaction.getMessageSignature().getProperties().
-						keySet().contains(FAULT_NAME)) {
+						keySet().contains(PropertyName.FAULT_NAME)) {
 			ret = true;
 		}
 
@@ -358,14 +354,15 @@
 	
 	public static String getFaultName(Interaction interaction) {
 		return((String)interaction.
-			getMessageSignature().getProperties().get(FAULT_NAME));
+			getMessageSignature().getProperties().get(PropertyName.FAULT_NAME));
 	}
 	
 	public static String getFaultName(When interaction) {
 		return((String)interaction.
-			getMessageSignature().getProperties().get(FAULT_NAME));
+			getMessageSignature().getProperties().get(PropertyName.FAULT_NAME));
 	}
 	
+	/*
 	public static String getMessageTypeLocalPart(Interaction interaction) {
 		return((String)interaction.
 			getMessageSignature().getProperties().get(MESSAGE_TYPE_LOCALPART));
@@ -375,6 +372,7 @@
 		return((String)interaction.
 			getMessageSignature().getProperties().get(MESSAGE_TYPE_NAMESPACE));
 	}
+	*/
 	
 	/*
 	public static String getVariableName(Interaction interaction) {

Modified: branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/java/org/savara/bpel/generator/GeneratorTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/java/org/savara/bpel/generator/GeneratorTest.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/java/org/savara/bpel/generator/GeneratorTest.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -25,7 +25,7 @@
 import org.savara.bpel.model.TProcess;
 import org.savara.bpel.util.BPELModelUtil;
 import org.savara.common.model.generator.ModelGenerator;
-import org.savara.common.model.util.PropertyNames;
+import org.savara.common.model.util.PropertyName;
 import org.scribble.common.logging.CachedJournal;
 import org.savara.pi4soa.cdm.parser.CDMProtocolParser;
 
@@ -184,7 +184,7 @@
     							// Obtain any namespace prefix map
     							java.util.Map<String, String> prefixes=
     									(java.util.Map<String, String>)
-    									projected.getProperties().get(PropertyNames.NAMESPACE_PREFIXES);
+    									projected.getProperties().get(PropertyName.NAMESPACE_PREFIXES);
     							
     							try {
     								java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();

Modified: branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/ESBBroker at Broker.bpel
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/ESBBroker at Broker.bpel	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/ESBBroker at Broker.bpel	2011-01-07 23:15:35 UTC (rev 560)
@@ -5,7 +5,7 @@
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_Supplier.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_BrokerArtifacts.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
     <partnerLinks>
-        <partnerLink myRole="BrokerBehavior" partnerLinkType="brk:BuyerToBrokerServiceLT" name="BuyerToBroker"/>
+        <partnerLink myRole="Broker" partnerLinkType="brk:BuyerToBrokerServiceLT" name="BuyerToBroker"/>
         <partnerLink partnerRole="SupplierQuoteEngineRequester" partnerLinkType="brk:BrokerToSupplierQuoteEngineLT" name="BrokerToSupplierQuoteEngine"/>
         <partnerLink partnerRole="CreditAgencyRequester" partnerLinkType="brk:BrokerToCreditAgencyLT" name="BrokerToCreditAgency"/>
         <partnerLink partnerRole="SupplierTxnProcessorRequester" partnerLinkType="brk:BrokerToSupplierTxnProcessorLT" name="BrokerToSupplierTxnProcessor"/>

Modified: branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/ESBBroker at SupplierQuoteEngine.bpel
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/ESBBroker at SupplierQuoteEngine.bpel	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/ESBBroker at SupplierQuoteEngine.bpel	2011-01-07 23:15:35 UTC (rev 560)
@@ -3,7 +3,7 @@
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="RequestForQuote_SupplierQuoteEngine.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="RequestForQuote_SupplierQuoteEngineArtifacts.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
     <partnerLinks>
-        <partnerLink myRole="SupplierBehavior" partnerLinkType="spr:BrokerToSupplierQuoteEngineServiceLT" name="BrokerToSupplierQuoteEngine"/>
+        <partnerLink myRole="SupplierQuoteEngine" partnerLinkType="spr:BrokerToSupplierQuoteEngineServiceLT" name="BrokerToSupplierQuoteEngine"/>
     </partnerLinks>
     <variables>
         <variable messageType="spr:getQuoteRequest" name="getQuoteRequestVar"/>

Modified: branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/PurchaseGoods at CreditAgency.bpel
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/PurchaseGoods at CreditAgency.bpel	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/PurchaseGoods at CreditAgency.bpel	2011-01-07 23:15:35 UTC (rev 560)
@@ -4,7 +4,7 @@
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
     <partnerLinks>
-        <partnerLink myRole="CreditAgencyInterface" partnerLinkType="pur:StoreToCreditAgencyServiceLT" name="StoreToCreditAgency"/>
+        <partnerLink myRole="CreditAgency" partnerLinkType="pur:StoreToCreditAgencyServiceLT" name="StoreToCreditAgency"/>
     </partnerLinks>
     <variables>
         <variable messageType="pur:checkCreditRequest" name="checkCreditRequestVar"/>

Modified: branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/PurchaseGoods at Store.bpel
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/PurchaseGoods at Store.bpel	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/PurchaseGoods at Store.bpel	2011-01-07 23:15:35 UTC (rev 560)
@@ -4,7 +4,7 @@
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_StoreArtifacts.wsdl" namespace="http://www.jboss.org/examples/store"/>
     <partnerLinks>
-        <partnerLink myRole="StoreInterface" partnerLinkType="sto:BuyerToStoreServiceLT" name="BuyerToStore"/>
+        <partnerLink myRole="Store" partnerLinkType="sto:BuyerToStoreServiceLT" name="BuyerToStore"/>
         <partnerLink partnerRole="CreditAgencyRequester" partnerLinkType="sto:StoreToCreditAgencyLT" name="StoreToCreditAgency"/>
     </partnerLinks>
     <variables>

Modified: branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/ReqRespFault at Seller.bpel
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/ReqRespFault at Seller.bpel	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/resources/generator/results/ReqRespFault at Seller.bpel	2011-01-07 23:15:35 UTC (rev 560)
@@ -3,7 +3,7 @@
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="ReqRespFaultProcess_Seller.wsdl" namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="ReqRespFaultProcess_SellerArtifacts.wsdl" namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
     <partnerLinks>
-        <partnerLink myRole="SellerBehavior" partnerLinkType="slr:BuyerToSellerServiceLT" name="BuyerToSeller"/>
+        <partnerLink myRole="Seller" partnerLinkType="slr:BuyerToSellerServiceLT" name="BuyerToSeller"/>
     </partnerLinks>
     <variables>
         <variable messageType="slr:checkCreditRequest" name="checkCreditRequestVar"/>

Copied: branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/util/PropertyName.java (from rev 558, branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/util/PropertyNames.java)
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/util/PropertyName.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/util/PropertyName.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.savara.common.model.util;
+
+public class PropertyName {
+
+	public static final String NAMESPACE_PREFIXES="NamespacePrefixes";
+	
+	public static final String SCHEMA_LOCATIONS="SchemaLocations";
+	
+	public static final String MESSAGE_TYPE = "MessageType";
+
+	public static final String INTERFACE_NAME = "InterfaceName";
+	
+	public static final String FAULT_NAME = "FaultName";
+
+	// TODO: Determine if required (SAVARA-158)
+	public static final String TYPE_SYSTEM = "TypeSystem";
+	
+	// XSD sub types
+	public static final String XSD_ELEMENT = "XSDElement";
+	public static final String XSD_TYPE = "XSDType";
+	
+}

Deleted: branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/util/PropertyNames.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/util/PropertyNames.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/util/PropertyNames.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -1,26 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- */
-package org.savara.common.model.util;
-
-public class PropertyNames {
-
-	public static final String NAMESPACE_PREFIXES="NamespacePrefixes";
-	
-	public static final String SCHEMA_LOCATIONS="SchemaLocations";
-	
-}

Added: branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/util/TypeSystem.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/util/TypeSystem.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/util/TypeSystem.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -0,0 +1,26 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.savara.common.model.util;
+
+public class TypeSystem {
+
+	public static final String XSD = "xsd";
+	
+	public static final String JAVA = "java";
+	
+}

Modified: branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/generator/impl/ContractIntrospector.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/generator/impl/ContractIntrospector.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/generator/impl/ContractIntrospector.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -25,6 +25,7 @@
 import java.util.logging.Logger;
 
 import org.savara.common.model.util.InteractionUtil;
+import org.savara.common.model.util.PropertyName;
 import org.savara.contract.model.Contract;
 import org.savara.contract.model.Interface;
 import org.savara.contract.model.MessageExchangePattern;
@@ -237,13 +238,22 @@
 	public Type convertType(TypeReference tref) {
 		Type ret=new Type();
 		
-		TypeDefinition td=new TypeDefinition();
-		td.setName(tref.getLocalpart());
-		td.setNamespace(tref.getNamespace());
-		//td.setTypeSystem(typeSystem);
+		if (getContract().getTypeDefinition(tref.getName()) == null) {
+			TypeDefinition td=new TypeDefinition();
+			td.setName(tref.getName());
+			
+			td.setDataType((String)tref.getProperties().get(PropertyName.MESSAGE_TYPE));
+			
+			// Copy properties that may provide additional information about the type
+			td.getProperties().putAll(tref.getProperties());
+			
+			//td.setNamespace(tref.getNamespace());
+			td.setTypeSystem((String)tref.getProperties().get(PropertyName.TYPE_SYSTEM));
+			
+			getContract().getTypeDefinitions().add(td);
+		}
 		
-		ret.getTypeDefinitions().add(td);
-		ret.setName(td.getName());
+		ret.setName(tref.getName());
 		
 		return(ret);
 	}

Modified: branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Contract.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Contract.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Contract.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -20,16 +20,16 @@
 /**
  * This class represents the contract.
  */
-public class Contract implements java.io.Serializable {
+public class Contract extends ContractObject {
 	
-	private static final long serialVersionUID = -2069422236288472372L;
-
 	private String m_name=null;
 	private String m_namespace=null;
 	private java.util.Set<Interface> m_interfaces=
 						new java.util.HashSet<Interface>();
 	private java.util.Set<Namespace> m_namespaces=
 			new java.util.HashSet<Namespace>();
+	private java.util.Set<TypeDefinition> m_typeDefinitions=
+		new java.util.HashSet<TypeDefinition>();
 	
 	/**
 	 * The default constructor.
@@ -85,6 +85,37 @@
 	}
 	
 	/**
+	 * This method returns the list of type definitions.
+	 * 
+	 * @return The list of type definitions
+	 */
+	public java.util.Set<TypeDefinition> getTypeDefinitions() {
+		return(m_typeDefinitions);
+	}
+	
+	/**
+	 * This method returns the type definition associated
+	 * with the supplied name.
+	 * 
+	 * @param name The type definition name
+	 * @return The type definition, or null if not found.
+	 */
+	public TypeDefinition getTypeDefinition(String name) {
+		TypeDefinition ret=null;
+		
+		java.util.Iterator<TypeDefinition> iter=getTypeDefinitions().iterator();
+		while (ret == null && iter.hasNext()) {
+			ret = iter.next();
+			
+			if (ret.getName().equals(name) == false) {
+				ret = null;
+			}
+		}
+		
+		return(ret);
+	}
+	
+	/**
 	 * This method returns the interface associated
 	 * with the supplied name.
 	 * 

Added: branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/ContractObject.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/ContractObject.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/ContractObject.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.savara.contract.model;
+
+/**
+ * Generic top level object inherited by all contract objects.
+ *
+ */
+public class ContractObject {
+
+	private java.util.Map<String,Object> m_properties=
+				new java.util.HashMap<String, Object>();
+
+	/**
+	 * This method returns the properties associated
+	 * with this contract object.
+	 * 
+	 * @return The properties
+	 */
+	public java.util.Map<String,Object> getProperties() {
+		return(m_properties);
+	}
+	
+}

Modified: branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/FaultDetails.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/FaultDetails.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/FaultDetails.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -20,9 +20,7 @@
 /**
  * This class represents the fault details.
  */
-public class FaultDetails implements java.io.Serializable {
-	
-	private static final long serialVersionUID = -3998017364115322343L;
+public class FaultDetails extends ContractObject {
 
 	private String m_name=null;
 	private String m_namespace=null;

Modified: branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Interface.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Interface.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Interface.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -21,9 +21,7 @@
  * This class represents an interface, as part of a contract.
  *
  */
-public class Interface implements java.io.Serializable {
-	
-	private static final long serialVersionUID = -5028398472232579842L;
+public class Interface extends ContractObject {
 
 	private String m_name=null;
 	private String m_namespace=null;

Modified: branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/MessageExchangePattern.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/MessageExchangePattern.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/MessageExchangePattern.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -20,9 +20,7 @@
 /**
  * This class represents the message exchange pattern.
  */
-public abstract class MessageExchangePattern implements java.io.Serializable {
-	
-	private static final long serialVersionUID = -5570256623664777195L;
+public abstract class MessageExchangePattern extends ContractObject {
 
 	private String m_operation=null;
 	private java.util.List<Type> m_types=

Modified: branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Namespace.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Namespace.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Namespace.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -20,9 +20,7 @@
 /**
  * This class represents the namespace.
  */
-public class Namespace implements java.io.Serializable {
-	
-	private static final long serialVersionUID = 705922078450920771L;
+public class Namespace extends ContractObject {
 
 	private String m_prefix=null;
 	private String m_uri=null;

Modified: branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/OneWayRequestMEP.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/OneWayRequestMEP.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/OneWayRequestMEP.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -20,9 +20,7 @@
 /**
  * This class represents the one-way message exchange pattern.
  */
-public class OneWayRequestMEP extends MessageExchangePattern implements java.io.Serializable {
-	
-	private static final long serialVersionUID = 8118537376650464370L;
+public class OneWayRequestMEP extends MessageExchangePattern {
 
 	/**
 	 * The default constructor.

Modified: branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/RequestResponseMEP.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/RequestResponseMEP.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/RequestResponseMEP.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -20,10 +20,8 @@
 /**
  * This class represents the request response message exchange pattern.
  */
-public class RequestResponseMEP extends MessageExchangePattern implements java.io.Serializable {
+public class RequestResponseMEP extends MessageExchangePattern {
 	
-	private static final long serialVersionUID = 723851982846902543L;
-
 	private java.util.List<Type> m_responseTypes=
 			new java.util.Vector<Type>();	
 	private java.util.List<FaultDetails> m_faultDetails=

Modified: branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Type.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Type.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/Type.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -25,8 +25,6 @@
 	private static final long serialVersionUID = 3623232001916287234L;
 
 	private String m_name=null;
-	private java.util.Set<TypeDefinition> m_typeDefinitions=
-		new java.util.HashSet<TypeDefinition>();
 	
 	/**
 	 * The default constructor.
@@ -53,12 +51,4 @@
 		m_name = name;
 	}
 	
-	/**
-	 * This method returns the list of type definitions.
-	 * 
-	 * @return The list of type definitions
-	 */
-	public java.util.Set<TypeDefinition> getTypeDefinitions() {
-		return(m_typeDefinitions);
-	}
 }

Modified: branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/TypeDefinition.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/TypeDefinition.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/model/TypeDefinition.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -20,15 +20,11 @@
 /**
  * This class represents a type definition within
  */
-public class TypeDefinition implements java.io.Serializable {
+public class TypeDefinition extends ContractObject {
 	
-	private static final long serialVersionUID = -3673043079078102077L;
-
-	public static final String XSD_ELEMENT="##XSDElement";
-	public static final String XSD_TYPE="##XSDType";
-	
 	private String m_name=null;	
-	private String m_namespace=null;
+	private String m_dataType=null;
+	private String m_location=null;
 	private String m_typeSystem=null;
 	
 	/**
@@ -48,34 +44,53 @@
 	}
 	
 	/**
-	 * This method returns the namespace associated with the
+	 * This method sets the name of the type.
+	 * 
+	 * @param name The name
+	 */
+	public void setName(String name) {
+		m_name = name;
+	}
+	
+	/**
+	 * This method returns the data type associated with the
 	 * type definition.
 	 * 
-	 * @return The namespace
+	 * @return The data type
 	 */
-	public String getNamespace() {
-		return(m_namespace);
+	public String getDataType() {
+		return(m_dataType);
 	}
 	
 	/**
-	 * This method sets the namespace of the type definition.
+	 * This method sets the data type of the type definition.
 	 * 
-	 * @param namespace The namespace
+	 * @param dataType The data type
 	 */
-	public void setNamespace(String namespace) {
-		m_namespace = namespace;
+	public void setDataType(String dataType) {
+		m_dataType = dataType;
 	}
 	
 	/**
-	 * This method sets the name of the type.
+	 * This method returns the location associated with the
+	 * type definition.
 	 * 
-	 * @param name The name
+	 * @return The location
 	 */
-	public void setName(String name) {
-		m_name = name;
+	public String getLocation() {
+		return(m_location);
 	}
 	
 	/**
+	 * This method sets the location of the type definition.
+	 * 
+	 * @param location The location
+	 */
+	public void setLocation(String location) {
+		m_location = location;
+	}
+	
+	/**
 	 * This method returns the type system associated with the
 	 * type definition.
 	 * 

Modified: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/InteractionConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/InteractionConverterRuleImpl.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/InteractionConverterRuleImpl.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -21,8 +21,12 @@
 
 import java.util.logging.Logger;
 
+import javax.xml.namespace.QName;
+
 import org.pi4soa.cdl.*;
 import org.pi4soa.cdl.Interaction;
+import org.savara.common.model.util.PropertyName;
+import org.savara.common.model.util.TypeSystem;
 import org.scribble.protocol.model.*;
 import org.scribble.protocol.model.Choice;
 import org.scribble.protocol.model.When;
@@ -33,10 +37,8 @@
 
 public class InteractionConverterRuleImpl implements ConverterRule {
 
-	private static final String INTERFACE_NAME = "interfaceName";
-	private static final String FAULT_NAME = "faultName";
-	private static final String MESSAGE_TYPE_LOCALPART = "messageTypeLocalPart";
-	private static final String MESSAGE_TYPE_NAMESPACE = "messageTypeNameSpace";
+	//private static final String MESSAGE_TYPE_LOCALPART = "messageTypeLocalPart";
+	//private static final String MESSAGE_TYPE_NAMESPACE = "messageTypeNameSpace";
 
 	/**
 	 * This method determines whether the rule can be applied
@@ -347,7 +349,7 @@
 			// Set interface name
 			if (cdl.getToRoleType() != null) {
 				// TODO: Deal with interfaces that have multiple behaviours
-				interaction.getProperties().put(INTERFACE_NAME,
+				interaction.getProperties().put(PropertyName.INTERFACE_NAME,
 						getInterfaceName(cdl));
 			}
 			
@@ -728,7 +730,7 @@
 		ms.setOperation(cdl.getOperation());
 		
 		if (NamesUtil.isSet(details.getFaultName())) {
-			ms.getProperties().put(FAULT_NAME,
+			ms.getProperties().put(PropertyName.FAULT_NAME,
 					details.getFaultName());
 		}
 
@@ -740,11 +742,20 @@
 			
 			ms.getTypeReferences().add(ref);
 			
+			// TODO: Determine if required (SAVARA-158)
+			ms.getProperties().put(PropertyName.TYPE_SYSTEM, TypeSystem.XSD);
+			
 			if (NamesUtil.isSet(itype.getTypeName())) {
 				String ns=CDLTypeUtil.getNamespace(itype.getTypeName(),
 								cdl);
 				String lp=XMLUtils.getLocalname(itype.getTypeName());
 				
+				QName qname=new QName(ns, lp);
+				ms.getProperties().put(PropertyName.MESSAGE_TYPE, qname.toString());
+				
+				ms.getProperties().put(PropertyName.XSD_TYPE, "true");
+				
+				/*
 				if (lp != null) {
 					ms.getProperties().put(MESSAGE_TYPE_LOCALPART,
 									lp);
@@ -753,11 +764,18 @@
 					ms.getProperties().put(MESSAGE_TYPE_NAMESPACE,
 									ns);
 				}
+				*/
 			} else if (NamesUtil.isSet(itype.getElementName())) {
 				String ns=CDLTypeUtil.getNamespace(itype.getElementName(),
 						cdl);
 				String lp=XMLUtils.getLocalname(itype.getElementName());
 		
+				QName qname=new QName(ns, lp);
+				ms.getProperties().put(PropertyName.MESSAGE_TYPE, qname.toString());
+								
+				ms.getProperties().put(PropertyName.XSD_ELEMENT, "true");
+				
+				/*
 				if (lp != null) {
 					ms.getProperties().put(MESSAGE_TYPE_LOCALPART,
 									lp);
@@ -766,6 +784,7 @@
 					ms.getProperties().put(MESSAGE_TYPE_NAMESPACE,
 									ns);
 				}
+				*/
 			}
 		}
 		

Modified: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolConverterRuleImpl.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolConverterRuleImpl.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -21,6 +21,8 @@
 
 import java.util.logging.Logger;
 
+import javax.xml.namespace.QName;
+
 import org.pi4soa.cdl.*;
 import org.pi4soa.cdl.Interaction;
 import org.pi4soa.cdl.interfaces.InterfaceDefinition;
@@ -32,6 +34,8 @@
 import org.pi4soa.cdl.util.PackageUtil;
 import org.pi4soa.common.util.NamesUtil;
 import org.pi4soa.common.xml.XMLUtils;
+import org.savara.common.model.util.PropertyName;
+import org.savara.common.model.util.TypeSystem;
 import org.savara.contract.model.*;
 import org.scribble.protocol.model.*;
 
@@ -744,30 +748,46 @@
 		
 		protected Type createType(MessageDefinition defn) {
 			Type ret=new Type();
+	
 			TypeDefinition td=new TypeDefinition();
-			ret.getTypeDefinitions().add(td);
 			
+			td.setTypeSystem(TypeSystem.XSD);
+			
 			if (defn.getElement() != null && defn.getElement().trim().length() > 0) {
 				td.setName(defn.getElement());
 				
+				/*
 				if (defn.getElementNamespace() != null) {
 					td.setNamespace(defn.getElementNamespace());
 				}
+				*/
 				
-				td.setTypeSystem(TypeDefinition.XSD_ELEMENT);
+				QName qname=new QName(defn.getElementNamespace(), defn.getElement());
+				td.setDataType(qname.toString());
+				
+				td.getProperties().put(PropertyName.XSD_ELEMENT, "true");
 
 			} else if (defn.getType() != null && defn.getType().trim().length() > 0) {
 				td.setName(defn.getType());
 				
+				/*
 				if (defn.getTypeNamespace() != null) {
 					td.setNamespace(defn.getTypeNamespace());
 				}
+				*/
 				
-				td.setTypeSystem(TypeDefinition.XSD_TYPE);
+				QName qname=new QName(defn.getTypeNamespace(), defn.getType());
+				td.setDataType(qname.toString());
+				
+				td.getProperties().put(PropertyName.XSD_TYPE, "true");
 			}
 			
 			ret.setName(td.getName());
-			
+
+			if (getContract().getTypeDefinition(td.getName()) == null) {
+				getContract().getTypeDefinitions().add(td);
+			}
+
 			return(ret);
 		}
 

Modified: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -23,7 +23,7 @@
 
 import org.pi4soa.cdl.*;
 import org.pi4soa.cdl.util.CDLTypeUtil;
-import org.savara.common.model.util.PropertyNames;
+import org.savara.common.model.util.PropertyName;
 import org.scribble.protocol.model.*;
 
 public class ProtocolModelConverterRuleImpl implements ConverterRule {
@@ -77,8 +77,8 @@
 			}
 		}
 		
-		ret.getProperties().put(PropertyNames.NAMESPACE_PREFIXES, prefixes);
-		ret.getProperties().put(PropertyNames.SCHEMA_LOCATIONS, locations);
+		ret.getProperties().put(PropertyName.NAMESPACE_PREFIXES, prefixes);
+		ret.getProperties().put(PropertyName.SCHEMA_LOCATIONS, locations);
 			
 		// TODO: Consider how to use the namespace information
 		//ret.setNamespace(getNamespace(cdlpack));

Modified: branches/experimental/2.0.x/bundles/org.savara.wsdl/.classpath
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/.classpath	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/.classpath	2011-01-07 23:15:35 UTC (rev 560)
@@ -1,14 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-  <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
-  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
-  <classpathentry kind="output" path="target/classes"/>
-  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.core/1.4.0/org.osgi.core-1.4.0.jar"/>
-  <classpathentry kind="src" path="/org.savara.contract"/>
-  <classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0-SNAPSHOT/org.scribble.common-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0-SNAPSHOT/org.scribble.common-2.0.0-SNAPSHOT-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0-SNAPSHOT/org.scribble.protocol-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0-SNAPSHOT/org.scribble.protocol-2.0.0-SNAPSHOT-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar"/>
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-</classpath>
\ No newline at end of file
+	<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/>
+	<classpathentry including="**/*.java" kind="src" path="src/main/java"/>
+	<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/>
+	<classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.core/1.4.0/org.osgi.core-1.4.0.jar"/>
+	<classpathentry kind="src" path="/org.savara.contract"/>
+	<classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0-SNAPSHOT/org.scribble.common-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.common/2.0.0-SNAPSHOT/org.scribble.common-2.0.0-SNAPSHOT-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0-SNAPSHOT/org.scribble.protocol-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/scribble/bundles/org.scribble.protocol/2.0.0-SNAPSHOT/org.scribble.protocol-2.0.0-SNAPSHOT-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/org.savara.common"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

Modified: branches/experimental/2.0.x/bundles/org.savara.wsdl/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/META-INF/MANIFEST.MF	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/META-INF/MANIFEST.MF	2011-01-07 23:15:35 UTC (rev 560)
@@ -8,6 +8,7 @@
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Import-Package: org.osgi.framework;version="1.3.0"
 Require-Bundle: javax.wsdl;visibility:=reexport,
+ org.savara.common,
  org.savara.contract,
  org.apache.commons.logging,
  org.scribble.common,

Modified: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -22,6 +22,8 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.savara.common.model.util.PropertyName;
+import org.savara.common.model.util.TypeSystem;
 import org.savara.contract.model.FaultDetails;
 import org.savara.contract.model.Interface;
 import org.savara.contract.model.Namespace;
@@ -492,42 +494,34 @@
 		} else {
 			Type ref=types.get(0);
 			
-			java.util.Iterator<TypeDefinition> iter=ref.getTypeDefinitions().iterator();
-			boolean f_done=false;
-			
-			while (f_done == false && iter.hasNext()) {
-				TypeDefinition td=iter.next();
+			TypeDefinition td=contract.getTypeDefinition(ref.getName());
 				
-				if (TypeDefinition.XSD_ELEMENT.equals(td.getTypeSystem()) ||
-						TypeDefinition.XSD_TYPE.equals(td.getTypeSystem())) {
-					javax.xml.namespace.QName qname=
-						new javax.xml.namespace.QName(td.getNamespace(),td.getName());
-					javax.wsdl.Definition defn=
-						getDefinition(wsdls, contract, msgname.getNamespaceURI(), wsdlBinding);
-							
-					if (defn != null && qname != null &&
-							(ret = defn.getMessage(msgname)) == null) {
-						ret = defn.createMessage();
-						ret.setUndefined(false);
+			if (td != null && TypeSystem.XSD.equals(td.getTypeSystem())) {
+				javax.xml.namespace.QName qname=
+					new javax.xml.namespace.QName(td.getDataType());
+				javax.wsdl.Definition defn=
+					getDefinition(wsdls, contract, msgname.getNamespaceURI(), wsdlBinding);
 						
-						ret.setQName(msgname);
-						
-						// Create single part for type or element
-						Part part=defn.createPart();
-						part.setName("content");
-						
-						if (TypeDefinition.XSD_ELEMENT.equals(td.getTypeSystem())) {
-							part.setElementName(qname);					
-						} else {
-							part.setTypeName(qname);
-						}
-						
-						ret.addPart(part);
-						
-						defn.addMessage(ret);
-						
-						f_done = true;
+				if (defn != null && qname != null &&
+						(ret = defn.getMessage(msgname)) == null) {
+					ret = defn.createMessage();
+					ret.setUndefined(false);
+					
+					ret.setQName(msgname);
+					
+					// Create single part for type or element
+					Part part=defn.createPart();
+					part.setName("content");
+					
+					if (td.getProperties().containsKey(PropertyName.XSD_ELEMENT)) {
+						part.setElementName(qname);					
+					} else {
+						part.setTypeName(qname);
 					}
+					
+					ret.addPart(part);
+					
+					defn.addMessage(ret);
 				}
 			}
 		}

Modified: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/tools/wsdl/tests/WSDLGeneratorTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/tools/wsdl/tests/WSDLGeneratorTest.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/tools/wsdl/tests/WSDLGeneratorTest.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -20,6 +20,8 @@
 import javax.wsdl.Part;
 import javax.xml.namespace.QName;
 
+import org.savara.common.model.util.PropertyName;
+import org.savara.common.model.util.TypeSystem;
 import org.savara.contract.model.*;
 import org.savara.wsdl.generator.WSDLGenerator;
 import org.savara.wsdl.generator.WSDLGeneratorFactory;
@@ -33,6 +35,8 @@
 	private static final String HTTP_TEST_NAMESPACE = "http://test.namespace";
 	private static final String TEST_TYPE_NS = "testTypeNS";
 	private static final String TEST_TYPE_LP = "testTypeLP";
+	private static final String TEST_TYPE_LP2 = "testTypeLP2";
+	private static final String TEST_TYPE_LP3 = "testTypeLP3";
 	private static final String TEST_NAME_SPACE = "testNameSpace";
 	private static final String TEST_NAME_SPACE2 = "testNameSpace2";
 	private static final String TEST_NAME_SPACE3 = "testNameSpace3";
@@ -166,12 +170,15 @@
 		m1.setOperation(TEST_NAME);
 		
 		Type tref1=new Type();
+		tref1.setName(TEST_TYPE_LP);
+		m1.getTypes().add(tref1);
+		
 		TypeDefinition ref1=new TypeDefinition();
-		tref1.getTypeDefinitions().add(ref1);
 		ref1.setName(TEST_TYPE_LP);
-		ref1.setNamespace(TEST_NAME_SPACE);
-		ref1.setTypeSystem(TypeDefinition.XSD_TYPE);
-		m1.getTypes().add(tref1);
+		ref1.setDataType(new QName(TEST_NAME_SPACE,TEST_TYPE_LP).toString());
+		ref1.setTypeSystem(TypeSystem.XSD);
+		ref1.getProperties().put(PropertyName.XSD_TYPE, "true");
+		c.getTypeDefinitions().add(ref1);
 		
 		i1.getMessageExchangePatterns().add(m1);
 		
@@ -184,11 +191,16 @@
 		m2.setOperation(TEST_NAME);
 		
 		Type tref2=new Type();
+		
+		/*
 		TypeDefinition ref2=new TypeDefinition();
 		tref2.getTypeDefinitions().add(ref1);
 		ref2.setName(TEST_TYPE_LP);
 		ref2.setNamespace(TEST_NAME_SPACE);
 		ref2.setTypeSystem(TypeDefinition.XSD_TYPE);
+		*/
+		
+		tref2.setName(TEST_TYPE_LP);
 		m2.getTypes().add(tref2);
 		
 		i2.getMessageExchangePatterns().add(m2);
@@ -202,11 +214,16 @@
 		m3.setOperation(TEST_NAME);
 		
 		Type tref3=new Type();
+		
+		/*
 		TypeDefinition ref3=new TypeDefinition();
 		tref3.getTypeDefinitions().add(ref1);
 		ref3.setName(TEST_TYPE_LP);
 		ref3.setNamespace(TEST_NAME_SPACE);
 		ref3.setTypeSystem(TypeDefinition.XSD_TYPE);
+		*/
+		
+		tref3.setName(TEST_TYPE_LP);
 		m3.getTypes().add(tref3);
 		
 		i3.getMessageExchangePatterns().add(m3);
@@ -250,16 +267,28 @@
 			fail("Failed to get definition");
 		}
 		
+		Contract c=new Contract();
+		
 		OneWayRequestMEP src=new OneWayRequestMEP();
 		
 		src.setOperation(TEST_NAME);
 		
 		Type tref=new Type();
+		
 		TypeDefinition ref=new TypeDefinition();
+		ref.setName(TEST_TYPE_LP);
+		ref.setDataType(new QName(TEST_TYPE_NS,TEST_TYPE_LP).toString());
+		ref.setTypeSystem(TypeSystem.XSD);
+		ref.getProperties().put(PropertyName.XSD_TYPE, "true");
+		c.getTypeDefinitions().add(ref);
+
+		/*
+		TypeDefinition ref=new TypeDefinition();
 		tref.getTypeDefinitions().add(ref);
 		ref.setName(TEST_TYPE_LP);
 		ref.setNamespace(TEST_TYPE_NS);
 		ref.setTypeSystem(TypeDefinition.XSD_TYPE);
+		*/
 		tref.setName(ref.getName());
 		src.getTypes().add(tref);
 		
@@ -308,35 +337,56 @@
 			fail("Failed to get definition");
 		}
 		
+		Contract c=new Contract();
+		
 		RequestResponseMEP src=new RequestResponseMEP();
 		
 		src.setOperation(TEST_NAME);
 		
 		Type tref1=new Type();
+				
 		TypeDefinition ref1=new TypeDefinition();
+		ref1.setName(TEST_TYPE_LP);
+		ref1.setDataType(new QName(TEST_TYPE_NS,TEST_TYPE_LP).toString());
+		ref1.setTypeSystem(TypeSystem.XSD);
+		ref1.getProperties().put(PropertyName.XSD_TYPE, "true");
+		c.getTypeDefinitions().add(ref1);
+
+		/*
+		TypeDefinition ref1=new TypeDefinition();
 		tref1.getTypeDefinitions().add(ref1);
 		ref1.setName(TEST_TYPE_LP);
 		ref1.setNamespace(TEST_TYPE_NS);
 		ref1.setTypeSystem(TypeDefinition.XSD_TYPE);
+		*/
+		tref1.setName(TEST_TYPE_LP);
 		src.getTypes().add(tref1);
 		
 		Type tref2=new Type();
+		/*
 		TypeDefinition ref2=new TypeDefinition();
 		tref2.getTypeDefinitions().add(ref2);
 		ref2.setName(TEST_TYPE_LP);
 		ref2.setNamespace(TEST_TYPE_NS);
 		ref2.setTypeSystem(TypeDefinition.XSD_TYPE);
+		*/
+
+		tref2.setName(TEST_TYPE_LP);
 		src.getResponseTypes().add(tref2);
 		
 		FaultDetails fd1=new FaultDetails();
 		fd1.setName("faultName1");
 
 		Type tref3=new Type();
+		
+		/*
 		TypeDefinition ref3=new TypeDefinition();
 		tref3.getTypeDefinitions().add(ref3);
 		ref3.setName(TEST_TYPE_LP);
 		ref3.setNamespace(TEST_TYPE_NS);
 		ref3.setTypeSystem(TypeDefinition.XSD_TYPE);
+		*/
+		tref3.setName(TEST_TYPE_LP);
 		fd1.getTypes().add(tref3);
 		
 		src.getFaultDetails().add(fd1);
@@ -345,11 +395,14 @@
 		fd2.setName("faultName2");
 
 		Type tref4=new Type();
+		/*
 		TypeDefinition ref4=new TypeDefinition();
 		tref4.getTypeDefinitions().add(ref4);
 		ref4.setName(TEST_TYPE_LP);
 		ref4.setNamespace(TEST_TYPE_NS);
 		ref4.setTypeSystem(TypeDefinition.XSD_TYPE);
+		*/
+		fd2.setName(TEST_TYPE_LP);
 		fd2.getTypes().add(tref4);
 		
 		src.getFaultDetails().add(fd2);
@@ -400,13 +453,24 @@
 			fail("Failed to get definition");
 		}
 		
+		Contract c=new Contract();
+		
 		TypeDefinition src=new TypeDefinition();
+		
+		/*
 		src.setName(TEST_TYPE_LP);
 		src.setNamespace(TEST_TYPE_NS);
 		src.setTypeSystem(TypeDefinition.XSD_TYPE);
-		
+		*/
+		src.setName(TEST_TYPE_LP);
+		src.setDataType(new QName(TEST_TYPE_NS,TEST_TYPE_LP).toString());
+		src.setTypeSystem(TypeSystem.XSD);
+		src.getProperties().put(PropertyName.XSD_TYPE, "true");
+		c.getTypeDefinitions().add(src);
+
 		Type t=new Type();
-		t.getTypeDefinitions().add(src);
+		//t.getTypeDefinitions().add(src);
+		t.setName(TEST_TYPE_LP);
 		
 		java.util.List<Type> refs=new java.util.Vector<Type>();
 		refs.add(t);
@@ -483,10 +547,21 @@
 		
 		Type tref1=new Type();
 		TypeDefinition ref1=new TypeDefinition();
+		
+		ref1.setName(TEST_TYPE_LP);
+		ref1.setDataType(new QName(TEST_NAME_SPACE,TEST_TYPE_LP).toString());
+		ref1.setTypeSystem(TypeSystem.XSD);
+		ref1.getProperties().put(PropertyName.XSD_TYPE, "true");
+		c.getTypeDefinitions().add(ref1);
+		
+		/*
 		tref1.getTypeDefinitions().add(ref1);
 		ref1.setName(TEST_TYPE_LP);
 		ref1.setNamespace(TEST_NAME_SPACE);
 		ref1.setTypeSystem(TypeDefinition.XSD_TYPE);
+		*/
+		
+		tref1.setName(TEST_TYPE_LP);
 		m1.getTypes().add(tref1);
 		
 		i1.getMessageExchangePatterns().add(m1);
@@ -501,10 +576,20 @@
 		
 		Type tref2=new Type();
 		TypeDefinition ref2=new TypeDefinition();
+
+		ref2.setName(TEST_TYPE_LP2);
+		ref2.setDataType(new QName(TEST_NAME_SPACE2,TEST_TYPE_LP).toString());
+		ref2.setTypeSystem(TypeSystem.XSD);
+		ref2.getProperties().put(PropertyName.XSD_TYPE, "true");
+		c.getTypeDefinitions().add(ref2);
+		
+		/*
 		tref2.getTypeDefinitions().add(ref2);
 		ref2.setName(TEST_TYPE_LP);
 		ref2.setNamespace(TEST_NAME_SPACE2);
 		ref2.setTypeSystem(TypeDefinition.XSD_TYPE);
+		*/
+		tref2.setName(TEST_TYPE_LP2);
 		m2.getTypes().add(tref2);
 		
 		i2.getMessageExchangePatterns().add(m2);
@@ -519,10 +604,20 @@
 		
 		Type tref3=new Type();
 		TypeDefinition ref3=new TypeDefinition();
+		
+		ref3.setName(TEST_TYPE_LP3);
+		ref3.setDataType(new QName(TEST_NAME_SPACE3,TEST_TYPE_LP).toString());
+		ref3.setTypeSystem(TypeSystem.XSD);
+		ref3.getProperties().put(PropertyName.XSD_TYPE, "true");
+		c.getTypeDefinitions().add(ref3);
+		
+		/*
 		tref3.getTypeDefinitions().add(ref3);
 		ref3.setName(TEST_TYPE_LP);
 		ref3.setNamespace(TEST_NAME_SPACE3);
 		ref3.setTypeSystem(TypeDefinition.XSD_TYPE);
+		*/
+		tref3.setName(TEST_TYPE_LP3);
 		m3.getTypes().add(tref3);
 		
 		i3.getMessageExchangePatterns().add(m3);

Modified: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/Generator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/Generator.java	2011-01-07 20:30:44 UTC (rev 559)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/Generator.java	2011-01-07 23:15:35 UTC (rev 560)
@@ -35,7 +35,7 @@
 import org.savara.bpel.generator.ProtocolToBPELModelGenerator;
 import org.savara.bpel.model.*;
 import org.savara.bpel.util.BPELModelUtil;
-import org.savara.common.model.util.PropertyNames;
+import org.savara.common.model.util.PropertyName;
 import org.savara.common.util.XMLUtils;
 import org.savara.contract.model.Contract;
 import org.savara.contract.model.Interface;
@@ -255,7 +255,7 @@
 			
 			java.util.Map<String, String> prefixes=
 					(java.util.Map<String, String>)
-					localcm.getProperties().get(PropertyNames.NAMESPACE_PREFIXES);
+					localcm.getProperties().get(PropertyName.NAMESPACE_PREFIXES);
 			
 			//String bpelText=XMLUtils.toText(bpelProcess.getDOMElement());
 			ByteArrayOutputStream os=new ByteArrayOutputStream();



More information about the savara-commits mailing list