diff options
Diffstat (limited to 'sandbox/sca-cloud-tutorial/store-appengine-webapp/war')
5 files changed, 103 insertions, 6 deletions
diff --git a/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/WEB-INF/appengine-web.xml b/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/WEB-INF/appengine-web.xml index 85626f6b1c..bfec5c4e26 100644 --- a/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/WEB-INF/appengine-web.xml +++ b/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/WEB-INF/appengine-web.xml @@ -19,7 +19,7 @@ --> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>tuscany-store</application> - <version>4</version> + <version>5</version> <!-- Configure java.util.logging --> <system-properties> diff --git a/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/WEB-INF/logging.properties b/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/WEB-INF/logging.properties index 03808336ec..bd3b8308fc 100644 --- a/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/WEB-INF/logging.properties +++ b/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/WEB-INF/logging.properties @@ -33,5 +33,5 @@ .level = WARNING #tuscany debug messages -org.apache.tuscany.level=WARNING +org.apache.tuscany.level = WARNING diff --git a/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/log4j.properties b/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/log4j.properties new file mode 100644 index 0000000000..036b48afd7 --- /dev/null +++ b/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/log4j.properties @@ -0,0 +1,28 @@ +# +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# + +# Configure the console as our one appender +log4j.appender.A1=org.apache.log4j.ConsoleAppender +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n + +#tuscany debug messages +log4j.category.org.apache.tuscany=ALL,A1 diff --git a/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/store.composite b/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/store.composite new file mode 100644 index 0000000000..8705f9a52a --- /dev/null +++ b/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/store.composite @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +--> +<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" + xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" + xmlns:s="http://store" + targetNamespace="http://store" + name="catalog"> + + <component name="CatalogAggregator"> + <implementation.java class="services.CatalogAggregatorImpl"/> + <property name="currencyCode">USD</property> + <service name="Catalog"> + <interface.java interface="services.Catalog"/> + <tuscany:binding.jsonrpc uri="/CatalogAggregator"/> + </service> + <reference name="fruitsCatalog"> + <interface.java interface="services.Catalog"/> + <tuscany:binding.jsonrpc uri="http://tuscany-store-catalog.appspot.com/Catalog"/> + </reference> + <reference name="vegetablesCatalog"> + <interface.java interface="services.Catalog"/> + <tuscany:binding.jsonrpc uri="http://tuscany.figueiredos.com/store-catalog-ibmcloud-webapp/Catalog"/> + </reference> + <reference name="currencyConverter" target="CurrencyConverter" /> + </component> + + <component name="CurrencyConverter"> + <implementation.java class="services.CurrencyConverterImpl" /> + <service name="CurrencyConverter"> + <interface.java interface="services.CurrencyConverter"/> + </service> + </component> + + <component name="ShoppingCartManager"> + <implementation.java class="services.ShoppingCartManager"/> + <service name="ShoppingCart"> + <tuscany:binding.jsonrpc uri="/ShoppingCart"/> + </service> + <reference name="userService" target="UserService"> + <binding.sca name="local"/> + </reference> + </component> + + <component name="UserService"> + <implementation.java class="org.apache.tuscany.sca.cloud.user.impl.GoogleUserService"/> + <service name="UserService"> + <binding.sca name="local"/> + <tuscany:binding.jsonrpc uri="/User"/> + </service> + </component> +</composite> diff --git a/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/store.html b/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/store.html index 050d451899..0afe661540 100644 --- a/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/store.html +++ b/sandbox/sca-cloud-tutorial/store-appengine-webapp/war/store.html @@ -63,7 +63,7 @@ var catalogCallback = function(items) { var catalog = ""; for (var i=0; i<items.length; i++) { - var item = items[i].name + ' - ' + items[i].price; + var item = items[i].name + ' - ' + items[i].currencySymbol + items[i].price; catalog += '<input name="items" type="checkbox" value="' + item + '">' + item + ' <br>'; } @@ -84,8 +84,9 @@ var item = items[i].data; // process its attributes var name = item.name; + var symbol = item.currencySymbol; var price = item.price - list += name + ' - ' + price + ' <br>'; + list += name + ' - ' + symbol + price + ' <br>'; } document.getElementById("shoppingCart").innerHTML = list; @@ -132,10 +133,10 @@ '<br>'+ '<input type="submit" value="Continue Shopping">'+ '</form>'; - shoppingCart.del(""); + shoppingCart.delete(""); } function deleteCart() { - shoppingCart.del(""); + shoppingCart.delete(""); document.getElementById('shoppingCart').innerHTML = ""; document.getElementById('total').innerHTML = ""; } |