diff options
Diffstat (limited to '')
113 files changed, 0 insertions, 6769 deletions
diff --git a/branches/sca-java-1.5/samples/store-android/.classpath b/branches/sca-java-1.5/samples/store-android/.classpath deleted file mode 100644 index ef7c361cff..0000000000 --- a/branches/sca-java-1.5/samples/store-android/.classpath +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/branches/sca-java-1.5/samples/store-android/.project b/branches/sca-java-1.5/samples/store-android/.project deleted file mode 100644 index 616abf1df0..0000000000 --- a/branches/sca-java-1.5/samples/store-android/.project +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>store-android</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.android.ide.eclipse.adt.ApkBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>com.android.ide.eclipse.adt.AndroidNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/branches/sca-java-1.5/samples/store-android/AndroidManifest.xml b/branches/sca-java-1.5/samples/store-android/AndroidManifest.xml deleted file mode 100644 index 4a26dd27c6..0000000000 --- a/branches/sca-java-1.5/samples/store-android/AndroidManifest.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="store.android" - android:versionCode="1" - android:versionName="1.0.0"> - <application android:icon="@drawable/icon" android:label="@string/app_name"> - <activity android:name=".catalog" - android:label="@string/app_name"> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - </activity> - </application> - -<uses-permission android:name="android.permission.INTERNET"></uses-permission> - -</manifest>
\ No newline at end of file diff --git a/branches/sca-java-1.5/samples/store-android/res/drawable/icon.png b/branches/sca-java-1.5/samples/store-android/res/drawable/icon.png Binary files differdeleted file mode 100644 index 75024841d3..0000000000 --- a/branches/sca-java-1.5/samples/store-android/res/drawable/icon.png +++ /dev/null diff --git a/branches/sca-java-1.5/samples/store-android/res/layout/main.xml b/branches/sca-java-1.5/samples/store-android/res/layout/main.xml deleted file mode 100644 index 3a5f117d3c..0000000000 --- a/branches/sca-java-1.5/samples/store-android/res/layout/main.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - > -<TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="@string/hello" - /> -</LinearLayout> diff --git a/branches/sca-java-1.5/samples/store-android/res/values/strings.xml b/branches/sca-java-1.5/samples/store-android/res/values/strings.xml deleted file mode 100644 index 02b55ae85a..0000000000 --- a/branches/sca-java-1.5/samples/store-android/res/values/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <string name="hello">Hello World, catalog</string> - <string name="app_name">store</string> -</resources> diff --git a/branches/sca-java-1.5/samples/store-android/src/services/Catalog.java b/branches/sca-java-1.5/samples/store-android/src/services/Catalog.java deleted file mode 100644 index 9105f1047c..0000000000 --- a/branches/sca-java-1.5/samples/store-android/src/services/Catalog.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ - -package services; - -public interface Catalog { - Item[] get(); -} diff --git a/branches/sca-java-1.5/samples/store-android/src/services/CatalogProxy.java b/branches/sca-java-1.5/samples/store-android/src/services/CatalogProxy.java deleted file mode 100644 index 3ce9459844..0000000000 --- a/branches/sca-java-1.5/samples/store-android/src/services/CatalogProxy.java +++ /dev/null @@ -1,52 +0,0 @@ -package services; - -import java.util.ArrayList; -import java.util.List; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import services.json.rpc.JSONRpc; - -public class CatalogProxy implements Catalog { - private static final String jsonRPCServiceURI = "http://192.168.1.104:8080/Catalog"; - private static final String jsonRPCRequest = "{\"id\": 3, \"method\": \"Service.get\", \"params\": []}"; - - private List<Item> catalog = new ArrayList<Item>(); - - public CatalogProxy() { - initialize(); - } - - public void initialize() { - JSONObject json = null; - - try { - json = JSONRpc.invoke(jsonRPCServiceURI, jsonRPCRequest); - - if(json == null) { - return; - } - - JSONArray result = json.getJSONArray("result"); - for(int i = 0; i < result.length(); i++) { - Item item = new Item(); - item.setName(result.getJSONObject(i).getString("name")); - item.setPrice(result.getJSONObject(i).getString("price")); - - catalog.add(item); - } - - } catch (JSONException e) { - e.printStackTrace(); - } - } - - public Item[] get() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.toArray(catalogArray); - return catalogArray; - } - -} diff --git a/branches/sca-java-1.5/samples/store-android/src/services/Item.java b/branches/sca-java-1.5/samples/store-android/src/services/Item.java deleted file mode 100644 index 27abd4f016..0000000000 --- a/branches/sca-java-1.5/samples/store-android/src/services/Item.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -package services; - - -public class Item { - private String name; - private String price; - - public Item() { - } - - public Item(String name, String price) { - this.name = name; - this.price = price; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - -} diff --git a/branches/sca-java-1.5/samples/store-android/src/services/ShoppingCartProxy.java b/branches/sca-java-1.5/samples/store-android/src/services/ShoppingCartProxy.java deleted file mode 100644 index 872db654a4..0000000000 --- a/branches/sca-java-1.5/samples/store-android/src/services/ShoppingCartProxy.java +++ /dev/null @@ -1,44 +0,0 @@ -package services; - -import org.json.JSONException; -import org.json.JSONObject; - -import services.json.rpc.JSONRpc; - -public class ShoppingCartProxy { - private static final String jsonRPCTotalServiceURI = "http://192.168.1.104:8080/ShoppingCart/Total"; - private static final String jsonRPCTotalRequest = "{\"id\": 4, \"method\": \"Service.getTotal\", \"params\": []}"; - - public Item[] getItems() { - return null; - } - - public void addItem(Item item) { - - } - - public void removeItem(Item item) { - - } - - public void checkOut() { - - } - - public String getTotal() { - String total = ""; - JSONObject json = null; - - try { - json = JSONRpc.invoke(jsonRPCTotalServiceURI, jsonRPCTotalRequest); - - if(json != null) { - total = json.getString("result"); - } - } catch (JSONException e) { - e.printStackTrace(); - } - - return total; - } -} diff --git a/branches/sca-java-1.5/samples/store-android/src/services/json/rpc/JSONRpc.java b/branches/sca-java-1.5/samples/store-android/src/services/json/rpc/JSONRpc.java deleted file mode 100644 index 927a840b86..0000000000 --- a/branches/sca-java-1.5/samples/store-android/src/services/json/rpc/JSONRpc.java +++ /dev/null @@ -1,44 +0,0 @@ -package services.json.rpc; - -import java.io.IOException; - -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.util.EntityUtils; -import org.json.JSONException; -import org.json.JSONObject; - -public class JSONRpc { - - protected JSONRpc() { - - } - - public static JSONObject invoke(String serviceURI, String rpcRequest) throws JSONException{ - HttpClient httpClient = new DefaultHttpClient(); - HttpPost httpPost = new HttpPost(serviceURI); - - JSONObject result = null; - try { - httpPost.setHeader("Content-Type", "text/xml"); - httpPost.setEntity(new StringEntity(rpcRequest)); - - HttpResponse httpResponse = httpClient.execute(httpPost); - if (httpResponse.getStatusLine().getStatusCode() == 200) { - String jsonResult = EntityUtils.toString(httpResponse.getEntity()); - result = new JSONObject(jsonResult); - } else { - String errorMessage = httpResponse.getStatusLine() - .getReasonPhrase(); - System.out.println(errorMessage); - } - } catch (IOException e) { - e.printStackTrace(); - } - - return result; - } -} diff --git a/branches/sca-java-1.5/samples/store-android/src/store/android/R.java b/branches/sca-java-1.5/samples/store-android/src/store/android/R.java deleted file mode 100644 index 74dae5d7e4..0000000000 --- a/branches/sca-java-1.5/samples/store-android/src/store/android/R.java +++ /dev/null @@ -1,23 +0,0 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package store.android; - -public final class R { - public static final class attr { - } - public static final class drawable { - public static final int icon=0x7f020000; - } - public static final class layout { - public static final int main=0x7f030000; - } - public static final class string { - public static final int app_name=0x7f040001; - public static final int hello=0x7f040000; - } -} diff --git a/branches/sca-java-1.5/samples/store-android/src/store/android/catalog.java b/branches/sca-java-1.5/samples/store-android/src/store/android/catalog.java deleted file mode 100644 index e21196b3ed..0000000000 --- a/branches/sca-java-1.5/samples/store-android/src/store/android/catalog.java +++ /dev/null @@ -1,82 +0,0 @@ -package store.android; - -import java.util.ArrayList; -import java.util.List; - -import services.Catalog; -import services.CatalogProxy; -import services.Item; -import services.ShoppingCartProxy; -import android.app.ListActivity; -import android.os.Bundle; -import android.util.SparseBooleanArray; -import android.view.View; -import android.widget.ArrayAdapter; -import android.widget.Button; -import android.widget.ListView; - -public class catalog extends ListActivity { - private Catalog catalogProxy = new CatalogProxy(); - private ShoppingCartProxy shoppingCartProxy = new ShoppingCartProxy(); - - private String[] getCatalogItems() { - List<String> catalog = new ArrayList<String>(); - - for(Item item : catalogProxy.get()) { - catalog.add(item.getName() + " - " + item.getPrice()); - } - - String[] catalogArray = new String[catalog.size()]; - catalog.toArray(catalogArray); - - return catalogArray; - } - - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - - setListAdapter(new ArrayAdapter<String>(this, - android.R.layout.simple_list_item_multiple_choice, this.getCatalogItems())); - - Button addToCart = (Button) findViewById(1); - /* - addToCart.setOnClickListener(new View.OnClickListener() { - public void onCLick(View v) { - this. - } - }); - */ - - - final ListView listView = getListView(); - - listView.setItemsCanFocus(false); - listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); - } - - @Override - protected void onListItemClick(ListView l, View v, int position, long id) { - super.onListItemClick(l, v, position, id); - - String item = this.getCatalogItems()[position]; - System.out.println("Item clicked : " + item); - - System.out.println("Selected items:"); - SparseBooleanArray checkedItems = l.getCheckedItemPositions(); - for(int i = 0; i < checkedItems.size(); i++) { - if(checkedItems.valueAt(i) == true) { - System.out.println(">>>" + this.getCatalogItems()[checkedItems.keyAt(i)]); - } - } - System.out.println("Total: " + shoppingCartProxy.getTotal()); - - //l.getCheckedItemPosition(); - //Intent webIntent = new Intent("android.intent.action.VIEW", Uri.parse("http://192.168.1.104:8080/ShoppingCart/Cart")); - //startActivity(webIntent); - } - - -}
\ No newline at end of file diff --git a/branches/sca-java-1.5/samples/store-distributed/README b/branches/sca-java-1.5/samples/store-distributed/README deleted file mode 100644 index 46e71bf51e..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/README +++ /dev/null @@ -1,28 +0,0 @@ -Store Sample -====================================== - -This is a sample store scenario that is used as a getting started guide -for Tuscany SCA. For detailed information, please see: - -http://tuscany.apache.org/getting-started-with-tuscany.html - -or - -http://tuscany.apache.org/getting-started-with-tuscany-using-tuscany-eclipse-plugin.html - - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built using Ant as follows: - -cd store -ant compile - -and then, to run: - -ant run - -Once the store application is running use your browser to visit the following -URL: - -http://localhost:8080/store/ diff --git a/branches/sca-java-1.5/samples/store-distributed/build.xml b/branches/sca-java-1.5/samples/store-distributed/build.xml deleted file mode 100644 index 04ba1c7752..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/build.xml +++ /dev/null @@ -1,79 +0,0 @@ -<!-- - * 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 name="store-distributed" default="compile"> - <property name="test.class" value="node.LaunchDomain" /> - <property name="test.jar" value="sample-store-distributed.jar" /> - - <target name="init"> - <mkdir dir="target/classes"/> - </target> - - <target name="compile" depends="init"> - <javac srcdir="src/main/java" - destdir="target/classes" - debug="on" - source="1.5" - target="1.5"> - <classpath> - <pathelement location="../../lib/tuscany-sca-manifest.jar"/> - <fileset refid="3rdparty.jars"/> - </classpath> - </javac> - <copy todir="target/classes"> - <fileset dir="src/main/resources"/> - </copy> - <jar destfile="target/${test.jar}" basedir="target/classes"> - <manifest> - <attribute name="Main-Class" value="${test.class}" /> - </manifest> - </jar> - </target> - - <target name="run-classes"> - <java classname="${test.class}" - fork="true"> - <classpath> - <pathelement path="target/classes"/> - <pathelement location="../../lib/tuscany-sca-manifest.jar"/> - <fileset refid="3rdparty.jars"/> - </classpath> - </java> - </target> - - <target name="run"> - <java classname="${test.class}" - fork="true"> - <classpath> - <pathelement path="target/${test.jar}"/> - <pathelement location="../../lib/tuscany-sca-manifest.jar"/> - <fileset refid="3rdparty.jars"/> - </classpath> - </java> - </target> - - <target name="clean"> - <delete quiet="true" includeemptydirs="true"> - <fileset dir="target"/> - </delete> - </target> - - <fileset id="3rdparty.jars" dir="../../lib"> - <include name="saxon-8.7.jar"/> - </fileset> -</project> diff --git a/branches/sca-java-1.5/samples/store-distributed/cloud.composite b/branches/sca-java-1.5/samples/store-distributed/cloud.composite deleted file mode 100644 index 7bd13d5b6f..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/cloud.composite +++ /dev/null @@ -1,27 +0,0 @@ -<?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 name="cloud.composite" - targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0" - xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:ns1="http://www.osoa.org/xmlns/sca/1.0"> - <include name="ns2:NodeA" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://store/cloud"/> - <include name="ns2:NodeB" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://store/cloud"/> - <include name="ns2:NodeC" uri="http://tuscany.apache.org/cloud" xmlns:ns2="http://store/cloud"/> -</composite> diff --git a/branches/sca-java-1.5/samples/store-distributed/domain.composite b/branches/sca-java-1.5/samples/store-distributed/domain.composite deleted file mode 100644 index 6898c454af..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/domain.composite +++ /dev/null @@ -1,27 +0,0 @@ -<?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 name="domain.composite" - targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0" - xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:ns1="http://www.osoa.org/xmlns/sca/1.0"> - <include name="ns2:storeA" uri="nodeA" xmlns:ns2="http://store"/> - <include name="ns2:storeB" uri="nodeB" xmlns:ns2="http://store"/> - <include name="ns2:storeC" uri="nodeC" xmlns:ns2="http://store"/> -</composite> diff --git a/branches/sca-java-1.5/samples/store-distributed/pom.xml b/branches/sca-java-1.5/samples/store-distributed/pom.xml deleted file mode 100644 index e8f6574285..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/pom.xml +++ /dev/null @@ -1,119 +0,0 @@ -<?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-sca</artifactId> - <version>1.5-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>sample-store-distributed</artifactId> - <name>Apache Tuscany SCA Sample Getting Started Online Distributed Store</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-node-api</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-domain-manager</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-data-api</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-widget-runtime-tuscany</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-atom-abdera</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-http-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-tomcat</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - </build> - -</project> diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/java/node/LaunchDomain.java b/branches/sca-java-1.5/samples/store-distributed/src/main/java/node/LaunchDomain.java deleted file mode 100644 index dd19f6b49b..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/java/node/LaunchDomain.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ -package node; - -import org.apache.tuscany.sca.node.launcher.DomainManagerLauncher; - -/** - * This server program that loads a composite to provide simple registry function. - * This server can be replaced with any registry that is appropriate but the components - * in each node that talk to the registry should be replaced also. - */ -public class LaunchDomain { - public static void main(String[] args) throws Exception { - DomainManagerLauncher.main(args); - } - -} diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java b/branches/sca-java-1.5/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java deleted file mode 100644 index 9016e515fb..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -package node; - -import org.apache.tuscany.sca.node.launcher.NodeLauncher; - -public class LaunchStoreNodeA { - public static void main(String[] args) throws Exception { - NodeLauncher.main(new String[] {"http://localhost:9990/node-config/NodeA"}); - } -} diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java b/branches/sca-java-1.5/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java deleted file mode 100644 index 2b387aec82..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -package node; - -import org.apache.tuscany.sca.node.launcher.NodeLauncher; - -public class LaunchStoreNodeB { - public static void main(String[] args) throws Exception { - NodeLauncher.main(new String[] {"http://localhost:9990/node-config/NodeB"}); - } -} diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java b/branches/sca-java-1.5/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java deleted file mode 100644 index fb138e484f..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -package node; - -import org.apache.tuscany.sca.node.launcher.NodeLauncher; - -public class LaunchStoreNodeC { - public static void main(String[] args) throws Exception { - NodeLauncher.main(new String[] {"http://localhost:9990/node-config/NodeC"}); - } -} diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/Cart.java b/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/Cart.java deleted file mode 100644 index 9e6226d963..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/Cart.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.apache.tuscany.sca.data.collection.Collection; -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Cart extends Collection<String, Item> { - -} diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/Catalog.java b/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/Catalog.java deleted file mode 100644 index 2c3b19f579..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/Catalog.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Catalog { - Item[] get(); -} diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/CurrencyConverter.java b/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/CurrencyConverter.java deleted file mode 100644 index e104a0423a..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/CurrencyConverter.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface CurrencyConverter { - public double getConversion(String fromCurrenycCode, String toCurrencyCode, double amount); - - public String getCurrencySymbol(String currencyCode); -} diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java b/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java deleted file mode 100644 index c354aed447..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ - -package services; - -public class CurrencyConverterImpl implements CurrencyConverter { - public double getConversion(String fromCurrencyCode, String toCurrencyCode, double amount) { - if (toCurrencyCode.equals("USD")) - return amount; - else if (toCurrencyCode.equals("EUR")) - return ((double)Math.round(amount * 0.7256 * 100)) /100; - return 0; - } - - public String getCurrencySymbol(String currencyCode) { - if (currencyCode.equals("USD")) - return "$"; - else if (currencyCode.equals("EUR")) - return "E"; //"€"; - return "?"; - } -} diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java b/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java deleted file mode 100644 index 377b3d7e59..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -package services; - -import java.util.ArrayList; -import java.util.List; - -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; - -public class FruitsCatalogImpl implements Catalog { - - @Property - public String currencyCode = "USD"; - - @Reference - public CurrencyConverter currencyConverter; - - private List<Item> catalog = new ArrayList<Item>(); - - @Init - public void init() { - String currencySymbol = currencyConverter.getCurrencySymbol(currencyCode); - catalog.add(new Item("Apple", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 2.99))); - catalog.add(new Item("Orange", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 3.55))); - catalog.add(new Item("Pear", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 1.55))); - } - - public Item[] get() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.toArray(catalogArray); - return catalogArray; - } -} diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/Item.java b/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/Item.java deleted file mode 100644 index 27abd4f016..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/Item.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -package services; - - -public class Item { - private String name; - private String price; - - public Item() { - } - - public Item(String name, String price) { - this.name = name; - this.price = price; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - -} diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java b/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java deleted file mode 100644 index 9889921a96..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * 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. - */ - -package services; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.apache.tuscany.sca.data.collection.Entry; -import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -@Scope("COMPOSITE") -public class ShoppingCartImpl implements Cart, Total { - - private Map<String, Item> cart; - - @Init - public void init() { - cart = new HashMap<String, Item>(); - } - - public Entry<String, Item>[] getAll() { - Entry<String, Item>[] entries = new Entry[cart.size()]; - int i = 0; - for (Map.Entry<String, Item> e: cart.entrySet()) { - entries[i++] = new Entry<String, Item>(e.getKey(), e.getValue()); - } - return entries; - } - - public Item get(String key) throws NotFoundException { - Item item = cart.get(key); - if (item == null) { - throw new NotFoundException(key); - } else { - return item; - } - } - - public String post(String key, Item item) { - if (key == null) { - key ="cart-" + UUID.randomUUID().toString(); - } - cart.put(key, item); - return key; - } - - public void put(String key, Item item) throws NotFoundException { - if (!cart.containsKey(key)) { - throw new NotFoundException(key); - } - cart.put(key, item); - } - - public void delete(String key) throws NotFoundException { - if (key == null || key.equals("")) { - cart.clear(); - } else { - Item item = cart.remove(key); - if (item == null) - throw new NotFoundException(key); - } - } - - public Entry<String, Item>[] query(String queryString) { - List<Entry<String, Item>> entries = new ArrayList<Entry<String,Item>>(); - if (queryString.startsWith("name=")) { - String name = queryString.substring(5); - for (Map.Entry<String, Item> e: cart.entrySet()) { - Item item = e.getValue(); - if (item.getName().equals(name)) { - entries.add(new Entry<String, Item>(e.getKey(), e.getValue())); - } - } - } - return entries.toArray(new Entry[entries.size()]); - } - - public String getTotal() { - double total = 0; - String currencySymbol = ""; - if (!cart.isEmpty()) { - Item item = cart.values().iterator().next(); - currencySymbol = item.getPrice().substring(0, 1); - } - for (Item item : cart.values()) { - total += Double.valueOf(item.getPrice().substring(1)); - } - return currencySymbol + String.valueOf(total); - } -} diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/Total.java b/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/Total.java deleted file mode 100644 index 8f464e526f..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/java/services/Total.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Total { - - String getTotal(); - -} diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/cloud/NodeA.composite b/branches/sca-java-1.5/samples/store-distributed/src/main/resources/cloud/NodeA.composite deleted file mode 100644 index f7bfd0fcb6..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/cloud/NodeA.composite +++ /dev/null @@ -1,36 +0,0 @@ -<?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/cloud" - xmlns:store="http://store" - name="NodeA"> - - <component name="NodeA"> - <t:implementation.node uri="nodeA" composite="store:storeA"/> - <service name="Node"> - <binding.sca uri="http://localhost:8100"/> - <t:binding.jsonrpc uri="http://localhost:8100"/> - <t:binding.atom uri="http://localhost:8100"/> - <t:binding.http uri="http://localhost:8100"/> - </service> - </component> - -</composite> diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/cloud/NodeB.composite b/branches/sca-java-1.5/samples/store-distributed/src/main/resources/cloud/NodeB.composite deleted file mode 100644 index 187c5caf1c..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/cloud/NodeB.composite +++ /dev/null @@ -1,36 +0,0 @@ -<?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/cloud" - xmlns:store="http://store" - name="NodeB"> - - <component name="NodeB"> - <t:implementation.node uri="nodeB" composite="store:storeB"/> - <service name="Node"> - <binding.sca uri="http://localhost:8200"/> - <t:binding.jsonrpc uri="http://localhost:8200"/> - <t:binding.atom uri="http://localhost:8200"/> - <t:binding.http uri="http://localhost:8200"/> - </service> - </component> - -</composite> diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/cloud/NodeC.composite b/branches/sca-java-1.5/samples/store-distributed/src/main/resources/cloud/NodeC.composite deleted file mode 100644 index 98113a3576..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/cloud/NodeC.composite +++ /dev/null @@ -1,36 +0,0 @@ -<?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/cloud" - xmlns:store="http://store" - name="NodeC"> - - <component name="NodeC"> - <t:implementation.node uri="nodeC" composite="store:storeC"/> - <service name="Node"> - <binding.sca uri="http://localhost:8300"/> - <t:binding.jsonrpc uri="http://localhost:8300"/> - <t:binding.atom uri="http://localhost:8300"/> - <t:binding.http uri="http://localhost:8300"/> - </service> - </component> - -</composite> diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml b/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml deleted file mode 100644 index f165ee0e29..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?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" - targetNamespace="http://store" - xmlns:store="http://store"> - <deployable composite="store:storeA"/> -</contribution>
\ No newline at end of file diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeA/store.composite b/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeA/store.composite deleted file mode 100644 index 2ac608d43f..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeA/store.composite +++ /dev/null @@ -1,38 +0,0 @@ -<?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="storeA"> - - <component name="Catalog"> - <implementation.java class="services.FruitsCatalogImpl"/> - <property name="currencyCode">USD</property> - <service name="Catalog"> - <t:binding.jsonrpc/> - </service> - <reference name="currencyConverter" target="CurrencyConverter"/> - </component> - - <component name="CurrencyConverter"> - <implementation.java class="services.CurrencyConverterImpl"/> - </component> - -</composite> diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml b/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml deleted file mode 100644 index 0f8e76ccd7..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?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" - targetNamespace="http://store" - xmlns:store="http://store"> - <deployable composite="store:storeB"/> -</contribution>
\ No newline at end of file diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeB/store.composite b/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeB/store.composite deleted file mode 100644 index 062a7aa2cd..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeB/store.composite +++ /dev/null @@ -1,35 +0,0 @@ -<?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="storeB"> - - <component name="ShoppingCart"> - <implementation.java class="services.ShoppingCartImpl"/> - <service name="Cart"> - <t:binding.atom uri="/ShoppingCart/Cart"/> - </service> - <service name="Total"> - <t:binding.jsonrpc/> - </service> - </component> - -</composite> diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml b/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml deleted file mode 100644 index 15bab17c1a..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?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" - targetNamespace="http://store" - xmlns:store="http://store"> - <deployable composite="store:storeC"/> -</contribution>
\ No newline at end of file diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeC/store.composite b/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeC/store.composite deleted file mode 100644 index 5de310128d..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeC/store.composite +++ /dev/null @@ -1,41 +0,0 @@ -<?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="storeC"> - - <component name="Store"> - <t:implementation.widget location="uiservices/store.html"/> - <service name="Widget"> - <t:binding.http uri="/store"/> - </service> - <reference name="catalog" target="Catalog"> - <t:binding.jsonrpc/> - </reference> - <reference name="shoppingCart" target="ShoppingCart/Cart"> - <t:binding.atom/> - </reference> - <reference name="shoppingTotal" target="ShoppingCart/Total"> - <t:binding.jsonrpc/> - </reference> - </component> -</composite> - diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeC/uiservices/store.html b/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeC/uiservices/store.html deleted file mode 100644 index ba004e02ac..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/nodeC/uiservices/store.html +++ /dev/null @@ -1,162 +0,0 @@ -<!-- - * 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="store.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" 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); - } - catch(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">'+ - 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 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/">(feed)</a> - </form> - </div> -</body> -</html> diff --git a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/uiservices/store.html b/branches/sca-java-1.5/samples/store-distributed/src/main/resources/uiservices/store.html deleted file mode 100644 index ba004e02ac..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/src/main/resources/uiservices/store.html +++ /dev/null @@ -1,162 +0,0 @@ -<!-- - * 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="store.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" 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); - } - catch(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">'+ - 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 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/">(feed)</a> - </form> - </div> -</body> -</html> diff --git a/branches/sca-java-1.5/samples/store-distributed/store.png b/branches/sca-java-1.5/samples/store-distributed/store.png Binary files differdeleted file mode 100644 index da413edeee..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/store.png +++ /dev/null diff --git a/branches/sca-java-1.5/samples/store-distributed/store.svg b/branches/sca-java-1.5/samples/store-distributed/store.svg deleted file mode 100644 index 74f8ecd36d..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/store.svg +++ /dev/null @@ -1,304 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- - * 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. ---> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1052.3622" - height="744.09448" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.45.1" - sodipodi:docbase="C:\simon\tuscany\java-head\sca\samples\store" - sodipodi:docname="store.svg" - version="1.0" - inkscape:output_extension="org.inkscape.output.svg.inkscape" - inkscape:export-filename="C:\simon\tuscany\java-head\sca\samples\store\store.png" - inkscape:export-xdpi="52.84" - inkscape:export-ydpi="52.84"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.4" - inkscape:cx="538.06165" - inkscape:cy="341.69129" - inkscape:document-units="px" - inkscape:current-layer="g2997" - inkscape:window-width="1466" - inkscape:window-height="831" - inkscape:window-x="117" - inkscape:window-y="80" /> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1"> - <g - id="g2997"> - <rect - rx="14.335117" - ry="17.743465" - y="197.1973" - x="447.35422" - height="419.39099" - width="464.23727" - id="rect2067" - style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:2.28840661;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <flowRoot - id="flowRoot2954" - xml:space="preserve" - transform="translate(189.90868,1.0101522)"><flowRegion - id="flowRegion2956"><rect - y="212.66591" - x="281.42856" - height="61.42857" - width="170" - id="rect2958" /></flowRegion><flowPara - id="flowPara2171">store</flowPara></flowRoot> <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.30182266;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2175" - width="118.21779" - height="111.27543" - x="491.60019" - y="247.75989" - rx="7.1507306" - ry="9.2311935" /> - <flowRoot - xml:space="preserve" - id="flowRoot2177" - transform="translate(223.8585,41.670449)"><flowRegion - id="flowRegion2179"><rect - id="rect2181" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2183">ufs</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 474.29877,279.45598 L 507.63381,279.45598 L 513.69472,292.58796 L 506.62366,304.7098 L 474.29877,304.7098 L 481.87492,292.58796 L 474.29877,279.45598 z " - id="path2187" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2191" - width="115.66247" - height="85.862968" - x="493.07068" - y="503.27759" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2193" - transform="translate(225.47992,297.33908)"><flowRegion - id="flowRegion2195"><rect - id="rect2197" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2199">ShoppingCart</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 475.92019,535.12461 L 509.25523,535.12461 L 515.31614,548.25659 L 508.24508,560.37843 L 475.92019,560.37843 L 483.49634,548.25659 L 475.92019,535.12461 z " - id="path2203" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2207" - width="115.66247" - height="85.862968" - x="761.44415" - y="391.31604" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2209" - transform="translate(487.8534,185.37751)"><flowRegion - id="flowRegion2211"><rect - id="rect2213" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2215">CurrencyConverter</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 744.29367,423.16304 L 777.62871,423.16304 L 783.68962,436.29502 L 776.61856,448.41686 L 744.29367,448.41686 L 751.86982,436.29502 L 744.29367,423.16304 z " - id="path2219" /> - <rect - style="opacity:1;fill:#0064ff;fill-opacity:1;stroke:#000000;stroke-width:0.9612025;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2223" - width="104.08451" - height="113.17588" - x="138.37151" - y="350.1156" - rx="0" - ry="0.048917599" /> - <path - style="fill:#1a73fe;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" - d="M 138.21429,462.66591 L 115.35714,479.80877 L 267.85714,479.80877 L 241.78571,463.02305 L 138.21429,462.66591 z " - id="path3197" /> - <rect - style="opacity:1;fill:#f1f4f8;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect3199" - width="92.5" - height="97.14286" - x="143.57143" - y="358.38019" - ry="3.6203461" - rx="3.9285715" /> - <image - y="366.6889" - x="156.24066" - id="image3323" - height="78.571434" - width="58.57143" - sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" - xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> - <image - y="270.52304" - x="526.42859" - id="image3342" - height="78.571434" - width="58.57143" - sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" - xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 242.85714,374.80877 C 245.71429,374.80877 345.71429,374.80877 345.71429,374.80877 L 345.71429,291.95162 L 481.42858,291.95162" - id="path3348" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 210.71429,406.95163 L 345,406.95163 L 345,437.66591 L 481.42857,437.66591" - id="path3350" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 210.71429,439.09448 L 325.71429,439.09448 L 325.71429,548.3802 L 482.85714,548.3802" - id="path3352" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 626.42857,436.23734 C 750,437.66591 752.14286,436.23734 752.14286,436.23734" - id="path3354" - sodipodi:nodetypes="cc" /> - <flowRoot - xml:space="preserve" - id="flowRoot3356" - transform="translate(-94.285714,25)"><flowRegion - id="flowRegion3358"><rect - id="rect3360" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3362">CurrenyCode</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3364" - transform="translate(-250.76562,-76.210859)"><flowRegion - id="flowRegion3366"><rect - id="rect3368" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3370">HTTP</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3372" - transform="translate(-273.62277,70.931998)"><flowRegion - id="flowRegion3374"><rect - id="rect3376" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3378">JSONRPC</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3380" - transform="translate(-243.62277,183.07485)"><flowRegion - id="flowRegion3382"><rect - id="rect3384" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3386">Atom</flowPara></flowRoot> </g> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2988" - width="115.66247" - height="85.862968" - x="491.56897" - y="392.70135" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2966" - transform="translate(223.97819,186.76283)"><flowRegion - id="flowRegion2968"><rect - id="rect2970" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2972">Catalog</flowPara></flowRoot> <rect - style="opacity:1;fill:#fff62c;fill-opacity:1;stroke:#060000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect3006" - width="21.718224" - height="20.708065" - x="537.53094" - y="377.04398" - rx="10.859112" - ry="0" /> - <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 474.41846,424.54836 L 507.7535,424.54836 L 513.81441,437.68034 L 506.74335,449.80218 L 474.41846,449.80218 L 481.99461,437.68034 L 474.41846,424.54836 z " - id="path3017" /> - <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 587.6709,422.71008 L 621.00594,422.71008 L 627.06685,435.84206 L 619.99579,447.9639 L 587.6709,447.9639 L 595.24705,435.84206 L 587.6709,422.71008 z " - id="path3019" /> - </g> -</svg> diff --git a/branches/sca-java-1.5/samples/store-distributed/workspace.xml b/branches/sca-java-1.5/samples/store-distributed/workspace.xml deleted file mode 100644 index d6cb2bfc81..0000000000 --- a/branches/sca-java-1.5/samples/store-distributed/workspace.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?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. ---> -<workspace xmlns="http://tuscany.apache.org/xmlns/sca/1.0" xmlns:ns1="http://tuscany.apache.org/xmlns/sca/1.0"> - <contribution location="file:./src/main/resources/nodeA" uri="nodeA"/> - <contribution location="file:./src/main/resources/nodeB" uri="nodeB"/> - <contribution location="file:./src/main/resources/nodeC" uri="nodeC"/> - <contribution location="file:./src/main/resources/cloud" uri="http://tuscany.apache.org/cloud"/> -</workspace> diff --git a/branches/sca-java-1.5/samples/store-dojo/README b/branches/sca-java-1.5/samples/store-dojo/README deleted file mode 100644 index 46e71bf51e..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/README +++ /dev/null @@ -1,28 +0,0 @@ -Store Sample -====================================== - -This is a sample store scenario that is used as a getting started guide -for Tuscany SCA. For detailed information, please see: - -http://tuscany.apache.org/getting-started-with-tuscany.html - -or - -http://tuscany.apache.org/getting-started-with-tuscany-using-tuscany-eclipse-plugin.html - - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built using Ant as follows: - -cd store -ant compile - -and then, to run: - -ant run - -Once the store application is running use your browser to visit the following -URL: - -http://localhost:8080/store/ diff --git a/branches/sca-java-1.5/samples/store-dojo/pom.xml b/branches/sca-java-1.5/samples/store-dojo/pom.xml deleted file mode 100644 index 9c1db5b32b..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/pom.xml +++ /dev/null @@ -1,127 +0,0 @@ -<?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-sca</artifactId> - <version>1.5-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>sample-store-dojo</artifactId> - <name>Apache Tuscany SCA Sample Getting Started Online Store</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-host-embedded</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-data-api</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-web-javascript-dojo</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-widget-runtime-dojo</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-atom-abdera</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-atom-js-dojo</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jsonrpc-js-dojo</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-http-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-tomcat</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - </build> - -</project> diff --git a/branches/sca-java-1.5/samples/store-dojo/src/main/java/launch/Launch.java b/branches/sca-java-1.5/samples/store-dojo/src/main/java/launch/Launch.java deleted file mode 100644 index 801697abea..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/src/main/java/launch/Launch.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -package launch; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class Launch { - public static void main(String[] args) throws Exception { - System.out.println("Starting ..."); - SCADomain scaDomain = SCADomain.newInstance("store.composite"); - System.out.println("store.composite ready for big business !!!"); - System.in.read(); - System.out.println("Stopping ..."); - scaDomain.close(); - System.out.println(); - } -} diff --git a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/Cart.java b/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/Cart.java deleted file mode 100644 index 9e6226d963..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/Cart.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.apache.tuscany.sca.data.collection.Collection; -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Cart extends Collection<String, Item> { - -} diff --git a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/Catalog.java b/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/Catalog.java deleted file mode 100644 index 2c3b19f579..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/Catalog.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Catalog { - Item[] get(); -} diff --git a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/CurrencyConverter.java b/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/CurrencyConverter.java deleted file mode 100644 index e104a0423a..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/CurrencyConverter.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface CurrencyConverter { - public double getConversion(String fromCurrenycCode, String toCurrencyCode, double amount); - - public String getCurrencySymbol(String currencyCode); -} diff --git a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/CurrencyConverterImpl.java b/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/CurrencyConverterImpl.java deleted file mode 100644 index c354aed447..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/CurrencyConverterImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ - -package services; - -public class CurrencyConverterImpl implements CurrencyConverter { - public double getConversion(String fromCurrencyCode, String toCurrencyCode, double amount) { - if (toCurrencyCode.equals("USD")) - return amount; - else if (toCurrencyCode.equals("EUR")) - return ((double)Math.round(amount * 0.7256 * 100)) /100; - return 0; - } - - public String getCurrencySymbol(String currencyCode) { - if (currencyCode.equals("USD")) - return "$"; - else if (currencyCode.equals("EUR")) - return "E"; //"€"; - return "?"; - } -} diff --git a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/FruitsCatalogImpl.java b/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/FruitsCatalogImpl.java deleted file mode 100644 index 377b3d7e59..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/FruitsCatalogImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -package services; - -import java.util.ArrayList; -import java.util.List; - -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; - -public class FruitsCatalogImpl implements Catalog { - - @Property - public String currencyCode = "USD"; - - @Reference - public CurrencyConverter currencyConverter; - - private List<Item> catalog = new ArrayList<Item>(); - - @Init - public void init() { - String currencySymbol = currencyConverter.getCurrencySymbol(currencyCode); - catalog.add(new Item("Apple", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 2.99))); - catalog.add(new Item("Orange", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 3.55))); - catalog.add(new Item("Pear", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 1.55))); - } - - public Item[] get() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.toArray(catalogArray); - return catalogArray; - } -} diff --git a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/Item.java b/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/Item.java deleted file mode 100644 index 27abd4f016..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/Item.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -package services; - - -public class Item { - private String name; - private String price; - - public Item() { - } - - public Item(String name, String price) { - this.name = name; - this.price = price; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - -} diff --git a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/ShoppingCartImpl.java b/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/ShoppingCartImpl.java deleted file mode 100644 index 9889921a96..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/ShoppingCartImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * 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. - */ - -package services; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.apache.tuscany.sca.data.collection.Entry; -import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -@Scope("COMPOSITE") -public class ShoppingCartImpl implements Cart, Total { - - private Map<String, Item> cart; - - @Init - public void init() { - cart = new HashMap<String, Item>(); - } - - public Entry<String, Item>[] getAll() { - Entry<String, Item>[] entries = new Entry[cart.size()]; - int i = 0; - for (Map.Entry<String, Item> e: cart.entrySet()) { - entries[i++] = new Entry<String, Item>(e.getKey(), e.getValue()); - } - return entries; - } - - public Item get(String key) throws NotFoundException { - Item item = cart.get(key); - if (item == null) { - throw new NotFoundException(key); - } else { - return item; - } - } - - public String post(String key, Item item) { - if (key == null) { - key ="cart-" + UUID.randomUUID().toString(); - } - cart.put(key, item); - return key; - } - - public void put(String key, Item item) throws NotFoundException { - if (!cart.containsKey(key)) { - throw new NotFoundException(key); - } - cart.put(key, item); - } - - public void delete(String key) throws NotFoundException { - if (key == null || key.equals("")) { - cart.clear(); - } else { - Item item = cart.remove(key); - if (item == null) - throw new NotFoundException(key); - } - } - - public Entry<String, Item>[] query(String queryString) { - List<Entry<String, Item>> entries = new ArrayList<Entry<String,Item>>(); - if (queryString.startsWith("name=")) { - String name = queryString.substring(5); - for (Map.Entry<String, Item> e: cart.entrySet()) { - Item item = e.getValue(); - if (item.getName().equals(name)) { - entries.add(new Entry<String, Item>(e.getKey(), e.getValue())); - } - } - } - return entries.toArray(new Entry[entries.size()]); - } - - public String getTotal() { - double total = 0; - String currencySymbol = ""; - if (!cart.isEmpty()) { - Item item = cart.values().iterator().next(); - currencySymbol = item.getPrice().substring(0, 1); - } - for (Item item : cart.values()) { - total += Double.valueOf(item.getPrice().substring(1)); - } - return currencySymbol + String.valueOf(total); - } -} diff --git a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/Total.java b/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/Total.java deleted file mode 100644 index 8f464e526f..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/src/main/java/services/Total.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Total { - - String getTotal(); - -} diff --git a/branches/sca-java-1.5/samples/store-dojo/src/main/resources/store.composite b/branches/sca-java-1.5/samples/store-dojo/src/main/resources/store.composite deleted file mode 100644 index 571678839d..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/src/main/resources/store.composite +++ /dev/null @@ -1,64 +0,0 @@ -<?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"> - - <component name="Store"> - <t:implementation.widget location="uiservices/store.html"/> - <service name="Widget"> - <t:binding.http uri="/store"/> - </service> - <reference name="catalog" target="Catalog"> - <t:binding.jsonrpc/> - </reference> - <reference name="shoppingCart" target="ShoppingCart/Cart"> - <t:binding.atom/> - </reference> - <reference name="shoppingTotal" target="ShoppingCart/Total"> - <t:binding.jsonrpc/> - </reference> - </component> - - <component name="Catalog"> - <implementation.java class="services.FruitsCatalogImpl"/> - <property name="currencyCode">USD</property> - <service name="Catalog"> - <t:binding.jsonrpc/> - </service> - <reference name="currencyConverter" target="CurrencyConverter"/> - </component> - - <component name="ShoppingCart"> - <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="CurrencyConverter"> - <implementation.java class="services.CurrencyConverterImpl"/> - </component> - -</composite> diff --git a/branches/sca-java-1.5/samples/store-dojo/src/main/resources/uiservices/store.html b/branches/sca-java-1.5/samples/store-dojo/src/main/resources/uiservices/store.html deleted file mode 100644 index 72d122af94..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/src/main/resources/uiservices/store.html +++ /dev/null @@ -1,168 +0,0 @@ -<!-- - * 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="/dojo/dojo.js"></script> - -<script type="text/javascript"> - dojo.require("dojo.rpc.JsonService"); - dojo.require("tuscany.AtomService"); -</script> -<script type="text/javascript" src="store.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" 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); - } - catch(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">'+ - 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 init() { - try { - catalog.get().addCallback(catalog_getResponse); - shoppingCart.get("").addCallback(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/">(feed)</a> - </form> - </div> -</body> -</html> diff --git a/branches/sca-java-1.5/samples/store-dojo/store.png b/branches/sca-java-1.5/samples/store-dojo/store.png Binary files differdeleted file mode 100644 index da413edeee..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/store.png +++ /dev/null diff --git a/branches/sca-java-1.5/samples/store-dojo/store.svg b/branches/sca-java-1.5/samples/store-dojo/store.svg deleted file mode 100644 index 74f8ecd36d..0000000000 --- a/branches/sca-java-1.5/samples/store-dojo/store.svg +++ /dev/null @@ -1,304 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- - * 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. ---> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1052.3622" - height="744.09448" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.45.1" - sodipodi:docbase="C:\simon\tuscany\java-head\sca\samples\store" - sodipodi:docname="store.svg" - version="1.0" - inkscape:output_extension="org.inkscape.output.svg.inkscape" - inkscape:export-filename="C:\simon\tuscany\java-head\sca\samples\store\store.png" - inkscape:export-xdpi="52.84" - inkscape:export-ydpi="52.84"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.4" - inkscape:cx="538.06165" - inkscape:cy="341.69129" - inkscape:document-units="px" - inkscape:current-layer="g2997" - inkscape:window-width="1466" - inkscape:window-height="831" - inkscape:window-x="117" - inkscape:window-y="80" /> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1"> - <g - id="g2997"> - <rect - rx="14.335117" - ry="17.743465" - y="197.1973" - x="447.35422" - height="419.39099" - width="464.23727" - id="rect2067" - style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:2.28840661;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <flowRoot - id="flowRoot2954" - xml:space="preserve" - transform="translate(189.90868,1.0101522)"><flowRegion - id="flowRegion2956"><rect - y="212.66591" - x="281.42856" - height="61.42857" - width="170" - id="rect2958" /></flowRegion><flowPara - id="flowPara2171">store</flowPara></flowRoot> <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.30182266;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2175" - width="118.21779" - height="111.27543" - x="491.60019" - y="247.75989" - rx="7.1507306" - ry="9.2311935" /> - <flowRoot - xml:space="preserve" - id="flowRoot2177" - transform="translate(223.8585,41.670449)"><flowRegion - id="flowRegion2179"><rect - id="rect2181" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2183">ufs</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 474.29877,279.45598 L 507.63381,279.45598 L 513.69472,292.58796 L 506.62366,304.7098 L 474.29877,304.7098 L 481.87492,292.58796 L 474.29877,279.45598 z " - id="path2187" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2191" - width="115.66247" - height="85.862968" - x="493.07068" - y="503.27759" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2193" - transform="translate(225.47992,297.33908)"><flowRegion - id="flowRegion2195"><rect - id="rect2197" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2199">ShoppingCart</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 475.92019,535.12461 L 509.25523,535.12461 L 515.31614,548.25659 L 508.24508,560.37843 L 475.92019,560.37843 L 483.49634,548.25659 L 475.92019,535.12461 z " - id="path2203" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2207" - width="115.66247" - height="85.862968" - x="761.44415" - y="391.31604" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2209" - transform="translate(487.8534,185.37751)"><flowRegion - id="flowRegion2211"><rect - id="rect2213" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2215">CurrencyConverter</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 744.29367,423.16304 L 777.62871,423.16304 L 783.68962,436.29502 L 776.61856,448.41686 L 744.29367,448.41686 L 751.86982,436.29502 L 744.29367,423.16304 z " - id="path2219" /> - <rect - style="opacity:1;fill:#0064ff;fill-opacity:1;stroke:#000000;stroke-width:0.9612025;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2223" - width="104.08451" - height="113.17588" - x="138.37151" - y="350.1156" - rx="0" - ry="0.048917599" /> - <path - style="fill:#1a73fe;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" - d="M 138.21429,462.66591 L 115.35714,479.80877 L 267.85714,479.80877 L 241.78571,463.02305 L 138.21429,462.66591 z " - id="path3197" /> - <rect - style="opacity:1;fill:#f1f4f8;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect3199" - width="92.5" - height="97.14286" - x="143.57143" - y="358.38019" - ry="3.6203461" - rx="3.9285715" /> - <image - y="366.6889" - x="156.24066" - id="image3323" - height="78.571434" - width="58.57143" - sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" - xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> - <image - y="270.52304" - x="526.42859" - id="image3342" - height="78.571434" - width="58.57143" - sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" - xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 242.85714,374.80877 C 245.71429,374.80877 345.71429,374.80877 345.71429,374.80877 L 345.71429,291.95162 L 481.42858,291.95162" - id="path3348" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 210.71429,406.95163 L 345,406.95163 L 345,437.66591 L 481.42857,437.66591" - id="path3350" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 210.71429,439.09448 L 325.71429,439.09448 L 325.71429,548.3802 L 482.85714,548.3802" - id="path3352" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 626.42857,436.23734 C 750,437.66591 752.14286,436.23734 752.14286,436.23734" - id="path3354" - sodipodi:nodetypes="cc" /> - <flowRoot - xml:space="preserve" - id="flowRoot3356" - transform="translate(-94.285714,25)"><flowRegion - id="flowRegion3358"><rect - id="rect3360" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3362">CurrenyCode</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3364" - transform="translate(-250.76562,-76.210859)"><flowRegion - id="flowRegion3366"><rect - id="rect3368" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3370">HTTP</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3372" - transform="translate(-273.62277,70.931998)"><flowRegion - id="flowRegion3374"><rect - id="rect3376" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3378">JSONRPC</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3380" - transform="translate(-243.62277,183.07485)"><flowRegion - id="flowRegion3382"><rect - id="rect3384" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3386">Atom</flowPara></flowRoot> </g> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2988" - width="115.66247" - height="85.862968" - x="491.56897" - y="392.70135" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2966" - transform="translate(223.97819,186.76283)"><flowRegion - id="flowRegion2968"><rect - id="rect2970" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2972">Catalog</flowPara></flowRoot> <rect - style="opacity:1;fill:#fff62c;fill-opacity:1;stroke:#060000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect3006" - width="21.718224" - height="20.708065" - x="537.53094" - y="377.04398" - rx="10.859112" - ry="0" /> - <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 474.41846,424.54836 L 507.7535,424.54836 L 513.81441,437.68034 L 506.74335,449.80218 L 474.41846,449.80218 L 481.99461,437.68034 L 474.41846,424.54836 z " - id="path3017" /> - <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 587.6709,422.71008 L 621.00594,422.71008 L 627.06685,435.84206 L 619.99579,447.9639 L 587.6709,447.9639 L 595.24705,435.84206 L 587.6709,422.71008 z " - id="path3019" /> - </g> -</svg> diff --git a/branches/sca-java-1.5/samples/store-secure/README b/branches/sca-java-1.5/samples/store-secure/README deleted file mode 100644 index 46e71bf51e..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/README +++ /dev/null @@ -1,28 +0,0 @@ -Store Sample -====================================== - -This is a sample store scenario that is used as a getting started guide -for Tuscany SCA. For detailed information, please see: - -http://tuscany.apache.org/getting-started-with-tuscany.html - -or - -http://tuscany.apache.org/getting-started-with-tuscany-using-tuscany-eclipse-plugin.html - - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built using Ant as follows: - -cd store -ant compile - -and then, to run: - -ant run - -Once the store application is running use your browser to visit the following -URL: - -http://localhost:8080/store/ diff --git a/branches/sca-java-1.5/samples/store-secure/pom.xml b/branches/sca-java-1.5/samples/store-secure/pom.xml deleted file mode 100644 index 1bb52289af..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/pom.xml +++ /dev/null @@ -1,112 +0,0 @@ -<?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-sca</artifactId> - <version>1.5-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>sample-store-secure</artifactId> - <name>Apache Tuscany SCA Sample Getting Started Online Store</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-host-embedded</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-policy-security-http</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-data-api</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-widget-runtime-tuscany</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-atom-abdera</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-http-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-tomcat</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - </build> - -</project> diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/java/launch/Launch.java b/branches/sca-java-1.5/samples/store-secure/src/main/java/launch/Launch.java deleted file mode 100644 index 801697abea..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/java/launch/Launch.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -package launch; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class Launch { - public static void main(String[] args) throws Exception { - System.out.println("Starting ..."); - SCADomain scaDomain = SCADomain.newInstance("store.composite"); - System.out.println("store.composite ready for big business !!!"); - System.in.read(); - System.out.println("Stopping ..."); - scaDomain.close(); - System.out.println(); - } -} diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/java/launch/LaunchProtected.java b/branches/sca-java-1.5/samples/store-secure/src/main/java/launch/LaunchProtected.java deleted file mode 100644 index ffdf9db47b..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/java/launch/LaunchProtected.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -package launch; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class LaunchProtected { - public static void main(String[] args) throws Exception { - System.out.println("Starting ..."); - SCADomain scaDomain = SCADomain.newInstance("store-protected.composite"); - System.out.println("store.composite ready for big business !!!"); - System.in.read(); - System.out.println("Stopping ..."); - scaDomain.close(); - System.out.println(); - } -} diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/java/launch/LaunchSSL.java b/branches/sca-java-1.5/samples/store-secure/src/main/java/launch/LaunchSSL.java deleted file mode 100644 index a3703869ac..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/java/launch/LaunchSSL.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -package launch; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class LaunchSSL { - public static void main(String[] args) throws Exception { - System.out.println("Starting ..."); - SCADomain scaDomain = SCADomain.newInstance("store-ssl.composite"); - System.out.println("store.composite ready for big business !!!"); - System.in.read(); - System.out.println("Stopping ..."); - scaDomain.close(); - System.out.println(); - } -} diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/Cart.java b/branches/sca-java-1.5/samples/store-secure/src/main/java/services/Cart.java deleted file mode 100644 index 9e6226d963..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/Cart.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.apache.tuscany.sca.data.collection.Collection; -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Cart extends Collection<String, Item> { - -} diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/Catalog.java b/branches/sca-java-1.5/samples/store-secure/src/main/java/services/Catalog.java deleted file mode 100644 index 2c3b19f579..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/Catalog.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Catalog { - Item[] get(); -} diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/CurrencyConverter.java b/branches/sca-java-1.5/samples/store-secure/src/main/java/services/CurrencyConverter.java deleted file mode 100644 index e104a0423a..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/CurrencyConverter.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface CurrencyConverter { - public double getConversion(String fromCurrenycCode, String toCurrencyCode, double amount); - - public String getCurrencySymbol(String currencyCode); -} diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/CurrencyConverterImpl.java b/branches/sca-java-1.5/samples/store-secure/src/main/java/services/CurrencyConverterImpl.java deleted file mode 100644 index c354aed447..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/CurrencyConverterImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ - -package services; - -public class CurrencyConverterImpl implements CurrencyConverter { - public double getConversion(String fromCurrencyCode, String toCurrencyCode, double amount) { - if (toCurrencyCode.equals("USD")) - return amount; - else if (toCurrencyCode.equals("EUR")) - return ((double)Math.round(amount * 0.7256 * 100)) /100; - return 0; - } - - public String getCurrencySymbol(String currencyCode) { - if (currencyCode.equals("USD")) - return "$"; - else if (currencyCode.equals("EUR")) - return "E"; //"€"; - return "?"; - } -} diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/FruitsCatalogImpl.java b/branches/sca-java-1.5/samples/store-secure/src/main/java/services/FruitsCatalogImpl.java deleted file mode 100644 index 377b3d7e59..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/FruitsCatalogImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -package services; - -import java.util.ArrayList; -import java.util.List; - -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; - -public class FruitsCatalogImpl implements Catalog { - - @Property - public String currencyCode = "USD"; - - @Reference - public CurrencyConverter currencyConverter; - - private List<Item> catalog = new ArrayList<Item>(); - - @Init - public void init() { - String currencySymbol = currencyConverter.getCurrencySymbol(currencyCode); - catalog.add(new Item("Apple", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 2.99))); - catalog.add(new Item("Orange", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 3.55))); - catalog.add(new Item("Pear", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 1.55))); - } - - public Item[] get() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.toArray(catalogArray); - return catalogArray; - } -} diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/Item.java b/branches/sca-java-1.5/samples/store-secure/src/main/java/services/Item.java deleted file mode 100644 index 27abd4f016..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/Item.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -package services; - - -public class Item { - private String name; - private String price; - - public Item() { - } - - public Item(String name, String price) { - this.name = name; - this.price = price; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - -} diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/ShoppingCartImpl.java b/branches/sca-java-1.5/samples/store-secure/src/main/java/services/ShoppingCartImpl.java deleted file mode 100644 index 9889921a96..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/ShoppingCartImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * 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. - */ - -package services; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.apache.tuscany.sca.data.collection.Entry; -import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -@Scope("COMPOSITE") -public class ShoppingCartImpl implements Cart, Total { - - private Map<String, Item> cart; - - @Init - public void init() { - cart = new HashMap<String, Item>(); - } - - public Entry<String, Item>[] getAll() { - Entry<String, Item>[] entries = new Entry[cart.size()]; - int i = 0; - for (Map.Entry<String, Item> e: cart.entrySet()) { - entries[i++] = new Entry<String, Item>(e.getKey(), e.getValue()); - } - return entries; - } - - public Item get(String key) throws NotFoundException { - Item item = cart.get(key); - if (item == null) { - throw new NotFoundException(key); - } else { - return item; - } - } - - public String post(String key, Item item) { - if (key == null) { - key ="cart-" + UUID.randomUUID().toString(); - } - cart.put(key, item); - return key; - } - - public void put(String key, Item item) throws NotFoundException { - if (!cart.containsKey(key)) { - throw new NotFoundException(key); - } - cart.put(key, item); - } - - public void delete(String key) throws NotFoundException { - if (key == null || key.equals("")) { - cart.clear(); - } else { - Item item = cart.remove(key); - if (item == null) - throw new NotFoundException(key); - } - } - - public Entry<String, Item>[] query(String queryString) { - List<Entry<String, Item>> entries = new ArrayList<Entry<String,Item>>(); - if (queryString.startsWith("name=")) { - String name = queryString.substring(5); - for (Map.Entry<String, Item> e: cart.entrySet()) { - Item item = e.getValue(); - if (item.getName().equals(name)) { - entries.add(new Entry<String, Item>(e.getKey(), e.getValue())); - } - } - } - return entries.toArray(new Entry[entries.size()]); - } - - public String getTotal() { - double total = 0; - String currencySymbol = ""; - if (!cart.isEmpty()) { - Item item = cart.values().iterator().next(); - currencySymbol = item.getPrice().substring(0, 1); - } - for (Item item : cart.values()) { - total += Double.valueOf(item.getPrice().substring(1)); - } - return currencySymbol + String.valueOf(total); - } -} diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/Total.java b/branches/sca-java-1.5/samples/store-secure/src/main/java/services/Total.java deleted file mode 100644 index 8f464e526f..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/java/services/Total.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Total { - - String getTotal(); - -} diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/resources/definitions.xml b/branches/sca-java-1.5/samples/store-secure/src/main/resources/definitions.xml deleted file mode 100644 index 140c5fd1c5..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/resources/definitions.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<!-- - * 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. ---> -<sca:definitions xmlns="http://www.osoa.org/xmlns/sca/1.0" - targetNamespace="http://www.osoa.org/xmlns/sca/1.0" - xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" - xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" - xmlns:store="http://store"> - - - <sca:policySet name="widgetBindingAuthenticationPolicySet" - provides="sca:authentication" - appliesTo="tuscany:binding.http"> - <tuscany:authenticationConfiguration> - <tuscany:user username="admin" password="tuscany" roles="admin"/> - <tuscany:user username="user1" password="tuscany" roles="user"/> - <tuscany:user username="user2" password="tuscany" roles="user"/> - </tuscany:authenticationConfiguration> - </sca:policySet> - - <sca:policySet name="widgetConfidentialityConfigurationPolicySet" - provides="sca:confidentiality" - appliesTo="tuscany:binding.http"> - <tuscany:confidentiality> - <tuscany:keyStore type="JKS" file="target/classes/tuscany.keyStore" password="apache"/> - <tuscany:trustStore type="" file="" password=""/> - </tuscany:confidentiality> - </sca:policySet> - - - - - - </sca:definitions> diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/resources/store-protected.composite b/branches/sca-java-1.5/samples/store-secure/src/main/resources/store-protected.composite deleted file mode 100644 index 5619afd8d9..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/resources/store-protected.composite +++ /dev/null @@ -1,64 +0,0 @@ -<?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"> - - <component name="Store"> - <t:implementation.widget location="uiservices/store.html"/> - <service name="Widget"> - <t:binding.http uri="/store" requires="authentication"/> - </service> - <reference name="catalog" target="Catalog"> - <t:binding.jsonrpc/> - </reference> - <reference name="shoppingCart" target="ShoppingCart/Cart"> - <t:binding.atom/> - </reference> - <reference name="shoppingTotal" target="ShoppingCart/Total"> - <t:binding.jsonrpc/> - </reference> - </component> - - <component name="Catalog"> - <implementation.java class="services.FruitsCatalogImpl"/> - <property name="currencyCode">USD</property> - <service name="Catalog"> - <t:binding.jsonrpc/> - </service> - <reference name="currencyConverter" target="CurrencyConverter"/> - </component> - - <component name="ShoppingCart"> - <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="CurrencyConverter"> - <implementation.java class="services.CurrencyConverterImpl"/> - </component> - -</composite> diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/resources/store-ssl.composite b/branches/sca-java-1.5/samples/store-secure/src/main/resources/store-ssl.composite deleted file mode 100644 index 79ef3f31a3..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/resources/store-ssl.composite +++ /dev/null @@ -1,64 +0,0 @@ -<?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"> - - <component name="Store"> - <t:implementation.widget location="uiservices/store.html"/> - <service name="Widget"> - <t:binding.http uri="/store" requires="confidentiality"/> - </service> - <reference name="catalog" target="Catalog"> - <t:binding.jsonrpc/> - </reference> - <reference name="shoppingCart" target="ShoppingCart/Cart"> - <t:binding.atom/> - </reference> - <reference name="shoppingTotal" target="ShoppingCart/Total"> - <t:binding.jsonrpc/> - </reference> - </component> - - <component name="Catalog"> - <implementation.java class="services.FruitsCatalogImpl"/> - <property name="currencyCode">USD</property> - <service name="Catalog"> - <t:binding.jsonrpc/> - </service> - <reference name="currencyConverter" target="CurrencyConverter"/> - </component> - - <component name="ShoppingCart"> - <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="CurrencyConverter"> - <implementation.java class="services.CurrencyConverterImpl"/> - </component> - -</composite> diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/resources/store.composite b/branches/sca-java-1.5/samples/store-secure/src/main/resources/store.composite deleted file mode 100644 index 8aef45c53c..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/resources/store.composite +++ /dev/null @@ -1,64 +0,0 @@ -<?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"> - - <component name="Store"> - <t:implementation.widget location="uiservices/store.html"/> - <service name="Widget" requires="authentication"> - <t:binding.http uri="/store"/> - </service> - <reference name="catalog" target="Catalog"> - <t:binding.jsonrpc/> - </reference> - <reference name="shoppingCart" target="ShoppingCart/Cart"> - <t:binding.atom/> - </reference> - <reference name="shoppingTotal" target="ShoppingCart/Total"> - <t:binding.jsonrpc/> - </reference> - </component> - - <component name="Catalog"> - <implementation.java class="services.FruitsCatalogImpl"/> - <property name="currencyCode">USD</property> - <service name="Catalog"> - <t:binding.jsonrpc/> - </service> - <reference name="currencyConverter" target="CurrencyConverter"/> - </component> - - <component name="ShoppingCart"> - <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="CurrencyConverter"> - <implementation.java class="services.CurrencyConverterImpl"/> - </component> - -</composite> diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/resources/tuscany.keyStore b/branches/sca-java-1.5/samples/store-secure/src/main/resources/tuscany.keyStore Binary files differdeleted file mode 100644 index 7ea23f7ff4..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/resources/tuscany.keyStore +++ /dev/null diff --git a/branches/sca-java-1.5/samples/store-secure/src/main/resources/uiservices/store.html b/branches/sca-java-1.5/samples/store-secure/src/main/resources/uiservices/store.html deleted file mode 100644 index ba004e02ac..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/src/main/resources/uiservices/store.html +++ /dev/null @@ -1,162 +0,0 @@ -<!-- - * 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="store.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" 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); - } - catch(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">'+ - 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 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/">(feed)</a> - </form> - </div> -</body> -</html> diff --git a/branches/sca-java-1.5/samples/store-secure/store.png b/branches/sca-java-1.5/samples/store-secure/store.png Binary files differdeleted file mode 100644 index da413edeee..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/store.png +++ /dev/null diff --git a/branches/sca-java-1.5/samples/store-secure/store.svg b/branches/sca-java-1.5/samples/store-secure/store.svg deleted file mode 100644 index 74f8ecd36d..0000000000 --- a/branches/sca-java-1.5/samples/store-secure/store.svg +++ /dev/null @@ -1,304 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- - * 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. ---> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1052.3622" - height="744.09448" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.45.1" - sodipodi:docbase="C:\simon\tuscany\java-head\sca\samples\store" - sodipodi:docname="store.svg" - version="1.0" - inkscape:output_extension="org.inkscape.output.svg.inkscape" - inkscape:export-filename="C:\simon\tuscany\java-head\sca\samples\store\store.png" - inkscape:export-xdpi="52.84" - inkscape:export-ydpi="52.84"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.4" - inkscape:cx="538.06165" - inkscape:cy="341.69129" - inkscape:document-units="px" - inkscape:current-layer="g2997" - inkscape:window-width="1466" - inkscape:window-height="831" - inkscape:window-x="117" - inkscape:window-y="80" /> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1"> - <g - id="g2997"> - <rect - rx="14.335117" - ry="17.743465" - y="197.1973" - x="447.35422" - height="419.39099" - width="464.23727" - id="rect2067" - style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:2.28840661;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <flowRoot - id="flowRoot2954" - xml:space="preserve" - transform="translate(189.90868,1.0101522)"><flowRegion - id="flowRegion2956"><rect - y="212.66591" - x="281.42856" - height="61.42857" - width="170" - id="rect2958" /></flowRegion><flowPara - id="flowPara2171">store</flowPara></flowRoot> <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.30182266;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2175" - width="118.21779" - height="111.27543" - x="491.60019" - y="247.75989" - rx="7.1507306" - ry="9.2311935" /> - <flowRoot - xml:space="preserve" - id="flowRoot2177" - transform="translate(223.8585,41.670449)"><flowRegion - id="flowRegion2179"><rect - id="rect2181" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2183">ufs</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 474.29877,279.45598 L 507.63381,279.45598 L 513.69472,292.58796 L 506.62366,304.7098 L 474.29877,304.7098 L 481.87492,292.58796 L 474.29877,279.45598 z " - id="path2187" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2191" - width="115.66247" - height="85.862968" - x="493.07068" - y="503.27759" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2193" - transform="translate(225.47992,297.33908)"><flowRegion - id="flowRegion2195"><rect - id="rect2197" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2199">ShoppingCart</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 475.92019,535.12461 L 509.25523,535.12461 L 515.31614,548.25659 L 508.24508,560.37843 L 475.92019,560.37843 L 483.49634,548.25659 L 475.92019,535.12461 z " - id="path2203" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2207" - width="115.66247" - height="85.862968" - x="761.44415" - y="391.31604" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2209" - transform="translate(487.8534,185.37751)"><flowRegion - id="flowRegion2211"><rect - id="rect2213" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2215">CurrencyConverter</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 744.29367,423.16304 L 777.62871,423.16304 L 783.68962,436.29502 L 776.61856,448.41686 L 744.29367,448.41686 L 751.86982,436.29502 L 744.29367,423.16304 z " - id="path2219" /> - <rect - style="opacity:1;fill:#0064ff;fill-opacity:1;stroke:#000000;stroke-width:0.9612025;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2223" - width="104.08451" - height="113.17588" - x="138.37151" - y="350.1156" - rx="0" - ry="0.048917599" /> - <path - style="fill:#1a73fe;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" - d="M 138.21429,462.66591 L 115.35714,479.80877 L 267.85714,479.80877 L 241.78571,463.02305 L 138.21429,462.66591 z " - id="path3197" /> - <rect - style="opacity:1;fill:#f1f4f8;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect3199" - width="92.5" - height="97.14286" - x="143.57143" - y="358.38019" - ry="3.6203461" - rx="3.9285715" /> - <image - y="366.6889" - x="156.24066" - id="image3323" - height="78.571434" - width="58.57143" - sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" - xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> - <image - y="270.52304" - x="526.42859" - id="image3342" - height="78.571434" - width="58.57143" - sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" - xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 242.85714,374.80877 C 245.71429,374.80877 345.71429,374.80877 345.71429,374.80877 L 345.71429,291.95162 L 481.42858,291.95162" - id="path3348" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 210.71429,406.95163 L 345,406.95163 L 345,437.66591 L 481.42857,437.66591" - id="path3350" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 210.71429,439.09448 L 325.71429,439.09448 L 325.71429,548.3802 L 482.85714,548.3802" - id="path3352" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 626.42857,436.23734 C 750,437.66591 752.14286,436.23734 752.14286,436.23734" - id="path3354" - sodipodi:nodetypes="cc" /> - <flowRoot - xml:space="preserve" - id="flowRoot3356" - transform="translate(-94.285714,25)"><flowRegion - id="flowRegion3358"><rect - id="rect3360" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3362">CurrenyCode</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3364" - transform="translate(-250.76562,-76.210859)"><flowRegion - id="flowRegion3366"><rect - id="rect3368" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3370">HTTP</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3372" - transform="translate(-273.62277,70.931998)"><flowRegion - id="flowRegion3374"><rect - id="rect3376" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3378">JSONRPC</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3380" - transform="translate(-243.62277,183.07485)"><flowRegion - id="flowRegion3382"><rect - id="rect3384" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3386">Atom</flowPara></flowRoot> </g> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2988" - width="115.66247" - height="85.862968" - x="491.56897" - y="392.70135" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2966" - transform="translate(223.97819,186.76283)"><flowRegion - id="flowRegion2968"><rect - id="rect2970" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2972">Catalog</flowPara></flowRoot> <rect - style="opacity:1;fill:#fff62c;fill-opacity:1;stroke:#060000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect3006" - width="21.718224" - height="20.708065" - x="537.53094" - y="377.04398" - rx="10.859112" - ry="0" /> - <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 474.41846,424.54836 L 507.7535,424.54836 L 513.81441,437.68034 L 506.74335,449.80218 L 474.41846,449.80218 L 481.99461,437.68034 L 474.41846,424.54836 z " - id="path3017" /> - <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 587.6709,422.71008 L 621.00594,422.71008 L 627.06685,435.84206 L 619.99579,447.9639 L 587.6709,447.9639 L 595.24705,435.84206 L 587.6709,422.71008 z " - id="path3019" /> - </g> -</svg> diff --git a/branches/sca-java-1.5/samples/store-webapp/README b/branches/sca-java-1.5/samples/store-webapp/README deleted file mode 100644 index 46e71bf51e..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/README +++ /dev/null @@ -1,28 +0,0 @@ -Store Sample -====================================== - -This is a sample store scenario that is used as a getting started guide -for Tuscany SCA. For detailed information, please see: - -http://tuscany.apache.org/getting-started-with-tuscany.html - -or - -http://tuscany.apache.org/getting-started-with-tuscany-using-tuscany-eclipse-plugin.html - - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built using Ant as follows: - -cd store -ant compile - -and then, to run: - -ant run - -Once the store application is running use your browser to visit the following -URL: - -http://localhost:8080/store/ diff --git a/branches/sca-java-1.5/samples/store-webapp/pom.xml b/branches/sca-java-1.5/samples/store-webapp/pom.xml deleted file mode 100644 index 1d00e35edd..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/pom.xml +++ /dev/null @@ -1,108 +0,0 @@ -<?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-sca</artifactId> - <version>1.5-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>sample-store-webapp</artifactId> - <packaging>war</packaging> - <name>Apache Tuscany SCA Sample Getting Started Online Store as WebApp</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-host-webapp</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-data-api</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-widget-runtime-tuscany</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-atom-abdera</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-atom-js</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jsonrpc-js</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - </build> - -</project> diff --git a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/Cart.java b/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/Cart.java deleted file mode 100644 index 9e6226d963..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/Cart.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.apache.tuscany.sca.data.collection.Collection; -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Cart extends Collection<String, Item> { - -} diff --git a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/Catalog.java b/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/Catalog.java deleted file mode 100644 index 2c3b19f579..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/Catalog.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Catalog { - Item[] get(); -} diff --git a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/CurrencyConverter.java b/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/CurrencyConverter.java deleted file mode 100644 index e104a0423a..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/CurrencyConverter.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface CurrencyConverter { - public double getConversion(String fromCurrenycCode, String toCurrencyCode, double amount); - - public String getCurrencySymbol(String currencyCode); -} diff --git a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/CurrencyConverterImpl.java b/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/CurrencyConverterImpl.java deleted file mode 100644 index c354aed447..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/CurrencyConverterImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ - -package services; - -public class CurrencyConverterImpl implements CurrencyConverter { - public double getConversion(String fromCurrencyCode, String toCurrencyCode, double amount) { - if (toCurrencyCode.equals("USD")) - return amount; - else if (toCurrencyCode.equals("EUR")) - return ((double)Math.round(amount * 0.7256 * 100)) /100; - return 0; - } - - public String getCurrencySymbol(String currencyCode) { - if (currencyCode.equals("USD")) - return "$"; - else if (currencyCode.equals("EUR")) - return "E"; //"€"; - return "?"; - } -} diff --git a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/FruitsCatalogImpl.java b/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/FruitsCatalogImpl.java deleted file mode 100644 index 377b3d7e59..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/FruitsCatalogImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -package services; - -import java.util.ArrayList; -import java.util.List; - -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; - -public class FruitsCatalogImpl implements Catalog { - - @Property - public String currencyCode = "USD"; - - @Reference - public CurrencyConverter currencyConverter; - - private List<Item> catalog = new ArrayList<Item>(); - - @Init - public void init() { - String currencySymbol = currencyConverter.getCurrencySymbol(currencyCode); - catalog.add(new Item("Apple", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 2.99))); - catalog.add(new Item("Orange", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 3.55))); - catalog.add(new Item("Pear", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 1.55))); - } - - public Item[] get() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.toArray(catalogArray); - return catalogArray; - } -} diff --git a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/Item.java b/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/Item.java deleted file mode 100644 index 27abd4f016..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/Item.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -package services; - - -public class Item { - private String name; - private String price; - - public Item() { - } - - public Item(String name, String price) { - this.name = name; - this.price = price; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - -} diff --git a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/ShoppingCartImpl.java b/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/ShoppingCartImpl.java deleted file mode 100644 index 9889921a96..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/ShoppingCartImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * 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. - */ - -package services; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.apache.tuscany.sca.data.collection.Entry; -import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -@Scope("COMPOSITE") -public class ShoppingCartImpl implements Cart, Total { - - private Map<String, Item> cart; - - @Init - public void init() { - cart = new HashMap<String, Item>(); - } - - public Entry<String, Item>[] getAll() { - Entry<String, Item>[] entries = new Entry[cart.size()]; - int i = 0; - for (Map.Entry<String, Item> e: cart.entrySet()) { - entries[i++] = new Entry<String, Item>(e.getKey(), e.getValue()); - } - return entries; - } - - public Item get(String key) throws NotFoundException { - Item item = cart.get(key); - if (item == null) { - throw new NotFoundException(key); - } else { - return item; - } - } - - public String post(String key, Item item) { - if (key == null) { - key ="cart-" + UUID.randomUUID().toString(); - } - cart.put(key, item); - return key; - } - - public void put(String key, Item item) throws NotFoundException { - if (!cart.containsKey(key)) { - throw new NotFoundException(key); - } - cart.put(key, item); - } - - public void delete(String key) throws NotFoundException { - if (key == null || key.equals("")) { - cart.clear(); - } else { - Item item = cart.remove(key); - if (item == null) - throw new NotFoundException(key); - } - } - - public Entry<String, Item>[] query(String queryString) { - List<Entry<String, Item>> entries = new ArrayList<Entry<String,Item>>(); - if (queryString.startsWith("name=")) { - String name = queryString.substring(5); - for (Map.Entry<String, Item> e: cart.entrySet()) { - Item item = e.getValue(); - if (item.getName().equals(name)) { - entries.add(new Entry<String, Item>(e.getKey(), e.getValue())); - } - } - } - return entries.toArray(new Entry[entries.size()]); - } - - public String getTotal() { - double total = 0; - String currencySymbol = ""; - if (!cart.isEmpty()) { - Item item = cart.values().iterator().next(); - currencySymbol = item.getPrice().substring(0, 1); - } - for (Item item : cart.values()) { - total += Double.valueOf(item.getPrice().substring(1)); - } - return currencySymbol + String.valueOf(total); - } -} diff --git a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/Total.java b/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/Total.java deleted file mode 100644 index 8f464e526f..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/src/main/java/services/Total.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Total { - - String getTotal(); - -} diff --git a/branches/sca-java-1.5/samples/store-webapp/src/main/resources/store.composite b/branches/sca-java-1.5/samples/store-webapp/src/main/resources/store.composite deleted file mode 100644 index 9c25783c0f..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/src/main/resources/store.composite +++ /dev/null @@ -1,61 +0,0 @@ -<?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"> - - <component name="Store"> - <t:implementation.widget location="store.html"/> - <reference name="catalog" target="Catalog"> - <t:binding.jsonrpc uri="http://localhost:8080/sample-store-webapp/Catalog"/> - </reference> - <reference name="shoppingCart" target="ShoppingCart/Cart"> - <t:binding.atom uri="http://localhost:8080/sample-store-webapp/ShoppingCart/Cart"/> - </reference> - <reference name="shoppingTotal" target="ShoppingCart/Total"> - <t:binding.jsonrpc uri="http://localhost:8080/sample-store-webapp/Total"/> - </reference> - </component> - - <component name="Catalog"> - <implementation.java class="services.FruitsCatalogImpl"/> - <property name="currencyCode">USD</property> - <service name="Catalog"> - <t:binding.jsonrpc uri="http://localhost:8080/sample-store-webapp/Catalog"/> - </service> - <reference name="currencyConverter" target="CurrencyConverter"/> - </component> - - <component name="ShoppingCart"> - <implementation.java class="services.ShoppingCartImpl"/> - <service name="Cart"> - <t:binding.atom uri="http://localhost:8080/sample-store-webapp/ShoppingCart/Cart"/> - </service> - <service name="Total"> - <t:binding.jsonrpc uri="http://localhost:8080/sample-store-webapp/Total"/> - </service> - </component> - - <component name="CurrencyConverter"> - <implementation.java class="services.CurrencyConverterImpl"/> - </component> - -</composite> diff --git a/branches/sca-java-1.5/samples/store-webapp/src/main/webapp/META-INF/sca-contribution.xml b/branches/sca-java-1.5/samples/store-webapp/src/main/webapp/META-INF/sca-contribution.xml deleted file mode 100644 index 8d744c2834..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/src/main/webapp/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?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:store="http://store">
- <deployable composite="store:store"/>
-</contribution>
\ No newline at end of file diff --git a/branches/sca-java-1.5/samples/store-webapp/src/main/webapp/WEB-INF/geronimo-web.xml b/branches/sca-java-1.5/samples/store-webapp/src/main/webapp/WEB-INF/geronimo-web.xml deleted file mode 100644 index b77ea923d8..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/src/main/webapp/WEB-INF/geronimo-web.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<web:web-app - xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0" - xmlns:client="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0" - xmlns:conn="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2" - xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" - xmlns:lc="http://geronimo.apache.org/xml/ns/loginconfig-2.0" - xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2" - xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2" - xmlns:pers="http://java.sun.com/xml/ns/persistence" - xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1" - xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0" - xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"> - <dep:environment> - <dep:moduleId> - <dep:groupId>org.apache.tuscany</dep:groupId> - <dep:artifactId>sample-store-secure-webapp</dep:artifactId> - <dep:version>1.0</dep:version> - <dep:type>car</dep:type> - </dep:moduleId> - <!-- TUSCANY-2622 --> - <dep:hidden-classes> - <dep:filter>org.apache.axiom</dep:filter> - <dep:filter>org.apache.axis2</dep:filter> - <dep:filter>org.apache.commons</dep:filter> - <dep:filter>org.jdom</dep:filter> - </dep:hidden-classes> - </dep:environment> - <web:context-root>/sample-store-secure-webapp</web:context-root> -</web:web-app> diff --git a/branches/sca-java-1.5/samples/store-webapp/src/main/webapp/WEB-INF/web.xml b/branches/sca-java-1.5/samples/store-webapp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index cfe63f359e..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> - <display-name>sample-store-secure-webapp</display-name> - - <filter> - <filter-name>tuscany</filter-name> - <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class> - </filter> - - <filter-mapping> - <filter-name>tuscany</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - - <welcome-file-list id="WelcomeFileList"> - <welcome-file>store.html</welcome-file> - </welcome-file-list> -</web-app>
\ No newline at end of file diff --git a/branches/sca-java-1.5/samples/store-webapp/src/main/webapp/store.html b/branches/sca-java-1.5/samples/store-webapp/src/main/webapp/store.html deleted file mode 100644 index e77389c552..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/src/main/webapp/store.html +++ /dev/null @@ -1,162 +0,0 @@ -<!--
- * 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="store.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" 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);
- }
- catch(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">'+
- 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 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/">(feed)</a>
- </form>
- </div>
-</body>
-</html>
diff --git a/branches/sca-java-1.5/samples/store-webapp/store.png b/branches/sca-java-1.5/samples/store-webapp/store.png Binary files differdeleted file mode 100644 index da413edeee..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/store.png +++ /dev/null diff --git a/branches/sca-java-1.5/samples/store-webapp/store.svg b/branches/sca-java-1.5/samples/store-webapp/store.svg deleted file mode 100644 index 74f8ecd36d..0000000000 --- a/branches/sca-java-1.5/samples/store-webapp/store.svg +++ /dev/null @@ -1,304 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- - * 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. ---> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1052.3622" - height="744.09448" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.45.1" - sodipodi:docbase="C:\simon\tuscany\java-head\sca\samples\store" - sodipodi:docname="store.svg" - version="1.0" - inkscape:output_extension="org.inkscape.output.svg.inkscape" - inkscape:export-filename="C:\simon\tuscany\java-head\sca\samples\store\store.png" - inkscape:export-xdpi="52.84" - inkscape:export-ydpi="52.84"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.4" - inkscape:cx="538.06165" - inkscape:cy="341.69129" - inkscape:document-units="px" - inkscape:current-layer="g2997" - inkscape:window-width="1466" - inkscape:window-height="831" - inkscape:window-x="117" - inkscape:window-y="80" /> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1"> - <g - id="g2997"> - <rect - rx="14.335117" - ry="17.743465" - y="197.1973" - x="447.35422" - height="419.39099" - width="464.23727" - id="rect2067" - style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:2.28840661;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <flowRoot - id="flowRoot2954" - xml:space="preserve" - transform="translate(189.90868,1.0101522)"><flowRegion - id="flowRegion2956"><rect - y="212.66591" - x="281.42856" - height="61.42857" - width="170" - id="rect2958" /></flowRegion><flowPara - id="flowPara2171">store</flowPara></flowRoot> <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.30182266;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2175" - width="118.21779" - height="111.27543" - x="491.60019" - y="247.75989" - rx="7.1507306" - ry="9.2311935" /> - <flowRoot - xml:space="preserve" - id="flowRoot2177" - transform="translate(223.8585,41.670449)"><flowRegion - id="flowRegion2179"><rect - id="rect2181" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2183">ufs</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 474.29877,279.45598 L 507.63381,279.45598 L 513.69472,292.58796 L 506.62366,304.7098 L 474.29877,304.7098 L 481.87492,292.58796 L 474.29877,279.45598 z " - id="path2187" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2191" - width="115.66247" - height="85.862968" - x="493.07068" - y="503.27759" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2193" - transform="translate(225.47992,297.33908)"><flowRegion - id="flowRegion2195"><rect - id="rect2197" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2199">ShoppingCart</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 475.92019,535.12461 L 509.25523,535.12461 L 515.31614,548.25659 L 508.24508,560.37843 L 475.92019,560.37843 L 483.49634,548.25659 L 475.92019,535.12461 z " - id="path2203" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2207" - width="115.66247" - height="85.862968" - x="761.44415" - y="391.31604" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2209" - transform="translate(487.8534,185.37751)"><flowRegion - id="flowRegion2211"><rect - id="rect2213" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2215">CurrencyConverter</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 744.29367,423.16304 L 777.62871,423.16304 L 783.68962,436.29502 L 776.61856,448.41686 L 744.29367,448.41686 L 751.86982,436.29502 L 744.29367,423.16304 z " - id="path2219" /> - <rect - style="opacity:1;fill:#0064ff;fill-opacity:1;stroke:#000000;stroke-width:0.9612025;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2223" - width="104.08451" - height="113.17588" - x="138.37151" - y="350.1156" - rx="0" - ry="0.048917599" /> - <path - style="fill:#1a73fe;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" - d="M 138.21429,462.66591 L 115.35714,479.80877 L 267.85714,479.80877 L 241.78571,463.02305 L 138.21429,462.66591 z " - id="path3197" /> - <rect - style="opacity:1;fill:#f1f4f8;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect3199" - width="92.5" - height="97.14286" - x="143.57143" - y="358.38019" - ry="3.6203461" - rx="3.9285715" /> - <image - y="366.6889" - x="156.24066" - id="image3323" - height="78.571434" - width="58.57143" - sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" - xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> - <image - y="270.52304" - x="526.42859" - id="image3342" - height="78.571434" - width="58.57143" - sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" - xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 242.85714,374.80877 C 245.71429,374.80877 345.71429,374.80877 345.71429,374.80877 L 345.71429,291.95162 L 481.42858,291.95162" - id="path3348" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 210.71429,406.95163 L 345,406.95163 L 345,437.66591 L 481.42857,437.66591" - id="path3350" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 210.71429,439.09448 L 325.71429,439.09448 L 325.71429,548.3802 L 482.85714,548.3802" - id="path3352" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 626.42857,436.23734 C 750,437.66591 752.14286,436.23734 752.14286,436.23734" - id="path3354" - sodipodi:nodetypes="cc" /> - <flowRoot - xml:space="preserve" - id="flowRoot3356" - transform="translate(-94.285714,25)"><flowRegion - id="flowRegion3358"><rect - id="rect3360" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3362">CurrenyCode</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3364" - transform="translate(-250.76562,-76.210859)"><flowRegion - id="flowRegion3366"><rect - id="rect3368" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3370">HTTP</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3372" - transform="translate(-273.62277,70.931998)"><flowRegion - id="flowRegion3374"><rect - id="rect3376" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3378">JSONRPC</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3380" - transform="translate(-243.62277,183.07485)"><flowRegion - id="flowRegion3382"><rect - id="rect3384" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3386">Atom</flowPara></flowRoot> </g> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2988" - width="115.66247" - height="85.862968" - x="491.56897" - y="392.70135" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2966" - transform="translate(223.97819,186.76283)"><flowRegion - id="flowRegion2968"><rect - id="rect2970" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2972">Catalog</flowPara></flowRoot> <rect - style="opacity:1;fill:#fff62c;fill-opacity:1;stroke:#060000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect3006" - width="21.718224" - height="20.708065" - x="537.53094" - y="377.04398" - rx="10.859112" - ry="0" /> - <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 474.41846,424.54836 L 507.7535,424.54836 L 513.81441,437.68034 L 506.74335,449.80218 L 474.41846,449.80218 L 481.99461,437.68034 L 474.41846,424.54836 z " - id="path3017" /> - <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 587.6709,422.71008 L 621.00594,422.71008 L 627.06685,435.84206 L 619.99579,447.9639 L 587.6709,447.9639 L 595.24705,435.84206 L 587.6709,422.71008 z " - id="path3019" /> - </g> -</svg> diff --git a/branches/sca-java-1.5/samples/store/README b/branches/sca-java-1.5/samples/store/README deleted file mode 100644 index 46e71bf51e..0000000000 --- a/branches/sca-java-1.5/samples/store/README +++ /dev/null @@ -1,28 +0,0 @@ -Store Sample -====================================== - -This is a sample store scenario that is used as a getting started guide -for Tuscany SCA. For detailed information, please see: - -http://tuscany.apache.org/getting-started-with-tuscany.html - -or - -http://tuscany.apache.org/getting-started-with-tuscany-using-tuscany-eclipse-plugin.html - - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built using Ant as follows: - -cd store -ant compile - -and then, to run: - -ant run - -Once the store application is running use your browser to visit the following -URL: - -http://localhost:8080/store/ diff --git a/branches/sca-java-1.5/samples/store/build.xml b/branches/sca-java-1.5/samples/store/build.xml deleted file mode 100644 index dec09d5dc2..0000000000 --- a/branches/sca-java-1.5/samples/store/build.xml +++ /dev/null @@ -1,79 +0,0 @@ -<!-- - * 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 name="store" default="compile"> - <property name="test.class" value="launch.Launch" /> - <property name="test.jar" value="sample-store.jar" /> - - <target name="init"> - <mkdir dir="target/classes"/> - </target> - - <target name="compile" depends="init"> - <javac srcdir="src/main/java" - destdir="target/classes" - debug="on" - source="1.5" - target="1.5"> - <classpath> - <pathelement location="../../lib/tuscany-sca-manifest.jar"/> - <fileset refid="3rdparty.jars"/> - </classpath> - </javac> - <copy todir="target/classes"> - <fileset dir="src/main/resources"/> - </copy> - <jar destfile="target/${test.jar}" basedir="target/classes"> - <manifest> - <attribute name="Main-Class" value="${test.class}" /> - </manifest> - </jar> - </target> - - <target name="run-classes"> - <java classname="${test.class}" - fork="true"> - <classpath> - <pathelement path="target/classes"/> - <pathelement location="../../lib/tuscany-sca-manifest.jar"/> - <fileset refid="3rdparty.jars"/> - </classpath> - </java> - </target> - - <target name="run"> - <java classname="${test.class}" - fork="true"> - <classpath> - <pathelement path="target/${test.jar}"/> - <pathelement location="../../lib/tuscany-sca-manifest.jar"/> - <fileset refid="3rdparty.jars"/> - </classpath> - </java> - </target> - - <target name="clean"> - <delete quiet="true" includeemptydirs="true"> - <fileset dir="target"/> - </delete> - </target> - - <fileset id="3rdparty.jars" dir="../../lib"> - <include name="saxon-8.7.jar"/> - </fileset> -</project> diff --git a/branches/sca-java-1.5/samples/store/pom.xml b/branches/sca-java-1.5/samples/store/pom.xml deleted file mode 100644 index 81ada43931..0000000000 --- a/branches/sca-java-1.5/samples/store/pom.xml +++ /dev/null @@ -1,121 +0,0 @@ -<?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-sca</artifactId> - <version>1.5-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>sample-store</artifactId> - <name>Apache Tuscany SCA Sample Getting Started Online Store</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-host-embedded</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-data-api</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-widget-runtime-tuscany</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-atom-abdera</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-atom-js</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jsonrpc-js</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-http-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-tomcat</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <finalName>${artifactId}</finalName> - </build> - -</project> diff --git a/branches/sca-java-1.5/samples/store/src/main/java/launch/Launch.java b/branches/sca-java-1.5/samples/store/src/main/java/launch/Launch.java deleted file mode 100644 index 801697abea..0000000000 --- a/branches/sca-java-1.5/samples/store/src/main/java/launch/Launch.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -package launch; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class Launch { - public static void main(String[] args) throws Exception { - System.out.println("Starting ..."); - SCADomain scaDomain = SCADomain.newInstance("store.composite"); - System.out.println("store.composite ready for big business !!!"); - System.in.read(); - System.out.println("Stopping ..."); - scaDomain.close(); - System.out.println(); - } -} diff --git a/branches/sca-java-1.5/samples/store/src/main/java/services/Cart.java b/branches/sca-java-1.5/samples/store/src/main/java/services/Cart.java deleted file mode 100644 index 9e6226d963..0000000000 --- a/branches/sca-java-1.5/samples/store/src/main/java/services/Cart.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.apache.tuscany.sca.data.collection.Collection; -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Cart extends Collection<String, Item> { - -} diff --git a/branches/sca-java-1.5/samples/store/src/main/java/services/Catalog.java b/branches/sca-java-1.5/samples/store/src/main/java/services/Catalog.java deleted file mode 100644 index 2c3b19f579..0000000000 --- a/branches/sca-java-1.5/samples/store/src/main/java/services/Catalog.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Catalog { - Item[] get(); -} diff --git a/branches/sca-java-1.5/samples/store/src/main/java/services/CurrencyConverter.java b/branches/sca-java-1.5/samples/store/src/main/java/services/CurrencyConverter.java deleted file mode 100644 index e104a0423a..0000000000 --- a/branches/sca-java-1.5/samples/store/src/main/java/services/CurrencyConverter.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface CurrencyConverter { - public double getConversion(String fromCurrenycCode, String toCurrencyCode, double amount); - - public String getCurrencySymbol(String currencyCode); -} diff --git a/branches/sca-java-1.5/samples/store/src/main/java/services/CurrencyConverterImpl.java b/branches/sca-java-1.5/samples/store/src/main/java/services/CurrencyConverterImpl.java deleted file mode 100644 index c354aed447..0000000000 --- a/branches/sca-java-1.5/samples/store/src/main/java/services/CurrencyConverterImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ - -package services; - -public class CurrencyConverterImpl implements CurrencyConverter { - public double getConversion(String fromCurrencyCode, String toCurrencyCode, double amount) { - if (toCurrencyCode.equals("USD")) - return amount; - else if (toCurrencyCode.equals("EUR")) - return ((double)Math.round(amount * 0.7256 * 100)) /100; - return 0; - } - - public String getCurrencySymbol(String currencyCode) { - if (currencyCode.equals("USD")) - return "$"; - else if (currencyCode.equals("EUR")) - return "E"; //"€"; - return "?"; - } -} diff --git a/branches/sca-java-1.5/samples/store/src/main/java/services/FruitsCatalogImpl.java b/branches/sca-java-1.5/samples/store/src/main/java/services/FruitsCatalogImpl.java deleted file mode 100644 index 377b3d7e59..0000000000 --- a/branches/sca-java-1.5/samples/store/src/main/java/services/FruitsCatalogImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -package services; - -import java.util.ArrayList; -import java.util.List; - -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; - -public class FruitsCatalogImpl implements Catalog { - - @Property - public String currencyCode = "USD"; - - @Reference - public CurrencyConverter currencyConverter; - - private List<Item> catalog = new ArrayList<Item>(); - - @Init - public void init() { - String currencySymbol = currencyConverter.getCurrencySymbol(currencyCode); - catalog.add(new Item("Apple", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 2.99))); - catalog.add(new Item("Orange", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 3.55))); - catalog.add(new Item("Pear", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 1.55))); - } - - public Item[] get() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.toArray(catalogArray); - return catalogArray; - } -} diff --git a/branches/sca-java-1.5/samples/store/src/main/java/services/Item.java b/branches/sca-java-1.5/samples/store/src/main/java/services/Item.java deleted file mode 100644 index 27abd4f016..0000000000 --- a/branches/sca-java-1.5/samples/store/src/main/java/services/Item.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -package services; - - -public class Item { - private String name; - private String price; - - public Item() { - } - - public Item(String name, String price) { - this.name = name; - this.price = price; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - -} diff --git a/branches/sca-java-1.5/samples/store/src/main/java/services/ShoppingCartImpl.java b/branches/sca-java-1.5/samples/store/src/main/java/services/ShoppingCartImpl.java deleted file mode 100644 index 9889921a96..0000000000 --- a/branches/sca-java-1.5/samples/store/src/main/java/services/ShoppingCartImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * 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. - */ - -package services; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.apache.tuscany.sca.data.collection.Entry; -import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -@Scope("COMPOSITE") -public class ShoppingCartImpl implements Cart, Total { - - private Map<String, Item> cart; - - @Init - public void init() { - cart = new HashMap<String, Item>(); - } - - public Entry<String, Item>[] getAll() { - Entry<String, Item>[] entries = new Entry[cart.size()]; - int i = 0; - for (Map.Entry<String, Item> e: cart.entrySet()) { - entries[i++] = new Entry<String, Item>(e.getKey(), e.getValue()); - } - return entries; - } - - public Item get(String key) throws NotFoundException { - Item item = cart.get(key); - if (item == null) { - throw new NotFoundException(key); - } else { - return item; - } - } - - public String post(String key, Item item) { - if (key == null) { - key ="cart-" + UUID.randomUUID().toString(); - } - cart.put(key, item); - return key; - } - - public void put(String key, Item item) throws NotFoundException { - if (!cart.containsKey(key)) { - throw new NotFoundException(key); - } - cart.put(key, item); - } - - public void delete(String key) throws NotFoundException { - if (key == null || key.equals("")) { - cart.clear(); - } else { - Item item = cart.remove(key); - if (item == null) - throw new NotFoundException(key); - } - } - - public Entry<String, Item>[] query(String queryString) { - List<Entry<String, Item>> entries = new ArrayList<Entry<String,Item>>(); - if (queryString.startsWith("name=")) { - String name = queryString.substring(5); - for (Map.Entry<String, Item> e: cart.entrySet()) { - Item item = e.getValue(); - if (item.getName().equals(name)) { - entries.add(new Entry<String, Item>(e.getKey(), e.getValue())); - } - } - } - return entries.toArray(new Entry[entries.size()]); - } - - public String getTotal() { - double total = 0; - String currencySymbol = ""; - if (!cart.isEmpty()) { - Item item = cart.values().iterator().next(); - currencySymbol = item.getPrice().substring(0, 1); - } - for (Item item : cart.values()) { - total += Double.valueOf(item.getPrice().substring(1)); - } - return currencySymbol + String.valueOf(total); - } -} diff --git a/branches/sca-java-1.5/samples/store/src/main/java/services/Total.java b/branches/sca-java-1.5/samples/store/src/main/java/services/Total.java deleted file mode 100644 index 8f464e526f..0000000000 --- a/branches/sca-java-1.5/samples/store/src/main/java/services/Total.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Total { - - String getTotal(); - -} diff --git a/branches/sca-java-1.5/samples/store/src/main/resources/store.composite b/branches/sca-java-1.5/samples/store/src/main/resources/store.composite deleted file mode 100644 index 571678839d..0000000000 --- a/branches/sca-java-1.5/samples/store/src/main/resources/store.composite +++ /dev/null @@ -1,64 +0,0 @@ -<?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"> - - <component name="Store"> - <t:implementation.widget location="uiservices/store.html"/> - <service name="Widget"> - <t:binding.http uri="/store"/> - </service> - <reference name="catalog" target="Catalog"> - <t:binding.jsonrpc/> - </reference> - <reference name="shoppingCart" target="ShoppingCart/Cart"> - <t:binding.atom/> - </reference> - <reference name="shoppingTotal" target="ShoppingCart/Total"> - <t:binding.jsonrpc/> - </reference> - </component> - - <component name="Catalog"> - <implementation.java class="services.FruitsCatalogImpl"/> - <property name="currencyCode">USD</property> - <service name="Catalog"> - <t:binding.jsonrpc/> - </service> - <reference name="currencyConverter" target="CurrencyConverter"/> - </component> - - <component name="ShoppingCart"> - <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="CurrencyConverter"> - <implementation.java class="services.CurrencyConverterImpl"/> - </component> - -</composite> diff --git a/branches/sca-java-1.5/samples/store/src/main/resources/uiservices/store.html b/branches/sca-java-1.5/samples/store/src/main/resources/uiservices/store.html deleted file mode 100644 index ba004e02ac..0000000000 --- a/branches/sca-java-1.5/samples/store/src/main/resources/uiservices/store.html +++ /dev/null @@ -1,162 +0,0 @@ -<!-- - * 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="store.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" 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); - } - catch(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">'+ - 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 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/">(feed)</a> - </form> - </div> -</body> -</html> diff --git a/branches/sca-java-1.5/samples/store/store.png b/branches/sca-java-1.5/samples/store/store.png Binary files differdeleted file mode 100644 index da413edeee..0000000000 --- a/branches/sca-java-1.5/samples/store/store.png +++ /dev/null diff --git a/branches/sca-java-1.5/samples/store/store.svg b/branches/sca-java-1.5/samples/store/store.svg deleted file mode 100644 index 74f8ecd36d..0000000000 --- a/branches/sca-java-1.5/samples/store/store.svg +++ /dev/null @@ -1,304 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- - * 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. ---> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1052.3622" - height="744.09448" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.45.1" - sodipodi:docbase="C:\simon\tuscany\java-head\sca\samples\store" - sodipodi:docname="store.svg" - version="1.0" - inkscape:output_extension="org.inkscape.output.svg.inkscape" - inkscape:export-filename="C:\simon\tuscany\java-head\sca\samples\store\store.png" - inkscape:export-xdpi="52.84" - inkscape:export-ydpi="52.84"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.4" - inkscape:cx="538.06165" - inkscape:cy="341.69129" - inkscape:document-units="px" - inkscape:current-layer="g2997" - inkscape:window-width="1466" - inkscape:window-height="831" - inkscape:window-x="117" - inkscape:window-y="80" /> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1"> - <g - id="g2997"> - <rect - rx="14.335117" - ry="17.743465" - y="197.1973" - x="447.35422" - height="419.39099" - width="464.23727" - id="rect2067" - style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:2.28840661;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <flowRoot - id="flowRoot2954" - xml:space="preserve" - transform="translate(189.90868,1.0101522)"><flowRegion - id="flowRegion2956"><rect - y="212.66591" - x="281.42856" - height="61.42857" - width="170" - id="rect2958" /></flowRegion><flowPara - id="flowPara2171">store</flowPara></flowRoot> <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.30182266;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2175" - width="118.21779" - height="111.27543" - x="491.60019" - y="247.75989" - rx="7.1507306" - ry="9.2311935" /> - <flowRoot - xml:space="preserve" - id="flowRoot2177" - transform="translate(223.8585,41.670449)"><flowRegion - id="flowRegion2179"><rect - id="rect2181" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2183">ufs</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 474.29877,279.45598 L 507.63381,279.45598 L 513.69472,292.58796 L 506.62366,304.7098 L 474.29877,304.7098 L 481.87492,292.58796 L 474.29877,279.45598 z " - id="path2187" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2191" - width="115.66247" - height="85.862968" - x="493.07068" - y="503.27759" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2193" - transform="translate(225.47992,297.33908)"><flowRegion - id="flowRegion2195"><rect - id="rect2197" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2199">ShoppingCart</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 475.92019,535.12461 L 509.25523,535.12461 L 515.31614,548.25659 L 508.24508,560.37843 L 475.92019,560.37843 L 483.49634,548.25659 L 475.92019,535.12461 z " - id="path2203" /> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2207" - width="115.66247" - height="85.862968" - x="761.44415" - y="391.31604" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2209" - transform="translate(487.8534,185.37751)"><flowRegion - id="flowRegion2211"><rect - id="rect2213" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2215">CurrencyConverter</flowPara></flowRoot> <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 744.29367,423.16304 L 777.62871,423.16304 L 783.68962,436.29502 L 776.61856,448.41686 L 744.29367,448.41686 L 751.86982,436.29502 L 744.29367,423.16304 z " - id="path2219" /> - <rect - style="opacity:1;fill:#0064ff;fill-opacity:1;stroke:#000000;stroke-width:0.9612025;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2223" - width="104.08451" - height="113.17588" - x="138.37151" - y="350.1156" - rx="0" - ry="0.048917599" /> - <path - style="fill:#1a73fe;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" - d="M 138.21429,462.66591 L 115.35714,479.80877 L 267.85714,479.80877 L 241.78571,463.02305 L 138.21429,462.66591 z " - id="path3197" /> - <rect - style="opacity:1;fill:#f1f4f8;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect3199" - width="92.5" - height="97.14286" - x="143.57143" - y="358.38019" - ry="3.6203461" - rx="3.9285715" /> - <image - y="366.6889" - x="156.24066" - id="image3323" - height="78.571434" - width="58.57143" - sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" - xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> - <image - y="270.52304" - x="526.42859" - id="image3342" - height="78.571434" - width="58.57143" - sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" - xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 242.85714,374.80877 C 245.71429,374.80877 345.71429,374.80877 345.71429,374.80877 L 345.71429,291.95162 L 481.42858,291.95162" - id="path3348" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 210.71429,406.95163 L 345,406.95163 L 345,437.66591 L 481.42857,437.66591" - id="path3350" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 210.71429,439.09448 L 325.71429,439.09448 L 325.71429,548.3802 L 482.85714,548.3802" - id="path3352" - sodipodi:nodetypes="cccc" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 626.42857,436.23734 C 750,437.66591 752.14286,436.23734 752.14286,436.23734" - id="path3354" - sodipodi:nodetypes="cc" /> - <flowRoot - xml:space="preserve" - id="flowRoot3356" - transform="translate(-94.285714,25)"><flowRegion - id="flowRegion3358"><rect - id="rect3360" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3362">CurrenyCode</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3364" - transform="translate(-250.76562,-76.210859)"><flowRegion - id="flowRegion3366"><rect - id="rect3368" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3370">HTTP</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3372" - transform="translate(-273.62277,70.931998)"><flowRegion - id="flowRegion3374"><rect - id="rect3376" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3378">JSONRPC</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot3380" - transform="translate(-243.62277,183.07485)"><flowRegion - id="flowRegion3382"><rect - id="rect3384" - width="142.14285" - height="21.428572" - x="655" - y="349.80878" /></flowRegion><flowPara - id="flowPara3386">Atom</flowPara></flowRoot> </g> - <rect - style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect2988" - width="115.66247" - height="85.862968" - x="491.56897" - y="392.70135" - rx="6.9961648" - ry="7.1230249" /> - <flowRoot - xml:space="preserve" - id="flowRoot2966" - transform="translate(223.97819,186.76283)"><flowRegion - id="flowRegion2968"><rect - id="rect2970" - width="170" - height="61.42857" - x="281.42856" - y="212.66591" /></flowRegion><flowPara - id="flowPara2972">Catalog</flowPara></flowRoot> <rect - style="opacity:1;fill:#fff62c;fill-opacity:1;stroke:#060000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect3006" - width="21.718224" - height="20.708065" - x="537.53094" - y="377.04398" - rx="10.859112" - ry="0" /> - <path - style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 474.41846,424.54836 L 507.7535,424.54836 L 513.81441,437.68034 L 506.74335,449.80218 L 474.41846,449.80218 L 481.99461,437.68034 L 474.41846,424.54836 z " - id="path3017" /> - <path - style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="M 587.6709,422.71008 L 621.00594,422.71008 L 627.06685,435.84206 L 619.99579,447.9639 L 587.6709,447.9639 L 595.24705,435.84206 L 587.6709,422.71008 z " - id="path3019" /> - </g> -</svg> |