Author: lresende
Date: Tue Sep 23 16:24:24 2008
New Revision: 698399

URL: http://svn.apache.org/viewvc?rev=698399&view=rev
Log:
Porting customer-dojo to J2EE WebApp

Added:
    tuscany/java/sca/samples/customer-dojo-webapp/   (props changed)
      - copied from r698213, tuscany/java/sca/samples/customer-dojo/
    tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/
    tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/META-INF/
    
tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/META-INF/sca-contribution.xml
   (with props)
    tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/WEB-INF/
    
tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/WEB-INF/geronimo-web.xml
   (with props)
    
tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/WEB-INF/web.xml   
(with props)
    tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/customer.jsp
Removed:
    tuscany/java/sca/samples/customer-dojo-webapp/src/main/resources/content/
Modified:
    tuscany/java/sca/samples/customer-dojo-webapp/build-dojo.xml
    tuscany/java/sca/samples/customer-dojo-webapp/pom.xml
    
tuscany/java/sca/samples/customer-dojo-webapp/src/main/resources/META-INF/persistence.xml
    
tuscany/java/sca/samples/customer-dojo-webapp/src/main/resources/customer.composite
    tuscany/java/sca/samples/pom.xml

Propchange: tuscany/java/sca/samples/customer-dojo-webapp/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Sep 23 16:24:24 2008
@@ -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

Propchange: tuscany/java/sca/samples/customer-dojo-webapp/
------------------------------------------------------------------------------
    svn:mergeinfo = /tuscany/branches/sca-java-1.3/samples/customer-dojo:671193

Modified: tuscany/java/sca/samples/customer-dojo-webapp/build-dojo.xml
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/customer-dojo-webapp/build-dojo.xml?rev=698399&r1=698213&r2=698399&view=diff
==============================================================================
--- tuscany/java/sca/samples/customer-dojo-webapp/build-dojo.xml (original)
+++ tuscany/java/sca/samples/customer-dojo-webapp/build-dojo.xml Tue Sep 23 
16:24:24 2008
@@ -21,7 +21,7 @@
        
 
     <property name="dojo.version" value="1.0.0"/>
-    <property name="unpack.location" 
value="${basedir}/target/classes/content/dojo"/>
+    <property name="unpack.location" value="${basedir}/src/main/webapp/dojo"/>
        
 
     <target name="check-dojo-installed">

Modified: tuscany/java/sca/samples/customer-dojo-webapp/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/customer-dojo-webapp/pom.xml?rev=698399&r1=698213&r2=698399&view=diff
==============================================================================
--- tuscany/java/sca/samples/customer-dojo-webapp/pom.xml (original)
+++ tuscany/java/sca/samples/customer-dojo-webapp/pom.xml Tue Sep 23 16:24:24 
2008
@@ -25,7 +25,8 @@
         <version>1.4-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
-    <artifactId>sample-customer-dojo</artifactId>
+    <artifactId>sample-customer-dojo-webapp</artifactId>
+       <packaging>war</packaging>
     <name>Apache Tuscany SCA Customer DOJO Sample WebApp</name>
 
     <repositories>
@@ -38,23 +39,23 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-host-embedded</artifactId>
+            <artifactId>tuscany-host-webapp</artifactId>
             <version>1.4-SNAPSHOT</version>
         </dependency>
         
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-data-api</artifactId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
             <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
          </dependency>
-        
+
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <artifactId>tuscany-data-api</artifactId>
             <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
          </dependency>
-        
+                        
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-binding-jsonrpc-runtime</artifactId>
@@ -68,20 +69,7 @@
             <version>1.4-SNAPSHOT</version>
             <scope>runtime</scope>
         </dependency>
-        
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-binding-http-runtime</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>        
-        
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-host-jetty</artifactId>
-            <version>1.4-SNAPSHOT</version>
-        </dependency>
-                
+                        
                <dependency>
                        <groupId>org.apache.geronimo.specs</groupId>
                        <artifactId>geronimo-jpa_3.0_spec</artifactId>
