Author: ajborley
Date: Wed Jan 3 11:55:25 2007
New Revision: 492273
URL: http://svn.apache.org/viewvc?view=rev&rev=492273
Log:
Added sample demonstrating named parameters (aka keyword arguments) using
Python & REST references
Added:
incubator/tuscany/cpp/sca/samples/RestYahoo/
incubator/tuscany/cpp/sca/samples/RestYahoo/Makefile.am (with props)
incubator/tuscany/cpp/sca/samples/RestYahoo/README (with props)
incubator/tuscany/cpp/sca/samples/RestYahoo/README.html (with props)
incubator/tuscany/cpp/sca/samples/RestYahoo/deploy.bat (with props)
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.app.composite
(with props)
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/Makefile.am
(with props)
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb
(with props)
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.bat
(with props)
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.sh
(with props)
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/Makefile.am
(with props)
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.py
(with props)
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd
(with props)
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/sample.yahoo.composite
(with props)
Modified:
incubator/tuscany/cpp/sca/samples/Makefile.am
incubator/tuscany/cpp/sca/samples/configure.ac
Modified: incubator/tuscany/cpp/sca/samples/Makefile.am
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/Makefile.am?view=diff&rev=492273&r1=492272&r2=492273
==============================================================================
--- incubator/tuscany/cpp/sca/samples/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/samples/Makefile.am Wed Jan 3 11:55:25 2007
@@ -31,6 +31,9 @@
endif
if WANT_PYTHON_SAMPLES
PYTHON_SAMPLES = PythonCalculator PythonWeatherForecast RestCustomer
+if WANT_RUBY_SAMPLES
+ PYTHON_SAMPLES = PythonCalculator PythonWeatherForecast RestCustomer
RestYahoo
+endif
endif
if WANT_RUBY_SAMPLES
RUBY_SAMPLES = RubyCalculator RubyBigBank HttpdBigBank RestCalculator
Added: incubator/tuscany/cpp/sca/samples/RestYahoo/Makefile.am
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/RestYahoo/Makefile.am?view=auto&rev=492273
==============================================================================
--- incubator/tuscany/cpp/sca/samples/RestYahoo/Makefile.am (added)
+++ incubator/tuscany/cpp/sca/samples/RestYahoo/Makefile.am Wed Jan 3 11:55:25
2007
@@ -0,0 +1,23 @@
+# 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)/samples/RestYahoo/deploy
+SUBDIRS = sample.yahoo sample.yahoo.client
+
+EXTRA_DIST = *.composite README.html
+deploy_DATA = *.composite
+
Propchange: incubator/tuscany/cpp/sca/samples/RestYahoo/Makefile.am
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/samples/RestYahoo/Makefile.am
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/samples/RestYahoo/README
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/RestYahoo/README?view=auto&rev=492273
==============================================================================
--- incubator/tuscany/cpp/sca/samples/RestYahoo/README (added)
+++ incubator/tuscany/cpp/sca/samples/RestYahoo/README Wed Jan 3 11:55:25 2007
@@ -0,0 +1,19 @@
+Tuscany SCA for C++ Samples - REST Yahoo Sample
+===============================================
+
+This is a very simple sample to show how to use the SCA REST binding to
+invoke the Yahoo Web Search REST service.
+
+There are two sub-projects in this workspace:
+ - sample.yahoo
+ This contains the SCDL artifacts and source code for the WebSearch
+ Component which calls a Reference that is configured to call the
+ Yahoo service
+ - sample.yahoo.client
+ A Ruby client which calls the WebSearch component.
+
+Additionally, there is the sample.yahoo.app.composite file. This
+describes the configuration of the SCA sample.yahoo composite deployed to
+the SCA runtime.
+
+See the README.html file for instructions to build and run this sample
Propchange: incubator/tuscany/cpp/sca/samples/RestYahoo/README
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/samples/RestYahoo/README
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/samples/RestYahoo/README.html
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/RestYahoo/README.html?view=auto&rev=492273
==============================================================================
--- incubator/tuscany/cpp/sca/samples/RestYahoo/README.html (added)
+++ incubator/tuscany/cpp/sca/samples/RestYahoo/README.html Wed Jan 3 11:55:25
2007
@@ -0,0 +1,175 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!--
+ 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>
+ <META CONTENT="text/html; charset=iso-8859-1" HTTP-EQUIV="Content-Type">
+ <META CONTENT="text/css" HTTP-EQUIV="Content-Style-Type">
+ <STYLE MEDIA="all" TYPE="text/css">
[EMAIL PROTECTED] url("../../doc/css/maven-base.css");
[EMAIL PROTECTED] url("../../doc/css/maven-theme.css");
+ </STYLE>
+
+ <LINK HREF="../doc/css/maven-theme.css" MEDIA="print" REL="stylesheet"
+ TYPE="text/css">
+ <TITLE>Tuscany SCA for C++ Samples - REST Yahoo Search Sample</TITLE>
+</HEAD>
+
+<BODY>
+<DIV ID="bodyColumn">
+ <DIV ID="contentBox">
+ <DIV CLASS="section">
+ <H2>Tuscany SCA for C++ Samples - REST Yahoo Search Sample</H2>
+
+ <P>TODO update this doc???
+ <P>This is a very simple sample to show how to use the SCA REST
binding to
+ invoke the Yahoo Web Search REST service.
+ </P>
+ <P>There are two sub projects in this workspace:</P>
+ <UL>
+ <LI>sample.yahoo<BR/>
+ This contains the SCDL artifacts and Python source code for
the WebSearch
+ Component which calls a Reference that is configured to call
the
+ Yahoo service
+ </LI>
+ <LI>sample.yahoo.client<BR/>
+ A Ruby client which calls the WebSearch component
+ </LI>
+ </UL>
+ <P>Additionally, there is the sample.yahoo.app.composite file. This
+ describes the configuration of the SCA Yahoo Search composite
deployed to
+ the SCA runtime.
+ </P>
+ </DIV>
+
+ <DIV CLASS="section">
+ <H2>Contents</H2>
+ <OL>
+ <LI><A HREF="#linuxbld">Building the Ruby & Python samples on
Linux</A></LI>
+ <LI><A HREF="#linuxrun">Running the REST Yahoo Search sample on
Linux:</A></LI>
+ <LI><A HREF="#winbld">Building the REST Yahoo Search sample on
Windows</A></LI>
+ <LI><A HREF="#winrun">Running the REST Yahoo Search sample on
Windows:</A></LI>
+ <LI><A HREF="#help">Getting help</A></LI>
+ </OL>
+ </DIV>
+
+
+ <DIV CLASS="section">
+ <A NAME="linuxbld"><H2>Building the Ruby & Python samples on
Linux</H2></A>
+ <P>If using the binary distribution the samples are built and
installed in
+ <tuscany_sca_install_dir>/samples - go directly to <A
HREF="#linuxrun">Running the samples on Linux</A>.</P>
+ <OL>
+ <LI>The following environment variables are required:
+ <UL>
+ <LI>TUSCANY_SCACPP=<path to installed Tuscany SCA>
+ <LI>TUSCANY_SDOCPP=<path to installed Tuscany SDO>
+ </UL></LI>
+ </LI>
+ <LI>As the REST Yahoo sample is based on Ruby and Python scripts,
a specific compilation step is not necessary -
+ only deployment is required. Deploy the Ruby and Python
samples only with the following command sequence:
+ <UL>
+ <LI>cd <tuscany_sca_install_dir>/samples</LI>
+ <LI>./configure --enable-ruby --enable-python
--enable-cpp=no --prefix=$TUSCANY_SCACPP</LI>
+ <LI>make install</LI>
+ </UL>
+ NOTE: If you don't provide the --prefix configure option,
it will by default install into
+ /usr/local/tuscany/sca/samples/RestYahoo</LI>
+ </OL>
+ </DIV>
+
+ <DIV CLASS="section">
+ <A NAME="linuxrun"><H2>Running the REST Yahoo Search sample on
Linux</H2></A>
+ <OL>
+ <LI>The following environment variables are required:
+ <UL>
+ <LI>TUSCANY_SCACPP=<path to installed Tuscany
SCA></LI>
+ <LI>TUSCANY_SDOCPP=<path to installed Tuscany
SDO></LI>
+ </UL>
+ </LI>
+ <LI>Run the sample with the following commands:
+ <UL>
+ <LI>cd
<tuscany_sca_install_dir>/samples/RestYahoo/deploy/sample.yahoo.client</LI>
+ <LI>./runclient.sh</LI>
+ </UL>
+ </LI>
+ </OL>
+ </DIV>
+
+ <DIV CLASS="section">
+ <A NAME="winbld"><H2>Building the REST Yahoo Search sample on
Windows</H2></A>
+ <P>If using the binary distribution the samples are built and
installed in
+ <tuscany_sca_install_dir>\samples - go directly to <A
HREF="#winrun">Running the samples on Windows</A>.</P>
+ <OL>
+ <LI>The following environment variables are required:
+ <UL>
+ <LI>TUSCANY_SCACPP=<path to installed Tuscany SCA>
+ <LI>TUSCANY_SDOCPP=<path to installed Tuscany SDO>
+ </UL></LI>
+ </LI>
+ <LI>As this sample is based on Ruby and Python scripts, a
specific compilation step is not necessary -
+ only deployment is required. Deploy the sample with the
following commands:
+ <UL>
+ <LI>cd
<tuscany_sca_install_dir>\samples\RestYahoo</LI>
+ <LI>deploy.bat</LI>
+ </UL>
+ </LI>
+ </OL>
+ </DIV>
+
+ <DIV CLASS="section">
+ <A NAME="winrun"><H2>Running the REST Yahoo Search sample on
Windows</H2></A>
+ <OL>
+ <LI>The following environment variables are required:
+ <UL>
+ <LI>TUSCANY_SCACPP=<path to installed Tuscany
SCA></LI>
+ <LI>TUSCANY_SDOCPP=<path to installed Tuscany
SDO></LI>
+ <LI>LIBCURL_HOME=<path to libcurl></LI>
+ </UL>
+ </LI>
+ <LI>Run the sample with the following commands:
+ <UL>
+ <LI>cd
<tuscany_sca_install_dir>\samples\RestYahoo\deploy\sample.yahoo.client</LI>
+ <LI>runclient.bat</LI>
+ </UL>
+ </LI>
+ </OL>
+ </DIV>
+
+
+
+ <DIV CLASS="section">
+ <A NAME="help"><H2>Getting Help</H2></A>
+
+ <P>First place to look is at the Tuscany FAQ at
+ <A HREF="http://incubator.apache.org/tuscany/faq.html"
+ TARGET="_blank">http://incubator.apache.org/tuscany/faq.html</A>
</P>
+
+ <P>Any problem with this release can be reported to the Tuscany
+ <A HREF="http://incubator.apache.org/tuscany/mail-lists.html"
+ TARGET="_blank">mailing lists</A> or create a JIRA issue
at <A HREF="http://issues.apache.org/jira/browse/Tuscany"
+
TARGET="_blank">http://issues.apache.org/jira/browse/Tuscany</A>.</P>
+ </DIV>
+ </DIV>
+</DIV>
+</BODY>
+
+</HTML>
+
Propchange: incubator/tuscany/cpp/sca/samples/RestYahoo/README.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/samples/RestYahoo/README.html
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/cpp/sca/samples/RestYahoo/README.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Added: incubator/tuscany/cpp/sca/samples/RestYahoo/deploy.bat
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/RestYahoo/deploy.bat?view=auto&rev=492273
==============================================================================
--- incubator/tuscany/cpp/sca/samples/RestYahoo/deploy.bat (added)
+++ incubator/tuscany/cpp/sca/samples/RestYahoo/deploy.bat Wed Jan 3 11:55:25
2007
@@ -0,0 +1,50 @@
[EMAIL PROTECTED] off
[EMAIL PROTECTED] Licensed to the Apache Software Foundation (ASF) under one
[EMAIL PROTECTED] or more contributor license agreements. See the NOTICE file
[EMAIL PROTECTED] distributed with this work for additional information
[EMAIL PROTECTED] regarding copyright ownership. The ASF licenses this file
[EMAIL PROTECTED] to you under the Apache License, Version 2.0 (the
[EMAIL PROTECTED] "License"); you may not use this file except in compliance
[EMAIL PROTECTED] with the License. You may obtain a copy of the License at
[EMAIL PROTECTED]
[EMAIL PROTECTED] http://www.apache.org/licenses/LICENSE-2.0
[EMAIL PROTECTED]
[EMAIL PROTECTED] Unless required by applicable law or agreed to in writing,
[EMAIL PROTECTED] software distributed under the License is distributed on an
[EMAIL PROTECTED] "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
[EMAIL PROTECTED] KIND, either express or implied. See the License for the
[EMAIL PROTECTED] specific language governing permissions and limitations
[EMAIL PROTECTED] under the License.
+
+rem Will copy the correct files from the source tree for packaging and
deployment of the
+rem SCA sample.
+setlocal
+set currentPath=%~d0%~p0
+set sourcePath=%currentPath%
+
+set deploydir=%TUSCANY_SCACPP%
+set samplesdir=%deploydir%\samples
+set yahoodir=%samplesdir%\RestYahoo
+
+if . == %1. (
+set destinationPath=%yahoodir%\deploy
+) ELSE (
+set destinationPath=%1
+)
+
+if not exist %samplesdir% mkdir %samplesdir%
+if not exist %yahoodir% mkdir %yahoodir%
+if not exist %destinationPath% mkdir %destinationPath%
+
+if not exist %destinationPath%\sample.yahoo mkdir
%destinationPath%\sample.yahoo
+copy %sourcePath%\sample.yahoo\*.py %destinationPath%\sample.yahoo
+copy %sourcePath%\sample.yahoo\*.composite %destinationPath%\sample.yahoo
+copy %sourcePath%\sample.yahoo\*.xsd %destinationPath%\sample.yahoo
+
+if not exist %destinationPath%\sample.yahoo.client mkdir
%destinationPath%\sample.yahoo.client
+copy %sourcePath%\sample.yahoo.client\*.rb
%destinationPath%\sample.yahoo.client
+copy %sourcePath%\sample.yahoo.client\runclient.bat
%destinationPath%\sample.yahoo.client
+
+copy %sourcePath%\*.composite %destinationPath%
+
+endlocal
Propchange: incubator/tuscany/cpp/sca/samples/RestYahoo/deploy.bat
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/samples/RestYahoo/deploy.bat
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.app.composite
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.app.composite?view=auto&rev=492273
==============================================================================
--- incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.app.composite
(added)
+++ incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.app.composite Wed
Jan 3 11:55:25 2007
@@ -0,0 +1,28 @@
+<?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.yahoo.app">
+
+ <component name="sample.yahoo.app.WebSearchComponent">
+ <implementation.composite name="sample.yahoo" />
+ </component>
+
+</composite>
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.app.composite
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.app.composite
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/Makefile.am
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/Makefile.am?view=auto&rev=492273
==============================================================================
--- incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/Makefile.am
(added)
+++ incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/Makefile.am
Wed Jan 3 11:55:25 2007
@@ -0,0 +1,23 @@
+# 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)/samples/RestYahoo/deploy
+clientdir=$(deploydir)/sample.yahoo.client
+
+client_DATA = *.rb
+client_SCRIPTS = runclient.sh
+EXTRA_DIST = runclient.sh *.rb
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/Makefile.am
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/Makefile.am
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb?view=auto&rev=492273
==============================================================================
---
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb
(added)
+++
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb
Wed Jan 3 11:55:25 2007
@@ -0,0 +1,25 @@
+# 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.
+#
+#
+
+require("tuscany_sca_ruby")
+
+yahooWebSearch = SCA::locateService("WebSearchComponent")
+
+results = yahooWebSearch.search("Tuscany")
+print results, "\n"
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.bat
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.bat?view=auto&rev=492273
==============================================================================
---
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.bat
(added)
+++
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.bat
Wed Jan 3 11:55:25 2007
@@ -0,0 +1,50 @@
[EMAIL PROTECTED] off
+
[EMAIL PROTECTED] Licensed to the Apache Software Foundation (ASF) under one
[EMAIL PROTECTED] or more contributor license agreements. See the NOTICE file
[EMAIL PROTECTED] distributed with this work for additional information
[EMAIL PROTECTED] regarding copyright ownership. The ASF licenses this file
[EMAIL PROTECTED] to you under the Apache License, Version 2.0 (the
[EMAIL PROTECTED] "License"); you may not use this file except in compliance
[EMAIL PROTECTED] with the License. You may obtain a copy of the License at
[EMAIL PROTECTED]
[EMAIL PROTECTED] http://www.apache.org/licenses/LICENSE-2.0
[EMAIL PROTECTED]
[EMAIL PROTECTED] Unless required by applicable law or agreed to in writing,
[EMAIL PROTECTED] software distributed under the License is distributed on an
[EMAIL PROTECTED] "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
[EMAIL PROTECTED] KIND, either express or implied. See the License for the
[EMAIL PROTECTED] specific language governing permissions and limitations
[EMAIL PROTECTED] 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=%LIBCURL_HOME%\lib;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\rest\reference\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.yahoo.app.WebSearchComponent
+
+cd %TUSCANY_SCACPP_ROOT%\sample.yahoo.client
+ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin YahooWebSearchClient.rb
+
+:end
+endlocal
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.bat
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.bat
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.sh
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.sh?view=auto&rev=492273
==============================================================================
---
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.sh
(added)
+++
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.sh
Wed Jan 3 11:55:25 2007
@@ -0,0 +1,41 @@
+#!/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"
+
+export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH
+
+export TUSCANY_SCACPP_ROOT=$APFULLDIR/../
+export TUSCANY_SCACPP_COMPONENT=sample.yahoo.app.WebSearchComponent
+
+cd $TUSCANY_SCACPP_ROOT/sample.yahoo.client
+ruby -I$TUSCANY_SCACPP/extensions/ruby/lib YahooWebSearchClient.rb
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.sh
------------------------------------------------------------------------------
svn:executable = *
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo.client/runclient.sh
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/Makefile.am
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/Makefile.am?view=auto&rev=492273
==============================================================================
--- incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/Makefile.am (added)
+++ incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/Makefile.am Wed
Jan 3 11:55:25 2007
@@ -0,0 +1,22 @@
+# 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)/samples/RestYahoo/deploy
+compositedir=$(deploydir)/sample.yahoo
+
+composite_DATA = *.composite *.py *.xsd
+EXTRA_DIST = *.composite *.py *.xsd
Propchange: incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/Makefile.am
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/Makefile.am
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.py
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.py?view=auto&rev=492273
==============================================================================
---
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.py
(added)
+++
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.py
Wed Jan 3 11:55:25 2007
@@ -0,0 +1,52 @@
+# 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.
+#
+#
+
+import xml.etree.ElementTree
+
+def search(searchText):
+
+ print "Python - YahooWebSearchImpl.py running Yahoo search for:",
searchText, "with ID:", yahooAppID
+
+ # Use the yahooWebSearchService reference to call the Yahoo REST service
+ # also use the yahooAppID property from the composite definition
+ xmlResult = yahooWebSearchService.webSearch(appid = yahooAppID, query =
searchText, results = 5)
+
+ print "Python - YahooWebSearchImpl.py formatting result from Yahoo:",
xmlResult
+
+ return formatResults(xmlResult, searchText)
+
+
+def formatResults(results, searchText):
+
+ formatted = "Failed to run Yahoo search service for \"" + str(searchText) +
"\""
+
+ ns = "{urn:yahoo:srch}"
+ pathAndNS = "./" + ns
+
+ formatted = "\n\nYahoo Web Search Results for \""+ str(searchText) +"\"\n"
+ formatted += results.attrib["totalResultsAvailable"]+ " results available.
First "+ results.attrib["totalResultsReturned"]+ " below\n\n"
+ pos = 1
+
+ for node in results.findall(".//"+ns+"Result"):
+ formatted += str(pos) + ". "+ node.findtext(pathAndNS+"Title") +"\n\t"
+ formatted += node.findtext(pathAndNS+"Summary") +"\n\t"
+ formatted += node.findtext(pathAndNS+"Url") +"\n\n"
+ pos += 1
+
+ return formatted
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.py
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd?view=auto&rev=492273
==============================================================================
---
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd
(added)
+++
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd
Wed Jan 3 11:55:25 2007
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:yahoo:srch"
+ xmlns="urn:yahoo:srch"
+ elementFormDefault="qualified">
+
+ <xs:element name="ResultSet">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="Result" type="ResultType"
minOccurs="0" maxOccurs="100" />
+ </xs:sequence>
+ <xs:attribute name="totalResultsAvailable"
type="xs:integer" />
+ <xs:attribute name="totalResultsReturned"
type="xs:integer" />
+ <xs:attribute name="firstResultPosition"
type="xs:integer" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="ResultType">
+ <xs:sequence>
+ <xs:element name="Title" type="xs:string" />
+ <xs:element name="Summary" type="xs:string" />
+ <xs:element name="Url" type="xs:string" />
+ <xs:element name="ClickUrl" type="xs:string" />
+ <xs:element name="ModificationDate" type="xs:string"
minOccurs="0" />
+ <xs:element name="MimeType" type="xs:string"
minOccurs="0" />
+ <xs:element name="Cache" type="CacheType" minOccurs="0"
/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="CacheType">
+ <xs:sequence>
+ <xs:element name="Url" type="xs:string" />
+ <xs:element name="Size" type="xs:string" />
+ </xs:sequence>
+ </xs:complexType>
+
+</xs:schema>
+<!-- ws01.search.re2.yahoo.com compressed/chunked Wed Jan 3 06:46:11 PST 2007
-->
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/sample.yahoo.composite
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/sample.yahoo.composite?view=auto&rev=492273
==============================================================================
---
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/sample.yahoo.composite
(added)
+++
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/sample.yahoo.composite
Wed Jan 3 11:55:25 2007
@@ -0,0 +1,33 @@
+<?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.yahoo">
+
+ <component name="WebSearchComponent">
+ <implementation.python module="YahooWebSearchImpl"/>
+ <reference
name="yahooWebSearchService">YahooWebSearchReference</reference>
+ <property name="yahooAppID">ApacheTuscanyC++SampleRestYahoo</property>
+ </component>
+
+ <reference name="YahooWebSearchReference">
+ <binding.rest
uri="http://search.yahooapis.com/WebSearchService/V1"/>
+ </reference>
+
+</composite>
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/sample.yahoo.composite
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/cpp/sca/samples/RestYahoo/sample.yahoo/sample.yahoo.composite
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/cpp/sca/samples/configure.ac
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/samples/configure.ac?view=diff&rev=492273&r1=492272&r2=492273
==============================================================================
--- incubator/tuscany/cpp/sca/samples/configure.ac (original)
+++ incubator/tuscany/cpp/sca/samples/configure.ac Wed Jan 3 11:55:25 2007
@@ -202,7 +202,7 @@
PythonCalculator/sample.calculator.wsclient/Makefile
PythonWeatherForecast/Makefile
PythonWeatherForecast/sample.weather/Makefile
- PythonWeatherForecast/sample.weather.client/Makefile
+ PythonWeatherForecast/sample.weather.client/Makefile
RestCalculator/Makefile
RestCalculator/sample.calculator/Makefile
RestCalculator/sample.calculator.restclient/Makefile
@@ -211,6 +211,9 @@
RestCustomer/sample.customer/Makefile
RestCustomer/sample.customer.restclient/Makefile
RestCustomer/httpserver/Makefile
+ RestYahoo/Makefile
+ RestYahoo/sample.yahoo/Makefile
+ RestYahoo/sample.yahoo.client/Makefile
CppBigBank/Makefile
CppBigBank/bigbank.account/Makefile
CppBigBank/bigbank.client/Makefile
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]