You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2007/10/29 06:30:19 UTC

svn commit: r589497 - in /incubator/tuscany/java/sca/tutorial: assets/uiservices/store.html cloud/pom.xml store-eu/pom.xml store-eu/uiservices/store.html store/launch/LaunchStore.java store/pom.xml store/uiservices/store.html

Author: jsdelfino
Date: Sun Oct 28 22:30:18 2007
New Revision: 589497

URL: http://svn.apache.org/viewvc?rev=589497&view=rev
Log:
Minor fixes to the tutorial HTML pages.

Added:
    incubator/tuscany/java/sca/tutorial/store/uiservices/store.html   (with props)
Modified:
    incubator/tuscany/java/sca/tutorial/assets/uiservices/store.html
    incubator/tuscany/java/sca/tutorial/cloud/pom.xml
    incubator/tuscany/java/sca/tutorial/store-eu/pom.xml
    incubator/tuscany/java/sca/tutorial/store-eu/uiservices/store.html
    incubator/tuscany/java/sca/tutorial/store/launch/LaunchStore.java
    incubator/tuscany/java/sca/tutorial/store/pom.xml

Modified: incubator/tuscany/java/sca/tutorial/assets/uiservices/store.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/assets/uiservices/store.html?rev=589497&r1=589496&r2=589497&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/assets/uiservices/store.html (original)
+++ incubator/tuscany/java/sca/tutorial/assets/uiservices/store.html Sun Oct 28 22:30:18 2007
@@ -71,7 +71,7 @@
 		document.getElementById('store').innerHTML='<h2>' +
 				'Thanks for Shopping With Us!</h2>'+
 				'<h2>Your Order</h2>'+
-				'<form name="orderForm" action="/ui/store.html">'+
+				'<form name="orderForm">'+
 					document.getElementById('shoppingCart').innerHTML+
 					'<br>'+
 					document.getElementById('total').innerHTML+

Modified: incubator/tuscany/java/sca/tutorial/cloud/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/cloud/pom.xml?rev=589497&r1=589496&r2=589497&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/cloud/pom.xml (original)
+++ incubator/tuscany/java/sca/tutorial/cloud/pom.xml Sun Oct 28 22:30:18 2007
@@ -38,8 +38,9 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-node-api</artifactId>
+            <artifactId>tuscany-host-jetty</artifactId>
             <version>1.1-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
         </dependency>
 
         <dependency>
@@ -50,35 +51,34 @@
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-node-impl</artifactId>
+            <artifactId>tuscany-node-api</artifactId>
             <version>1.1-incubating-SNAPSHOT</version>
-            <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-domain-impl</artifactId>
+            <artifactId>tuscany-node-impl</artifactId>
             <version>1.1-incubating-SNAPSHOT</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <artifactId>tuscany-domain-impl</artifactId>
             <version>1.1-incubating-SNAPSHOT</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-binding-sca-axis2</artifactId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
             <version>1.1-incubating-SNAPSHOT</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-host-jetty</artifactId>
+            <artifactId>tuscany-binding-sca-axis2</artifactId>
             <version>1.1-incubating-SNAPSHOT</version>
             <scope>runtime</scope>
         </dependency>

Modified: incubator/tuscany/java/sca/tutorial/store-eu/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-eu/pom.xml?rev=589497&r1=589496&r2=589497&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-eu/pom.xml (original)
+++ incubator/tuscany/java/sca/tutorial/store-eu/pom.xml Sun Oct 28 22:30:18 2007
@@ -38,8 +38,9 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-node-api</artifactId>
+            <artifactId>tuscany-host-jetty</artifactId>
             <version>1.1-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
         </dependency>
 
         <dependency>
@@ -50,6 +51,12 @@
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node-api</artifactId>
+            <version>1.1-incubating-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-node-impl</artifactId>
             <version>1.1-incubating-SNAPSHOT</version>
             <scope>runtime</scope>
@@ -64,7 +71,7 @@
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-implementation-resource</artifactId>
+            <artifactId>tuscany-implementation-widget</artifactId>
             <version>1.1-incubating-SNAPSHOT</version>
             <scope>runtime</scope>
         </dependency>
@@ -85,13 +92,6 @@
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-binding-http</artifactId>
-            <version>1.1-incubating-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-host-jetty</artifactId>
             <version>1.1-incubating-SNAPSHOT</version>
             <scope>runtime</scope>
         </dependency>

Modified: incubator/tuscany/java/sca/tutorial/store-eu/uiservices/store.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store-eu/uiservices/store.html?rev=589497&r1=589496&r2=589497&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store-eu/uiservices/store.html (original)
+++ incubator/tuscany/java/sca/tutorial/store-eu/uiservices/store.html Sun Oct 28 22:30:18 2007
@@ -71,7 +71,7 @@
 		document.getElementById('store').innerHTML='<h2>' +
 				'Thanks for Shopping With Us!</h2>'+
 				'<h2>Your Order</h2>'+
-				'<form name="orderForm" action="/ui/store.html">'+
+				'<form name="orderForm">'+
 					document.getElementById('shoppingCart').innerHTML+
 					'<br>'+
 					document.getElementById('total').innerHTML+

