[savara-commits] savara SVN: r650 - in branches/experimental/2.0.x: tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/actions and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Feb 10 17:51:12 EST 2011


Author: objectiser
Date: 2011-02-10 17:51:12 -0500 (Thu, 10 Feb 2011)
New Revision: 650

Modified:
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ProtocolModelChangeRule.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/actions/GenerateAction.java
Log:


Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ProtocolModelChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ProtocolModelChangeRule.java	2011-02-10 22:03:36 UTC (rev 649)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ProtocolModelChangeRule.java	2011-02-10 22:51:12 UTC (rev 650)
@@ -168,9 +168,6 @@
 		Contract contract=ModelChangeUtils.getContract(context, role);
 		
 		if (contract != null) {
-		//if (role.getProperties().containsKey(Contract.class.getName())) {
-			//Contract contract=(Contract)role.getProperties().get(Contract.class.getName());
-
 			boolean gen=false;
 			
 			java.util.Iterator<Interface> iter=contract.getInterfaces().iterator();

Modified: branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/actions/GenerateAction.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/actions/GenerateAction.java	2011-02-10 22:03:36 UTC (rev 649)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.wsdl/src/java/org/savara/tools/wsdl/actions/GenerateAction.java	2011-02-10 22:51:12 UTC (rev 650)
@@ -79,52 +79,38 @@
 	protected void generateWSDL(IFile res) {
 		
 		/*
-		ModelReference ref=
-			org.scribble.eclipse.model.admin.OSGIModelRepository.createReference(res);
-		ConversationModel conversationModel=null;
-		java.util.List<ModelReference> localModelRefs=null;
+		Journal journal=new CachedJournal();
 		
-		if (ref != null) {
-			ModelRepository mrep=(ModelRepository)
-					RegistryFactory.getRegistry().getExtension(
-						ModelRepository.class, null);
-
-			if (mrep != null) {
-				Model model=mrep.getModel(ref,
-								new DefaultModelListener());
-				
-				if (model instanceof ConversationModel) {
-					conversationModel = (ConversationModel)model;
-						
-					localModelRefs = conversationModel.getLocalModels(ref);
-				}
+		try {
+			m_protocolModel = ScribbleServices.getParserManager().parse(res.getFileExtension(),
+								res.getContents(), journal, null);
+			
+			if (m_protocolModel == null) {
+				logger.error("Unable to load model used to generate the WSDL definition");
 			}
+		} catch(Exception e) {
+			logger.error("Failed to load model used to generated WSDL definition", e);
 		}
-		
-		if (conversationModel == null) {
-			logger.error("Unable to load model used to generate " +
-					"the BPEL artefacts", null);
-		} else if (localModelRefs != null) {
-			for (ModelReference mref : localModelRefs) {
-				
-				try {
-					generateWSDL(conversationModel, mref, res);
-				} catch(Exception e) {
-					org.savara.tools.wsdl.osgi.Activator.logError("Failed to generate WSDL for '"+res+"'", e);
-				}
-			}
-		}
 		*/
 	}
 
 	protected void generateWSDL(ProtocolModel pm, Role role, IResource cdmResource) throws Exception {		
 
-		if (role.getProperties().containsKey(Contract.class.getName())) {
+		Contract contract=null;
+		/*
+		ContractGenerator cg=ContractGeneratorFactory.getContractGenerator();
+		
+		if (cg != null) {
+			CachedJournal journal=new CachedJournal();
+			contract=cg.generate(m_protocolModel.getProtocol(), null, role, journal);
+		}
+		*/
+		
+		if (contract != null) {
 			javax.wsdl.xml.WSDLWriter writer=
 				javax.wsdl.factory.WSDLFactory.newInstance().newWSDLWriter();
 			org.savara.wsdl.generator.WSDLGenerator generator=
 							WSDLGeneratorFactory.getWSDLGenerator();
-			Contract contract=(Contract)role.getProperties().get(Contract.class.getName());
 		
 			// Generate WSDL folder
 			IPath wsdlFolderPath=cdmResource.getParent().getFullPath();



More information about the savara-commits mailing list