You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2010/10/25 05:18:18 UTC

svn commit: r1026939 - in /tuscany/sca-cpp/trunk: modules/python/ modules/wsgi/ samples/store-cluster/ samples/store-cluster/domains/jane/ samples/store-cluster/domains/joe/ samples/store-cluster/htdocs/domains/jane/ samples/store-cluster/htdocs/domain...

Author: jsdelfino
Date: Mon Oct 25 03:18:16 2010
New Revision: 1026939

URL: http://svn.apache.org/viewvc?rev=1026939&view=rev
Log:
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.

Added:
    tuscany/sca-cpp/trunk/samples/store-python/htdocs/test/
    tuscany/sca-cpp/trunk/samples/store-python/htdocs/test/items-result.txt
      - copied, changed from r1026938, tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/test/items-result.txt
Removed:
    tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/test/getcatalog-request.txt
    tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/test/getcatalog-result.txt
Modified:
    tuscany/sca-cpp/trunk/modules/python/client-test.py
    tuscany/sca-cpp/trunk/modules/python/eval.hpp
    tuscany/sca-cpp/trunk/modules/wsgi/client-test.py
    tuscany/sca-cpp/trunk/modules/wsgi/http-test.py
    tuscany/sca-cpp/trunk/modules/wsgi/httputil.py
    tuscany/sca-cpp/trunk/modules/wsgi/scdl.py
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/fruits-catalog.py
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/shopping-cart.py
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.py
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/fruits-catalog.py
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/shopping-cart.py
    tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.py
    tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/index.html
    tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/index.html
    tuscany/sca-cpp/trunk/samples/store-cluster/server-test
    tuscany/sca-cpp/trunk/samples/store-cpp/fruits-catalog.cpp
    tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/index.html
    tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/test/items-result.txt
    tuscany/sca-cpp/trunk/samples/store-cpp/server-test
    tuscany/sca-cpp/trunk/samples/store-cpp/shopping-cart.cpp
    tuscany/sca-cpp/trunk/samples/store-gae/fruits-catalog.py
    tuscany/sca-cpp/trunk/samples/store-gae/htdocs/index.html
    tuscany/sca-cpp/trunk/samples/store-gae/shopping-cart.py
    tuscany/sca-cpp/trunk/samples/store-gae/store.py
    tuscany/sca-cpp/trunk/samples/store-java/htdocs/index.html
    tuscany/sca-cpp/trunk/samples/store-java/server-test
    tuscany/sca-cpp/trunk/samples/store-java/store/FruitsCatalogImpl.java
    tuscany/sca-cpp/trunk/samples/store-java/store/ShoppingCartImpl.java
    tuscany/sca-cpp/trunk/samples/store-nosql/fruits-catalog.scm
    tuscany/sca-cpp/trunk/samples/store-nosql/htdocs/index.html
    tuscany/sca-cpp/trunk/samples/store-nosql/server-test
    tuscany/sca-cpp/trunk/samples/store-nosql/shopping-cart.scm
    tuscany/sca-cpp/trunk/samples/store-nosql/store.scm
    tuscany/sca-cpp/trunk/samples/store-python/fruits-catalog.py
    tuscany/sca-cpp/trunk/samples/store-python/htdocs/index.html
    tuscany/sca-cpp/trunk/samples/store-python/server-test
    tuscany/sca-cpp/trunk/samples/store-python/shopping-cart.py
    tuscany/sca-cpp/trunk/samples/store-python/store.py
    tuscany/sca-cpp/trunk/samples/store-scheme/fruits-catalog.scm
    tuscany/sca-cpp/trunk/samples/store-scheme/htdocs/index.html
    tuscany/sca-cpp/trunk/samples/store-scheme/script-test.cpp
    tuscany/sca-cpp/trunk/samples/store-scheme/script-test.scm
    tuscany/sca-cpp/trunk/samples/store-scheme/server-test
    tuscany/sca-cpp/trunk/samples/store-scheme/shopping-cart.scm
    tuscany/sca-cpp/trunk/samples/store-scheme/store.scm
    tuscany/sca-cpp/trunk/samples/store-sql/fruits-catalog.scm
    tuscany/sca-cpp/trunk/samples/store-sql/htdocs/index.html
    tuscany/sca-cpp/trunk/samples/store-sql/server-test
    tuscany/sca-cpp/trunk/samples/store-sql/shopping-cart.scm
    tuscany/sca-cpp/trunk/samples/store-sql/store.scm
    tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/fruits-catalog.py
    tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/shopping-cart.py
    tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/store.py
    tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/fruits-catalog.py
    tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/shopping-cart.py
    tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/store.py
    tuscany/sca-cpp/trunk/samples/store-vhost/htdocs/domains/jane/index.html
    tuscany/sca-cpp/trunk/samples/store-vhost/htdocs/domains/joe/index.html
    tuscany/sca-cpp/trunk/samples/store-vhost/server-test

Modified: tuscany/sca-cpp/trunk/modules/python/client-test.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/client-test.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/client-test.py (original)
+++ tuscany/sca-cpp/trunk/modules/python/client-test.py Mon Oct 25 03:18:16 2010
@@ -15,21 +15,26 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
+import unittest
+
 # JSON-RPC test case
 
 def echo(x, ref):
-    return ref("echo", x)
+    e1 = ref("echo", x)
+    e2 = ref.echo(x)
+    assert e1 == e2
+    return e1
 
 # ATOMPub test case
 
 def get(id, ref):
-    return ref("get", id)
+    return ref.get(id);
 
 def post(collection, item, ref):
-    return ref("post", collection, item)
+    return ref.post(collection, item)
 
 def put(id, item, ref):
-    return ref("put", id, item)
+    return ref.put(id, item)
 
 def delete(id, ref):
-    return ref("delete", id)
+    return ref.delete(id)

Modified: tuscany/sca-cpp/trunk/modules/python/eval.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/eval.hpp?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/eval.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/python/eval.hpp Mon Oct 25 03:18:16 2010
@@ -94,15 +94,54 @@ typedef struct {
   lambda<value(const list<value>&)> func;
 } pyLambda;
 
+PyObject *mkPyLambda(const lambda<value(const list<value>&)>& l);
+
 void pyLambda_dealloc(PyObject* self) {
     PyMem_DEL(self);
 }
 
+const string pyRepr(PyObject * o) {
+    return PyString_AsString(PyObject_Repr(o));
+}
+
 PyObject* pyLambda_call(PyObject* self, PyObject* args, unused PyObject* kwds) {
+    debug("python::call");
     const pyLambda* pyl = (pyLambda*)self;
     const value result = pyl->func(pyTupleToValues(args));
+    debug(result, "python::call::result");
     Py_DECREF(args);
     PyObject *pyr = valueToPyObject(result);
+    Py_INCREF(pyr);
+    return pyr;
+}
+
+struct pyProxy {
+    const value name;
+    const lambda<value(const list<value>&)> func;
+
+    pyProxy(const value& name, const lambda<value(const list<value>&)>& func) : name(name), func(func) {
+    }
+
+    const value operator()(const list<value>& args) const {
+        debug(name, "python::proxy::name");
+        const value result = func(cons<value>(name, args));
+        debug(result, "python::proxy::result");
+        return result;
+    }
+};
+
+PyObject* pyLambda_getattr(PyObject *self, PyObject *attrname) {
+    const string name = PyString_AsString(attrname);
+    if (substr(name, 0, 1) == "_")
+        return PyObject_GenericGetAttr(self, attrname);
+
+    if (name == "eval")
+        return self;
+
+    const pyLambda* pyl = (pyLambda*)self;
+    debug(name, "python::getattr::name");
+    PyObject* pyr = mkPyLambda(pyProxy(name, pyl->func));
+    Py_INCREF(pyr);
     return pyr;
 }
 
