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 2008/04/08 21:18:42 UTC

svn commit: r646039 - in /incubator/tuscany/java/sca/samples/chat2-webapp: ./ src/ src/main/ src/main/java/ src/main/java/sample/ src/main/resources/ src/main/webapp/ src/main/webapp/META-INF/ src/main/webapp/WEB-INF/

Author: antelder
Date: Tue Apr  8 12:18:34 2008
New Revision: 646039

URL: http://svn.apache.org/viewvc?rev=646039&view=rev
Log:
Chat sample prototype using <implementation.web> and async callbacks

Added:
    incubator/tuscany/java/sca/samples/chat2-webapp/   (with props)
    incubator/tuscany/java/sca/samples/chat2-webapp/README   (with props)
    incubator/tuscany/java/sca/samples/chat2-webapp/build.xml   (with props)
    incubator/tuscany/java/sca/samples/chat2-webapp/pom.xml   (with props)
    incubator/tuscany/java/sca/samples/chat2-webapp/src/
    incubator/tuscany/java/sca/samples/chat2-webapp/src/main/
    incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/
    incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/
    incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatCallback.java   (with props)
    incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatService.java   (with props)
    incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatServiceImpl.java   (with props)
    incubator/tuscany/java/sca/samples/chat2-webapp/src/main/resources/
    incubator/tuscany/java/sca/samples/chat2-webapp/src/main/resources/chat.composite
    incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/
    incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/META-INF/
    incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/META-INF/sca-contribution.xml   (with props)
    incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/WEB-INF/
    incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/WEB-INF/web.xml   (with props)
    incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/chat.html   (with props)

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr  8 12:18:34 2008
@@ -0,0 +1,18 @@
+target
+work
+dojo
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+derby.log
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+.externalToolBuilders
+activemq-data

