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 2007/05/14 01:39:53 UTC

svn commit: r537680 - in /incubator/tuscany/sandbox/ant/ajax/ajaxchat: ./ src/main/java/sample/ src/main/resources/ src/main/webapp/ src/main/webapp/WEB-INF/

Author: antelder
Date: Sun May 13 16:39:52 2007
New Revision: 537680

URL: http://svn.apache.org/viewvc?view=rev&rev=537680
Log:
Get the old ajax chat sample working with the new scdl and runtime

Added:
    incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/java/sample/ChatServiceImpl.java   (with props)
    incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/resources/chat.composite
    incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/webapp/chat.html   (with props)
Removed:
    incubator/tuscany/sandbox/ant/ajax/ajaxchat/readme.htm
    incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/resources/sca.module
    incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/webapp/AJAXChat.html
Modified:
    incubator/tuscany/sandbox/ant/ajax/ajaxchat/   (props changed)
    incubator/tuscany/sandbox/ant/ajax/ajaxchat/pom.xml
    incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/java/sample/ChatService.java
    incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/webapp/WEB-INF/web.xml

Propchange: incubator/tuscany/sandbox/ant/ajax/ajaxchat/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun May 13 16:39:52 2007
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Modified: incubator/tuscany/sandbox/ant/ajax/ajaxchat/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/ajax/ajaxchat/pom.xml?view=diff&rev=537680&r1=537679&r2=537680
==============================================================================
--- incubator/tuscany/sandbox/ant/ajax/ajaxchat/pom.xml (original)
+++ incubator/tuscany/sandbox/ant/ajax/ajaxchat/pom.xml Sun May 13 16:39:52 2007
@@ -1,57 +1,67 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
- *  Copyright (c) 2005-2006 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.
- -->
+    * 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.samples.sca</groupId>
-        <artifactId>tuscany-samples-sca</artifactId>
-        <version>incubating-M1</version>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-sca</artifactId>
+        <version>1.0-incubating-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
     </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>sample-ajaxchat</artifactId>
+    <artifactId>sample-chat-webapp</artifactId>
     <packaging>war</packaging>
-    <name>Tuscany AJAX Chat Sample</name>
-    <description>A sample Chat Web application using AJAX</description>
-    <version>incubating-M1</version>
+    <name>Apache Tuscany Chat Sample WebApp</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</groupId>
-            <artifactId>tuscany-core</artifactId>
-            <version>${pom.version}</version>
-            <scope>provided</scope>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-webapp</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
         </dependency>
 
         <dependency>
-            <groupId>org.apache.tuscany.sca.containers</groupId>
-            <artifactId>tuscany-container-java</artifactId>
-            <version>${pom.version}</version>
-            <scope>provided</scope>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-ajax</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
         </dependency>
 
         <dependency>
-            <groupId>org.apache.tuscany.sca.bindings</groupId>
-            <artifactId>tuscany-binding-ajax</artifactId>
-            <version>${pom.version}</version>
-            <scope>provided</scope>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
         </dependency>
 
     </dependencies>
+
+    <build>
+       <finalName>${artifactId}</finalName>
+    </build>
 
 </project>

Modified: incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/java/sample/ChatService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/java/sample/ChatService.java?view=diff&rev=537680&r1=537679&r2=537680
==============================================================================
--- incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/java/sample/ChatService.java (original)
+++ incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/java/sample/ChatService.java Sun May 13 16:39:52 2007
@@ -16,6 +16,11 @@
  */
 package sample;
 
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Service;
+
+@Service
+@Remotable
 public interface ChatService {
 
     public void chat(String msg);

Added: incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/java/sample/ChatServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/java/sample/ChatServiceImpl.java?view=auto&rev=537680
==============================================================================
--- incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/java/sample/ChatServiceImpl.java (added)
+++ incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/java/sample/ChatServiceImpl.java Sun May 13 16:39:52 2007
@@ -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.Scope;
+
+@Scope("COMPOSITE")
+public class ChatServiceImpl implements ChatService {
+
+    ChatService chatters;
+
+    public void chat(String msg) {
+        chatters.chat(msg);
+    }
+
+    public void setChatters(ChatService chatters) {
+        this.chatters = chatters;
+    }
+}

Propchange: incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/java/sample/ChatServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/java/sample/ChatServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/resources/chat.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/resources/chat.composite?view=auto&rev=537680
==============================================================================
--- incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/resources/chat.composite (added)
+++ incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/resources/chat.composite Sun May 13 16:39:52 2007
@@ -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://www.osoa.org/xmlns/sca/1.0"
+           name="Chat">
+
+    <service name="ChatService" promote="ChatComponent">
+        <interface.java interface="sample.ChatService"/>
+        <binding.ajax/>
+    </service>
+
+    <component name="ChatComponent">
+        <implementation.java class="sample.ChatServiceImpl"/>
+    </component>
+
+    <reference name="ChatReference" promote="ChatComponent/chatters">
+        <interface.java interface="sample.ChatService" />
+        <binding.ajax/>
+    </reference>
+
+</composite>

Modified: incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/webapp/WEB-INF/web.xml?view=diff&rev=537680&r1=537679&r2=537680
==============================================================================
--- incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/webapp/WEB-INF/web.xml (original)
+++ incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/webapp/WEB-INF/web.xml Sun May 13 16:39:52 2007
@@ -18,10 +18,27 @@
 <!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>Tuscany AJAX Chat Sample</display-name>
+    <display-name>Tuscany Chat Sample</display-name>
 
     <welcome-file-list id="WelcomeFileList">
-        <welcome-file>AJAXChat.html</welcome-file>
+        <welcome-file>chat.html</welcome-file>
     </welcome-file-list>
+
+
+    <!-- the Tuscany system listener and servlet -->
+    
+    <listener>
+       <listener-class>org.apache.tuscany.sca.webapp.TuscanyContextListener</listener-class>
+    </listener>
+
+    <servlet>
+       <servlet-name>TuscanyServlet</servlet-name>
+       <servlet-class>org.apache.tuscany.sca.webapp.TuscanyServlet</servlet-class>
+    </servlet>
+  
+    <servlet-mapping>
+       <servlet-name>TuscanyServlet</servlet-name>
+       <url-pattern>/SCA/*</url-pattern>
+    </servlet-mapping>
 
 </web-app>

Added: incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/webapp/chat.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/webapp/chat.html?view=auto&rev=537680
==============================================================================
--- incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/webapp/chat.html (added)
+++ incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/webapp/chat.html Sun May 13 16:39:52 2007
@@ -0,0 +1,39 @@
+<html>
+  <head>
+    <title>Tuscany AJAX Chat Sample</TITLE>
+
+    <script type="text/javascript" src="SCA/SCADomain/scaDomain.js"></script>
+
+    <script language="JavaScript">
+
+       ChatReference.chat = 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.chat(msg);
+       }
+    </script>
+
+  </head>
+  <body onLoad="scaDomain.open()">
+
+    <h2>Tuscany AJAX Chat Sample</h2><br>
+     
+      Nickname: <input type="text" id="nickName" size="10"/>
+      <br><br>
+
+      Enter text: <input type="text" id="chatText" size="80" onEnter="sendChat()"/>
+      <input type="button" value="Send" onclick="sendChat()" />
+
+      <br><br>
+      <div id="chatLog" style="overflow:auto; height:400px; border:1px solid"></div>
+
+  </body>
+</html>

Propchange: incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/webapp/chat.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/ant/ajax/ajaxchat/src/main/webapp/chat.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/sandbox/ant/ajax/ajaxchat/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