Author: bbrodt
Date: 2010-11-15 13:04:29 -0500 (Mon, 15 Nov 2010)
New Revision: 26573
Added:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.classpath
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.cvsignore
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.project
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.settings/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.settings/org.eclipse.jdt.core.prefs
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/META-INF/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/META-INF/MANIFEST.MF
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/bin/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/build.properties
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/buildfiles/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/buildfiles/riftsaw2x.xml
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/definition/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/definition/riftsaw2x.xml
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/ctool16/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/ctool16/new_bpelprj.gif
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/obj16/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/obj16/bpelfacet.gif
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/obj16/prj_bpel.gif
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/obj16/riftsaw.gif
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/wizban/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/wizban/newprj_bpel_wiz_banner.gif
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/plugin.properties
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/plugin.xml
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/pom.xml
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/RiftsawServerRuntime.java
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/RuntimesPlugin.java
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/module/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/module/JBTBPELModuleFactoryDelegate.java
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/module/JBTBPELPublisher.java
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/view/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/view/server/
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/view/server/BPELModuleActionProvider.java
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/view/server/BPELModuleContentProvider.java
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/view/server/BPELModuleLabelProvider.java
Log:
OPEN - issue JBIDE-6588: BPEL deployment to ODE running in Tomcat
https://jira.jboss.org/browse/JBIDE-6588
generic server deployment for jboss/riftsaw
Added: workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.classpath
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.classpath
(rev 0)
+++ workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.classpath 2010-11-15 18:04:29
UTC (rev 26573)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.cvsignore
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.cvsignore
(rev 0)
+++ workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.cvsignore 2010-11-15 18:04:29
UTC (rev 26573)
@@ -0,0 +1 @@
+bin
Added: workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.project
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.project
(rev 0)
+++ workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.project 2010-11-15 18:04:29
UTC (rev 26573)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.bpel.jboss.riftsaw.runtime</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>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
Added:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/.settings/org.eclipse.jdt.core.prefs 2010-11-15
18:04:29 UTC (rev 26573)
@@ -0,0 +1,8 @@
+#Tue Oct 20 16:01:25 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.jboss.riftsaw.runtime/META-INF/MANIFEST.MF
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/META-INF/MANIFEST.MF
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/META-INF/MANIFEST.MF 2010-11-15
18:04:29 UTC (rev 26573)
@@ -0,0 +1,45 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.jboss.tools.bpel.runtimes;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.bpel.jboss.riftsaw.runtime.RuntimesPlugin
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.wst.server.core,
+ org.eclipse.wst.web.ui,
+ org.eclipse.wst.common.project.facet.ui,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.wst.common.frameworks,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.wst.common.frameworks.ui,
+ org.eclipse.jst.server.generic.core,
+ org.eclipse.jst.server.core;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.jst.server.generic.ui;bundle-version="[1.0.305,2.0.0)",
+ org.eclipse.jst.server.ui;bundle-version="[1.0.303,2.0.0)",
+ org.eclipse.jst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)",
+ org.eclipse.jem.util,
+ org.eclipse.debug.ui,
+ org.eclipse.bpel.model,
+ org.eclipse.emf.ecore,
+ org.eclipse.wst.wsdl,
+ javax.wsdl,
+ org.eclipse.jst.common.frameworks,
+ org.jboss.ide.eclipse.as.wtp.core,
+ org.eclipse.wst.web,
+ org.jboss.ide.eclipse.as.core;resolution:=optional,
+ org.jboss.ide.eclipse.archives.webtools;resolution:=optional,
+ org.eclipse.wst.server.ui;resolution:=optional,
+ org.eclipse.ui.navigator,
+ org.jboss.ide.eclipse.as.ui;bundle-version="2.2.0",
+ org.jboss.ide.eclipse.as.wtp.ui;bundle-version="2.2.0",
+ org.eclipse.bpel.runtimes;bundle-version="0.5.0",
+ org.jboss.tools.jmx.core;bundle-version="1.2.0"
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.bpel.jboss.riftsaw.runtime,
+ org.eclipse.bpel.jboss.riftsaw.runtime.module
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Added: workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/build.properties
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/build.properties
(rev 0)
+++ workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/build.properties 2010-11-15
18:04:29 UTC (rev 26573)
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.*,\
+ icons/
Added: workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/buildfiles/riftsaw2x.xml
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/buildfiles/riftsaw2x.xml
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/buildfiles/riftsaw2x.xml 2010-11-15
18:04:29 UTC (rev 26573)
@@ -0,0 +1,22 @@
+<project name="deployextension" default="deploy.bpel"
basedir=".">
+ <property name="pause.deploy" value="2"/>
+ <property name="pause.undeploy" value="2"/>
+ <property name="version" value="1" />
+
+ <target name="deploy.bpel">
+ <jar compress="false"
destfile="${project.working.dir}/${module.name}.jar">
+ <zipfileset dir="${module.dir}">
+ <include name="**/*.*"/>
+ <exclude name="**/*.java"/>
+ </zipfileset>
+ </jar>
+ <move file="${project.working.dir}/${module.name}-${version}.jar"
todir="${server.publish.dir}"/>
+ <sleep seconds="${pause.deploy}"/>
+ </target>
+
+ <target name="undeploy.bpel">
+ <delete file="${server.publish.dir}/${module.name}-${version}.jar"
failonerror="false"> </delete>
+ <sleep seconds="${pause.undeploy}"/>
+ </target>
+
+</project>
\ No newline at end of file
Added: workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/definition/riftsaw2x.xml
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/definition/riftsaw2x.xml
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/definition/riftsaw2x.xml 2010-11-15
18:04:29 UTC (rev 26573)
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<tns:ServerRuntime
+
xmlns:tns="http://eclipse.org/jst/server/generic/ServerTypeDefinitio...
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://eclipse.org/jst/server/generic/ServerType...
ServerTypeDefinitionSchema.xsd "
+ name="JBoss Riftsaw" version="v2.x">
+
+ <property id="serverRootDirectory"
+ label="%jbossHome"
+ type="directory"
+ context="runtime"
+ default="/your_server_root" />
+
+ <property id="serverAddress"
+ label="%serverAddress"
+ type="string"
+ context="runtime"
+ default="127.0.0.1" />
+
+ <property id="port"
+ label="%port"
+ type="string"
+ context="runtime"
+ default="8080" />
+
+ <property id="serverConfig"
+ label="%jbossServerConfig"
+ type="combo"
+ context="runtime"
+ default="default,all,minimal,other - type your own here" />
+
+ <port>
+ <no>${port}</no>
+ <name>Http</name>
+ <protocol>http</protocol>
+ </port>
+
+ <module>
+ <type>bpel.module</type>
+ <publishDir>${jboss.home}/server/${serverConfig}/deploy</publishDir>
+ <publisherReference>org.eclipse.jboss.tools.bpel.runtimes.module</publisherReference>
+ </module>
+
+ <project>
+ <classpathReference>riftsaw.project</classpathReference>
+ </project>
+
+ <start>
+ <mainClass>org.jboss.Main</mainClass>
+ <workingDirectory>${serverRootDirectory}/bin</workingDirectory>
+ <programArguments>-c ${serverConfig}</programArguments>
+ <vmParameters>-Dprogram.name=run.bat -Xms128m -Xmx512m
-XX:MaxPermSize=256m</vmParameters>
+ <classpathReference>jboss</classpathReference>
+ </start>
+
+ <stop>
+ <mainClass>org.jboss.Shutdown</mainClass>
+ <workingDirectory>${serverRootDirectory}/bin</workingDirectory>
+ <programArguments>-S</programArguments>
+ <vmParameters>-Djboss.boot.loader.name=shutdown.bat</vmParameters>
+ <classpathReference>jboss.shutdown</classpathReference>
+ </stop>
+
+ <publisher id="org.eclipse.jst.server.generic.antpublisher">
+ <publisherdata>
+ <dataname>build.file</dataname>
+ <datavalue>/buildfiles/riftsaw2x.xml</datavalue>
+ </publisherdata>
+ <publisherdata>
+ <dataname>target.publish.bpel</dataname>
+ <datavalue>deploy.bpel</datavalue>
+ </publisherdata>
+ <publisherdata>
+ <dataname>target.unpublish.bpel</dataname>
+ <datavalue>undeploy.bpel</datavalue>
+ </publisherdata>
+ </publisher>
+
+ <classpath id="jboss" >
+ <archive path="${serverRootDirectory}/bin/run.jar" />
+ </classpath>
+ <classpath id="jboss.shutdown" >
+ <archive path="${serverRootDirectory}/bin/shutdown.jar" />
+ </classpath>
+
+ <classpath id="jboss.project" >
+
+
+ <fileset dir="${serverRootDirectory}">
+ <include name="client/*.jar" />
+ <include name="server/default/lib/*.jar" />
+
+ <include name="server/default/deploy/jbossweb.sar/jsf-libs/*.jar"
/>
+
+ <!-- This will be ignored if EJB3 is not there 5.0 -->
+ <include name="lib/*.jar" />
+ <include name="server/default/deployers/jbossweb.deployer/*.jar"
/>
+ <include
name="server/default/deployers/jboss-aop-jboss5.deployer/*.jar" />
+ <include name="common/lib/*.jar" />
+ <include name="server/default/deploy/jbossweb.sar/*.jar" />
+
+ <!-- for validation to work this library is defined as an archive -->
+ <exclude name="lib/jboss-kernel.jar" />
+ </fileset>
+
+ <!-- leave one generic jar as an archive so that validation works -->
+ <archive path="${serverRootDirectory}/lib/jboss-kernel.jar" />
+
+ </classpath>
+
+</tns:ServerRuntime>
\ No newline at end of file
Added:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/ctool16/new_bpelprj.gif
===================================================================
(Binary files differ)
Property changes on:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/ctool16/new_bpelprj.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/obj16/bpelfacet.gif
===================================================================
(Binary files differ)
Property changes on:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/obj16/bpelfacet.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/obj16/prj_bpel.gif
===================================================================
(Binary files differ)
Property changes on:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/obj16/prj_bpel.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/obj16/riftsaw.gif
===================================================================
(Binary files differ)
Property changes on:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/obj16/riftsaw.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/wizban/newprj_bpel_wiz_banner.gif
===================================================================
(Binary files differ)
Property changes on:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/icons/wizban/newprj_bpel_wiz_banner.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/plugin.properties
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/plugin.properties
(rev 0)
+++ workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/plugin.properties 2010-11-15
18:04:29 UTC (rev 26573)
@@ -0,0 +1,32 @@
+###############################################################################
+# Copyright (c) 2010 JBoss by 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
+#
+# Contributors:
+# University College London - initial API and implementation
+# JBoss by Red Hat - subsequent contributions and maintenance
+###############################################################################
+pluginName = Eclipse BPEL Designer Runtimes
+providerName = JBoss by Red Hat
+
+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.
+
+# used by wizard definitions in definition/riftsaw2x.xml
+pluginName = JBoss Riftsaw Runtime Adapter
+providerName = JBoss by Red Hat
+jbossHome = JBoss App Server home directory:
+jbossServerConfig = Server configuration:
+serverAddress = Server address:
+port = Port:
\ No newline at end of file
Added: workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/plugin.xml
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/plugin.xml
(rev 0)
+++ workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/plugin.xml 2010-11-15 18:04:29
UTC (rev 26573)
@@ -0,0 +1,262 @@
+<?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>
+
+<!--=========================================================================-->
+<!-- BPEL ModuleType -->
+<!--=========================================================================-->
+
+ <extension point="org.eclipse.wst.server.core.moduleTypes">
+ <moduleType
+ id="jbt.bpel.module"
+ name="%MODULE_TYPE_NAME">
+ </moduleType>
+ </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.jboss.tools.bpel.runtimes.jbt.bpel.module"
+ typeIds="jbt.bpel.module"
+ icon="icons/obj16/bpelfacet.gif"/>
+ </extension>
+
+<!--=========================================================================-->
+<!-- BPEL Module Factory -->
+<!--=========================================================================-->
+
+ <extension
+ point="org.eclipse.wst.server.core.moduleFactories">
+ <moduleFactory
+ projects="true"
+
class="org.eclipse.bpel.jboss.riftsaw.runtime.module.JBTBPELModuleFactoryDelegate"
+ id="org.jboss.tools.bpel.runtimes.module.moduleFactory">
+ <moduleType
+ versions="1.1, 2.0"
+ types="jbt.bpel.module">
+ </moduleType>
+ <moduleType
+ versions="1.1, 2.0"
+ types="bpel.module">
+ </moduleType>
+ </moduleFactory>
+ </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. -->
+<!-- -->
+<!-- -->
+<!-- -->
+<!--=========================================================================-->
+
+ <extension
+ point="org.eclipse.ui.navigator.navigatorContent">
+ <navigatorContent
+ id="org.jboss.tools.bpel.runtimes.ui.view.server.content"
+ activeByDefault="true"
+
contentProvider="org.jboss.tools.bpel.runtimes.ui.view.server.BPELModuleContentProvider"
+ icon="icons/obj16/bpelfacet.gif"
+
labelProvider="org.jboss.tools.bpel.runtimes.ui.view.server.BPELModuleLabelProvider"
+ name="BPEL Modules"
+ priority="highest">
+ <triggerPoints>
+ <instanceof
+ value="java.lang.Object">
+ </instanceof>
+ </triggerPoints>
+ <possibleChildren>
+ <instanceof
+ value="java.lang.Object">
+ </instanceof>
+ </possibleChildren>
+ <actionProvider
+
class="org.jboss.tools.bpel.runtimes.ui.view.server.BPELModuleActionProvider"
+
id="org.jboss.tools.bpel.runtimes.ui.view.server.BPELModuleActionProvider"
+ priority="highest">
+ <enablement>
+ <or>
+ <instanceof
+ value="org.eclipse.wst.server.core.IServer">
+ </instanceof>
+ <instanceof
+
value="org.eclipse.wst.server.ui.internal.view.servers.ModuleServer">
+ </instanceof>
+ <instanceof
+ value="org.eclipse.core.resources.IWorkspaceRoot">
+ </instanceof>
+ <adapt type="java.util.Collection">
+ <count value="0"/>
+ </adapt>
+ <instanceof
+
value="org.jboss.tools.bpel.runtimes.ui.view.server.BPELModuleContentProvider$BPELVersionDeployment">
+ </instanceof>
+ </or>
+ </enablement>
+ </actionProvider>
+ </navigatorContent>
+ </extension>
+ <extension
+ point="org.eclipse.ui.navigator.viewer">
+ <viewerContentBinding
+ viewerId="org.eclipse.wst.server.ui.ServersView">
+ <includes>
+ <contentExtension
+ isRoot="true"
+
pattern="org.jboss.tools.bpel.runtimes.ui.view.server.content">
+ </contentExtension>
+ </includes>
+ </viewerContentBinding>
+ </extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.core.publishers">
+ <publisher
+
class="org.eclipse.bpel.jboss.riftsaw.runtime.module.JBTBPELPublisher"
+ priority="10"
+ zipDelegate="false">
+ </publisher>
+ </extension>
+
+ <extension point="org.eclipse.wst.server.core.runtimeTypes">
+ <runtimeType
+ id="org.jboss.riftsaw.runtime.rt"
+ name="JBoss Riftsaw 2.x"
+ description="JBoss Riftsaw 2.x WS-BPEL execution engine - Runtime"
+ vendor="JBoss Community"
+ version="2.2"
+
class="org.eclipse.bpel.jboss.riftsaw.runtime.RiftsawServerRuntime">
+ <moduleType
+ types="bpel.module"
+ versions="1.1, 2.0"/>
+ </runtimeType>
+ </extension>
+
+ <extension point="org.eclipse.wst.server.core.serverTypes">
+ <serverType
+ runtime="true"
+ class="org.eclipse.jst.server.generic.core.internal.GenericServer"
+ id="org.jboss.riftsaw.runtime.st"
+ initialState="stopped"
+ supportsRemoteHosts="true"
+ runtimeTypeId="org.jboss.riftsaw.runtime.rt"
+ description="JBoss Riftsaw 2.x WS-BPEL execution engine - Server"
+ launchConfigId="org.eclipse.jst.server.generic.core.launchConfigurationType"
+ behaviourClass="org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour"
+ name="JBoss Riftsaw 2.x Server"
+ hasConfiguration="false"
+ startTimeout="480000"
+ stopTimeout="60000"
+ launchModes="run, debug"
+ startBeforePublish="true">
+ </serverType>
+ </extension>
+
+ <extension point="org.eclipse.wst.server.ui.serverImages">
+ <image
+ id="org.eclipse.jst.server.generic.image"
+ icon="icons/obj16/riftsaw.gif"
+ typeIds="org.jboss.riftsaw.runtime.rt"/>
+ <image
+ id="org.eclipse.jst.server.generic.image"
+ icon="icons/obj16/riftsaw.gif"
+ typeIds="org.jboss.riftsaw.runtime.st"/>
+ </extension>
+
+<!-- -->
+ <extension
point="org.eclipse.wst.common.project.facet.core.runtimes">
+ <runtime-component-type
+ id="org.jboss.riftsaw.runtime.rt"/>
+
+ <runtime-component-version
+ type="org.jboss.riftsaw.runtime.rt"
+ version="2.0"/>
+
+ <adapter>
+ <runtime-component
+ id="org.jboss.riftsaw.runtime.rt"/>
+ <factory
+ class="org.eclipse.jst.server.core.internal.RuntimeClasspathProvider$Factory"/>
+ <type
+ class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
+ </adapter>
+
+ <supported>
+ <runtime-component
+ id="org.jboss.riftsaw.runtime.rt"
+ version="2.0"/>
+ <facet
+ id="bpel.facet.core"
+ version="2.0"/>
+ </supported>
+ </extension>
+ <extension point="org.eclipse.wst.common.project.facet.ui.images">
+ <image
+ runtime-component-type="org.jboss.riftsaw.runtime.rt"
+ path="icons/obj16/riftsaw.gif"/>
+ </extension>
+
+
+ <extension point="org.eclipse.wst.common.project.facet.core.runtimes">
+ <adapter>
+ <runtime-component id="org.jboss.riftsaw.runtime.rt"/>
+ <factory
class="org.eclipse.jst.server.ui.internal.RuntimeLabelProvider$Factory"/>
+ <type
class="org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLabelProvider"/>
+ </adapter>
+ </extension>
+
+ <extension point="org.eclipse.jst.server.core.runtimeFacetMappings">
+ <runtimeFacetMapping
+ runtimeTypeId="org.jboss.riftsaw.runtime.rt"
+ runtime-component="org.jboss.riftsaw.runtime.rt"
+ version="2.0"/>
+ </extension>
+
+ <extension
point="org.eclipse.jst.server.generic.core.serverdefinition">
+ <serverdefinition id="org.jboss.riftsaw.runtime.rt"
definitionfile="definition/riftsaw2x.xml">
+ </serverdefinition>
+ </extension>
+ <extension point="org.eclipse.wst.server.ui.wizardFragments">
+ <fragment
+ id="org.eclipse.jst.server.generic.runtime"
+ typeIds="org.jboss.riftsaw.runtime.rt"
+ class="org.eclipse.jst.server.generic.ui.internal.GenericServerRuntimeWizardFragment"/>
+ <fragment
+ id="org.eclipse.jst.server.generic.server"
+ typeIds="org.jboss.riftsaw.runtime.st"
+ class="org.eclipse.jst.server.generic.ui.internal.GenericServerWizardFragment"/>
+ </extension>
+
+
+ <extension
point="org.eclipse.wst.common.project.facet.core.runtimes">
+ <supported>
+ <runtime-component id="org.jboss.riftsaw.runtime.rt"
version="2.2"/>
+ <facet id="bpel.facet.core" version="1.1,2.0"/>
+ </supported>
+ </extension>
+
+</plugin>
Added: workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/pom.xml
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/pom.xml
(rev 0)
+++ workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/pom.xml 2010-11-15 18:04:29
UTC (rev 26573)
@@ -0,0 +1,13 @@
+<project
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.bpel.plugins</groupId>
+ <artifactId>org.eclipse.bpel.jboss.riftsaw.runtime</artifactId>
+ <version>0.6.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
Added:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/RiftsawServerRuntime.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/RiftsawServerRuntime.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/RiftsawServerRuntime.java 2010-11-15
18:04:29 UTC (rev 26573)
@@ -0,0 +1,17 @@
+package org.eclipse.bpel.jboss.riftsaw.runtime;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jst.server.generic.core.internal.GenericServerRuntime;
+import org.eclipse.bpel.runtimes.IBPELRuntimeDelegate;
+// import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
+
+public class RiftsawServerRuntime extends GenericServerRuntime implements
IBPELRuntimeDelegate {
+
+ public String getPort()
+ {
+ Map m = getAttribute("generic_server_attributes", new HashMap());
+ return (String)m.get("port");
+ }
+}
Added:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/RuntimesPlugin.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/RuntimesPlugin.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/RuntimesPlugin.java 2010-11-15
18:04:29 UTC (rev 26573)
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * 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.jboss.riftsaw.runtime;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.bpel.runtimes.IRuntimesUIConstants;
+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.jboss.riftsaw.runtime"; //$NON-NLS-1$
+
+ //The shared instance.
+ private static RuntimesPlugin plugin;
+
+ private boolean imagesInitialized = false;
+
+ /**
+ * The constructor.
+ */
+ public RuntimesPlugin() {
+ super();
+ plugin = this;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ *
+ * @return the shared instance.
+ */
+ public static RuntimesPlugin getPlugin() {
+ return plugin;
+ }
+
+ @Override
+ public ImageRegistry getImageRegistry() {
+ ImageRegistry result = super.getImageRegistry();
+ initialize();
+ return result;
+ }
+
+ /**
+ * Returns the image descriptor for the given image ID.
+ * Returns null if there is no such image.
+ */
+ public ImageDescriptor getImageDescriptor(String id) {
+ return getImageRegistry().getDescriptor(id);
+ }
+
+ public Image getImage(String id) {
+ return getImageRegistry().get(id);
+ }
+
+ /**
+ * Creates an image descriptor and places it in the image registry.
+ */
+ private void createImageDescriptor(String id, URL baseURL) {
+ URL url = null;
+ try {
+ url = new URL(baseURL, IRuntimesUIConstants.ICON_PATH + id);
+ } catch (MalformedURLException e) {
+ RuntimesPlugin.log(e);
+ }
+ ImageDescriptor desc = ImageDescriptor.createFromURL(url);
+ getImageRegistry().put(id, desc);
+ }
+
+ protected void initialize() {
+ if (!imagesInitialized) {
+ imagesInitialized = true;
+ initializeImages();
+ }
+ }
+
+ /**
+ * Initializes the table of images used in this plugin.
+ */
+ private void initializeImages() {
+ URL baseURL = getBundle().getEntry("/"); //$NON-NLS-1$
+
+ // TODO make sure you initialize all required icons here
+ createImageDescriptor(IRuntimesUIConstants.ICON_NEWPRJ_WIZARD_BANNER, baseURL);
+ createImageDescriptor(IRuntimesUIConstants.ICON_BPEL_NEW_PRJ, baseURL);
+ createImageDescriptor(IRuntimesUIConstants.ICON_BPEL_PRJ, baseURL);
+ }
+
+ /**
+ * Utility methods for logging exceptions.
+ */
+ public static void log(Exception e, int severity) {
+ IStatus status = null;
+ if (e instanceof CoreException) {
+ status = ((CoreException)e).getStatus();
+ } else {
+ String m = e.getMessage();
+ status = new Status(severity, PLUGIN_ID, 0, m==null? "<no message>" :
m, e); //$NON-NLS-1$
+ }
+ System.out.println(e.getClass().getName()+": "+status); //$NON-NLS-1$
+ RuntimesPlugin.getPlugin().getLog().log(status);
+ }
+
+ public static void log(Exception e) {
+ log(e, IStatus.ERROR);
+ }
+}
Added:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/module/JBTBPELModuleFactoryDelegate.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/module/JBTBPELModuleFactoryDelegate.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/module/JBTBPELModuleFactoryDelegate.java 2010-11-15
18:04:29 UTC (rev 26573)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpel.jboss.riftsaw.runtime.module;
+
+import org.eclipse.bpel.runtimes.module.BPELModuleFactoryDelegate;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.model.ModuleDelegate;
+import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
+
+/**
+ * The purpose of this class is to redirect requests to locate an
+ * already-migrated project module. For example, if a project
+ * previously was of module-type jbt.bpel.module and has since been
+ * migrated properly, old servers may still search for a jbt.bpel.module
+ * module ID.
+ *
+ * This factory does not create any modules, but rather only returns
+ * new modules from the eclipse bpel factory when the server is requesting
+ * a legacy id.
+ */
+public class JBTBPELModuleFactoryDelegate extends ModuleFactoryDelegate {
+ public static final String FACTORY_ID =
"org.eclipse.bpel.jboss.riftsaw.runtime.module.moduleFactory";
+ public static final String LEGACY_MODULE_TYPE = "jbt.bpel.module";
+
+ public JBTBPELModuleFactoryDelegate() {
+ super();
+ }
+
+ @Override
+ public ModuleDelegate getModuleDelegate(IModule module) {
+ return BPELModuleFactoryDelegate.factoryInstance().getModuleDelegate(module);
+ }
+
+ @Override
+ public IModule[] getModules() {
+ return new IModule[]{};
+ }
+
+ @Override
+ public IModule findModule(String id) {
+ return BPELModuleFactoryDelegate.factoryInstance().findModule(id);
+ }
+}
\ No newline at end of file
Property changes on:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/module/JBTBPELModuleFactoryDelegate.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/module/JBTBPELPublisher.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/module/JBTBPELPublisher.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/module/JBTBPELPublisher.java 2010-11-15
18:04:29 UTC (rev 26573)
@@ -0,0 +1,309 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpel.jboss.riftsaw.runtime.module;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Iterator;
+
+import org.eclipse.bpel.runtimes.IBPELModuleFacetConstants;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.IModuleResourceDelta;
+import org.jboss.ide.eclipse.archives.webtools.modules.LocalZippedPublisherUtil;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
+import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
+import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
+import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.LocalCopyCallback;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.core.util.IWTPConstants;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.tools.jmx.core.IMemento;
+import org.jboss.tools.jmx.core.util.XMLMemento;
+
+/**
+ * This class allows you to publish a BPEL module specifically
+ * to a JBossTools server entity.
+ * @author rob.stryker(a)jboss.com
+ *
+ */
+public class JBTBPELPublisher implements IJBossServerPublisher {
+ private IServer server;
+ private int publishState = IServer.PUBLISH_STATE_INCREMENTAL;
+ public JBTBPELPublisher() {
+ }
+
+ public int getPublishState() {
+ return publishState;
+ }
+
+ public boolean accepts(String method, IServer server, IModule[] module) {
+ if( LocalPublishMethod.LOCAL_PUBLISH_METHOD.equals(method)
+ && module != null && module.length > 0
+ && module[module.length-1] != null ) {
+ String typeId =module[module.length-1].getModuleType().getId();
+ if( typeId.equals(IBPELModuleFacetConstants.BPEL20_MODULE_TYPE))
+ return true;
+ if( typeId.equals(JBTBPELModuleFactoryDelegate.LEGACY_MODULE_TYPE))
+ return true;
+ }
+ return false;
+ }
+
+ public IStatus publishModule(
+ IJBossServerPublishMethod method,
+ IServer server, IModule[] module,
+ int publishType, IModuleResourceDelta[] delta,
+ IProgressMonitor monitor) throws CoreException {
+
+ this.server = server;
+ IModule last = module[module.length-1];
+ IStatus status = null;
+ if(publishType == REMOVE_PUBLISH){
+ removeAll(server, last.getProject());
+ } else if( publishType == FULL_PUBLISH ){
+ // Publish a new version forced
+ status = publish(module, delta, publishType, monitor);
+ publishState = IServer.PUBLISH_STATE_NONE;
+ } else if( publishType == INCREMENTAL_PUBLISH ) {
+ // Do nothing. This is intentional
+ publishState = IServer.PUBLISH_STATE_INCREMENTAL;
+ }
+ return status == null ? Status.OK_STATUS : status;
+ }
+
+
+ protected IStatus publish(IModule[] moduleTree,
+ IModuleResourceDelta[] delta, int publishType, IProgressMonitor monitor) throws
CoreException {
+ ArrayList<IStatus> resultList = new ArrayList<IStatus>();
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ IModule last = moduleTree[moduleTree.length -1];
+ IPath deployPath = getDeployPath(moduleTree, ds);
+ IPath tempDeployPath = PublishUtil.getTempDeployFolder(moduleTree, ds);
+ IModuleResource[] members = PublishUtil.getResources(last);
+ if( shouldZip() ) {
+ String deployRoot = PublishUtil.getDeployRootFolder(
+ moduleTree, ds, ds.getDeployFolder(),
+ IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
+ BPELZippedPublisherUtil util = new BPELZippedPublisherUtil(deployPath);
+ IStatus ret = util.publishModule(server, deployRoot, moduleTree, publishType, delta,
monitor);
+ resultList.add(ret);
+ } else {
+ LocalCopyCallback handler = new LocalCopyCallback(server, deployPath,
tempDeployPath);
+ PublishCopyUtil util = new PublishCopyUtil(handler);
+ resultList.addAll(Arrays.asList(util.initFullPublish(members, monitor)));
+ }
+ addDeployedPathToDescriptor(server, last.getProject(), deployPath); // persist it
+ pruneList(resultList);
+ if( resultList.size() > 0 ) {
+ MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FULL_FAIL,
+ NLS.bind(Messages.FullPublishFail, last.getName()), null);
+ for( int i = 0; i < resultList.size(); i++ )
+ ms.add(resultList.get(i));
+ return ms;
+ }
+ return Status.OK_STATUS;
+ }
+
+ // Prune out ok status
+ protected void pruneList(ArrayList<IStatus> list) {
+ Iterator<IStatus> i = list.iterator();
+ while(i.hasNext()) {
+ if( i.next().isOK())
+ i.remove();
+ }
+ }
+
+ protected boolean shouldZip() {
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ return ds == null || ds.zipsWTPDeployments();
+ }
+
+ public static IPath getDeployPath(IModule[] moduleTree, IDeployableServer server) {
+ IPath path = PublishUtil.getDeployPath(moduleTree, server);
+ path = path.removeLastSegments(1).append(getNewLastSegment(moduleTree));
+ return path;
+ }
+
+ public static String getNewLastSegment(IModule[] moduleTree) {
+ IModule last = moduleTree[moduleTree.length-1];
+ Calendar cal = Calendar.getInstance();
+ StringBuffer lastSeg = new StringBuffer(formatString(cal.get(Calendar.YEAR)));
+ lastSeg.append(formatString(cal.get(Calendar.MONTH) + 1));
+ lastSeg.append(formatString(cal.get(Calendar.DAY_OF_MONTH)));
+ lastSeg.append(formatString(cal.get(Calendar.HOUR_OF_DAY)));
+ lastSeg.append(formatString(cal.get(Calendar.MINUTE)));
+ lastSeg.append(formatString(cal.get(Calendar.SECOND)));
+
+
+ return last.getName() + "-" + lastSeg.toString() + IWTPConstants.EXT_JAR;
+ }
+
+ private static String formatString(int dateUnit){
+ if(String.valueOf(dateUnit).length() < 2){
+ return "0" + dateUnit;
+ }
+
+ return String.valueOf(dateUnit);
+ }
+
+ private static final String DEPLOYMENTS = "deployments";
+ private static final String PROJECT = "project";
+ private static final String NAME = "name";
+ private static final String VERSION = "version";
+
+ protected static void save(IServer server, XMLMemento memento) {
+ try {
+ memento.save(new FileOutputStream(getDeployDetailsFile(server)));
+ } catch( IOException ioe) {
+ // TODO LOG
+ }
+ }
+
+ public static void removeAll(IServer server, IProject project) {
+ String[] paths = getDeployedPathsFromDescriptor(server, project);
+ for( int i = 0; i < paths.length; i++ ) {
+ // remove them all, with full force!!! >=[
+ FileUtil.safeDelete(new File(paths[i]));
+ }
+ removeProjectFromDescriptor(server, project);
+ }
+
+ public static void removeVersion(IServer server, IProject project, String path) {
+ // delete file
+ FileUtil.safeDelete(new File(path));
+ // remove from descriptor
+ removeVersionFromDescriptor(server, project, path);
+ }
+
+ public static void removeVersionFromDescriptor(IServer server, IProject project, String
path) {
+ File f = getDeployDetailsFile(server);
+ XMLMemento memento = null;
+ try {
+ memento = XMLMemento.createReadRoot(new FileInputStream(f));
+ IMemento[] projects = memento.getChildren(PROJECT);//$NON-NLS-1$
+ for( int i = 0; i < projects.length; i++ ) {
+ if( project.getName().equals(projects[i].getString(NAME)) ) {
+ IMemento[] versions = projects[i].getChildren(VERSION);
+ for( int j = 0; j < versions.length; j++ ) {
+ if( ((XMLMemento)versions[j]).getTextData().equals(path)) {
+ ((XMLMemento)projects[i]).removeChild((XMLMemento)versions[j]);
+ }
+ }
+ }
+ }
+ save(server, memento);
+ } catch( FileNotFoundException fnfe) {}
+ }
+
+ public static void removeProjectFromDescriptor(IServer server, IProject project) {
+ File f = getDeployDetailsFile(server);
+ XMLMemento memento = null;
+ try {
+ memento = XMLMemento.createReadRoot(new FileInputStream(f));
+ IMemento[] projects = memento.getChildren(PROJECT);//$NON-NLS-1$
+ for( int i = 0; i < projects.length; i++ ) {
+ if( project.getName().equals(projects[i].getString(NAME)) ) {
+ memento.removeChild((XMLMemento)projects[i]);
+ }
+ }
+ save(server, memento);
+ } catch( FileNotFoundException fnfe) {}
+ }
+
+ public static void addDeployedPathToDescriptor(IServer server, IProject project, IPath
path) {
+ File f = getDeployDetailsFile(server);
+ XMLMemento memento = null;
+ try {
+ memento = XMLMemento.createReadRoot(new FileInputStream(f));
+ } catch( FileNotFoundException fnfe) {}
+
+ if( memento == null )
+ memento = XMLMemento.createWriteRoot(DEPLOYMENTS);
+
+ IMemento[] projects = memento.getChildren(PROJECT);//$NON-NLS-1$
+ boolean projectFound = false;
+ for( int i = 0; i < projects.length; i++ ) {
+ if( project.getName().equals(projects[i].getString(NAME))) {
+ projectFound = true;
+ XMLMemento child = (XMLMemento)projects[i].createChild(VERSION);
+ child.putTextData(path.toOSString());
+ }
+ }
+ if( !projectFound ) {
+ XMLMemento proj = (XMLMemento)memento.createChild(PROJECT);
+ proj.putString(NAME, project.getName());
+ XMLMemento child = (XMLMemento)proj.createChild(VERSION);
+ child.putTextData(path.toOSString());
+ }
+ save(server, memento);
+ }
+
+ public static String[] getDeployedPathsFromDescriptor(IServer server, IProject project)
{
+ File f = getDeployDetailsFile(server);
+ ArrayList<String> list = new ArrayList<String>();
+ if( f.exists() ) {
+ try {
+ XMLMemento memento = XMLMemento.createReadRoot(new FileInputStream(f));
+ IMemento[] projects = memento.getChildren(PROJECT);//$NON-NLS-1$
+ for( int i = 0; i < projects.length; i++ ) {
+ if( project.getName().equals(projects[i].getString(NAME))) {
+ IMemento[] deployments = projects[i].getChildren(VERSION);
+ for( int j = 0; j < deployments.length; j++ ) {
+ String s = ((XMLMemento)deployments[j]).getTextData();
+ if( s != null && !s.equals(""))
+ list.add(s);
+ }
+ break;
+ }
+ }
+ } catch( FileNotFoundException fnfe) {}
+ }
+ return (String[]) list.toArray(new String[list.size()]);
+ }
+
+ public static File getDeployDetailsFile(IServer server) {
+ return JBossServerCorePlugin.getServerStateLocation(server)
+ .append("bpel.deployment.versions").toFile();
+ }
+
+ public static class BPELZippedPublisherUtil extends LocalZippedPublisherUtil {
+ private IPath deployPath;
+ public BPELZippedPublisherUtil(IPath deployPath) {
+ this.deployPath = deployPath;
+ }
+ public IPath getOutputFilePath() {
+ return deployPath;
+ }
+ }
+}
Added:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/view/server/BPELModuleActionProvider.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/view/server/BPELModuleActionProvider.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/view/server/BPELModuleActionProvider.java 2010-11-15
18:04:29 UTC (rev 26573)
@@ -0,0 +1,103 @@
+package org.eclipse.bpel.jboss.riftsaw.runtime.ui.view.server;
+
+import org.eclipse.bpel.jboss.riftsaw.runtime.module.JBTBPELPublisher;
+import
org.eclipse.bpel.jboss.riftsaw.runtime.ui.view.server.BPELModuleContentProvider.BPELVersionDeployment;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+
+public class BPELModuleActionProvider extends CommonActionProvider {
+
+ private ICommonActionExtensionSite actionSite;
+ private Action undeployVersionAction;
+ private IStructuredSelection lastSelection;
+ public BPELModuleActionProvider() {
+ super();
+ }
+
+ public void dispose() {
+ super.dispose();
+ }
+
+ public void init(ICommonActionExtensionSite aSite) {
+ super.init(aSite);
+ this.actionSite = aSite;
+ createActions(aSite);
+ }
+
+ protected void createActions(ICommonActionExtensionSite aSite) {
+ ICommonViewerSite site = aSite.getViewSite();
+ if( site instanceof ICommonViewerWorkbenchSite ) {
+ StructuredViewer v = aSite.getStructuredViewer();
+ if( v instanceof CommonViewer ) {
+ CommonViewer cv = (CommonViewer)v;
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
+ undeployVersionAction = new Action() {
+ public void run() {
+ runUndeployVersion();
+ refreshViewer(getLastServer());
+ }
+ };
+ undeployVersionAction.setText("Undeploy Version");
+ undeployVersionAction.setDescription("Undeploy this version of the
module");
+ //undeployVersionAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.PUBLISH_IMAGE));
+ }
+ }
+ }
+
+ protected void runUndeployVersion() {
+ Object firstSel = lastSelection.getFirstElement();
+ if( firstSel instanceof BPELVersionDeployment ) {
+ BPELVersionDeployment deployment = (BPELVersionDeployment)firstSel;
+ JBTBPELPublisher.removeVersion(deployment.getModuleServer().server,
+ deployment.getProject(), deployment.getPath());
+ }
+ }
+
+ protected IServer getLastServer() {
+ Object firstSel = lastSelection.getFirstElement();
+ if( firstSel instanceof IServer )
+ return (IServer)firstSel;
+ if( firstSel instanceof ModuleServer )
+ return ((ModuleServer)firstSel).getServer();
+ if( firstSel instanceof BPELVersionDeployment )
+ return ((BPELVersionDeployment)firstSel).getModuleServer().getServer();
+ return null;
+ }
+
+ protected void refreshViewer(Object o) {
+ actionSite.getStructuredViewer().refresh(o);
+ }
+
+
+ public void fillContextMenu(IMenuManager menu) {
+ lastSelection = getSelection();
+ if( lastSelection.size() == 1 ) {
+ Object sel = lastSelection.getFirstElement();
+ if( sel instanceof BPELVersionDeployment )
+ menu.add(undeployVersionAction);
+ }
+ }
+
+ public IStructuredSelection getSelection() {
+ ICommonViewerSite site = actionSite.getViewSite();
+ IStructuredSelection selection = null;
+ if (site instanceof ICommonViewerWorkbenchSite) {
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite) site;
+ selection = (IStructuredSelection) wsSite.getSelectionProvider()
+ .getSelection();
+ return selection;
+ }
+ return new StructuredSelection();
+ }
+
+}
Added:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/view/server/BPELModuleContentProvider.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/view/server/BPELModuleContentProvider.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/view/server/BPELModuleContentProvider.java 2010-11-15
18:04:29 UTC (rev 26573)
@@ -0,0 +1,78 @@
+package org.eclipse.bpel.jboss.riftsaw.runtime.ui.view.server;
+
+import org.eclipse.bpel.jboss.riftsaw.runtime.module.JBTBPELModuleFactoryDelegate;
+import org.eclipse.bpel.jboss.riftsaw.runtime.module.JBTBPELPublisher;
+import org.eclipse.bpel.runtimes.IBPELModuleFacetConstants;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+
+public class BPELModuleContentProvider implements ITreeContentProvider {
+ public BPELModuleContentProvider() {
+ }
+ public Object[] getChildren(Object parentElement) {
+ if( parentElement instanceof ModuleServer ) {
+ IServer s = ((ModuleServer)parentElement).server;
+ IModule[] module = ((ModuleServer)parentElement).module;
+ IModule mod = module.length > 0 ? module[module.length-1] : null;
+ String typeId = mod.getModuleType().getId();
+ //
https://jira.jboss.org/browse/JBIDE-7486
+ // if project was closed or deleted, mod.getProject() is null - ignore
+ if( mod != null && mod.getProject() != null &&
(typeId.equals(IBPELModuleFacetConstants.BPEL20_MODULE_TYPE) ||
typeId.equals(JBTBPELModuleFactoryDelegate.LEGACY_MODULE_TYPE))) {
+ // we have a bpel module deployed to a server. List the children
+ String[] versions = JBTBPELPublisher.getDeployedPathsFromDescriptor(s,
mod.getProject());
+ return wrap((ModuleServer)parentElement, versions);
+ }
+ }
+ return new Object[]{};
+ }
+
+ protected BPELVersionDeployment[] wrap(ModuleServer ms, String[] vals) {
+ BPELVersionDeployment[] versions = new BPELVersionDeployment[vals.length];
+ for( int i = 0; i < vals.length; i++ ) {
+ versions[i] = new BPELVersionDeployment(ms, vals[i]);
+ }
+ return versions;
+ }
+
+ public static class BPELVersionDeployment {
+ private String path;
+ private ModuleServer ms;
+ public BPELVersionDeployment(ModuleServer ms, String path) {
+ this.path = path;
+ this.ms = ms;
+ }
+ public String getPath() { return path; }
+ public ModuleServer getModuleServer() { return ms; }
+ public IProject getProject() {
+ if( ms.module != null && ms.module.length > 0 )
+ return ms.module[ms.module.length-1].getProject();
+ return null;
+ }
+ }
+
+ public Object getParent(Object element) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/view/server/BPELModuleLabelProvider.java
===================================================================
---
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/view/server/BPELModuleLabelProvider.java
(rev 0)
+++
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/ui/view/server/BPELModuleLabelProvider.java 2010-11-15
18:04:29 UTC (rev 26573)
@@ -0,0 +1,22 @@
+package org.eclipse.bpel.jboss.riftsaw.runtime.ui.view.server;
+
+import org.eclipse.bpel.jboss.riftsaw.runtime.RuntimesPlugin;
+import
org.eclipse.bpel.jboss.riftsaw.runtime.ui.view.server.BPELModuleContentProvider.BPELVersionDeployment;
+import org.eclipse.bpel.runtimes.IRuntimesUIConstants;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+public class BPELModuleLabelProvider extends LabelProvider {
+ public Image getImage(Object element) {
+
+ return RuntimesPlugin.getPlugin().getImage(IRuntimesUIConstants.ICON_BPEL_FACET);
+ }
+
+ public String getText(Object element) {
+ if( element instanceof BPELVersionDeployment ) {
+ return new Path(((BPELVersionDeployment)element).getPath()).lastSegment();
+ }
+ return null;
+ }
+}