Added: incubator/tuscany/java/sca/samples/chat2-webapp/README
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/chat2-webapp/README?rev=646039&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/chat2-webapp/README (added)
+++ incubator/tuscany/java/sca/samples/chat2-webapp/README Tue Apr  8 12:18:34 2008
@@ -0,0 +1,61 @@
+Chat WebApp Sample
+==================
+This sample demonstrates the SCA DWR binding to implement the classic Ajax sample
+of a chat application which allows multiple users to chat from their browsers.
+
+The README in the samples directory (the directory above this) provides 
+general instructions about building and running samples. Take a look there 
+first. 
+
+As this sample provides a web app there is a manual step where the WAR file
+that contains the sample is copied to your web app container. If you just want 
+to give this sample a go deploy the WAR file (target/sample-chat-webapp.war)
+to your web application server. 
+
+Once the web app is deployed use your browser to visit the following URL;
+
+http://localhost:8080/sample-chat-webapp
+
+The port and hostname will of course vary depending on your local installation. 
+
+Sample Overview
+---------------
+The sample provides an SCA component which has an SCA service using the SCA DWR
+binding and an SCA reference also using the DWR binding. The component implementation 
+simply forwards every invocation of the service as an invocation on the reference. The
+component reference is scoped by the composite so every active client of the composite
+will receive every message sent to the component service, thus implementing the chat
+application with very little code.
+
+chat-webapp/
+  src/
+    main/
+      java/
+        sample/
+          ChatService.java            - service interface
+          ChatServiceImpl.java        - service implementation
+      resources/
+        chat.composite                - the SCA assembly for this sample
+      webapp
+        chat.html                     - the html UserInterface for this application
+        META-INF/
+          sca-contribution.xml        - specifies the composite to be deployed
+        WEB-INF/
+          web.xml                     - defines the listener that starts up the 
+                                        Tuscany SCA runtime
+           
+  pom.xml                             - the Maven build file  
+
+Building And Running The Sample Using Maven 
+-------------------------------------------
+With either the binary or source distributions the sample can be built and run 
+using Maven as follows. 
+
+cd chat-webapp 
+mvn
+
+Again this should result in a war file (sample-chat-webapp.war) in the target 
+directory. Follow the steps described in the previous section for running the web 
+app and for the expected results.
+
+

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/README
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/README
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/tuscany/java/sca/samples/chat2-webapp/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/chat2-webapp/build.xml?rev=646039&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/chat2-webapp/build.xml (added)
+++ incubator/tuscany/java/sca/samples/chat2-webapp/build.xml Tue Apr  8 12:18:34 2008
@@ -0,0 +1,117 @@
+<!--
+ * 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 name="sample-chat2-webapp" default="compile">
+
+    <target name="compile">
+        <mkdir dir="target/classes"/>
+        <javac destdir="target/classes" debug="on" source="1.5" target="1.5">
+            <src path="src\main\java"/>
+            <classpath>
+                <fileset refid="tuscany.jars"/>
+                <fileset refid="3rdparty.jars"/>
+            </classpath>
+        </javac>
+        <copy todir="target/classes">
+            <fileset dir="src\main\resources"/>
+            <fileset dir="." includes="*" excludes="src, target, pom.xml, build.xml"/>
+        </copy>
+        <war destfile="target/sample-chat2-webapp.war" webxml="src/main/webapp/WEB-INF/web.xml">
+            <fileset dir="src/main/webapp"/>
+            <lib refid="tuscany.jars"/>
+            <lib refid="3rdparty.jars"/>
+            <classes dir="target/classes"/>
+        </war>
+    </target>
+
+    <target name="package" depends="compile"/>
+
+    <target name="clean">
+        <delete includeemptydirs="true">
+            <fileset dir="target"/>
+        </delete>
+    </target>
+
+    <fileset id="tuscany.jars" dir="../../modules">
+        <include name="tuscany-assembly-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-assembly-xml-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-assembly-xsd-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-binding-dwr-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-binding-sca-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-binding-sca-xml-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-contribution-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-contribution-impl-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-contribution-java-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-contribution-namespace-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-contribution-resource-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-contribution-xml-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-core-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-core-databinding-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-core-spi-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-databinding-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-databinding-jaxb-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-definitions-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-definitions-xml-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-domain-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-domain-api-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-extensibility-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-extension-helper-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-host-embedded-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-host-http-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-host-webapp-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-implementation-java-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-implementation-java-runtime-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-implementation-java-xml-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-implementation-web-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-interface-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-interface-java-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-interface-java-jaxws-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-interface-java-xml-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-node-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-node-api-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-policy-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-policy-xml-2.0-incubating-SNAPSHOT.jar"/>
+        <include name="tuscany-sca-api-2.0-incubating-SNAPSHOT.jar"/>
+    </fileset>
+    <fileset id="3rdparty.jars" dir="../../lib">
+        <include name="activation-1.1.jar"/>
+        <include name="axiom-api-1.2.5.jar"/>
+        <include name="axiom-impl-1.2.5.jar"/>
+        <include name="cglib-nodep-2.1_3.jar"/>
+        <include name="commons-logging-1.1.jar"/>
+        <include name="dwr-2.0.1.jar"/>
+        <include name="geronimo-commonj_1.1_spec-1.0.jar"/>
+        <include name="jaxb-api-2.1.jar"/>
+        <include name="jaxb-impl-2.1.6.jar"/>
+        <include name="jaxb2-reflection-2.1.4.jar"/>
+        <include name="jaxen-1.1-beta-9.jar"/>
+        <include name="jaxws-api-2.1.jar"/>
+        <include name="jsr181-api-1.0-MR1.jar"/>
+        <include name="jsr250-api-1.0.jar"/>
+        <include name="mail-1.4.jar"/>
+        <include name="neethi-2.0.2.jar"/>
+        <include name="saaj-api-1.3.jar"/>
+        <include name="stax-api-1.0-2.jar"/>
+        <include name="wstx-asl-3.2.1.jar"/>
+        <include name="xalan-2.7.0.jar"/>
+        <include name="xercesImpl-2.8.1.jar"/>
+        <include name="xml-apis-1.3.03.jar"/>
+    </fileset>
+
+</project>

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/build.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/build.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/tuscany/java/sca/samples/chat2-webapp/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/chat2-webapp/pom.xml?rev=646039&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/chat2-webapp/pom.xml (added)
+++ incubator/tuscany/java/sca/samples/chat2-webapp/pom.xml Tue Apr  8 12:18:34 2008
@@ -0,0 +1,104 @@
+<?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>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-sca</artifactId>
+        <version>2.0-incubating-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+    <artifactId>sample-chat2-webapp</artifactId>
+    <packaging>war</packaging>
+    <name>Apache Tuscany SCA Chat Sample WebApp using callbacks</name>
+
+    <repositories>
+       <repository>
+          <id>apache.incubator</id>
+          <url>http://people.apache.org/repo/m2-incubating-repository</url>
+       </repository>
+    </repositories>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-webapp</artifactId>
+            <version>2.0-incubating-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-dwr</artifactId>
+            <version>2.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-web</artifactId>
+            <version>2.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>2.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <!-- exclude stax 1.0.1 as we're also pulling in javax\xml\stream\stax-api\1.0-2 -->
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+            <version>1.0.1</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <!-- marking dependency as provided to exclude from war file -->
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.3</version>
+            <scope>provided</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+       <finalName>${artifactId}</finalName>
+       <plugins>
+            <plugin>
+                <groupId>org.apache.tuscany.sca</groupId>
+                <artifactId>tuscany-maven-ant-generator</artifactId>
+                <version>2.0-incubating-SNAPSHOT</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+       </plugins>       
+    </build>
+
+</project>

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatCallback.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatCallback.java?rev=646039&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatCallback.java (added)
+++ incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatCallback.java Tue Apr  8 12:18:34 2008
@@ -0,0 +1,27 @@
+/*
+ * 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.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface ChatCallback {
+    void newMsg(String msg);
+}

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatCallback.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatCallback.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatService.java?rev=646039&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatService.java (added)
+++ incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatService.java Tue Apr  8 12:18:34 2008
@@ -0,0 +1,32 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package sample;
+
+import javax.jws.Oneway;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Scope;
+
+@Remotable
+@Scope("COMPOSITE")
+@Callback(ChatCallback.class)
+public interface ChatService {
+
+    @Oneway
+    public void addMsg(String msg);
+}

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatServiceImpl.java?rev=646039&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatServiceImpl.java (added)
+++ incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatServiceImpl.java Tue Apr  8 12:18:34 2008
@@ -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.    
+ */
+
+package sample;
+
+import org.osoa.sca.annotations.Callback;
+
+public class ChatServiceImpl implements ChatService {
+
+    ChatCallback chatCallback;
+
+    @Callback
+    public void setCallback(ChatCallback chatCallback) {
+        this.chatCallback = chatCallback;
+    }
+
+    public void addMsg(String msg) {
+        chatCallback.newMsg(msg);
+    }
+}

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/java/sample/ChatServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/resources/chat.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/chat2-webapp/src/main/resources/chat.composite?rev=646039&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/chat2-webapp/src/main/resources/chat.composite (added)
+++ incubator/tuscany/java/sca/samples/chat2-webapp/src/main/resources/chat.composite Tue Apr  8 12:18:34 2008
@@ -0,0 +1,40 @@
+<?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://www.osoa.org/xmlns/sca/1.0"
+	       xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
+           targetNamespace="http://sample"
+           xmlns:sample="http://sample"
+           name="Chat">
+
+    <component name="webapp">
+        <t:implementation.web war="." />
+        <reference name="ChatService" target="ChatService">
+           <t:binding.dwr/>
+        </reference>
+    </component>
+
+    <component name="ChatService">
+        <implementation.java class="sample.ChatServiceImpl"/>
+        <service name="ChatService">
+           <t:binding.dwr/>
+        </service>
+    </component>
+
+</composite>

