diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-28 19:41:51 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-28 19:41:51 +0000 |
commit | cbe502740bdd6d2a0ae56d113882dd9d6b31c394 (patch) | |
tree | bfb25bbced6038f250e9ea972be35e76f6a200fe /sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient | |
parent | e982b4ef38fd043c15e89bdd60763b10434a087e (diff) |
Removed contrib folder now that it's saved in its own branch.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@917274 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
6 files changed, 0 insertions, 277 deletions
diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/Customer.xsd b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/Customer.xsd deleted file mode 100644 index 1cec1b0ae6..0000000000 --- a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/Customer.xsd +++ /dev/null @@ -1,33 +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. ---> -<xsd:schema targetNamespace="http://sample.customer" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - - <xsd:element name="customer"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="id" type="xsd:int" /> - <xsd:element name="firstName" type="xsd:string" /> - <xsd:element name="lastName" type="xsd:string" /> - <xsd:element name="address" type="xsd:string" /> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - -</xsd:schema> diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py deleted file mode 100644 index 340da8700d..0000000000 --- a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py +++ /dev/null @@ -1,85 +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. -# -# - -# -# This Python code is a simple sample that provides a Python -# client for the REST Customer sample - - -from xml.etree import ElementTree as et -import sca - -# Locate the customer resource service -customerResource = sca.locateservice("CustomerResource") - -# Show how to invoke CRUD operations on the customer resource -# The CRUD operations translate to HTTP POST, GET, PUT and DELETE -# according to the REST pattern - -customer = customerResource.retrieve("2345") -print "Rest - Retrieved customer " + et.tostring(customer) - -customer = et.fromstring("""<customer xmlns="http://sample.customer"><id>1234</id><firstName>Jane</firstName><lastName>Doe</lastName></customer>""") -url = customerResource.create(customer) -print "Rest - Created customer " + url - -customer = customerResource.retrieve("1234") -print "Rest - Retrieved customer " + et.tostring(customer) - -customer = customerResource.retrieve(url) -print "Rest - Retrieved by url " + et.tostring(customer) - -customer.find("{http://sample.customer}lastName").text="Smith" -customerResource.update("1234", customer) -print "Rest - Updated customer 1234" - -customer = customerResource.retrieve("1234") -print "Rest - Retrieved customer " + et.tostring(customer) - -customerResource.delete("1234") -print "Rest - Deleted customer 1234" - -# Also show how to use REST binding to invoke remote commands -# using HTTP GET and XML over HTTP POST, the REST binding -# uses that command pattern when you don't declare a REST interface -# on your SCA reference - -# Locate the customer command service -customerCommand = sca.locateservice("CustomerCommand") - -# Invoke operations on the customer command service -customer = customerCommand.retrieve("2345") -print "Command - Retrieved customer " + et.tostring(customer) - -customer = et.fromstring("""<customer xmlns="http://sample.customer"><id>1234</id><firstName>Jane</firstName><lastName>Doe</lastName></customer>""") -url = customerCommand.create(customer) -print "Command - Created customer " + url - -customer = customerCommand.retrieve("1234") -print "Command - Retrieved customer " + et.tostring(customer) - -customer.find("{http://sample.customer}lastName").text="Smith" -customerCommand.update("1234", customer) -print "Command - Updated customer 1234" - -customer = customerCommand.retrieve("1234") -print "Command - Retrieved customer " + et.tostring(customer) - -customerCommand.delete("1234") -print "Command - Deleted customer 1234" diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/Makefile.am b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/Makefile.am deleted file mode 100644 index 13c14d07e9..0000000000 --- a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/Makefile.am +++ /dev/null @@ -1,23 +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. - -deploydir=$(prefix)/RestCustomer/deploy -restclientdir=$(deploydir)/sample.customer.restclient - -restclient_DATA = *.py *.composite *.xsd -restclient_SCRIPTS = runrestclient.sh -EXTRA_DIST = runrestclient.sh *.py *.composite *.xsd diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/runrestclient.bat b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/runrestclient.bat deleted file mode 100644 index 982b9b5e83..0000000000 --- a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/runrestclient.bat +++ /dev/null @@ -1,53 +0,0 @@ -@echo off
-
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-
-setlocal
-
-if "%TUSCANY_SCACPP%" == "" (
-echo TUSCANY_SCACPP not set
-goto end
-)
-echo using SCA installed at %TUSCANY_SCACPP%
-
-if "%TUSCANY_SDOCPP%" == "" (
-echo TUSCANY_SDOCPP not set
-goto end
-)
-echo using SDO installed at %TUSCANY_SDOCPP%
-
-if "%LIBCURL_HOME%" == "" (
-echo LIBCURL_HOME not set
-goto end
-)
-echo using Libcurl installed at %LIBCURL_HOME%
-
-set PATH=%HTTPD_HOME%\bin;%LIBCURL_HOME%\lib;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\rest\reference\bin;%TUSCANY_SCACPP%\extensions\python\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%PATH%
-set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin
-
-set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\
-set TUSCANY_SCACPP_COMPONENT=sample.customer.CustomerRestClientComponent
-set TUSCANY_SCACPP_BASE_URI=http://localhost:9090
-
-set CUSTOMER_DIR=%TUSCANY_SCACPP_ROOT%\sample.customer
-
-cd %TUSCANY_SCACPP_ROOT%\sample.customer.restclient
-python CustomerRestClient.py
-
-:end
-endlocal
diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/runrestclient.sh b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/runrestclient.sh deleted file mode 100755 index 54c068f4e2..0000000000 --- a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/runrestclient.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -# 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. - -APFULLDIR=`pwd` - -if [ x$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$PYTHON_LIB != x ]; then -echo "Using Python library installed at $PYTHON_LIB" -export LD_LIBRARY_PATH=$PYTHON_LIB:$LD_LIBRARY_PATH -export PATH=$PYTHON_LIB/../bin:$PATH -fi - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SCACPP/extensions/python/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH -export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_COMPONENT=sample.customer.CustomerRestClientComponent -export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -export CUSTOMER_DIR=$TUSCANY_SCACPP_ROOT/sample.customer - -cd $TUSCANY_SCACPP_ROOT/sample.customer.restclient -python CustomerRestClient.py diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/sample.customer.restclient.composite b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/sample.customer.restclient.composite deleted file mode 100644 index 15072f28f8..0000000000 --- a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/sample.customer.restclient.composite +++ /dev/null @@ -1,33 +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" - name="sample.customer.restclient"> - - <reference name="CustomerResource"> - <interface.rest/> - <binding.rest/> - </reference> - - <reference name="CustomerCommand"> - <binding.rest/> - </reference> - -</composite>
\ No newline at end of file |