Support python method invocation style on references, ref.func(...) in addition to ref('func', ...). Minor cleanup of the various samples, renamed gettotal to total and getcatalog to items, for consistency with the python sample.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1026939 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0dd33c3859
commit
a2a2cb76e9
62 changed files with 307 additions and 218 deletions
|
|
@ -36,7 +36,7 @@ var shoppingTotal = new tuscany.sca.Reference("shoppingTotal");
|
|||
|
||||
var catalogItems;
|
||||
|
||||
function catalog_getcatalogResponse(items, exception) {
|
||||
function catalog_itemsResponse(items, exception) {
|
||||
if (exception){
|
||||
alert(exception.message);
|
||||
return;
|
||||
|
|
@ -64,11 +64,11 @@ function shoppingCart_getResponse(feed) {
|
|||
}
|
||||
document.getElementById("shoppingCart").innerHTML = list;
|
||||
|
||||
shoppingTotal.apply("gettotal", shoppingTotal_gettotalResponse);
|
||||
shoppingTotal.apply("total", shoppingTotal_totalResponse);
|
||||
}
|
||||
}
|
||||
|
||||
function shoppingTotal_gettotalResponse(total, exception) {
|
||||
function shoppingTotal_totalResponse(total, exception) {
|
||||
if (exception) {
|
||||
alert(exception.message);
|
||||
return;
|
||||
|
|
@ -119,7 +119,7 @@ function deleteCart() {
|
|||
|
||||
function init() {
|
||||
try {
|
||||
catalog.apply("getcatalog", catalog_getcatalogResponse);
|
||||
catalog.apply("items", catalog_itemsResponse);
|
||||
shoppingCart.get("", shoppingCart_getResponse);
|
||||
} catch(e){
|
||||
alert(e);
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
{"id": 1, "method": "getcatalog", "params": []}
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"id":1,"result":[{"name":"Apple","currencyCode":"USD","currencySymbol":"$","price":2.99},{"name":"Orange","currencyCode":"USD","currencySymbol":"$","price":3.55},{"name":"Pear","currencyCode":"USD","currencySymbol":"$","price":1.55}]}
|
||||
|
|
@ -1 +1 @@
|
|||
{"id":1,"result":[{"name":"Mango","currencyCode":"USD","currencySymbol":"$","price":2.99},{"name":"Passion","currencyCode":"USD","currencySymbol":"$","price":3.55},{"name":"Kiwi","currencyCode":"USD","currencySymbol":"$","price":1.55}]}
|
||||
{"id":1,"result":[{"name":"Apple","currencyCode":"USD","currencySymbol":"$","price":2.99},{"name":"Orange","currencyCode":"USD","currencySymbol":"$","price":3.55},{"name":"Pear","currencyCode":"USD","currencySymbol":"$","price":1.55}]}
|
||||
Loading…
Add table
Add a link
Reference in a new issue