@@ -115,7 +154,9 @@ PyTypeObject pyLambda_type = {
     (destructor)pyLambda_dealloc,
     0, 0, 0, 0, 0, 0, 0, 0, 0,
     (ternaryfunc)pyLambda_call,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 
+    (binaryfunc)pyLambda_getattr,
+    0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0
@@ -179,6 +220,7 @@ const list<value> pyTupleToValuesHelper(
 }
 
 const list<value> pyTupleToValues(PyObject* o) {
+    debug(pyRepr(o), "python::pyTupleToValues");
     return pyTupleToValuesHelper(o, 0, PyTuple_Size(o));
 }
 

Modified: tuscany/sca-cpp/trunk/modules/wsgi/client-test.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/wsgi/client-test.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/wsgi/client-test.py (original)
+++ tuscany/sca-cpp/trunk/modules/wsgi/client-test.py Mon Oct 25 03:18:16 2010
@@ -15,21 +15,26 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
+import unittest
+
 # JSON-RPC test case
 
 def echo(x, ref):
-    return ref("echo", x)
+    e1 = ref("echo", x)
+    e2 = ref.echo(x)
+    assert e1 == e2
+    return e1
 
 # ATOMPub test case
 
 def get(id, ref):
-    return ref("get", id)
+    return ref.get(id)
 
 def post(collection, item, ref):
-    return ref("post", collection, item)
+    return ref.post(collection, item)
 
 def put(id, item, ref):
-    return ref("put", id, item)
+    return ref.put(id, item)
 
 def delete(id, ref):
-    return ref("delete", id)
+    return ref.delete(id)

Modified: tuscany/sca-cpp/trunk/modules/wsgi/http-test.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/wsgi/http-test.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/wsgi/http-test.py (original)
+++ tuscany/sca-cpp/trunk/modules/wsgi/http-test.py Mon Oct 25 03:18:16 2010
@@ -22,7 +22,7 @@ from httputil import *
 
 def testClient():
     c = mkclient("http://localhost:8090/wsgi")
-    assert c("echo", "Hey") == "Hey"
+    assert c.echo("Hey") == "Hey"
     return True
 
 if __name__ == "__main__":

Modified: tuscany/sca-cpp/trunk/modules/wsgi/httputil.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/wsgi/httputil.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/wsgi/httputil.py (original)
+++ tuscany/sca-cpp/trunk/modules/wsgi/httputil.py Mon Oct 25 03:18:16 2010
@@ -56,6 +56,15 @@ class client:
             return None
         return jsonResultValue((res.read(),))
 
+    def __getattr__(self, name):
+        if name[0] == '_':
+            raise AttributeError()
+        if name == "eval":
+            return self
+        l = lambda *args: self.__call__(name, *args)
+        self.__dict__[name] = l
+        return l
+
     def __repr__(self):
         return repr((self.url,))
 

Modified: tuscany/sca-cpp/trunk/modules/wsgi/scdl.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/wsgi/scdl.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/wsgi/scdl.py (original)
+++ tuscany/sca-cpp/trunk/modules/wsgi/scdl.py Mon Oct 25 03:18:16 2010
@@ -56,6 +56,15 @@ class component:
     def __call__(self, func, *args):
         return self.mod.__getattribute__(func)(*(args + self.proxies))
 
+    def __getattr__(self, name):
+        if name[0] == '_':
+            raise AttributeError()
+        if name == "eval":
+            return self
+        l = lambda *args: self.__call__(name, *args)
+        self.__dict__[name] = l
+        return l
+
     def __repr__(self):
         return repr((self.name, self.impl, self.mod, self.svcs, self.refs, self.props, self.proxies))
 
@@ -186,19 +195,39 @@ def evalReference(r, comps):
         return mkclient(t)
     return nameToComponent(t, comps)
 
+# Make a callable property
+class property:
+    def __init__(self, name, l):
+        self.name = name
+        self.l = l
+
+    def __call__(self, *args):
+        return self.l(*args)
+
+    def __getattr__(self, name):
+        if name == "eval":
+            return self
+        raise AttributeError()
+
+    def __repr__(self):
+        return repr((self.name, self.l()))
+
+def mkproperty(name, l):
+    return property(name, l)
+
 # Evaluate a property, return a lambda function returning the property
 # value. The host, user and email properties are configured with the
 # values from the HTTP request, if any
 def evalProperty(p):
     if car(p) == "host":
-        return lambda: hostProperty(cadr(p), environ)
+        return mkproperty(car(p), lambda: hostProperty(cadr(p), environ))
     if car(p) == "user":
-        return lambda: userProperty(cadr(p))
+        return mkproperty(car(p), lambda: userProperty(cadr(p)))
     if car(p) == "nickname":
-        return lambda: nicknameProperty(cadr(p))
+        return mkproperty(car(p), lambda: nicknameProperty(cadr(p)))
     if car(p) == "email":
-        return lambda: emailProperty(cadr(p))
-    return lambda: cadr(p)
+        return mkproperty(car(p), lambda: emailProperty(cadr(p)))
+    return mkproperty(car(p), lambda: cadr(p))
 
 def currentUser():
     try:

Modified: tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/fruits-catalog.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/fruits-catalog.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/fruits-catalog.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/fruits-catalog.py Mon Oct 25 03:18:16 2010
@@ -17,11 +17,11 @@
 
 # Catalog implementation
 
-def getcatalog(converter, currencyCode):
-  code = currencyCode()
+def items(converter, currencyCode):
+  code = currencyCode.eval()
   def convert(price):
-      return converter("convert", "USD", code, price)
-  symbol = converter("symbol", code)
+      return converter.convert("USD", code, price)
+  symbol = converter.symbol(code)
   return (
     (("'name", "Passion"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(2.99))),
     (("'name", "Mango"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(3.55))),

Modified: tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/shopping-cart.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/shopping-cart.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/shopping-cart.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/shopping-cart.py Mon Oct 25 03:18:16 2010
@@ -21,12 +21,12 @@ import sys
 
 # Convert a particular host and user email to a cart id
 def cartid(host, email):
-    return ("cart", host(), email())
+    return ("cart", host.eval(), email.eval())
 
 # Get the shopping cart from the cache
 # Return an empty cart if not found
 def getcart(id, cache):
-    cart = cache("get", id)
+    cart = cache.get(id)
     if cart is None:
         return ()
     return cart
@@ -35,7 +35,7 @@ def getcart(id, cache):
 def post(collection, item, cache, host, email):
     id = str(uuid.uuid1())
     cart = ((item[0], id, item[2]),) + getcart(cartid(host, email), cache)
-    cache("put", cartid(host, email), cart)
+    cache.put(cartid(host, email), cart)
     return (id,)
 
 
@@ -51,13 +51,13 @@ def find(id, cart):
 # Get items from the cart
 def get(id, cache, host, email):
     if id == ():
-        return ("Your Cart", email()) + getcart(cartid(host, email), cache)
+        return ("Your Cart", email.eval()) + getcart(cartid(host, email), cache)
     return find(id[0], getcart(cartid(host, email), cache))
 
 # Delete items from the  cart
 def delete(id, cache, host, email):
     if id == ():
-        return cache("delete", cartid(host, email))
+        return cache.delete(cartid(host, email))
     return True
 
 # Return the price of an item
@@ -71,6 +71,6 @@ def sum(items):
     return price(items[0]) + sum(items[1:])
 
 # Return the total price of the items in the cart
-def gettotal(cache, host, email):
+def total(cache, host, email):
     return sum(getcart(cartid(host, email), cache))
 

Modified: tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/jane/store.py Mon Oct 25 03:18:16 2010
@@ -18,23 +18,23 @@
 # Store implementation
 
 def post(item, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("post", item)
+    return shoppingCart.post(item)
 
 def getall(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("getall")
+    return shoppingCart.getall()
 
 def get(id, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("get", id)
+    return shoppingCart.get(id)
 
-def getcatalog(catalog, shoppingCart, shoppingTotal):
-    return catalog("getcatalog")
+def items(catalog, shoppingCart, shoppingTotal):
+    return catalog.items()
 
-def gettotal(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("gettotal")
+def total(catalog, shoppingCart, shoppingTotal):
+    return shoppingCart.total()
 
 def deleteall(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("deleteall")
+    return shoppingCart.deleteall()
 
 def delete(id, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("delete", id)
+    return shoppingCart.delete(id)
 

Modified: tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/fruits-catalog.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/fruits-catalog.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/fruits-catalog.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/fruits-catalog.py Mon Oct 25 03:18:16 2010
@@ -17,11 +17,11 @@
 
 # Catalog implementation
 
-def getcatalog(converter, currencyCode):
-  code = currencyCode()
+def items(converter, currencyCode):
+  code = currencyCode.eval()
   def convert(price):
-      return converter("convert", "USD", code, price)
-  symbol = converter("symbol", code)
+      return converter.convert("USD", code, price)
+  symbol = converter.symbol(code)
   return (
     (("'name", "Apple"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(2.99))),
     (("'name", "Orange"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(3.55))),

Modified: tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/shopping-cart.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/shopping-cart.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/shopping-cart.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/shopping-cart.py Mon Oct 25 03:18:16 2010
@@ -21,12 +21,12 @@ import sys
 
 # Convert a particular host and user email to a cart id
 def cartid(host, email):
-    return ("cart", host(), email())
+    return ("cart", host.eval(), email.eval())
 
 # Get the shopping cart from the cache
 # Return an empty cart if not found
 def getcart(id, cache):
-    cart = cache("get", id)
+    cart = cache.get(id)
     if cart is None:
         return ()
     return cart
@@ -35,7 +35,7 @@ def getcart(id, cache):
 def post(collection, item, cache, host, email):
     id = str(uuid.uuid1())
     cart = ((item[0], id, item[2]),) + getcart(cartid(host, email), cache)
-    cache("put", cartid(host, email), cart)
+    cache.put(cartid(host, email), cart)
     return (id,)
 
 
@@ -51,13 +51,13 @@ def find(id, cart):
 # Get items from the cart
 def get(id, cache, host, email):
     if id == ():
-        return ("Your Cart", email()) + getcart(cartid(host, email), cache)
+        return ("Your Cart", email.eval()) + getcart(cartid(host, email), cache)
     return find(id[0], getcart(cartid(host, email), cache))
 
 # Delete items from the  cart
 def delete(id, cache, host, email):
     if id == ():
-        return cache("delete", cartid(host, email))
+        return cache.delete(cartid(host, email))
     return True
 
 # Return the price of an item
@@ -71,6 +71,6 @@ def sum(items):
     return price(items[0]) + sum(items[1:])
 
 # Return the total price of the items in the cart
-def gettotal(cache, host, email):
+def total(cache, host, email):
     return sum(getcart(cartid(host, email), cache))
 

Modified: tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/domains/joe/store.py Mon Oct 25 03:18:16 2010
@@ -18,23 +18,23 @@
 # Store implementation
 
 def post(item, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("post", item)
+    return shoppingCart.post(item)
 
 def getall(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("getall")
+    return shoppingCart.getall()
 
 def get(id, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("get", id)
+    return shoppingCart.get(id)
 
-def getcatalog(catalog, shoppingCart, shoppingTotal):
-    return catalog("getcatalog")
+def items(catalog, shoppingCart, shoppingTotal):
+    return catalog.items()
 
-def gettotal(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("gettotal")
+def total(catalog, shoppingCart, shoppingTotal):
+    return shoppingCart.total()
 
 def deleteall(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("deleteall")
+    return shoppingCart.deletall()
 
 def delete(id, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("delete", id)
+    return shoppingCart.delete(id)
 

Modified: tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/index.html?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/index.html (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/jane/index.html Mon Oct 25 03:18:16 2010
@@ -36,7 +36,7 @@ var shoppingTotal = new tuscany.sca.Refe
 
 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);

Modified: tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/index.html?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/index.html (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/htdocs/domains/joe/index.html Mon Oct 25 03:18:16 2010
@@ -36,7 +36,7 @@ var shoppingTotal = new tuscany.sca.Refe
 
 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);

Modified: tuscany/sca-cpp/trunk/samples/store-cluster/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/server-test?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/server-test (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/server-test Mon Oct 25 03:18:16 2010
@@ -36,8 +36,8 @@ rc=$?
 
 # Test Catalog
 if [ "$rc" = "0" ]; then
-    $curl_prefix/bin/curl http://joe.sca-store.com/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/getcatalog-request.txt >tmp/getcatalog-result.txt 2>/dev/null
-    diff tmp/getcatalog-result.txt ../store-cpp/htdocs/test/getcatalog-result.txt
+    $curl_prefix/bin/curl http://joe.sca-store.com/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/items-request.txt >tmp/items-result.txt 2>/dev/null
+    diff tmp/items-result.txt ../store-cpp/htdocs/test/items-result.txt
     rc=$?
 fi
 

Modified: tuscany/sca-cpp/trunk/samples/store-cpp/fruits-catalog.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cpp/fruits-catalog.cpp?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cpp/fruits-catalog.cpp (original)
+++ tuscany/sca-cpp/trunk/samples/store-cpp/fruits-catalog.cpp Mon Oct 25 03:18:16 2010
@@ -50,7 +50,7 @@ const list<value> mkfruit(const string& 
         mklist<value>("name", name) + mklist<value>("currencyCode", code) + mklist<value>("currencySymbol", symbol) + mklist<value>("price", price);
 }
 
-const failable<value> getcatalog(const lambda<value(const list<value>&)> converter, const lambda<value(const list<value>&)> currencyCode) {
+const failable<value> items(const lambda<value(const list<value>&)> converter, const lambda<value(const list<value>&)> currencyCode) {
     const string currency(currencyCode(list<value>()));
     const string symbol(converter(mklist<value>("symbol", currency)));
     const lambda<value(const value&)> conv(convert(converter, currency));
@@ -68,8 +68,8 @@ extern "C" {
 
 const tuscany::value apply(const tuscany::list<tuscany::value>& params) {
     const tuscany::value func(car(params));
-    if (func == "getcatalog")
-        return tuscany::store::getcatalog(cadr(params), caddr(params));
+    if (func == "items")
+        return tuscany::store::items(cadr(params), caddr(params));
     return tuscany::mkfailure<tuscany::value>();
 }
 

Modified: tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/index.html?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/index.html (original)
+++ tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/index.html Mon Oct 25 03:18:16 2010
@@ -36,7 +36,7 @@ var shoppingTotal = new tuscany.sca.Refe
 
 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);

Modified: tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/test/items-result.txt
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/test/items-result.txt?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/test/items-result.txt (original)
+++ tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/test/items-result.txt Mon Oct 25 03:18:16 2010
@@ -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}]}
\ No newline at end of file
+{"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}]}
\ No newline at end of file

Modified: tuscany/sca-cpp/trunk/samples/store-cpp/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cpp/server-test?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cpp/server-test (original)
+++ tuscany/sca-cpp/trunk/samples/store-cpp/server-test Mon Oct 25 03:18:16 2010
@@ -32,8 +32,8 @@ rc=$?
 
 # Test Catalog
 if [ "$rc" = "0" ]; then
-    $curl_prefix/bin/curl http://localhost:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @htdocs/test/getcatalog-request.txt >tmp/getcatalog-result.txt 2>/dev/null
-    diff tmp/getcatalog-result.txt htdocs/test/getcatalog-result.txt
+    $curl_prefix/bin/curl http://localhost:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @htdocs/test/items-request.txt >tmp/items-result.txt 2>/dev/null
+    diff tmp/items-result.txt htdocs/test/items-result.txt
     rc=$?
 fi
 

Modified: tuscany/sca-cpp/trunk/samples/store-cpp/shopping-cart.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cpp/shopping-cart.cpp?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cpp/shopping-cart.cpp (original)
+++ tuscany/sca-cpp/trunk/samples/store-cpp/shopping-cart.cpp Mon Oct 25 03:18:16 2010
@@ -109,7 +109,7 @@ const double sum(const list<value>& item
 /**
  * Return the total price of the items in the cart.
  */
-const failable<value> gettotal(const lambda<value(const list<value>&)> cache) {
+const failable<value> total(const lambda<value(const list<value>&)> cache) {
     const list<value> cart(getcart(cartId, cache));
     return value(sum(cart));
 }
@@ -127,8 +127,8 @@ const tuscany::value apply(const tuscany
         return tuscany::store::get(cadr(params), caddr(params));
     if (func == "delete")
         return tuscany::store::del(cadr(params), caddr(params));
-    if (func == "gettotal")
-        return tuscany::store::gettotal(cadr(params));
+    if (func == "total")
+        return tuscany::store::total(cadr(params));
     return tuscany::mkfailure<tuscany::value>();
 }
 

Modified: tuscany/sca-cpp/trunk/samples/store-gae/fruits-catalog.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-gae/fruits-catalog.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-gae/fruits-catalog.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-gae/fruits-catalog.py Mon Oct 25 03:18:16 2010
@@ -18,10 +18,10 @@
 # Catalog implementation
 
 def items(converter, currencyCode):
-  code = currencyCode()
+  code = currencyCode.eval()
   def convert(price):
-      return converter("convert", "USD", code, price)
-  symbol = converter("symbol", code)
+      return converter.convert("USD", code, price)
+  symbol = converter.symbol(code)
   return (
     (("'name", "Platano"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(2.99))),
     (("'name", "Banana"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(3.55))),

Modified: tuscany/sca-cpp/trunk/samples/store-gae/htdocs/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-gae/htdocs/index.html?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-gae/htdocs/index.html (original)
+++ tuscany/sca-cpp/trunk/samples/store-gae/htdocs/index.html Mon Oct 25 03:18:16 2010
@@ -79,11 +79,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;

Modified: tuscany/sca-cpp/trunk/samples/store-gae/shopping-cart.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-gae/shopping-cart.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-gae/shopping-cart.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-gae/shopping-cart.py Mon Oct 25 03:18:16 2010
@@ -24,7 +24,7 @@ cartId = "1234"
 # Get the shopping cart from the cache
 # Return an empty cart if not found
 def getcart(id, cache):
-    cart = cache("get", (id,))
+    cart = cache.get((id,))
     if cart is None:
         return ()
     return cart
@@ -33,7 +33,7 @@ def getcart(id, cache):
 def post(collection, item, cache, host, email):
     id = str(uuid.uuid1())
     cart = ((item[0], id, item[2]),) + getcart(cartId, cache)
-    cache("put", (cartId,), cart)
+    cache.put((cartId,), cart)
     return (id,)
 
 # Find an item in the cart
@@ -54,7 +54,7 @@ def get(id, cache, host, email):
 # Delete items from the  cart
 def delete(id, cache, host, email):
     if id == ():
-        return cache("delete", (cartId,))
+        return cache.delete((cartId,))
     return True
 
 # Return the price of an item
@@ -68,15 +68,15 @@ def sum(items):
     return price(items[0]) + sum(items[1:])
 
 # Return the total price of the items in the cart
-def gettotal(cache, host, email):
+def total(cache, host, email):
     cart = getcart(cartId, cache)
     return sum(cart)
 
 # Return the email of the cart owner
 def getemail(cache, host, email):
-    return email()
+    return email.eval()
 
 # Return the host that the app is running on
 def gethost(cache, host, email):
-    return host()
+    return host.eval()
 

Modified: tuscany/sca-cpp/trunk/samples/store-gae/store.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-gae/store.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-gae/store.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-gae/store.py Mon Oct 25 03:18:16 2010
@@ -18,23 +18,23 @@
 # Store implementation
 
 def post(item, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("post", item)
+    return shoppingCart.post(item)
 
 def getall(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("getall")
+    return shoppingCart.getall()
 
 def get(id, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("get", id)
+    return shoppingCart.get(id)
 
 def items(catalog, shoppingCart, shoppingTotal):
-    return catalog("items")
+    return catalog.items()
 
-def gettotal(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("gettotal")
+def total(catalog, shoppingCart, shoppingTotal):
+    return shoppingCart.total()
 
 def deleteall(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("deleteall")
+    return shoppingCart.deleteall()
 
 def delete(id, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("delete", id)
+    return shoppingCart.delete(id)
 

Modified: tuscany/sca-cpp/trunk/samples/store-java/htdocs/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-java/htdocs/index.html?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-java/htdocs/index.html (original)
+++ tuscany/sca-cpp/trunk/samples/store-java/htdocs/index.html Mon Oct 25 03:18:16 2010
@@ -36,7 +36,7 @@ var shoppingTotal = new tuscany.sca.Refe
 
 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);

Modified: tuscany/sca-cpp/trunk/samples/store-java/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-java/server-test?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-java/server-test (original)
+++ tuscany/sca-cpp/trunk/samples/store-java/server-test Mon Oct 25 03:18:16 2010
@@ -32,8 +32,8 @@ rc=$?
 
 # Test Catalog
 if [ "$rc" = "0" ]; then
-    $curl_prefix/bin/curl http://localhost:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/getcatalog-request.txt >tmp/getcatalog-result.txt 2>/dev/null
-    diff tmp/getcatalog-result.txt ../store-cpp/htdocs/test/getcatalog-result.txt
+    $curl_prefix/bin/curl http://localhost:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/items-request.txt >tmp/items-result.txt 2>/dev/null
+    diff tmp/items-result.txt ../store-cpp/htdocs/test/items-result.txt
     rc=$?
 fi
 

Modified: tuscany/sca-cpp/trunk/samples/store-java/store/FruitsCatalogImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-java/store/FruitsCatalogImpl.java?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-java/store/FruitsCatalogImpl.java (original)
+++ tuscany/sca-cpp/trunk/samples/store-java/store/FruitsCatalogImpl.java Mon Oct 25 03:18:16 2010
@@ -31,7 +31,7 @@ public class FruitsCatalogImpl {
     /**
      * Returns the catalog.
      */
-    public Iterable<?> getcatalog(final CurrencyConverter converter, final Service currencyCode) {
+    public Iterable<?> items(final CurrencyConverter converter, final Service currencyCode) {
         final String code = currencyCode.eval();
 
         class Converter {

Modified: tuscany/sca-cpp/trunk/samples/store-java/store/ShoppingCartImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-java/store/ShoppingCartImpl.java?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-java/store/ShoppingCartImpl.java (original)
+++ tuscany/sca-cpp/trunk/samples/store-java/store/ShoppingCartImpl.java Mon Oct 25 03:18:16 2010
@@ -104,7 +104,7 @@ public class ShoppingCartImpl {
     /**
      * Return the total price of the items in the cart.
      */
-    public Double gettotal(final Service cache) {
+    public Double total(final Service cache) {
         final Iterable<?> cart = this.getcart(cartId, cache);
         return this.sum(cart);
     }

Modified: tuscany/sca-cpp/trunk/samples/store-nosql/fruits-catalog.scm
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-nosql/fruits-catalog.scm?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-nosql/fruits-catalog.scm (original)
+++ tuscany/sca-cpp/trunk/samples/store-nosql/fruits-catalog.scm Mon Oct 25 03:18:16 2010
@@ -17,7 +17,7 @@
 
 ; Catalog implementation
 
-(define (getcatalog converter currencyCode)
+(define (items converter currencyCode)
   (define code (currencyCode))
   (define (convert price) (converter "convert" "USD" code price))
   (define symbol (converter "symbol" code))

Modified: tuscany/sca-cpp/trunk/samples/store-nosql/htdocs/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-nosql/htdocs/index.html?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-nosql/htdocs/index.html (original)
+++ tuscany/sca-cpp/trunk/samples/store-nosql/htdocs/index.html Mon Oct 25 03:18:16 2010
@@ -36,7 +36,7 @@ var shoppingTotal = new tuscany.sca.Refe
 
 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);

Modified: tuscany/sca-cpp/trunk/samples/store-nosql/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-nosql/server-test?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-nosql/server-test (original)
+++ tuscany/sca-cpp/trunk/samples/store-nosql/server-test Mon Oct 25 03:18:16 2010
@@ -32,8 +32,8 @@ rc=$?
 
 # Test Catalog
 if [ "$rc" = "0" ]; then
-    $curl_prefix/bin/curl http://localhost:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/getcatalog-request.txt >tmp/getcatalog-result.txt 2>/dev/null
-    diff tmp/getcatalog-result.txt ../store-cpp/htdocs/test/getcatalog-result.txt
+    $curl_prefix/bin/curl http://localhost:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/items-request.txt >tmp/items-result.txt 2>/dev/null
+    diff tmp/items-result.txt ../store-cpp/htdocs/test/items-result.txt
     rc=$?
 fi
 

Modified: tuscany/sca-cpp/trunk/samples/store-nosql/shopping-cart.scm
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-nosql/shopping-cart.scm?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-nosql/shopping-cart.scm (original)
+++ tuscany/sca-cpp/trunk/samples/store-nosql/shopping-cart.scm Mon Oct 25 03:18:16 2010
@@ -75,7 +75,7 @@
 )
 
 ; Return the total price of the items in the cart
-(define (gettotal cache)
+(define (total cache)
   (define cart (getcart cartId cache))
   (sum cart)
 )

Modified: tuscany/sca-cpp/trunk/samples/store-nosql/store.scm
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-nosql/store.scm?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-nosql/store.scm (original)
+++ tuscany/sca-cpp/trunk/samples/store-nosql/store.scm Mon Oct 25 03:18:16 2010
@@ -29,12 +29,12 @@
   (shoppingCart "get" id)
 )
 
-(define (getcatalog catalog shoppingCart shoppingTotal)
-  (catalog "getcatalog")
+(define (items catalog shoppingCart shoppingTotal)
+  (catalog "items")
 )
 
-(define (gettotal catalog shoppingCart shoppingTotal)
-  (shoppingCart "gettotal")
+(define (total catalog shoppingCart shoppingTotal)
+  (shoppingCart "total")
 )
 
 (define (deleteall catalog shoppingCart shoppingTotal)

Modified: tuscany/sca-cpp/trunk/samples/store-python/fruits-catalog.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-python/fruits-catalog.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-python/fruits-catalog.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-python/fruits-catalog.py Mon Oct 25 03:18:16 2010
@@ -18,10 +18,10 @@
 # Catalog implementation
 
 def items(converter, currencyCode):
-  code = currencyCode()
+  code = currencyCode.eval()
   def convert(price):
-      return converter("convert", "USD", code, price)
-  symbol = converter("symbol", code)
+      return converter.convert("USD", code, price)
+  symbol = converter.symbol(code)
   return (
     (("'name", "Mango"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(2.99))),
     (("'name", "Passion"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(3.55))),

Modified: tuscany/sca-cpp/trunk/samples/store-python/htdocs/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-python/htdocs/index.html?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-python/htdocs/index.html (original)
+++ tuscany/sca-cpp/trunk/samples/store-python/htdocs/index.html Mon Oct 25 03:18:16 2010
@@ -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;

Copied: tuscany/sca-cpp/trunk/samples/store-python/htdocs/test/items-result.txt (from r1026938, tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/test/items-result.txt)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-python/htdocs/test/items-result.txt?p2=tuscany/sca-cpp/trunk/samples/store-python/htdocs/test/items-result.txt&p1=tuscany/sca-cpp/trunk/samples/store-cpp/htdocs/test/items-result.txt&r1=1026938&r2=1026939&rev=1026939&view=diff
==============================================================================
    (empty)

Modified: tuscany/sca-cpp/trunk/samples/store-python/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-python/server-test?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-python/server-test (original)
+++ tuscany/sca-cpp/trunk/samples/store-python/server-test Mon Oct 25 03:18:16 2010
@@ -33,7 +33,7 @@ rc=$?
 # Test Catalog
 if [ "$rc" = "0" ]; then
     $curl_prefix/bin/curl http://localhost:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/items-request.txt >tmp/items-result.txt 2>/dev/null
-    diff tmp/items-result.txt ../store-cpp/htdocs/test/items-result.txt
+    diff tmp/items-result.txt htdocs/test/items-result.txt
     rc=$?
 fi
 

Modified: tuscany/sca-cpp/trunk/samples/store-python/shopping-cart.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-python/shopping-cart.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-python/shopping-cart.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-python/shopping-cart.py Mon Oct 25 03:18:16 2010
@@ -24,7 +24,7 @@ cartId = "1234"
 # Get the shopping cart from the cache
 # Return an empty cart if not found
 def getcart(id, cache):
-    cart = cache("get", (id,))
+    cart = cache.get((id,))
     if cart is None:
         return ()
     return cart
@@ -33,7 +33,7 @@ def getcart(id, cache):
 def post(collection, item, cache):
     id = str(uuid.uuid1())
     cart = ((item[0], id, item[2]),) + getcart(cartId, cache)
-    cache("put", (cartId,), cart)
+    cache.put((cartId,), cart)
     return (id,)
 
 
@@ -55,7 +55,7 @@ def get(id, cache):
 # Delete items from the  cart
 def delete(id, cache):
     if id == ():
-        return cache("delete", (cartId,))
+        return cache.delete((cartId,))
     return True
 
 # Return the price of an item
@@ -69,7 +69,7 @@ def sum(items):
     return price(items[0]) + sum(items[1:])
 
 # Return the total price of the items in the cart
-def gettotal(cache):
+def total(cache):
     cart = getcart(cartId, cache)
     return sum(cart)
 

Modified: tuscany/sca-cpp/trunk/samples/store-python/store.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-python/store.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-python/store.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-python/store.py Mon Oct 25 03:18:16 2010
@@ -18,23 +18,23 @@
 # Store implementation
 
 def post(item, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("post", item)
+    return shoppingCart.post(item)
 
 def getall(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("getall")
+    return shoppingCart.getall()
 
 def get(id, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("get", id)
+    return shoppingCart.get(id)
 
 def items(catalog, shoppingCart, shoppingTotal):
-    return catalog("items")
+    return catalog.items()
 
-def gettotal(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("gettotal")
+def total(catalog, shoppingCart, shoppingTotal):
+    return shoppingCart.gettotal()
 
 def deleteall(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("deleteall")
+    return shoppingCart.deleteall()
 
 def delete(id, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("delete", id)
+    return shoppingCart.delete(id)
 

Modified: tuscany/sca-cpp/trunk/samples/store-scheme/fruits-catalog.scm
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-scheme/fruits-catalog.scm?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-scheme/fruits-catalog.scm (original)
+++ tuscany/sca-cpp/trunk/samples/store-scheme/fruits-catalog.scm Mon Oct 25 03:18:16 2010
@@ -17,7 +17,7 @@
 
 ; Catalog implementation
 
-(define (getcatalog converter currencyCode)
+(define (items converter currencyCode)
   (define code (currencyCode))
   (define (convert price) (converter "convert" "USD" code price))
   (define symbol (converter "symbol" code))

Modified: tuscany/sca-cpp/trunk/samples/store-scheme/htdocs/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-scheme/htdocs/index.html?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-scheme/htdocs/index.html (original)
+++ tuscany/sca-cpp/trunk/samples/store-scheme/htdocs/index.html Mon Oct 25 03:18:16 2010
@@ -36,7 +36,7 @@ var shoppingTotal = new tuscany.sca.Refe
 
 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);

Modified: tuscany/sca-cpp/trunk/samples/store-scheme/script-test.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-scheme/script-test.cpp?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-scheme/script-test.cpp (original)
+++ tuscany/sca-cpp/trunk/samples/store-scheme/script-test.cpp Mon Oct 25 03:18:16 2010
@@ -56,7 +56,7 @@ bool testEval() {
         ostringstream os;
         scheme::setupDisplay(os);
         scheme::Env globalEnv = scheme::setupEnvironment();
-        const value exp(mklist<value>("storeui_service", string("getcatalog")));
+        const value exp(mklist<value>("storeui_service", string("items")));
         const value val = scheme::evalScript(exp, is, globalEnv);
 
         ostringstream vs;
@@ -71,7 +71,7 @@ bool testEval() {
         scheme::setupDisplay(os);
 
         scheme::Env globalEnv = scheme::setupEnvironment();
-        const value exp(mklist<value>("storeui_service", string("gettotal")));
+        const value exp(mklist<value>("storeui_service", string("total")));
         const value res = scheme::evalScript(exp, is, globalEnv);
 
         ostringstream rs;

Modified: tuscany/sca-cpp/trunk/samples/store-scheme/script-test.scm
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-scheme/script-test.scm?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-scheme/script-test.scm (original)
+++ tuscany/sca-cpp/trunk/samples/store-scheme/script-test.scm Mon Oct 25 03:18:16 2010
@@ -53,7 +53,7 @@
 
 (define (catalog_impl converter op args)
   (cond
-    ((equal? op "getcatalog") (apply catalog_get (cons converter args)))
+    ((equal? op "items") (apply catalog_get (cons converter args)))
   )
 )
 
@@ -76,7 +76,7 @@
   (cons "Item" (list id entry))
 )
 
-(define (cart_gettotal)
+(define (cart_total)
   10.0
 )
 
@@ -85,7 +85,7 @@
     ((equal? op "post") (apply cart_post args))
     ((equal? op "getall") (apply cart_getall args))
     ((equal? op "getentry") (apply cart_getentry args))
-    ((equal? op "gettotal") (apply cart_gettotal args))
+    ((equal? op "total") (apply cart_total args))
   )
 )
 
@@ -103,12 +103,12 @@
   (cart "getentry" id)
 )
 
-(define (storeui_getcatalog catalog)
-  (catalog "getcatalog")
+(define (storeui_items catalog)
+  (catalog "items")
 )
 
-(define (storeui_gettotal cart)
-  (cart "gettotal")
+(define (storeui_total cart)
+  (cart "total")
 )
 
 (define (storeui_impl cart catalog op args)
@@ -116,8 +116,8 @@
     ((equal? op "post") (apply storeui_post (cons cart args)))
     ((equal? op "getall") (apply storeui_getcart (cons cart args)))
     ((equal? op "getentry") (apply storeui_getentry (cons cart args)))
-    ((equal? op "getcatalog") (apply storeui_getcatalog (cons catalog args)))
-    ((equal? op "gettotal") (apply storeui_gettotal (cons cart args)))
+    ((equal? op "items") (apply storeui_items (cons catalog args)))
+    ((equal? op "total") (apply storeui_total (cons cart args)))
   )
 )
 
@@ -129,12 +129,12 @@
 
 ; Store UI test case
 
-(define catalog (storeui_service "getcatalog"))
+(define catalog (storeui_service "items"))
 (define empty (list))
 (define apple (car catalog))
 (define orange (car (cdr catalog)))
 (define added1 (storeui_service "post" empty apple))
 (define added2 (storeui_service "post" added1 orange))
 (display (storeui_service "getall" added2))
-(display (storeui_service "gettotal"))
+(display (storeui_service "total"))
 

Modified: tuscany/sca-cpp/trunk/samples/store-scheme/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-scheme/server-test?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-scheme/server-test (original)
+++ tuscany/sca-cpp/trunk/samples/store-scheme/server-test Mon Oct 25 03:18:16 2010
@@ -32,8 +32,8 @@ rc=$?
 
 # Test Catalog
 if [ "$rc" = "0" ]; then
-    $curl_prefix/bin/curl http://localhost:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/getcatalog-request.txt >tmp/getcatalog-result.txt 2>/dev/null
-    diff tmp/getcatalog-result.txt ../store-cpp/htdocs/test/getcatalog-result.txt
+    $curl_prefix/bin/curl http://localhost:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/items-request.txt >tmp/items-result.txt 2>/dev/null
+    diff tmp/items-result.txt ../store-cpp/htdocs/test/items-result.txt
     rc=$?
 fi
 

Modified: tuscany/sca-cpp/trunk/samples/store-scheme/shopping-cart.scm
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-scheme/shopping-cart.scm?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-scheme/shopping-cart.scm (original)
+++ tuscany/sca-cpp/trunk/samples/store-scheme/shopping-cart.scm Mon Oct 25 03:18:16 2010
@@ -75,7 +75,7 @@
 )
 
 ; Return the total price of the items in the cart
-(define (gettotal cache)
+(define (total cache)
   (define cart (getcart cartId cache))
   (sum cart)
 )

Modified: tuscany/sca-cpp/trunk/samples/store-scheme/store.scm
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-scheme/store.scm?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-scheme/store.scm (original)
+++ tuscany/sca-cpp/trunk/samples/store-scheme/store.scm Mon Oct 25 03:18:16 2010
@@ -29,12 +29,12 @@
   (shoppingCart "get" id)
 )
 
-(define (getcatalog catalog shoppingCart shoppingTotal)
-  (catalog "getcatalog")
+(define (items catalog shoppingCart shoppingTotal)
+  (catalog "items")
 )
 
-(define (gettotal catalog shoppingCart shoppingTotal)
-  (shoppingCart "gettotal")
+(define (total catalog shoppingCart shoppingTotal)
+  (shoppingCart "total")
 )
 
 (define (deleteall catalog shoppingCart shoppingTotal)

Modified: tuscany/sca-cpp/trunk/samples/store-sql/fruits-catalog.scm
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-sql/fruits-catalog.scm?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-sql/fruits-catalog.scm (original)
+++ tuscany/sca-cpp/trunk/samples/store-sql/fruits-catalog.scm Mon Oct 25 03:18:16 2010
@@ -17,7 +17,7 @@
 
 ; Catalog implementation
 
-(define (getcatalog converter currencyCode)
+(define (items converter currencyCode)
   (define code (currencyCode))
   (define (convert price) (converter "convert" "USD" code price))
   (define symbol (converter "symbol" code))

Modified: tuscany/sca-cpp/trunk/samples/store-sql/htdocs/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-sql/htdocs/index.html?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-sql/htdocs/index.html (original)
+++ tuscany/sca-cpp/trunk/samples/store-sql/htdocs/index.html Mon Oct 25 03:18:16 2010
@@ -36,7 +36,7 @@ var shoppingTotal = new tuscany.sca.Refe
 
 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);

Modified: tuscany/sca-cpp/trunk/samples/store-sql/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-sql/server-test?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-sql/server-test (original)
+++ tuscany/sca-cpp/trunk/samples/store-sql/server-test Mon Oct 25 03:18:16 2010
@@ -32,8 +32,8 @@ rc=$?
 
 # Test Catalog
 if [ "$rc" = "0" ]; then
-    $curl_prefix/bin/curl http://localhost:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/getcatalog-request.txt >tmp/getcatalog-result.txt 2>/dev/null
-    diff tmp/getcatalog-result.txt ../store-cpp/htdocs/test/getcatalog-result.txt
+    $curl_prefix/bin/curl http://localhost:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/items-request.txt >tmp/items-result.txt 2>/dev/null
+    diff tmp/items-result.txt ../store-cpp/htdocs/test/items-result.txt
     rc=$?
 fi
 

Modified: tuscany/sca-cpp/trunk/samples/store-sql/shopping-cart.scm
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-sql/shopping-cart.scm?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-sql/shopping-cart.scm (original)
+++ tuscany/sca-cpp/trunk/samples/store-sql/shopping-cart.scm Mon Oct 25 03:18:16 2010
@@ -75,7 +75,7 @@
 )
 
 ; Return the total price of the items in the cart
-(define (gettotal cache)
+(define (total cache)
   (define cart (getcart cartId cache))
   (sum cart)
 )

Modified: tuscany/sca-cpp/trunk/samples/store-sql/store.scm
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-sql/store.scm?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-sql/store.scm (original)
+++ tuscany/sca-cpp/trunk/samples/store-sql/store.scm Mon Oct 25 03:18:16 2010
@@ -29,12 +29,12 @@
   (shoppingCart "get" id)
 )
 
-(define (getcatalog catalog shoppingCart shoppingTotal)
-  (catalog "getcatalog")
+(define (items catalog shoppingCart shoppingTotal)
+  (catalog "items")
 )
 
-(define (gettotal catalog shoppingCart shoppingTotal)
-  (shoppingCart "gettotal")
+(define (total catalog shoppingCart shoppingTotal)
+  (shoppingCart "total")
 )
 
 (define (deleteall catalog shoppingCart shoppingTotal)

Modified: tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/fruits-catalog.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/fruits-catalog.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/fruits-catalog.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/fruits-catalog.py Mon Oct 25 03:18:16 2010
@@ -17,11 +17,11 @@
 
 # Catalog implementation
 
-def getcatalog(converter, currencyCode):
-  code = currencyCode()
+def items(converter, currencyCode):
+  code = currencyCode.eval()
   def convert(price):
-      return converter("convert", "USD", code, price)
-  symbol = converter("symbol", code)
+      return converter.convert("USD", code, price)
+  symbol = converter.symbol(code)
   return (
     (("'name", "Passion"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(2.99))),
     (("'name", "Mango"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(3.55))),

Modified: tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/shopping-cart.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/shopping-cart.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/shopping-cart.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/shopping-cart.py Mon Oct 25 03:18:16 2010
@@ -24,7 +24,7 @@ cartId = "1234"
 # Get the shopping cart from the cache
 # Return an empty cart if not found
 def getcart(id, cache):
-    cart = cache("get", (id,))
+    cart = cache.get((id,))
     if cart is None:
         return ()
     return cart
@@ -33,7 +33,7 @@ def getcart(id, cache):
 def post(collection, item, cache):
     id = str(uuid.uuid1())
     cart = ((item[0], id, item[2]),) + getcart(cartId, cache)
-    cache("put", (cartId,), cart)
+    cache.put((cartId,), cart)
     return (id,)
 
 
@@ -55,7 +55,7 @@ def get(id, cache):
 # Delete items from the  cart
 def delete(id, cache):
     if id == ():
-        return cache("delete", (cartId,))
+        return cache.delete((cartId,))
     return True
 
 # Return the price of an item
@@ -69,7 +69,7 @@ def sum(items):
     return price(items[0]) + sum(items[1:])
 
 # Return the total price of the items in the cart
-def gettotal(cache):
+def total(cache):
     cart = getcart(cartId, cache)
     return sum(cart)
 

Modified: tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/store.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/store.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/store.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-vhost/domains/jane/store.py Mon Oct 25 03:18:16 2010
@@ -18,23 +18,23 @@
 # Store implementation
 
 def post(item, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("post", item)
+    return shoppingCart.post(item)
 
 def getall(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("getall")
+    return shoppingCart.getall()
 
 def get(id, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("get", id)
+    return shoppingCart.get(id)
 
-def getcatalog(catalog, shoppingCart, shoppingTotal):
-    return catalog("getcatalog")
+def items(catalog, shoppingCart, shoppingTotal):
+    return catalog.items()
 
-def gettotal(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("gettotal")
+def total(catalog, shoppingCart, shoppingTotal):
+    return shoppingCart.total()
 
 def deleteall(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("deleteall")
+    return shoppingCart.deleteall()
 
 def delete(id, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("delete", id)
+    return shoppingCart.delete(id)
 

Modified: tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/fruits-catalog.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/fruits-catalog.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/fruits-catalog.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/fruits-catalog.py Mon Oct 25 03:18:16 2010
@@ -17,11 +17,11 @@
 
 # Catalog implementation
 
-def getcatalog(converter, currencyCode):
-  code = currencyCode()
+def items(converter, currencyCode):
+  code = currencyCode.eval()
   def convert(price):
-      return converter("convert", "USD", code, price)
-  symbol = converter("symbol", code)
+      return converter.convert("USD", code, price)
+  symbol = converter.symbol(code)
   return (
     (("'name", "Apple"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(2.99))),
     (("'name", "Orange"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(3.55))),

Modified: tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/shopping-cart.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/shopping-cart.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/shopping-cart.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/shopping-cart.py Mon Oct 25 03:18:16 2010
@@ -24,7 +24,7 @@ cartId = "1234"
 # Get the shopping cart from the cache
 # Return an empty cart if not found
 def getcart(id, cache):
-    cart = cache("get", (id,))
+    cart = cache.get((id,))
     if cart is None:
         return ()
     return cart
@@ -33,7 +33,7 @@ def getcart(id, cache):
 def post(collection, item, cache):
     id = str(uuid.uuid1())
     cart = ((item[0], id, item[2]),) + getcart(cartId, cache)
-    cache("put", (cartId,), cart)
+    cache.put((cartId,), cart)
     return (id,)
 
 
@@ -55,7 +55,7 @@ def get(id, cache):
 # Delete items from the  cart
 def delete(id, cache):
     if id == ():
-        return cache("delete", (cartId,))
+        return cache.delete((cartId,))
     return True
 
 # Return the price of an item
@@ -69,7 +69,7 @@ def sum(items):
     return price(items[0]) + sum(items[1:])
 
 # Return the total price of the items in the cart
-def gettotal(cache):
+def total(cache):
     cart = getcart(cartId, cache)
     return sum(cart)
 

Modified: tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/store.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/store.py?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/store.py (original)
+++ tuscany/sca-cpp/trunk/samples/store-vhost/domains/joe/store.py Mon Oct 25 03:18:16 2010
@@ -18,23 +18,23 @@
 # Store implementation
 
 def post(item, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("post", item)
+    return shoppingCart.post(item)
 
 def getall(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("getall")
+    return shoppingCart.getall()
 
 def get(id, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("get", id)
+    return shoppingCart.get(id)
 
-def getcatalog(catalog, shoppingCart, shoppingTotal):
-    return catalog("getcatalog")
+def items(catalog, shoppingCart, shoppingTotal):
+    return catalog.items()
 
-def gettotal(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("gettotal")
+def total(catalog, shoppingCart, shoppingTotal):
+    return shoppingCart.total()
 
 def deleteall(catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("deleteall")
+    return shoppingCart.deleteall()
 
 def delete(id, catalog, shoppingCart, shoppingTotal):
-    return shoppingCart("delete", id)
+    return shoppingCart.delete(id)
 

Modified: tuscany/sca-cpp/trunk/samples/store-vhost/htdocs/domains/jane/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-vhost/htdocs/domains/jane/index.html?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-vhost/htdocs/domains/jane/index.html (original)
+++ tuscany/sca-cpp/trunk/samples/store-vhost/htdocs/domains/jane/index.html Mon Oct 25 03:18:16 2010
@@ -36,7 +36,7 @@ var shoppingTotal = new tuscany.sca.Refe
 
 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);

Modified: tuscany/sca-cpp/trunk/samples/store-vhost/htdocs/domains/joe/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-vhost/htdocs/domains/joe/index.html?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-vhost/htdocs/domains/joe/index.html (original)
+++ tuscany/sca-cpp/trunk/samples/store-vhost/htdocs/domains/joe/index.html Mon Oct 25 03:18:16 2010
@@ -36,7 +36,7 @@ var shoppingTotal = new tuscany.sca.Refe
 
 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);

Modified: tuscany/sca-cpp/trunk/samples/store-vhost/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-vhost/server-test?rev=1026939&r1=1026938&r2=1026939&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-vhost/server-test (original)
+++ tuscany/sca-cpp/trunk/samples/store-vhost/server-test Mon Oct 25 03:18:16 2010
@@ -35,8 +35,8 @@ rc=$?
 
 # Test Catalog
 if [ "$rc" = "0" ]; then
-    $curl_prefix/bin/curl http://joe.sca-store.com:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/getcatalog-request.txt >tmp/getcatalog-result.txt 2>/dev/null
-    diff tmp/getcatalog-result.txt ../store-cpp/htdocs/test/getcatalog-result.txt
+    $curl_prefix/bin/curl http://joe.sca-store.com:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/items-request.txt >tmp/items-result.txt 2>/dev/null
+    diff tmp/items-result.txt ../store-cpp/htdocs/test/items-result.txt
     rc=$?
 fi