@@ -103,7 +91,7 @@
                <dependency>
                        <groupId>org.apache.derby</groupId>
                        <artifactId>derby</artifactId>
-                       <version>10.1.2.1</version>
+                       <version>10.3.1.4</version>
                </dependency>           
 
         <dependency>
@@ -214,7 +202,7 @@
                         </goals>
                         <configuration>
                             
<driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
-                            
<url>jdbc:derby:${pom.basedir}/target/classes/customer;create=true</url>
+                            
<url>jdbc:derby:${pom.basedir}/target/classes/customer-db;create=true</url>
                             <autocommit>true</autocommit>
                             <onError>continue</onError>
                             <onConnectionError>skip</onConnectionError>
@@ -234,7 +222,7 @@
                        </goals>
                        <configuration>
                            
<driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
-                               
<url>jdbc:derby:${pom.basedir}/target/classes/customer;shutdown=true</url>
+                               
<url>jdbc:derby:${pom.basedir}/target/classes/customer-db;shutdown=true</url>
                                
<skipOnConnectionError>true</skipOnConnectionError>
                        </configuration>
                     </execution>

Modified: 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/resources/META-INF/persistence.xml
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/customer-dojo-webapp/src/main/resources/META-INF/persistence.xml?rev=698399&r1=698213&r2=698399&view=diff
==============================================================================
--- 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/resources/META-INF/persistence.xml
 (original)
+++ 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/resources/META-INF/persistence.xml
 Tue Sep 23 16:24:24 2008
@@ -29,7 +29,7 @@
                
                <properties>
                <property name="openjpa.ConnectionDriverName" 
value="org.apache.derby.jdbc.EmbeddedDriver"/>
-               <property name="openjpa.ConnectionURL" 
value="jdbc:derby:target/classes/customer"/>
+               <property name="openjpa.ConnectionURL" 
value="jdbc:derby:/opt/apache-tomcat-6.0.16/webapps/sample-customer-dojo-webapp/WEB-INF/classes/customer-db"/>
                        <property name="openjpa.ConnectionUserName" value=""/>
                        <property name="openjpa.ConnectionPassword" value=""/>  
        
                        

Modified: 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/resources/customer.composite
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/customer-dojo-webapp/src/main/resources/customer.composite?rev=698399&r1=698213&r2=698399&view=diff
==============================================================================
--- 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/resources/customer.composite
 (original)
+++ 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/resources/customer.composite
 Tue Sep 23 16:24:24 2008
@@ -24,13 +24,6 @@
            xmlns:sample="http://sample";
            name="customer">
 
-       <component name="ui">
-               <tuscany:implementation.resource location="content"/>
-               <service name="Resource">
-               <tuscany:binding.http uri="/"/>
-       </service>
-       </component>    
-
        <service name="CustomerService" 
promote="CustomerServiceComponent/CustomerService">
          <interface.java interface="customer.CustomerService"/>
          <tuscany:binding.jsonrpc/>

Added: 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/META-INF/sca-contribution.xml
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/META-INF/sca-contribution.xml?rev=698399&view=auto
==============================================================================
--- 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/META-INF/sca-contribution.xml
 (added)
+++ 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/META-INF/sca-contribution.xml
 Tue Sep 23 16:24:24 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:customer"/>
+</contribution>
\ No newline at end of file

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

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

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

Added: 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/WEB-INF/geronimo-web.xml
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/WEB-INF/geronimo-web.xml?rev=698399&view=auto
==============================================================================
--- 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/WEB-INF/geronimo-web.xml
 (added)
+++ 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/WEB-INF/geronimo-web.xml
 Tue Sep 23 16:24:24 2008
