[savara-commits] savara SVN: r213 - in tools/eclipse/trunk/plugins: org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Mar 25 19:06:56 EDT 2010


Author: objectiser
Date: 2010-03-25 19:06:56 -0400 (Thu, 25 Mar 2010)
New Revision: 213

Modified:
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java
Log:
SAVARA-63 - allow multiple schema files to be specified.

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java	2010-03-25 22:07:38 UTC (rev 212)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java	2010-03-25 23:06:56 UTC (rev 213)
@@ -322,27 +322,32 @@
 							
 							if (ns.getSchemaLocation() != null &&
 									ns.getSchemaLocation().trim().length() > 0) {
-								IFile file=cdmResource.getParent().getFile(new Path(ns.getSchemaLocation()));
 								
-								javax.wsdl.Import imp=defns.get(0).createImport();
+								java.util.StringTokenizer st=new java.util.StringTokenizer(ns.getSchemaLocation());
 								
-								imp.setDefinition(defn);
-								imp.setNamespaceURI(ns.getURI());
-								imp.setLocationURI(file.getName());
-								
-								defns.get(0).addImport(imp);					
-								
-								IPath artifactPath=wsdlFolderPath.append(file.getName());
-					
-								IFile artifactFile=cdmResource.getProject().getWorkspace().getRoot().getFile(artifactPath);
-
-								if (artifactFile.exists() == false) {
-									artifactFile.create(null, true,
-											new org.eclipse.core.runtime.NullProgressMonitor());
+								while (st.hasMoreTokens()) {
+									IFile file=cdmResource.getParent().getFile(new Path(st.nextToken()));
+									
+									javax.wsdl.Import imp=defns.get(0).createImport();
+									
+									imp.setDefinition(defn);
+									imp.setNamespaceURI(ns.getURI());
+									imp.setLocationURI(file.getName());
+									
+									defns.get(0).addImport(imp);					
+									
+									IPath artifactPath=wsdlFolderPath.append(file.getName());
+						
+									IFile artifactFile=cdmResource.getProject().getWorkspace().getRoot().getFile(artifactPath);
+	
+									if (artifactFile.exists() == false) {
+										artifactFile.create(null, true,
+												new org.eclipse.core.runtime.NullProgressMonitor());
+									}
+									
+									artifactFile.setContents(file.getContents(), true, false,
+												new org.eclipse.core.runtime.NullProgressMonitor());
 								}
-								
-								artifactFile.setContents(file.getContents(), true, false,
-											new org.eclipse.core.runtime.NullProgressMonitor());
 							}
 						}
 					}

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java	2010-03-25 22:07:38 UTC (rev 212)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/actions/GenerateAction.java	2010-03-25 23:06:56 UTC (rev 213)
@@ -183,34 +183,32 @@
 							
 							if (ns.getSchemaLocation() != null &&
 										ns.getSchemaLocation().trim().length() > 0) {
-								IFile file=cdmResource.getParent().getFile(new Path(ns.getSchemaLocation()));
-								
-								javax.wsdl.Import imp=defns.get(0).createImport();
-								
-								imp.setDefinition(defn);
-								imp.setNamespaceURI(ns.getURI());
-								imp.setLocationURI(file.getName());
-								
-								defns.get(0).addImport(imp);					
-								
-								IPath artifactPath=wsdlFolderPath.append(file.getName());
-					
-								IFile artifactFile=cdmResource.getProject().getWorkspace().getRoot().getFile(artifactPath);
 
-								if (artifactFile.exists() == false) {
-									artifactFile.create(null, true,
-											new org.eclipse.core.runtime.NullProgressMonitor());
-								}
+								java.util.StringTokenizer st=new java.util.StringTokenizer(ns.getSchemaLocation());
 								
-								try {
+								while (st.hasMoreTokens()) {
+									IFile file=cdmResource.getParent().getFile(new Path(st.nextToken()));
+								
+									javax.wsdl.Import imp=defns.get(0).createImport();
+									
+									imp.setDefinition(defn);
+									imp.setNamespaceURI(ns.getURI());
+									imp.setLocationURI(file.getName());
+									
+									defns.get(0).addImport(imp);					
+									
+									IPath artifactPath=wsdlFolderPath.append(file.getName());
+						
+									IFile artifactFile=cdmResource.getProject().getWorkspace().getRoot().getFile(artifactPath);
+	
+									if (artifactFile.exists() == false) {
+										artifactFile.create(null, true,
+												new org.eclipse.core.runtime.NullProgressMonitor());
+									}
+									
 									artifactFile.setContents(file.getContents(), true, false,
-											new org.eclipse.core.runtime.NullProgressMonitor());
-								} catch(Exception e) {
-									org.jboss.savara.tools.wsdl.osgi.Activator.logError(
-											"Failed to generate WSDL for choreography '"+
-											cdmResource+"' to file: "+artifactFile.getName(), e);
+												new org.eclipse.core.runtime.NullProgressMonitor());
 								}
-
 							}
 						}
 					}



More information about the savara-commits mailing list