summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/samples/store-sql/htdocs/index.html
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-10-27 06:57:31 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-10-27 06:57:31 +0000
commit0fa885699a8225377dbdcbcf0fc5be9625a81ede (patch)
tree0502084ee2577cc2b6fc3831a048bb74a4449b3f /sca-cpp/trunk/samples/store-sql/htdocs/index.html
parent0f106d216277e82a83514e689d404a283be06d9b (diff)
Simplify Javascript component reference API a bit. Rename tuscany-ref.js to ref.js. Add a function to declare reference proxy methods.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1027835 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/samples/store-sql/htdocs/index.html')
-rw-r--r--sca-cpp/trunk/samples/store-sql/htdocs/index.html20
1 files changed, 7 insertions, 13 deletions
diff --git a/sca-cpp/trunk/samples/store-sql/htdocs/index.html b/sca-cpp/trunk/samples/store-sql/htdocs/index.html
index 7de17d92e3..27007eb09d 100644
--- a/sca-cpp/trunk/samples/store-sql/htdocs/index.html
+++ b/sca-cpp/trunk/samples/store-sql/htdocs/index.html
@@ -20,19 +20,13 @@
<head>
<title>Store</title>
-<script type="text/javascript" src="/js/tuscany-ref.js"></script>
+<script type="text/javascript" src="/js/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 store = component("Store");
+var catalog = defun(reference(store, "catalog"), "items");
+var shoppingCart = reference(store, "shoppingCart");
+var shoppingTotal = defun(reference(store, "shoppingTotal"), "total");
var catalogItems;
@@ -64,7 +58,7 @@ function shoppingCart_getResponse(feed) {
}
document.getElementById("shoppingCart").innerHTML = list;
- shoppingTotal.apply("total", shoppingTotal_totalResponse);
+ shoppingTotal.total(shoppingTotal_totalResponse);
}
}
@@ -119,7 +113,7 @@ function deleteCart() {
function init() {
try {
- catalog.apply("items", catalog_itemsResponse);
+ catalog.items(catalog_itemsResponse);
shoppingCart.get("", shoppingCart_getResponse);
} catch(e){
alert(e);