@@ -0,0 +1,34 @@
+<?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 xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0";
+    xmlns:d="http://geronimo.apache.org/xml/ns/deployment-1.2";>
+
+    <d:environment>
+        <d:moduleId>
+            <d:groupId>org.apache.tuscany.sca</d:groupId>
+            <d:artifactId>sample-customer-dojo-webapp</d:artifactId>
+            <d:version>1.4-SNAPSHOT</d:version>
+            <d:type>war</d:type>
+        </d:moduleId>
+
+        <!-- TUSCANY-1986 -->
+        <d:inverse-classloading />
+    </d:environment>
+</web-app>

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

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

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

Added: 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/WEB-INF/web.xml
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/WEB-INF/web.xml?rev=698399&view=auto
==============================================================================
--- 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/WEB-INF/web.xml 
(added)
+++ 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/WEB-INF/web.xml 
Tue Sep 23 16:24:24 2008
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  * 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.    
+-->
+
+<!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 Customer dojo web application 
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 id="WelcomeFileList">
+    <welcome-file>customer.jsp</welcome-file>
+  </welcome-file-list>
+
+</web-app>

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

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

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

Added: 
tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/customer.jsp
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/customer.jsp?rev=698399&view=auto
==============================================================================
--- tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/customer.jsp 
(added)
+++ tuscany/java/sca/samples/customer-dojo-webapp/src/main/webapp/customer.jsp 
Tue Sep 23 16:24:24 2008
@@ -0,0 +1,80 @@
+<%--
+ * 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" %>
+
+<html>
+<head>
+       <title>Tuscany Dojo JSON-RPC Customer Example</TITLE>
+
+       <style type="text/css">
+        @import "dojo/dijit/themes/soria/soria.css";
+        @import "dojo/dojo/resources/dojo.css"
+    </style>
+                       
+       <script type="text/javascript">
+               var djConfig = {
+                       parseOnLoad: true,
+                       baseRelativePath: "dojo",
+                       isDebug: true,
+                       debugContainerId: "dojoDebug"
+                   };
+                       djConfig.usePlainJson=true ;
+               //djConfig.debugAtAllCosts = true;
+       </script>
+       
+       <script type="text/javascript" src="dojo/dojo/dojo.js"></script>
+       <script type="text/javascript" src="dojo/dijit/dijit.js"></script>
+       
+       <script type="text/javascript">
+            dojo.require("dojo.parser");
+               dojo.require("dojo.rpc.JsonService");
+            dojo.require("dijit.form.ValidationTextBox");      
+               dojo.require("dijit.form.Button");
+       </script>
+       
+       <link rel="stylesheet" type="text/css" href="style.css" />
+</head>
+
+<body class="soria">
+
+<h2>Tuscany Dojo JSON-RPC Customer Sample</h2>
+
+Customer Name :<br>
+<input type="text" id="name" size="30" value="Joe Smith" 
dojoType="dijit.form.TextBox" trim="true" propercase="true" required="true" />  
             
+<input type="button" dojoType="dijit.form.Button" 
onclick="findCustomerByName()" />
+
+
+<script type="text/javascript">
+       function findCustomerByName() {
+           var name = document.getElementById("name").value;
+           
customerService.findCustomerByName(name).addCallback(contentCallBack);;
+        }
+
+               function contentCallBack(result) {
+                       alert(result.name);
+               //var handlerNode = document.getElementById("ReturnedContent");
+               //handlerNode.innerHTML = "<p>" + result + "</p>" ;
+       }
+    
+    var customerService = new dojo.rpc.JsonService("CustomerService?smd");
+</script>
+
+</body>
+</html>

Modified: tuscany/java/sca/samples/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/pom.xml?rev=698399&r1=698398&r2=698399&view=diff
==============================================================================
--- tuscany/java/sca/samples/pom.xml (original)
+++ tuscany/java/sca/samples/pom.xml Tue Sep 23 16:24:24 2008
@@ -62,6 +62,7 @@
                 <module>callback-ws-service</module>
                 <module>chat-webapp</module>
                 <module>customer-dojo</module>
+                <module>customer-dojo-webapp</module>
                 <module>databinding-echo</module>
                 <!--module>domain-webapp</module-->
                 <module>domain-management</module>


Reply via email to