savara SVN: r41 - in trunk/tools/eclipse/plugins: org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl and 1 other directory.
by do-not-reply@jboss.org
Author: objectiser
Date: 2009-10-10 17:11:20 -0400 (Sat, 10 Oct 2009)
New Revision: 41
Modified:
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/AbstractInteraction.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java
Log:
Generate and use namespace/prefix information.
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/AbstractInteraction.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/AbstractInteraction.java 2009-10-10 21:09:31 UTC (rev 40)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/AbstractInteraction.java 2009-10-10 21:11:20 UTC (rev 41)
@@ -17,6 +17,7 @@
*/
package org.jboss.savara.tools.bpel.model.component;
+import org.scribble.model.TypeReference;
import org.scribble.model.admin.ModelListener;
import org.jboss.savara.tools.bpel.model.*;
@@ -143,6 +144,30 @@
return(ret);
}
+ protected TypeReference createTypeReference(String type, ConversionContext context) {
+ TypeReference ret=new TypeReference();
+
+ if (type != null) {
+ int index=-1;
+ if ((index=type.indexOf(':')) == -1) {
+ ret.setLocalpart(type);
+ } else {
+ ret.setLocalpart(type.substring(index+1));
+
+ String prefix=type.substring(0, index);
+ String ns=context.getNamespace(prefix);
+
+ if (ns != null) {
+ ret.setNamespace(ns);
+ } else {
+ // TODO: Log error
+ }
+ }
+ }
+
+ return(ret);
+ }
+
/**
* This method validates the BPEL activity and reports warnings or
* errors to the supplied model listener.
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java 2009-10-10 21:09:31 UTC (rev 40)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java 2009-10-10 21:11:20 UTC (rev 41)
@@ -42,5 +42,13 @@
* @param var The variable
*/
public void addVariable(Variable var);
-
+
+ /**
+ * This method returns the namespace for the supplied prefix.
+ *
+ * @param prefix The prefix
+ * @return The namespace, or null if not found
+ */
+ public String getNamespace(String prefix);
+
}
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java 2009-10-10 21:09:31 UTC (rev 40)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java 2009-10-10 21:11:20 UTC (rev 41)
@@ -29,8 +29,9 @@
*
* @param role The role
*/
- public DefaultConversionContext(String role) {
+ public DefaultConversionContext(String role, Process proc) {
m_role = role;
+ m_process = proc;
}
/**
@@ -63,7 +64,18 @@
m_variables.put(var.getName(), var);
}
+ /**
+ * This method returns the namespace for the supplied prefix.
+ *
+ * @param prefix The prefix
+ * @return The namespace, or null if not found
+ */
+ public String getNamespace(String prefix) {
+ return(m_process.getNamespace(prefix));
+ }
+
private String m_role=null;
+ private Process m_process=null;
private java.util.Map<String,Variable> m_variables=
new java.util.HashMap<String,Variable>();
}
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java 2009-10-10 21:09:31 UTC (rev 40)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java 2009-10-10 21:11:20 UTC (rev 41)
@@ -193,14 +193,10 @@
// Create interaction for request
ConversationInteraction interaction=new ConversationInteraction();
- TypeReference tref=new TypeReference();
-
Variable var=context.getVariable(getInputVariable());
- if (var != null) {
- tref.setLocalpart(var.getMessageType());
- }
-
+ TypeReference tref=createTypeReference(var.getMessageType(), context);
+
MessageSignature ms=new MessageSignature();
ms.setOperation(getOperation());
ms.getTypes().add(tref);
@@ -226,13 +222,9 @@
// Create interaction for request
ConversationInteraction interaction=new ConversationInteraction();
- TypeReference tref=new TypeReference();
-
Variable var=context.getVariable(getOutputVariable());
- if (var != null) {
- tref.setLocalpart(var.getMessageType());
- }
+ TypeReference tref=createTypeReference(var.getMessageType(), context);
MessageSignature ms=new MessageSignature();
ms.setOperation(getOperation());
@@ -259,7 +251,7 @@
// Create interaction for request
ConversationInteraction interaction=new ConversationInteraction();
- TypeReference tref=new TypeReference();
+ TypeReference tref=null;
// TODO: Not sure if fault variable is supposed to be declared
// in catch scope, or reused from outer scope?? If declared,
@@ -269,9 +261,11 @@
Variable var=context.getVariable(faultVar);
if (var != null) {
- tref.setLocalpart(var.getMessageType());
+ tref = createTypeReference(var.getMessageType(), context);
+ //tref.setLocalpart(var.getMessageType());
} else if (faultMesgType != null) {
- tref.setLocalpart(faultMesgType);
+ tref = createTypeReference(faultMesgType, context);
+ //tref.setLocalpart(faultMesgType);
}
MessageSignature ms=new MessageSignature();
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java 2009-10-10 21:09:31 UTC (rev 40)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java 2009-10-10 21:11:20 UTC (rev 41)
@@ -280,6 +280,33 @@
}
/**
+ * This method returns the namespace for the supplied prefix.
+ *
+ * @param prefix The prefix
+ * @return The namespace, or null if not found
+ */
+ public String getNamespace(String prefix) {
+ String ret=null;
+
+ org.w3c.dom.NamedNodeMap map=getDOMElement().getAttributes();
+
+ for (int i=0; ret == null && i < map.getLength(); i++) {
+ org.w3c.dom.Node node=map.item(i);
+
+ if (node instanceof org.w3c.dom.Attr) {
+ org.w3c.dom.Attr attr=(org.w3c.dom.Attr)node;
+
+ if (attr.getNodeName().equals("xmlns:"+prefix) ||
+ attr.getNodeName().equals(prefix)) {
+ ret = attr.getNodeValue();
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
* This method adds a new namespace and returns the
* prefix allocated to it.
*
@@ -713,7 +740,7 @@
}
// Convert the process contents
- DefaultConversionContext context=new DefaultConversionContext(role);
+ DefaultConversionContext context=new DefaultConversionContext(role, this);
// Add variables to the context
for (int i=0; i < m_variables.size(); i++) {
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java 2009-10-10 21:09:31 UTC (rev 40)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java 2009-10-10 21:11:20 UTC (rev 41)
@@ -132,13 +132,9 @@
ConversionContext context) {
ConversationInteraction interaction=new ConversationInteraction();
- TypeReference tref=new TypeReference();
-
Variable var=context.getVariable(getVariable());
- if (var != null) {
- tref.setLocalpart(var.getMessageType());
- }
+ TypeReference tref=createTypeReference(var.getMessageType(), context);
MessageSignature ms=new MessageSignature();
ms.setOperation(getOperation());
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java 2009-10-10 21:09:31 UTC (rev 40)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java 2009-10-10 21:11:20 UTC (rev 41)
@@ -120,13 +120,9 @@
ConversionContext context) {
ConversationInteraction interaction=new ConversationInteraction();
- TypeReference tref=new TypeReference();
-
Variable var=context.getVariable(getVariable());
- if (var != null) {
- tref.setLocalpart(var.getMessageType());
- }
+ TypeReference tref=createTypeReference(var.getMessageType(), context);
MessageSignature ms=new MessageSignature();
ms.setOperation(getOperation());
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java 2009-10-10 21:09:31 UTC (rev 40)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java 2009-10-10 21:11:20 UTC (rev 41)
@@ -20,6 +20,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.scribble.contract.model.FaultDetails;
+import org.scribble.contract.model.Namespace;
import org.scribble.contract.model.RequestResponseMEP;
import org.scribble.model.TypeReference;
@@ -55,11 +56,19 @@
}
ret.setTargetNamespace(contract.getNamespace());
+ // Set up namespace mappings
+ for (int i=0; i < contract.getNamespaces().size(); i++) {
+ Namespace ns=contract.getNamespaces().get(i);
+
+ ret.addNamespace(ns.getPrefix(), ns.getURI());
+ }
+
// Define a port type per interface
for (int i=0; i < contract.getInterfaces().size(); i++) {
javax.wsdl.PortType ptype=generatePortType(ret, contract.getInterfaces().get(i));
- if (ptype != null) {
+ // Only add portType to definition if they have atleast one operation
+ if (ptype != null && ptype.getOperations().size() > 0) {
ret.addPortType(ptype);
}
}
16 years, 6 months
savara SVN: r40 - trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator.
by do-not-reply@jboss.org
Author: objectiser
Date: 2009-10-10 17:09:31 -0400 (Sat, 10 Oct 2009)
New Revision: 40
Modified:
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
Log:
Generate WSDL for other roles, but only if they have a port type - which in turn means that it has operations.
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java 2009-10-08 19:41:21 UTC (rev 39)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java 2009-10-10 21:09:31 UTC (rev 40)
@@ -197,6 +197,12 @@
// Write the WSDL files
generateWSDL(role, proj, localcm);
+
+ java.util.List<Role> roles=localcm.getConversation().getRoles();
+
+ for (int i=0; i < roles.size(); i++) {
+ generateWSDL(roles.get(i), proj, localcm);
+ }
}
}
@@ -212,26 +218,29 @@
javax.wsdl.Definition defn=generator.generateDefinition(contract);
- java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();
-
- writer.writeWSDL(defn, baos);
-
- byte[] b=baos.toByteArray();
-
- baos.close();
-
- IPath wsdlPath=proj.getFullPath().append(
- new Path(getBuildSystem().getBPELFilePath())).
- append(localcm.getModelName().getName()+"_"+
- role.getName()+".wsdl");
-
- IFile wsdlFile=proj.getProject().getWorkspace().getRoot().getFile(wsdlPath);
- GeneratorUtil.createParentFolder(wsdlFile);
- wsdlFile.create(null, true,
- new org.eclipse.core.runtime.NullProgressMonitor());
-
- wsdlFile.setContents(new java.io.ByteArrayInputStream(b), true, false,
+ // Check if definition has a port type
+ if (defn.getPortTypes().size() > 0) {
+ java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();
+
+ writer.writeWSDL(defn, baos);
+
+ byte[] b=baos.toByteArray();
+
+ baos.close();
+
+ IPath wsdlPath=proj.getFullPath().append(
+ new Path(getBuildSystem().getBPELFilePath())).
+ append(localcm.getModelName().getName()+"_"+
+ role.getName()+".wsdl");
+
+ IFile wsdlFile=proj.getProject().getWorkspace().getRoot().getFile(wsdlPath);
+ GeneratorUtil.createParentFolder(wsdlFile);
+ wsdlFile.create(null, true,
new org.eclipse.core.runtime.NullProgressMonitor());
+
+ wsdlFile.setContents(new java.io.ByteArrayInputStream(b), true, false,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+ }
}
}
16 years, 6 months
savara SVN: r39 - in trunk/tools/eclipse/plugins: org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator and 1 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2009-10-08 15:41:21 -0400 (Thu, 08 Oct 2009)
New Revision: 39
Modified:
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java
Log:
Create wsdl for current role. Also will need to eventually create wsdls for partner roles, and additional wsdl definitions related to BPEL specific info, like partner link definitions.
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF 2009-10-05 20:00:54 UTC (rev 38)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF 2009-10-08 19:41:21 UTC (rev 39)
@@ -17,7 +17,8 @@
org.apache.commons.logging,
org.scribble.expression.xpath,
org.scribble.pi4soa.cdm;resolution:=optional,
- org.scribble.contract.model
+ org.scribble.contract.model,
+ org.jboss.savara.tools.wsdl
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: www.jboss.org
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java 2009-10-05 20:00:54 UTC (rev 38)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java 2009-10-08 19:41:21 UTC (rev 39)
@@ -24,6 +24,7 @@
import org.jboss.savara.tools.bpel.generator.BuildSystem;
import org.jboss.savara.tools.bpel.model.*;
import org.jboss.savara.tools.bpel.util.XMLUtils;
+import org.scribble.contract.model.Contract;
import org.scribble.conversation.model.*;
import org.scribble.extensions.RegistryFactory;
import org.scribble.model.*;
@@ -157,7 +158,7 @@
generator.generate(targetRef, role, target,
lcm);
- generateRoleProject(projectName,
+ generateRoleProject(projectName, role,
target.getBPELProcess().getDOMElement(),
lcm, target);
} else {
@@ -167,9 +168,9 @@
}
}
- protected void generateRoleProject(String projectName,
+ protected void generateRoleProject(String projectName, Role role,
org.w3c.dom.Element bpel, ConversationModel localcm,
- BPELLanguageModel model) throws Exception {
+ BPELLanguageModel model) throws Exception {
final IProject proj=createProject(projectName);
@@ -193,9 +194,47 @@
bpelText.getBytes()), true, false,
new org.eclipse.core.runtime.NullProgressMonitor());
}
+
+ // Write the WSDL files
+ generateWSDL(role, proj, localcm);
}
}
+
+ protected void generateWSDL(Role role, IProject proj, ConversationModel localcm)
+ throws Exception {
+
+ if (role.getAnnotations().containsKey(Contract.class.getName())) {
+ javax.wsdl.xml.WSDLWriter writer=
+ javax.wsdl.factory.WSDLFactory.newInstance().newWSDLWriter();
+ org.jboss.savara.tools.wsdl.WSDLGenerator generator=
+ new org.jboss.savara.tools.wsdl.WSDLGenerator();
+ Contract contract=(Contract)role.getAnnotations().get(Contract.class.getName());
+
+ javax.wsdl.Definition defn=generator.generateDefinition(contract);
+ java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();
+
+ writer.writeWSDL(defn, baos);
+
+ byte[] b=baos.toByteArray();
+
+ baos.close();
+
+ IPath wsdlPath=proj.getFullPath().append(
+ new Path(getBuildSystem().getBPELFilePath())).
+ append(localcm.getModelName().getName()+"_"+
+ role.getName()+".wsdl");
+
+ IFile wsdlFile=proj.getProject().getWorkspace().getRoot().getFile(wsdlPath);
+ GeneratorUtil.createParentFolder(wsdlFile);
+ wsdlFile.create(null, true,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+
+ wsdlFile.setContents(new java.io.ByteArrayInputStream(b), true, false,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+ }
+ }
+
protected IProject createProject(String projectName)
throws Exception {
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java 2009-10-05 20:00:54 UTC (rev 38)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java 2009-10-08 19:41:21 UTC (rev 39)
@@ -86,6 +86,7 @@
if (defn != null && intf != null) {
ret = defn.createPortType();
+ ret.setUndefined(false);
if (intf.getName() != null) {
ret.setQName(new javax.xml.namespace.QName(intf.getNamespace(), intf.getName()));
@@ -117,6 +118,7 @@
if (defn != null && mep != null) {
ret = defn.createOperation();
+ ret.setUndefined(false);
ret.setName(mep.getOperation());
@@ -192,6 +194,7 @@
if (qname != null &&
(ret = defn.getMessage(qname)) == null) {
ret = defn.createMessage();
+ ret.setUndefined(false);
ret.setQName(qname);
16 years, 6 months
savara SVN: r38 - in trunk/tools/eclipse/plugins: org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator and 2 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2009-10-05 16:00:54 -0400 (Mon, 05 Oct 2009)
New Revision: 38
Modified:
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/WSDLGeneratorTest.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java
Log:
Pass the contract details through to the BPEL generator, to enable it to import appropriate WSDL files.
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF 2009-10-03 20:58:25 UTC (rev 37)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF 2009-10-05 20:00:54 UTC (rev 38)
@@ -16,7 +16,8 @@
org.scribble.conversation.parser,
org.apache.commons.logging,
org.scribble.expression.xpath,
- org.scribble.pi4soa.cdm;resolution:=optional
+ org.scribble.pi4soa.cdm;resolution:=optional,
+ org.scribble.contract.model
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: www.jboss.org
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java 2009-10-03 20:58:25 UTC (rev 37)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java 2009-10-05 20:00:54 UTC (rev 38)
@@ -125,6 +125,13 @@
if (projector != null) {
Role role=new Role(localModelRef.getLocatedRole());
+ // Transfer contract details (if defined) from local model
+ // reference to role
+ if (localModelRef.getAnnotations().containsKey(org.scribble.contract.model.Contract.class.getName())) {
+ role.getAnnotations().put(org.scribble.contract.model.Contract.class.getName(),
+ localModelRef.getAnnotations().get(org.scribble.contract.model.Contract.class.getName()));
+ }
+
ModelReference srcRef=
new ModelReference(ConversationNotation.NOTATION_CODE);
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java 2009-10-03 20:58:25 UTC (rev 37)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java 2009-10-05 20:00:54 UTC (rev 38)
@@ -120,7 +120,7 @@
ret.setName(mep.getOperation());
- javax.wsdl.Message mesg=generateMessage(defn, mep.getTypes());
+ javax.wsdl.Message mesg=getMessage(defn, mep.getTypes());
if (mesg != null) {
javax.wsdl.Input input=defn.createInput();
@@ -132,7 +132,7 @@
if (mep instanceof RequestResponseMEP) {
RequestResponseMEP rr=(RequestResponseMEP)mep;
- javax.wsdl.Message om=generateMessage(defn, rr.getResponseTypes());
+ javax.wsdl.Message om=getMessage(defn, rr.getResponseTypes());
if (om != null) {
javax.wsdl.Output output=defn.createOutput();
output.setMessage(om);
@@ -144,7 +144,7 @@
for (int i=0; i < rr.getFaultDetails().size(); i++) {
FaultDetails fd=rr.getFaultDetails().get(i);
- javax.wsdl.Message fm=generateMessage(defn, fd.getTypes());
+ javax.wsdl.Message fm=getMessage(defn, fd.getTypes());
if (fm != null) {
javax.wsdl.Fault fault=defn.createFault();
fault.setName(fd.getName());
@@ -161,29 +161,42 @@
}
/**
- * This method generates a message, using the supplied WSDL definition,
+ * This method returns a message, using the supplied WSDL definition,
* based on the information supplied in the list of type references. If
* a single type reference is supplied, this will be the message type,
* if multiple type references are supplied, then these will be considered
- * the message parts.
+ * the message parts.<p>
+ * <p>
+ * The returned message will be part of the supplied definition. If it
+ * does not exist prior to the call to this method, then it will be
+ * created and added to the definition upon returning the message.
*
* @param defn The WSDL definition
* @param types The list of type references
* @return The WSDL message
*/
- public javax.wsdl.Message generateMessage(javax.wsdl.Definition defn,
+ public javax.wsdl.Message getMessage(javax.wsdl.Definition defn,
java.util.List<TypeReference> types) {
javax.wsdl.Message ret=null;
if (defn != null && types != null && types.size() > 0) {
- ret = defn.createMessage();
-
+ javax.xml.namespace.QName qname=null;
+
if (types.size() == 1) {
TypeReference ref=types.get(0);
- ret.setQName(new javax.xml.namespace.QName(ref.getNamespace(),ref.getLocalpart()));
+ qname = new javax.xml.namespace.QName(ref.getNamespace(),ref.getLocalpart());
} else {
throw new UnsupportedOperationException("Currently only supports single type reference");
}
+
+ if (qname != null &&
+ (ret = defn.getMessage(qname)) == null) {
+ ret = defn.createMessage();
+
+ ret.setQName(qname);
+
+ defn.addMessage(ret);
+ }
}
return(ret);
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/WSDLGeneratorTest.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/WSDLGeneratorTest.java 2009-10-03 20:58:25 UTC (rev 37)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/WSDLGeneratorTest.java 2009-10-05 20:00:54 UTC (rev 38)
@@ -283,7 +283,7 @@
WSDLGenerator gen=new WSDLGenerator();
- javax.wsdl.Message result=gen.generateMessage(defn, refs);
+ javax.wsdl.Message result=gen.getMessage(defn, refs);
if (result == null) {
fail("Message is null");
16 years, 6 months
savara SVN: r37 - in trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests: .settings and 10 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2009-10-03 16:58:25 -0400 (Sat, 03 Oct 2009)
New Revision: 37
Added:
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.classpath
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.project
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.settings/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.settings/org.eclipse.jdt.core.prefs
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.settings/org.eclipse.pde.core.prefs
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/META-INF/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/META-INF/MANIFEST.MF
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/build.properties
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/WSDLGeneratorTest.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/osgi/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/osgi/Activator.java
Log:
Creation of initial tests for WSDL generator plugin.
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.classpath
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.classpath (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.classpath 2009-10-03 20:58:25 UTC (rev 37)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/java"/>
+ <classpathentry kind="output" path="classes"/>
+</classpath>
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.project
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.project (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.project 2009-10-03 20:58:25 UTC (rev 37)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.savara.tools.wsdl.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.settings/org.eclipse.jdt.core.prefs 2009-10-03 20:58:25 UTC (rev 37)
@@ -0,0 +1,8 @@
+#Sat Oct 03 18:45:24 BST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.settings/org.eclipse.pde.core.prefs
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.settings/org.eclipse.pde.core.prefs (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/.settings/org.eclipse.pde.core.prefs 2009-10-03 20:58:25 UTC (rev 37)
@@ -0,0 +1,5 @@
+#Sat Oct 03 18:45:24 BST 2009
+eclipse.preferences.version=1
+pluginProject.equinox=false
+pluginProject.extensions=false
+resolve.requirebundle=false
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/META-INF/MANIFEST.MF (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/META-INF/MANIFEST.MF 2009-10-03 20:58:25 UTC (rev 37)
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Boss SAVARA Tools WSDL Tests Plug-in
+Bundle-SymbolicName: org.jboss.savara.tools.wsdl.tests
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.savara.tools.wsdl.tests.osgi.Activator
+Bundle-Vendor: www.jboss.org
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.osgi.framework;version="1.3.0"
+Require-Bundle: org.scribble.contract.model;bundle-version="0.1.0",
+ org.jboss.savara.tools.wsdl;bundle-version="1.0.0",
+ org.junit,
+ org.scribble.core;bundle-version="0.1.0"
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/build.properties
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/build.properties (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/build.properties 2009-10-03 20:58:25 UTC (rev 37)
@@ -0,0 +1,4 @@
+source.. = src/java/
+output.. = classes/
+bin.includes = META-INF/,\
+ .
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/WSDLGeneratorTest.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/WSDLGeneratorTest.java (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/WSDLGeneratorTest.java 2009-10-03 20:58:25 UTC (rev 37)
@@ -0,0 +1,312 @@
+/*
+ * 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.jboss.savara.tools.wsdl.tests;
+
+import org.jboss.savara.tools.wsdl.WSDLGenerator;
+import org.scribble.contract.model.*;
+import org.scribble.model.TypeReference;
+
+import junit.framework.TestCase;
+
+public class WSDLGeneratorTest extends TestCase {
+
+ private static final String TEST_TYPE_NS = "testTypeNS";
+ private static final String TEST_TYPE_LP = "testTypeLP";
+ private static final String TEST_NAME_SPACE = "testNameSpace";
+ private static final String TEST_NAME = "testName";
+
+ public void testDefnNameAndNamespace() {
+
+ Contract c=new Contract();
+
+ c.setName(TEST_NAME);
+ c.setNamespace(TEST_NAME_SPACE);
+
+ WSDLGenerator gen=new WSDLGenerator();
+
+ javax.wsdl.Definition defn=gen.generateDefinition(c);
+
+ if (defn == null) {
+ fail("Definition is null");
+ }
+
+ if (defn.getTargetNamespace() == null) {
+ fail("Target namespace not set");
+ }
+
+ if (TEST_NAME_SPACE.equals(defn.getTargetNamespace()) == false) {
+ fail("Target namespace not correct: "+defn.getTargetNamespace());
+ }
+
+ if (defn.getQName() == null) {
+ fail("QName not set");
+ }
+
+ if (defn.getQName().getLocalPart() == null) {
+ fail("QName localpart not set");
+ }
+
+ if (TEST_NAME.equals(defn.getQName().getLocalPart()) == false) {
+ fail("QName localpart not correct: "+defn.getQName().getLocalPart());
+ }
+ }
+
+ public void testPortTypeNameAndNamespace() {
+ javax.wsdl.Definition defn=null;
+ try {
+ javax.wsdl.factory.WSDLFactory fact=
+ javax.wsdl.factory.WSDLFactory.newInstance();
+
+ defn = fact.newDefinition();
+
+ } catch(Exception e) {
+ fail("Failed to get definition");
+ }
+
+ Interface src=new Interface();
+
+ src.setName(TEST_NAME);
+ src.setNamespace(TEST_NAME_SPACE);
+
+ WSDLGenerator gen=new WSDLGenerator();
+
+ javax.wsdl.PortType result=gen.generatePortType(defn, src);
+
+ if (result == null) {
+ fail("PortType is null");
+ }
+
+ if (result.getQName() == null) {
+ fail("QName not set");
+ }
+
+ if (result.getQName().getNamespaceURI() == null) {
+ fail("QName namespace not set");
+ }
+
+ if (TEST_NAME_SPACE.equals(result.getQName().getNamespaceURI()) == false) {
+ fail("Namespace not correct: "+result.getQName().getNamespaceURI());
+ }
+
+ if (result.getQName().getLocalPart() == null) {
+ fail("QName localpart not set");
+ }
+
+ if (TEST_NAME.equals(result.getQName().getLocalPart()) == false) {
+ fail("QName localpart not correct: "+result.getQName().getLocalPart());
+ }
+ }
+
+ public void testDefnWithPortTypes() {
+
+ Contract c=new Contract();
+
+ Interface i1=new Interface();
+ i1.setName("I1");
+
+ Interface i2=new Interface();
+ i2.setName("I2");
+
+ Interface i3=new Interface();
+ i3.setName("I3");
+
+ c.getInterfaces().add(i1);
+ c.getInterfaces().add(i2);
+ c.getInterfaces().add(i3);
+
+ WSDLGenerator gen=new WSDLGenerator();
+
+ javax.wsdl.Definition defn=gen.generateDefinition(c);
+
+ if (defn == null) {
+ fail("Definition is null");
+ }
+
+ if (defn.getPortTypes().size() != c.getInterfaces().size()) {
+ fail("Number of port types ("+defn.getPortTypes().size()+
+ ") does not match number of interfaces ("+
+ c.getInterfaces().size()+")");
+ }
+ }
+
+ public void testOperationOneWay() {
+ javax.wsdl.Definition defn=null;
+ try {
+ javax.wsdl.factory.WSDLFactory fact=
+ javax.wsdl.factory.WSDLFactory.newInstance();
+
+ defn = fact.newDefinition();
+
+ } catch(Exception e) {
+ fail("Failed to get definition");
+ }
+
+ OneWayRequestMEP src=new OneWayRequestMEP();
+
+ src.setOperation(TEST_NAME);
+
+ TypeReference ref=new TypeReference();
+ ref.setLocalpart(TEST_TYPE_LP);
+ ref.setNamespace(TEST_TYPE_NS);
+ src.getTypes().add(ref);
+
+ WSDLGenerator gen=new WSDLGenerator();
+
+ javax.wsdl.Operation result=gen.generateOperation(defn, src);
+
+ if (result == null) {
+ fail("Operation is null");
+ }
+
+ if (TEST_NAME.equals(result.getName()) == false) {
+ fail("Operation name mismatch: "+result.getName());
+ }
+
+ if (result.getInput() == null) {
+ fail("Input not set");
+ }
+
+ if (result.getOutput() != null) {
+ fail("Output should NOT be set");
+ }
+
+ if (result.getFaults().size() != 0) {
+ fail("Faults should NOT be defined");
+ }
+ }
+
+ public void testOperationReqRespFaults() {
+ javax.wsdl.Definition defn=null;
+ try {
+ javax.wsdl.factory.WSDLFactory fact=
+ javax.wsdl.factory.WSDLFactory.newInstance();
+
+ defn = fact.newDefinition();
+
+ } catch(Exception e) {
+ fail("Failed to get definition");
+ }
+
+ RequestResponseMEP src=new RequestResponseMEP();
+
+ src.setOperation(TEST_NAME);
+
+ TypeReference ref1=new TypeReference();
+ ref1.setLocalpart(TEST_TYPE_LP);
+ ref1.setNamespace(TEST_TYPE_NS);
+ src.getTypes().add(ref1);
+
+ TypeReference ref2=new TypeReference();
+ ref2.setLocalpart(TEST_TYPE_LP);
+ ref2.setNamespace(TEST_TYPE_NS);
+ src.getResponseTypes().add(ref2);
+
+ FaultDetails fd1=new FaultDetails();
+ fd1.setName("faultName1");
+
+ TypeReference ref3=new TypeReference();
+ ref3.setLocalpart(TEST_TYPE_LP);
+ ref3.setNamespace(TEST_TYPE_NS);
+ fd1.getTypes().add(ref3);
+
+ src.getFaultDetails().add(fd1);
+
+ FaultDetails fd2=new FaultDetails();
+ fd2.setName("faultName2");
+
+ TypeReference ref4=new TypeReference();
+ ref4.setLocalpart(TEST_TYPE_LP);
+ ref4.setNamespace(TEST_TYPE_NS);
+ fd2.getTypes().add(ref4);
+
+ src.getFaultDetails().add(fd2);
+
+ WSDLGenerator gen=new WSDLGenerator();
+
+ javax.wsdl.Operation result=gen.generateOperation(defn, src);
+
+ if (result == null) {
+ fail("Operation is null");
+ }
+
+ if (TEST_NAME.equals(result.getName()) == false) {
+ fail("Operation name mismatch: "+result.getName());
+ }
+
+ if (result.getInput() == null) {
+ fail("Input not set");
+ }
+
+ if (result.getOutput() == null) {
+ fail("Output not set");
+ }
+
+ if (result.getFaults().size() != src.getFaultDetails().size()) {
+ fail("Faults number ("+result.getFaults().size()+
+ ") does not match contract ("+src.getFaultDetails().size()+")");
+ }
+ }
+
+ public void testMessage() {
+ javax.wsdl.Definition defn=null;
+ try {
+ javax.wsdl.factory.WSDLFactory fact=
+ javax.wsdl.factory.WSDLFactory.newInstance();
+
+ defn = fact.newDefinition();
+
+ } catch(Exception e) {
+ fail("Failed to get definition");
+ }
+
+ TypeReference src=new TypeReference();
+ src.setLocalpart(TEST_TYPE_LP);
+ src.setNamespace(TEST_TYPE_NS);
+
+ java.util.List<TypeReference> refs=new java.util.Vector<TypeReference>();
+ refs.add(src);
+
+ WSDLGenerator gen=new WSDLGenerator();
+
+ javax.wsdl.Message result=gen.generateMessage(defn, refs);
+
+ if (result == null) {
+ fail("Message is null");
+ }
+
+ if (result.getQName() == null) {
+ fail("QName not set");
+ }
+
+ if (result.getQName().getLocalPart() == null) {
+ fail("QName localpart not set");
+ }
+
+ if (TEST_TYPE_LP.equals(result.getQName().getLocalPart()) == false) {
+ fail("QName localpart not correct: "+result.getQName().getLocalPart());
+ }
+
+ if (result.getQName().getNamespaceURI() == null) {
+ fail("QName namespace not set");
+ }
+
+ if (TEST_TYPE_NS.equals(result.getQName().getNamespaceURI()) == false) {
+ fail("QName namespace not correct: "+result.getQName().getNamespaceURI());
+ }
+ }
+}
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/osgi/Activator.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/osgi/Activator.java (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/osgi/Activator.java 2009-10-03 20:58:25 UTC (rev 37)
@@ -0,0 +1,22 @@
+package org.jboss.savara.tools.wsdl.tests.osgi;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ }
+
+}
16 years, 7 months
savara SVN: r36 - trunk/tools/eclipse/plugins.
by do-not-reply@jboss.org
Author: objectiser
Date: 2009-10-03 16:55:39 -0400 (Sat, 03 Oct 2009)
New Revision: 36
Added:
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl.tests/
Log:
Initial import.
16 years, 7 months
savara SVN: r35 - in trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl: src/java/org/jboss/savara/tools/wsdl and 1 other directory.
by do-not-reply@jboss.org
Author: objectiser
Date: 2009-10-03 16:51:57 -0400 (Sat, 03 Oct 2009)
New Revision: 35
Modified:
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/META-INF/MANIFEST.MF
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java
Log:
Added more generation functionality.
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/META-INF/MANIFEST.MF 2009-10-02 21:25:19 UTC (rev 34)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/META-INF/MANIFEST.MF 2009-10-03 20:51:57 UTC (rev 35)
@@ -7,6 +7,8 @@
Import-Package: org.osgi.framework;version="1.3.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: www.jboss.org
-Require-Bundle: javax.wsdl;bundle-version="1.5.1",
+Require-Bundle: javax.wsdl;bundle-version="1.5.1";visibility:=reexport,
org.scribble.contract.model;bundle-version="0.1.0",
- org.apache.commons.logging;bundle-version="1.0.4"
+ org.apache.commons.logging;bundle-version="1.0.4",
+ org.scribble.core;bundle-version="0.1.0"
+Export-Package: org.jboss.savara.tools.wsdl
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java 2009-10-02 21:25:19 UTC (rev 34)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java 2009-10-03 20:51:57 UTC (rev 35)
@@ -19,6 +19,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.scribble.contract.model.FaultDetails;
+import org.scribble.contract.model.RequestResponseMEP;
+import org.scribble.model.TypeReference;
/**
* This class generates a WSDL definition from a Contract model.
@@ -31,7 +34,13 @@
public WSDLGenerator() {
}
- public javax.wsdl.Definition generate(org.scribble.contract.model.Contract contract) {
+ /**
+ * This method generates a WSDL definition from a Scribble contract model.
+ *
+ * @param contract The contract model
+ * @return The WSDL definition
+ */
+ public javax.wsdl.Definition generateDefinition(org.scribble.contract.model.Contract contract) {
javax.wsdl.Definition ret=null;
try {
@@ -40,10 +49,143 @@
ret = fact.newDefinition();
+ // Set details on the definition
+ if (contract.getName() != null) {
+ ret.setQName(new javax.xml.namespace.QName(contract.getName()));
+ }
+ ret.setTargetNamespace(contract.getNamespace());
+
+ // Define a port type per interface
+ for (int i=0; i < contract.getInterfaces().size(); i++) {
+ javax.wsdl.PortType ptype=generatePortType(ret, contract.getInterfaces().get(i));
+
+ if (ptype != null) {
+ ret.addPortType(ptype);
+ }
+ }
+
} catch(Exception e) {
logger.error("Failed to generate WSDL", e);
}
return(ret);
}
+
+ /**
+ * This method generates a port type, using the supplied WSDL definition,
+ * based on the information in the supplied interface definition. Note that
+ * the port type is not automatically added to the definition.
+ *
+ * @param defn The WSDL definition used to create the port type
+ * @param intf The interface model
+ * @return The WSDL port type
+ */
+ public javax.wsdl.PortType generatePortType(javax.wsdl.Definition defn,
+ org.scribble.contract.model.Interface intf) {
+ javax.wsdl.PortType ret=null;
+
+ if (defn != null && intf != null) {
+ ret = defn.createPortType();
+
+ if (intf.getName() != null) {
+ ret.setQName(new javax.xml.namespace.QName(intf.getNamespace(), intf.getName()));
+ }
+
+ for (int i=0; i < intf.getMessageExchangePatterns().size(); i++) {
+ javax.wsdl.Operation op=generateOperation(defn,
+ intf.getMessageExchangePatterns().get(i));
+ if (op != null) {
+ ret.addOperation(op);
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method generates an operation, using the supplied WSDL definition,
+ * based on the information in the supplied message exchange pattern.
+ *
+ * @param defn The WSDL definition
+ * @param mep The message exchange pattern
+ * @return The WSDL operation
+ */
+ public javax.wsdl.Operation generateOperation(javax.wsdl.Definition defn,
+ org.scribble.contract.model.MessageExchangePattern mep) {
+ javax.wsdl.Operation ret=null;
+
+ if (defn != null && mep != null) {
+ ret = defn.createOperation();
+
+ ret.setName(mep.getOperation());
+
+ javax.wsdl.Message mesg=generateMessage(defn, mep.getTypes());
+
+ if (mesg != null) {
+ javax.wsdl.Input input=defn.createInput();
+ input.setMessage(mesg);
+ ret.setInput(input);
+ }
+
+ // Check if a request/response MEP
+ if (mep instanceof RequestResponseMEP) {
+ RequestResponseMEP rr=(RequestResponseMEP)mep;
+
+ javax.wsdl.Message om=generateMessage(defn, rr.getResponseTypes());
+ if (om != null) {
+ javax.wsdl.Output output=defn.createOutput();
+ output.setMessage(om);
+ ret.setOutput(output);
+ }
+
+ // Generate fault details
+ if (rr.getFaultDetails() != null) {
+ for (int i=0; i < rr.getFaultDetails().size(); i++) {
+ FaultDetails fd=rr.getFaultDetails().get(i);
+
+ javax.wsdl.Message fm=generateMessage(defn, fd.getTypes());
+ if (fm != null) {
+ javax.wsdl.Fault fault=defn.createFault();
+ fault.setName(fd.getName());
+ fault.setMessage(fm);
+
+ ret.addFault(fault);
+ }
+ }
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method generates a message, using the supplied WSDL definition,
+ * based on the information supplied in the list of type references. If
+ * a single type reference is supplied, this will be the message type,
+ * if multiple type references are supplied, then these will be considered
+ * the message parts.
+ *
+ * @param defn The WSDL definition
+ * @param types The list of type references
+ * @return The WSDL message
+ */
+ public javax.wsdl.Message generateMessage(javax.wsdl.Definition defn,
+ java.util.List<TypeReference> types) {
+ javax.wsdl.Message ret=null;
+
+ if (defn != null && types != null && types.size() > 0) {
+ ret = defn.createMessage();
+
+ if (types.size() == 1) {
+ TypeReference ref=types.get(0);
+ ret.setQName(new javax.xml.namespace.QName(ref.getNamespace(),ref.getLocalpart()));
+ } else {
+ throw new UnsupportedOperationException("Currently only supports single type reference");
+ }
+ }
+
+ return(ret);
+ }
}
16 years, 7 months
savara SVN: r34 - in trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl: .settings and 9 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2009-10-02 17:25:19 -0400 (Fri, 02 Oct 2009)
New Revision: 34
Added:
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.classpath
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.project
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.settings/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.settings/org.eclipse.jdt.core.prefs
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.settings/org.eclipse.pde.core.prefs
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/Copyright.txt
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/META-INF/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/META-INF/MANIFEST.MF
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/build.properties
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/osgi/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/osgi/Activator.java
Log:
Initial skeleton for WSDL Generator.
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.classpath
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.classpath (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.classpath 2009-10-02 21:25:19 UTC (rev 34)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/java"/>
+ <classpathentry kind="output" path="classes"/>
+</classpath>
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.project
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.project (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.project 2009-10-02 21:25:19 UTC (rev 34)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.savara.tools.wsdl</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.settings/org.eclipse.jdt.core.prefs 2009-10-02 21:25:19 UTC (rev 34)
@@ -0,0 +1,8 @@
+#Fri Oct 02 20:31:25 BST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.settings/org.eclipse.pde.core.prefs
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.settings/org.eclipse.pde.core.prefs (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/.settings/org.eclipse.pde.core.prefs 2009-10-02 21:25:19 UTC (rev 34)
@@ -0,0 +1,5 @@
+#Fri Oct 02 20:31:25 BST 2009
+eclipse.preferences.version=1
+pluginProject.equinox=false
+pluginProject.extensions=false
+resolve.requirebundle=false
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/Copyright.txt
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/Copyright.txt (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/Copyright.txt 2009-10-02 21:25:19 UTC (rev 34)
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/META-INF/MANIFEST.MF (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/META-INF/MANIFEST.MF 2009-10-02 21:25:19 UTC (rev 34)
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: JBoss SAVARA Tools WSDL Plug-in
+Bundle-SymbolicName: org.jboss.savara.tools.wsdl
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.savara.tools.wsdl.osgi.Activator
+Import-Package: org.osgi.framework;version="1.3.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: www.jboss.org
+Require-Bundle: javax.wsdl;bundle-version="1.5.1",
+ org.scribble.contract.model;bundle-version="0.1.0",
+ org.apache.commons.logging;bundle-version="1.0.4"
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/build.properties
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/build.properties (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/build.properties 2009-10-02 21:25:19 UTC (rev 34)
@@ -0,0 +1,4 @@
+source.. = src/java/
+output.. = classes/
+bin.includes = META-INF/,\
+ .
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/WSDLGenerator.java 2009-10-02 21:25:19 UTC (rev 34)
@@ -0,0 +1,49 @@
+/*
+ * 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.jboss.savara.tools.wsdl;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This class generates a WSDL definition from a Contract model.
+ *
+ */
+public class WSDLGenerator {
+
+ private static Log logger = LogFactory.getLog(WSDLGenerator.class);
+
+ public WSDLGenerator() {
+ }
+
+ public javax.wsdl.Definition generate(org.scribble.contract.model.Contract contract) {
+ javax.wsdl.Definition ret=null;
+
+ try {
+ javax.wsdl.factory.WSDLFactory fact=
+ javax.wsdl.factory.WSDLFactory.newInstance();
+
+ ret = fact.newDefinition();
+
+ } catch(Exception e) {
+ logger.error("Failed to generate WSDL", e);
+ }
+
+ return(ret);
+ }
+}
Added: trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/osgi/Activator.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/osgi/Activator.java (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/osgi/Activator.java 2009-10-02 21:25:19 UTC (rev 34)
@@ -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.jboss.savara.tools.wsdl.osgi;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ }
+
+}
16 years, 7 months
savara SVN: r33 - trunk/tools/eclipse/plugins.
by do-not-reply@jboss.org
Author: objectiser
Date: 2009-10-02 17:23:24 -0400 (Fri, 02 Oct 2009)
New Revision: 33
Added:
trunk/tools/eclipse/plugins/org.jboss.savara.tools.wsdl/
Log:
Initial skeleton project for the WSDL generator.
16 years, 7 months
savara SVN: r32 - in trunk/tools/eclipse/plugins: org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel and 11 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2009-10-02 15:43:10 -0400 (Fri, 02 Oct 2009)
New Revision: 32
Added:
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/osgi/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/osgi/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/osgi/Activator.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/osgi/JBossESBValidatorAnnotations.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/osgi/
Removed:
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/eclipse/
trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/eclipse/Activator.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/eclipse/JBossESBValidatorAnnotations.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/eclipse/
Modified:
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/dialogs/GenerateDialog.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/osgi/Activator.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/META-INF/MANIFEST.MF
trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/plugin.xml
trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/META-INF/MANIFEST.MF
trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/dialogs/GenerateDialog.java
trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/osgi/Activator.java
Log:
Refactored plugin package in line with scribble plugins.
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF 2009-09-23 17:15:11 UTC (rev 31)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/META-INF/MANIFEST.MF 2009-10-02 19:43:10 UTC (rev 32)
@@ -3,7 +3,7 @@
Bundle-Name: JBoss SAVARA Tools BPEL Plug-in
Bundle-SymbolicName: org.jboss.savara.tools.bpel;singleton:=true
Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.jboss.savara.tools.bpel.eclipse.Activator
+Bundle-Activator: org.jboss.savara.tools.bpel.osgi.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.scribble.conversation.model,
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/dialogs/GenerateDialog.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/dialogs/GenerateDialog.java 2009-09-23 17:15:11 UTC (rev 31)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/dialogs/GenerateDialog.java 2009-10-02 19:43:10 UTC (rev 32)
@@ -358,7 +358,7 @@
*/
public void error(String mesg, Exception ex) {
- org.jboss.savara.tools.bpel.eclipse.Activator.logError(mesg, ex);
+ org.jboss.savara.tools.bpel.osgi.Activator.logError(mesg, ex);
MessageBox mbox=new MessageBox(getShell(),
SWT.ICON_ERROR|SWT.OK);
Copied: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/osgi (from rev 17, trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/eclipse)
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/osgi/Activator.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/eclipse/Activator.java 2009-09-07 12:32:04 UTC (rev 17)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/osgi/Activator.java 2009-10-02 19:43:10 UTC (rev 32)
@@ -1,4 +1,4 @@
-package org.jboss.savara.tools.bpel.eclipse;
+package org.jboss.savara.tools.bpel.osgi;
import org.apache.commons.logging.*;
import org.eclipse.core.runtime.IStatus;
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/META-INF/MANIFEST.MF 2009-09-23 17:15:11 UTC (rev 31)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/META-INF/MANIFEST.MF 2009-10-02 19:43:10 UTC (rev 32)
@@ -4,7 +4,7 @@
Bundle-SymbolicName: org.jboss.savara.tools.jbossesb;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: .
-Bundle-Activator: org.jboss.savara.tools.jbossesb.eclipse.Activator
+Bundle-Activator: org.jboss.savara.tools.jbossesb.osgi.Activator
Bundle-Vendor: www.jboss.org
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/dialogs/GenerateDialog.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/dialogs/GenerateDialog.java 2009-09-23 17:15:11 UTC (rev 31)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/dialogs/GenerateDialog.java 2009-10-02 19:43:10 UTC (rev 32)
@@ -382,7 +382,7 @@
*/
public void error(String mesg, Exception ex) {
- org.jboss.savara.tools.jbossesb.eclipse.Activator.logError(mesg, ex);
+ org.jboss.savara.tools.jbossesb.osgi.Activator.logError(mesg, ex);
MessageBox mbox=new MessageBox(getShell(),
SWT.ICON_ERROR|SWT.OK);
Copied: trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/osgi (from rev 17, trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/eclipse)
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/osgi/Activator.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/eclipse/Activator.java 2009-09-07 12:32:04 UTC (rev 17)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb/src/java/org/jboss/savara/tools/jbossesb/osgi/Activator.java 2009-10-02 19:43:10 UTC (rev 32)
@@ -15,7 +15,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
-package org.jboss.savara.tools.jbossesb.eclipse;
+package org.jboss.savara.tools.jbossesb.osgi;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/META-INF/MANIFEST.MF 2009-09-23 17:15:11 UTC (rev 31)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/META-INF/MANIFEST.MF 2009-10-02 19:43:10 UTC (rev 32)
@@ -3,7 +3,7 @@
Bundle-Name: JBoss SAVARA Tools JBossESB CDL Plug-in
Bundle-SymbolicName: org.jboss.savara.tools.jbossesb.cdl;singleton:=true
Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.jboss.savara.tools.jbossesb.cdl.eclipse.Activator
+Bundle-Activator: org.jboss.savara.tools.jbossesb.cdl.osgi.Activator
Bundle-Vendor: www.jboss.org
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
Modified: trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/plugin.xml
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/plugin.xml 2009-09-23 17:15:11 UTC (rev 31)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/plugin.xml 2009-10-02 19:43:10 UTC (rev 32)
@@ -4,7 +4,7 @@
<extension
point="org.pi4soa.common.annotationsManager">
<annotationsManager
- class="org.jboss.savara.tools.jbossesb.cdl.eclipse.JBossESBValidatorAnnotations">
+ class="org.jboss.savara.tools.jbossesb.cdl.osgi.JBossESBValidatorAnnotations">
</annotationsManager>
</extension>
Deleted: trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/eclipse/Activator.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/eclipse/Activator.java 2009-09-23 17:15:11 UTC (rev 31)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/eclipse/Activator.java 2009-10-02 19:43:10 UTC (rev 32)
@@ -1,74 +0,0 @@
-package org.jboss.savara.tools.jbossesb.cdl.eclipse;
-
-import java.util.logging.Logger;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.savara.tools.jbossesb.cdl";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- /**
- * This method logs an error against the plugin.
- *
- * @param mesg The error message
- * @param t The optional exception
- */
- public static void logError(String mesg, Throwable t) {
-
- if (getDefault() != null) {
- Status status=new Status(IStatus.ERROR,
- PLUGIN_ID, 0, mesg, t);
-
- getDefault().getLog().log(status);
- }
-
- logger.severe("LOG ERROR: "+mesg+
- (t == null ? "" : ": "+t));
- }
-
- private static Logger logger = Logger.getLogger("org.jboss.savara.tools.jbossesb.cdl.eclipse");
-}
Deleted: trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/eclipse/JBossESBValidatorAnnotations.java
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/eclipse/JBossESBValidatorAnnotations.java 2009-09-23 17:15:11 UTC (rev 31)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/eclipse/JBossESBValidatorAnnotations.java 2009-10-02 19:43:10 UTC (rev 32)
@@ -1,72 +0,0 @@
-/*
- * Copyright 2005-8 Pi4 Technologies Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Change History:
- * 21 Oct 2008 : Initial version created by gary
- */
-package org.jboss.savara.tools.jbossesb.cdl.eclipse;
-
-import java.net.URL;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.pi4soa.common.annotations.eclipse.EclipseAnnotationsManager;
-
-/**
- * This class implements the AnnotationsManager extension point.
- */
-public class JBossESBValidatorAnnotations extends EclipseAnnotationsManager {
-
- public JBossESBValidatorAnnotations() {
- super(Activator.PLUGIN_ID);
- }
-
- /**
- * This method returns an input stream associated with the
- * supplied URL. The URL can also reference a local relative
- * file path.
- *
- * @param url The URL, or relative file path
- * @return The input stream
- */
- protected java.io.InputStream getInputStream(String url) {
- java.io.InputStream ret=null;
-
- try {
- String path=ANNOTATIONS_FOLDER +
- "/" + url;
-
- logger.fine("Load from path: "+path);
-
- ret = JBossESBValidatorAnnotations.class.getResourceAsStream(path);
-
- } catch(Exception e) {
- logger.severe("Failed to get input stream for URL '"+
- url+"': "+e);
- }
-
- if (logger.isLoggable(Level.FINEST)) {
- logger.finest("Ret="+ret);
- }
-
- return(ret);
- }
-
- private static Logger logger = Logger.getLogger("org.jboss.savara.tools.jbossesb.cdl.eclipse");
-
- private static final String ANNOTATIONS_FOLDER="annotations";
- private static final String PATH_SEPARATOR = "/";
-}
Copied: trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/osgi/Activator.java (from rev 17, trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/eclipse/Activator.java)
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/osgi/Activator.java (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/osgi/Activator.java 2009-10-02 19:43:10 UTC (rev 32)
@@ -0,0 +1,74 @@
+package org.jboss.savara.tools.jbossesb.cdl.osgi;
+
+import java.util.logging.Logger;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.savara.tools.jbossesb.cdl";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * This method logs an error against the plugin.
+ *
+ * @param mesg The error message
+ * @param t The optional exception
+ */
+ public static void logError(String mesg, Throwable t) {
+
+ if (getDefault() != null) {
+ Status status=new Status(IStatus.ERROR,
+ PLUGIN_ID, 0, mesg, t);
+
+ getDefault().getLog().log(status);
+ }
+
+ logger.severe("LOG ERROR: "+mesg+
+ (t == null ? "" : ": "+t));
+ }
+
+ private static Logger logger = Logger.getLogger("org.jboss.savara.tools.jbossesb.cdl.eclipse");
+}
Copied: trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/osgi/JBossESBValidatorAnnotations.java (from rev 17, trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/eclipse/JBossESBValidatorAnnotations.java)
===================================================================
--- trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/osgi/JBossESBValidatorAnnotations.java (rev 0)
+++ trunk/tools/eclipse/plugins/org.jboss.savara.tools.jbossesb.cdl/src/java/org/jboss/savara/tools/jbossesb/cdl/osgi/JBossESBValidatorAnnotations.java 2009-10-02 19:43:10 UTC (rev 32)
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 21 Oct 2008 : Initial version created by gary
+ */
+package org.jboss.savara.tools.jbossesb.cdl.osgi;
+
+import java.net.URL;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.pi4soa.common.annotations.eclipse.EclipseAnnotationsManager;
+
+/**
+ * This class implements the AnnotationsManager extension point.
+ */
+public class JBossESBValidatorAnnotations extends EclipseAnnotationsManager {
+
+ public JBossESBValidatorAnnotations() {
+ super(Activator.PLUGIN_ID);
+ }
+
+ /**
+ * This method returns an input stream associated with the
+ * supplied URL. The URL can also reference a local relative
+ * file path.
+ *
+ * @param url The URL, or relative file path
+ * @return The input stream
+ */
+ protected java.io.InputStream getInputStream(String url) {
+ java.io.InputStream ret=null;
+
+ try {
+ String path=ANNOTATIONS_FOLDER +
+ "/" + url;
+
+ logger.fine("Load from path: "+path);
+
+ ret = JBossESBValidatorAnnotations.class.getResourceAsStream(path);
+
+ } catch(Exception e) {
+ logger.severe("Failed to get input stream for URL '"+
+ url+"': "+e);
+ }
+
+ if (logger.isLoggable(Level.FINEST)) {
+ logger.finest("Ret="+ret);
+ }
+
+ return(ret);
+ }
+
+ private static Logger logger = Logger.getLogger("org.jboss.savara.tools.jbossesb.cdl.osgi");
+
+ private static final String ANNOTATIONS_FOLDER="annotations";
+ private static final String PATH_SEPARATOR = "/";
+}
16 years, 7 months