Author: bbrodt
Date: 2011-02-17 18:25:16 -0500 (Thu, 17 Feb 2011)
New Revision: 29228
Added:
workspace/bbrodt/org.eclipse.bpel.runtimes/.classpath
workspace/bbrodt/org.eclipse.bpel.runtimes/.cvsignore
workspace/bbrodt/org.eclipse.bpel.runtimes/.project
workspace/bbrodt/org.eclipse.bpel.runtimes/.settings/
workspace/bbrodt/org.eclipse.bpel.runtimes/.settings/org.eclipse.jdt.core.prefs
workspace/bbrodt/org.eclipse.bpel.runtimes/META-INF/
workspace/bbrodt/org.eclipse.bpel.runtimes/META-INF/MANIFEST.MF
workspace/bbrodt/org.eclipse.bpel.runtimes/build.properties
workspace/bbrodt/org.eclipse.bpel.runtimes/icons/
workspace/bbrodt/org.eclipse.bpel.runtimes/icons/ctool16/
workspace/bbrodt/org.eclipse.bpel.runtimes/icons/ctool16/new_bpelprj.gif
workspace/bbrodt/org.eclipse.bpel.runtimes/icons/obj16/
workspace/bbrodt/org.eclipse.bpel.runtimes/icons/obj16/bpelfacet.gif
workspace/bbrodt/org.eclipse.bpel.runtimes/icons/obj16/prj_bpel.gif
workspace/bbrodt/org.eclipse.bpel.runtimes/icons/wizban/
workspace/bbrodt/org.eclipse.bpel.runtimes/icons/wizban/newprj_bpel_wiz_banner.gif
workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.properties
workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.xml
workspace/bbrodt/org.eclipse.bpel.runtimes/src/
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELModuleFacetConstants.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELRuntimeDelegate.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IRuntimesUIConstants.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/RuntimesPlugin.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELCoreFacetInstallDelegate.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELFacetInstallDataModelProvider.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELVirtualComponent.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployable.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactAdapterFactory.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactUtil.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleArtifact.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleDelegate.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleFactoryDelegate.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/FlatComponentDeployable.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/Messages.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/messages.properties
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/publishers/
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/publishers/GenericBPELPublisher.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/BPELFacetInstallPage.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/Messages.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizard.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizardPage1.java
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/messages.properties
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/utils/
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/utils/BPELModelUtils.java
Modified:
workspace/bbrodt/org.eclipse.bpel.runtimes/
Log:
Property changes on: workspace/bbrodt/org.eclipse.bpel.runtimes
___________________________________________________________________
Added: svn:ignore
+ pom.xml
Added: workspace/bbrodt/org.eclipse.bpel.runtimes/.classpath
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.runtimes/.classpath (rev 0)
+++ workspace/bbrodt/org.eclipse.bpel.runtimes/.classpath 2011-02-17 23:25:16 UTC (rev
29228)
@@ -0,0 +1,6 @@
+<?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"/>
+</classpath>
Added: workspace/bbrodt/org.eclipse.bpel.runtimes/.cvsignore
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.runtimes/.cvsignore (rev 0)
+++ workspace/bbrodt/org.eclipse.bpel.runtimes/.cvsignore 2011-02-17 23:25:16 UTC (rev
29228)
@@ -0,0 +1,4 @@
+target
+bin
+*.class
+
Added: workspace/bbrodt/org.eclipse.bpel.runtimes/.project
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.runtimes/.project (rev 0)
+++ workspace/bbrodt/org.eclipse.bpel.runtimes/.project 2011-02-17 23:25:16 UTC (rev
29228)
@@ -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/bbrodt/org.eclipse.bpel.runtimes/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.runtimes/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/.settings/org.eclipse.jdt.core.prefs 2011-02-17
23:25:16 UTC (rev 29228)
@@ -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/bbrodt/org.eclipse.bpel.runtimes/META-INF/MANIFEST.MF
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.runtimes/META-INF/MANIFEST.MF
(rev 0)
+++ workspace/bbrodt/org.eclipse.bpel.runtimes/META-INF/MANIFEST.MF 2011-02-17 23:25:16
UTC (rev 29228)
@@ -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.5.0.qualifier
+Bundle-Activator: org.eclipse.bpel.runtimes.RuntimesPlugin
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.wst.server.core;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.wst.web.ui;bundle-version="[1.1.200,2.0.0)",
+ org.eclipse.wst.common.project.facet.ui;bundle-version="[1.3.0,2.0.0)",
+ org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,2.0.0)",
+ org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
+ org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)",
+ org.eclipse.wst.common.frameworks.ui;bundle-version="[1.1.200,2.0.0)",
+ org.eclipse.jst.server.generic.core;bundle-version="[1.0.305,2.0.0)",
+ org.eclipse.jem.util;bundle-version="[2.0.100,3.0.0)",
+ org.eclipse.debug.ui;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.bpel.model;bundle-version="0.5.0",
+ org.eclipse.emf.ecore;bundle-version="[2.4.0,3.0.0)",
+ javax.wsdl;bundle-version="[1.5.0,1.6.0)",
+ org.eclipse.wst.wsdl;bundle-version="[1.1.200,2.0.0)",
+ org.eclipse.jst.common.frameworks
+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-Vendor: %providerName
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Added: workspace/bbrodt/org.eclipse.bpel.runtimes/build.properties
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.runtimes/build.properties
(rev 0)
+++ workspace/bbrodt/org.eclipse.bpel.runtimes/build.properties 2011-02-17 23:25:16 UTC
(rev 29228)
@@ -0,0 +1,16 @@
+bin.includes = plugin.xml,\
+ META-INF/,\
+ icons/,\
+ plugin.properties,\
+ .
+src.includes = META-INF/,\
+ icons/,\
+ plugin.*,\
+ src/,\
+ build.properties,\
+ .,\
+ .project,\
+ .cvsignore,\
+ .classpath
+source.. = src/
+
Added: workspace/bbrodt/org.eclipse.bpel.runtimes/icons/ctool16/new_bpelprj.gif
===================================================================
(Binary files differ)
Property changes on:
workspace/bbrodt/org.eclipse.bpel.runtimes/icons/ctool16/new_bpelprj.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/bbrodt/org.eclipse.bpel.runtimes/icons/obj16/bpelfacet.gif
===================================================================
(Binary files differ)
Property changes on: workspace/bbrodt/org.eclipse.bpel.runtimes/icons/obj16/bpelfacet.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/bbrodt/org.eclipse.bpel.runtimes/icons/obj16/prj_bpel.gif
===================================================================
(Binary files differ)
Property changes on: workspace/bbrodt/org.eclipse.bpel.runtimes/icons/obj16/prj_bpel.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/bbrodt/org.eclipse.bpel.runtimes/icons/wizban/newprj_bpel_wiz_banner.gif
===================================================================
(Binary files differ)
Property changes on:
workspace/bbrodt/org.eclipse.bpel.runtimes/icons/wizban/newprj_bpel_wiz_banner.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.properties
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.properties
(rev 0)
+++ workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.properties 2011-02-17 23:25:16 UTC
(rev 29228)
@@ -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/bbrodt/org.eclipse.bpel.runtimes/plugin.xml
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.xml (rev 0)
+++ workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.xml 2011-02-17 23:25:16 UTC (rev
29228)
@@ -0,0 +1,193 @@
+<?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>
+
+ <extension
point="org.eclipse.wst.common.project.facet.ui.wizardPages">
+ <wizard-pages action="bpel.facet.core.install">
+ <page
class="org.eclipse.bpel.runtimes.ui.wizards.BPELFacetInstallPage"/>
+ </wizard-pages>
+ </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">
+ <group-member id="modules"></group-member>
+ <constraint>
+ <conflicts group="modules">
+ </conflicts>
+ </constraint>
+ </project-facet-version>
+
+
+ <action facet="bpel.facet.core" version="2.0"
type="INSTALL" id="bpel.facet.core.install">
+ <delegate
class="org.eclipse.bpel.runtimes.facets.BPELCoreFacetInstallDelegate"/>
+ <config-factory
class="org.eclipse.bpel.runtimes.facets.BPELFacetInstallDataModelProvider"/>
+ </action>
+
+ <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"/>
+ </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>
+
+ <extension
+ point="org.eclipse.wst.common.modulecore.componentimpl">
+ <componentimpl
+ typeID="bpel.facet.core"
+ class="org.eclipse.bpel.runtimes.facets.BPELVirtualComponent">
+ </componentimpl>
+ </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/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELModuleFacetConstants.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELModuleFacetConstants.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELModuleFacetConstants.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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 {
+ public final static String BPEL_CONTENT_FOLDER =
"BPELFacetInstallDataModelProvider.contentRoot";
+ public final static String BPEL_CONTENT_DEFAULT_FOLDER = "bpelContent";
+
+ // 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/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELRuntimeDelegate.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELRuntimeDelegate.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELRuntimeDelegate.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -0,0 +1,9 @@
+package org.eclipse.bpel.runtimes;
+
+public interface IBPELRuntimeDelegate {
+
+ public String getServerAddress();
+ public String getPort();
+ public String getDeployDir();
+
+}
Added:
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IRuntimesUIConstants.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IRuntimesUIConstants.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IRuntimesUIConstants.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -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/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/RuntimesPlugin.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/RuntimesPlugin.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/RuntimesPlugin.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -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();
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /**
+ * 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/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELCoreFacetInstallDelegate.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELCoreFacetInstallDelegate.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELCoreFacetInstallDelegate.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * 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.IFolder;
+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.core.runtime.Path;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jst.common.project.facet.WtpUtils;
+import org.eclipse.wst.common.componentcore.internal.util.IComponentImplFactory;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+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 ...", 300 ); //$NON-NLS-1$
+ IDataModel model = (IDataModel)obj;
+ String contentRoot =
(String)model.getProperty(BPELFacetInstallDataModelProvider.BPEL_CONTENT_FOLDER);
+ contentRoot = (contentRoot == null || "".equals(contentRoot)) ?
IBPELModuleFacetConstants.BPEL_CONTENT_DEFAULT_FOLDER : contentRoot;
+
+ // add natures
+ WtpUtils.addNatures(proj);
+
+ // Create the content folder
+ IFolder bpelContent = proj.getFolder(contentRoot);
+ if (!bpelContent.exists())
+ bpelContent.create(true,true, null);
+
+ // create the virtual component
+ IComponentImplFactory factory = new BPELVirtualComponent();
+ IVirtualComponent newComponent = factory.createComponent(proj);
+ newComponent.create(0, null);
+ progMon.worked(100);
+
+ // Add the resource mapping to bpelContent
+ newComponent.getRootFolder().createLink(new Path("/" + contentRoot), 0,
null);
+
+ // Add builder
+ addBuilder(proj, new SubProgressMonitor(progMon, 100));
+ progMon.done();
+ }
+ protected void addBuilder(IProject proj, IProgressMonitor monitor) throws CoreException
{
+ // 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, monitor);
+
+ } 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, monitor);
+ }
+ }
+ }
+}
Added:
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELFacetInstallDataModelProvider.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELFacetInstallDataModelProvider.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELFacetInstallDataModelProvider.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -0,0 +1,29 @@
+package org.eclipse.bpel.runtimes.facets;
+
+import java.util.Set;
+
+import org.eclipse.bpel.runtimes.IBPELModuleFacetConstants;
+import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
+import
org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
+
+public class BPELFacetInstallDataModelProvider extends
+ FacetInstallDataModelProvider implements IActionConfigFactory,
IFacetDataModelProperties, IBPELModuleFacetConstants {
+
+ @Override
+ public Set getPropertyNames() {
+ Set names = super.getPropertyNames();
+ names.add(FACET_PROJECT_NAME);
+ names.add(FACET_ID);
+ names.add(BPEL_CONTENT_FOLDER);
+ return names;
+ }
+
+ @Override
+ public Object getDefaultProperty(String propertyName) {
+ if (propertyName.equals(FACET_ID)) {
+ return IBPELModuleFacetConstants.BPEL20_PROJECT_FACET;
+ }
+ return super.getDefaultProperty(propertyName);
+ }
+}
Added:
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELVirtualComponent.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELVirtualComponent.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/facets/BPELVirtualComponent.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -0,0 +1,34 @@
+package org.eclipse.bpel.runtimes.facets;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualFolder;
+import org.eclipse.wst.common.componentcore.internal.util.IComponentImplFactory;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+
+public class BPELVirtualComponent extends VirtualComponent implements
IComponentImplFactory {
+ public BPELVirtualComponent() {
+ super();
+ }
+
+ public BPELVirtualComponent(IProject aProject, IPath aRuntimePath) {
+ super(aProject, aRuntimePath);
+ }
+
+ public IVirtualComponent createComponent(IProject aProject) {
+ return new BPELVirtualComponent(aProject, new Path("/"));
+ }
+
+ public IVirtualFolder createFolder(IProject aProject, IPath aRuntimePath) {
+ return new VirtualFolder(aProject, aRuntimePath);
+ }
+
+ public IVirtualComponent createArchiveComponent(IProject aProject,
+ String archiveLocation, IPath aRuntimePath) {
+ return new VirtualArchiveComponent(aProject, archiveLocation, aRuntimePath);
+ }
+}
Added:
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployable.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployable.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployable.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -0,0 +1,36 @@
+package org.eclipse.bpel.runtimes.module;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.wst.common.componentcore.internal.flat.IFlattenParticipant;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+
+public class BPELDeployable extends FlatComponentDeployable {
+
+ public BPELDeployable(IProject project) {
+ super(project);
+ }
+
+ public BPELDeployable(IProject project, IVirtualComponent aComponent) {
+ super(project, aComponent);
+ }
+
+ @Override
+ public boolean shouldCache() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.bpel.runtimes.module.FlatComponentDeployable#getParticipants()
+ */
+ protected IFlattenParticipant[] getParticipants() {
+ /*
+ * No work really needs to be done here. The BPEL project
+ * doesn't need to map source in instead, it doesn't need to
+ * update a manifest file, it doesn't need to add in classpath dependencies, etc
etc
+ *
+ * Just standard traversals as of now.
+ */
+ return super.getParticipants();
+ }
+}
Added:
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactAdapterFactory.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactAdapterFactory.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactAdapterFactory.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -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/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactUtil.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactUtil.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELDeployableArtifactUtil.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -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/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleArtifact.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleArtifact.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleArtifact.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -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/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleDelegate.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleDelegate.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleDelegate.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -0,0 +1,184 @@
+/*******************************************************************************
+ * 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.bpel.runtimes.RuntimesPlugin;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.internal.ModuleFile;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.ModuleDelegate;
+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() {
+ IModuleResource[] result = {new ModuleFile(file, file.getName(), Path.EMPTY)};
+
+ return result;
+ }
+
+ /**
+ * 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;
+ }
+
+
+ /*
+ * (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return file == null ? 0 : file.getFullPath().toOSString().length();
+ }
+}
Added:
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleFactoryDelegate.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleFactoryDelegate.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/BPELModuleFactoryDelegate.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -0,0 +1,222 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes.module;
+
+import java.io.File;
+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.IProject;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.internal.StructureEdit;
+import org.eclipse.wst.common.componentcore.internal.flat.IChildModuleReference;
+import org.eclipse.wst.common.componentcore.internal.util.FacetedProjectUtilities;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.internal.Module;
+import org.eclipse.wst.server.core.internal.ModuleFactory;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.eclipse.wst.server.core.model.ModuleDelegate;
+import org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate;
+
+/**
+ * J2EE module factory.
+ */
+public class BPELModuleFactoryDelegate extends ProjectModuleFactoryDelegate implements
IResourceChangeListener {
+ protected Map <IModule, FlatComponentDeployable> moduleDelegates = new
HashMap<IModule, FlatComponentDeployable>(5);
+
+ public static final String BPEL_FACTORY =
"org.eclipse.bpel.runtimes.module.moduleFactory"; //$NON-NLS-1$
+
+ public static BPELModuleFactoryDelegate FACTORY;
+ public static BPELModuleFactoryDelegate factoryInstance() {
+ if( FACTORY == null ) {
+ ensureFactoryLoaded(BPEL_FACTORY);
+ }
+ return FACTORY;
+ }
+
+ public static void ensureFactoryLoaded(String factoryId) {
+ ModuleFactory[] factories = ServerPlugin.getModuleFactories();
+ for( int i = 0; i < factories.length; i++ ) {
+ if( factories[i].getId().equals(factoryId)) {
+ factories[i].getDelegate(new NullProgressMonitor());
+ }
+ }
+ }
+
+ public BPELModuleFactoryDelegate() {
+ super();
+ }
+
+ @Override
+ public void initialize() {
+ super.initialize();
+ if( getId().equals(BPEL_FACTORY))
+ FACTORY = this;
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
+ }
+
+ @Override
+ protected IModule[] createModules(IProject project) {
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ if(component != null)
+ return createModuleDelegates(component);
+ return null;
+ }
+
+
+ @Override
+ public ModuleDelegate getModuleDelegate(IModule module) {
+ if (module == null)
+ return null;
+
+ ModuleDelegate md = moduleDelegates.get(module);
+// if( md == null &&
((Module)module).getInternalId().startsWith(BINARY_PREFIX))
+// return createDelegate(module);
+
+ if (md == null) {
+ createModules(module.getProject());
+ md = moduleDelegates.get(module);
+ }
+ return md;
+ }
+
+ protected boolean canHandleProject(IProject p) {
+ return FacetedProjectUtilities.isProjectOfType(p,
IBPELModuleFacetConstants.BPEL20_PROJECT_FACET);
+ }
+
+ protected IModule[] createModuleDelegates(IVirtualComponent component) {
+ if(component == null){
+ return null;
+ }
+
+ List<IModule> projectModules = new ArrayList<IModule>();
+ try {
+ if (canHandleProject(component.getProject())) {
+ String type = IBPELModuleFacetConstants.BPEL20_MODULE_TYPE;
+ String version = IBPELModuleFacetConstants.BPEL20_MODULE_VERSION;
+ IModule module = createModule(component.getName(), component.getName(), type,
version, component.getProject());
+ FlatComponentDeployable moduleDelegate = createModuleDelegate(component.getProject(),
component);
+ moduleDelegates.put(module, moduleDelegate);
+ projectModules.add(module);
+
+ // Check to add any binary modules
+// if (J2EEProjectUtilities.ENTERPRISE_APPLICATION.equals(type))
+// projectModules.addAll(LEGACY_createBinaryModules(component));
+ } else {
+ return null;
+ }
+ } catch (Exception e) {
+// e.printStackTrace();
+// J2EEPlugin.logError(e);
+ }
+ return projectModules.toArray(new IModule[projectModules.size()]);
+ }
+
+ protected FlatComponentDeployable createModuleDelegate(IProject project,
IVirtualComponent component) {
+ return new BPELDeployable(project, component);
+ }
+
+// protected FlatComponentDeployable getNestedDelegate(IVirtualComponent component) {
+// return new BPELDeployable(component.getProject(), component);
+// }
+
+ /**
+ * Returns the list of resources that the module should listen to for state
+ * changes. The paths should be project relative paths. Subclasses can
+ * override this method to provide the paths.
+ *
+ * @return a possibly empty array of paths
+ */
+ @Override
+ protected IPath[] getListenerPaths() {
+ return new IPath[] { new Path(".project"), // nature //$NON-NLS-1$
+ new Path(StructureEdit.MODULE_META_FILE_NAME), // component
+ new Path(".settings/org.eclipse.wst.common.project.facet.core.xml") //
facets //$NON-NLS-1$
+ };
+ }
+
+ @Override
+ protected void clearCache(IProject project) {
+ super.clearCache(project);
+ List<IModule> modulesToRemove = null;
+ for (Iterator<IModule> iterator = moduleDelegates.keySet().iterator();
iterator.hasNext();) {
+ IModule module = iterator.next();
+ if (module.getProject().equals(project)) {
+ if (modulesToRemove == null) {
+ modulesToRemove = new ArrayList<IModule>();
+ }
+ modulesToRemove.add(module);
+ }
+ }
+ if (modulesToRemove != null) {
+ for (IModule module : modulesToRemove) {
+ moduleDelegates.remove(module);
+ }
+ }
+ }
+
+// /**
+// * From this point on, when queried, projects will generate their binary
+// * child modules on the fly and they will be small and dumb
+// *
+// * @param parent
+// * @param child
+// * @return
+// */
+// public IModule createChildModule(FlatComponentDeployable parent, IChildModuleReference
child) {
+// File file = child.getFile();
+// if( file != null ) {
+// IPath p = new Path(file.getAbsolutePath());
+// JavaEEQuickPeek qp = JavaEEBinaryComponentHelper.getJavaEEQuickPeek(p);
+// IModule module = createModule(qp, BINARY_PREFIX + file.getAbsolutePath(),
file.getName(), parent.getProject());
+// FlatComponentDeployable moduleDelegate = getNestedDelegate(child.getComponent());
+// moduleDelegates.put(module, moduleDelegate);
+// return module;
+// }
+// return null;
+// }
+
+// /**
+// * Create a module delegate on the fly for this binary file
+// * @param module
+// * @return
+// */
+// public ModuleDelegate createDelegate(IModule module) {
+// String internalId = ((Module)module).getInternalId();
+// String path = internalId.substring(BINARY_PREFIX.length());
+// File f = new File(path);
+// return new BinaryFileModuleDelegate(f);
+// }
+
+ public void resourceChanged(IResourceChangeEvent event) {
+ cleanAllDelegates();
+ }
+
+ protected void cleanAllDelegates() {
+ Iterator<FlatComponentDeployable> i = moduleDelegates.values().iterator();
+ while(i.hasNext()) {
+ i.next().clearCache();
+ }
+ modulesChanged();
+ }
+}
Added:
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/FlatComponentDeployable.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/FlatComponentDeployable.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/FlatComponentDeployable.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -0,0 +1,381 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat and others.
+ * 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
+ *
+ * THIS CLASS IS AN EXACT CLONE OF
+ * org.eclipse.wst.web.internal.deployables.FlatComponentDeployable
+ *
+ * This class is a candidate for being pushed into COMMON TOOLS
+ *******************************************************************************/
+package org.eclipse.bpel.runtimes.module;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent;
+import
org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.FlatComponentTaskModel;
+import org.eclipse.wst.common.componentcore.internal.flat.IChildModuleReference;
+import org.eclipse.wst.common.componentcore.internal.flat.IFlatFile;
+import org.eclipse.wst.common.componentcore.internal.flat.IFlatFolder;
+import org.eclipse.wst.common.componentcore.internal.flat.IFlatResource;
+import org.eclipse.wst.common.componentcore.internal.flat.IFlatVirtualComponent;
+import org.eclipse.wst.common.componentcore.internal.flat.IFlattenParticipant;
+import org.eclipse.wst.common.componentcore.internal.util.VirtualReferenceUtilities;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+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.ServerUtil;
+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.ProjectModule;
+
+public abstract class FlatComponentDeployable extends ProjectModule {
+
+ /*
+ * Register an adapt IModule to IVirtualComponent
+ */
+ static {
+ Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {
+ public Class[] getAdapterList() {
+ return new Class[] { IVirtualComponent.class };
+ }
+
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adaptableObject instanceof IModule) {
+ IModule module = (IModule) adaptableObject;
+ FlatComponentDeployable deployable = (FlatComponentDeployable)
module.loadAdapter(FlatComponentDeployable.class, null);
+ if(deployable != null){
+ IVirtualComponent virtualComponent = deployable.getComponent();
+ return virtualComponent;
+ }
+ }
+ return null;
+ }
+ }, IModule.class);
+ }
+
+ protected IVirtualComponent component = null;
+ protected List<IModuleResource> members = new ArrayList<IModuleResource>();
+
+ public FlatComponentDeployable(IProject project) {
+ this(project,ComponentCore.createComponent(project));
+ }
+
+ public FlatComponentDeployable(IProject project, IVirtualComponent aComponent) {
+ super(project);
+ this.component = aComponent;
+ }
+
+ public IVirtualComponent getComponent() {
+ return component;
+ }
+
+ /**
+ * We will cache the flattened piece here, and instead redirect
+ * the module factories to recreate the modules *whenever* there is
+ * a workspace change. This will still be much more efficient than
+ * traversing the tree each time a call to getResources() or getChildModules().
+ */
+ private FlatVirtualComponent cacheFlattened = null;
+
+
+ public boolean shouldCache() {
+ return false;
+ }
+
+ public void clearCache() {
+ cacheFlattened = null;
+ }
+
+ /**
+ * The export model is what does the grunt of the work
+ * @return
+ */
+ protected IFlatVirtualComponent getFlatComponent() {
+ if( !shouldCache() || cacheFlattened == null ) {
+ FlatComponentTaskModel options = new FlatComponentTaskModel();
+ options.put(FlatVirtualComponent.PARTICIPANT_LIST, Arrays.asList(getParticipants()));
+ FlatVirtualComponent tmp = new FlatVirtualComponent(component, options);
+ if( shouldCache())
+ cacheFlattened = tmp;
+ return tmp;
+ }
+ return cacheFlattened;
+ }
+
+ /**
+ * Subclasses can provide a list of participants who may
+ * be involved in forming the export model
+ *
+ * A deployable with no participant should still properly
+ * consume consumed references and traverse the model appropriately
+ *
+ * @return
+ */
+ protected IFlattenParticipant[] getParticipants() {
+ return new IFlattenParticipant[]{
+ };
+ }
+
+ public boolean isBinary() {
+ return component == null ? false : component.isBinary();
+ }
+
+ @Override
+ public IModuleResource[] members() throws CoreException {
+ if( component.isBinary() )
+ return LEGACY_binaryMembers();
+
+ IFlatVirtualComponent em = getFlatComponent();
+ IFlatResource[] resources = em.fetchResources();
+ return convert(resources);
+
+ }
+
+ protected IModuleResource[] LEGACY_binaryMembers() {
+ IFile ifile = (IFile)component.getAdapter(IFile.class);
+ File file = (File)component.getAdapter(File.class);
+ ModuleFile mf = ifile != null ? new ModuleFile(ifile, ifile.getName(), new
Path("")) //$NON-NLS-1$
+ : new ModuleFile(file, file.getName(), new Path("")); //$NON-NLS-1$
+ return new IModuleResource[]{mf};
+ }
+
+ /**
+ * Returns the child modules of this module.
+ *
+ * @return org.eclipse.wst.server.core.model.IModule[]
+ */
+ @Override
+ public IModule[] getChildModules() {
+ return getModules();
+ }
+
+ public /* non api */ IChildModuleReference[] getExportModelChildren() throws
CoreException {
+ IFlatVirtualComponent em = getFlatComponent();
+ IChildModuleReference[] children = em.getChildModules();
+ return children;
+ }
+
+ public IModule[] getModules() {
+ // Legacy, here in case the old modules are used
+ if( component.isBinary() )
+ return new IModule[]{};
+
+ try {
+ List<IModule> modules = new ArrayList<IModule>();
+ IChildModuleReference[] children = getExportModelChildren();
+ for( int i = 0; i < children.length; i++ ) {
+ IModule child = gatherModuleReference(component, children[i]);
+ if( child != null )
+ modules.add(child);
+ }
+ return modules.toArray(new IModule[modules.size()]);
+ } catch( CoreException ce ) {
+ }
+ return new IModule[]{};
+ }
+
+ @Override
+ public String getPath(IModule m) {
+ return getURI(m);
+ }
+
+ /**
+ * Returns the URI of the given contained CHILD module.
+ *
+ * SOFT requirements (NOT API!!) in use by some adopters
+ * If the passed in module is equal to this module, return our own deployed name
+ *
+ * @param module a module
+ * @return the URI of the given module, or <code>null</code> if the URI
could
+ * not be found
+ */
+ public String getURI(IModule module) {
+ ProjectModule md = (ProjectModule)module.loadAdapter(ProjectModule.class, new
NullProgressMonitor());
+ if( md == this ) {
+ // guess my own name
+ return
VirtualReferenceUtilities.INSTANCE.getDefaultProjectArchiveName(this.component);
+ }
+ try {
+ FlatComponentDeployable cd =
(FlatComponentDeployable)module.loadAdapter(FlatComponentDeployable.class, new
NullProgressMonitor());
+ if( cd != null ) {
+ IFlatVirtualComponent em = getFlatComponent();
+ IChildModuleReference[] children = em.getChildModules();
+ for( int i = 0; i < children.length; i++ ) {
+ IModule child = gatherModuleReference(component, children[i]);
+ if( child != null && child.getId().equals(module.getId()))
+ return children[i].getRelativeURI().toString();
+ }
+ }
+ } catch( CoreException ce ) {
+ }
+ return null;
+ }
+
+ /**
+ * If I know how to find an IModule for this child, do so now
+ *
+ * I would love to see this replaced with some API to locate a
+ * possible child module based on a virtual component.
+ *
+ * @param component
+ * @param targetComponent
+ * @return
+ */
+ protected IModule gatherModuleReference(IVirtualComponent component,
IChildModuleReference child) {
+ // Handle workspace project module components
+ // Subclasses should extend
+ IVirtualComponent targetComponent = child.getComponent();
+ if (targetComponent != null && targetComponent.getProject()!=
component.getProject()) {
+ if (!targetComponent.isBinary()) {
+ return filterModuleDelegates(ServerUtil.getModules(targetComponent.getProject()));
+ }
+ }
+ return null;
+ }
+
+ /**
+ * An extender may wish to override this method in order to control which
+ * delegate is returned in the scenario where more than one exist. By default
+ * the first one found is returned.
+ *
+ * @param IModule[] modules
+ * @return IModule[]
+ */
+ protected IModule filterModuleDelegates(IModule[] modules) {
+ for (int i = 0; i < modules.length; i++) {
+ ModuleDelegate md = (ModuleDelegate)modules[i].loadAdapter(ModuleDelegate.class, new
NullProgressMonitor());
+ if (md instanceof ProjectModule) {
+ return modules[i];
+ }
+ }
+ return modules.length > 0 ? modules[0] : null;
+ }
+
+ /*
+ * Below are STATIC utility classes and methods
+ */
+ protected static IModuleResource[] convert(IFlatResource[] resources) {
+ ArrayList<IModuleResource> list = new ArrayList<IModuleResource>();
+ for( int i = 0; i < resources.length; i++ ) {
+ if( resources[i] instanceof IFlatFile)
+ list.add(new ComponentModuleFile(resources[i]));
+ else if( resources[i] instanceof IFlatFolder)
+ list.add(new ComponentModuleFolder(resources[i]));
+ }
+ return list.toArray(new IModuleResource[list.size()]);
+ }
+
+ public static class ComponentModuleResource {
+ protected IFlatResource delegate;
+ public ComponentModuleResource(IFlatResource resource) {
+ this.delegate = resource;
+ }
+ public long getModificationStamp() {
+ return ((IFlatFile)delegate).getModificationStamp();
+ }
+
+ public IPath getModuleRelativePath() {
+ return delegate.getModuleRelativePath();
+ }
+ public String getName() {
+ return delegate.getName();
+ }
+ public Object getAdapter(Class adapter) {
+ return delegate.getAdapter(adapter);
+ }
+ public IModuleResource[] members() {
+ IFlatResource[] children = ((IFlatFolder)delegate).members();
+ return convert(children);
+ }
+ }
+
+ public static class ComponentModuleFile extends ComponentModuleResource implements
IModuleFile{
+ public ComponentModuleFile(IFlatResource resource) {
+ super(resource);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this)
+ return true;
+
+ if (!(obj instanceof IModuleFile))
+ return false;
+
+ IModuleFile mf = (IModuleFile) obj;
+ if (!getName().equals(mf.getName()))
+ return false;
+ if (!getModuleRelativePath().equals(mf.getModuleRelativePath()))
+ return false;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return getName().hashCode() * 37 + getModuleRelativePath().hashCode();
+ }
+ }
+
+ public static class ComponentModuleFolder extends ComponentModuleResource implements
IModuleFolder {
+ public ComponentModuleFolder(IFlatResource resource) {
+ super(resource);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this)
+ return true;
+
+ if (!(obj instanceof IModuleFolder))
+ return false;
+
+ IModuleFolder mf = (IModuleFolder) obj;
+ if (!getName().equals(mf.getName()))
+ return false;
+ if (!getModuleRelativePath().equals(mf.getModuleRelativePath()))
+ return false;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return getName().hashCode() * 37 + getModuleRelativePath().hashCode();
+ }
+
+ }
+
+ protected static boolean isProjectOfType(IProject project, String typeID) {
+ IFacetedProject facetedProject = null;
+ try {
+ facetedProject = ProjectFacetsManager.create(project);
+ } catch (CoreException e) {
+ return false;
+ }
+
+ if (facetedProject !=null &&
ProjectFacetsManager.isProjectFacetDefined(typeID)) {
+ IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(typeID);
+ return projectFacet!=null && facetedProject.hasProjectFacet(projectFacet);
+ }
+ return false;
+ }
+}
Added:
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/Messages.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/Messages.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/Messages.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -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/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/messages.properties
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/messages.properties
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/module/messages.properties 2011-02-17
23:25:16 UTC (rev 29228)
@@ -0,0 +1 @@
+InvalidFileExtension=BPEL module file resource must end with bpel file extension.
Added:
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/publishers/GenericBPELPublisher.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/publishers/GenericBPELPublisher.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/publishers/GenericBPELPublisher.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -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/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/BPELFacetInstallPage.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/BPELFacetInstallPage.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/BPELFacetInstallPage.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -0,0 +1,46 @@
+package org.eclipse.bpel.runtimes.ui.wizards;
+
+import org.eclipse.bpel.runtimes.IBPELModuleFacetConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.project.facet.ui.IFacetWizardPage;
+import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetInstallPage;
+
+public class BPELFacetInstallPage extends DataModelFacetInstallPage implements
+ IFacetWizardPage {
+
+ private Label contentDirLabel;
+ private Text contentDir;
+ public BPELFacetInstallPage() {
+ super("Test BPEL");
+ setTitle("BPEL Title");
+ setDescription("BPEL Description");
+ }
+
+ @Override
+ protected String[] getValidationPropertyNames() {
+ return new String[]{IBPELModuleFacetConstants.BPEL_CONTENT_FOLDER};
+ }
+
+ @Override
+ protected Composite createTopLevelComposite(Composite parent) {
+ final Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(2, false));
+ this.contentDirLabel = new Label(composite, SWT.NONE);
+ this.contentDirLabel.setText("Content Folder");
+ this.contentDirLabel.setLayoutData(new GridData());
+
+ this.contentDir = new Text(composite, SWT.BORDER);
+ this.contentDir.setLayoutData(gdhfill());
+ this.contentDir.setData("label", this.contentDirLabel); //$NON-NLS-1$
+ this.synchHelper.synchText(contentDir, IBPELModuleFacetConstants.BPEL_CONTENT_FOLDER,
null);
+ this.contentDir.setText(IBPELModuleFacetConstants.BPEL_CONTENT_DEFAULT_FOLDER);
+ new Label(composite, SWT.NONE); // pad
+ return composite;
+ }
+
+}
Added:
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/Messages.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/Messages.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/Messages.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -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/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizard.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizard.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizard.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -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/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizardPage1.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizardPage1.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/NewBPELProjectWizardPage1.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -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/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/messages.properties
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/messages.properties
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/ui/wizards/messages.properties 2011-02-17
23:25:16 UTC (rev 29228)
@@ -0,0 +1,2 @@
+NewProjectWizard_1=New BPEL Project
+NewProjectWizardPage1_1=Create a new BPEL 2.0 project.
Added:
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/utils/BPELModelUtils.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/utils/BPELModelUtils.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/utils/BPELModelUtils.java 2011-02-17
23:25:16 UTC (rev 29228)
@@ -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;
+ }
+}