summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/samples/store-vhost/htdocs/index.html
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sca-cpp/trunk/samples/store-vhost/htdocs/index.html137
1 files changed, 7 insertions, 130 deletions
diff --git a/sca-cpp/trunk/samples/store-vhost/htdocs/index.html b/sca-cpp/trunk/samples/store-vhost/htdocs/index.html
index c27e54f753..e0239392ff 100644
--- a/sca-cpp/trunk/samples/store-vhost/htdocs/index.html
+++ b/sca-cpp/trunk/samples/store-vhost/htdocs/index.html
@@ -19,139 +19,16 @@
<html>
<head>
<title>Store</title>
-
-<script type="text/javascript" src="/js/tuscany-ref.js"></script>
-
-<script type="text/javascript">
-var component = new tuscany.sca.Component("Store");
-
-//@Reference
-var catalog = new tuscany.sca.Reference("catalog");
-
-//@Reference
-var shoppingCart = new tuscany.sca.Reference("shoppingCart");
-
-//@Reference
-var shoppingTotal = new tuscany.sca.Reference("shoppingTotal");
-
-var catalogItems;
-
-function catalog_getcatalogResponse(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(feed) {
- if (feed != null) {
- 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.apply("gettotal", shoppingTotal_gettotalResponse);
- }
-}
-
-function shoppingTotal_gettotalResponse(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>' +
- '<javaClass>' + catalogItems[i].javaClass + '</javaClass>' +
- '<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.apply("getcatalog", catalog_getcatalogResponse);
- shoppingCart.get("", shoppingCart_getResponse);
- } catch(e){
- alert(e);
- }
-}
-</script>
-
</head>
-<body onload="init()">
+<body>
<h1>Store</h1>
-<div id="store">
-<h2>Catalog</h2>
-<form name="catalogForm">
-<div id="catalog" ></div>
-<br>
-<input type="button" onClick="addToCart()" value="Add to Cart">
-</form>
-<br>
-
-<h2>Your Shopping Cart</h2>
-<form name="shoppingCartForm">
-<div id="shoppingCart"></div>
-<br>
-<div id="total"></div>
-<br>
-<input type="button" onClick="checkoutCart()" value="Checkout">
-<input type="button" onClick="deleteCart()" value="Empty">
-<a href="shoppingCart/">(feed)</a>
-</form>
-</div>
+<p>For this sample to work, add the sample domain to your /etc/hosts as follows:<br/>
+127.0.0.1 sca-store.com jane.sca-store.com joe.sca-store.com</p>
+
+<p/>
+<p>Jane's store at <a href="http://jane.sca-store.com:8090/">jane.sca-store.com</a>
+<br/>Joe's store at <a href="http://joe.sca-store.com:8090/">joe.sca-store.com</a></p>
</body>
</html>