Modified: incubator/tuscany/java/sca/tutorial/store/launch/LaunchStore.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store/launch/LaunchStore.java?rev=589497&r1=589496&r2=589497&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store/launch/LaunchStore.java (original)
+++ incubator/tuscany/java/sca/tutorial/store/launch/LaunchStore.java Sun Oct 28 22:30:18 2007
@@ -31,7 +31,7 @@
     public static void main(String[] args) throws Exception {
         System.out.println("Starting ...");
         SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
-        SCANode node = nodeFactory.createSCANode(null, "http://localhost:9999");
+        SCANode node = nodeFactory.createSCANode("http://localhost:8100/store", "http://localhost:9999");
         
         URL contribution = SCAContributionUtil.findContributionFromClass(LaunchStore.class);
         node.addContribution("http://store", contribution);

Modified: incubator/tuscany/java/sca/tutorial/store/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store/pom.xml?rev=589497&r1=589496&r2=589497&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store/pom.xml (original)
+++ incubator/tuscany/java/sca/tutorial/store/pom.xml Sun Oct 28 22:30:18 2007
@@ -38,8 +38,9 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-node-api</artifactId>
+            <artifactId>tuscany-host-jetty</artifactId>
             <version>1.1-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
         </dependency>
 
         <dependency>
@@ -50,6 +51,12 @@
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node-api</artifactId>
+            <version>1.1-incubating-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-node-impl</artifactId>
             <version>1.1-incubating-SNAPSHOT</version>
             <scope>runtime</scope>
@@ -85,13 +92,6 @@
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-binding-http</artifactId>
-            <version>1.1-incubating-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-host-jetty</artifactId>
             <version>1.1-incubating-SNAPSHOT</version>
             <scope>runtime</scope>
         </dependency>

Added: incubator/tuscany/java/sca/tutorial/store/uiservices/store.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store/uiservices/store.html?rev=589497&view=auto
==============================================================================
--- incubator/tuscany/java/sca/tutorial/store/uiservices/store.html (added)
+++ incubator/tuscany/java/sca/tutorial/store/uiservices/store.html Sun Oct 28 22:30:18 2007
@@ -0,0 +1,120 @@
+<!--
+    * 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>Store</TITLE>
+
+<script type="text/javascript" src="store.js"></script>
+
+<script language="JavaScript">
+
+	//@Reference
+	var catalog = new Reference("catalog");
+	
+	//@Reference
+	var shoppingCart = new Reference("shoppingCart");
+
+
+	function catalog_getResponse(items) {
+		var catalog = "";
+		for (var i=0; i<items.length; i++) {
+			catalog += '<input name="items" type="checkbox" value="' + 
+						items[i] + '">' + items[i] + ' <br>';
+		}
+		document.getElementById('catalog').innerHTML=catalog;
+	}
+	
+	function shoppingCart_getResponse(feed) {
+		if (feed != null) {
+			var entries = feed.getElementsByTagName("entry");              
+			var list = "";
+			for (var i=0; i<entries.length; i++) {
+				var item = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
+				list += item + ' <br>';
+			}
+			document.getElementById("shoppingCart").innerHTML = list;
+			document.getElementById('total').innerHTML = feed.getElementsByTagName("subtitle")[0].firstChild.nodeValue;
+		}
+	}
+	function shoppingCart_postResponse(entry) {
+		shoppingCart.get("", shoppingCart_getResponse);
+	}				
+
+
+	function addToCart() {
+		var items  = document.catalogForm.items;
+		var j = 0;
+		for (var i=0; i<items.length; i++)
+			if (items[i].checked) {
+				var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title>cart-item</title><content type="text">'+items[i].value+'</content></entry>'
+				shoppingCart.post(entry, shoppingCart_postResponse);
+				items[i].checked = false;
+			}
+	}
+	function checkoutCart() {
+		document.getElementById('store').innerHTML='<h2>' +
+				'Thanks for Shopping With Us!</h2>'+
+				'<h2>Your Order</h2>'+
+				'<form name="orderForm">'+
+					document.getElementById('shoppingCart').innerHTML+
+					'<br>'+
+					document.getElementById('total').innerHTML+
+					'<br>'+
+					'<br>'+
+					'<input type="submit" value="Continue Shopping">'+ 
+				'</form>';
+		shoppingCart.del("", null);
+	}
+	function deleteCart() {
+		shoppingCart.del("", null);
+		document.getElementById('shoppingCart').innerHTML = "";
+		document.getElementById('total').innerHTML = "";	
+	}	
+
+	catalog.get(catalog_getResponse);
+	shoppingCart.get("", shoppingCart_getResponse);
+</script>
+
+</head>
+
+<body>
+<h1>Store</h1>
+  <div id="store">
+   	<h2>Catalog</h2>
+   	<form name="catalogForm">
+		<div id="catalog" ></div>
+		<br>
+		<input type="button" onClick="addToCart()"  value="Add to Cart">
+   	</form>
+ 
+ 	<br>
+  
+   	<h2>Your Shopping Cart</h2>
+   	<form name="shoppingCartForm">
+		<div id="shoppingCart"></div>
+		<br>
+		<div id="total"></div>
+		<br>		
+		<input type="button" onClick="checkoutCart()" value="Checkout"> 
+		<input type="button" onClick="deleteCart()" value="Empty">     
+	   	<a href="../ShoppingCart/">(feed)</a>
+	</form>    
+  </div>
+</body>
+</html>

Propchange: incubator/tuscany/java/sca/tutorial/store/uiservices/store.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date



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