Added: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/META-INF/sca-contribution.xml?rev=646039&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/META-INF/sca-contribution.xml (added)
+++ incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/META-INF/sca-contribution.xml Tue Apr  8 12:18:34 2008
@@ -0,0 +1,24 @@
+<?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.    
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+              targetNamespace="http://sample"
+              xmlns:sample="http://sample">
+   <deployable composite="sample:Chat"/>
+</contribution>
\ No newline at end of file

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/WEB-INF/web.xml?rev=646039&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/WEB-INF/web.xml (added)
+++ incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/WEB-INF/web.xml Tue Apr  8 12:18:34 2008
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ -->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
+Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+    <display-name>Apache Tuscany AJAX/DWR Chat Sample</display-name>
+
+    <filter>
+       <filter-name>tuscany</filter-name>
+       <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+    </filter>
+  
+    <filter-mapping>
+       <filter-name>tuscany</filter-name>
+       <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <welcome-file-list>
+        <welcome-file>chat.jsp</welcome-file>
+    </welcome-file-list>
+
+</web-app>

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/chat.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/chat.html?rev=646039&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/chat.html (added)
+++ incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/chat.html Tue Apr  8 12:18:34 2008
@@ -0,0 +1,73 @@
+<!--
+    * 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.    
+-->
+<html>
+  <head>
+    <title>Apache Tuscany Ajax/DWR Chat Sample</TITLE>
+
+    <script type="text/javascript" src="org.apache.tuscany.sca.componentContext.js" />
+
+    <script language="JavaScript">
+    
+       var chatService = componentContext.getService("ChatService");
+
+       chatService.callbacks.chatResponse = function(msg) {
+          var chatLog = document.getElementById('chatLog');
+          chatLog.innerHTML = msg + '<br>' + chatLog.innerHTML;
+       }
+
+       function sendChat() {
+          var chatText = document.getElementById("chatText");
+          var nickName = document.getElementById("nickName").value;
+          var msg = nickName + ": " + chatText.value
+          chatText.value = "";
+          chatText.focus();
+          ChatService.addMsg(msg);
+       }
+
+       function clickButton(e, buttonid){
+          var evt = e ? e : window.event;
+          var bt = document.getElementById(buttonid);
+          if (bt){
+              if (evt.keyCode == 13){
+                  bt.click();
+                  return false;
+              }
+          }
+       } 
+
+    </script>
+
+  </head>
+  <body >
+
+    <h2>Apache Tuscany Ajax/DWR Chat Sample</h2>
+     
+      A simple client to chat between multiple web browsers:<br><br>
+     
+      Nickname: <input type="text" id="nickName" size="10"/>
+      <br><br>
+
+      Enter text: <input type="text" id="chatText" size="80" onkeypress="return clickButton(event,'Send')"/>
+      <input type="button" name="Send" value="Send" id="Send" onclick="sendChat()" />
+
+      <br><br>
+      <div id="chatLog" style="overflow:auto; height:400px; border:1px solid"></div>
+
+  </body>
+</html>

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/chat.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/chat.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/samples/chat2-webapp/src/main/webapp/chat.html
------------------------------------------------------------------------------
    svn:mime-type = text/html



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org