Author: dennyxu
Date: 2009-05-06 03:13:47 -0400 (Wed, 06 May 2009)
New Revision: 15045
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/.classpath
workspace/Denny/bpel/org.eclipse.bpel.runtimes/.cvsignore
workspace/Denny/bpel/org.eclipse.bpel.runtimes/.project
workspace/Denny/bpel/org.eclipse.bpel.runtimes/.settings/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/.settings/org.eclipse.jdt.core.prefs
workspace/Denny/bpel/org.eclipse.bpel.runtimes/META-INF/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/META-INF/MANIFEST.MF
workspace/Denny/bpel/org.eclipse.bpel.runtimes/bin/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/build.properties
workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/ctool16/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/ctool16/new_bpelprj.gif
workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/obj16/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/obj16/bpelfacet.gif
workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/obj16/prj_bpel.gif
workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/wizban/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/wizban/newprj_bpel_wiz_banner.gif
workspace/Denny/bpel/org.eclipse.bpel.runtimes/plugin.properties
workspace/Denny/bpel/org.eclipse.bpel.runtimes/plugin.xml
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELModuleFacetConstants.java
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IRuntimesUIConstants.java
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/RuntimesPlugin.java
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELCoreFacetInstallDelegate.java
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactAdapterFactory.java
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactUtil.java
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleArtifact.java
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleDelegate.java
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleFactoryDelegate.java
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/Messages.java
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/messages.properties
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/publishers/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/publishers/GenericBPELPublisher.java
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/Messages.java
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizard.java
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizardPage1.java
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/messages.properties
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/utils/
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/utils/BPELModelUtils.java
Log:
Initial import.
Added: workspace/Denny/bpel/org.eclipse.bpel.runtimes/.classpath
===================================================================
--- workspace/Denny/bpel/org.eclipse.bpel.runtimes/.classpath (rev
0)
+++ workspace/Denny/bpel/org.eclipse.bpel.runtimes/.classpath 2009-05-06 07:13:47 UTC (rev
15045)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry exported="true" kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/Denny/bpel/org.eclipse.bpel.runtimes/.cvsignore
===================================================================
--- workspace/Denny/bpel/org.eclipse.bpel.runtimes/.cvsignore (rev
0)
+++ workspace/Denny/bpel/org.eclipse.bpel.runtimes/.cvsignore 2009-05-06 07:13:47 UTC (rev
15045)
@@ -0,0 +1 @@
+bin
Added: workspace/Denny/bpel/org.eclipse.bpel.runtimes/.project
===================================================================
--- workspace/Denny/bpel/org.eclipse.bpel.runtimes/.project (rev
0)
+++ workspace/Denny/bpel/org.eclipse.bpel.runtimes/.project 2009-05-06 07:13:47 UTC (rev
15045)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.bpel.runtimes</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:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/Denny/bpel/org.eclipse.bpel.runtimes/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/.settings/org.eclipse.jdt.core.prefs 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,7 @@
+#Mon Oct 23 11:56:22 PDT 2006
+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: workspace/Denny/bpel/org.eclipse.bpel.runtimes/META-INF/MANIFEST.MF
===================================================================
--- workspace/Denny/bpel/org.eclipse.bpel.runtimes/META-INF/MANIFEST.MF
(rev 0)
+++ workspace/Denny/bpel/org.eclipse.bpel.runtimes/META-INF/MANIFEST.MF 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,33 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.bpel.runtimes; singleton:=true
+Bundle-Version: 0.4.0
+Bundle-Activator: org.eclipse.bpel.runtimes.RuntimesPlugin
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui;bundle-version="3.3.0",
+ org.eclipse.core.runtime;bundle-version="3.3.0",
+ org.eclipse.core.resources;bundle-version="3.3.0",
+ org.eclipse.wst.server.core;bundle-version="1.0.0",
+ org.eclipse.wst.web.ui;bundle-version="1.1.0",
+ org.eclipse.wst.common.project.facet.ui;bundle-version="1.2.0",
+ org.eclipse.wst.common.modulecore;bundle-version="1.1.0",
+ org.eclipse.wst.common.frameworks;bundle-version="1.1.0",
+ org.eclipse.wst.common.project.facet.core;bundle-version="1.2.0",
+ org.eclipse.wst.common.frameworks.ui;bundle-version="1.1.0",
+ org.eclipse.jst.server.generic.core;bundle-version="1.0.0",
+ org.eclipse.jem.util;bundle-version="2.0.0",
+ org.eclipse.debug.ui;bundle-version="3.3.0",
+ org.eclipse.bpel.model;bundle-version="0.3.0",
+ org.eclipse.emf.ecore;bundle-version="2.3.0",
+ org.eclipse.wst.wsdl;bundle-version="1.1.0",
+ javax.wsdl;bundle-version="[1.4.0,1.6.0)"
+Eclipse-LazyStart: true
+Export-Package: org.eclipse.bpel.runtimes,
+ org.eclipse.bpel.runtimes.facets,
+ org.eclipse.bpel.runtimes.module,
+ org.eclipse.bpel.runtimes.publishers,
+ org.eclipse.bpel.runtimes.ui.wizards
+Bundle-ClassPath: bin
+Bundle-Vendor: %providerName
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Added: workspace/Denny/bpel/org.eclipse.bpel.runtimes/build.properties
===================================================================
--- workspace/Denny/bpel/org.eclipse.bpel.runtimes/build.properties
(rev 0)
+++ workspace/Denny/bpel/org.eclipse.bpel.runtimes/build.properties 2009-05-06 07:13:47
UTC (rev 15045)
@@ -0,0 +1,20 @@
+bin.includes = plugin.xml,\
+ META-INF/,\
+ icons/,\
+ plugin.properties,\
+ bin/,\
+ bin
+
+jars.compile.order =
+src.includes = META-INF/,\
+ icons/,\
+ plugin.properties,\
+ plugin.xml,\
+ src/,\
+ build.properties,\
+ bin/,\
+ .project,\
+ .cvsignore,\
+ .classpath
+source.bin = src/
+
Added: workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/ctool16/new_bpelprj.gif
===================================================================
(Binary files differ)
Property changes on:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/ctool16/new_bpelprj.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/obj16/bpelfacet.gif
===================================================================
(Binary files differ)
Property changes on:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/obj16/bpelfacet.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/obj16/prj_bpel.gif
===================================================================
(Binary files differ)
Property changes on:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/obj16/prj_bpel.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/wizban/newprj_bpel_wiz_banner.gif
===================================================================
(Binary files differ)
Property changes on:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/icons/wizban/newprj_bpel_wiz_banner.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/Denny/bpel/org.eclipse.bpel.runtimes/plugin.properties
===================================================================
--- workspace/Denny/bpel/org.eclipse.bpel.runtimes/plugin.properties
(rev 0)
+++ workspace/Denny/bpel/org.eclipse.bpel.runtimes/plugin.properties 2009-05-06 07:13:47
UTC (rev 15045)
@@ -0,0 +1,21 @@
+###############################################################################
+# Copyright (c) 2006 University College London.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+#
http://www.eclipse.org/legal/epl-v10.html
+#
+###############################################################################
+pluginName = Eclipse BPEL Designer Runtimes
+providerName = University College London Software Systems Engineering
+
+MODULE_TYPE_NAME=BPEL 2.0 Process
+MODULE_TYPE_DESCRIPTION=Module representing a BPEL process
+
+BPEL_CORE_FACET_LABEL=BPEL 2.0 Facet
+BPEL_CORE_FACET_DESCRIPTION=Enables modelling and deployment of BPEL processes.
+BPEL_FACET_CATEGORY_LABEL=BPEL 2.0
+BPEL_FACET_TEMPLATE_LABEL=BPEL 2.0 Project
+NEW_BPEL_CATEGORY=BPEL 2.0
+NEW_BPEL_PROJECT=BPEL Project
+NEW_BPEL_PROJECT_DESCRIPTION=Create a new BPEL project.
Added: workspace/Denny/bpel/org.eclipse.bpel.runtimes/plugin.xml
===================================================================
--- workspace/Denny/bpel/org.eclipse.bpel.runtimes/plugin.xml (rev
0)
+++ workspace/Denny/bpel/org.eclipse.bpel.runtimes/plugin.xml 2009-05-06 07:13:47 UTC (rev
15045)
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+
+<!--=========================================================================-->
+<!-- BPEL Designer Runtime Extension Point -->
+<!-- -->
+<!-- Copyright (c) 2006 University College London. -->
+<!-- All rights reserved. This program and the accompanying materials -->
+<!-- are made available under the terms of the Eclipse Public License v1.0 -->
+<!-- which accompanies this distribution, and is available at -->
+<!--
http://www.eclipse.org/legal/epl-v10.html -->
+<!-- -->
+<!--=========================================================================-->
+
+<plugin>
+
+<!--=========================================================================-->
+<!-- New BPEL Project Wizard -->
+<!--=========================================================================-->
+
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <wizard
+ name="%NEW_BPEL_PROJECT"
+ icon="icons/ctool16/new_bpelprj.gif"
+ category="org.eclipse.bpel.wizards"
+ project="true"
+ class="org.eclipse.bpel.runtimes.ui.wizards.NewBPELProjectWizard"
+ id="org.eclipse.bpel.runtimes.wizards.newBPELProject">
+ <description>%NEW_BPEL_PROJECT_DESCRIPTION</description>
+ </wizard>
+ </extension>
+
+<!--=========================================================================-->
+<!-- BPEL ModuleType -->
+<!--=========================================================================-->
+
+ <extension
+ id="bpel.module"
+ name="%MODULE_TYPE_NAME"
+ point="org.eclipse.wst.server.core.moduleTypes">
+ </extension>
+
+<!-- The following is needed to make icons for deployable modules occur in -->
+<!-- the Add and Remove Projects wizard -->
+
+ <extension point="org.eclipse.wst.server.ui.serverImages">
+ <image
+ id="org.eclipse.bpel.runtimes.bpel.module"
+ typeIds="bpel.module"
+ icon="icons/obj16/bpelfacet.gif"/>
+ </extension>
+
+<!--=========================================================================-->
+<!-- BPEL Facet -->
+<!--=========================================================================-->
+
+ <extension point="org.eclipse.wst.common.project.facet.core.facets">
+
+ <project-facet id="bpel.facet.core">
+ <label>%BPEL_CORE_FACET_LABEL</label>
+ <description>%BPEL_CORE_FACET_DESCRIPTION</description>
+ </project-facet>
+
+ <project-facet-version facet="bpel.facet.core"
version="2.0">
+ <action type="install">
+ <delegate
class="org.eclipse.bpel.runtimes.facets.BPELCoreFacetInstallDelegate"/>
+ </action>
+ </project-facet-version>
+
+ <category id="bpel.category">
+ <label>%BPEL_FACET_CATEGORY_LABEL</label>
+ <description>%bpelCoreFacetDescription</description>
+ </category>
+
+ <template id="template.bpel.core">
+ <label>%BPEL_FACET_TEMPLATE_LABEL</label>
+ <fixed
+ facet="bpel.facet.core">
+ </fixed>
+<!-- <fixed facet="bpel.facet.core"/>-->
+ </template>
+
+ </extension>
+
+<!--=========================================================================-->
+<!-- BPEL Facet Image -->
+<!--=========================================================================-->
+
+ <extension point="org.eclipse.wst.common.project.facet.ui.images">
+ <image facet="bpel.facet.core"
path="icons/obj16/bpelfacet.gif"/>
+ </extension>
+
+<!--=========================================================================-->
+<!-- BPEL Module Factory -->
+<!--=========================================================================-->
+
+ <extension
+ point="org.eclipse.wst.server.core.moduleFactories">
+ <moduleFactory
+ projects="true"
+ class="org.eclipse.bpel.runtimes.module.BPELModuleFactoryDelegate"
+ id="org.eclipse.bpel.runtimes.module.moduleFactory">
+ <moduleType
+ versions="1.1, 2.0"
+ types="bpel.module">
+ </moduleType>
+ </moduleFactory>
+ </extension>
+
+<!--=========================================================================-->
+<!-- BPEL Module ArtifactAdapters -->
+<!--=========================================================================-->
+
+ <extension point="org.eclipse.wst.server.core.moduleArtifactAdapters">
+ <moduleArtifactAdapter
+ id="org.eclipse.bpel.runtimes.module.artifactAdapter1"
+
class="org.eclipse.bpel.runtimes.module.BPELDeployableArtifactAdapterFactory">
+ <enablement>
+ <with variable="selection">
+ <adapt type="org.eclipse.core.resources.IProject"/>
+ </with>
+ </enablement>
+ </moduleArtifactAdapter>
+ <moduleArtifactAdapter
+ id="org.eclipse.bpel.runtimes.module.artifactAdapter2"
+
class="org.eclipse.bpel.runtimes.module.BPELDeployableArtifactAdapterFactory">
+ <enablement>
+ <with variable="selection">
+ <adapt type="org.eclipse.core.resources.IFile"/>
+ </with>
+ </enablement>
+ </moduleArtifactAdapter>
+ </extension>
+
+<!--=========================================================================-->
+<!-- BPEL Runtime Adapters -->
+<!--=========================================================================-->
+
+ <extension point="org.eclipse.core.runtime.adapters">
+ <factory
+ class="org.eclipse.bpel.runtimes.module.BPELDeployableArtifactAdapterFactory"
+ adaptableType="org.eclipse.core.resources.IProject">
+ <adapter type="org.eclipse.debug.ui.actions.ILaunchable"/>
+ </factory>
+ <factory
+
class="org.eclipse.bpel.runtimes.module.BPELDeployableArtifactAdapterFactory"
+ adaptableType="org.eclipse.core.resources.IFile">
+ <adapter type="org.eclipse.debug.ui.actions.ILaunchable"/>
+ </factory>
+ </extension>
+
+<!--=========================================================================-->
+<!-- TO MAKE PROCESSES ACTUALLY LAUNCHABLE VIA RUN ON SERVER -->
+<!-- -->
+<!-- Implement org.eclipse.wst.server.core.clients in order to specify the -->
+<!-- the client app to be used for launching. -->
+<!-- -->
+<!-- Implement org.eclipse.wst.server.core.launchableAdapters. Might have to -->
+<!-- do this in server-specific way or maybe can resuse some generic server -->
+<!-- framework stuff or maybe can come up with some interface that would -->
+<!-- allow us to implement in runtimes plug-in. -->
+<!-- -->
+<!-- N.B. Launching here means launching a Web service. Hence, can do this -->
+<!-- via the corresponding WTP feature with no code at all from our end. -->
+<!-- -->
+<!-- -->
+<!-- -->
+<!--=========================================================================-->
+
+
+</plugin>
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELModuleFacetConstants.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELModuleFacetConstants.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELModuleFacetConstants.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes;
+
+/**
+ *
+ *
+ * @author Bruno Wassermann, written Jun 29, 2006
+ */
+public interface IBPELModuleFacetConstants {
+
+ // module types
+ public final static String BPEL20_MODULE_TYPE = "bpel.module"; //$NON-NLS-1$
+
+ // module type versions
+ public final static String BPEL11_MODULE_VERSION = "1.1"; // $NON-NLS-1$
+ public final static String BPEL20_MODULE_VERSION = "2.0"; // $NON-NLS-1$
+
+ // facet template
+ public final static String BPEL20_FACET_TEMPLATE = "template.bpel.core";
//$NON-NLS-1$
+
+ // facet
+ public final static String BPEL20_PROJECT_FACET = "bpel.facet.core";
//$NON-NLS-1$
+
+ // bpel file extension
+ public final static String BPEL_FILE_EXTENSION = "bpel"; //$NON-NLS-1$
+ public final static String DOT_BPEL_FILE_EXTENSION = "." +
BPEL_FILE_EXTENSION; //$NON-NLS-1$
+}
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IRuntimesUIConstants.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IRuntimesUIConstants.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IRuntimesUIConstants.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes;
+
+/**
+ * A bunch of constants for use by the UI elements of the runtimes plug-in.
+ *
+ * @author Bruno Wassermann, written Jun 30, 2006
+ */
+public interface IRuntimesUIConstants {
+
+ /*
+ * Icons
+ */
+
+ // Icons path
+ public final String ICON_PATH = "icons/"; //$NON-NLS-1$
+
+ // Wizard banner
+ public final String ICON_NEWPRJ_WIZARD_BANNER =
"wizban/newprj_bpel_wiz_banner.gif"; //$NON-NLS-1$
+
+ // Facet icons
+ public final String ICON_BPEL_FACET = "obj/bpelfacet.gif"; //$NON-NLS-1$
+
+ // Workbench icons
+ public final String ICON_BPEL_PRJ = "obj16/prj_bpel.gif"; //$NON-NLS-1$
+
+ // New icons
+ public final String ICON_BPEL_NEW_PRJ = "ctool16/new_bpelprj.gif";
//$NON-NLS-1$
+
+ /*
+ * End of icons
+ */
+
+}
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/RuntimesPlugin.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/RuntimesPlugin.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/RuntimesPlugin.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class RuntimesPlugin extends AbstractUIPlugin {
+
+ public static final String PLUGIN_ID = "org.eclipse.bpel.runtimes";
//$NON-NLS-1$
+
+ //The shared instance.
+ private static RuntimesPlugin plugin;
+
+ private boolean imagesInitialized = false;
+
+ /**
+ * The constructor.
+ */
+ public RuntimesPlugin() {
+ super();
+ plugin = this;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ *
+ * @return the shared instance.
+ */
+ public static RuntimesPlugin getPlugin() {
+ return plugin;
+ }
+
+ @Override
+ public ImageRegistry getImageRegistry() {
+ ImageRegistry result = super.getImageRegistry();
+ initialize();
+ return result;
+ }
+
+ /**
+ * Returns the image descriptor for the given image ID.
+ * Returns null if there is no such image.
+ */
+ public ImageDescriptor getImageDescriptor(String id) {
+ return getImageRegistry().getDescriptor(id);
+ }
+
+ public Image getImage(String id) {
+ return getImageRegistry().get(id);
+ }
+
+ /**
+ * Creates an image descriptor and places it in the image registry.
+ */
+ private void createImageDescriptor(String id, URL baseURL) {
+ URL url = null;
+ try {
+ url = new URL(baseURL, IRuntimesUIConstants.ICON_PATH + id);
+ } catch (MalformedURLException e) {
+ RuntimesPlugin.log(e);
+ }
+ ImageDescriptor desc = ImageDescriptor.createFromURL(url);
+ getImageRegistry().put(id, desc);
+ }
+
+ protected void initialize() {
+ if (!imagesInitialized) {
+ imagesInitialized = true;
+ initializeImages();
+ }
+ }
+
+ /**
+ * Initializes the table of images used in this plugin.
+ */
+ private void initializeImages() {
+ URL baseURL = getBundle().getEntry("/"); //$NON-NLS-1$
+
+ // TODO make sure you initialize all required icons here
+ createImageDescriptor(IRuntimesUIConstants.ICON_NEWPRJ_WIZARD_BANNER, baseURL);
+ createImageDescriptor(IRuntimesUIConstants.ICON_BPEL_NEW_PRJ, baseURL);
+ createImageDescriptor(IRuntimesUIConstants.ICON_BPEL_PRJ, baseURL);
+ }
+
+ /**
+ * Utility methods for logging exceptions.
+ */
+ public static void log(Exception e, int severity) {
+ IStatus status = null;
+ if (e instanceof CoreException) {
+ status = ((CoreException)e).getStatus();
+ } else {
+ String m = e.getMessage();
+ status = new Status(severity, PLUGIN_ID, 0, m==null? "<no message>" :
m, e); //$NON-NLS-1$
+ }
+ System.out.println(e.getClass().getName()+": "+status); //$NON-NLS-1$
+ RuntimesPlugin.getPlugin().getLog().log(status);
+ }
+
+ public static void log(Exception e) {
+ log(e, IStatus.ERROR);
+ }
+}
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELCoreFacetInstallDelegate.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELCoreFacetInstallDelegate.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELCoreFacetInstallDelegate.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes.facets;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.bpel.runtimes.IBPELModuleFacetConstants;
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
+import
org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.internal.datamodel.DataModelImpl;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+/**
+ * BPEL Facet implementation of <code>IDelegate</code>.
+ * <p>
+ * Note: Must not call IFacetedProject.modify() to install facet as this is
+ * a prohibited operation from a delegate and will throw
<code>CoreException</code>.
+ *
+ * @author Bruno Wassermann, written Jun 7, 2006
+ */
+public class BPELCoreFacetInstallDelegate implements IDelegate {
+
+ /**
+ * At the moment, there does not appear to be any opportunity to do some
+ * common setup of stuff here (e.g., set up a WEB-INF folder, etc.).
+ * Maybe some common requirements will become apparent at some later stage.
+ */
+
+ /** (non-Javadoc)
+ * @see
org.eclipse.wst.common.project.facet.core.IDelegate#execute(org.eclipse.core.resources.IProject,
org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, java.lang.Object,
org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @SuppressWarnings("nls")
+ public void execute(IProject proj,
+ IProjectFacetVersion ver,
+ Object obj,
+ IProgressMonitor progMon)
+ throws CoreException
+ {
+ progMon.beginTask( "Configuring ...", 3 ); //$NON-NLS-1$
+
+ FacetInstallDataModelProvider dmProvider = new FacetInstallDataModelProvider();
+ IDataModel dataModel = new DataModelImpl (dmProvider);
+ //WtpUtils.addNatures(proj);
+
+ progMon.worked(1);
+ try
+ {
+
+ dataModel.setProperty(
+ IFacetDataModelProperties.FACET_ID,
+ IBPELModuleFacetConstants.BPEL20_PROJECT_FACET);
+ dataModel.setProperty(
+ IFacetDataModelProperties.FACET_PROJECT_NAME,
+ proj.getName());
+ dataModel.setProperty(
+ IFacetDataModelProperties.FACET_VERSION,
+ ver);
+ dataModel.setProperty(
+ IFacetDataModelProperties.FACET_VERSION_STR,
+ ver.getVersionString());
+ dataModel.setProperty(IFacetDataModelProperties.SHOULD_EXECUTE, Boolean.TRUE);
+
+ progMon.worked(1);
+
+
+ // Add the builder to the project description
+ IProjectDescription description = proj.getDescription();
+
+ // Our builder name
+ String builderName = "org.eclipse.bpel.validator.builder";
//$NON-NLS-1$
+
+ // Install the builder (validator)
+
+ ICommand buildCommand = description.newCommand();
+
+ // We only support 1 argument now, its "debug"
+ Map<String,String> args = new HashMap<String,String>();
+ args.put("debug","false");
+ buildCommand.setArguments(args);
+
+ buildCommand.setBuilderName( builderName );
+
+
+ ICommand [] commands = description.getBuildSpec();
+
+ if (commands == null) {
+ description.setBuildSpec( new ICommand[] { buildCommand } );
+ proj.setDescription(description, IResource.KEEP_HISTORY, progMon);
+
+ } else {
+
+ boolean bFound = false;
+ for(ICommand c : commands) {
+ if (builderName.equals(c.getBuilderName())) {
+ bFound = true;
+ break;
+ }
+ }
+
+ // not found
+ if (bFound == false) {
+ int i = commands.length;
+ ICommand [] newCommands = new ICommand [ i + 1 ];
+ System.arraycopy(commands, 0, newCommands, 0, i);
+ newCommands [ i ] = buildCommand;
+ description.setBuildSpec( newCommands );
+ proj.setDescription(description, IResource.KEEP_HISTORY, progMon);
+ }
+ }
+
+ progMon.worked( 1 );
+ }
+ finally
+ {
+ progMon.done();
+ }
+ }
+
+}
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactAdapterFactory.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactAdapterFactory.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactAdapterFactory.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes.module;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.debug.ui.actions.ILaunchable;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate;
+
+/**
+ * Preliminary implementation of <code>ModuleArtifactAdapterDelegate</code>
+ * and <code>I</code>for BPEL modules.
+ *
+ * @author Bruno Wassermann, written Aug 14, 2006
+ */
+public class BPELDeployableArtifactAdapterFactory extends
+ ModuleArtifactAdapterDelegate implements IAdapterFactory
+{
+
+ /**
+ *
+ */
+ public BPELDeployableArtifactAdapterFactory() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate#getModuleArtifact(java.lang.Object)
+ */
+ @Override
+ public IModuleArtifact getModuleArtifact(Object obj) {
+ return BPELDeployableArtifactUtil.getModuleObject(obj);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object,
java.lang.Class)
+ */
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+ */
+ public Class[] getAdapterList() {
+
+ // TODO replace ILaunchable with interface of BPEL module artifacts once available
+ return new Class[]{ILaunchable.class};
+ }
+
+}
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactUtil.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactUtil.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactUtil.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes.module;
+
+import org.eclipse.bpel.runtimes.IBPELModuleFacetConstants;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jem.util.logger.proxy.Logger;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.ServerUtil;
+
+/**
+ * Utility to adapt an object (in this case an <code>IProject</code< or an
+ * <code>IFile</code>) toa <code>BPELModuleArtifact</code>.
+ *
+ * @author Bruno Wassermann, written Aug 14, 2006
+ */
+public class BPELDeployableArtifactUtil {
+
+ public BPELDeployableArtifactUtil() {
+ super();
+ }
+
+ /**
+ * Adapt an object to an <code>IModuleArtifact</code>
+ *
+ * @param obj
+ * @return <code>IModuleArtifact</code>
+ */
+ public static IModuleArtifact getModuleObject(Object obj) {
+ if (obj instanceof IProject) {
+ return getModuleObject((IProject) obj);
+ }
+
+ if (obj instanceof IFile) {
+ return getModuleObject((IFile) obj);
+ }
+
+ return null;
+ }
+
+ protected static IModuleArtifact getModuleObject(IProject project) {
+ return null;
+ }
+
+ protected static IModuleArtifact getModuleObject(IFile file) {
+ // TODO this is not really how you should be using BPELModuleDelegate
+ BPELModuleDelegate moduleDelegate = new BPELModuleDelegate(file.getProject(), file);
+ IStatus fileStatus = moduleDelegate.validate();
+
+ if (IStatus.OK != fileStatus.getCode()) return null; // not a valid BPEL file
+
+ IModule[] modules =
ServerUtil.getModules(IBPELModuleFacetConstants.BPEL20_MODULE_TYPE);
+
+ for (int i=0; i<modules.length; i++) {
+
+ if (modules[i].getProject().equals(file.getProject())
+ && modules[i].getName().equals(file.getName()))
+ {
+ return new BPELModuleArtifact(modules[i], file);
+ }
+ }
+ return null;
+ }
+
+ /*
+ * TODO in case fixed BPEL facet is not set anymore, may be able to set
+ * the facet programmatically as a fix for the time being
+ *
+ * TODO figure out new plugin.xml syntax for fixed facet from dynamic web
+ * project
+ *
+ * TODO this is a duplicate method (BPELModuleFactory.getVersion()).
+ * Replace this with a utility method somewhere.
+ */
+ private static String getVersion(IProject project) {
+ IFacetedProject facetedProject = null;
+ try {
+ facetedProject = ProjectFacetsManager.create(project);
+ if (facetedProject != null
+ &&
ProjectFacetsManager.isProjectFacetDefined(IBPELModuleFacetConstants.BPEL20_PROJECT_FACET))
+ {
+ IProjectFacet projectFacet =
ProjectFacetsManager.getProjectFacet(IBPELModuleFacetConstants.BPEL20_PROJECT_FACET);
+
+ return facetedProject.getInstalledVersion(projectFacet).getVersionString();
+ }
+ } catch (Exception e) {
+ Logger.getLogger().write(e);
+ }
+ return "2.0"; //$NON-NLS-1$
+ }
+}
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleArtifact.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleArtifact.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleArtifact.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes.module;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IModuleArtifact;
+
+/**
+ * Representing a simple BPEL module as an <code>IModuleArtifact</code>. Not
+ * sure at this stage what is needed to actually launch deployed BPEL process,
+ * so this implementation is going to change considerably in the near future.
+ *
+ * @author Bruno Wassermann, written Aug 14, 2006
+ */
+public class BPELModuleArtifact implements IModuleArtifact {
+
+ private IModule module;
+ private IFile file;
+
+ /**
+ * Constructor accepting module and corresponding bpel file.
+ *
+ * @param module <code>IModule</code>
+ * @param file <code>IFile</code> the corresponding bpel file
+ */
+ public BPELModuleArtifact(IModule module, IFile file) {
+ super();
+ this.module = module;
+ this.file = file;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.server.core.IModuleArtifact#getModule()
+ */
+ public IModule getModule() {
+ return module;
+ }
+
+ public IFile getFile() {
+ return file;
+ }
+
+ /**
+ * @see Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "BPELModuleArtifact [module=" + module + "]";
+ }
+
+}
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleDelegate.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleDelegate.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleDelegate.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,233 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes.module;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpel.runtimes.IBPELModuleFacetConstants;
+import org.eclipse.bpel.runtimes.RuntimesPlugin;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.model.IModuleFile;
+import org.eclipse.wst.server.core.model.IModuleFolder;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.ModuleDelegate;
+import org.eclipse.wst.server.core.util.ModuleFile;
+import org.eclipse.wst.server.core.util.ModuleFolder;
+import org.eclipse.wst.server.core.util.ProjectModule;
+
+/**
+ * A <code>ModuleDelegate</code> implementation for BPEL modules making use
+ * of <code>ProjectModule</code> in order to link a BPEL module to the
project
+ * it is contained in. Nevertheless, at the moment, a BPEL module is considered
+ * to be a single BPEL file and not to consist of other resources in the same
+ * project.
+ *
+ * @author Bruno Wassermann, written 14 Jul 2006
+ */
+public class BPELModuleDelegate extends ProjectModule {
+
+ private IFile file;
+
+ /**
+ * Constructor initialising module delegate with the folder in which the
+ * BPEL module is contained and with the file representing the actual
+ * BPEL process/module.
+ *
+ * @param project <code>IProject</code> containing BPEL module (but is not
+ * the same as BPEL module)
+ * @param file <code>IFile</code> representing the actual BPEL
process/module
+ */
+ public BPELModuleDelegate(IProject project, IFile file) {
+ super(project);
+ this.file = file;
+ }
+
+ /**
+ * Overriding implementation in <code>ProjectModule</code> in order to
return
+ * actual module type id.
+ *
+ * @see ProjectModule#getId()
+ * @return <code>String</code> representing module type id
+ */
+ @Override
+ public String getId() {
+ return IBPELModuleFacetConstants.BPEL20_MODULE_TYPE;
+ }
+
+ /**
+ * Returns the name of this module; to be precise the name of the file this
+ * module represents.
+ *
+ * @see ProjectModule#getName()
+ * @return <code>String</code>
+ */
+ @Override
+ public String getName() {
+ return file.getName();
+ }
+
+ /**
+ * Returns the file represented by this module.
+ *
+ * @return <code>IFile</code>
+ */
+ public IFile getFile() {
+ return file;
+ }
+
+ /**
+ * Returns whether or not this module exists (may have been removed).
+ *
+ * @see ProjectModule#exists()
+ * @return <code>true</code> if the module exists,
<code>false</code> otherwise
+ */
+ @Override
+ public boolean exists() {
+ return file.exists();
+ }
+
+ /**
+ * Returns the module resources that should be published to the server.
+ * The implementation in <code>ProjectModule</code> assumes that the entire
+ * project should be published to the server.
+ * <p>
+ * For now we will restrict this to be just the selected BPEL file itself
+ * that is represented by this module.
+ * <p>
+ * TODO will have to reconsider implementation to allow for all BPEL files
+ * in a project to be published
+ * <p>
+ * TODO would be interesting to consider publishing any Web services present
+ * in the project that BPEL processes may require as part of automated
+ * deployment. For now, will suffice, though, to notify user of missing Web
+ * service and ask user to deploy WS first.
+ *
+ * @see ModuleDelegate#members()
+ * @return <code>IModuleResource</code>[]
+ */
+ @Override
+ public IModuleResource[] members() {
+ IProject project = this.getProject();
+ IModuleResource[] result = {new ModuleFile(file, file.getName(), Path.EMPTY)};
+
+ final List<IModuleResource> files = new ArrayList<IModuleResource>();
+ IResourceVisitor visitor = new IResourceVisitor() {
+ public boolean visit(org.eclipse.core.resources.IResource resource) throws
org.eclipse.core.runtime.CoreException {
+ IPath path = resource.getProjectRelativePath();
+ path = path.removeLastSegments(1);
+ if (resource.getType() == IResource.FILE) {
+ if(!isFileOfInterest((IFile)resource)){
+ return true;
+ }
+ IModuleFile mf = new ModuleFile((IFile)resource, resource.getName(), path);
+ files.add(mf);
+ }
+ else if( resource.getType() == IResource.FOLDER){
+ if( resource.getName().startsWith(".")){
+ return false;
+ }
+ IModuleFolder mf = new ModuleFolder((IFolder)resource, resource.getName(), path);
+ files.add(mf);
+ }
+ return true;
+ }
+ };
+ try {
+ project.accept(visitor);
+ }
+ catch (CoreException e) {
+ e.printStackTrace();
+ }
+
+ return result;
+ }
+
+ protected boolean isFileOfInterest(IFile file) {
+
+ String fileExtension = file.getFileExtension();
+
+ if (fileExtension.equalsIgnoreCase("bpel"))
+ return true;
+ if (fileExtension.equalsIgnoreCase("wsdl"))
+ return true;
+ if (fileExtension.equalsIgnoreCase("xsd"))
+ return true;
+ if (fileExtension.equalsIgnoreCase("soap"))
+ return true;
+ if (fileExtension.equalsIgnoreCase("xml"))
+ return true;
+ else
+ return false;
+ }
+
+ /**
+ * Overriding superclass implementation. Checks whether the
<code>IFile</code>
+ * representing the BPEL module has a bpel file extension (weak validation).
+ *
+ * @see ModuleDelegate#validate()
+ * <p>
+ * TODO should also allow for BPEL projects being valid modules
+ */
+ @Override
+ public IStatus validate() {
+ super.validate();
+ if (IBPELModuleFacetConstants.DOT_BPEL_FILE_EXTENSION.equalsIgnoreCase(
+ file.getFileExtension()))
+ {
+ return Status.OK_STATUS;
+ }
+ return new Status(
+ IStatus.ERROR,
+ RuntimesPlugin.PLUGIN_ID,
+ 0,
+ Messages.InvalidFileExtension,
+ null);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) return false;
+
+ if (this == obj) return true;
+
+ if (!(obj instanceof BPELModuleDelegate)) return false;
+
+ BPELModuleDelegate bmd = (BPELModuleDelegate) obj;
+
+ if (this.getProject() != null
+ && this.getProject().exists()
+ && !this.getProject().equals(bmd.getProject()))
+ {
+ return false;
+ }
+
+// if (file != null
+// && file.exists()
+// && !(file.getFullPath().equals(bmd.getFile().getFullPath())))
+// {
+// return false;
+// }
+
+ if (getId() != null && !getId().equals(bmd.getId())) return false;
+
+ return true;
+ }
+}
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleFactoryDelegate.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleFactoryDelegate.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleFactoryDelegate.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,243 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes.module;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.bpel.runtimes.IBPELModuleFacetConstants;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jem.util.logger.proxy.Logger;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.internal.FacetedProject;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.internal.Trace;
+import org.eclipse.wst.server.core.model.ModuleDelegate;
+import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
+
+/**
+ * <code>ModuleFactoryDelegate</code> implementation for discovering BPEL
modules
+ * (for now, just BPEL files not entire projects).
+ *
+ * @author Bruno Wassermann, written Aug 4, 2006
+ */
+public class BPELModuleFactoryDelegate extends ModuleFactoryDelegate {
+
+ /*
+ * TODO Idea for resolving bug 5. Maybe can register a standard resource
+ * listener on the workbench in initialize() (override, call super() and then
+ * register) and get any events/deltas. Then can decide whether something
+ * we are interested in happened and do ModuleFactory.clearModuleCache()
+ * (see ProjectModuleFactoryDelegate.handleGlobalProjectChange()).
+ * This would be a bit of a hack, but would fix the bug until
+ * ResourceManager does not just notify us of project changes, but also
+ * considers file resources.
+ */
+
+
+ /**
+ * Stores a mapping from <code>IModules</code> to
<code>BPELModuleDelegates</code>
+ */
+ protected Map moduleDelegates = new HashMap(5);
+
+ /**
+ * List of all BPEL modules that exist in workspace.
+ */
+ private List modules;
+
+ public BPELModuleFactoryDelegate() {
+ // 0-arg constructor used by when setting this in ModuleFactory
+ }
+
+
+ /**
+ * Create a module from given information and invoke creation of
+ * corresponding module delegate.
+ *
+ * @param project <code>IProject</code> the module belongs to
+ * @param file <code>IFile</code> representing the module (or is it vice
versa?)
+ * @return
+ */
+ protected IModule createModule(IProject project, IFile file) {
+ try {
+// IVirtualComponent comp = ComponentCore.createComponent(project);
+ return createModuleDelegates(project, file);
+ } catch (Exception e) {
+ Logger.getLogger().write(e);
+ }
+ return null;
+ }
+
+ protected IModule createModuleDelegates(IProject project, IFile file) {
+ try {
+ IModule module = createModule(
+ project.getName(),
+ project.getName(),
+ IBPELModuleFacetConstants.BPEL20_MODULE_TYPE,
+ getVersion(project),
+ project);
+ BPELModuleDelegate moduleDelegate = new BPELModuleDelegate(project, file);
+ moduleDelegates.put(module, moduleDelegate);
+ return module;
+ } catch (Exception e) {
+ Logger.getLogger().write(e);
+ }
+ return null;
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.wst.server.core.model.ModuleFactoryDelegate#getModuleDelegate(org.eclipse.wst.server.core.IModule)
+ */
+ @Override
+ public ModuleDelegate getModuleDelegate(IModule module) {
+ return (ModuleDelegate) moduleDelegates.get(module);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.server.core.model.ModuleFactoryDelegate#getModules()
+ */
+ @Override
+ public IModule[] getModules() {
+ cacheModules();
+
+ IModule[] modules2 = new IModule[modules.size()];
+ modules.toArray(modules2);
+ return modules2;
+ }
+
+ protected void clearCache() {
+ moduleDelegates = new HashMap(5);
+ }
+
+ /**
+ * Discovers any BPEL modules and stores them in a <code>List</code> in
case
+ * <code>getModules</code> is called for the first time in this session.
+ * This is to make sure that we don't miss any pre-existing modules.
+ * <p>
+ * PUBLIC FOR TESTING ONLY
+ */
+ public final void cacheModules() {
+// if (modules != null) {
+// return; // has already been initialised with pre-existing modules
+// }
+
+ try {
+ clearCache();
+ IProject[] projects2 = getWorkspaceRoot().getProjects();
+ int size = projects2.length;
+ modules = new ArrayList();
+
+ for (int i = 0; i < size; i++) {
+ IFacetedProject fp = ProjectFacetsManager.create(projects2[i]);
+ IProjectFacet bpelFacet =
ProjectFacetsManager.getProjectFacet(IBPELModuleFacetConstants.BPEL20_PROJECT_FACET);
+ if(fp.hasProjectFacet(bpelFacet)){
+ final List bpelFileResources = new ArrayList();
+ projects2[i].accept(new IResourceVisitor(){
+
+ public boolean visit(IResource resource) throws CoreException {
+ switch (resource.getType()) {
+ case IResource.FOLDER:
+ return true;
+
+ case IResource.FILE:
+ if (isBPELFile((IFile) resource)) {
+ bpelFileResources.add(resource);
+ }
+ /* falls through */
+
+ default:
+ return true;
+ }
+ }
+ });
+
+ for (Iterator iter = bpelFileResources.iterator(); iter.hasNext(); ) {
+ IModule module = createModule(
+ projects2[i],
+ (IFile) iter.next());
+
+ if (module != null) {
+ modules.add(module);
+ break;
+ }
+
+ }
+ }
+
+ }
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Error caching modules", e);
+ }
+ }
+
+ /**
+ * Return the workspace root.
+ *
+ * @return the workspace root
+ */
+ private static IWorkspaceRoot getWorkspaceRoot() {
+ return ResourcesPlugin.getWorkspace().getRoot();
+ }
+
+ private boolean isBPELFile(IFile file) {
+ if (IBPELModuleFacetConstants.BPEL_FILE_EXTENSION.equals(file.getFileExtension())) {
+ return true;
+ }
+ return false;
+ }
+
+ /*
+ * TODO in case fixed BPEL facet is not set anymore, may be able to set
+ * the facet programmatically as a fix for the time being
+ */
+ @SuppressWarnings("nls")
+ private String getVersion(IProject project) {
+ IFacetedProject facetedProject = null;
+ try {
+ facetedProject = ProjectFacetsManager.create(project);
+ if (facetedProject != null
+ &&
ProjectFacetsManager.isProjectFacetDefined(IBPELModuleFacetConstants.BPEL20_PROJECT_FACET))
+ {
+ IProjectFacet projectFacet =
ProjectFacetsManager.getProjectFacet(IBPELModuleFacetConstants.BPEL20_PROJECT_FACET);
+ IProjectFacetVersion pfv = facetedProject.getInstalledVersion(projectFacet);
+ if (pfv != null) {
+ pfv.getVersionString();
+ }
+ return "2.0";
+ }
+ } catch (Exception e) {
+ Logger.getLogger().write(e);
+ }
+ return "2.0"; //$NON-NLS-1$
+ }
+
+ /**
+ * FOR TESTING PURPOSES ONLY
+ */
+ public List getCachedModules() {
+ return modules;
+ }
+
+}
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/Messages.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/Messages.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/Messages.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes.module;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Module-related messages.
+ *
+ * @author Bruno Wassermann, written 17 Jul 2006
+ */
+public class Messages extends NLS {
+
+ private static final String BUNDLE_NAME =
"org.eclipse.bpel.runtimes.module.messages"; //$NON-NLS-1$
+
+ private Messages() {
+ }
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ // module validation
+ public static String InvalidFileExtension;
+}
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/messages.properties
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/messages.properties
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/messages.properties 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1 @@
+InvalidFileExtension=BPEL module file resource must end with bpel file extension.
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/publishers/GenericBPELPublisher.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/publishers/GenericBPELPublisher.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/publishers/GenericBPELPublisher.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes.publishers;
+
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jst.server.generic.core.internal.GenericPublisher;
+import org.eclipse.jst.server.generic.core.internal.GenericServer;
+import org.eclipse.jst.server.generic.servertype.definition.Port;
+import org.eclipse.wst.server.core.IModuleArtifact;
+
+/**
+ * An abstract base class offering some utility methods facilitating the process
+ * of deploying a BPEL process onto a runtime and indicating a publisher of
+ * BPEL processes. This extends the generic server
+ * framework. Implementers of the <code>genericpublishers</code> extension
point
+ * wishing to publish BPEL processes onto some runtime, may find it convenient
+ * to sub-class this class.
+ * <p>
+ * The minimum requirement on sub-classes is to provide an implementation of
+ * <code>GenericPublisher{@link #publish(IModuleArtifact[],
IProgressMonitor)}</code>,
+ * <code>GenericPublisher{@link #unpublish(IProgressMonitor)}</code> and of
+ * <code></code>
+ * <p>
+ * Clients should not instantiate this class or its sub-classes as they will be
+ * instantiated by the WTP server framework. Clients can make use of any
+ * convenience methods contained in this class (all methods defined directly
+ * on <code>GenericBPELPublisher</code>).
+ *
+ *
+ * @author Bruno Wassermann, written Jun 8, 2006
+ */
+public abstract class GenericBPELPublisher extends GenericPublisher {
+
+// TODO add utility methods that may be useful to concrete implementations
+
+ /**
+ * Displays engine-specific validation warnings and errors in the BPEL
+ * Designer.
+ * <p>
+ * Sub-classes can call this method to provide information
+ * about any problems detected during deployment.
+ */
+ protected final void submitValidationMarkers() {
+ // TODO decide on signature/arguments
+ }
+
+ /**
+ * Provides access to the relevant project in the workspace in order to
+ * store a local copy of a generated deployment archive
+ *
+ * @param deployArchive
+ * @param path should probably be relative from project root and if null
+ * will save archive in project root
+ */
+ protected void storeDeploymentArchive(IFile deployArchive, IPath path) {
+ // TODO figure out whether this is really useful
+ // TODO figure out the signature (should it be a file, what's the best
+ // way to allow specifying an additional path?) - maybe look at some
+ // of the methods in the WTP tutorial.
+ }
+
+ /**
+ * Returns the host part of the server on which module is to be published.
+ * For example, 'localhost'.
+ *
+ * @return <code>String</code> representing host part of server on which
+ * module is to be published. Will return <code>null</code>, if called
+ * before {@link GenericPublisher#initialize()} has been called.
+ */
+ protected String getHost() {
+ return getServer().getServer().getHost();
+ }
+
+ /**
+ * Returns http port defined for the server module is to be published on.
+ * <p>
+ * This replicates {@link GenericServer#getHttpPort()}.
+ *
+ * @return int
+ */
+ protected int getHttpPort() {
+ int port = -1;
+ Iterator pIter = getServer().getServerDefinition().getPort().iterator();
+
+ while (pIter.hasNext()) {
+ Port aPort = (Port) pIter.next();
+
+ if(port == -1) {
+ port =
Integer.parseInt(getServer().getServerDefinition().getResolver().resolveProperties(aPort.getNo()));
+ }
+ else if( "http".equals(aPort.getProtocol() ) ) { //$NON-NLS-1$
+ port = Integer.parseInt(aPort.getNo());
+ }
+ }
+ if( port == -1) {
+ port = 8080;
+ }
+ return port;
+ }
+
+ /*
+ * we don't have something like validate in here as we are not the provider
+ * of an extension point, but simply providing some utility methods for
+ * sub-classes to use if they so wish.
+ *
+ * if we had provided our own extension point to do publishing, then
+ * we would probably have specified a validate() method in the abstract base
+ * class so that our framework could call its implementation in extensions.
+ *
+ * If it's just a utility method it should have static methods. Otherwise,
+ * allow it to be sub-classed and declare some methods as abstract to
+ * indicate to sub-classes what they need to implement.
+ *
+ * What is true though is that we cannot call such methods automatically as
+ * we are not really offering an extension point.
+ *
+ * TODO clarify explain this point about usage in the class comment! the methods
+ * will not be called automatically as we are not providing an extension
+ * point as initially expected.
+ */
+
+
+}
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/Messages.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/Messages.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/Messages.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes.ui.wizards;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Internationalization, internationalisation...
+ *
+ *
+ * @author Bruno Wassermann, written Jun 30, 2006
+ */
+public final class Messages extends NLS {
+
+ private static final String BUNDLE_NAME =
"org.eclipse.bpel.runtimes.ui.wizards.messages"; //$NON-NLS-1$
+
+ private Messages() {
+ }
+
+ // new project wizard
+ public static String NewProjectWizard_1;
+ public static String NewProjectWizardPage1_1;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+}
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizard.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizard.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizard.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes.ui.wizards;
+
+import org.eclipse.bpel.runtimes.IBPELModuleFacetConstants;
+import org.eclipse.bpel.runtimes.IRuntimesUIConstants;
+import org.eclipse.bpel.runtimes.RuntimesPlugin;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.ui.INewWizard;
+import
org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard;
+
+/**
+ * <code>INewWizard</code> implementation for new BPEL project wizard
+ * installing the BPEL facet by default.
+ *
+ * @author Bruno Wassermann, written Jun 28, 2006
+ */
+public class NewBPELProjectWizard extends NewProjectDataModelFacetWizard
+ implements INewWizard
+{
+
+ /**
+ * Default constructor.
+ */
+ public NewBPELProjectWizard() {
+ super();
+ setWindowTitle(Messages.NewProjectWizard_1);
+ }
+
+ /**
+ * Constructor settings this wizard's <code>IDataModel</code>.
+ *
+ * @see <code>IDataModel</code>
+ * @param model <code>IDataModel</code>
+ */
+ public NewBPELProjectWizard(IDataModel model) {
+ super(model);
+ setWindowTitle(Messages.NewProjectWizard_1);
+ }
+
+ /**
+ * Creates an instance of the
<code>FacetProjectCreationDataModelProvider</code>
+ * for BPEL projects. Used to associate common facet information such as
+ * runtimes with particular a project.
+ *
+ * @see <code>FacetProjectCreationDataModelProvider</code>
+ * @return <code>IDataModel</code>
+ */
+ @Override
+ protected IDataModel createDataModel() {
+
+ /*
+ * There does not seem to be a need for any custom implementation for
+ * BPEL projects at this stage. May have to reconsider at some point and
+ * build a BPELFacetProjectCreationDataModelProvider.
+ */
+ return DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider());
+ }
+
+ /**
+ * Getting image descriptor to be used as wizard banner.
+ *
+ * @return <code>ImageDescriptor</code>
+ */
+ @Override
+ protected ImageDescriptor getDefaultPageImageDescriptor() {
+ return
RuntimesPlugin.getPlugin().getImageDescriptor(IRuntimesUIConstants.ICON_NEWPRJ_WIZARD_BANNER);
+ }
+
+ /**
+ * Getting the <code>IFacetedProjectTemplate</code> for a BPEL project.
+ * Is used to retrieve the set of fixed facets for a particular project
+ * type.
+ *
+ * @see org.eclipse.wst.common.project.core.IFacetedProjectTemplate
+ * @return org.eclipse.wst.common.project.core.IFacetedProjectTemplate
+ *
+ */
+ @Override
+ protected IFacetedProjectTemplate getTemplate() {
+ return
ProjectFacetsManager.getTemplate(IBPELModuleFacetConstants.BPEL20_FACET_TEMPLATE);
+ }
+
+
+ /*
+ * (non-Javadoc)
+ * @see
org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard#createFirstPage()
+ */
+ @Override
+ protected IWizardPage createFirstPage() {
+ return new NewBPELProjectWizardPage1(model, "newBPELProject"); //
$NON-NLS-1$
+ }
+
+
+}
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizardPage1.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizardPage1.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizardPage1.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes.ui.wizards;
+
+import org.eclipse.bpel.runtimes.IBPELModuleFacetConstants;
+import org.eclipse.bpel.runtimes.IRuntimesUIConstants;
+import org.eclipse.bpel.runtimes.RuntimesPlugin;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetCreationWizardPage;
+
+/**
+ * <code>DataModelFacetCreationWizardPage</code> for setting up a new BPEL
+ * project.
+ *
+ * @author Bruno Wassermann, written Jun 29, 2006
+ */
+public class NewBPELProjectWizardPage1 extends DataModelFacetCreationWizardPage {
+
+ public NewBPELProjectWizardPage1(IDataModel dataModel, String pageName) {
+ super(dataModel, pageName);
+ //setTitle(org.eclipse.bpel.runtimes.ui.wizards.Messages.NewProjectWizard_1);
+ //setDescription(org.eclipse.bpel.runtimes.ui.wizards.Messages.NewProjectWizardPage1_1);
+ setTitle(org.eclipse.bpel.runtimes.ui.wizards.Messages.NewProjectWizard_1);
+ setDescription(org.eclipse.bpel.runtimes.ui.wizards.Messages.NewProjectWizardPage1_1);
+ setImageDescriptor(RuntimesPlugin.getPlugin().getImageDescriptor(IRuntimesUIConstants.ICON_NEWPRJ_WIZARD_BANNER));
+ }
+
+ protected String getModuleFacetID() {
+ return IBPELModuleFacetConstants.BPEL20_MODULE_TYPE;
+ }
+
+ protected String getModuleTypeID() {
+ return IBPELModuleFacetConstants.BPEL20_PROJECT_FACET;
+ }
+
+}
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/messages.properties
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/messages.properties
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/messages.properties 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,2 @@
+NewProjectWizard_1=New BPEL Project
+NewProjectWizardPage1_1=Create a new BPEL 2.0 project.
Added:
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/utils/BPELModelUtils.java
===================================================================
---
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/utils/BPELModelUtils.java
(rev 0)
+++
workspace/Denny/bpel/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/utils/BPELModelUtils.java 2009-05-06
07:13:47 UTC (rev 15045)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes.utils;
+
+import org.eclipse.bpel.model.PartnerLink;
+import org.eclipse.bpel.model.Scope;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * A bunch of helper methods to support runtime providers get data from the
+ * BPEL model.
+ *
+ * @author Bruno Wassermann, written 11 May 2007
+ */
+public class BPELModelUtils {
+
+ /**
+ * Return an <code>EList</code> containing all partnerLink elements defined
+ * on Scopes in this process.
+ *
+ * @param process <code>EObject</code> representing the Process element
+ * @return <code>EList</code> containing all
<code>PartnerLink</code>s
+ * defined on any Scopes (or none)
+ */
+ public static EList<PartnerLink> getScopePartnerLinks(final EObject process) {
+ TreeIterator<EObject> contents = process.eAllContents();
+ EList<PartnerLink> results = new BasicEList<PartnerLink>();
+
+ while (contents.hasNext()) {
+ EObject obj = contents.next();
+
+ if (obj instanceof Scope) {
+ results.addAll(((Scope) obj).getPartnerLinks().getChildren());
+ }
+ }
+ return results;
+ }
+}