diff options
Diffstat (limited to 'sca-cpp/trunk/samples')
12 files changed, 85 insertions, 151 deletions
diff --git a/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/index.html b/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/index.html index 376b15f6c1..c1c38c9d6e 100644 --- a/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/index.html +++ b/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/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);
diff --git a/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/index.html b/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/index.html index e3675dc2d3..cce2939f1a 100644 --- a/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/index.html +++ b/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/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);
diff --git a/sca-cpp/trunk/samples/store-cpp/htdocs/index.html b/sca-cpp/trunk/samples/store-cpp/htdocs/index.html index 7de17d92e3..27007eb09d 100644 --- a/sca-cpp/trunk/samples/store-cpp/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-cpp/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);
diff --git a/sca-cpp/trunk/samples/store-gae/htdocs/index.html b/sca-cpp/trunk/samples/store-gae/htdocs/index.html index 8907cc6b49..3823f58f14 100644 --- a/sca-cpp/trunk/samples/store-gae/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-gae/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 = defun(reference(store, "shoppingCart"), "email", "host");
+var shoppingTotal = defun(reference(store, "shoppingTotal"), "total");
var catalogItems;
@@ -51,7 +45,7 @@ function catalog_itemsResponse(items, exception) { catalogItems = items;
}
-function shoppingCart_gethostResponse(host, exception) {
+function shoppingCart_hostResponse(host, exception) {
if (exception) {
alert(exception.message);
return;
@@ -59,7 +53,7 @@ function shoppingCart_gethostResponse(host, exception) { document.getElementById('host').innerHTML = host;
}
-function shoppingCart_getemailResponse(email, exception) {
+function shoppingCart_emailResponse(email, exception) {
if (exception) {
alert(exception.message);
return;
@@ -79,7 +73,7 @@ function shoppingCart_getResponse(feed) { }
document.getElementById("shoppingCart").innerHTML = list;
- shoppingTotal.apply("total", shoppingTotal_totalResponse);
+ shoppingTotal.total(shoppingTotal_totalResponse);
}
}
@@ -136,9 +130,9 @@ function deleteCart() { function init() {
try {
- catalog.apply("items", catalog_itemsResponse);
- shoppingCart.apply("getemail", shoppingCart_getemailResponse);
- shoppingCart.apply("gethost", shoppingCart_gethostResponse);
+ catalog.items(catalog_itemsResponse);
+ shoppingCart.email(shoppingCart_emailResponse);
+ shoppingCart.host(shoppingCart_hostResponse);
shoppingCart.get("", shoppingCart_getResponse);
} catch(e){
alert(e);
diff --git a/sca-cpp/trunk/samples/store-gae/shopping-cart.py b/sca-cpp/trunk/samples/store-gae/shopping-cart.py index 6501f3db8d..3c3168d77b 100644 --- a/sca-cpp/trunk/samples/store-gae/shopping-cart.py +++ b/sca-cpp/trunk/samples/store-gae/shopping-cart.py @@ -73,10 +73,10 @@ def total(cache, host, email): return sum(cart) # Return the email of the cart owner -def getemail(cache, host, email): - return email.eval() +def email(cache, host, email_): + return email_.eval() # Return the host that the app is running on -def gethost(cache, host, email): - return host.eval() +def host(cache, host_, email): + return host_.eval() diff --git a/sca-cpp/trunk/samples/store-java/htdocs/index.html b/sca-cpp/trunk/samples/store-java/htdocs/index.html index 7de17d92e3..27007eb09d 100644 --- a/sca-cpp/trunk/samples/store-java/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-java/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);
diff --git a/sca-cpp/trunk/samples/store-nosql/htdocs/index.html b/sca-cpp/trunk/samples/store-nosql/htdocs/index.html index 7de17d92e3..27007eb09d 100644 --- a/sca-cpp/trunk/samples/store-nosql/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-nosql/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);
diff --git a/sca-cpp/trunk/samples/store-python/htdocs/index.html b/sca-cpp/trunk/samples/store-python/htdocs/index.html index 7de17d92e3..27007eb09d 100644 --- a/sca-cpp/trunk/samples/store-python/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-python/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);
diff --git a/sca-cpp/trunk/samples/store-scheme/htdocs/index.html b/sca-cpp/trunk/samples/store-scheme/htdocs/index.html index 7de17d92e3..27007eb09d 100644 --- a/sca-cpp/trunk/samples/store-scheme/htdocs/index.html +++ b/sca-cpp/trunk/samples/store-scheme/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);
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);
diff --git a/sca-cpp/trunk/samples/store-vhost/htdocs/domains/jane/index.html b/sca-cpp/trunk/samples/store-vhost/htdocs/domains/jane/index.html index 376b15f6c1..c1c38c9d6e 100644 --- a/sca-cpp/trunk/samples/store-vhost/htdocs/domains/jane/index.html +++ b/sca-cpp/trunk/samples/store-vhost/htdocs/domains/jane/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);
diff --git a/sca-cpp/trunk/samples/store-vhost/htdocs/domains/joe/index.html b/sca-cpp/trunk/samples/store-vhost/htdocs/domains/joe/index.html index e3675dc2d3..cce2939f1a 100644 --- a/sca-cpp/trunk/samples/store-vhost/htdocs/domains/joe/index.html +++ b/sca-cpp/trunk/samples/store-vhost/htdocs/domains/joe/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);
|