You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2009/06/10 15:10:20 UTC

svn commit: r783348 - in /tuscany/java/sca/samples/webapps/helloworld-bpel: ./ src/ src/main/ src/main/java/ src/main/java/sample/ src/main/resources/ src/main/webapp/ src/main/webapp/WEB-INF/

Author: antelder
Date: Wed Jun 10 13:10:19 2009
New Revision: 783348

URL: http://svn.apache.org/viewvc?rev=783348&view=rev
Log:
Add a webapp sample using a BPEL component

Added:
    tuscany/java/sca/samples/webapps/helloworld-bpel/   (with props)
    tuscany/java/sca/samples/webapps/helloworld-bpel/pom.xml
    tuscany/java/sca/samples/webapps/helloworld-bpel/src/
    tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/
    tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/java/
    tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/java/sample/
    tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java
    tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/resources/
    tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.bpel
    tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl
    tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/
    tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/
    tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite
    tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml
    tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/hello.jsp

Propchange: tuscany/java/sca/samples/webapps/helloworld-bpel/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Jun 10 13:10:19 2009
@@ -0,0 +1,20 @@
+target
+work
+dojo
+*.iws
+*.ipr
+*.iml
+derby.log
+maven.log
+maven-eclipse.xml
+build.xml
+build-dependency.xml
+velocity.log*
+junit*.properties
+surefire*.properties
+.project
+.classpath
+.settings
+.deployables
+.wtpmodules
+.externalToolBuilders

