diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-05-28 04:39:44 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-05-28 04:39:44 +0000 |
commit | 7519724a171bb85246bb86bce453cbdd408691d9 (patch) | |
tree | 3fd959c40a09fc496bf1f84d9fd25eaf9741fd5e /sca-cpp/trunk/samples | |
parent | 4a28afdf7a6b193942f180862d443a7d818c5789 (diff) |
Cleanup sample and test HTML pages. Remove crlf, fix links to the Javascript scripts, and remove unused CSS stylesheets.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1343140 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/samples')
23 files changed, 1892 insertions, 1925 deletions
diff --git a/sca-cpp/trunk/samples/relay-gae/htdocs/index.html b/sca-cpp/trunk/samples/relay-gae/htdocs/index.html index 76fb54c21f..c3cf8d768e 100644 --- a/sca-cpp/trunk/samples/relay-gae/htdocs/index.html +++ b/sca-cpp/trunk/samples/relay-gae/htdocs/index.html @@ -1,36 +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.
--->
-<html>
-<head>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Relay</title>
-</head>
-<body>
-
-<p><a href="/html">Sample HTML request</a></p>
-<p><a href="/jsontwit">Sample Twitter JSON request</a></p>
-<p><a href="/xmltwit">Sample Twitter XML request</a></p>
-<p><a href="/rsstwit">Sample Twitter RSS request</a></p>
-<p><a href="/jsonfb">Sample Facebook JSON request</a></p>
-
-</body>
-</html>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Relay</title> +</head> +<body> + +<p><a href="/html">Sample HTML request</a></p> +<p><a href="/jsontwit">Sample Twitter JSON request</a></p> +<p><a href="/xmltwit">Sample Twitter XML request</a></p> +<p><a href="/rsstwit">Sample Twitter RSS request</a></p> +<p><a href="/jsonfb">Sample Facebook JSON request</a></p> + +</body> +</html> diff --git a/sca-cpp/trunk/samples/relay-python/htdocs/index.html b/sca-cpp/trunk/samples/relay-python/htdocs/index.html index 1a02816df9..28061397d5 100644 --- a/sca-cpp/trunk/samples/relay-python/htdocs/index.html +++ b/sca-cpp/trunk/samples/relay-python/htdocs/index.html @@ -1,35 +1,35 @@ -<!--
- * 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>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Relay</title>
-<body>
-
-<p><a href="/html">Sample HTML request</a></p>
-<p><a href="/jsontwit">Sample Twitter JSON request</a></p>
-<p><a href="/xmltwit">Sample Twitter XML request</a></p>
-<p><a href="/rsstwit">Sample Twitter RSS request</a></p>
-<p><a href="/jsonfb">Sample Facebook JSON request</a></p>
-
-</body>
-</html>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Relay</title> +<body> + +<p><a href="/html">Sample HTML request</a></p> +<p><a href="/jsontwit">Sample Twitter JSON request</a></p> +<p><a href="/xmltwit">Sample Twitter XML request</a></p> +<p><a href="/rsstwit">Sample Twitter RSS request</a></p> +<p><a href="/jsonfb">Sample Facebook JSON request</a></p> + +</body> +</html> diff --git a/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/index.html b/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/index.html index 09e2c4ab83..43f624a8c3 100644 --- a/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/index.html @@ -1,159 +1,156 @@ -<!--
- * 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>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Jane's Store</title>
-
-<script type="text/javascript" src="/util.js"></script>
-<script type="text/javascript" src="/elemutil.js"></script>
-<script type="text/javascript" src="/xmlutil.js"></script>
-<script type="text/javascript" src="/atomutil.js"></script>
-<script type="text/javascript" src="/component.js"></script>
-
-<script type="text/javascript">
-var store = sca.component("Store");
-var catalog = sca.defun(sca.reference(store, "catalog"), "items");
-var shoppingCart = sca.reference(store, "shoppingCart");
-var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total");
-
-var catalogItems;
-
-function catalog_itemsResponse(items, exception) {
- if (exception){
- alert(exception.message);
- return;
- }
- var catalog = "";
- for (var i=0; i<items.length; i++) {
- var item = items[i].name + ' - ' + items[i].price;
- catalog += '<input name="items" type="checkbox" value="' +
- item + '">' + item + ' <br>';
- }
- document.getElementById('catalog').innerHTML=catalog;
- catalogItems = items;
-
-}
-
-function shoppingCart_getResponse(doc) {
- if (doc != null) {
- var feed = parseXML([doc]);
- var entries = feed.getElementsByTagName("entry");
- var list = "";
- for (var i=0; i<entries.length; i++) {
- var content = entries[i].getElementsByTagName("content")[0];
- var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
- var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
- list += name + ' - ' + price + ' <br>';
- }
- document.getElementById("shoppingCart").innerHTML = list;
-
- shoppingTotal.total(shoppingTotal_totalResponse);
- }
-}
-
-function shoppingTotal_totalResponse(total, exception) {
- if (exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('total').innerHTML = total;
-}
-
-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 type="text">Item</title><content type="application/xml">' +
- '<item>' +
- '<name>' + catalogItems[i].name + '</name>' +
- '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' +
- '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' +
- '<price>' + catalogItems[i].price + '</price>' +
- '</item>' +
- '</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 = "";
-}
-
-function init() {
- try {
- catalog.items(catalog_itemsResponse);
- shoppingCart.get("", shoppingCart_getResponse);
- } catch(e){
- alert(e);
- }
-}
-</script>
-</head>
-
-<body onload="init()">
-<h1>Jane's Store</h1>
-<br/>
-<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>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Jane's Store</title> + +<script type="text/javascript" src="/all.js"></script> + +<script type="text/javascript"> +var store = sca.component("Store"); +var catalog = sca.defun(sca.reference(store, "catalog"), "items"); +var shoppingCart = sca.reference(store, "shoppingCart"); +var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total"); + +var catalogItems; + +function catalog_itemsResponse(items, exception) { + if (exception){ + alert(exception.message); + return; + } + var catalog = ""; + for (var i=0; i<items.length; i++) { + var item = items[i].name + ' - ' + items[i].price; + catalog += '<input name="items" type="checkbox" value="' + + item + '">' + item + ' <br>'; + } + document.getElementById('catalog').innerHTML=catalog; + catalogItems = items; + +} + +function shoppingCart_getResponse(doc) { + if (doc != null) { + var feed = parseXML([doc]); + var entries = feed.getElementsByTagName("entry"); + var list = ""; + for (var i=0; i<entries.length; i++) { + var content = entries[i].getElementsByTagName("content")[0]; + var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; + var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; + list += name + ' - ' + price + ' <br>'; + } + document.getElementById("shoppingCart").innerHTML = list; + + shoppingTotal.total(shoppingTotal_totalResponse); + } +} + +function shoppingTotal_totalResponse(total, exception) { + if (exception) { + alert(exception.message); + return; + } + document.getElementById('total').innerHTML = total; +} + +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 = '<?xml version="1.0" encoding="UTF-8"?>\n' + + '<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml">' + + '<item>' + + '<name>' + catalogItems[i].name + '</name>' + + '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' + + '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' + + '<price>' + catalogItems[i].price + '</price>' + + '</item>' + + '</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 = ""; +} + +function init() { + try { + catalog.items(catalog_itemsResponse); + shoppingCart.get("", shoppingCart_getResponse); + } catch(e){ + alert(e); + } +} +</script> +</head> + +<body onload="init()"> +<h1>Jane's Store</h1> +<br/> +<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> diff --git a/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/login/index.html b/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/login/index.html index fcad40bf8a..9fcafbd5a1 100644 --- a/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/login/index.html +++ b/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/login/index.html @@ -23,7 +23,7 @@ <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> <link rel="stylesheet" type="text/css" href="/ui.css"/> -<script type="text/javascript" src="/util.js"></script> +<script type="text/javascript" src="/all.js"></script> <title>Sign in</title> </head> <body> diff --git a/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/logout/index.html b/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/logout/index.html index 91608a6523..4140eb3b93 100644 --- a/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/logout/index.html +++ b/sca-cpp/trunk/samples/store-cluster/domains/jane/htdocs/logout/index.html @@ -23,7 +23,7 @@ <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> <link rel="stylesheet" type="text/css" href="/ui.css"/> -<script type="text/javascript" src="/util.js"></script> +<script type="text/javascript" src="/all.js"></script> <title>Sign out</title> </head> <body> diff --git a/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/index.html b/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/index.html index 4a25ff4afa..34c8dd3986 100644 --- a/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/index.html @@ -1,159 +1,156 @@ -<!--
- * 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>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Joe's Store</title>
-
-<script type="text/javascript" src="/util.js"></script>
-<script type="text/javascript" src="/elemutil.js"></script>
-<script type="text/javascript" src="/xmlutil.js"></script>
-<script type="text/javascript" src="/atomutil.js"></script>
-<script type="text/javascript" src="/component.js"></script>
-
-<script type="text/javascript">
-var store = sca.component("Store");
-var catalog = sca.defun(sca.reference(store, "catalog"), "items");
-var shoppingCart = sca.reference(store, "shoppingCart");
-var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total");
-
-var catalogItems;
-
-function catalog_itemsResponse(items, exception) {
- if (exception){
- alert(exception.message);
- return;
- }
- var catalog = "";
- for (var i=0; i<items.length; i++) {
- var item = items[i].name + ' - ' + items[i].price;
- catalog += '<input name="items" type="checkbox" value="' +
- item + '">' + item + ' <br>';
- }
- document.getElementById('catalog').innerHTML=catalog;
- catalogItems = items;
-
-}
-
-function shoppingCart_getResponse(doc) {
- if (doc != null) {
- var feed = parseXML([doc]);
- var entries = feed.getElementsByTagName("entry");
- var list = "";
- for (var i=0; i<entries.length; i++) {
- var content = entries[i].getElementsByTagName("content")[0];
- var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
- var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
- list += name + ' - ' + price + ' <br>';
- }
- document.getElementById("shoppingCart").innerHTML = list;
-
- shoppingTotal.total(shoppingTotal_totalResponse);
- }
-}
-
-function shoppingTotal_totalResponse(total, exception) {
- if (exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('total').innerHTML = total;
-}
-
-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 type="text">Item</title><content type="application/xml">' +
- '<item>' +
- '<name>' + catalogItems[i].name + '</name>' +
- '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' +
- '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' +
- '<price>' + catalogItems[i].price + '</price>' +
- '</item>' +
- '</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 = "";
-}
-
-function init() {
- try {
- catalog.items(catalog_itemsResponse);
- shoppingCart.get("", shoppingCart_getResponse);
- } catch(e){
- alert(e);
- }
-}
-</script>
-</head>
-
-<body onload="init()">
-<h1>Joe's Store</h1>
-<br/>
-<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>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Joe's Store</title> + +<script type="text/javascript" src="/all.js"></script> + +<script type="text/javascript"> +var store = sca.component("Store"); +var catalog = sca.defun(sca.reference(store, "catalog"), "items"); +var shoppingCart = sca.reference(store, "shoppingCart"); +var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total"); + +var catalogItems; + +function catalog_itemsResponse(items, exception) { + if (exception){ + alert(exception.message); + return; + } + var catalog = ""; + for (var i=0; i<items.length; i++) { + var item = items[i].name + ' - ' + items[i].price; + catalog += '<input name="items" type="checkbox" value="' + + item + '">' + item + ' <br>'; + } + document.getElementById('catalog').innerHTML=catalog; + catalogItems = items; + +} + +function shoppingCart_getResponse(doc) { + if (doc != null) { + var feed = parseXML([doc]); + var entries = feed.getElementsByTagName("entry"); + var list = ""; + for (var i=0; i<entries.length; i++) { + var content = entries[i].getElementsByTagName("content")[0]; + var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; + var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; + list += name + ' - ' + price + ' <br>'; + } + document.getElementById("shoppingCart").innerHTML = list; + + shoppingTotal.total(shoppingTotal_totalResponse); + } +} + +function shoppingTotal_totalResponse(total, exception) { + if (exception) { + alert(exception.message); + return; + } + document.getElementById('total').innerHTML = total; +} + +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 = '<?xml version="1.0" encoding="UTF-8"?>\n' + + '<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml">' + + '<item>' + + '<name>' + catalogItems[i].name + '</name>' + + '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' + + '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' + + '<price>' + catalogItems[i].price + '</price>' + + '</item>' + + '</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 = ""; +} + +function init() { + try { + catalog.items(catalog_itemsResponse); + shoppingCart.get("", shoppingCart_getResponse); + } catch(e){ + alert(e); + } +} +</script> +</head> + +<body onload="init()"> +<h1>Joe's Store</h1> +<br/> +<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> diff --git a/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/login/index.html b/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/login/index.html index fcad40bf8a..9fcafbd5a1 100644 --- a/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/login/index.html +++ b/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/login/index.html @@ -23,7 +23,7 @@ <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> <link rel="stylesheet" type="text/css" href="/ui.css"/> -<script type="text/javascript" src="/util.js"></script> +<script type="text/javascript" src="/all.js"></script> <title>Sign in</title> </head> <body> diff --git a/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/logout/index.html b/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/logout/index.html index 91608a6523..4140eb3b93 100644 --- a/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/logout/index.html +++ b/sca-cpp/trunk/samples/store-cluster/domains/joe/htdocs/logout/index.html @@ -23,7 +23,7 @@ <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> <link rel="stylesheet" type="text/css" href="/ui.css"/> -<script type="text/javascript" src="/util.js"></script> +<script type="text/javascript" src="/all.js"></script> <title>Sign out</title> </head> <body> diff --git a/sca-cpp/trunk/samples/store-cluster/htdocs/index.html b/sca-cpp/trunk/samples/store-cluster/htdocs/index.html index a2b44bcb96..c1bd39181d 100644 --- a/sca-cpp/trunk/samples/store-cluster/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-cluster/htdocs/index.html @@ -1,39 +1,39 @@ -<!--
- * 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>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Store</title>
-</head>
-
-<body>
-<h1>Store</h1>
-<br/>
-<p>For this sample to work, add the sample domain to your /etc/hosts as follows:<br/>
-127.0.0.1 example.com jane.example.com joe.example.com</p>
-
-<p/>
-<p>Jane's store at <a href="http://jane.example.com/">jane.example.com</a>
-<br/>Joe's store at <a href="http://joe.example.com/">joe.example.com</a></p>
-
-</body>
-</html>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Store</title> +</head> + +<body> +<h1>Store</h1> +<br/> +<p>For this sample to work, add the sample domain to your /etc/hosts as follows:<br/> +127.0.0.1 example.com jane.example.com joe.example.com</p> + +<p/> +<p>Jane's store at <a href="http://jane.example.com/">jane.example.com</a> +<br/>Joe's store at <a href="http://joe.example.com/">joe.example.com</a></p> + +</body> +</html> diff --git a/sca-cpp/trunk/samples/store-cluster/htdocs/login/index.html b/sca-cpp/trunk/samples/store-cluster/htdocs/login/index.html index fcad40bf8a..9fcafbd5a1 100644 --- a/sca-cpp/trunk/samples/store-cluster/htdocs/login/index.html +++ b/sca-cpp/trunk/samples/store-cluster/htdocs/login/index.html @@ -23,7 +23,7 @@ <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> <link rel="stylesheet" type="text/css" href="/ui.css"/> -<script type="text/javascript" src="/util.js"></script> +<script type="text/javascript" src="/all.js"></script> <title>Sign in</title> </head> <body> diff --git a/sca-cpp/trunk/samples/store-cluster/htdocs/logout/index.html b/sca-cpp/trunk/samples/store-cluster/htdocs/logout/index.html index 91608a6523..4140eb3b93 100644 --- a/sca-cpp/trunk/samples/store-cluster/htdocs/logout/index.html +++ b/sca-cpp/trunk/samples/store-cluster/htdocs/logout/index.html @@ -23,7 +23,7 @@ <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> <link rel="stylesheet" type="text/css" href="/ui.css"/> -<script type="text/javascript" src="/util.js"></script> +<script type="text/javascript" src="/all.js"></script> <title>Sign out</title> </head> <body> diff --git a/sca-cpp/trunk/samples/store-constdb/htdocs/index.html b/sca-cpp/trunk/samples/store-constdb/htdocs/index.html index 83b1e16df4..4a621631bd 100644 --- a/sca-cpp/trunk/samples/store-constdb/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-constdb/htdocs/index.html @@ -1,159 +1,156 @@ -<!--
- * 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>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Store</title>
-
-<script type="text/javascript" src="/util.js"></script>
-<script type="text/javascript" src="/elemutil.js"></script>
-<script type="text/javascript" src="/xmlutil.js"></script>
-<script type="text/javascript" src="/atomutil.js"></script>
-<script type="text/javascript" src="/component.js"></script>
-
-<script type="text/javascript">
-var store = sca.component("Store");
-var catalog = sca.defun(sca.reference(store, "catalog"), "items");
-var shoppingCart = sca.reference(store, "shoppingCart");
-var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total");
-
-var catalogItems;
-
-function catalog_itemsResponse(items, exception) {
- if (exception){
- alert(exception.message);
- return;
- }
- var catalog = "";
- for (var i=0; i<items.length; i++) {
- var item = items[i].name + ' - ' + items[i].price;
- catalog += '<input name="items" type="checkbox" value="' +
- item + '">' + item + ' <br>';
- }
- document.getElementById('catalog').innerHTML=catalog;
- catalogItems = items;
-
-}
-
-function shoppingCart_getResponse(doc) {
- if (doc != null) {
- var feed = parseXML([doc]);
- var entries = feed.getElementsByTagName("entry");
- var list = "";
- for (var i=0; i<entries.length; i++) {
- var content = entries[i].getElementsByTagName("content")[0];
- var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
- var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
- list += name + ' - ' + price + ' <br>';
- }
- document.getElementById("shoppingCart").innerHTML = list;
-
- shoppingTotal.total(shoppingTotal_totalResponse);
- }
-}
-
-function shoppingTotal_totalResponse(total, exception) {
- if (exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('total').innerHTML = total;
-}
-
-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 type="text">Item</title><content type="application/xml">' +
- '<item>' +
- '<name>' + catalogItems[i].name + '</name>' +
- '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' +
- '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' +
- '<price>' + catalogItems[i].price + '</price>' +
- '</item>' +
- '</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 = "";
-}
-
-function init() {
- try {
- catalog.items(catalog_itemsResponse);
- shoppingCart.get("", shoppingCart_getResponse);
- } catch(e){
- alert(e);
- }
-}
-</script>
-</head>
-
-<body onload="init()">
-<h1>Store</h1>
-<br/>
-<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>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Store</title> + +<script type="text/javascript" src="/all.js"></script> + +<script type="text/javascript"> +var store = sca.component("Store"); +var catalog = sca.defun(sca.reference(store, "catalog"), "items"); +var shoppingCart = sca.reference(store, "shoppingCart"); +var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total"); + +var catalogItems; + +function catalog_itemsResponse(items, exception) { + if (exception){ + alert(exception.message); + return; + } + var catalog = ""; + for (var i=0; i<items.length; i++) { + var item = items[i].name + ' - ' + items[i].price; + catalog += '<input name="items" type="checkbox" value="' + + item + '">' + item + ' <br>'; + } + document.getElementById('catalog').innerHTML=catalog; + catalogItems = items; + +} + +function shoppingCart_getResponse(doc) { + if (doc != null) { + var feed = parseXML([doc]); + var entries = feed.getElementsByTagName("entry"); + var list = ""; + for (var i=0; i<entries.length; i++) { + var content = entries[i].getElementsByTagName("content")[0]; + var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; + var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; + list += name + ' - ' + price + ' <br>'; + } + document.getElementById("shoppingCart").innerHTML = list; + + shoppingTotal.total(shoppingTotal_totalResponse); + } +} + +function shoppingTotal_totalResponse(total, exception) { + if (exception) { + alert(exception.message); + return; + } + document.getElementById('total').innerHTML = total; +} + +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 = '<?xml version="1.0" encoding="UTF-8"?>\n' + + '<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml">' + + '<item>' + + '<name>' + catalogItems[i].name + '</name>' + + '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' + + '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' + + '<price>' + catalogItems[i].price + '</price>' + + '</item>' + + '</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 = ""; +} + +function init() { + try { + catalog.items(catalog_itemsResponse); + shoppingCart.get("", shoppingCart_getResponse); + } catch(e){ + alert(e); + } +} +</script> +</head> + +<body onload="init()"> +<h1>Store</h1> +<br/> +<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> diff --git a/sca-cpp/trunk/samples/store-cpp/htdocs/index.html b/sca-cpp/trunk/samples/store-cpp/htdocs/index.html index 83b1e16df4..4a621631bd 100644 --- a/sca-cpp/trunk/samples/store-cpp/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-cpp/htdocs/index.html @@ -1,159 +1,156 @@ -<!--
- * 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>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Store</title>
-
-<script type="text/javascript" src="/util.js"></script>
-<script type="text/javascript" src="/elemutil.js"></script>
-<script type="text/javascript" src="/xmlutil.js"></script>
-<script type="text/javascript" src="/atomutil.js"></script>
-<script type="text/javascript" src="/component.js"></script>
-
-<script type="text/javascript">
-var store = sca.component("Store");
-var catalog = sca.defun(sca.reference(store, "catalog"), "items");
-var shoppingCart = sca.reference(store, "shoppingCart");
-var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total");
-
-var catalogItems;
-
-function catalog_itemsResponse(items, exception) {
- if (exception){
- alert(exception.message);
- return;
- }
- var catalog = "";
- for (var i=0; i<items.length; i++) {
- var item = items[i].name + ' - ' + items[i].price;
- catalog += '<input name="items" type="checkbox" value="' +
- item + '">' + item + ' <br>';
- }
- document.getElementById('catalog').innerHTML=catalog;
- catalogItems = items;
-
-}
-
-function shoppingCart_getResponse(doc) {
- if (doc != null) {
- var feed = parseXML([doc]);
- var entries = feed.getElementsByTagName("entry");
- var list = "";
- for (var i=0; i<entries.length; i++) {
- var content = entries[i].getElementsByTagName("content")[0];
- var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
- var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
- list += name + ' - ' + price + ' <br>';
- }
- document.getElementById("shoppingCart").innerHTML = list;
-
- shoppingTotal.total(shoppingTotal_totalResponse);
- }
-}
-
-function shoppingTotal_totalResponse(total, exception) {
- if (exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('total').innerHTML = total;
-}
-
-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 type="text">Item</title><content type="application/xml">' +
- '<item>' +
- '<name>' + catalogItems[i].name + '</name>' +
- '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' +
- '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' +
- '<price>' + catalogItems[i].price + '</price>' +
- '</item>' +
- '</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 = "";
-}
-
-function init() {
- try {
- catalog.items(catalog_itemsResponse);
- shoppingCart.get("", shoppingCart_getResponse);
- } catch(e){
- alert(e);
- }
-}
-</script>
-</head>
-
-<body onload="init()">
-<h1>Store</h1>
-<br/>
-<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>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Store</title> + +<script type="text/javascript" src="/all.js"></script> + +<script type="text/javascript"> +var store = sca.component("Store"); +var catalog = sca.defun(sca.reference(store, "catalog"), "items"); +var shoppingCart = sca.reference(store, "shoppingCart"); +var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total"); + +var catalogItems; + +function catalog_itemsResponse(items, exception) { + if (exception){ + alert(exception.message); + return; + } + var catalog = ""; + for (var i=0; i<items.length; i++) { + var item = items[i].name + ' - ' + items[i].price; + catalog += '<input name="items" type="checkbox" value="' + + item + '">' + item + ' <br>'; + } + document.getElementById('catalog').innerHTML=catalog; + catalogItems = items; + +} + +function shoppingCart_getResponse(doc) { + if (doc != null) { + var feed = parseXML([doc]); + var entries = feed.getElementsByTagName("entry"); + var list = ""; + for (var i=0; i<entries.length; i++) { + var content = entries[i].getElementsByTagName("content")[0]; + var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; + var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; + list += name + ' - ' + price + ' <br>'; + } + document.getElementById("shoppingCart").innerHTML = list; + + shoppingTotal.total(shoppingTotal_totalResponse); + } +} + +function shoppingTotal_totalResponse(total, exception) { + if (exception) { + alert(exception.message); + return; + } + document.getElementById('total').innerHTML = total; +} + +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 = '<?xml version="1.0" encoding="UTF-8"?>\n' + + '<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml">' + + '<item>' + + '<name>' + catalogItems[i].name + '</name>' + + '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' + + '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' + + '<price>' + catalogItems[i].price + '</price>' + + '</item>' + + '</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 = ""; +} + +function init() { + try { + catalog.items(catalog_itemsResponse); + shoppingCart.get("", shoppingCart_getResponse); + } catch(e){ + alert(e); + } +} +</script> +</head> + +<body onload="init()"> +<h1>Store</h1> +<br/> +<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> diff --git a/sca-cpp/trunk/samples/store-gae/htdocs/index.html b/sca-cpp/trunk/samples/store-gae/htdocs/index.html index e16890eee4..979d27e048 100644 --- a/sca-cpp/trunk/samples/store-gae/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-gae/htdocs/index.html @@ -1,178 +1,175 @@ -<!--
- * 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>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Store</title>
-
-<script type="text/javascript" src="/util.js"></script>
-<script type="text/javascript" src="/elemutil.js"></script>
-<script type="text/javascript" src="/xmlutil.js"></script>
-<script type="text/javascript" src="/atomutil.js"></script>
-<script type="text/javascript" src="/component.js"></script>
-
-<script type="text/javascript">
-var store = sca.component("Store");
-var catalog = sca.defun(sca.reference(store, "catalog"), "items");
-var shoppingCart = sca.defun(sca.reference(store, "shoppingCart"), "email", "host");
-var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total");
-
-var catalogItems;
-
-function catalog_itemsResponse(items, exception) {
- if (exception) {
- alert(exception.message);
- return;
- }
- var catalog = "";
- for (var i=0; i<items.length; i++) {
- var item = items[i].name + ' - ' + items[i].price;
- catalog += '<input name="items" type="checkbox" value="' +
- item + '">' + item + ' <br>';
- }
- document.getElementById('catalog').innerHTML=catalog;
- catalogItems = items;
-}
-
-function shoppingCart_hostResponse(host, exception) {
- if (exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('host').innerHTML = host;
-}
-
-function shoppingCart_emailResponse(email, exception) {
- if (exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('email').innerHTML = email;
-}
-
-function shoppingCart_getResponse(doc) {
- if (doc != null) {
- var feed = parseXML([doc]);
- var entries = feed.getElementsByTagName("entry");
- var list = "";
- for (var i=0; i<entries.length; i++) {
- var content = entries[i].getElementsByTagName("content")[0];
- var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
- var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
- list += name + ' - ' + price + ' <br>';
- }
- document.getElementById("shoppingCart").innerHTML = list;
-
- shoppingTotal.total(shoppingTotal_totalResponse);
- }
-}
-
-function shoppingTotal_totalResponse(total,exception) {
- if (exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('total').innerHTML = total;
-}
-
-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 type="text">Item</title><content type="application/xml">' +
- '<item>' +
- '<name>' + catalogItems[i].name + '</name>' +
- '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' +
- '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' +
- '<price>' + catalogItems[i].price + '</price>' +
- '</item>' +
- '</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 = "";
-}
-
-function init() {
- try {
- catalog.items(catalog_itemsResponse);
- shoppingCart.email(shoppingCart_emailResponse);
- shoppingCart.host(shoppingCart_hostResponse);
- shoppingCart.get("", shoppingCart_getResponse);
- } catch(e){
- alert(e);
- }
-}
-</script>
-</head>
-
-<body onload="init()">
-<h1>Store</h1>
-<p>Welcome to: <span id="host"></span>, you're signed in as: <span id="email"></span><br/><a href="/logout">Sign out</a></p>
-<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>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Store</title> + +<script type="text/javascript" src="/all.js"></script> + +<script type="text/javascript"> +var store = sca.component("Store"); +var catalog = sca.defun(sca.reference(store, "catalog"), "items"); +var shoppingCart = sca.defun(sca.reference(store, "shoppingCart"), "email", "host"); +var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total"); + +var catalogItems; + +function catalog_itemsResponse(items, exception) { + if (exception) { + alert(exception.message); + return; + } + var catalog = ""; + for (var i=0; i<items.length; i++) { + var item = items[i].name + ' - ' + items[i].price; + catalog += '<input name="items" type="checkbox" value="' + + item + '">' + item + ' <br>'; + } + document.getElementById('catalog').innerHTML=catalog; + catalogItems = items; +} + +function shoppingCart_hostResponse(host, exception) { + if (exception) { + alert(exception.message); + return; + } + document.getElementById('host').innerHTML = host; +} + +function shoppingCart_emailResponse(email, exception) { + if (exception) { + alert(exception.message); + return; + } + document.getElementById('email').innerHTML = email; +} + +function shoppingCart_getResponse(doc) { + if (doc != null) { + var feed = parseXML([doc]); + var entries = feed.getElementsByTagName("entry"); + var list = ""; + for (var i=0; i<entries.length; i++) { + var content = entries[i].getElementsByTagName("content")[0]; + var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; + var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; + list += name + ' - ' + price + ' <br>'; + } + document.getElementById("shoppingCart").innerHTML = list; + + shoppingTotal.total(shoppingTotal_totalResponse); + } +} + +function shoppingTotal_totalResponse(total,exception) { + if (exception) { + alert(exception.message); + return; + } + document.getElementById('total').innerHTML = total; +} + +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 = '<?xml version="1.0" encoding="UTF-8"?>\n' + + '<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml">' + + '<item>' + + '<name>' + catalogItems[i].name + '</name>' + + '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' + + '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' + + '<price>' + catalogItems[i].price + '</price>' + + '</item>' + + '</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 = ""; +} + +function init() { + try { + catalog.items(catalog_itemsResponse); + shoppingCart.email(shoppingCart_emailResponse); + shoppingCart.host(shoppingCart_hostResponse); + shoppingCart.get("", shoppingCart_getResponse); + } catch(e){ + alert(e); + } +} +</script> +</head> + +<body onload="init()"> +<h1>Store</h1> +<p>Welcome to: <span id="host"></span>, you're signed in as: <span id="email"></span><br/><a href="/logout">Sign out</a></p> +<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> diff --git a/sca-cpp/trunk/samples/store-java/htdocs/index.html b/sca-cpp/trunk/samples/store-java/htdocs/index.html index 83b1e16df4..4a621631bd 100644 --- a/sca-cpp/trunk/samples/store-java/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-java/htdocs/index.html @@ -1,159 +1,156 @@ -<!--
- * 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>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Store</title>
-
-<script type="text/javascript" src="/util.js"></script>
-<script type="text/javascript" src="/elemutil.js"></script>
-<script type="text/javascript" src="/xmlutil.js"></script>
-<script type="text/javascript" src="/atomutil.js"></script>
-<script type="text/javascript" src="/component.js"></script>
-
-<script type="text/javascript">
-var store = sca.component("Store");
-var catalog = sca.defun(sca.reference(store, "catalog"), "items");
-var shoppingCart = sca.reference(store, "shoppingCart");
-var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total");
-
-var catalogItems;
-
-function catalog_itemsResponse(items, exception) {
- if (exception){
- alert(exception.message);
- return;
- }
- var catalog = "";
- for (var i=0; i<items.length; i++) {
- var item = items[i].name + ' - ' + items[i].price;
- catalog += '<input name="items" type="checkbox" value="' +
- item + '">' + item + ' <br>';
- }
- document.getElementById('catalog').innerHTML=catalog;
- catalogItems = items;
-
-}
-
-function shoppingCart_getResponse(doc) {
- if (doc != null) {
- var feed = parseXML([doc]);
- var entries = feed.getElementsByTagName("entry");
- var list = "";
- for (var i=0; i<entries.length; i++) {
- var content = entries[i].getElementsByTagName("content")[0];
- var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
- var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
- list += name + ' - ' + price + ' <br>';
- }
- document.getElementById("shoppingCart").innerHTML = list;
-
- shoppingTotal.total(shoppingTotal_totalResponse);
- }
-}
-
-function shoppingTotal_totalResponse(total, exception) {
- if (exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('total').innerHTML = total;
-}
-
-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 type="text">Item</title><content type="application/xml">' +
- '<item>' +
- '<name>' + catalogItems[i].name + '</name>' +
- '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' +
- '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' +
- '<price>' + catalogItems[i].price + '</price>' +
- '</item>' +
- '</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 = "";
-}
-
-function init() {
- try {
- catalog.items(catalog_itemsResponse);
- shoppingCart.get("", shoppingCart_getResponse);
- } catch(e){
- alert(e);
- }
-}
-</script>
-</head>
-
-<body onload="init()">
-<h1>Store</h1>
-<br/>
-<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>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Store</title> + +<script type="text/javascript" src="/all.js"></script> + +<script type="text/javascript"> +var store = sca.component("Store"); +var catalog = sca.defun(sca.reference(store, "catalog"), "items"); +var shoppingCart = sca.reference(store, "shoppingCart"); +var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total"); + +var catalogItems; + +function catalog_itemsResponse(items, exception) { + if (exception){ + alert(exception.message); + return; + } + var catalog = ""; + for (var i=0; i<items.length; i++) { + var item = items[i].name + ' - ' + items[i].price; + catalog += '<input name="items" type="checkbox" value="' + + item + '">' + item + ' <br>'; + } + document.getElementById('catalog').innerHTML=catalog; + catalogItems = items; + +} + +function shoppingCart_getResponse(doc) { + if (doc != null) { + var feed = parseXML([doc]); + var entries = feed.getElementsByTagName("entry"); + var list = ""; + for (var i=0; i<entries.length; i++) { + var content = entries[i].getElementsByTagName("content")[0]; + var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; + var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; + list += name + ' - ' + price + ' <br>'; + } + document.getElementById("shoppingCart").innerHTML = list; + + shoppingTotal.total(shoppingTotal_totalResponse); + } +} + +function shoppingTotal_totalResponse(total, exception) { + if (exception) { + alert(exception.message); + return; + } + document.getElementById('total').innerHTML = total; +} + +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 = '<?xml version="1.0" encoding="UTF-8"?>\n' + + '<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml">' + + '<item>' + + '<name>' + catalogItems[i].name + '</name>' + + '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' + + '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' + + '<price>' + catalogItems[i].price + '</price>' + + '</item>' + + '</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 = ""; +} + +function init() { + try { + catalog.items(catalog_itemsResponse); + shoppingCart.get("", shoppingCart_getResponse); + } catch(e){ + alert(e); + } +} +</script> +</head> + +<body onload="init()"> +<h1>Store</h1> +<br/> +<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> diff --git a/sca-cpp/trunk/samples/store-python/htdocs/index.html b/sca-cpp/trunk/samples/store-python/htdocs/index.html index 83b1e16df4..4a621631bd 100644 --- a/sca-cpp/trunk/samples/store-python/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-python/htdocs/index.html @@ -1,159 +1,156 @@ -<!--
- * 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>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Store</title>
-
-<script type="text/javascript" src="/util.js"></script>
-<script type="text/javascript" src="/elemutil.js"></script>
-<script type="text/javascript" src="/xmlutil.js"></script>
-<script type="text/javascript" src="/atomutil.js"></script>
-<script type="text/javascript" src="/component.js"></script>
-
-<script type="text/javascript">
-var store = sca.component("Store");
-var catalog = sca.defun(sca.reference(store, "catalog"), "items");
-var shoppingCart = sca.reference(store, "shoppingCart");
-var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total");
-
-var catalogItems;
-
-function catalog_itemsResponse(items, exception) {
- if (exception){
- alert(exception.message);
- return;
- }
- var catalog = "";
- for (var i=0; i<items.length; i++) {
- var item = items[i].name + ' - ' + items[i].price;
- catalog += '<input name="items" type="checkbox" value="' +
- item + '">' + item + ' <br>';
- }
- document.getElementById('catalog').innerHTML=catalog;
- catalogItems = items;
-
-}
-
-function shoppingCart_getResponse(doc) {
- if (doc != null) {
- var feed = parseXML([doc]);
- var entries = feed.getElementsByTagName("entry");
- var list = "";
- for (var i=0; i<entries.length; i++) {
- var content = entries[i].getElementsByTagName("content")[0];
- var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
- var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
- list += name + ' - ' + price + ' <br>';
- }
- document.getElementById("shoppingCart").innerHTML = list;
-
- shoppingTotal.total(shoppingTotal_totalResponse);
- }
-}
-
-function shoppingTotal_totalResponse(total, exception) {
- if (exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('total').innerHTML = total;
-}
-
-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 type="text">Item</title><content type="application/xml">' +
- '<item>' +
- '<name>' + catalogItems[i].name + '</name>' +
- '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' +
- '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' +
- '<price>' + catalogItems[i].price + '</price>' +
- '</item>' +
- '</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 = "";
-}
-
-function init() {
- try {
- catalog.items(catalog_itemsResponse);
- shoppingCart.get("", shoppingCart_getResponse);
- } catch(e){
- alert(e);
- }
-}
-</script>
-</head>
-
-<body onload="init()">
-<h1>Store</h1>
-<br/>
-<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>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Store</title> + +<script type="text/javascript" src="/all.js"></script> + +<script type="text/javascript"> +var store = sca.component("Store"); +var catalog = sca.defun(sca.reference(store, "catalog"), "items"); +var shoppingCart = sca.reference(store, "shoppingCart"); +var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total"); + +var catalogItems; + +function catalog_itemsResponse(items, exception) { + if (exception){ + alert(exception.message); + return; + } + var catalog = ""; + for (var i=0; i<items.length; i++) { + var item = items[i].name + ' - ' + items[i].price; + catalog += '<input name="items" type="checkbox" value="' + + item + '">' + item + ' <br>'; + } + document.getElementById('catalog').innerHTML=catalog; + catalogItems = items; + +} + +function shoppingCart_getResponse(doc) { + if (doc != null) { + var feed = parseXML([doc]); + var entries = feed.getElementsByTagName("entry"); + var list = ""; + for (var i=0; i<entries.length; i++) { + var content = entries[i].getElementsByTagName("content")[0]; + var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; + var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; + list += name + ' - ' + price + ' <br>'; + } + document.getElementById("shoppingCart").innerHTML = list; + + shoppingTotal.total(shoppingTotal_totalResponse); + } +} + +function shoppingTotal_totalResponse(total, exception) { + if (exception) { + alert(exception.message); + return; + } + document.getElementById('total').innerHTML = total; +} + +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 = '<?xml version="1.0" encoding="UTF-8"?>\n' + + '<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml">' + + '<item>' + + '<name>' + catalogItems[i].name + '</name>' + + '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' + + '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' + + '<price>' + catalogItems[i].price + '</price>' + + '</item>' + + '</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 = ""; +} + +function init() { + try { + catalog.items(catalog_itemsResponse); + shoppingCart.get("", shoppingCart_getResponse); + } catch(e){ + alert(e); + } +} +</script> +</head> + +<body onload="init()"> +<h1>Store</h1> +<br/> +<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> diff --git a/sca-cpp/trunk/samples/store-python/htdocs/login/index.html b/sca-cpp/trunk/samples/store-python/htdocs/login/index.html index 5c5286f7c4..3936730553 100644 --- a/sca-cpp/trunk/samples/store-python/htdocs/login/index.html +++ b/sca-cpp/trunk/samples/store-python/htdocs/login/index.html @@ -23,7 +23,7 @@ <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> <link rel="stylesheet" type="text/css" href="/ui.css"/> -<script type="text/javascript" src="/util.js"></script> +<script type="text/javascript" src="/all.js"></script> <title>Sign in</title> </head> <body> diff --git a/sca-cpp/trunk/samples/store-python/htdocs/logout/index.html b/sca-cpp/trunk/samples/store-python/htdocs/logout/index.html index 452fa7399d..1108b00e65 100644 --- a/sca-cpp/trunk/samples/store-python/htdocs/logout/index.html +++ b/sca-cpp/trunk/samples/store-python/htdocs/logout/index.html @@ -23,7 +23,7 @@ <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> <link rel="stylesheet" type="text/css" href="/ui.css"/> -<script type="text/javascript" src="/util.js"></script> +<script type="text/javascript" src="/all.js"></script> <title>Sign out</title> </head> <body> diff --git a/sca-cpp/trunk/samples/store-scheme/htdocs/index.html b/sca-cpp/trunk/samples/store-scheme/htdocs/index.html index 83b1e16df4..4a621631bd 100644 --- a/sca-cpp/trunk/samples/store-scheme/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-scheme/htdocs/index.html @@ -1,159 +1,156 @@ -<!--
- * 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>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Store</title>
-
-<script type="text/javascript" src="/util.js"></script>
-<script type="text/javascript" src="/elemutil.js"></script>
-<script type="text/javascript" src="/xmlutil.js"></script>
-<script type="text/javascript" src="/atomutil.js"></script>
-<script type="text/javascript" src="/component.js"></script>
-
-<script type="text/javascript">
-var store = sca.component("Store");
-var catalog = sca.defun(sca.reference(store, "catalog"), "items");
-var shoppingCart = sca.reference(store, "shoppingCart");
-var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total");
-
-var catalogItems;
-
-function catalog_itemsResponse(items, exception) {
- if (exception){
- alert(exception.message);
- return;
- }
- var catalog = "";
- for (var i=0; i<items.length; i++) {
- var item = items[i].name + ' - ' + items[i].price;
- catalog += '<input name="items" type="checkbox" value="' +
- item + '">' + item + ' <br>';
- }
- document.getElementById('catalog').innerHTML=catalog;
- catalogItems = items;
-
-}
-
-function shoppingCart_getResponse(doc) {
- if (doc != null) {
- var feed = parseXML([doc]);
- var entries = feed.getElementsByTagName("entry");
- var list = "";
- for (var i=0; i<entries.length; i++) {
- var content = entries[i].getElementsByTagName("content")[0];
- var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
- var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
- list += name + ' - ' + price + ' <br>';
- }
- document.getElementById("shoppingCart").innerHTML = list;
-
- shoppingTotal.total(shoppingTotal_totalResponse);
- }
-}
-
-function shoppingTotal_totalResponse(total, exception) {
- if (exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('total').innerHTML = total;
-}
-
-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 type="text">Item</title><content type="application/xml">' +
- '<item>' +
- '<name>' + catalogItems[i].name + '</name>' +
- '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' +
- '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' +
- '<price>' + catalogItems[i].price + '</price>' +
- '</item>' +
- '</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 = "";
-}
-
-function init() {
- try {
- catalog.items(catalog_itemsResponse);
- shoppingCart.get("", shoppingCart_getResponse);
- } catch(e){
- alert(e);
- }
-}
-</script>
-</head>
-
-<body onload="init()">
-<h1>Store</h1>
-<br/>
-<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>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Store</title> + +<script type="text/javascript" src="/all.js"></script> + +<script type="text/javascript"> +var store = sca.component("Store"); +var catalog = sca.defun(sca.reference(store, "catalog"), "items"); +var shoppingCart = sca.reference(store, "shoppingCart"); +var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total"); + +var catalogItems; + +function catalog_itemsResponse(items, exception) { + if (exception){ + alert(exception.message); + return; + } + var catalog = ""; + for (var i=0; i<items.length; i++) { + var item = items[i].name + ' - ' + items[i].price; + catalog += '<input name="items" type="checkbox" value="' + + item + '">' + item + ' <br>'; + } + document.getElementById('catalog').innerHTML=catalog; + catalogItems = items; + +} + +function shoppingCart_getResponse(doc) { + if (doc != null) { + var feed = parseXML([doc]); + var entries = feed.getElementsByTagName("entry"); + var list = ""; + for (var i=0; i<entries.length; i++) { + var content = entries[i].getElementsByTagName("content")[0]; + var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; + var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; + list += name + ' - ' + price + ' <br>'; + } + document.getElementById("shoppingCart").innerHTML = list; + + shoppingTotal.total(shoppingTotal_totalResponse); + } +} + +function shoppingTotal_totalResponse(total, exception) { + if (exception) { + alert(exception.message); + return; + } + document.getElementById('total').innerHTML = total; +} + +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 = '<?xml version="1.0" encoding="UTF-8"?>\n' + + '<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml">' + + '<item>' + + '<name>' + catalogItems[i].name + '</name>' + + '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' + + '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' + + '<price>' + catalogItems[i].price + '</price>' + + '</item>' + + '</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 = ""; +} + +function init() { + try { + catalog.items(catalog_itemsResponse); + shoppingCart.get("", shoppingCart_getResponse); + } catch(e){ + alert(e); + } +} +</script> +</head> + +<body onload="init()"> +<h1>Store</h1> +<br/> +<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> diff --git a/sca-cpp/trunk/samples/store-sql/htdocs/index.html b/sca-cpp/trunk/samples/store-sql/htdocs/index.html index 83b1e16df4..4a621631bd 100644 --- a/sca-cpp/trunk/samples/store-sql/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-sql/htdocs/index.html @@ -1,159 +1,156 @@ -<!--
- * 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>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Store</title>
-
-<script type="text/javascript" src="/util.js"></script>
-<script type="text/javascript" src="/elemutil.js"></script>
-<script type="text/javascript" src="/xmlutil.js"></script>
-<script type="text/javascript" src="/atomutil.js"></script>
-<script type="text/javascript" src="/component.js"></script>
-
-<script type="text/javascript">
-var store = sca.component("Store");
-var catalog = sca.defun(sca.reference(store, "catalog"), "items");
-var shoppingCart = sca.reference(store, "shoppingCart");
-var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total");
-
-var catalogItems;
-
-function catalog_itemsResponse(items, exception) {
- if (exception){
- alert(exception.message);
- return;
- }
- var catalog = "";
- for (var i=0; i<items.length; i++) {
- var item = items[i].name + ' - ' + items[i].price;
- catalog += '<input name="items" type="checkbox" value="' +
- item + '">' + item + ' <br>';
- }
- document.getElementById('catalog').innerHTML=catalog;
- catalogItems = items;
-
-}
-
-function shoppingCart_getResponse(doc) {
- if (doc != null) {
- var feed = parseXML([doc]);
- var entries = feed.getElementsByTagName("entry");
- var list = "";
- for (var i=0; i<entries.length; i++) {
- var content = entries[i].getElementsByTagName("content")[0];
- var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
- var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
- list += name + ' - ' + price + ' <br>';
- }
- document.getElementById("shoppingCart").innerHTML = list;
-
- shoppingTotal.total(shoppingTotal_totalResponse);
- }
-}
-
-function shoppingTotal_totalResponse(total, exception) {
- if (exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('total').innerHTML = total;
-}
-
-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 type="text">Item</title><content type="application/xml">' +
- '<item>' +
- '<name>' + catalogItems[i].name + '</name>' +
- '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' +
- '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' +
- '<price>' + catalogItems[i].price + '</price>' +
- '</item>' +
- '</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 = "";
-}
-
-function init() {
- try {
- catalog.items(catalog_itemsResponse);
- shoppingCart.get("", shoppingCart_getResponse);
- } catch(e){
- alert(e);
- }
-}
-</script>
-</head>
-
-<body onload="init()">
-<h1>Store</h1>
-<br/>
-<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>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Store</title> + +<script type="text/javascript" src="/all.js"></script> + +<script type="text/javascript"> +var store = sca.component("Store"); +var catalog = sca.defun(sca.reference(store, "catalog"), "items"); +var shoppingCart = sca.reference(store, "shoppingCart"); +var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total"); + +var catalogItems; + +function catalog_itemsResponse(items, exception) { + if (exception){ + alert(exception.message); + return; + } + var catalog = ""; + for (var i=0; i<items.length; i++) { + var item = items[i].name + ' - ' + items[i].price; + catalog += '<input name="items" type="checkbox" value="' + + item + '">' + item + ' <br>'; + } + document.getElementById('catalog').innerHTML=catalog; + catalogItems = items; + +} + +function shoppingCart_getResponse(doc) { + if (doc != null) { + var feed = parseXML([doc]); + var entries = feed.getElementsByTagName("entry"); + var list = ""; + for (var i=0; i<entries.length; i++) { + var content = entries[i].getElementsByTagName("content")[0]; + var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; + var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; + list += name + ' - ' + price + ' <br>'; + } + document.getElementById("shoppingCart").innerHTML = list; + + shoppingTotal.total(shoppingTotal_totalResponse); + } +} + +function shoppingTotal_totalResponse(total, exception) { + if (exception) { + alert(exception.message); + return; + } + document.getElementById('total').innerHTML = total; +} + +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 = '<?xml version="1.0" encoding="UTF-8"?>\n' + + '<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml">' + + '<item>' + + '<name>' + catalogItems[i].name + '</name>' + + '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' + + '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' + + '<price>' + catalogItems[i].price + '</price>' + + '</item>' + + '</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 = ""; +} + +function init() { + try { + catalog.items(catalog_itemsResponse); + shoppingCart.get("", shoppingCart_getResponse); + } catch(e){ + alert(e); + } +} +</script> +</head> + +<body onload="init()"> +<h1>Store</h1> +<br/> +<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> diff --git a/sca-cpp/trunk/samples/store-vhost/domains/jane/htdocs/index.html b/sca-cpp/trunk/samples/store-vhost/domains/jane/htdocs/index.html index 09e2c4ab83..43f624a8c3 100644 --- a/sca-cpp/trunk/samples/store-vhost/domains/jane/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-vhost/domains/jane/htdocs/index.html @@ -1,159 +1,156 @@ -<!--
- * 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>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Jane's Store</title>
-
-<script type="text/javascript" src="/util.js"></script>
-<script type="text/javascript" src="/elemutil.js"></script>
-<script type="text/javascript" src="/xmlutil.js"></script>
-<script type="text/javascript" src="/atomutil.js"></script>
-<script type="text/javascript" src="/component.js"></script>
-
-<script type="text/javascript">
-var store = sca.component("Store");
-var catalog = sca.defun(sca.reference(store, "catalog"), "items");
-var shoppingCart = sca.reference(store, "shoppingCart");
-var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total");
-
-var catalogItems;
-
-function catalog_itemsResponse(items, exception) {
- if (exception){
- alert(exception.message);
- return;
- }
- var catalog = "";
- for (var i=0; i<items.length; i++) {
- var item = items[i].name + ' - ' + items[i].price;
- catalog += '<input name="items" type="checkbox" value="' +
- item + '">' + item + ' <br>';
- }
- document.getElementById('catalog').innerHTML=catalog;
- catalogItems = items;
-
-}
-
-function shoppingCart_getResponse(doc) {
- if (doc != null) {
- var feed = parseXML([doc]);
- var entries = feed.getElementsByTagName("entry");
- var list = "";
- for (var i=0; i<entries.length; i++) {
- var content = entries[i].getElementsByTagName("content")[0];
- var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
- var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
- list += name + ' - ' + price + ' <br>';
- }
- document.getElementById("shoppingCart").innerHTML = list;
-
- shoppingTotal.total(shoppingTotal_totalResponse);
- }
-}
-
-function shoppingTotal_totalResponse(total, exception) {
- if (exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('total').innerHTML = total;
-}
-
-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 type="text">Item</title><content type="application/xml">' +
- '<item>' +
- '<name>' + catalogItems[i].name + '</name>' +
- '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' +
- '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' +
- '<price>' + catalogItems[i].price + '</price>' +
- '</item>' +
- '</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 = "";
-}
-
-function init() {
- try {
- catalog.items(catalog_itemsResponse);
- shoppingCart.get("", shoppingCart_getResponse);
- } catch(e){
- alert(e);
- }
-}
-</script>
-</head>
-
-<body onload="init()">
-<h1>Jane's Store</h1>
-<br/>
-<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>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Jane's Store</title> + +<script type="text/javascript" src="/all.js"></script> + +<script type="text/javascript"> +var store = sca.component("Store"); +var catalog = sca.defun(sca.reference(store, "catalog"), "items"); +var shoppingCart = sca.reference(store, "shoppingCart"); +var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total"); + +var catalogItems; + +function catalog_itemsResponse(items, exception) { + if (exception){ + alert(exception.message); + return; + } + var catalog = ""; + for (var i=0; i<items.length; i++) { + var item = items[i].name + ' - ' + items[i].price; + catalog += '<input name="items" type="checkbox" value="' + + item + '">' + item + ' <br>'; + } + document.getElementById('catalog').innerHTML=catalog; + catalogItems = items; + +} + +function shoppingCart_getResponse(doc) { + if (doc != null) { + var feed = parseXML([doc]); + var entries = feed.getElementsByTagName("entry"); + var list = ""; + for (var i=0; i<entries.length; i++) { + var content = entries[i].getElementsByTagName("content")[0]; + var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; + var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; + list += name + ' - ' + price + ' <br>'; + } + document.getElementById("shoppingCart").innerHTML = list; + + shoppingTotal.total(shoppingTotal_totalResponse); + } +} + +function shoppingTotal_totalResponse(total, exception) { + if (exception) { + alert(exception.message); + return; + } + document.getElementById('total').innerHTML = total; +} + +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 = '<?xml version="1.0" encoding="UTF-8"?>\n' + + '<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml">' + + '<item>' + + '<name>' + catalogItems[i].name + '</name>' + + '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' + + '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' + + '<price>' + catalogItems[i].price + '</price>' + + '</item>' + + '</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 = ""; +} + +function init() { + try { + catalog.items(catalog_itemsResponse); + shoppingCart.get("", shoppingCart_getResponse); + } catch(e){ + alert(e); + } +} +</script> +</head> + +<body onload="init()"> +<h1>Jane's Store</h1> +<br/> +<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> diff --git a/sca-cpp/trunk/samples/store-vhost/domains/joe/htdocs/index.html b/sca-cpp/trunk/samples/store-vhost/domains/joe/htdocs/index.html index 4a25ff4afa..34c8dd3986 100644 --- a/sca-cpp/trunk/samples/store-vhost/domains/joe/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-vhost/domains/joe/htdocs/index.html @@ -1,159 +1,156 @@ -<!--
- * 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>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Joe's Store</title>
-
-<script type="text/javascript" src="/util.js"></script>
-<script type="text/javascript" src="/elemutil.js"></script>
-<script type="text/javascript" src="/xmlutil.js"></script>
-<script type="text/javascript" src="/atomutil.js"></script>
-<script type="text/javascript" src="/component.js"></script>
-
-<script type="text/javascript">
-var store = sca.component("Store");
-var catalog = sca.defun(sca.reference(store, "catalog"), "items");
-var shoppingCart = sca.reference(store, "shoppingCart");
-var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total");
-
-var catalogItems;
-
-function catalog_itemsResponse(items, exception) {
- if (exception){
- alert(exception.message);
- return;
- }
- var catalog = "";
- for (var i=0; i<items.length; i++) {
- var item = items[i].name + ' - ' + items[i].price;
- catalog += '<input name="items" type="checkbox" value="' +
- item + '">' + item + ' <br>';
- }
- document.getElementById('catalog').innerHTML=catalog;
- catalogItems = items;
-
-}
-
-function shoppingCart_getResponse(doc) {
- if (doc != null) {
- var feed = parseXML([doc]);
- var entries = feed.getElementsByTagName("entry");
- var list = "";
- for (var i=0; i<entries.length; i++) {
- var content = entries[i].getElementsByTagName("content")[0];
- var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
- var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
- list += name + ' - ' + price + ' <br>';
- }
- document.getElementById("shoppingCart").innerHTML = list;
-
- shoppingTotal.total(shoppingTotal_totalResponse);
- }
-}
-
-function shoppingTotal_totalResponse(total, exception) {
- if (exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('total').innerHTML = total;
-}
-
-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 type="text">Item</title><content type="application/xml">' +
- '<item>' +
- '<name>' + catalogItems[i].name + '</name>' +
- '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' +
- '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' +
- '<price>' + catalogItems[i].price + '</price>' +
- '</item>' +
- '</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 = "";
-}
-
-function init() {
- try {
- catalog.items(catalog_itemsResponse);
- shoppingCart.get("", shoppingCart_getResponse);
- } catch(e){
- alert(e);
- }
-}
-</script>
-</head>
-
-<body onload="init()">
-<h1>Joe's Store</h1>
-<br/>
-<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>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Joe's Store</title> + +<script type="text/javascript" src="/all.js"></script> + +<script type="text/javascript"> +var store = sca.component("Store"); +var catalog = sca.defun(sca.reference(store, "catalog"), "items"); +var shoppingCart = sca.reference(store, "shoppingCart"); +var shoppingTotal = sca.defun(sca.reference(store, "shoppingTotal"), "total"); + +var catalogItems; + +function catalog_itemsResponse(items, exception) { + if (exception){ + alert(exception.message); + return; + } + var catalog = ""; + for (var i=0; i<items.length; i++) { + var item = items[i].name + ' - ' + items[i].price; + catalog += '<input name="items" type="checkbox" value="' + + item + '">' + item + ' <br>'; + } + document.getElementById('catalog').innerHTML=catalog; + catalogItems = items; + +} + +function shoppingCart_getResponse(doc) { + if (doc != null) { + var feed = parseXML([doc]); + var entries = feed.getElementsByTagName("entry"); + var list = ""; + for (var i=0; i<entries.length; i++) { + var content = entries[i].getElementsByTagName("content")[0]; + var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; + var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; + list += name + ' - ' + price + ' <br>'; + } + document.getElementById("shoppingCart").innerHTML = list; + + shoppingTotal.total(shoppingTotal_totalResponse); + } +} + +function shoppingTotal_totalResponse(total, exception) { + if (exception) { + alert(exception.message); + return; + } + document.getElementById('total').innerHTML = total; +} + +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 = '<?xml version="1.0" encoding="UTF-8"?>\n' + + '<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml">' + + '<item>' + + '<name>' + catalogItems[i].name + '</name>' + + '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' + + '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' + + '<price>' + catalogItems[i].price + '</price>' + + '</item>' + + '</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 = ""; +} + +function init() { + try { + catalog.items(catalog_itemsResponse); + shoppingCart.get("", shoppingCart_getResponse); + } catch(e){ + alert(e); + } +} +</script> +</head> + +<body onload="init()"> +<h1>Joe's Store</h1> +<br/> +<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> diff --git a/sca-cpp/trunk/samples/store-vhost/htdocs/index.html b/sca-cpp/trunk/samples/store-vhost/htdocs/index.html index 72a797e1d9..a24ecd4379 100644 --- a/sca-cpp/trunk/samples/store-vhost/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-vhost/htdocs/index.html @@ -1,39 +1,39 @@ -<!--
- * 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>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
-<link rel="stylesheet" type="text/css" href="/ui.css"/>
-<title>Store</title>
-</head>
-
-<body>
-<h1>Store</h1>
-<br/>
-<p>For this sample to work, add the sample domain to your /etc/hosts as follows:<br/>
-127.0.0.1 example.com jane.example.com joe.example.com</p>
-
-<p/>
-<p>Jane's store at <a href="http://jane.example.com:8090/">jane.example.com</a>
-<br/>Joe's store at <a href="http://joe.example.com:8090/">joe.example.com</a></p>
-
-</body>
-</html>
+<!-- + * 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> +<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> +<meta name="apple-mobile-web-app-capable" content="yes"/> +<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> +<link rel="stylesheet" type="text/css" href="/ui.css"/> +<title>Store</title> +</head> + +<body> +<h1>Store</h1> +<br/> +<p>For this sample to work, add the sample domain to your /etc/hosts as follows:<br/> +127.0.0.1 example.com jane.example.com joe.example.com</p> + +<p/> +<p>Jane's store at <a href="http://jane.example.com:8090/">jane.example.com</a> +<br/>Joe's store at <a href="http://joe.example.com:8090/">joe.example.com</a></p> + +</body> +</html> |