diff options
Diffstat (limited to '')
9 files changed, 729 insertions, 0 deletions
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..4ec08403e5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ +<?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. +--> +<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0" + xmlns:s="http://store"> + <import.java package="services"/> + <import.java package="services.map"/> + <deployable composite="s:store-mashup"/> +</contribution> diff --git a/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/gadget/map-gadget.html b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/gadget/map-gadget.html new file mode 100644 index 0000000000..d76bcad91b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/gadget/map-gadget.html @@ -0,0 +1,50 @@ +<!-- + * 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. +--> +<html> +<head> +<title>Map</title> + +<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA"></script> + +<script language="JavaScript"> + + function coordsChangedCallback(eventname, publisherData, subscriberData) { + var coords = publisherData.split(','); + if (coords.length >= 2) { + subscriberData.setCenter(new GLatLng(coords[0], coords[1])); + } + } + + function init() { + if (GBrowserIsCompatible()) { + var map = new GMap2(document.getElementById("map_canvas")); + map.setCenter(new GLatLng(37.4419, -122.1419), 13); + + if (window.top.hub != null) { + window.top.hub.subscribe("geospatial.coords", coordsChangedCallback, null, map); + } + } + } +</script> +</head> + +<body onload="init()"> + <div id="map_canvas" style="width: 100%; height: 100%"></div> +</body> +</html> diff --git a/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/gadget/store-gadget.html b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/gadget/store-gadget.html new file mode 100644 index 0000000000..e25b91f46d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/gadget/store-gadget.html @@ -0,0 +1,166 @@ +<!-- + * 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. +--> +<html> +<head> +<title>Store</title> + +<script type="text/javascript" src="/gadget/store/store-gadget.js"></script> + +<script language="JavaScript"> + + //@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 catalogItems; + + function catalog_getResponse(items,exception) { + if(exception){ + alert(exception.message); + return; + } + var catalog = ""; + for (var i=0; i<items.length; i++) { + var item = items[i].name + ' - ' + items[i].price; + catalog += '<input name="items" type="checkbox" onClick="selectItem(' + i + ')" value="' + + item + '">' + item + ' <br>'; + } + document.getElementById('catalog').innerHTML=catalog; + catalogItems = items; + } + + function shoppingCart_getResponse(feed) { + if (feed != null) { + var entries = feed.getElementsByTagName("entry"); + var list = ""; + for (var i=0; i<entries.length; i++) { + var content = entries[i].getElementsByTagName("content")[0]; + var name = content.getElementsByTagName("name")[0].firstChild.nodeValue; + var price = content.getElementsByTagName("price")[0].firstChild.nodeValue; + list += name + ' - ' + price + ' <br>'; + } + document.getElementById("shoppingCart").innerHTML = list; + + if (entries.length != 0) { + try { + shoppingTotal.getTotal(shoppingTotal_getTotalResponse); + } + carch(e) { + alert(e); + } + } + } + } + + function shoppingTotal_getTotalResponse(total,exception) { + if(exception){ + alert(exception.message); + return; + } + document.getElementById('total').innerHTML = total; + } + + function shoppingCart_postResponse(entry) { + shoppingCart.get("", shoppingCart_getResponse); + } + + function addToCart() { + var items = document.catalogForm.items; + var j = 0; + for (var i=0; i<items.length; i++) + if (items[i].checked) { + var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title>item</title><content type="text/xml">' + + '<Item xmlns="http://services/">' + + '<name xmlns="">' + catalogItems[i].name + '</name>' + '<price xmlns="">' + catalogItems[i].price + '</price>' + + '</Item>' + '</content></entry>'; + shoppingCart.post(entry, shoppingCart_postResponse); + items[i].checked = false; + } + } + function checkoutCart() { + document.getElementById('store').innerHTML='<h2>' + + 'Thanks for Shopping With Us!</h2>'+ + '<h2>Your Order</h2>'+ + '<form name="orderForm" action="/gadget/store">'+ + document.getElementById('shoppingCart').innerHTML+ + '<br>'+ + document.getElementById('total').innerHTML+ + '<br>'+ + '<br>'+ + '<input type="submit" value="Continue Shopping">'+ + '</form>'; + shoppingCart.del("", null); + } + function deleteCart() { + shoppingCart.del("", null); + document.getElementById('shoppingCart').innerHTML = ""; + document.getElementById('total').innerHTML = ""; + } + + function selectItem(i) { + var item = catalogItems[i]; + if (window.top.hub != null) { + window.top.hub.publish("geospatial.coords", item.origin); + } + } + + function init() { + try { + catalog.get(catalog_getResponse); + shoppingCart.get("", shoppingCart_getResponse); + } + catch(e) { + alert(e); + } + } + +</script> + +</head> + +<body onload="init()"> +<h1>Store</h1> + <div id="store"> + <h2>Catalog</h2> + <form name="catalogForm"> + <div id="catalog" ></div> + <br> + <input type="button" onClick="addToCart()" value="Add to Cart"> + </form> + + <br> + + <h2>Your Shopping Cart</h2> + <form name="shoppingCartForm"> + <div id="shoppingCart"></div> + <br> + <div id="total"></div> + <br> + <input type="button" onClick="checkoutCart()" value="Checkout"> + <input type="button" onClick="deleteCart()" value="Empty"> + <a href="/ShoppingCart/Cart/" target="_top">(feed)</a> + </form> + </div> +</body> +</html> diff --git a/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/map-gadget.composite b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/map-gadget.composite new file mode 100644 index 0000000000..77db2edbf2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/map-gadget.composite @@ -0,0 +1,32 @@ +<?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://www.osoa.org/xmlns/sca/1.0" + xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" + targetNamespace="http://store" + name="map-gadget"> + + <component name="MapGadget"> + <t:implementation.widget location="gadget/map-gadget.html"/> + <service name="Widget"> + <t:binding.http uri="/gadget/map"/> + </service> + </component> + +</composite> diff --git a/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/mashup/store-mash.html b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/mashup/store-mash.html new file mode 100644 index 0000000000..b4708475f6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/mashup/store-mash.html @@ -0,0 +1,70 @@ +<!-- + * 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. +--> +<html>
+<head>
+<title>Store Mashup</title>
+
+<script type="text/javascript" src='/openajax/OpenAjax.js'></script> + +<script type="text/javascript" src="/mashup/store-mash.js"></script> + +<script language="JavaScript"> + + //@Reference + var storeGadget = new tuscany.sca.Reference("storeGadget"); + + //@Reference + var mapGadget = new tuscany.sca.Reference("mapGadget"); + + function storeGadget_getResponse(gadget) { + var gadget1 = document.getElementById('gadget1').contentDocument; + gadget1.open(); + gadget1.write(gadget); + gadget1.close(); + } + + function mapGadget_getResponse(gadget) { + var gadget2 = document.getElementById('gadget2').contentDocument; + gadget2.open(); + gadget2.write(gadget); + gadget2.close(); + } + + function init() { + window.top.hub = OpenAjax.hub; + + storeGadget.get('', storeGadget_getResponse); + mapGadget.get('', mapGadget_getResponse); + } + +</script> +</head> +
+<body onload="init()"> +<h1>Store Mashup</h1>
+<br>
+<table border="0" cellpadding="0" cellspacing="2">
+ <tr>
+ <td><iframe id="gadget1" style='overflow:hidden;width:400px;height:500px;border:1px solid black;'></iframe></td>
+ <td><iframe id="gadget2" style='overflow:hidden;width:400px;height:500px;border:1px solid black;'></iframe></td>
+ </tr>
+</table>
+ +</body>
+</html> diff --git a/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/openajax/OpenAjax.js b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/openajax/OpenAjax.js new file mode 100644 index 0000000000..e1a855d1c0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/openajax/OpenAjax.js @@ -0,0 +1,193 @@ +/*******************************************************************************
+ * OpenAjax.js
+ *
+ * Reference implementation of the OpenAjax Hub, as specified by OpenAjax Alliance.
+ * Specification is under development at:
+ *
+ * http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification
+ *
+ * Copyright 2006-2008 OpenAjax Alliance
+ *
+ * Licensed 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.
+ *
+ ******************************************************************************/
+ +// prevent re-definition of the OpenAjax object +if(!window["OpenAjax"]){
+ OpenAjax = new function(){ + var t = true; + var f = false; + var g = window;
+ var libs;
+ var ooh = "org.openajax.hub."; +
+ var h = {};
+ this.hub = h;
+ h.implementer = "http://openajax.org";
+ h.implVersion = "1.0";
+ h.specVersion = "1.0";
+ h.implExtraData = {};
+ var libs = {};
+ h.libraries = libs; +
+ h.registerLibrary = function(prefix, nsURL, version, extra){
+ libs[prefix] = { + prefix: prefix, + namespaceURI: nsURL, + version: version, + extraData: extra + };
+ this.publish(ooh+"registerLibrary", libs[prefix]); + }
+ h.unregisterLibrary = function(prefix){ + this.publish(ooh+"unregisterLibrary", libs[prefix]); + delete libs[prefix];
+ }
+
+ h._subscriptions = { c:{}, s:[] };
+ h._cleanup = [];
+ h._subIndex = 0;
+ h._pubDepth = 0;
+
+ h.subscribe = function(name, callback, scope, subscriberData, filter)
+ {
+ if(!scope){
+ scope = window;
+ }
+ var handle = name + "." + this._subIndex;
+ var sub = { scope: scope, cb: callback, fcb: filter, data: subscriberData, sid: this._subIndex++, hdl: handle };
+ var path = name.split(".");
+ this._subscribe(this._subscriptions, path, 0, sub);
+ return handle;
+ }
+
+ h.publish = function(name, message)
+ {
+ var path = name.split(".");
+ this._pubDepth++;
+ this._publish(this._subscriptions, path, 0, name, message);
+ this._pubDepth--;
+ if((this._cleanup.length > 0) && (this._pubDepth == 0)) {
+ for(var i = 0; i < this._cleanup.length; i++)
+ this.unsubscribe(this._cleanup[i].hdl);
+ delete(this._cleanup);
+ this._cleanup = [];
+ }
+ }
+
+ h.unsubscribe = function(sub)
+ {
+ var path = sub.split(".");
+ var sid = path.pop();
+ this._unsubscribe(this._subscriptions, path, 0, sid);
+ }
+
+ h._subscribe = function(tree, path, index, sub)
+ {
+ var token = path[index];
+ if(index == path.length)
+ tree.s.push(sub);
+ else {
+ if(typeof tree.c == "undefined")
+ tree.c = {};
+ if(typeof tree.c[token] == "undefined") {
+ tree.c[token] = { c: {}, s: [] };
+ this._subscribe(tree.c[token], path, index + 1, sub);
+ }
+ else
+ this._subscribe( tree.c[token], path, index + 1, sub);
+ }
+ }
+
+ h._publish = function(tree, path, index, name, msg) {
+ if(typeof tree != "undefined") {
+ var node;
+ if(index == path.length) {
+ node = tree;
+ } else {
+ this._publish(tree.c[path[index]], path, index + 1, name, msg);
+ this._publish(tree.c["*"], path, index + 1, name, msg);
+ node = tree.c["**"];
+ }
+ if(typeof node != "undefined") {
+ var callbacks = node.s;
+ var max = callbacks.length;
+ for(var i = 0; i < max; i++) {
+ if(callbacks[i].cb) {
+ var sc = callbacks[i].scope;
+ var cb = callbacks[i].cb;
+ var fcb = callbacks[i].fcb;
+ var d = callbacks[i].data;
+ if(typeof cb == "string"){
+ // get a function object
+ cb = sc[cb];
+ }
+ if(typeof fcb == "string"){
+ // get a function object
+ fcb = sc[fcb];
+ }
+ if((!fcb) ||
+ (fcb.call(sc, name, msg, d))) {
+ cb.call(sc, name, msg, d);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ h._unsubscribe = function(tree, path, index, sid) {
+ if(typeof tree != "undefined") {
+ if(index < path.length) {
+ var childNode = tree.c[path[index]];
+ this._unsubscribe(childNode, path, index + 1, sid);
+ if(childNode.s.length == 0) {
+ for(var x in childNode.c)
+ return;
+ delete tree.c[path[index]];
+ }
+ return;
+ }
+ else {
+ var callbacks = tree.s;
+ var max = callbacks.length;
+ for(var i = 0; i < max; i++)
+ if(sid == callbacks[i].sid) {
+ if(this._pubDepth > 0) {
+ callbacks[i].cb = null;
+ this._cleanup.push(callbacks[i]);
+ }
+ else
+ callbacks.splice(i, 1);
+ return;
+ }
+ }
+ }
+ }
+ // The following function is provided for automatic testing purposes.
+ // It is not expected to be deployed in run-time OpenAjax Hub implementations.
+ h.reinit = function()
+ {
+ for (var lib in OpenAjax.hub.libraries) {
+ delete OpenAjax.hub.libraries[lib];
+ }
+ OpenAjax.hub.registerLibrary("OpenAjax", "http://openajax.org/hub", "1.0", {});
+
+ delete OpenAjax._subscriptions;
+ OpenAjax._subscriptions = {c:{},s:[]};
+ delete OpenAjax._cleanup;
+ OpenAjax._cleanup = [];
+ OpenAjax._subIndex = 0;
+ OpenAjax._pubDepth = 0;
+ }
+ };
+ // Register the OpenAjax Hub itself as a library.
+ OpenAjax.hub.registerLibrary("OpenAjax", "http://openajax.org/hub", "1.0", {});
+ +}
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/pom.xml b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/pom.xml new file mode 100644 index 0000000000..e936f0a9e3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/pom.xml @@ -0,0 +1,81 @@ +<?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. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-tutorial-store</artifactId> + <version>1.6-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>tutorial-store-mashup</artifactId> + <name>Apache Tuscany SCA Store Tutorial Online Store Mashup</name> + + <repositories> + <repository> + <id>apache.incubator</id> + <url>http://people.apache.org/repo/m2-incubating-repository</url> + </repository> + </repositories> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca-api</artifactId> + <version>1.6-SNAPSHOT</version> + </dependency> + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <sourceDirectory>${basedir}</sourceDirectory> + <resources> + <resource> + <directory>${basedir}</directory> + <excludes> + <exclude>**/*.java</exclude> + <exclude>**/.*/**</exclude> + <exclude>pom.xml</exclude> + <exclude>build.xml</exclude> + <exclude>target/**</exclude> + </excludes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-maven-ant-generator</artifactId> + <version>1.6-SNAPSHOT</version> + <executions> + <execution> + <configuration> + <pathToRootDir>../../..</pathToRootDir> + </configuration> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + </build> + +</project> diff --git a/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/store-gadget.composite b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/store-gadget.composite new file mode 100644 index 0000000000..7c10651e52 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/store-gadget.composite @@ -0,0 +1,64 @@ +<?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://www.osoa.org/xmlns/sca/1.0" + xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" + targetNamespace="http://store" + name="store-gadget"> + + <component name="StoreGadget"> + <t:implementation.widget location="gadget/store-gadget.html"/> + <service name="Widget"> + <t:binding.http uri="/gadget/store"/> + </service> + <reference name="catalog" target="StoreGadgetCatalog"> + <t:binding.jsonrpc/> + </reference> + <reference name="shoppingCart" target="StoreGadgetShoppingCart/Cart"> + <t:binding.atom/> + </reference> + <reference name="shoppingTotal" target="StoreGadgetShoppingCart/Total"> + <t:binding.jsonrpc/> + </reference> + </component> + + <component name="StoreGadgetCatalog"> + <implementation.java class="services.map.FruitsCatalogImpl"/> + <property name="currencyCode">USD</property> + <service name="Catalog"> + <t:binding.jsonrpc/> + </service> + <reference name="currencyConverter" target="StoreGadgetCurrencyConverter"/> + </component> + + <component name="StoreGadgetShoppingCart"> + <implementation.java class="services.ShoppingCartImpl"/> + <service name="Cart"> + <t:binding.atom uri="/ShoppingCart/Cart"/> + </service> + <service name="Total"> + <t:binding.jsonrpc/> + </service> + </component> + + <component name="StoreGadgetCurrencyConverter"> + <implementation.java class="services.CurrencyConverterImpl"/> + </component> + +</composite> diff --git a/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/store-mashup.composite b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/store-mashup.composite new file mode 100644 index 0000000000..84e4933e63 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.1/tutorials/store/store-mashup/store-mashup.composite @@ -0,0 +1,48 @@ +<?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://www.osoa.org/xmlns/sca/1.0" + xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" + targetNamespace="http://store" + xmlns:s="http://store" + name="store-mashup"> + + <include name="s:store-gadget"/> + <include name="s:map-gadget"/> + + <component name="StoreMashup"> + <t:implementation.widget location="mashup/store-mash.html"/> + <service name="Widget"> + <t:binding.http uri="/mashup"/> + </service> + <reference name="storeGadget" target="StoreGadget"> + <t:binding.http/> + </reference> + <reference name="mapGadget" target="MapGadget"> + <t:binding.http/> + </reference> + </component> + + <component name="openajax"> + <t:implementation.resource location="openajax"/> + <service name="Resource"> + <t:binding.http uri="/openajax"/> + </service> + </component> +</composite> |