Added: tuscany/java/sca/samples/webapps/helloworld-bpel/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/webapps/helloworld-bpel/pom.xml?rev=783348&view=auto
==============================================================================
--- tuscany/java/sca/samples/webapps/helloworld-bpel/pom.xml (added)
+++ tuscany/java/sca/samples/webapps/helloworld-bpel/pom.xml Wed Jun 10 13:10:19 2009
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+      <modelVersion>4.0.0</modelVersion>
+      <parent>
+          <groupId>org.apache.tuscany.sca</groupId>
+          <artifactId>tuscany-sca</artifactId>
+          <version>2.0-SNAPSHOT</version>
+          <relativePath>../../pom.xml</relativePath>
+      </parent>
+
+      <artifactId>helloworld-bpel</artifactId>
+      <packaging>war</packaging>
+      <name>Apache Tuscany SCA Sample Helloworld BPEL</name>
+
+	<properties>
+		<tuscany.version>2.0-SNAPSHOT</tuscany.version>
+		<jetty.version>6.1.4</jetty.version>
+	</properties>
+
+	<dependencies>
+		<!--  TUSCANY DEPENDENCIES -->
+            <dependency>
+               <groupId>org.apache.tuscany.sca</groupId>
+               <artifactId>tuscany-sca-api</artifactId>
+               <version>${tuscany.version}</version>
+            </dependency>
+
+            <dependency>
+               <groupId>org.apache.tuscany.sca</groupId>
+               <artifactId>tuscany-implementation-web-runtime</artifactId>
+               <version>${tuscany.version}</version>
+               <scope>runtime</scope>
+            </dependency>
+
+            <dependency>
+               <groupId>org.apache.tuscany.sca</groupId>
+               <artifactId>tuscany-implementation-bpel-runtime</artifactId>
+               <version>${tuscany.version}</version>
+               <scope>runtime</scope>
+            </dependency>
+
+		<!--  JUNIT DEPENDENCY FOR TESTING -->
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>3.8.2</version>
+			<scope>test</scope>
+		</dependency>
+
+		<!--  JETTY DEPENDENCIES FOR TESTING  -->
+		<dependency>
+			<groupId>org.mortbay.jetty</groupId>
+			<artifactId>jetty</artifactId>
+			<version>${jetty.version}</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.mortbay.jetty</groupId>
+			<artifactId>jetty-util</artifactId>
+			<version>${jetty.version}</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.mortbay.jetty</groupId>
+			<artifactId>jetty-management</artifactId>
+			<version>${jetty.version}</version>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
+
+	<build>
+         <finalName>${artifactId}</finalName>
+
+         <plugins>
+            <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-dependency-plugin</artifactId>
+              <executions>
+                <execution>
+                  <id>unpack</id>
+                  <phase>compile</phase>
+                  <goals>
+                    <goal>unpack</goal>
+                  </goals>
+                  <configuration>
+                    <artifactItems>
+                      <artifactItem>
+                        <groupId>org.apache.ode</groupId>
+                        <artifactId>ode-dao-jpa-ojpa-derby</artifactId>
+                        <version>1.1.1</version>
+                        <type>zip</type>
+                        <overWrite>false</overWrite>
+                        <outputDirectory>${project.build.directory}/classes</outputDirectory>
+                        <includes>**/*</includes>
+                      </artifactItem>
+                    </artifactItems>
+                   </configuration>
+                </execution>
+              </executions>
+            </plugin>
+
+            <plugin>
+               <groupId>org.mortbay.jetty</groupId>
+               <artifactId>maven-jetty-plugin</artifactId>
+            </plugin>
+
+         </plugins>
+	</build>
+</project>
\ No newline at end of file

Added: tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java?rev=783348&view=auto
==============================================================================
--- tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java (added)
+++ tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java Wed Jun 10 13:10:19 2009
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloworldService {
+
+    String hello(String name);
+
+}

Added: tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.bpel
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.bpel?rev=783348&view=auto
==============================================================================
--- tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.bpel (added)
+++ tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.bpel Wed Jun 10 13:10:19 2009
@@ -0,0 +1,66 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<process name="HelloWorld"
+    targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld"
+    xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
+    xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+    xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:test="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+    queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+    expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
+
+  <import location="helloworld.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"
+     namespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"/>
+
+   <partnerLinks>
+      <partnerLink name="helloPartnerLink" partnerLinkType="test:HelloPartnerLinkType" myRole="me" />
+   </partnerLinks>
+    
+   <variables>
+     <variable name="myVar" messageType="test:HelloMessage"/>
+     <variable name="tmpVar" type="xsd:string"/>
+   </variables>
+
+   <sequence>
+       <receive
+          name="start"
+          partnerLink="helloPartnerLink"
+          portType="test:HelloPortType"
+          operation="hello"
+          variable="myVar"
+          createInstance="yes"/>
+
+      <assign name="assign1">
+          <copy>
+              <from variable="myVar" part="TestPart"/>
+              <to variable="tmpVar"/>
+          </copy>
+          <copy>
+              <from>concat($tmpVar,' World')</from>
+              <to variable="myVar" part="TestPart"/>
+          </copy>
+      </assign>
+       <reply name="end"  
+              partnerLink="helloPartnerLink"
+              portType="test:HelloPortType" 
+              operation="hello"
+              variable="myVar"/>
+   </sequence>
+</process>

Added: tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl?rev=783348&view=auto
==============================================================================
--- tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl (added)
+++ tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl Wed Jun 10 13:10:19 2009
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<wsdl:definitions 
+    targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+    xmlns="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+    xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
+    
+    <wsdl:types>
+        <schema elementFormDefault="qualified" 
+           targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl" 
+           xmlns="http://www.w3.org/2001/XMLSchema">
+
+            <element name="hello">
+                <complexType>
+                    <sequence>
+                        <element name="message" type="xsd:string"/>
+                    </sequence>
+                </complexType>
+            </element>            
+        </schema>
+    </wsdl:types>
+    
+    <wsdl:message name="HelloMessage">
+        <wsdl:part element="tns:hello" name="TestPart"/>
+    </wsdl:message>
+    
+    <wsdl:portType name="HelloPortType">
+        <wsdl:operation name="hello">
+            <wsdl:input message="tns:HelloMessage" name="TestIn"/>
+            <wsdl:output message="tns:HelloMessage" name="TestOut"/>
+        </wsdl:operation>    
+    </wsdl:portType>
+    
+
+    <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
+        <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="hello">
+            <wsdlsoap:operation soapAction=""/>
+            <wsdl:input name="TestIn">
+                <wsdlsoap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="TestOut">
+                <wsdlsoap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>    
+    
+    <wsdl:service name="HelloService">
+		<wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
+     		<soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
+		</wsdl:port>
+    </wsdl:service>
+    
+   <plnk:partnerLinkType name="HelloPartnerLinkType">
+       <plnk:role name="me" portType="tns:HelloPortType"/>
+       <plnk:role name="you" portType="tns:HelloPortType"/>
+   </plnk:partnerLinkType>
+</wsdl:definitions>
\ No newline at end of file

Added: tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite?rev=783348&view=auto
==============================================================================
--- tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite (added)
+++ tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite Wed Jun 10 13:10:19 2009
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+           xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+           xmlns:hns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
+           targetNamespace="http://sample"
+           name="helloworld-bpel">
+
+    <component name="WebComponent">
+        <implementation.web web-uri=""/>
+        <reference name="service" target="HelloworldComponent">
+            <interface.java interface="sample.HelloworldService"/>
+        </reference>
+    </component>
+
+    <component name="HelloworldComponent">
+        <implementation.bpel process="hns:HelloWorld"/>
+    </component>
+
+</composite>

Added: tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml?rev=783348&view=auto
==============================================================================
--- tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml (added)
+++ tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml Wed Jun 10 13:10:19 2009
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<web-app version="2.4"
+         xmlns="http://java.sun.com/xml/ns/j2ee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+
+  <display-name>helloworld-bpel</display-name>
+
+  <filter>
+    <filter-name>tuscany.helloworld-bpel</filter-name> 
+    <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class> 
+  </filter>
+
+  <filter-mapping>
+    <filter-name>tuscany.helloworld-bpel</filter-name> 
+    <url-pattern>/*</url-pattern> 
+  </filter-mapping>
+
+  <welcome-file-list id="WelcomeFileList">
+    <welcome-file>hello.jsp</welcome-file>
+  </welcome-file-list>
+
+</web-app>

Added: tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/hello.jsp
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/hello.jsp?rev=783348&view=auto
==============================================================================
--- tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/hello.jsp (added)
+++ tuscany/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/hello.jsp Wed Jun 10 13:10:19 2009
@@ -0,0 +1,36 @@
+<%--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca" %>
+
+<sca:reference name="service" type="sample.HelloworldService" />
+
+<html>
+  <body >
+
+    <h2>helloworld-bpel</h2>
+
+    Calling HelloworldService sayHello("world") returns:
+
+    <p>
+
+    <%= service.hello("world") %>
+
+  </body>
+</html>