Overlord SVN: r457 - in cdl/trunk/docs/cdl: user and 1 other directory.
by overlord-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2008-12-22 02:01:18 -0500 (Mon, 22 Dec 2008)
New Revision: 457
Added:
cdl/trunk/docs/cdl/user/
cdl/trunk/docs/cdl/user/TBGuide.odt
cdl/trunk/docs/cdl/user/TBGuide.pdf
Log:
* Add Trailblazer document, as JBossESB remove it in trunk.
Added: cdl/trunk/docs/cdl/user/TBGuide.odt
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/docs/cdl/user/TBGuide.odt
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: cdl/trunk/docs/cdl/user/TBGuide.pdf
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/docs/cdl/user/TBGuide.pdf
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 7 months
Overlord SVN: r456 - in cdl/trunk/tools/plugins: org.jboss.tools.overlord.cdl.bpel/META-INF and 5 other directories.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2008-12-18 12:22:31 -0500 (Thu, 18 Dec 2008)
New Revision: 456
Added:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.settings/org.eclipse.jdt.ui.prefs
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/BPELActivity.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/BPELActivityFactory.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/ConversionContext.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/AbstractBPELActivity.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/InvokeActivity.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/ReceiveActivity.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/ReplyActivity.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/UnsupportedActivity.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/change/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/change/AbstractBPELModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/change/ConversationInteractionModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/change/LanguageToConversationModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/util/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/util/InteractionUtil.java
Modified:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/META-INF/MANIFEST.MF
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ConversionContext.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultConversionContext.java
Log:
Added some other aspects.
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.settings/org.eclipse.jdt.ui.prefs (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.settings/org.eclipse.jdt.ui.prefs 2008-12-18 17:22:31 UTC (rev 456)
@@ -0,0 +1,4 @@
+#Thu Dec 18 11:03:58 GMT 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_cont!
ext" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment!
_context" deleted\="false" description\="Comment for overriding method
s" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*\r\n * JBoss, Home of Professional Open Source\r\n * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated\r\n * by the @authors tag. All rights reserved.\r\n * See the copyright.txt in the distribution for a\r\n * full listing of individual contributors.\r\n * This copyrighted material is made available to anyone wishing !
to use,\r\n * modify, copy, or redistribute it subject to the terms and conditions\r\n * of the GNU Lesser General Public License, v. 2.1.\r\n * This program is distributed in the hope that it will be useful, but WITHOUT A\r\n * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\r\n * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\r\n * You should have received a copy of the GNU Lesser General Public License,\r\n * v.2.1 along with this distribution; if not, write to the Free Software\r\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\r\n * MA 02110-1301, USA.\r\n */\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" con!
text\="interfacebody_context" deleted\="false" description\="Code in n
ew interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in!
created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" cont!
ext\="gettercomment_context" deleted\="false" description\="Comment fo
r getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \!
r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplat!
es.overridecomment" name\="overridecomment">/* (non-Jsdoc)\r\n * ${see
_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.ecli!
pse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><!
template autoinsert\="true" context\="setterbody_context" deleted\="fa
lse" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/META-INF/MANIFEST.MF
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/META-INF/MANIFEST.MF 2008-12-18 09:21:17 UTC (rev 455)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/META-INF/MANIFEST.MF 2008-12-18 17:22:31 UTC (rev 456)
@@ -16,4 +16,6 @@
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: www.jboss.org
Scribble-Extensions: org.jboss.tools.overlord.cdl.bpel.parser.BPELParser,
- org.jboss.tools.overlord.cdl.bpel.parser.BPELNotation
+ org.jboss.tools.overlord.cdl.bpel.parser.BPELNotation,
+ org.jboss.tools.overlord.cdl.bpel.model.change.LanguageToConversationModelChangeRule,
+ org.jboss.tools.overlord.cdl.bpel.model.change.ConversationInteractionModelChangeRule
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/BPELActivity.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/BPELActivity.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/BPELActivity.java 2008-12-18 17:22:31 UTC (rev 456)
@@ -0,0 +1,22 @@
+/*
+ * 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.tools.overlord.cdl.bpel.model;
+
+public interface BPELActivity {
+
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/BPELActivityFactory.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/BPELActivityFactory.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/BPELActivityFactory.java 2008-12-18 17:22:31 UTC (rev 456)
@@ -0,0 +1,69 @@
+/*
+ * 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.tools.overlord.cdl.bpel.model;
+
+import java.util.logging.Logger;
+
+import org.jboss.tools.overlord.cdl.bpel.model.activities.UnsupportedActivity;
+
+public class BPELActivityFactory {
+
+ public static final String MODEL_ACTIVITIES_PACKAGE =
+ "org.jboss.tools.overlord.cdl.bpel.model.activities";
+
+ /**
+ * This method creates a BPELActivity instance relevant to the
+ * supplied JBossESB action, associated with the supplied
+ * service.
+ *
+ * @param model The BPEL model
+ * @param activity The XML configuration of the BPEL activity
+ * @return The BPEL activity instance
+ */
+ public static BPELActivity createActivity(BPELLanguageModel model,
+ org.w3c.dom.Element activity) {
+ BPELActivity ret=null;
+ String activityType=activity.getNodeName();
+
+ String clsName=MODEL_ACTIVITIES_PACKAGE+"."+activityType;
+
+ try {
+ Class<?> cls=(Class<?>)
+ Class.forName(clsName);
+
+ java.lang.reflect.Constructor<?> con=
+ cls.getConstructor(new Class<?>[]{BPELLanguageModel.class,
+ org.w3c.dom.Element.class});
+
+ ret = (BPELActivity)con.newInstance(new Object[]{model, activity});
+
+ } catch(Exception e) {
+ logger.log(java.util.logging.Level.SEVERE,
+ "Unable to find action class '"+clsName+"'", e);
+ }
+
+ if (ret == null) {
+ // Unrecognised or unsupported activity
+ ret = new UnsupportedActivity(model, activity);
+ }
+
+ return(ret);
+ }
+
+ private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.bpel.model");
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/ConversionContext.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/ConversionContext.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/ConversionContext.java 2008-12-18 17:22:31 UTC (rev 456)
@@ -0,0 +1,30 @@
+/*
+ * 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.tools.overlord.cdl.bpel.model;
+
+public interface ConversionContext {
+
+ /**
+ * This method returns the role associated with the
+ * endpoint being converted.
+ *
+ *@return The role
+ */
+ public String getRole();
+
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/AbstractBPELActivity.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/AbstractBPELActivity.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/AbstractBPELActivity.java 2008-12-18 17:22:31 UTC (rev 456)
@@ -0,0 +1,121 @@
+/*
+ * 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.tools.overlord.cdl.bpel.model.activities;
+
+import java.util.logging.Logger;
+
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+import org.jboss.tools.overlord.cdl.bpel.model.*;
+
+/**
+ * This is the generic BPEL activity class.
+ *
+ * @author gary
+ */
+public abstract class AbstractBPELActivity extends ModelObject
+ implements BPELActivity {
+
+ /**
+ * The constructor for initializing the activity based on
+ * an existing DOM element.
+ */
+ protected AbstractBPELActivity(BPELLanguageModel model,
+ org.w3c.dom.Element activity) {
+ m_model = model;
+
+ initExistingActivity(model, activity);
+ }
+
+ /**
+ * The contructor for initializing a new activity.
+ */
+ protected AbstractBPELActivity(BPELLanguageModel model,
+ String activityName) {
+ m_model = model;
+
+ initNewAction(model, activityName);
+ }
+
+ /**
+ * This method initializes the activity.
+ *
+ * @param model The BPEL model
+ * @param activity The activity name
+ */
+ protected void initNewAction(BPELLanguageModel model,
+ String activity) {
+ m_activity = model.getBPELProcess().
+ getOwnerDocument().createElement(activity);
+
+ getSource().setObject(this);
+ }
+
+ /**
+ * This method initializes the activity.
+ *
+ * @param model The BPEL model
+ * @param activity The XML configuration details for the activity
+ */
+ protected void initExistingActivity(BPELLanguageModel model,
+ org.w3c.dom.Element activity) {
+ m_activity = activity;
+
+ // TODO: Set the start/end position information
+ // in the source details
+
+ getSource().setObject(this);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ public void validate(ModelListener l) {
+ }
+
+
+ /**
+ * This method returns the XML configuration representation
+ * of the activity.
+ *
+ * @return The XML configuration for the activity
+ */
+ public org.w3c.dom.Element getActivity() {
+ return(m_activity);
+ }
+
+ /**
+ * This method converts the BPEL activity into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ public abstract void convert(java.util.List<Activity> activities,
+ ConversionContext context);
+
+ private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.bpel.model");
+
+ private BPELLanguageModel m_model=null;
+ private org.w3c.dom.Element m_activity=null;
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/InvokeActivity.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/InvokeActivity.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/InvokeActivity.java 2008-12-18 17:22:31 UTC (rev 456)
@@ -0,0 +1,65 @@
+/*
+ * 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.tools.overlord.cdl.bpel.model.activities;
+
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelListener;
+import org.jboss.tools.overlord.cdl.bpel.model.*;
+/**
+ * This class represents an unsupported (or custom) action within
+ * the conversation based ESB service descriptor.
+ *
+ * @author gary
+ */
+public class InvokeActivity extends AbstractBPELActivity {
+
+ /**
+ * The constructor for the activity.
+ *
+ * @param model The BPEL model
+ * @param activity The XML configuration details for the activity
+ */
+ public InvokeActivity(BPELLanguageModel model,
+ org.w3c.dom.Element activity) {
+ super(model, activity);
+ }
+
+ /**
+ * This method validates the BPEL activity and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ // Don't validate unsupported actions
+ }
+
+ /**
+ * This method converts the BPEL activity into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+ }
+
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/ReceiveActivity.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/ReceiveActivity.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/ReceiveActivity.java 2008-12-18 17:22:31 UTC (rev 456)
@@ -0,0 +1,65 @@
+/*
+ * 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.tools.overlord.cdl.bpel.model.activities;
+
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelListener;
+import org.jboss.tools.overlord.cdl.bpel.model.*;
+/**
+ * This class represents an unsupported (or custom) action within
+ * the conversation based ESB service descriptor.
+ *
+ * @author gary
+ */
+public class ReceiveActivity extends AbstractBPELActivity {
+
+ /**
+ * The constructor for the activity.
+ *
+ * @param model The BPEL model
+ * @param activity The XML configuration details for the activity
+ */
+ public ReceiveActivity(BPELLanguageModel model,
+ org.w3c.dom.Element activity) {
+ super(model, activity);
+ }
+
+ /**
+ * This method validates the BPEL activity and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ // Don't validate unsupported actions
+ }
+
+ /**
+ * This method converts the BPEL activity into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+ }
+
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/ReplyActivity.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/ReplyActivity.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/ReplyActivity.java 2008-12-18 17:22:31 UTC (rev 456)
@@ -0,0 +1,65 @@
+/*
+ * 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.tools.overlord.cdl.bpel.model.activities;
+
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelListener;
+import org.jboss.tools.overlord.cdl.bpel.model.*;
+/**
+ * This class represents an unsupported (or custom) action within
+ * the conversation based ESB service descriptor.
+ *
+ * @author gary
+ */
+public class ReplyActivity extends AbstractBPELActivity {
+
+ /**
+ * The constructor for the activity.
+ *
+ * @param model The BPEL model
+ * @param activity The XML configuration details for the activity
+ */
+ public ReplyActivity(BPELLanguageModel model,
+ org.w3c.dom.Element activity) {
+ super(model, activity);
+ }
+
+ /**
+ * This method validates the BPEL activity and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ // Don't validate unsupported actions
+ }
+
+ /**
+ * This method converts the BPEL activity into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+ }
+
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/UnsupportedActivity.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/UnsupportedActivity.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/activities/UnsupportedActivity.java 2008-12-18 17:22:31 UTC (rev 456)
@@ -0,0 +1,65 @@
+/*
+ * 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.tools.overlord.cdl.bpel.model.activities;
+
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelListener;
+import org.jboss.tools.overlord.cdl.bpel.model.*;
+/**
+ * This class represents an unsupported (or custom) action within
+ * the conversation based ESB service descriptor.
+ *
+ * @author gary
+ */
+public class UnsupportedActivity extends AbstractBPELActivity {
+
+ /**
+ * The constructor for the activity.
+ *
+ * @param model The BPEL model
+ * @param activity The XML configuration details for the activity
+ */
+ public UnsupportedActivity(BPELLanguageModel model,
+ org.w3c.dom.Element activity) {
+ super(model, activity);
+ }
+
+ /**
+ * This method validates the BPEL activity and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ // Don't validate unsupported actions
+ }
+
+ /**
+ * This method converts the BPEL activity into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+ }
+
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/change/AbstractBPELModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/change/AbstractBPELModelChangeRule.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/change/AbstractBPELModelChangeRule.java 2008-12-18 17:22:31 UTC (rev 456)
@@ -0,0 +1,83 @@
+/*
+ * 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.tools.overlord.cdl.bpel.model.change;
+
+import org.scribble.model.*;
+import org.scribble.model.change.*;
+
+/**
+ * This is the abstract ESB model change rule.
+ */
+public abstract class AbstractBPELModelChangeRule extends AbstractModelChangeRule {
+
+ /**
+ * This method determines whether the rule is appropriate
+ * for the supplied type of model, parent (in the context) and inserted
+ * model object.
+ *
+ * @param context The context
+ * @param model The model
+ * @param mobj The model object being inserted
+ * @param ref The optional reference model object
+ * @return Whether the rule supports the supplied information
+ */
+ @Override
+ public boolean isInsertSupported(ModelChangeContext context,
+ Model model, ModelObject mobj, ModelObject ref) {
+ boolean ret=false;
+
+ return(ret);
+ }
+
+ /**
+ * This method determines whether the rule is appropriate
+ * for the supplied type of model, parent (in the context)
+ * and deleted model object.
+ *
+ * @param context The context
+ * @param model The model
+ * @param mobj The model object to be removed
+ * @return Whether the rule supports the supplied information
+ */
+ @Override
+ public boolean isDeleteSupported(ModelChangeContext context,
+ Model model, ModelObject mobj) {
+ boolean ret=false;
+
+ return(ret);
+ }
+
+ /**
+ * This method removes the supplied model object from the
+ * supplied model. The model object representation must
+ * contain the necessary model specific to remove the
+ * object from the underlying model representation.
+ *
+ * @param context The context
+ * @param model The model being changed
+ * @param mobj The model object to be deleted
+ * @return Whether the change has been applied
+ */
+ @Override
+ public boolean delete(ModelChangeContext context,
+ Model model, ModelObject mobj) {
+ boolean ret=false;
+
+ return(ret);
+ }
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/change/ConversationInteractionModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/change/ConversationInteractionModelChangeRule.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/change/ConversationInteractionModelChangeRule.java 2008-12-18 17:22:31 UTC (rev 456)
@@ -0,0 +1,185 @@
+/*
+ * 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.tools.overlord.cdl.bpel.model.change;
+
+import org.jboss.tools.overlord.cdl.bpel.model.*;
+import org.jboss.tools.overlord.cdl.bpel.model.util.*;
+import org.jboss.tools.overlord.cdl.bpel.model.activities.*;
+import org.scribble.model.*;
+import org.scribble.model.change.*;
+import org.scribble.conversation.model.*;
+import org.scribble.extensions.RegistryInfo;
+
+/**
+ * This is the model change rule for the Conversation Interaction.
+ */
+(a)RegistryInfo(extension=ModelChangeRule.class,notation=BPELLanguageModel.BPEL_NOTATION)
+public class ConversationInteractionModelChangeRule extends AbstractBPELModelChangeRule {
+
+ /**
+ * This method determines whether the rule is appropriate
+ * for the supplied type of model, parent (in the context) and inserted
+ * model object.
+ *
+ * @param context The context
+ * @param model The model
+ * @param mobj The model object being inserted
+ * @param ref The optional reference model object
+ * @return Whether the rule supports the supplied information
+ */
+ @Override
+ public boolean isInsertSupported(ModelChangeContext context,
+ Model model, ModelObject mobj,
+ ModelObject ref) {
+ boolean ret=false;
+
+ if (mobj instanceof ConversationInteraction &&
+ super.isInsertSupported(context, model, mobj, ref)) {
+ ret = true;
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method adds a new model object, within a
+ * parent model object, with the details supplied in
+ * another model object. The supplied model object
+ * will usually be from a different model representation
+ * (e.g. due to a merge), so the details will be
+ * copied and placed in the representation associated
+ * with the supplied model and parent model object.<p>
+ * <p>
+ * If a reference model object is supplied, then the
+ * insertion will occur relative to it. If the reference
+ * object is a block, then it means that the insertion
+ * should occur at the end of the block. Otherwise the
+ * new model object should be inserted before the
+ * reference object, within the containing block.<p>
+ * <p>
+ * If the reference object is not supplied, then the
+ * new model object should be inserted at the end of
+ * the behaviour associated with the parent in the model
+ * change context.
+ *
+ * @param context The context
+ * @param model The model being changed
+ * @param mobj The model object details to be inserted
+ * @param ref The optional reference model object
+ * @return Whether the change has been applied
+ */
+ @Override
+ public boolean insert(ModelChangeContext context,
+ Model model, ModelObject mobj, ModelObject ref) {
+ BPELLanguageModel bpelModel=(BPELLanguageModel)model;
+ ConversationInteraction interaction=(ConversationInteraction)mobj;
+
+ // Check if send or receive
+ if (InteractionUtil.isSend(interaction)) {
+
+ // Send
+ insertSend(context, bpelModel, interaction, ref);
+
+ } else {
+ // Receive
+ insertReceive(context, bpelModel, interaction, ref);
+ }
+
+ return(true);
+ }
+
+ protected void insertSend(ModelChangeContext context,
+ BPELLanguageModel bpelModel, ConversationInteraction interaction,
+ ModelObject ref) {
+ }
+
+ protected void insertReceive(ModelChangeContext context,
+ BPELLanguageModel bpelModel, ConversationInteraction interaction,
+ ModelObject ref) {
+ }
+
+ /**
+ * This method determines whether the rule is appropriate
+ * for the supplied type of model, parent (in the context)
+ * and modified model object.
+ *
+ * @param context The context
+ * @param model The model
+ * @param fromObj The source model object
+ * @param toObj The model object to be updated
+ * @return Whether the rule supports the supplied information
+ */
+ @Override
+ public boolean isUpdateSupported(ModelChangeContext context,
+ Model model, ModelObject fromObj, ModelObject toObj) {
+ boolean ret=false;
+
+ if (fromObj instanceof ConversationInteraction &&
+ toObj instanceof ConversationInteraction &&
+ model instanceof BPELLanguageModel) {
+ ret = true;
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method modifies an existing model object, within a
+ * parent model object, with the details supplied in
+ * another model object.
+ *
+ * @param context The context
+ * @param model The model being changed
+ * @param fromObj The source model object
+ * @param toObj The model object to be updated
+ * @return Whether the change has been applied
+ */
+ @Override
+ public boolean update(ModelChangeContext context,
+ Model model, ModelObject fromObj, ModelObject toObj) {
+ boolean ret=false;
+ BPELLanguageModel bpelModel=(BPELLanguageModel)model;
+ ConversationInteraction fromInteraction=(ConversationInteraction)fromObj;
+ ConversationInteraction toInteraction=(ConversationInteraction)toObj;
+
+ return(ret);
+ }
+
+ /**
+ * This method determines whether the rule is appropriate
+ * for the supplied type of model, parent (in the context)
+ * and deleted model object.
+ *
+ * @param context The context
+ * @param model The model
+ * @param mobj The model object to be removed
+ * @return Whether the rule supports the supplied information
+ */
+ @Override
+ public boolean isDeleteSupported(ModelChangeContext context,
+ Model model, ModelObject mobj) {
+ boolean ret=false;
+
+ if (mobj instanceof ConversationInteraction &&
+ super.isDeleteSupported(context, model, mobj)) {
+ ret = true;
+ }
+
+ return(ret);
+ }
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/change/LanguageToConversationModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/change/LanguageToConversationModelChangeRule.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/change/LanguageToConversationModelChangeRule.java 2008-12-18 17:22:31 UTC (rev 456)
@@ -0,0 +1,96 @@
+/*
+ * 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.tools.overlord.cdl.bpel.model.change;
+
+import org.jboss.tools.overlord.cdl.bpel.model.*;
+import org.scribble.model.*;
+import org.scribble.model.change.*;
+import org.scribble.conversation.model.*;
+import org.scribble.extensions.RegistryInfo;
+
+/**
+ * This is the model change rule for the Language Model to
+ * Conversation Model.
+ */
+(a)RegistryInfo(extension=ModelChangeRule.class,notation=BPELLanguageModel.BPEL_NOTATION)
+public class LanguageToConversationModelChangeRule extends AbstractModelChangeRule {
+
+ /**
+ * This method determines whether the rule is appropriate
+ * for the supplied type of model, parent (in the context) and inserted
+ * model object.
+ *
+ * @param context The context
+ * @param model The model
+ * @param mobj The model object being inserted
+ * @param ref The optional reference model object
+ * @return Whether the rule supports the supplied information
+ */
+ @Override
+ public boolean isInsertSupported(ModelChangeContext context,
+ Model model, ModelObject mobj, ModelObject ref) {
+ boolean ret=false;
+
+ if (mobj instanceof ConversationModel &&
+ model instanceof BPELLanguageModel) {
+ ret = true;
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method adds a new model object, within a
+ * parent model object, with the details supplied in
+ * another model object. The supplied model object
+ * will usually be from a different model representation
+ * (e.g. due to a merge), so the details will be
+ * copied and placed in the representation associated
+ * with the supplied model and parent model object.<p>
+ * <p>
+ * If a reference model object is supplied, then the
+ * insertion will occur relative to it. If the reference
+ * object is a block, then it means that the insertion
+ * should occur at the end of the block. Otherwise the
+ * new model object should be inserted before the
+ * reference object, within the containing block.<p>
+ * <p>
+ * If the reference object is not supplied, then the
+ * new model object should be inserted at the end of
+ * the behaviour associated with the parent in the model
+ * change context.
+ *
+ * @param context The context
+ * @param model The model being changed
+ * @param mobj The model object details to be inserted
+ * @param ref The optional reference model object
+ * @return Whether the change has been applied
+ */
+ @Override
+ public boolean insert(ModelChangeContext context,
+ Model model, ModelObject mobj, ModelObject ref) {
+ ConversationModel cm=(ConversationModel)mobj;
+
+ if (cm.getConversation() != null) {
+ context.insert(model, cm.getConversation(), null);
+ }
+
+ return(true);
+ }
+
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/util/InteractionUtil.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/util/InteractionUtil.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/util/InteractionUtil.java 2008-12-18 17:22:31 UTC (rev 456)
@@ -0,0 +1,55 @@
+/*
+ * 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.tools.overlord.cdl.bpel.model.util;
+
+import org.scribble.model.*;
+
+/**
+ * This class contains utility functions for dealing with Interactions.
+ */
+public class InteractionUtil {
+
+ /**
+ * This method determines whether the supplied interaction
+ * is a send.
+ *
+ * @param interaction The interaction
+ * @return Whether the interaction is a send
+ */
+ public static boolean isSend(Interaction interaction) {
+ boolean ret=false;
+ Role role=null;
+
+ if (interaction.getEnclosingDefinition() != null) {
+ role = interaction.getEnclosingDefinition().
+ getModelName().getLocatedRole();
+ }
+
+ if (role != null && ((interaction.getFromRole() != null &&
+ interaction.getFromRole().equals(
+ role)) ||
+ (interaction.getToRole() != null &&
+ interaction.getToRole().equals(
+ role) == false))) {
+ ret = true;
+ }
+
+ return(ret);
+ }
+
+}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ConversionContext.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ConversionContext.java 2008-12-18 09:21:17 UTC (rev 455)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ConversionContext.java 2008-12-18 17:22:31 UTC (rev 456)
@@ -1,21 +1,19 @@
/*
- * 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:
- * 25 Jun 2008 : Initial version created by gary
+ * 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.tools.overlord.cdl.runtime.jbossesb.model;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultConversionContext.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultConversionContext.java 2008-12-18 09:21:17 UTC (rev 455)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultConversionContext.java 2008-12-18 17:22:31 UTC (rev 456)
@@ -1,21 +1,19 @@
/*
- * 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:
- * 25 Jun 2008 : Initial version created by gary
+ * 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.tools.overlord.cdl.runtime.jbossesb.model;
17 years, 7 months
Overlord SVN: r455 - in cdl/trunk: distribution and 9 other directories.
by overlord-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2008-12-18 04:21:17 -0500 (Thu, 18 Dec 2008)
New Revision: 455
Removed:
cdl/trunk/docs/cdl/user/
Modified:
cdl/trunk/distribution/pom.xml
cdl/trunk/docs/docbook/gettingstartedguide/pom.xml
cdl/trunk/docs/docbook/pom.xml
cdl/trunk/docs/docbook/samplesguide/pom.xml
cdl/trunk/docs/docbook/userguide/pom.xml
cdl/trunk/pom.xml
cdl/trunk/runtime/jbossesb-assembly/pom.xml
cdl/trunk/runtime/jbossesb/pom.xml
cdl/trunk/runtime/pom.xml
cdl/trunk/samples/pom.xml
Log:
* Update the trunk's version to SNAPSHOT
Modified: cdl/trunk/distribution/pom.xml
===================================================================
--- cdl/trunk/distribution/pom.xml 2008-12-17 17:47:14 UTC (rev 454)
+++ cdl/trunk/distribution/pom.xml 2008-12-18 09:21:17 UTC (rev 455)
@@ -23,7 +23,7 @@
<artifactId>distribution</artifactId>
<packaging>pom</packaging>
<name>Overlord::CDL::Distribution</name>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
<url>http://www.jboss.org/soag</url>
<properties>
Modified: cdl/trunk/docs/docbook/gettingstartedguide/pom.xml
===================================================================
--- cdl/trunk/docs/docbook/gettingstartedguide/pom.xml 2008-12-17 17:47:14 UTC (rev 454)
+++ cdl/trunk/docs/docbook/gettingstartedguide/pom.xml 2008-12-18 09:21:17 UTC (rev 455)
@@ -6,14 +6,14 @@
<groupId>org.jboss.soa.overlord.cdl.docs</groupId>
<artifactId>gettingstartedguide</artifactId>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
<packaging>jdocbook</packaging>
<name>Overlord::CDL::Docs::gettingstartedguide</name>
<parent>
<groupId>org.jboss.soa.overlord.cdl</groupId>
<artifactId>docs</artifactId>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
</parent>
Modified: cdl/trunk/docs/docbook/pom.xml
===================================================================
--- cdl/trunk/docs/docbook/pom.xml 2008-12-17 17:47:14 UTC (rev 454)
+++ cdl/trunk/docs/docbook/pom.xml 2008-12-18 09:21:17 UTC (rev 455)
@@ -6,7 +6,7 @@
<groupId>org.jboss.soa.overlord.cdl</groupId>
<artifactId>docs</artifactId>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Overlord::CDL::Docs</name>
Modified: cdl/trunk/docs/docbook/samplesguide/pom.xml
===================================================================
--- cdl/trunk/docs/docbook/samplesguide/pom.xml 2008-12-17 17:47:14 UTC (rev 454)
+++ cdl/trunk/docs/docbook/samplesguide/pom.xml 2008-12-18 09:21:17 UTC (rev 455)
@@ -6,14 +6,14 @@
<groupId>org.jboss.soa.overlord.cdl.docs</groupId>
<artifactId>samplesguide</artifactId>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
<packaging>jdocbook</packaging>
<name>Overlord::CDL::Docs::samplesguide</name>
<parent>
<groupId>org.jboss.soa.overlord.cdl</groupId>
<artifactId>docs</artifactId>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
</parent>
Modified: cdl/trunk/docs/docbook/userguide/pom.xml
===================================================================
--- cdl/trunk/docs/docbook/userguide/pom.xml 2008-12-17 17:47:14 UTC (rev 454)
+++ cdl/trunk/docs/docbook/userguide/pom.xml 2008-12-18 09:21:17 UTC (rev 455)
@@ -6,14 +6,14 @@
<groupId>org.jboss.soa.overlord.cdl.docs</groupId>
<artifactId>userguide</artifactId>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
<packaging>jdocbook</packaging>
<name>Overlord::CDL::Docs::userguide</name>
<parent>
<groupId>org.jboss.soa.overlord.cdl</groupId>
<artifactId>docs</artifactId>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
</parent>
Modified: cdl/trunk/pom.xml
===================================================================
--- cdl/trunk/pom.xml 2008-12-17 17:47:14 UTC (rev 454)
+++ cdl/trunk/pom.xml 2008-12-18 09:21:17 UTC (rev 455)
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.soa.overlord</groupId>
<artifactId>cdl</artifactId>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Overlord::CDL</name>
<url>http://www.jboss.org/overlord</url>
Modified: cdl/trunk/runtime/jbossesb/pom.xml
===================================================================
--- cdl/trunk/runtime/jbossesb/pom.xml 2008-12-17 17:47:14 UTC (rev 454)
+++ cdl/trunk/runtime/jbossesb/pom.xml 2008-12-18 09:21:17 UTC (rev 455)
@@ -4,14 +4,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.soa.overlord.cdl.runtime</groupId>
<artifactId>cdl-jbossesb</artifactId>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Overlord::CDL::Runtime::JBossESB</name>
<parent>
<groupId>org.jboss.soa.overlord.cdl</groupId>
<artifactId>runtime</artifactId>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
</parent>
<properties>
Modified: cdl/trunk/runtime/jbossesb-assembly/pom.xml
===================================================================
--- cdl/trunk/runtime/jbossesb-assembly/pom.xml 2008-12-17 17:47:14 UTC (rev 454)
+++ cdl/trunk/runtime/jbossesb-assembly/pom.xml 2008-12-18 09:21:17 UTC (rev 455)
@@ -4,14 +4,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.soa.overlord.cdl.runtime</groupId>
<artifactId>cdl-jbossesb-assembly</artifactId>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
<packaging>jboss-esb</packaging>
<name>Overlord::CDL::Runtime::JBossESB-Assembly</name>
<parent>
<groupId>org.jboss.soa.overlord.cdl</groupId>
<artifactId>runtime</artifactId>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
</parent>
<properties>
Modified: cdl/trunk/runtime/pom.xml
===================================================================
--- cdl/trunk/runtime/pom.xml 2008-12-17 17:47:14 UTC (rev 454)
+++ cdl/trunk/runtime/pom.xml 2008-12-18 09:21:17 UTC (rev 455)
@@ -5,13 +5,13 @@
<groupId>org.jboss.soa.overlord.cdl</groupId>
<artifactId>runtime</artifactId>
<packaging>pom</packaging>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
<name>Overlord::CDL::Runtime</name>
<parent>
<groupId>org.jboss.soa.overlord</groupId>
<artifactId>cdl</artifactId>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
</parent>
<modules>
Modified: cdl/trunk/samples/pom.xml
===================================================================
--- cdl/trunk/samples/pom.xml 2008-12-17 17:47:14 UTC (rev 454)
+++ cdl/trunk/samples/pom.xml 2008-12-18 09:21:17 UTC (rev 455)
@@ -11,12 +11,12 @@
<parent>
<groupId>org.jboss.soa.overlord</groupId>
<artifactId>cdl</artifactId>
- <version>1.0-M1</version>
+ <version>1.0-SNAPSHOT</version>
</parent>
<properties>
<deploy.dir>/var/local/jboss-4.2.2.GA/server/default/deploy</deploy.dir>
- <cdl.jbossesb.version>1.0-M1</cdl.jbossesb.version>
+ <cdl.jbossesb.version>1.0-SNAPSHOT</cdl.jbossesb.version>
</properties>
17 years, 7 months
Overlord SVN: r454 - cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2008-12-17 12:47:14 -0500 (Wed, 17 Dec 2008)
New Revision: 454
Modified:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/plugin.xml
Log:
Move generate service validator menu item under a common 'Generate' menu.
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/plugin.xml
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/plugin.xml 2008-12-17 17:46:58 UTC (rev 453)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/plugin.xml 2008-12-17 17:47:14 UTC (rev 454)
@@ -19,15 +19,15 @@
<separator name="group1"/>
</menu>
<menu
- id="jbossesb.menu"
- label="JBossESB"
+ id="generate.menu"
+ label="Generate"
path="org.jboss.tools.overlord.menu/additions">
<separator name="group2"/>
</menu>
<action
- label="Generate ESB Services"
+ label="JBossESB Services"
class="org.jboss.tools.overlord.cdl.runtime.jbossesb.actions.GenerateAction"
- menubarPath="org.jboss.tools.overlord.menu/jbossesb.menu/group2"
+ menubarPath="org.jboss.tools.overlord.menu/generate.menu/group2"
enablesFor="1"
id="org.jboss.tools.overlord.cdl.runtime.jbossesb.actions.GenerateAction">
</action>
17 years, 7 months
Overlord SVN: r453 - cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2008-12-17 12:46:58 -0500 (Wed, 17 Dec 2008)
New Revision: 453
Modified:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb/plugin.xml
Log:
Move generate service validator menu item under a common 'Generate' menu.
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb/plugin.xml
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb/plugin.xml 2008-12-17 17:35:58 UTC (rev 452)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb/plugin.xml 2008-12-17 17:46:58 UTC (rev 453)
@@ -20,15 +20,15 @@
<separator name="group1"/>
</menu>
<menu
- id="jbossesb.menu"
- label="JBossESB"
+ id="generate.menu"
+ label="Generate"
path="org.jboss.tools.overlord.menu/additions">
<separator name="group2"/>
</menu>
<action
- label="Generate Validator"
+ label="JBossESB Service Validators"
class="org.jboss.tools.overlord.cdl.validator.jbossesb.actions.GenerateValidatorAction"
- menubarPath="org.jboss.tools.overlord.menu/jbossesb.menu/group2"
+ menubarPath="org.jboss.tools.overlord.menu/generate.menu/group2"
enablesFor="1"
id="org.jboss.tools.overlord.cdl.validator.jbossesb.actions.GenerateAction">
</action>
17 years, 7 months
Overlord SVN: r452 - in cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel: .settings and 17 other directories.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2008-12-17 12:35:58 -0500 (Wed, 17 Dec 2008)
New Revision: 452
Added:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.classpath
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.project
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.settings/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.settings/org.eclipse.jdt.core.prefs
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/Copyright.txt
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/META-INF/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/META-INF/MANIFEST.MF
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/build.properties
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/plugin.xml
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/actions/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/actions/GenerateAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/dialogs/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/dialogs/GenerateDialog.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/eclipse/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/eclipse/Activator.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/export/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/export/BPELLanguageModelStreamExportRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/AbstractBuildSystem.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/AntBuildSystem.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/BuildSystem.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/ConversationBasedGenerator.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/Generator.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/GeneratorException.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/GeneratorUtil.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/MavenBuildSystem.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/ModelBasedGenerator.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/template/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/template/Ant.template
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/template/Maven.template
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/BPELLanguageModel.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/DefaultBPELLanguageModel.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/parser/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/parser/BPELNotation.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/parser/BPELParser.java
Log:
Initial version of Overlord CDL BPEL plugin. Setup initial structure to be similar to the ESB actions plugin - may refactor later to extract common functionality into a shared plugin, which may also be dependent upon how the deployment framework is implemented.
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.classpath
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.classpath (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.classpath 2008-12-17 17:35:58 UTC (rev 452)
@@ -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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/java"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.project
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.project (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.project 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.overlord.cdl.bpel</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: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/.settings/org.eclipse.jdt.core.prefs 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,7 @@
+#Wed Dec 17 14:25:40 GMT 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/Copyright.txt
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/Copyright.txt (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/Copyright.txt 2008-12-17 17:35:58 UTC (rev 452)
@@ -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: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/META-INF/MANIFEST.MF
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/META-INF/MANIFEST.MF (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/META-INF/MANIFEST.MF 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Overlord CDL BPEL Plug-in
+Bundle-SymbolicName: org.jboss.tools.overlord.cdl.bpel;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.overlord.cdl.bpel.eclipse.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.scribble.conversation.model,
+ org.scribble.core,
+ org.scribble.lang.model,
+ org.eclipse.core.resources,
+ org.scribble.osgi,
+ org.eclipse.jdt.core
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: www.jboss.org
+Scribble-Extensions: org.jboss.tools.overlord.cdl.bpel.parser.BPELParser,
+ org.jboss.tools.overlord.cdl.bpel.parser.BPELNotation
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/build.properties
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/build.properties (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/build.properties 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,5 @@
+source.. = src/java/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/plugin.xml
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/plugin.xml (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/plugin.xml 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ id="org.jboss.tools.overlord.cdl.bpel.object.contribution"
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.cdm">
+ <menu
+ id="org.jboss.tools.overlord.menu"
+ label="Overlord"
+ path="additions">
+ <separator name="group1"/>
+ </menu>
+ <menu
+ id="generate.menu"
+ label="Generate"
+ path="org.jboss.tools.overlord.menu/additions">
+ <separator name="group2"/>
+ </menu>
+ <action
+ label="WS-BPEL"
+ class="org.jboss.tools.overlord.cdl.bpel.actions.GenerateAction"
+ menubarPath="org.jboss.tools.overlord.menu/generate.menu/group2"
+ enablesFor="1"
+ id="org.jboss.tools.overlord.cdl.bpel.actions.GenerateAction">
+ </action>
+ </objectContribution>
+ </extension>
+
+</plugin>
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/actions/GenerateAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/actions/GenerateAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/actions/GenerateAction.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,117 @@
+/*
+ * 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.tools.overlord.cdl.bpel.actions;
+
+import java.util.logging.Logger;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+import org.scribble.osgi.util.*;
+
+import org.jboss.tools.overlord.cdl.bpel.dialogs.*;
+
+/**
+ * This class implements the action to generate the choreography
+ * as a BPEL process.
+ */
+public class GenerateAction implements IObjectActionDelegate {
+
+ private static final String CANNOT_GENERATE = "Choreography has errors, so cannot generate";
+
+ public GenerateAction() {
+ }
+
+ /**
+ * This method implements the action's run method.
+ *
+ * @param action The action
+ */
+ public void run(IAction action) {
+ if (m_selection instanceof StructuredSelection) {
+ StructuredSelection sel=(StructuredSelection)m_selection;
+
+ IResource res=(IResource)sel.getFirstElement();
+
+ if (res instanceof IFile) {
+
+ if (ResourceUtil.hasErrors(res) == false) {
+ GenerateDialog dialog=
+ new GenerateDialog(m_targetPart.getSite().getShell(),
+ (IFile)res);
+
+ try {
+ dialog.open();
+ } catch(Throwable e) {
+ logger.log(java.util.logging.Level.SEVERE,
+ "Failed to open generate dialog", e);
+ }
+ } else {
+ warn(CANNOT_GENERATE);
+ }
+ }
+ }
+ }
+
+ /**
+ * This method indicates that the selection has changed.
+ *
+ * @param action The action
+ * @param selection The selection
+ */
+ public void selectionChanged(IAction action,
+ ISelection selection) {
+ m_selection = selection;
+ }
+
+ /**
+ * This method sets the currently active workbench part.
+ *
+ * @param action The action
+ * @param targetPart The active workbench part
+ */
+ public void setActivePart(IAction action,
+ IWorkbenchPart targetPart) {
+ m_targetPart = targetPart;
+ }
+
+ /**
+ * This method is used to report a warning.
+ *
+ * @param mesg The warning message
+ */
+ public void warn(String mesg) {
+
+ MessageBox mbox=new MessageBox(m_targetPart.getSite().getShell(),
+ SWT.ICON_WARNING|SWT.OK);
+ mbox.setMessage(mesg);
+ mbox.open();
+ }
+
+ private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.bpel.actions");
+
+ private ISelection m_selection=null;
+ private IWorkbenchPart m_targetPart=null;
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/dialogs/GenerateDialog.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/dialogs/GenerateDialog.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/dialogs/GenerateDialog.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,380 @@
+/*
+ * 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.tools.overlord.cdl.bpel.dialogs;
+
+import java.util.logging.Logger;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.layout.*;
+import org.eclipse.swt.widgets.*;
+import org.jboss.tools.overlord.cdl.bpel.generator.*;
+import org.scribble.conversation.model.ConversationModel;
+import org.scribble.extensions.RegistryFactory;
+import org.scribble.model.*;
+import org.scribble.model.admin.DefaultModelListener;
+import org.scribble.model.admin.ModelRepository;
+
+/**
+ * This class provides the dialog for generating BPEL
+ * artefacts.
+ */
+public class GenerateDialog extends org.eclipse.jface.dialogs.Dialog {
+
+ /**
+ * This is the constructor for the generate dialog.
+ *
+ * @param shell The shell
+ */
+ public GenerateDialog(Shell shell, IFile file) {
+ super(shell);
+
+ m_file = file;
+
+ m_buildSystems.add(new AntBuildSystem());
+ m_buildSystems.add(new MavenBuildSystem());
+
+ initialize(m_file);
+ }
+
+ /**
+ * This method initializes the conversation model associated
+ * with the supplied file resource.
+ *
+ * @param res The file
+ */
+ protected void initialize(IFile res) {
+ ModelReference ref=
+ org.scribble.osgi.model.admin.OSGIModelRepository.createReference(res);
+
+ if (ref != null) {
+ ModelRepository mrep=(ModelRepository)
+ RegistryFactory.getRegistry().getExtension(
+ ModelRepository.class, null);
+
+ if (mrep != null) {
+ java.util.List<ModelInfo> models=mrep.getModels(ref,
+ new DefaultModelListener());
+
+ for (int i=0; m_conversationModel == null &&
+ i < models.size(); i++) {
+ if (models.get(i).getModel() instanceof ConversationModel) {
+ m_conversationModel = (ConversationModel)
+ models.get(i).getModel();
+
+ m_roles = m_conversationModel.getRoles();
+ }
+ }
+ }
+ }
+
+ if (m_conversationModel == null) {
+ error("Unable to load model used to generate " +
+ "the BPEL artefacts", null);
+ }
+ }
+
+ /**
+ * This method creates the dialog details.
+ *
+ * @param parent The parent control
+ * @return The control containing the dialog components
+ */
+ protected Control createDialogArea(Composite parent) {
+
+ Composite composite=(Composite)super.createDialogArea(parent);
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ composite.setLayout(layout);
+
+ GridData gd=null;
+
+ Group group=new Group(composite, SWT.H_SCROLL|SWT.V_SCROLL);
+
+ gd=new GridData();
+ gd.horizontalAlignment = SWT.FILL;
+ gd.horizontalSpan = 1;
+ gd.widthHint = 500;
+ gd.grabExcessHorizontalSpace = true;
+ group.setLayoutData(gd);
+
+ layout = new GridLayout();
+ layout.numColumns = 4;
+ group.setLayout(layout);
+
+ // Labels
+ Label label=new Label(group, SWT.NONE);
+ label.setText("Service Role");
+
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ gd.widthHint = 150;
+ label.setLayoutData(gd);
+
+ label = new Label(group, SWT.NONE);
+ label.setText("Project Name");
+
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ gd.widthHint = 150;
+ label.setLayoutData(gd);
+
+ if (m_conversationModel != null) {
+
+ for (int i=0; i < m_roles.size(); i++) {
+
+ Button button=new Button(group, SWT.CHECK);
+ button.setText(m_roles.get(i).getName());
+ button.setSelection(true);
+
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ gd.widthHint = 150;
+ button.setLayoutData(gd);
+
+ m_roleButtons.add(button);
+
+ button.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ checkStatus();
+ }
+ });
+
+ Text projectName=new Text(group, SWT.NONE);
+
+ String prjName=m_roles.get(i).getName();
+
+ if (m_conversationModel.getModelName() != null) {
+ prjName = m_conversationModel.getModelName().getName()+"-"+prjName;
+ }
+
+ projectName.setText(prjName);
+
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ gd.widthHint = 300;
+ projectName.setLayoutData(gd);
+
+ m_projectNames.add(projectName);
+
+ projectName.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ checkStatus();
+ }
+ });
+
+ }
+ }
+
+ Button button=new Button(group, SWT.NONE);
+ button.setText("Check All");
+
+ gd = new GridData();
+ gd.horizontalSpan = 1;
+ gd.widthHint = 100;
+ button.setLayoutData(gd);
+
+ button.addSelectionListener(new SelectionListener() {
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ for (int i=0; i < m_roleButtons.size(); i++) {
+ m_roleButtons.get(i).setSelection(true);
+ }
+ checkStatus();
+ }
+ });
+
+ button=new Button(group, SWT.NONE);
+ button.setText("Clear All");
+
+ gd = new GridData();
+ gd.horizontalSpan = 1;
+ gd.widthHint = 100;
+ button.setLayoutData(gd);
+
+ button.addSelectionListener(new SelectionListener() {
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ for (int i=0; i < m_roleButtons.size(); i++) {
+ m_roleButtons.get(i).setSelection(false);
+ }
+ checkStatus();
+ }
+ });
+
+ label = new Label(group, SWT.RIGHT);
+ label.setText("Build: ");
+
+ gd = new GridData();
+ gd.horizontalSpan = 1;
+ gd.widthHint = 100;
+ label.setLayoutData(gd);
+
+ m_build=new Combo(group, SWT.DROP_DOWN);
+
+ for (int i=0; i < m_buildSystems.size(); i++) {
+ m_build.add(m_buildSystems.get(i).getName());
+ }
+
+ m_build.select(0);
+
+ gd = new GridData();
+ gd.horizontalSpan = 1;
+ gd.widthHint = 100;
+ m_build.setLayoutData(gd);
+
+ return(composite);
+ }
+
+ @Override
+ protected Control createButtonBar(Composite parent) {
+ Control ret=super.createButtonBar(parent);
+
+ checkStatus();
+
+ return(ret);
+ }
+
+ protected void checkStatus() {
+ int selected=0;
+ boolean f_error=false;
+
+ for (int i=0; i < m_roleButtons.size(); i++) {
+ if (m_roleButtons.get(i).getSelection()) {
+ selected++;
+
+ m_projectNames.get(i).setEnabled(true);
+
+ // Check project name
+ String projectName=m_projectNames.get(i).getText();
+
+ if (isProjectNameValid(projectName) == false) {
+ f_error = true;
+
+ m_projectNames.get(i).setBackground(
+ Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ } else {
+ m_projectNames.get(i).setBackground(
+ Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+ }
+ } else {
+ m_projectNames.get(i).setEnabled(false);
+ m_projectNames.get(i).setBackground(
+ Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+ }
+ }
+
+ if (f_error || selected == 0) {
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ } else {
+ getButton(IDialogConstants.OK_ID).setEnabled(true);
+ }
+ }
+
+ protected boolean isProjectNameValid(String name) {
+ boolean ret=true;
+
+ if (name == null || name.trim().length() == 0) {
+ ret = false;
+ } else if (m_file.getWorkspace().getRoot().getProject(name).exists()) {
+ ret = false;
+ } else {
+ for (int i=0; ret && i < name.length(); i++) {
+ if (i == 0) {
+ ret = Character.isJavaIdentifierStart(name.charAt(i));
+ } else if ("-.".indexOf(name.charAt(i)) != -1) {
+ ret = true;
+ } else {
+ ret = Character.isJavaIdentifierPart(name.charAt(i));
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * The ok button has been pressed.
+ */
+ public void okPressed() {
+
+ try {
+ Generator generator=new Generator(m_file,
+ getSelectedBuildSystem());
+
+ for (int i=0; i < m_roles.size(); i++) {
+
+ if (m_roleButtons.get(i).getSelection()) {
+ generator.generateRole(m_roles.get(i),
+ m_projectNames.get(i).getText());
+ }
+ }
+
+ super.okPressed();
+ } catch(Exception e) {
+ error("Failed to generate BPEL artefacts", e);
+ }
+ }
+
+ protected BuildSystem getSelectedBuildSystem() {
+ return(m_buildSystems.get(m_build.getSelectionIndex()));
+ }
+
+ /**
+ * This method is used to report an error.
+ *
+ * @param mesg The error message
+ * @param ex The exception
+ */
+ public void error(String mesg, Exception ex) {
+
+ org.jboss.tools.overlord.cdl.bpel.eclipse.Activator.logError(mesg, ex);
+
+ MessageBox mbox=new MessageBox(getShell(),
+ SWT.ICON_ERROR|SWT.OK);
+ mbox.setMessage(mesg);
+ mbox.open();
+
+ logger.log(java.util.logging.Level.SEVERE, mesg, ex);
+ }
+
+ private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.runtime.jbossesb.dialogs");
+
+ private IFile m_file=null;
+ private ConversationModel m_conversationModel=null;
+ private java.util.List<Role> m_roles=null;
+ private java.util.List<Button> m_roleButtons=new java.util.Vector<Button>();
+ private java.util.List<Text> m_projectNames=new java.util.Vector<Text>();
+ private Combo m_build=null;
+ private java.util.List<BuildSystem> m_buildSystems=new java.util.Vector<BuildSystem>();
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/eclipse/Activator.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/eclipse/Activator.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/eclipse/Activator.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,74 @@
+package org.jboss.tools.overlord.cdl.bpel.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.tools.overlord.cdl.bpel";
+
+ // 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.tools.overlord.cdl.bpel.eclipse");
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/export/BPELLanguageModelStreamExportRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/export/BPELLanguageModelStreamExportRule.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/export/BPELLanguageModelStreamExportRule.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,207 @@
+/*
+ * 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.tools.overlord.cdl.bpel.export;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.jboss.tools.overlord.cdl.bpel.model.*;
+import org.scribble.export.*;
+import org.scribble.export.stream.*;
+import org.scribble.extensions.RegistryInfo;
+import org.scribble.model.*;
+import org.w3c.dom.Node;
+
+/**
+ * This class implements the stream based export rule for the
+ * BPELLanguageModel entity.
+ */
+(a)RegistryInfo(extension=ExportRule.class,notation=BPELLanguageModel.BPEL_NOTATION)
+public class BPELLanguageModelStreamExportRule extends DefaultModelStreamExportRule {
+
+ /**
+ * This method determines whether the exporter rule is appropriate
+ * for the supplied model object and format.
+ *
+ * @param modelObject The model object
+ * @param format The format
+ * @return Whether the rule is appropriate for the model object and
+ * format
+ */
+ public boolean isSupported(ModelObject modelObject, Formatter format) {
+ return(super.isSupported(modelObject, format) &&
+ BPELLanguageModel.class.isAssignableFrom(modelObject.getClass()));
+ }
+
+ /**
+ * This method exports the model object.
+ *
+ * @param modelObject The model object
+ * @param context The context
+ * @throws IOException Failed to record export information
+ */
+ public void export(ModelObject modelObject, ExporterContext context)
+ throws java.io.IOException {
+ BPELLanguageModel model=(BPELLanguageModel)modelObject;
+
+ try {
+ String text=getText(model.getBPELProcess());
+
+ context.getFormatter().record(text.getBytes());
+
+ } catch(Exception e) {
+ throw new java.io.IOException("Failed to get BPEL process text");
+ }
+ }
+
+ /**
+ * This class converts a DOM representation node to
+ * text.
+ *
+ * @param node The DOM node
+ * @return The text
+ * @throws Exception Failed to convert
+ */
+ protected String getText(Node node) throws Exception {
+ String ret=null;
+
+ try {
+ // Transform the DOM represent to text
+ java.io.ByteArrayOutputStream xmlstr=
+ new java.io.ByteArrayOutputStream();
+
+ DOMSource source=new DOMSource();
+ source.setNode(node);
+
+ StreamResult result=new StreamResult(xmlstr);
+
+ Transformer trans=
+ TransformerFactory.newInstance().newTransformer();
+ trans.transform(source, result);
+
+ xmlstr.close();
+
+ ret = new String(xmlstr.toByteArray());
+
+ if ((node instanceof org.w3c.dom.Document) == false) {
+
+ // Strip off any <?xml> header
+ int index=ret.indexOf("<?xml");
+ if (index != -1) {
+ index = ret.indexOf("<", 1);
+
+ if (index != -1) {
+ ret = ret.substring(index);
+ } else {
+ index = ret.indexOf("?>");
+
+ if (index != -1) {
+ index += 2;
+
+ // Remove any trailing whitespaces
+ // after XML header
+ while (index < ret.length() &&
+ Character.isWhitespace(ret.charAt(index))) {
+ index++;
+ }
+
+ ret = ret.substring(index);
+ }
+ }
+ }
+ }
+
+ } catch(Exception e) {
+ throw new Exception("Failed to transform " +
+ "DOM representation into text", e);
+ }
+
+ int pos=0;
+ int prevpos=0;
+ StringBuffer buf=new StringBuffer();
+ int level=0;
+
+ while ((pos=ret.indexOf('<', prevpos)) != -1) {
+
+ if (prevpos < pos &&
+ ret.substring(prevpos, pos).trim().length() > 0 &&
+ ret.charAt(prevpos-1) != '?') {
+
+ if (ret.charAt(prevpos) == '\r' &&
+ ret.charAt(prevpos+1) == '\n') {
+ prevpos += 2;
+ }
+ for (int i=0; i < level; i++) {
+ buf.append(" ");
+ }
+
+ buf.append(ret.substring(prevpos, pos).trim());
+ buf.append("\r\n");
+ }
+
+ int endpos=ret.indexOf('>', pos);
+
+ if (endpos > 0) {
+ boolean noreturn=false;
+
+ if (pos > 0 && ret.charAt(pos+1) == '/') {
+ level--;
+ }
+
+ for (int i=0; i < level; i++) {
+ buf.append(" ");
+ }
+ buf.append(ret.substring(pos, endpos+1));
+
+ if (ret.charAt(endpos-1)== '?') {
+ //noreturn = true;
+
+ } else if (ret.charAt(endpos-1) == '/') {
+ // Ignore
+ } else if (pos > 0 && ret.charAt(pos+1) == '/') {
+ // Ignore
+
+ } else if (pos > 0 && ret.charAt(pos+1) == '!') {
+ // Ignore
+
+ } else {
+ level++;
+ }
+
+ if (noreturn == false) {
+ buf.append("\r\n");
+ }
+
+ pos = endpos+1;
+ }
+
+ prevpos = pos;
+ }
+
+ if (prevpos != -1 &&
+ ret.substring(prevpos).trim().length() > 0) {
+ buf.append(ret.substring(prevpos));
+ }
+
+ ret = buf.toString();
+
+ return(ret);
+ }
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/AbstractBuildSystem.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/AbstractBuildSystem.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/AbstractBuildSystem.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,58 @@
+/*
+ * 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.tools.overlord.cdl.bpel.generator;
+
+/**
+ * This class represents an abstract build system.
+ */
+public abstract class AbstractBuildSystem implements BuildSystem {
+
+ private static final String TEMPLATE_SUFFIX = ".template";
+ private static final String TEMPLATE_PREFIX = "template/";
+
+ /**
+ * This method returns the contents for the build
+ * configuration file.
+ *
+ * @param projectName The project name
+ * @return The build file contents
+ */
+ public String getBuildFileContents(String projectName) {
+ String ret=null;
+
+ java.io.InputStream is=
+ AbstractBuildSystem.class.getResourceAsStream(
+ TEMPLATE_PREFIX+getName()+TEMPLATE_SUFFIX);
+
+ if (is != null) {
+
+ try {
+ byte[] b=new byte[is.available()];
+ is.read(b);
+
+ ret = new String(b);
+
+ ret = ret.replaceAll("%PROJECT%", projectName);
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ return(ret);
+ }
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/AntBuildSystem.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/AntBuildSystem.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/AntBuildSystem.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,101 @@
+/*
+ * 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.tools.overlord.cdl.bpel.generator;
+
+/**
+ * This class represents the Ant build system.
+ */
+public class AntBuildSystem extends AbstractBuildSystem {
+
+ private static final String BUILD_FILE = "build.xml";
+ private static final String ANT = "Ant";
+ private static final String ESB_CONFIG_PATH = "src/conf/jboss-esb.xml";
+ private static final String DEPLOYMENT_PATH = "src/conf/deployment.xml";
+ private static final String JBMQ_CONFIG_PATH = "src/conf/jbmq-queue-service.xml";
+ private static final String JAVA_SOURCE_PATH = "src/java";
+ private static final String LIBRARY_PATH = "src/lib";
+
+ /**
+ * This method represents the name of the build
+ * system.
+ *
+ * @return The name
+ */
+ public String getName() {
+ return(ANT);
+ }
+
+ /**
+ * This method returns the build configuration file
+ * path.
+ *
+ * @return The build configuration file path
+ */
+ public String getBuildFilePath() {
+ return(BUILD_FILE);
+ }
+
+ /**
+ * This method returns the ESB configuration file
+ * path.
+ *
+ * @return The ESB configuration file path
+ */
+ public String getESBConfigFilePath() {
+ return(ESB_CONFIG_PATH);
+ }
+
+ /**
+ * This method returns the deployment file
+ * path.
+ *
+ * @return The deployment file path
+ */
+ public String getDeploymentFilePath() {
+ return(DEPLOYMENT_PATH);
+ }
+
+ /**
+ * This method returns the JBMQ configuration file
+ * path.
+ *
+ * @return The JBMQ configuration file path
+ */
+ public String getJBMQConfigFilePath() {
+ return(JBMQ_CONFIG_PATH);
+ }
+
+ /**
+ * This method returns the Java source path.
+ *
+ * @return The Java source path
+ */
+ public String getJavaSourcePath() {
+ return(JAVA_SOURCE_PATH);
+ }
+
+ /**
+ * This method returns the library path.
+ *
+ * @return The library path
+ */
+ public String getLibraryPath() {
+ return(LIBRARY_PATH);
+ }
+
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/BuildSystem.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/BuildSystem.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/BuildSystem.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,89 @@
+/*
+ * 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.tools.overlord.cdl.bpel.generator;
+
+/**
+ * This interface represents a build system used when
+ * generating the ESB projects.
+ */
+public interface BuildSystem {
+
+ /**
+ * This method represents the name of the build
+ * system.
+ *
+ * @return The name
+ */
+ public String getName();
+
+ /**
+ * This method returns the build configuration file
+ * path.
+ *
+ * @return The build configuration file path
+ */
+ public String getBuildFilePath();
+
+ /**
+ * This method returns the contents for the build
+ * configuration file.
+ *
+ * @param projectName The project name
+ * @return The build file contents
+ */
+ public String getBuildFileContents(String projectName);
+
+ /**
+ * This method returns the ESB configuration file
+ * path.
+ *
+ * @return The ESB configuration file path
+ */
+ public String getESBConfigFilePath();
+
+ /**
+ * This method returns the deployment file
+ * path.
+ *
+ * @return The deployment file path
+ */
+ public String getDeploymentFilePath();
+
+ /**
+ * This method returns the JBMQ configuration file
+ * path.
+ *
+ * @return The JBMQ configuration file path
+ */
+ public String getJBMQConfigFilePath();
+
+ /**
+ * This method returns the Java source path.
+ *
+ * @return The Java source path
+ */
+ public String getJavaSourcePath();
+
+ /**
+ * This method returns the library path.
+ *
+ * @return The library path, or null if not required
+ */
+ public String getLibraryPath();
+
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/ConversationBasedGenerator.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/ConversationBasedGenerator.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/ConversationBasedGenerator.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,42 @@
+/*
+ * 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.tools.overlord.cdl.bpel.generator;
+
+import org.eclipse.jdt.core.IJavaProject;
+import org.scribble.conversation.model.Conversation;
+
+/**
+ * This interface represents a module that generates artefacts
+ * based on a specific conversation.
+ */
+public interface ConversationBasedGenerator {
+
+ /**
+ * This method generates the relevant artefacts based on
+ * the supplied conversation, within the specified Java project.
+ *
+ * @param jproj The Java project
+ * @param conversation The conversation
+ * @param buildSystem The build system to use
+ * @throws GeneratorException Failed to generate
+ */
+ public void generate(IJavaProject jproj,
+ Conversation conversation, BuildSystem buildSystem)
+ throws GeneratorException;
+
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/Generator.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/Generator.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/Generator.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,461 @@
+/*
+ * 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.tools.overlord.cdl.bpel.generator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.overlord.cdl.bpel.generator.BuildSystem;
+import org.jboss.tools.overlord.cdl.bpel.model.*;
+import org.scribble.conversation.model.ConversationModel;
+import org.scribble.extensions.RegistryFactory;
+import org.scribble.model.*;
+import org.scribble.model.admin.DefaultModelListener;
+import org.scribble.model.admin.ModelRepository;
+import org.scribble.model.change.ModelGenerator;
+import org.scribble.conversation.model.*;
+import org.w3c.dom.Node;
+import org.eclipse.jdt.core.*;
+import org.eclipse.core.resources.*;
+import org.eclipse.core.runtime.*;
+
+/**
+ * This class provides the mechanism for generating JBossESB
+ * service artefacts.
+ */
+public class Generator {
+
+ private static final String CLASSPATH_FILENAME = ".classpath";
+ private static final String OUTPUT_LOCATION = "classes";
+
+ /**
+ * This is the constructor for the generator.
+ *
+ */
+ public Generator(IFile file, BuildSystem buildSystem) {
+ m_file = file;
+ m_buildSystem = buildSystem;
+
+ initialize(m_file);
+ }
+
+ /**
+ * This method initializes the conversation model associated
+ * with the supplied file resource.
+ *
+ * @param res The file
+ */
+ protected void initialize(IFile res) {
+
+ // Initialize the artefact generators
+ //m_conversationBasedGen.add(new BusinessObjectTypeGenerator());
+
+ //m_modelBasedGen.add(new BuildConfigurationGenerator());
+ //m_modelBasedGen.add(new JBMQConfigurationGenerator());
+ //m_modelBasedGen.add(new DeploymentFileGenerator());
+
+ // Initialize the model
+ ModelReference ref=
+ org.scribble.osgi.model.admin.OSGIModelRepository.createReference(res);
+
+ if (ref != null) {
+ ModelRepository mrep=(ModelRepository)
+ RegistryFactory.getRegistry().getExtension(
+ ModelRepository.class, null);
+
+ if (mrep != null) {
+ java.util.List<ModelInfo> models=mrep.getModels(ref,
+ new DefaultModelListener());
+
+ for (int i=0; m_conversationModel == null &&
+ i < models.size(); i++) {
+ if (models.get(i).getModel() instanceof ConversationModel) {
+ m_conversationModel = (ConversationModel)
+ models.get(i).getModel();
+
+ m_roles = m_conversationModel.getRoles();
+ }
+ }
+ }
+ }
+
+ if (m_conversationModel == null) {
+ logger.severe("Unable to load model used to generate " +
+ "the ESB artefacts");
+ }
+ }
+
+ /**
+ * This method returns the roles that can be generated.
+ *
+ * @return The roles
+ */
+ public java.util.List<Role> getRoles() {
+ return(m_roles);
+ }
+
+ /**
+ * This method generates the project associated with the
+ * supplied role.
+ *
+ * @param role The role
+ * @param projectName The project name
+ * @throws Exception Failed to generate role
+ */
+ public void generateRole(Role role, String projectName)
+ throws Exception {
+
+ if (logger.isLoggable(Level.FINEST)) {
+ logger.finest("Generate role '"+role+"' for: "+
+ m_conversationModel);
+ }
+
+ // Project to role
+ org.scribble.projector.Projector projector=
+ (org.scribble.projector.Projector)
+ RegistryFactory.getRegistry().getExtension(
+ org.scribble.projector.Projector.class, null);
+
+ if (projector != null) {
+ Model localModel=projector.project(m_conversationModel,
+ role, new DefaultModelListener());
+
+ if (localModel instanceof ConversationModel &&
+ ((ConversationModel)localModel).getConversation() != null) {
+ ConversationModel lcm=(ConversationModel)localModel;
+
+ ModelReference targetRef=
+ new ModelReference(BPELLanguageModel.BPEL_NOTATION);
+
+ DefaultBPELLanguageModel target=
+ new DefaultBPELLanguageModel(targetRef);
+
+ ModelGenerator generator=(ModelGenerator)
+ RegistryFactory.getRegistry().getExtension(
+ ModelGenerator.class, null);
+
+ if (generator != null) {
+ generator.generate(targetRef, role, target,
+ lcm);
+
+ generateRoleProject(projectName,
+ target.getBPELProcess(),
+ lcm, target);
+ } else {
+ logger.severe("Unable to find model generator");
+ }
+ }
+ }
+ }
+
+ protected void generateRoleProject(String projectName,
+ org.w3c.dom.Element esbConfig, ConversationModel localcm,
+ BPELLanguageModel model) throws Exception {
+
+ final IJavaProject jproj=createJavaProject(projectName);
+
+ if (jproj != null && esbConfig != null) {
+ // Generate business object types for
+ // local conversation model
+ localcm.visit(new Visitor() {
+
+ public boolean visit(ModelObject obj) {
+
+ if (obj instanceof Conversation) {
+ for (int i=0; i < m_conversationBasedGen.size(); i++) {
+ try {
+ m_conversationBasedGen.get(i).generate(jproj,
+ (Conversation)obj, getBuildSystem());
+ } catch(GeneratorException e) {
+ logger.log(java.util.logging.Level.SEVERE,
+ "Failed to generate conversation based artefact",
+ e);
+ }
+ }
+ }
+
+ return true;
+ }
+ });
+
+ // Store ESB configuration
+ IPath esbConfigPath=jproj.getPath().append(
+ new Path(getBuildSystem().getESBConfigFilePath()));
+
+ IFile esbConfigFile=jproj.getProject().getWorkspace().getRoot().getFile(esbConfigPath);
+ GeneratorUtil.createParentFolder(esbConfigFile);
+ esbConfigFile.create(null, true,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+
+ String config=getText(esbConfig);
+
+ if (config != null) {
+ esbConfigFile.setContents(new java.io.ByteArrayInputStream(
+ config.getBytes()), true, false,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+ }
+
+ for (int i=0; i < m_modelBasedGen.size(); i++) {
+ try {
+ m_modelBasedGen.get(i).generate(jproj, model,
+ getBuildSystem());
+ } catch(GeneratorException e) {
+ logger.log(java.util.logging.Level.SEVERE,
+ "Failed to generate model based artefact",
+ e);
+ }
+ }
+ }
+ }
+
+ protected IJavaProject createJavaProject(String projectName)
+ throws Exception {
+
+ // Create project
+ IProject project=m_file.getWorkspace().getRoot().getProject(projectName);
+ project.create(new org.eclipse.core.runtime.NullProgressMonitor());
+
+ IJavaProject jproj=JavaCore.create(project);
+
+ project.open(new org.eclipse.core.runtime.NullProgressMonitor());
+
+ IProjectDescription description = jproj.getProject().getDescription();
+
+ // Update the project natures to include Java Nature
+ String[] prevNatures= description.getNatureIds();
+ String[] newNatures= new String[prevNatures.length + 1];
+ System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
+ newNatures[prevNatures.length]= JavaCore.NATURE_ID;
+ description.setNatureIds(newNatures);
+
+ // Setup project reference to CDM project
+ IProject[] prevProjects=description.getReferencedProjects();
+ IProject[] newProjects=new IProject[prevProjects.length+1];
+ System.arraycopy(prevProjects, 0, newProjects, 0, prevProjects.length);
+ newProjects[prevProjects.length] = m_file.getProject();
+ description.setReferencedProjects(newProjects);
+
+ // Set the description
+ jproj.getProject().setDescription(description,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+
+ IPath outputLocation=jproj.getPath().append(new Path(OUTPUT_LOCATION));
+ IPath classpathLocation=jproj.getPath().append(new Path(CLASSPATH_FILENAME));
+ IPath sourceLocation=jproj.getPath().append(
+ new Path(getBuildSystem().getJavaSourcePath()));
+ IPath libLocation=null;
+
+ if (getBuildSystem().getLibraryPath() != null) {
+ libLocation=jproj.getPath().append(new Path(getBuildSystem().getLibraryPath()));
+ }
+
+ // create and set the output and source paths first
+ IFolder outputFolder= jproj.getProject().getWorkspace().getRoot().getFolder(outputLocation);
+ GeneratorUtil.createParentFolder(outputFolder);
+ outputFolder.create(true, true, new org.eclipse.core.runtime.NullProgressMonitor());
+ outputFolder.setDerived(true);
+
+ IFolder sourceFolder= jproj.getProject().getWorkspace().getRoot().getFolder(sourceLocation);
+ GeneratorUtil.createParentFolder(sourceFolder);
+ sourceFolder.create(true, true, new org.eclipse.core.runtime.NullProgressMonitor());
+ sourceFolder.setDerived(true);
+
+ if (libLocation != null) {
+ IFolder libFolder= jproj.getProject().getWorkspace().getRoot().getFolder(libLocation);
+ GeneratorUtil.createParentFolder(libFolder);
+ libFolder.create(true, true, new org.eclipse.core.runtime.NullProgressMonitor());
+ libFolder.setDerived(true);
+ }
+
+ IFile file=jproj.getProject().getWorkspace().getRoot().getFile(classpathLocation);
+ file.create(null, true, new org.eclipse.core.runtime.NullProgressMonitor());
+ file.setDerived(true);
+
+ // Write empty contents, to overcome 'Resource '..' is not local' exception
+ String classpath="<classpath/>";
+ file.setContents(new java.io.ByteArrayInputStream(classpath.getBytes()), true,
+ false, new org.eclipse.core.runtime.NullProgressMonitor());
+
+ IClasspathEntry[] classpaths=new IClasspathEntry[2];
+
+ classpaths[0] = JavaCore.newContainerEntry(
+ new Path("org.eclipse.jdt.launching.JRE_CONTAINER"));
+
+ classpaths[1] = JavaCore.newSourceEntry(sourceLocation);
+
+ jproj.setRawClasspath(classpaths, outputLocation,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+
+ return(jproj);
+ }
+
+ /**
+ * This class converts a DOM representation node to
+ * text.
+ *
+ * @param node The DOM node
+ * @return The text
+ * @throws Exception Failed to convert
+ */
+ protected String getText(Node node) throws Exception {
+ String ret=null;
+
+ try {
+ // Transform the DOM represent to text
+ java.io.ByteArrayOutputStream xmlstr=
+ new java.io.ByteArrayOutputStream();
+
+ DOMSource source=new DOMSource();
+ source.setNode(node);
+
+ StreamResult result=new StreamResult(xmlstr);
+
+ Transformer trans=
+ TransformerFactory.newInstance().newTransformer();
+ trans.transform(source, result);
+
+ xmlstr.close();
+
+ ret = new String(xmlstr.toByteArray());
+
+ if ((node instanceof org.w3c.dom.Document) == false) {
+
+ // Strip off any <?xml> header
+ int index=ret.indexOf("<?xml");
+ if (index != -1) {
+ index = ret.indexOf("<", 1);
+
+ if (index != -1) {
+ ret = ret.substring(index);
+ } else {
+ index = ret.indexOf("?>");
+
+ if (index != -1) {
+ index += 2;
+
+ // Remove any trailing whitespaces
+ // after XML header
+ while (index < ret.length() &&
+ Character.isWhitespace(ret.charAt(index))) {
+ index++;
+ }
+
+ ret = ret.substring(index);
+ }
+ }
+ }
+ }
+
+ } catch(Exception e) {
+ throw new Exception("Failed to transform " +
+ "DOM representation into text", e);
+ }
+
+ int pos=0;
+ int prevpos=0;
+ StringBuffer buf=new StringBuffer();
+ int level=0;
+
+ while ((pos=ret.indexOf('<', prevpos)) != -1) {
+
+ if (prevpos < pos &&
+ ret.substring(prevpos, pos).trim().length() > 0 &&
+ ret.charAt(prevpos-1) != '?') {
+
+ if (ret.charAt(prevpos) == '\r' &&
+ ret.charAt(prevpos+1) == '\n') {
+ prevpos += 2;
+ }
+ for (int i=0; i < level; i++) {
+ buf.append(" ");
+ }
+
+ buf.append(ret.substring(prevpos, pos).trim());
+ buf.append("\r\n");
+ }
+
+ int endpos=ret.indexOf('>', pos);
+
+ if (endpos > 0) {
+ boolean noreturn=false;
+
+ if (pos > 0 && ret.charAt(pos+1) == '/') {
+ level--;
+ }
+
+ for (int i=0; i < level; i++) {
+ buf.append(" ");
+ }
+ buf.append(ret.substring(pos, endpos+1));
+
+ if (ret.charAt(endpos-1)== '?') {
+ //noreturn = true;
+
+ } else if (ret.charAt(endpos-1) == '/') {
+ // Ignore
+ } else if (pos > 0 && ret.charAt(pos+1) == '/') {
+ // Ignore
+
+ } else if (pos > 0 && ret.charAt(pos+1) == '!') {
+ // Ignore
+
+ } else {
+ level++;
+ }
+
+ if (noreturn == false) {
+ buf.append("\r\n");
+ }
+
+ pos = endpos+1;
+ }
+
+ prevpos = pos;
+ }
+
+ if (prevpos != -1 &&
+ ret.substring(prevpos).trim().length() > 0) {
+ buf.append(ret.substring(prevpos));
+ }
+
+ ret = buf.toString();
+
+ return(ret);
+ }
+
+ public BuildSystem getBuildSystem() {
+ return(m_buildSystem);
+ }
+
+ private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.runtime.jbossesb.generator");
+
+ private IFile m_file=null;
+ private java.util.List<Role> m_roles=null;
+ private ConversationModel m_conversationModel=null;
+ private BuildSystem m_buildSystem=null;
+ private java.util.List<ConversationBasedGenerator> m_conversationBasedGen=
+ new java.util.Vector<ConversationBasedGenerator>();
+ private java.util.List<ModelBasedGenerator> m_modelBasedGen=
+ new java.util.Vector<ModelBasedGenerator>();
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/GeneratorException.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/GeneratorException.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/GeneratorException.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,35 @@
+/*
+ * 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.tools.overlord.cdl.bpel.generator;
+
+public class GeneratorException extends Exception {
+
+ private static final long serialVersionUID = -2263049447116467663L;
+
+ /**
+ * This constructor initializes the generator exception
+ * with a message and the underlying exception that
+ * caused the problem.
+ *
+ * @param mesg The message
+ * @param t The cause
+ */
+ public GeneratorException(String mesg, Throwable t) {
+ super(mesg, t);
+ }
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/GeneratorUtil.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/GeneratorUtil.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/GeneratorUtil.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,53 @@
+/*
+ * 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.tools.overlord.cdl.bpel.generator;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+
+/**
+ * This class provides general utility functions for
+ * use when generating artefacts.
+ */
+public class GeneratorUtil {
+
+ /**
+ * This method checks whether the parent folder exists,
+ * and if not attempts to create it.
+ *
+ * @param res The current resource
+ */
+ public static void createParentFolder(IResource res) {
+
+ if (res.getParent() instanceof IFolder) {
+ IFolder parent=(IFolder)res.getParent();
+
+ if (parent.exists() == false) {
+ createParentFolder(parent);
+
+ try {
+ parent.create(true, true,
+ new org.eclipse.core.runtime.NullProgressMonitor());
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/MavenBuildSystem.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/MavenBuildSystem.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/MavenBuildSystem.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,101 @@
+/*
+ * 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.tools.overlord.cdl.bpel.generator;
+
+/**
+ * This class represents the Ant build system.
+ */
+public class MavenBuildSystem extends AbstractBuildSystem {
+
+ private static final String BUILD_FILE = "pom.xml";
+ private static final String MAVEN = "Maven";
+ private static final String ESB_CONFIG_PATH = "src/main/resources/META-INF/jboss-esb.xml";
+ private static final String DEPLOYMENT_PATH = "src/main/resources/META-INF/deployment.xml";
+ private static final String JBMQ_CONFIG_PATH = "src/main/resources/jbmq-queue-service.xml";
+ private static final String JAVA_SOURCE_PATH = "src/main/java";
+ private static final String LIBRARY_PATH = null;
+
+ /**
+ * This method represents the name of the build
+ * system.
+ *
+ * @return The name
+ */
+ public String getName() {
+ return(MAVEN);
+ }
+
+ /**
+ * This method returns the build configuration file
+ * path.
+ *
+ * @return The build configuration file path
+ */
+ public String getBuildFilePath() {
+ return(BUILD_FILE);
+ }
+
+ /**
+ * This method returns the ESB configuration file
+ * path.
+ *
+ * @return The ESB configuration file path
+ */
+ public String getESBConfigFilePath() {
+ return(ESB_CONFIG_PATH);
+ }
+
+ /**
+ * This method returns the deployment file
+ * path.
+ *
+ * @return The deployment file path
+ */
+ public String getDeploymentFilePath() {
+ return(DEPLOYMENT_PATH);
+ }
+
+ /**
+ * This method returns the JBMQ configuration file
+ * path.
+ *
+ * @return The JBMQ configuration file path
+ */
+ public String getJBMQConfigFilePath() {
+ return(JBMQ_CONFIG_PATH);
+ }
+
+ /**
+ * This method returns the Java source path.
+ *
+ * @return The Java source path
+ */
+ public String getJavaSourcePath() {
+ return(JAVA_SOURCE_PATH);
+ }
+
+ /**
+ * This method returns the library path.
+ *
+ * @return The library path
+ */
+ public String getLibraryPath() {
+ return(LIBRARY_PATH);
+ }
+
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/ModelBasedGenerator.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/ModelBasedGenerator.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/ModelBasedGenerator.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,42 @@
+/*
+ * 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.tools.overlord.cdl.bpel.generator;
+
+import org.eclipse.jdt.core.IJavaProject;
+import org.jboss.tools.overlord.cdl.bpel.model.*;
+
+/**
+ * This interface represents a module that generates artefacts
+ * based on the complete model.
+ */
+public interface ModelBasedGenerator {
+
+ /**
+ * This method generates the relevant artefacts based on
+ * the supplied model, within the specified Java project.
+ *
+ * @param jproj The Java project
+ * @param model The model
+ * @param buildSystem The build system to use
+ * @throws GeneratorException Failed to generate
+ */
+ public void generate(IJavaProject jproj,
+ BPELLanguageModel model, BuildSystem buildSystem)
+ throws GeneratorException;
+
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/template/Ant.template
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/template/Ant.template (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/template/Ant.template 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,44 @@
+<project name="%PROJECT%" basedir="." default="deploy" >
+ <property name="build.dir" value="${basedir}/target" />
+ <property name="classes" value="${build.dir}/classes" />
+ <property name="lib" value="src/lib" />
+ <property name="src" value="src/java" />
+ <property name="conf" value="src/conf" />
+
+ <path id="compile-classpath">
+ <fileset dir="${lib}" includes="*.jar" />
+ </path>
+
+ <target name="init" depends="clean">
+ <mkdir dir="${build.dir}" />
+ </target>
+
+ <target name="clean">
+ <delete dir="${build.dir}" />
+ </target>
+
+ <target name="compile" depends="init">
+ <mkdir dir="${classes}" />
+ <javac srcdir="${src}" destdir="${classes}" debug="true" deprecation="true">
+ <classpath refid="compile-classpath" />
+ </javac>
+ <copy todir="${classes}">
+ <fileset dir="${conf}" includes="**/*.xml"/>
+ </copy>
+ </target>
+
+ <target name="esbjar" depends="compile">
+ <jar destfile="${build.dir}/${ant.project.name}.esb">
+ <fileset dir="${classes}" />
+ <fileset dir="${build.dir}" includes="*.jar,*.war"/>
+ <fileset dir="${classes}" includes="deployment.xml"/>
+ <fileset dir="${classes}" includes="META-INF/**" />
+ <fileset dir="${lib}" includes="*.jar"/>
+ </jar>
+ </target>
+
+ <target name="deploy" depends="esbjar">
+ <copy todir="${org.jboss.esb.server.deploy.dir}"
+ file="${build.dir}/${ant.project.name}.esb"/>
+ </target>
+</project>
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/template/Maven.template
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/template/Maven.template (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/generator/template/Maven.template 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,54 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.soa.overlord.cdl.project</groupId>
+ <artifactId>%PROJECT%</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jboss-esb</packaging>
+ <name>%PROJECT%</name>
+ <url>http://www.jboss.org/overlord</url>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.soa.overlord.cdl</groupId>
+ <artifactId>runtime-jbossesb</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>%PROJECT%</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jboss-packaging-maven-plugin</artifactId>
+ <version>2.0-20080130.110241-9</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots/>
+ <id>jboss-plugin-snapshots</id>
+ <name>JBoss Snapshot Plugin Repository</name>
+ <url>http://snapshots.repository.codehaus.org</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+
+</project>
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/BPELLanguageModel.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/BPELLanguageModel.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/BPELLanguageModel.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,63 @@
+/*
+ * 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.tools.overlord.cdl.bpel.model;
+
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * This class represents a BPEL model.
+ *
+ * @author gary
+ */
+public interface BPELLanguageModel {
+
+ public static final String BPEL_NOTATION = "bpel";
+
+ /**
+ * This method validates the ESB model and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ public void validate(ModelListener l);
+
+ /**
+ * This method returns the source model reference.
+ *
+ * @return The source model reference
+ */
+ public ModelReference getModelReference();
+
+ /**
+ * This textual contents of the model.
+ *
+ * @return The textual contents
+ */
+ public String getOriginalContents();
+
+
+ /**
+ * This method returns the reference to the DOM
+ * representation of the BPEL process.
+ *
+ * @return The BPEL process
+ */
+ public org.w3c.dom.Element getBPELProcess();
+
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/DefaultBPELLanguageModel.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/DefaultBPELLanguageModel.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/model/DefaultBPELLanguageModel.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,212 @@
+/*
+ * 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.tools.overlord.cdl.bpel.model;
+
+import java.util.logging.Logger;
+
+import org.scribble.conversation.model.*;
+import org.scribble.extensions.RegistryFactory;
+import org.scribble.model.*;
+import org.scribble.model.admin.DependencyType;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+import org.scribble.model.resolutions.*;
+
+/**
+ * This class represents a BPEL model.
+ *
+ * @author gary
+ */
+public class DefaultBPELLanguageModel extends org.scribble.lang.model.LanguageModel
+ implements BPELLanguageModel {
+
+
+ public static final String BPEL_NOTATION = "bpel";
+
+ /**
+ * This constructor is initialized with the BPEL description.
+ *
+ * @param source The model reference for the BPEL source
+ * @param elem The BPEL document
+ * @param contents The textual contents
+ */
+ public DefaultBPELLanguageModel(ModelReference source, org.w3c.dom.Element elem,
+ String contents) {
+ m_source = source;
+ m_bpelProcess = elem;
+ m_contents = contents;
+
+ // Extract service action pipelines
+ initializeExistingConfig();
+ }
+
+ /**
+ * This constructor initializes a new BPEL process.
+ *
+ * @param source The model reference for the BPEL description
+ */
+ public DefaultBPELLanguageModel(ModelReference source) {
+ m_source = source;
+
+ initializeNewConfig();
+ }
+
+ /**
+ * This method creates a new BPEL process.
+ */
+ protected void initializeNewConfig() {
+
+ org.w3c.dom.Document doc=null;
+
+ // Create an empty document
+ try {
+ doc = javax.xml.parsers.DocumentBuilderFactory.
+ newInstance().newDocumentBuilder().newDocument();
+
+ m_bpelProcess = doc.createElement("process");
+
+ } catch(Exception e) {
+ logger.severe("Failed to create initial BPEL document: "+e);
+ }
+
+ }
+
+ /**
+ * This method initializes the ESB Model.
+ */
+ protected void initializeExistingConfig() {
+
+ // Needs to establish dependency to conversation
+ }
+
+ @Override
+ public String getNotation() {
+ return(BPEL_NOTATION);
+ }
+
+ /**
+ * This method returns the source model reference.
+ *
+ * @return The source model reference
+ */
+ public ModelReference getModelReference() {
+ return(m_source);
+ }
+
+ /**
+ * Generate a key for use in accessing the service related to
+ * the supplied category and name.
+ *
+ * @param category The category
+ * @param name The service name
+ * @return The key
+ */
+ protected String getKey(String category, String name) {
+ return(category+"/"+name);
+ }
+
+ /**
+ * This method validates the ESB model and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ public void validate(ModelListener l) {
+
+ }
+
+ /**
+ * This textual contents of the model.
+ *
+ * @return The textual contents
+ */
+ public String getOriginalContents() {
+ return(m_contents);
+ }
+
+ /**
+ * This method returns the reference to the DOM
+ * representation of the BPEL process.
+ *
+ * @return The BPEL Process
+ */
+ public org.w3c.dom.Element getBPELProcess() {
+ return(m_bpelProcess);
+ }
+
+ private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.bpel.model");
+
+ private ModelReference m_source=null;
+ private org.w3c.dom.Element m_bpelProcess=null;
+ private String m_contents=null;
+
+ public class InnerModelListener implements ModelListener {
+
+ public InnerModelListener(ModelListener l) {
+ m_listener = l;
+ }
+
+ public void error(ModelIssue issue) {
+
+ /*
+ issue.getProperties().put(ModelListener.RESOLUTIONS, ModelListener.SHOW_REFERENCE_DESCRIPTION_RESOLUTION);
+ issue.getProperties().put(ModelListener.REFERENCE_MODEL, m_source);
+ issue.getProperties().put(ModelListener.REFERENCE_MODEL_START_POSITION,
+ issue.getModelObject().getSource().getStartPosition());
+ issue.getProperties().put(ModelListener.REFERENCE_MODEL_END_POSITION,
+ issue.getModelObject().getSource().getEndPosition());
+ if (issue.getModelObject().getSource().getComponentURI() != null) {
+ issue.getProperties().put(ModelListener.REFERENCE_MODEL_COMPONENT,
+ issue.getModelObject().getSource().getComponentURI());
+ }
+ */
+ ShowReferencedDescription res=new ShowReferencedDescription();
+ res.setModel(m_source);
+ res.setSourceReference(issue.getModelObject().getSource());
+
+ issue.getResolutions().add(res);
+
+ m_listener.error(issue);
+ }
+
+ public void warning(ModelIssue issue) {
+ /*
+ issue.getProperties().put(ModelListener.RESOLUTIONS, ModelListener.SHOW_REFERENCE_DESCRIPTION_RESOLUTION);
+ issue.getProperties().put(ModelListener.REFERENCE_MODEL, m_source);
+ issue.getProperties().put(ModelListener.REFERENCE_MODEL_START_POSITION,
+ issue.getModelObject().getSource().getStartPosition());
+ issue.getProperties().put(ModelListener.REFERENCE_MODEL_END_POSITION,
+ issue.getModelObject().getSource().getEndPosition());
+ if (issue.getModelObject().getSource().getComponentURI() != null) {
+ issue.getProperties().put(ModelListener.REFERENCE_MODEL_COMPONENT,
+ issue.getModelObject().getSource().getComponentURI());
+ }
+ */
+
+ ShowReferencedDescription res=new ShowReferencedDescription();
+ res.setModel(m_source);
+ res.setSourceReference(issue.getModelObject().getSource());
+
+ issue.getResolutions().add(res);
+
+ m_listener.warning(issue);
+ }
+
+ private ModelListener m_listener=null;
+ }
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/parser/BPELNotation.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/parser/BPELNotation.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/parser/BPELNotation.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,72 @@
+/*
+ * 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.tools.overlord.cdl.bpel.parser;
+
+import org.scribble.extensions.*;
+import org.scribble.model.ModelReference;
+import org.jboss.tools.overlord.cdl.bpel.model.*;
+
+/**
+ *
+ *
+ * @author gary
+ */
+(a)RegistryInfo(extension=org.scribble.parser.Notation.class)
+public class BPELNotation implements org.scribble.parser.Notation {
+
+ /**
+ * This method returns the code for the notation.
+ *
+ * @return The notation code
+ */
+ public String getCode() {
+ return(BPELLanguageModel.BPEL_NOTATION);
+ }
+
+ /**
+ * This method returns the name of the notation.
+ *
+ * @return The name
+ */
+ public String getName() {
+ return("BPEL");
+ }
+
+ /**
+ * This method returns the initial description associated
+ * with the supplied reference.
+ *
+ * @param ref The reference
+ * @return The initial description, or null if no description
+ */
+ public String getInitialDescription(ModelReference ref) {
+ StringBuffer buf=new StringBuffer();
+
+ return(buf.toString());
+ }
+
+ /**
+ * This method determines whether the Scribble editor should
+ * be used for editing the notation.
+ *
+ * @return Whether the Scribble editor should be used
+ */
+ public boolean useScribbleEditor() {
+ return(false);
+ }
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/parser/BPELParser.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/parser/BPELParser.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/src/java/org/jboss/tools/overlord/cdl/bpel/parser/BPELParser.java 2008-12-17 17:35:58 UTC (rev 452)
@@ -0,0 +1,90 @@
+/*
+ * 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.tools.overlord.cdl.bpel.parser;
+
+import java.io.InputStream;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelListener;
+import org.jboss.tools.overlord.cdl.bpel.model.*;
+import org.scribble.extensions.*;
+import org.scribble.parser.Parser;
+
+/**
+ * This BPEL implementation of the Parser interface.
+ *
+ * @author gary
+ */
+(a)RegistryInfo(extension=Parser.class,notation=BPELLanguageModel.BPEL_NOTATION)
+public class BPELParser implements Parser {
+
+ /**
+ * This method parses the source located using the supplied
+ * scribble reference, to return a model. If any
+ * errors are detected, they will be reported to the parser
+ * listener.
+ *
+ * @param ref The scribble source reference
+ * @param is The input stream
+ * @param l The model listener
+ * @return The model, or null if not found
+ */
+ public Model parse(ModelReference ref, InputStream is,
+ ModelListener l) {
+ DefaultBPELLanguageModel ret=null;
+
+ try {
+ // Transform the text representation to DOM
+ DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+ fact.setNamespaceAware(true);
+
+ DocumentBuilder builder=fact.newDocumentBuilder();
+
+ byte[] b=new byte[is.available()];
+ is.read(b);
+
+ // Need to load original input stream and then
+ // provide a second input stream, as some input stream
+ // implementations don't support 'reset' operation,
+ // and therefore this was the only way to extract the
+ // content and also provide the stream to the XML
+ // document builder.
+ java.io.ByteArrayInputStream bais=new java.io.ByteArrayInputStream(b);
+
+ org.w3c.dom.Document doc=builder.parse(bais);
+
+ // Identify the model associated with the
+ // changed resource
+ ret = new DefaultBPELLanguageModel(ref, doc.getDocumentElement(),
+ new String(b));
+
+ } catch(Exception e) {
+ logger.log(Level.SEVERE,
+ "Failed to load model", e);
+ }
+
+ return(ret);
+ }
+
+ private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.bpel.parser");
+}
17 years, 7 months
Overlord SVN: r451 - cdl/trunk/tools/plugins.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2008-12-17 12:33:54 -0500 (Wed, 17 Dec 2008)
New Revision: 451
Added:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.bpel/
Log:
Initial import.
17 years, 7 months
Overlord SVN: r450 - in cdl/trunk/tools/plugins: org.jboss.tools.overlord.cdl.validator.jbossesb/META-INF and 1 other directory.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2008-12-17 09:22:20 -0500 (Wed, 17 Dec 2008)
New Revision: 450
Modified:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/META-INF/MANIFEST.MF
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb/META-INF/MANIFEST.MF
Log:
Removed versions from dependencies on other plugins, to avoid software update issues.
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/META-INF/MANIFEST.MF
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/META-INF/MANIFEST.MF 2008-12-17 14:17:37 UTC (rev 449)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/META-INF/MANIFEST.MF 2008-12-17 14:22:20 UTC (rev 450)
@@ -15,9 +15,9 @@
org.scribble.lang.model,
org.scribble.core,
org.eclipse.jface.text,
- org.eclipse.ui.workbench.texteditor;bundle-version="3.4.0",
- org.eclipse.ui.ide;bundle-version="3.4.0",
- org.eclipse.ui.editors;bundle-version="3.4.0"
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.editors
Scribble-Extensions: org.jboss.tools.overlord.cdl.runtime.jbossesb.parser.JBossESBParser,
org.jboss.tools.overlord.cdl.runtime.jbossesb.parser.JBossESBNotation,
org.jboss.tools.overlord.cdl.runtime.jbossesb.editor.JBossESBConfigEditorManager,
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb/META-INF/MANIFEST.MF
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb/META-INF/MANIFEST.MF 2008-12-17 14:17:37 UTC (rev 449)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb/META-INF/MANIFEST.MF 2008-12-17 14:22:20 UTC (rev 450)
@@ -7,8 +7,8 @@
Bundle-Vendor: www.jboss.org
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.pi4soa.common;bundle-version="2.0.0",
- org.eclipse.core.resources;bundle-version="3.4.0",
- org.pi4soa.cdl;bundle-version="2.0.0"
+ org.pi4soa.common,
+ org.eclipse.core.resources,
+ org.pi4soa.cdl
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
17 years, 7 months
Overlord SVN: r449 - cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2008-12-17 09:17:37 -0500 (Wed, 17 Dec 2008)
New Revision: 449
Modified:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb/plugin.xml
Log:
Removed scribble extension, as no runtime rules.
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb/plugin.xml
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb/plugin.xml 2008-12-16 17:17:56 UTC (rev 448)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.validator.jbossesb/plugin.xml 2008-12-17 14:17:37 UTC (rev 449)
@@ -8,12 +8,6 @@
</annotationsManager>
</extension>
- <extension
- id="org.jboss.tools.overlord.cdl.validator.jbossesb.extension"
- name="Overlord CDL Validator JBossESB extension"
- point="org.scribble.extension">
- </extension>
-
<extension point="org.eclipse.ui.popupMenus">
<objectContribution
id="org.jboss.tools.overlord.cdl.validator.jbossesb.object.contribution"
17 years, 7 months
Overlord SVN: r448 - cdl/trunk/docs/docbook/userguide/src/main/module.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2008-12-16 12:17:56 -0500 (Tue, 16 Dec 2008)
New Revision: 448
Modified:
cdl/trunk/docs/docbook/userguide/src/main/module/conversation-validation-with-cdl.xml
Log:
Updated user guide to include 'record only' service validator configuration.
Modified: cdl/trunk/docs/docbook/userguide/src/main/module/conversation-validation-with-cdl.xml
===================================================================
--- cdl/trunk/docs/docbook/userguide/src/main/module/conversation-validation-with-cdl.xml 2008-11-18 14:09:08 UTC (rev 447)
+++ cdl/trunk/docs/docbook/userguide/src/main/module/conversation-validation-with-cdl.xml 2008-12-16 17:17:56 UTC (rev 448)
@@ -4,9 +4,7 @@
<chapter id="conversationvalidationwithcdl">
<title>Conversation Validation with CDL</title>
<section>
- <title>Conversation Validation</title>
- <section>
- <title>Overview</title>
+ <title>Overview</title>
<para>
Conversation validation is a form of runtime governance concerned with the dynamic behaviour of a system.
</para>
@@ -16,8 +14,7 @@
<para>
This section introduces the choreography description language (CDL) defined by W3C, and the <emphasis>pi4soa</emphasis> open source project which provides an editor for creating choreography descriptions, as well as utilizing these descriptions for runtime validation and execution purposes.
- </para>
- </section>
+ </para>
</section>
@@ -205,7 +202,7 @@
<para>
When the dialog box is displayed, either enter the path to the <filename>validator-config.xml</filename>
- in the text field, or use the <emphasis>Browse</emphasis> button to locate the file3
+ in the text field, or use the <emphasis>Browse</emphasis> button to locate the file.
</para>
<imageobject>
@@ -285,4 +282,66 @@
If any <emphasis>out of sequence</emphasis> or other error situations arise, these are displayed in red.
</para>
</section>
+
+ <section>
+ <title>Configuration for Conversation Recording</title>
+
+ <para>
+ As well as validating the interactions between a set of
+ services, against a pre-defined choreography description,
+ it is also possible to use the <emphasis>Service Validators</emphasis>
+ in a non-validating record mode.
+ </para>
+
+ <para>
+ This will be useful in situations where a choreography
+ description does not currently exist, and we wish to
+ use the stream of business events being sent and received
+ by each identified service (or participant type) to
+ gain an understanding of the current business process.
+ </para>
+
+ <para>
+ An example of this type of configuration, associated
+ with the TrailBlazer example, is:
+ </para>
+ <informalexample>
+ <programlisting role="XML" ><![CDATA[
+ <validator active="true" >
+ <service participantType="LoanBrokerParticipant" validate="false" >
+ <output epr="jms:queue/esb-tb-creditAgencyQueue" />
+ <input epr="jms:queue/esb-tb-creditAgencyQueue_reply" />
+ <output epr="jms:queue/esb-tb-jmsBankRequestQueue" />
+ <output epr="jms:queue/esb-tb-fileBankRequestQueue" />
+ <input epr="jms:queue/esb-tb-jmsBankResponseQueue" />
+ <output epr="jms:queue/esb-tb-customerNotifier" />
+ <input epr="jms:queue/esb-tb-fileBankResponseQueue" />
+ </service>
+ <service participantType="CreditAgencyParticipant" validate="false" >
+ <input epr="jms:queue/esb-tb-creditAgencyQueue" />
+ <output epr="jms:queue/esb-tb-creditAgencyQueue_reply" />
+ </service>
+ <service participantType="BankParticipant" validate="false" >
+ <input epr="jms:queue/esb-tb-jmsBankRequestQueue" />
+ <input epr="jms:queue/esb-tb-fileBankRequestQueue" />
+ <output epr="jms:queue/esb-tb-jmsBankResponseQueue" />
+ <output epr="jms:queue/esb-tb-fileBankResponseQueue" />
+ </service>
+ <service participantType="NotifierParticipant" validate="false" >
+ <input epr="jms:queue/esb-tb-customerNotifier" />
+ </service>
+ </validator>
+ ]]></programlisting>
+ </informalexample>
+
+ <para>
+ To define a <emphasis>Service Validator</emphasis> in record
+ only mode, the <emphasis>cdmFilePath</emphasis> attribute
+ is not specified (because no choreography description exists
+ to be validated against), and the optional <emphasis>validate</emphasis>
+ attribute should be set to <emphasis role="bold">false</emphasis> (by default
+ this attribute is <emphasis role="bold">true</emphasis>).
+ </para>
+ </section>
+
</chapter>
17 years, 7 months