From 83355a7557cf91c455a65e0ce79ea8dd4d880052 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 13 Jan 2010 02:16:12 +0000 Subject: Refactoring sandbox structure to accomodate 1.x versus 2.x stuff git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@898623 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/customer/CustomerService.java | 35 ++ .../customer-map/src/main/java/launch/Launch.java | 34 ++ .../src/main/resources/customer-map.composite | 42 ++ .../src/main/resources/customer.componentType | 31 ++ .../customer-map/src/main/resources/customer.xml | 27 ++ .../customer-map/src/main/resources/customer.xsd | 35 ++ .../customer-map/src/main/resources/dastest/db.lck | Bin 0 -> 38 bytes .../src/main/resources/dastest/log/log.ctrl | Bin 0 -> 48 bytes .../src/main/resources/dastest/log/log1.dat | Bin 0 -> 1048576 bytes .../src/main/resources/dastest/log/logmirror.ctrl | Bin 0 -> 48 bytes .../src/main/resources/dastest/seg0/c10.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c101.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c111.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c121.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c130.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c141.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c150.dat | Bin 0 -> 16384 bytes .../src/main/resources/dastest/seg0/c161.dat | Bin 0 -> 16384 bytes .../src/main/resources/dastest/seg0/c171.dat | Bin 0 -> 16384 bytes .../src/main/resources/dastest/seg0/c180.dat | Bin 0 -> 24576 bytes .../src/main/resources/dastest/seg0/c191.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c1a1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c1b1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c1c0.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c1d1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c1e0.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c1f1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c20.dat | Bin 0 -> 20480 bytes .../src/main/resources/dastest/seg0/c200.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c211.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c221.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c230.dat | Bin 0 -> 274432 bytes .../src/main/resources/dastest/seg0/c241.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c251.dat | Bin 0 -> 12288 bytes .../src/main/resources/dastest/seg0/c260.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c271.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c281.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c290.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c2a1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c2b1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c2c1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c2d0.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c2e1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c2f0.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c300.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c31.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c311.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c41.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c51.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c60.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c71.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c81.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c90.dat | Bin 0 -> 24576 bytes .../src/main/resources/dastest/seg0/ca1.dat | Bin 0 -> 20480 bytes .../src/main/resources/dastest/seg0/cb1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/cc0.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/cd1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/ce1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/cf0.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/service.properties | 22 + .../src/main/resources/html/binding-atom.js | 92 ++++ .../src/main/resources/html/binding-jsonrpc.js | 494 +++++++++++++++++++++ .../src/main/resources/html/index-plain.html | 76 ++++ .../src/main/resources/html/index.html | 55 +++ .../customer-map/src/main/resources/html/map.json | 27 ++ .../java/customer/CustomerServiceTestCase.java | 60 +++ .../src/test/resources/customer.componentType | 29 ++ .../src/test/resources/customer.composite | 35 ++ .../customer-map/src/test/resources/customer.xml | 27 ++ 69 files changed, 1121 insertions(+) create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/java/customer/CustomerService.java create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/java/launch/Launch.java create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer-map.composite create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.componentType create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xml create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xsd create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/db.lck create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log.ctrl create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/logmirror.ctrl create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c10.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c101.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c111.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c121.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c130.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c141.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c150.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c161.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c171.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c180.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c191.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1a1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1b1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1c0.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1d1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1e0.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1f1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c20.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c200.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c211.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c221.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c230.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c241.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c251.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c260.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c271.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c281.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c290.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2a1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2b1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2c1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2d0.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2e1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2f0.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c300.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c31.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c311.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c41.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c51.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c60.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c71.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c81.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c90.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ca1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cb1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cc0.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cd1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ce1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cf0.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/service.properties create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/binding-atom.js create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/binding-jsonrpc.js create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index-plain.html create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index.html create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/map.json create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.componentType create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.composite create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.xml (limited to 'sandbox/lresende/sca-1.x/demos/customer-map/src') diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/java/customer/CustomerService.java b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/java/customer/CustomerService.java new file mode 100644 index 0000000000..5a99f0bc77 --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/java/customer/CustomerService.java @@ -0,0 +1,35 @@ +/* + * 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 customer; + +import org.osoa.sca.annotations.Remotable; + +import commonj.sdo.DataObject; + +/** + * + * @version $Rev$ $Date$ + */ +@Remotable +public interface CustomerService { + + public DataObject getCustomers(); + +} diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/java/launch/Launch.java b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/java/launch/Launch.java new file mode 100644 index 0000000000..2bbb40c6a5 --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/java/launch/Launch.java @@ -0,0 +1,34 @@ +/* + * 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("customer-map.composite"); + System.out.println("customer-map.composite ready for big business !!!"); + System.in.read(); + System.out.println("Stopping ..."); + scaDomain.close(); + System.out.println(); + } +} diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer-map.composite b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer-map.composite new file mode 100644 index 0000000000..f7c979687d --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer-map.composite @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.componentType b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.componentType new file mode 100644 index 0000000000..bf56a3f4e9 --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.componentType @@ -0,0 +1,31 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xml b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xml new file mode 100644 index 0000000000..17d5da9cd6 --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xml @@ -0,0 +1,27 @@ + + + + + + + + +
+
diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xsd b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xsd new file mode 100644 index 0000000000..f00d0ec56a --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xsd @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/db.lck b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/db.lck new file mode 100644 index 0000000000..6b9b2452e0 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/db.lck differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log.ctrl b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log.ctrl new file mode 100644 index 0000000000..4238225f1f Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log.ctrl differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log1.dat new file mode 100644 index 0000000000..e9eb981c16 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/logmirror.ctrl b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/logmirror.ctrl new file mode 100644 index 0000000000..4238225f1f Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/logmirror.ctrl differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c10.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c10.dat new file mode 100644 index 0000000000..27e2ac866e Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c10.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c101.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c101.dat new file mode 100644 index 0000000000..fc4340b2e7 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c101.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c111.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c111.dat new file mode 100644 index 0000000000..750dffff3f Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c111.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c121.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c121.dat new file mode 100644 index 0000000000..0d0b53b30e Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c121.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c130.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c130.dat new file mode 100644 index 0000000000..65f1689e47 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c130.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c141.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c141.dat new file mode 100644 index 0000000000..5b509fb668 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c141.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c150.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c150.dat new file mode 100644 index 0000000000..d985c31be4 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c150.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c161.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c161.dat new file mode 100644 index 0000000000..d3af4852f2 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c161.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c171.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c171.dat new file mode 100644 index 0000000000..731d9e87fb Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c171.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c180.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c180.dat new file mode 100644 index 0000000000..82298723d7 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c180.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c191.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c191.dat new file mode 100644 index 0000000000..b2d149a0f3 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c191.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1a1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1a1.dat new file mode 100644 index 0000000000..5001ad3d63 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1a1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1b1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1b1.dat new file mode 100644 index 0000000000..b3a539d635 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1b1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1c0.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1c0.dat new file mode 100644 index 0000000000..359525a31a Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1c0.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1d1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1d1.dat new file mode 100644 index 0000000000..9f257df932 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1d1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1e0.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1e0.dat new file mode 100644 index 0000000000..e43e52fb7f Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1e0.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1f1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1f1.dat new file mode 100644 index 0000000000..7e6ee3b1e0 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1f1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c20.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c20.dat new file mode 100644 index 0000000000..2b9a6b96d4 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c20.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c200.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c200.dat new file mode 100644 index 0000000000..cae919d022 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c200.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c211.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c211.dat new file mode 100644 index 0000000000..c7e311b00e Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c211.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c221.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c221.dat new file mode 100644 index 0000000000..28e89367ce Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c221.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c230.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c230.dat new file mode 100644 index 0000000000..c8aca2ee6f Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c230.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c241.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c241.dat new file mode 100644 index 0000000000..3478bc897d Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c241.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c251.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c251.dat new file mode 100644 index 0000000000..d3d6adf4fb Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c251.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c260.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c260.dat new file mode 100644 index 0000000000..8d7333df7d Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c260.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c271.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c271.dat new file mode 100644 index 0000000000..af722f7d73 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c271.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c281.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c281.dat new file mode 100644 index 0000000000..3972983c2e Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c281.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c290.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c290.dat new file mode 100644 index 0000000000..31577b8124 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c290.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2a1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2a1.dat new file mode 100644 index 0000000000..0f700d13a7 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2a1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2b1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2b1.dat new file mode 100644 index 0000000000..1d6382fb3d Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2b1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2c1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2c1.dat new file mode 100644 index 0000000000..3bc60d886b Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2c1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2d0.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2d0.dat new file mode 100644 index 0000000000..c542d3c91c Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2d0.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2e1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2e1.dat new file mode 100644 index 0000000000..16abd20b5f Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2e1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2f0.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2f0.dat new file mode 100644 index 0000000000..eb26be5932 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2f0.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c300.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c300.dat new file mode 100644 index 0000000000..35a164db8a Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c300.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c31.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c31.dat new file mode 100644 index 0000000000..44f7fa784d Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c31.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c311.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c311.dat new file mode 100644 index 0000000000..85c095cadb Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c311.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c41.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c41.dat new file mode 100644 index 0000000000..519f1a49be Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c41.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c51.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c51.dat new file mode 100644 index 0000000000..452a28db9b Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c51.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c60.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c60.dat new file mode 100644 index 0000000000..94c357868f Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c60.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c71.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c71.dat new file mode 100644 index 0000000000..9ca2ca97d1 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c71.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c81.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c81.dat new file mode 100644 index 0000000000..85bc9c8351 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c81.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c90.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c90.dat new file mode 100644 index 0000000000..14e77ef636 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c90.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ca1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ca1.dat new file mode 100644 index 0000000000..624ae61a85 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ca1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cb1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cb1.dat new file mode 100644 index 0000000000..97e6f19260 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cb1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cc0.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cc0.dat new file mode 100644 index 0000000000..5126021a83 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cc0.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cd1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cd1.dat new file mode 100644 index 0000000000..2e135b64ab Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cd1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ce1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ce1.dat new file mode 100644 index 0000000000..076423c10a Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ce1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cf0.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cf0.dat new file mode 100644 index 0000000000..bfae1c8b85 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cf0.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/service.properties b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/service.properties new file mode 100644 index 0000000000..997a33e4db --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/service.properties @@ -0,0 +1,22 @@ +#D:\dev\Opensource\Apache\Tuscany\source\java\sca\demos\google-maps\src\main\resources\dastest +# ******************************************************************** +# *** Please do NOT edit this file. *** +# *** CHANGING THE CONTENT OF THIS FILE MAY CAUSE DATA CORRUPTION. *** +# ******************************************************************** +#Wed Aug 29 13:46:31 PDT 2007 +SysschemasIndex2Identifier=225 +SyscolumnsIdentifier=144 +SysconglomeratesIndex1Identifier=49 +SysconglomeratesIdentifier=32 +SyscolumnsIndex2Identifier=177 +SysschemasIndex1Identifier=209 +SysconglomeratesIndex3Identifier=81 +SystablesIndex2Identifier=129 +SyscolumnsIndex1Identifier=161 +derby.serviceProtocol=org.apache.derby.database.Database +SysschemasIdentifier=192 +derby.storage.propertiesId=16 +SysconglomeratesIndex2Identifier=65 +derby.serviceLocale=en_US +SystablesIdentifier=96 +SystablesIndex1Identifier=113 \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/binding-atom.js b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/binding-atom.js new file mode 100644 index 0000000000..aacf864f14 --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/binding-atom.js @@ -0,0 +1,92 @@ +/* + * 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. + */ + +function AtomClient(uri) { + + this.uri=uri; + + this.get = function(id, responseFunction) { + var xhr = this.createXMLHttpRequest(); + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + if (xhr.status == 200) { + if (responseFunction != null) responseFunction(xhr.responseXML); + } else { + alert("get - Error getting data from the server"); + } + } + } + xhr.open("GET", uri + id, true); + xhr.send(null); + } + this.post = function (entry, responseFunction) { + var xhr = this.createXMLHttpRequest(); + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + if (xhr.status == 201) { + if (responseFunction != null) responseFunction(xhr.responseXML); + } else { + alert("post - Error getting data from the server"); + } + } + } + xhr.open("POST", uri, true); + xhr.setRequestHeader("Content-Type", "application/atom+xml"); + xhr.send(entry); + } + this.put = function (id, entry, responseFunction) { + var xhr = this.createXMLHttpRequest(); + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + if (xhr.status == 200) { + if (responseFunction != null) responseFunction(xhr.responseXML); + } else { + alert("put - Error getting data from the server"); + } + } + } + xhr.open("PUT", uri + id, true); + xhr.setRequestHeader("Content-Type", "application/atom+xml"); + xhr.send(entry); + } + this.delete = function (id, responseFunction) { + var xhr = this.createXMLHttpRequest(); + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + if (xhr.status == 200) { + if (responseFunction != null) responseFunction(); + } else { + alert("delete - Error getting data from the server"); + } + } + } + xhr.open("DELETE", uri + id, true); + xhr.send(null); + } + + this.createXMLHttpRequest = function () { + try {return new XMLHttpRequest();} catch(e) {} + try {return new ActiveXObject("Msxml2.XMLHTTP");} catch(e) {} + try {return new ActiveXObject("Microsoft.XMLHTTP");} catch(e) {} + alert("XML http request not supported"); + return null; + } +} + +bindingatom = "loaded"; \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/binding-jsonrpc.js b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/binding-jsonrpc.js new file mode 100644 index 0000000000..7f4a092f71 --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/binding-jsonrpc.js @@ -0,0 +1,494 @@ +/* + * JSON-RPC JavaScript client + * + * $Id: jsonrpc.js,v 1.36.2.3 2006/03/08 15:09:37 mclark Exp $ + * + * Copyright (c) 2003-2004 Jan-Klaas Kollhof + * Copyright (c) 2005 Michael Clark, Metaparadigm Pte Ltd + * + * This code is based on Jan-Klaas' JavaScript o lait library (jsolait). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/* + * Modifications for Apache Tuscany: + * - JSONRpcClient_createMethod changed so callback is last arg + */ + +/* escape a character */ + +escapeJSONChar = +function escapeJSONChar(c) +{ + if(c == "\"" || c == "\\") return "\\" + c; + else if (c == "\b") return "\\b"; + else if (c == "\f") return "\\f"; + else if (c == "\n") return "\\n"; + else if (c == "\r") return "\\r"; + else if (c == "\t") return "\\t"; + var hex = c.charCodeAt(0).toString(16); + if(hex.length == 1) return "\\u000" + hex; + else if(hex.length == 2) return "\\u00" + hex; + else if(hex.length == 3) return "\\u0" + hex; + else return "\\u" + hex; +}; + + +/* encode a string into JSON format */ + +escapeJSONString = +function escapeJSONString(s) +{ + /* The following should suffice but Safari's regex is b0rken + (doesn't support callback substitutions) + return "\"" + s.replace(/([^\u0020-\u007f]|[\\\"])/g, + escapeJSONChar) + "\""; + */ + + /* Rather inefficient way to do it */ + var parts = s.split(""); + for(var i=0; i < parts.length; i++) { + var c =parts[i]; + if(c == '"' || + c == '\\' || + c.charCodeAt(0) < 32 || + c.charCodeAt(0) >= 128) + parts[i] = escapeJSONChar(parts[i]); + } + return "\"" + parts.join("") + "\""; +}; + + +/* Marshall objects to JSON format */ + +toJSON = function toJSON(o) +{ + if(o == null) { + return "null"; + } else if(o.constructor == String) { + return escapeJSONString(o); + } else if(o.constructor == Number) { + return o.toString(); + } else if(o.constructor == Boolean) { + return o.toString(); + } else if(o.constructor == Date) { + return '{javaClass: "java.util.Date", time: ' + o.valueOf() +'}'; + } else if(o.constructor == Array) { + var v = []; + for(var i = 0; i < o.length; i++) v.push(toJSON(o[i])); + return "[" + v.join(", ") + "]"; + } else { + var v = []; + for(attr in o) { + if(o[attr] == null) v.push("\"" + attr + "\": null"); + else if(typeof o[attr] == "function"); /* skip */ + else v.push(escapeJSONString(attr) + ": " + toJSON(o[attr])); + } + return "{" + v.join(", ") + "}"; + } +}; + + +/* JSONRpcClient constructor */ + +JSONRpcClient = +function JSONRpcClient_ctor(serverURL, user, pass, objectID) +{ + this.serverURL = serverURL; + this.user = user; + this.pass = pass; + this.objectID = objectID; + + /* Add standard methods */ + if(this.objectID) { + this._addMethods(["listMethods"]); + var req = this._makeRequest("listMethods", []); + } else { + this._addMethods(["system.listMethods"]); + var req = this._makeRequest("system.listMethods", []); + } + var m = this._sendRequest(req); + this._addMethods(m); +}; + + +/* JSONRpcCLient.Exception */ + +JSONRpcClient.Exception = +function JSONRpcClient_Exception_ctor(code, message, javaStack) +{ + this.code = code; + var name; + if(javaStack) { + this.javaStack = javaStack; + var m = javaStack.match(/^([^:]*)/); + if(m) name = m[0]; + } + if(name) this.name = name; + else this.name = "JSONRpcClientException"; + this.message = message; +}; + +JSONRpcClient.Exception.CODE_REMOTE_EXCEPTION = 490; +JSONRpcClient.Exception.CODE_ERR_CLIENT = 550; +JSONRpcClient.Exception.CODE_ERR_PARSE = 590; +JSONRpcClient.Exception.CODE_ERR_NOMETHOD = 591; +JSONRpcClient.Exception.CODE_ERR_UNMARSHALL = 592; +JSONRpcClient.Exception.CODE_ERR_MARSHALL = 593; + +JSONRpcClient.Exception.prototype = new Error(); + +JSONRpcClient.Exception.prototype.toString = +function JSONRpcClient_Exception_toString(code, msg) +{ + return this.name + ": " + this.message; +}; + + +/* Default top level exception handler */ + +JSONRpcClient.default_ex_handler = +function JSONRpcClient_default_ex_handler(e) { alert(e); }; + + +/* Client settable variables */ + +JSONRpcClient.toplevel_ex_handler = JSONRpcClient.default_ex_handler; +JSONRpcClient.profile_async = false; +JSONRpcClient.max_req_active = 1; +JSONRpcClient.requestId = 1; + + +/* JSONRpcClient implementation */ + +JSONRpcClient.prototype._createMethod = +function JSONRpcClient_createMethod(methodName) +{ + var fn=function() + { + var args = []; + var callback = null; + for(var i=0;i 0) { + var res = JSONRpcClient.async_responses.shift(); + if(res.canceled) continue; + if(res.profile) res.profile.dispatch = new Date(); + try { + res.cb(res.result, res.ex, res.profile); + } catch(e) { + JSONRpcClient.toplevel_ex_handler(e); + } + } + + while(JSONRpcClient.async_requests.length > 0 && + JSONRpcClient.num_req_active < JSONRpcClient.max_req_active) { + var req = JSONRpcClient.async_requests.shift(); + if(req.canceled) continue; + req.client._sendRequest.call(req.client, req); + } +}; + +JSONRpcClient.kick_async = +function JSONRpcClient_kick_async() +{ + if(JSONRpcClient.async_timeout == null) + JSONRpcClient.async_timeout = + setTimeout(JSONRpcClient._async_handler, 0); +}; + +JSONRpcClient.cancelRequest = +function JSONRpcClient_cancelRequest(requestId) +{ + /* If it is in flight then mark it as canceled in the inflight map + and the XMLHttpRequest callback will discard the reply. */ + if(JSONRpcClient.async_inflight[requestId]) { + JSONRpcClient.async_inflight[requestId].canceled = true; + return true; + } + + /* If its not in flight yet then we can just mark it as canceled in + the the request queue and it will get discarded before being sent. */ + for(var i in JSONRpcClient.async_requests) { + if(JSONRpcClient.async_requests[i].requestId == requestId) { + JSONRpcClient.async_requests[i].canceled = true; + return true; + } + } + + /* It may have returned from the network and be waiting for its callback + to be dispatched, so mark it as canceled in the response queue + and the response will get discarded before calling the callback. */ + for(var i in JSONRpcClient.async_responses) { + if(JSONRpcClient.async_responses[i].requestId == requestId) { + JSONRpcClient.async_responses[i].canceled = true; + return true; + } + } + + return false; +}; + +JSONRpcClient.prototype._makeRequest = +function JSONRpcClient_makeRequest(methodName, args, cb) +{ + var req = {}; + req.client = this; + req.requestId = JSONRpcClient.requestId++; + + var obj = {}; + obj.id = req.requestId; + if (this.objectID) + obj.method = ".obj#" + this.objectID + "." + methodName; + else + obj.method = methodName; + obj.params = args; + + if (cb) req.cb = cb; + if (JSONRpcClient.profile_async) + req.profile = { "submit": new Date() }; + req.data = toJSON(obj); + + return req; +}; + +JSONRpcClient.prototype._sendRequest = +function JSONRpcClient_sendRequest(req) +{ + if(req.profile) req.profile.start = new Date(); + + /* Get free http object from the pool */ + var http = JSONRpcClient.poolGetHTTPRequest(); + JSONRpcClient.num_req_active++; + + /* Send the request */ + if (typeof(this.user) == "undefined") { + http.open("POST", this.serverURL, (req.cb != null)); + } else { + http.open("POST", this.serverURL, (req.cb != null), this.user, this.pass); + } + + /* setRequestHeader is missing in Opera 8 Beta */ + try { http.setRequestHeader("Content-type", "text/plain"); } catch(e) {} + + /* Construct call back if we have one */ + if(req.cb) { + var self = this; + http.onreadystatechange = function() { + if(http.readyState == 4) { + http.onreadystatechange = function () {}; + var res = { "cb": req.cb, "result": null, "ex": null}; + if (req.profile) { + res.profile = req.profile; + res.profile.end = new Date(); + } + try { res.result = self._handleResponse(http); } + catch(e) { res.ex = e; } + if(!JSONRpcClient.async_inflight[req.requestId].canceled) + JSONRpcClient.async_responses.push(res); + delete JSONRpcClient.async_inflight[req.requestId]; + JSONRpcClient.kick_async(); + } + }; + } else { + http.onreadystatechange = function() {}; + } + + JSONRpcClient.async_inflight[req.requestId] = req; + + try { + http.send(req.data); + } catch(e) { + JSONRpcClient.poolReturnHTTPRequest(http); + JSONRpcClient.num_req_active--; + throw new JSONRpcClient.Exception + (JSONRpcClient.Exception.CODE_ERR_CLIENT, "Connection failed"); + } + + if(!req.cb) return this._handleResponse(http); +}; + +JSONRpcClient.prototype._handleResponse = +function JSONRpcClient_handleResponse(http) +{ + /* Get the charset */ + if(!this.charset) { + this.charset = JSONRpcClient._getCharsetFromHeaders(http); + } + + /* Get request results */ + var status, statusText, data; + try { + status = http.status; + statusText = http.statusText; + data = http.responseText; + } catch(e) { + JSONRpcClient.poolReturnHTTPRequest(http); + JSONRpcClient.num_req_active--; + JSONRpcClient.kick_async(); + throw new JSONRpcClient.Exception + (JSONRpcClient.Exception.CODE_ERR_CLIENT, "Connection failed"); + } + + /* Return http object to the pool; */ + JSONRpcClient.poolReturnHTTPRequest(http); + JSONRpcClient.num_req_active--; + + /* Unmarshall the response */ + if(status != 200) { + throw new JSONRpcClient.Exception(status, statusText); + } + var obj; + try { + eval("obj = " + data); + } catch(e) { + throw new JSONRpcClient.Exception(550, "error parsing result"); + } + if(obj.error) + throw new JSONRpcClient.Exception(obj.error.code, obj.error.msg, + obj.error.trace); + var res = obj.result; + + /* Handle CallableProxy */ + if(res && res.objectID && res.JSONRPCType == "CallableReference") + return new JSONRpcClient(this.serverURL, this.user, + this.pass, res.objectID); + + return res; +}; + + +/* XMLHttpRequest wrapper code */ + +/* XMLHttpRequest pool globals */ +JSONRpcClient.http_spare = []; +JSONRpcClient.http_max_spare = 8; + +JSONRpcClient.poolGetHTTPRequest = +function JSONRpcClient_pool_getHTTPRequest() +{ + if(JSONRpcClient.http_spare.length > 0) { + return JSONRpcClient.http_spare.pop(); + } + return JSONRpcClient.getHTTPRequest(); +}; + +JSONRpcClient.poolReturnHTTPRequest = +function JSONRpcClient_poolReturnHTTPRequest(http) +{ + if(JSONRpcClient.http_spare.length >= JSONRpcClient.http_max_spare) + delete http; + else + JSONRpcClient.http_spare.push(http); +}; + +JSONRpcClient.msxmlNames = [ "MSXML2.XMLHTTP.5.0", + "MSXML2.XMLHTTP.4.0", + "MSXML2.XMLHTTP.3.0", + "MSXML2.XMLHTTP", + "Microsoft.XMLHTTP" ]; + +JSONRpcClient.getHTTPRequest = +function JSONRpcClient_getHTTPRequest() +{ + /* Mozilla XMLHttpRequest */ + try { + JSONRpcClient.httpObjectName = "XMLHttpRequest"; + return new XMLHttpRequest(); + } catch(e) {} + + /* Microsoft MSXML ActiveX */ + for (var i=0;i < JSONRpcClient.msxmlNames.length; i++) { + try { + JSONRpcClient.httpObjectName = JSONRpcClient.msxmlNames[i]; + return new ActiveXObject(JSONRpcClient.msxmlNames[i]); + } catch (e) {} + } + + /* None found */ + JSONRpcClient.httpObjectName = null; + throw new JSONRpcClient.Exception(0, "Can't create XMLHttpRequest object"); +}; + +bindingjsonrpc = "loaded"; \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index-plain.html b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index-plain.html new file mode 100644 index 0000000000..0783c3facb --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index-plain.html @@ -0,0 +1,76 @@ + + + + + Google Maps JavaScript API Example + + + + +
+ + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index.html b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index.html new file mode 100644 index 0000000000..53f637bed2 --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index.html @@ -0,0 +1,55 @@ + + + +Customer Mashup + + + + + + + + + + +

MyCompany.com

+
+

Customer List

+ +
None yet.
+
+
+ + + diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/map.json b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/map.json new file mode 100644 index 0000000000..a884141a3c --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/map.json @@ -0,0 +1,27 @@ +/* + * 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. + */ + +{"markers": [ + {"country":"Brazil", "city":"Cuiaba", "point":new GLatLng(-15.625702586903822, -56.07351064682007), "html":"My home town","label":"Cuiaba"}, + {"country":"Brazil", "city":"Chapada dos Guimaraes", "point":new GLatLng(-15.44329, -55.75835), "html":"Chapada, Wonderful landscape and beautiful whaterfalls ","label":"Chapada dos Guimaraes"}, + {"country":"Brazil", "city":"Pantanal Matogrossense", "point":new GLatLng(-16.223575372658782, -56.631431579589844), "html":"Pantanal and it's amazing biologic diversity","label":"Pantanal Matogrossensse"}, + {"country":"Brazil", "city":"Rio de Janeiro", "point":new GLatLng(-22.963984709280982, -43.17753553390503), "html":"Wonderful City","label":"Rio de Janeiro"}, + {"country":"Brazil", "city":"Sao Paulo", "point":new GLatLng(-23.54329433556302, -46.71802997589111), "html":"Sao Paulo","label":"Sao Paulo"}, + ] +} \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java new file mode 100644 index 0000000000..7d289fd62a --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java @@ -0,0 +1,60 @@ +/* + * 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 customer; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +import commonj.sdo.DataObject; +import customer.CustomerService; + +/** + * Tests the DAS service + */ +public class CustomerServiceTestCase extends TestCase { + + private SCADomain scaDomain; + private CustomerService customerService; + + /** + * @throws java.lang.Exception + */ + @Override + protected void setUp() throws Exception { + scaDomain = SCADomain.newInstance("customer.composite"); + customerService = scaDomain.getService(CustomerService.class, "CustomerServiceComponent/CustomerService"); + } + + /** + * @throws java.lang.Exception + */ + @Override + protected void tearDown() throws Exception { + scaDomain.close(); + } + + public void testGetCustomers() throws Exception { + DataObject root = customerService.getCustomers(); + assertNotNull(root); + assertEquals("Luciano Resende", root.getString("CUSTOMER[1]/NAME")); + } + + +} diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.componentType b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.componentType new file mode 100644 index 0000000000..0d1992d597 --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.componentType @@ -0,0 +1,29 @@ + + + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.composite b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.composite new file mode 100644 index 0000000000..72a692e38b --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.xml b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.xml new file mode 100644 index 0000000000..7b17903540 --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.xml @@ -0,0 +1,27 @@ + + + + + + + + +
+
-- cgit v1.2.3