diff options
Diffstat (limited to 'tags/cpp-1.0-incubating-M2-final/sca/doc')
6 files changed, 0 insertions, 1676 deletions
diff --git a/tags/cpp-1.0-incubating-M2-final/sca/doc/Axis2CWSService.html b/tags/cpp-1.0-incubating-M2-final/sca/doc/Axis2CWSService.html deleted file mode 100644 index 201ee10e26..0000000000 --- a/tags/cpp-1.0-incubating-M2-final/sca/doc/Axis2CWSService.html +++ /dev/null @@ -1,395 +0,0 @@ - -<!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"> -@import url("css/maven-base.css"); -@import url("css/maven-theme.css"); - </STYLE> - - <LINK HREF="css/maven-theme.css" MEDIA="print" REL="stylesheet" - TYPE="text/css"> - <TITLE>Tuscany SCA for C++ - Enabling Axis2C Web Services</TITLE> -</HEAD> - -<BODY> -<DIV ID="bodyColumn"> - <DIV ID="contentBox"> - <DIV CLASS="section"> - <H2>Tuscany SCA for C++ - Enabling Axis2C Web Services</H2> - - <P>This document describes the deployment and use of the Axis2C Web Service - (binding.ws) service support in the Apache Tuscany SCA C++ runtime. - </P> - <P>The WS service code is based on <A HREF="http://ws.apache.org/axis2/c">Apache - Axis2C version 0.94</A> and allows SCA components to be invoked via Web - Service calls. - </P> - <P>WS service currently supports Document/literal Wrapped style Web Services - only. There are also restrictions about the parameter and return types of the - operations in SCA components that can be exposed as Web Services, see below - for more details. - </P> - <P>See the <A HREF="http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications">SCA - Web Service binding specification</A> for more details about SCA Web - Service support. - </P> - <P>Also, see the <A HREF="../samples/GettingStarted.html">samples</A> for various - demonstrations of the use of the binding.ws service support. - </P> - </DIV> - - <DIV CLASS="section"> - <H2>Contents</H2> - <OL> - <LI><A HREF="#deploy">Deploying the Tuscany Web Service support to Axis2C..</A> - <UL> - <LI><A HREF="#autodeploy">..automatically via scripts</A></LI> - <LI><A HREF="#mandeploy">..manually</A></LI> - </UL></LI> - <LI><A HREF="#use">Defining an SCA Composite with a WS service</A></LI> - <LI><A HREF="#maptable">XML Schema Type to C++ Type Mapping</A></LI> - <LI><A HREF="#creatingwsdl">Notes on creating WSDL</A></LI> - </OL> - </DIV> - - - <DIV CLASS="section"> - <A NAME="deploy"><H2>Deploying the Tuscany Web Service support to Axis2C</H2></A> - <A NAME="autodeploy"><H3>Deploying via scripts</H3></A> - <P>Tuscany provides simple shell scripts to deploy the Web Service support to Axis2C. - However, the script <STRONG>will overwrite your Axis2C axis.xml file</STRONG>, so if you - have altered your axis2.xml from the default provided by the Axis2C distribution, it is - recommended that you follow the <A HREF="#mandeploy">manual deployment</A> steps - outlined below. - </P> - <P>To automatically deploy Tuscany Web Service support to Axis2C on Linux: - <OL> - <LI>The AXIS2C_HOME environment variable is required: - <UL> - <LI>set AXIS2C_HOME=<path to axis2c version 0.94></LI> - </UL></LI> - <LI>Use the following command sequence to run the deploy script: - <UL> - <LI>cd <tuscany_sca_install_dir>/extensions/ws/service</LI> - <LI>./deploy.sh</LI> - </UL> - </LI> - </OL> - </P> - <P>To automatically deploy Tuscany Web Service support to Axis2C on Windows: - <OL> - <LI>The AXIS2C_HOME environment variable is required: - <UL> - <LI>export AXIS2C_HOME=<path to axis2c version 0.94></LI> - </UL></LI> - <LI>Use the following command sequence to run the deploy script: - <UL> - <LI>cd <tuscany_sca_install_dir>\extensions\ws\service</LI> - <LI>deploy.cmd</LI> - </UL> - </LI> - </OL> - </P> - - - <A NAME="mandeploy"><H3>Deploying manually</H3></A> - <P>To deploy Tuscany Web Service support to Axis2C manually, use the following steps: - </P> - <OL> - <LI> - Linux: - <OL> - <LI>cd <axis2c version 0.94>/services</LI> - <LI>ln -sf <tuscany_sca_install_dir>/extensions/ws/service/services/tuscany</LI> - <LI>cd <axis2c version 0.94>/modules</LI> - <LI>ln -sf <tuscany_sca_install_dir>/extensions/ws/service/modules/tuscany</LI> - </OL> - Windows: - <OL> - <LI>Create a <axis2c version 0.94>\services\tuscany directory - </LI> - <LI>Copy all the files in <tuscany_sca_install_dir>\extensions\ws\service\services\tuscany - to the directory created above - </LI> - <LI>Create a <axis2c version 0.94>\modules\tuscany directory - </LI> - <LI>Copy all the files in <tuscany_sca_install_dir>\extensions\ws\service\modules\tuscany - to the directory created above - </LI> - </OL> - </LI> - <LI>Edit the <axis2c version 0.94>/axis2.xml file to add a <ref module="tuscany"> - element. This will register the above module. E.g.: - <PRE>... - <!-- ================================================= --> - <!-- Global Modules --> - <!-- ================================================= --> - <!-- Comment this to disable Addressing --> - <module ref="addressing"/> - - <module ref="tuscany"/> - -... </PRE> - </LI> - - </OL> - </DIV> - - <DIV CLASS="section"> - <A NAME="use"><H2>Defining an SCA Composite with a WS service</H2></A> - - <P>In this section we will use the Calculator sample as a worked example. - The Calculator code and files can be found at - <tuscany_sca_install_dir>samples/Calculator. - </P> - <P>Pre-requisites: - <UL> - <LI>At least one working component within a composite and solution - composite. The component(s) can be implemented in C++, Ruby or Python. - If this includes C++ components, the SCAGEN generated Proxy and Wrapper - classes and the component class files must have been compiled into a - .dll or .so library. The *.composite and *.componentType files must - also be available and working. - </LI> - </UL> - </P> - <OL> - <LI>Optionally, create the WSDL that defines the interface of your SCA component. See the - table <A HREF="#maptable">XML Schema Type to C++ Type Mapping</A> and - <A HREF="#creatingwsdl">Notes on creating WSDL</A> below - for mapping the parameters and return types of the component operations to XML - schema types in the WSDL. This file will need to be accessible from the component, - so place it in the same directory as the component or in a subdirectory. - <BR/> - See the <tuscany_sca_install_dir>/samples/Calculator/sample.calculator/Calculator.wsdl - file as an example. - <BR/> - If you do not provide a WSDL file describing the service interface then the service will - accept any incoming document/literal wrapped XML request that matches an operation on the - target service (the wrapper element name and types of the sub-elements must match the operation - name and its parameter types). Additionally, if the target component is a Python or Ruby - scripting component, it will accept any parameter type so you can pretty much pass whatever - data you want, as long at the incoming XML request matches to an operation name with the - correct number of parameters on the target service. - </LI> - <LI>Add a service definition to the component .composite file. If you have created a WSDL - definition, set the interface.wsdl interface attribute to the namespace and port name - specified in the WSDL, in the form: "<namespace>#wsdl.interface(<port-name>)". - Link a reference from this service definition to your - component, give the service a name and set the multiplicity if required. - <BR/> - E.g. for the Calculator component, based on the Calculator.wsdl file: - <PRE><service name="CalculatorService"> - <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)"/> - <binding.ws/> - <reference>CalculatorComponent/CalculatorService</reference> -</service></PRE> - If the Calculator.wsdl file were not included, the service definition would simply - be as follows: - <PRE><service name="CalculatorService"> - <binding.ws/> - <reference>CalculatorComponent/CalculatorService</reference> -</service></PRE> - </LI> - <LI>You are now ready to start the Axis2C HTTP server. Remember you will need to have the - TUSCANY_SCACPP, TUSCANY_SDOCPP and AXIS2C_HOME environment variables set, - as well as the SCA and SDO bin directories and the Axis2C lib directory on - your PATH on Windows or the SCA, SDO and Axis2C lib directories on - your LD_LIBRARY_PATH on Linux. You will also need to set the TUSCANY_SCACPP_SYSTEM_ROOT - and TUSCANY_SCACPP_DEFAULT_COMPONENT environment variables to the - path to your SCA component directory structure and the default component respectively. - E.g. on Windows run the following commands: - <UL> - <LI>set TUSCANY_SCACPP=C:/tuscany_sca </LI> - <LI>set TUSCANY_SDOCPP=C:/tuscany_sdo </LI> - <LI>set AXIS2C_HOME=C:/axis2c-bin-0.94-win32 </LI> - <LI>set PATH=%PATH%;C:/tuscany_sca/bin;C:/tuscany_sdo/bin;C:/axis2c-bin-0.94-win32/lib</LI> - <LI>set TUSCANY_SCACPP_SYSTEM_ROOT=C:/tuscany_sca/samples/Calculator/deploy </LI> - <LI>set TUSCANY_SCACPP_DEFAULT_COMPONENT=sample.calculator.CalculatorComponent </LI> - <LI>cd %AXIS2C_HOME%/bin/ </LI> - <LI>./axis2_http_server.exe </LI> - </UL> - </LI> - <LI>Optionally, enable Tuscany logging by setting the TUSCANY_SCACPP_LOGGING - environment variable with the level you wish to log at (0 for minimal - logging, up to 9 for more detailed logging) and the TUSCANY_SCACPP_LOG - environment variable to define the file to log to (if this is not set, - logging will go to the console). E.g. on Windows run the following - commands: - <UL> - <LI>set TUSCANY_SCACPP_LOGGING=5 </LI> - <LI>set TUSCANY_SCACPP_LOG=C:/tuscany/mylogfile.txt</LI> - </UL> - </LI> - </OL> - <P>Your component should now be exposed as an Axis2C Web Service, via the WS - service you created. See the Axis2C documentation for writing clients to - invoke the Web Service, or you can use any other Web Service client platform - (e.g. <A HREF="http://ws.apache.org/axis2">Axis2 for Java</A>), or you can - invoke your service from another SCA application by using Tuscany's WS - reference support. - </P> - - </DIV> - - <DIV CLASS="section"> - <A name="maptable"><H2>XML Schema Type to C++ Type Mapping</H2></A> - <P>To help define the WSDL that describes the interface of your component, the - table below lists how incoming XML data in Web Service messages is mapped to - C++ types used in the parameters and return types of your component operations. - </P> - <P>This lists the only C++ types that can currently be used on the operations of a - component exposed as a Web Service. For other types, use an SDO DataObject to - wrap the data, and define that wrapping as a complexType in the WSDL. See the - <A HREF="http://www.osoa.org/display/Main/SDO+-+Previously+Published+Specifications">SDO - specifications</A> for the C++ types that SDO supports. - </P> - <TABLE CLASS="bodyTable"> - <TBODY> - <TR CLASS="a"> - <TD><STRONG>XML Schema Type</STRONG></TD> - <TD><STRONG>C++ Type</STRONG></TD> - </TR> - <TR CLASS="b"> - <TD>string</TD> - <TD>std::string</TD> - </TR> - <TR CLASS="a"> - <TD>int</TD> - <TD>long</TD> - </TR> - <TR CLASS="b"> - <TD>integer</TD> - <TD>long</TD> - </TR> - <TR CLASS="a"> - <TD>short</TD> - <TD>short</TD> - </TR> - <TR CLASS="b"> - <TD>float</TD> - <TD>float</TD> - </TR> - <TR CLASS="a"> - <TD>double</TD> - <TD>long double</TD> - </TR> - <TR CLASS="b"> - <TD>boolean</TD> - <TD>bool</TD> - </TR> - <TR CLASS="a"> - <TD>hexBinary</TD> - <TD>char*</TD> - </TR> - <TR CLASS="b"> - <TD>base64Binary</TD> - <TD>char*</TD> - </TR> - <TR CLASS="a"> - <TD>byte</TD> - <TD>char</TD> - </TR> - <TR CLASS="b"> - <TD>complexType</TD> - <TD>commonj::sdo::DataObjectPtr</TD> - </TR> - <TR CLASS="a"> - <TD>any</TD> - <TD>commonj::sdo::DataObjectPtr with OpenDataObjectType</TD> - </TR> - </TBODY> - </TABLE> - </DIV> - - <DIV CLASS="section"> - <A name="creatingwsdl"><H2>Notes on creating WSDL</H2></A> - <P>Currently only Document/literal Wrapped style Web Services are supported by - WS EntryPoint, support for RPC style Web Services is planned for future - releases. - </P> - <P>See <A HREF="http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/">this article</A> - for an explanation of Document/literal Wrapped style WSDL and Web Services - </P> - <P>Document/literal Wrapped services require that the operation name is used as - the name of the incoming element that wraps the operation parameters. Additionally, - operation parameter and return messages that are defined in the WSDL must be - XML Schema elements containing a complexType. - </P> - <P>For example, a component operation defined in C++ as: - <PRE>long myOperation(std::string arg1, short arg2, DataObjectPtr arg3);</PRE> - will need to be described in WSDL with messages like: - <PRE><wsdl:message name="myOperationRequestMsg"> - <wsdl:part element="tns:myOperation" name="myOperationRequestPart"/> -</wsdl:message> -<wsdl:message name="myOperationResponseMsg"> - <wsdl:part element="tns:myOperationResponse" name="myOperationResponsePart"/> -</wsdl:message></PRE> - and will need an XML schema to define the types like: - <PRE><xsd:element name="myOperation"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="arg1" type="xsd:string" minOccurs="1"/> - <xsd:element name="arg2" type="xsd:short" minOccurs="1"/> - <xsd:element name="arg3" minOccurs="1"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="dataObjectFloatData" type="xsd:float"/> - <xsd:element name="dataObjectStringData" type="xsd:string"/> - <xsd:element name="dataObjectIntData" type="xsd:int"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - </xsd:complexType> -</xsd:element> - -<xsd:element name="myOperationResponse"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="result" type="xsd:int" minOccurs="1"/> - </xsd:sequence> - </xsd:complexType> -</xsd:element></PRE> - </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> - diff --git a/tags/cpp-1.0-incubating-M2-final/sca/doc/CPPComponents.html b/tags/cpp-1.0-incubating-M2-final/sca/doc/CPPComponents.html deleted file mode 100644 index 4994d4c610..0000000000 --- a/tags/cpp-1.0-incubating-M2-final/sca/doc/CPPComponents.html +++ /dev/null @@ -1,333 +0,0 @@ - -<!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"> -@import url("css/maven-base.css"); -@import url("css/maven-theme.css"); - </STYLE> - - <LINK HREF="css/maven-theme.css" MEDIA="print" REL="stylesheet" - TYPE="text/css"> - <TITLE>Tuscany SCA for C++ - Creating C++ SCA Components</TITLE> -</HEAD> - -<BODY> -<DIV ID="bodyColumn"> - <DIV ID="contentBox"> - <DIV CLASS="section"> - <H2>Tuscany SCA for C++ - Creating C++ SCA Components</H2> - - <P>This document describes how to create and run SCA components in Tuscany SCA C++ - milestone release 2. - </P> - <P>See the <A HREF="http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications">SCA - C++ Client and Implementation specification</A> for more details about the SCA C++ - programming model. - </P> - <P>See <A HREF="../samples/Calculator/README.html">Calculator</A> or - <A HREF="../samples/BigBank/README.html">BigBank</A> for samples that - demonstrate the use of C++ components - </P> - </DIV> - <DIV CLASS="section"> - <H2>Creating and deploying an SCA C++ Component</H2> - <P>Each SCA C++ component needs: - </P> - <UL> - <LI>A service header file that defines the operations that can be invoked on the - component - </LI> - <LI>An implementation header file that defines the implementation and extends - the service header file - </LI> - <LI>A C++ implementation of the service that implements the operations defined - in the service header file - </LI> - <LI>Proxy and wrapper header and implementation files generated by the Tuscany - C++ SCAGEN tool - </LI> - <LI>A service definition in a .componentType file - </LI> - <LI>An SCDL component definition within an SCDL composite file. Usually this - composite file will contain multiple components configured and assembled together. - </LI> - </UL> - <P>Once these items are in place for each component in your composite, you will need to - deploy this composite to your SCA system. In this release we are - using the SCA recursive composition model to do this. You simply create another - SCDL component definition in a separate composite file that will represent the composite - you created above in the SCA system. Follow the steps below to see each of these items - being created and used. - </P> - <P>In this section we will use the Calculator sample as a worked example. - The Calculator code and files can be found at samples/Calculator and has been - developed further than the details specified below. In the interests of - readability, the example used below takes the simplest path. - </P> - <OL> - <LI>Create the service header file that defines the operations your component - will implement. E.g. Calculator.h contains the following:<BR/> - <PRE>#ifndef CALCULATOR_H -#define CALCULATOR_H -class Calculator -{ -public: - virtual float add(float arg1, float arg2) = 0; - virtual float sub(float arg1, float arg2) = 0; - virtual float mul(float arg1, float arg2) = 0; - virtual float div(float arg1, float arg2) = 0; -}; - -#endif</PRE> - </LI> - <LI>Create the implementation header file that extends the service header file. - E.g. CalculatorImpl.h contains the following:<BR/> - <PRE>#ifndef CALCULATORIMPL_H -#define CALCULATORIMPL_H - -#include "Calculator.h" - -class CalculatorImpl : public Calculator -{ -public: - CalculatorImpl(); - virtual ~CalculatorImpl(); - - // Calculator interface - virtual float add(float arg1, float arg2); - virtual float sub(float arg1, float arg2); - virtual float mul(float arg1, float arg2); - virtual float div(float arg1, float arg2); -}; - -#endif</PRE> - </LI> - <LI>Create the implementation for the component based on the implementation - header file. E.g. CalculatorImpl.cpp contains the following code:<BR/> - <PRE>#include "CalculatorImpl.h" -#include <stdio.h> - -CalculatorImpl::CalculatorImpl() -{ -} - -CalculatorImpl::~CalculatorImpl() -{ -} - -// Calculator interface -float CalculatorImpl::add(float arg1, float arg2) -{ - float result = arg1 + arg2; - - printf("CalculatorImpl::add %f + %f = %f\n", arg1, arg2, result); - return result; -} - -float CalculatorImpl::sub(float arg1, float arg2) -{ - float result = arg1 - arg2; - printf("CalculatorImpl::sub %f - %f = %f\n", arg1, arg2, result); - return result; -} - -float CalculatorImpl::div(float arg1, float arg2) -{ - float result = arg1 / arg2; - printf("CalculatorImpl::div %f / %f = %f\n", arg1, arg2, result); - return result; -} - -float CalculatorImpl::mul(float arg1, float arg2) -{ - float result = arg1 * arg2; - printf("CalculatorImpl::mul %f * %f = %f\n", arg1, arg2, result); - return result; -}</PRE> - </LI> - <LI>Create the componentType file for your component to define the service that - your component provides. The file must be named after your implementation - class and specifies the name of the service and the service header file - (which describes the service operations). E.g. CalculatorImpl.componentType - contains the following XML:<BR/> - <PRE><componentType xmlns="http://www.osoa.org/xmlns/sca/1.0"> - - <service name="CalculatorService"> - <interface.cpp header="Calculator.h"/> - </service> - -</componentType></PRE> - </LI> - <LI>Create a sample.calculator.composite file for your composite and define your - component within it. The component definition specifies the implementation - library to use (a .dll file on Windows and a .so file on Linux) and the - implementation header file (which describes the implementation class). Component - properties and references to other services can also be specified here. E.g. the - Calculator sample.calculator.composite file contains the following XML:<BR/> - <PRE><composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - name="sample.calculator"> - - <component name="CalculatorComponent"> - <implementation.cpp library="Calculator" header="CalculatorImpl.h"/> - </component> - -</composite></PRE> - </LI> - <LI>Generate the proxy and wrapper classes and header files using the SCAGEN - tool. These classes are used by the Tuscany SCA C++ runtime to enable - service implementations to be invoked from a client or another component. - Run the SCAGEN tool, specifying the directory where your header files, - sca.composite and componentType file are and the directory where you - want the generated files to be placed. E.g. on Windows, the - following command is run from the directory where Tuscany SCA is deployed:<BR/> - <PRE>./bin/scagen.cmd -dir ./samples/Calculator/sample.calculator -output ./samples/Calculator/sample.calculator</PRE> - which produces the following files: - <UL> - <LI>CalculatorImpl_CalculatorService_Proxy.h</LI> - <LI>CalculatorImpl_CalculatorService_Proxy.cpp</LI> - <LI>CalculatorImpl_CalculatorService_Wrapper.h</LI> - <LI>CalculatorImpl_CalculatorService_Wrapper.cpp</LI> - </UL> - </LI> - <LI>Compile and link the code that has been written and generated. This will - produce a .dll or .so library file. The name should match the library name - specified in the sample.calculator.composite file. - </LI> - <LI>Create the sample.calculator.solution.composite file and define the Calculator composite - as a component within it. This is used to include the Calculator composite in the SCA system - and should specify the composite name used in the sample.calculator.composite file. - E.g. the Calculator sample.calculator.solution.composite - file contains the following XML:<BR/> - <PRE><composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - name="sample.calculator.solution"> - - <component name="sample.calculator.CalculatorComponent"> - <implementation.composite name="sample.calculator" /> - </component> - -</composite></PRE> - </LI> - <LI>Deploy the various files into the SCA directory structure, as follows: - <UL> - <LI><deploy_root>/CompositeName/CompositeName.composite </LI> - <LI><deploy_root>/CompositeName/Implementation.componentType </LI> - <LI><deploy_root>/CompositeName/Implementation.dll (or .so on Linux) </LI> - <LI><deploy_root>/SolutionName.composite </LI> - </UL> - E.g. for the Calculator sample the structure is: - <UL> - <LI>samples/Calculator/deploy/sample.calculator/Calculator.h </LI> - <LI>samples/Calculator/deploy/sample.calculator/CalculatorImpl.h </LI> - <LI>samples/Calculator/deploy/sample.calculator/sample.calculator.composite </LI> - <LI>samples/Calculator/deploy/sample.calculator/CalculatorImpl.componentType</LI> - <LI>samples/Calculator/deploy/sample.calculator/Calculator.dll </LI> - <LI>samples/Calculator/deploy/sample.calculator.solution.composite</LI> - </UL> - </LI> - <LI>Your component, composite and subsystem are now ready to be invoked. Create a - client that will call the service. E.g. the Calculator client (in the - CalculatorClient.cpp file) contains code similar to the following:<BR/> - <PRE>try -{ - // Locate the service - CompositeContext myContext = CompositeContext::getCurrent(); - Calculator *calcService = (Calculator*) myContext.locateService("CalculatorComponent/CalculatorService"); - if (calcService == 0) - { - cout << "calculator_client: Unable to find Calculator service" << endl; - } - else - { - float result = calcService->add(arg1, arg2); - cout << "calculator_client add(" << arg1 << "," << arg2 << ") = " << result << endl; - } -} -catch (ServiceRuntimeException& ex) -{ - cout << "calculator_client: Error whilst invoking Tuscany: " << - ex.getMessageText() << endl; -} -</PRE> - </LI> - <LI>Compile, link and run the client that has been created. You should - (hopefully!) see your component invoked. Remember you will need to have the - TUSCANY_SCACPP, TUSCANY_SDOCPP and AXIS2C_HOME environment variables set, - as well as the SCA and SDO bin directories and the Axis2C lib directory on - your PATH on Windows or the SCA, SDO and Axis2C lib directories on - your LD_LIBRARY_PATH on Linux. You will also need to set the TUSCANY_SCACPP_SYSTEM_ROOT - and TUSCANY_SCACPP_DEFAULT_COMPONENT environment variables to the - path to your SCA component directory structure and the default component respectively. - TUSCANY_SCACPP_SYSTEM_ROOT is the directory where the SCA runtime will look for any - .composite files and TUSCANY_SCACPP_DEFAULT_COMPONENT is the name of the base component - to be used by SCA clients or containers when finding services - this component must be - an instance of a composite (i.e. contain an <implementation.composite> element). - <BR/> - E.g. on Windows run the following commands: - <UL> - <LI>set TUSCANY_SCACPP=C:/tuscany_sca </LI> - <LI>set TUSCANY_SDOCPP=C:/tuscany_sdo </LI> - <LI>set AXIS2C_HOME=C:/axis2c-bin-0.94-win32 </LI> - <LI>set PATH=%PATH%;C:/tuscany_sca/bin;C:/tuscany_sdo/bin;C:/axis2c-bin-0.94-win32/lib</LI> - <LI>set TUSCANY_SCACPP_SYSTEM_ROOT=C:/tuscany_sca/samples/Calculator/deploy </LI> - <LI>set TUSCANY_SCACPP_DEFAULT_COMPONENT=sample.calculator.CalculatorComponent </LI> - <LI>./calculator_client.exe </LI> - </UL> - </LI> - <LI>Optionally, enable Tuscany logging by setting the TUSCANY_SCACPP_LOGGING - environment variable with the level you wish to log at (0 for minimal - logging, up to 9 for more detailed logging) and the TUSCANY_SCACPP_LOG - environment variable to define the file to log to (if this is not set, - logging will go to the console). E.g. on Windows run the following - commands: - <UL> - <LI>set TUSCANY_SCACPP_LOGGING=5 </LI> - <LI>set TUSCANY_SCACPP_LOG=C:/tuscany/mylogfile.txt</LI> - </UL> - </LI> - </OL> - <P>The Calculator sample has been developed further than the details specified - above. In particular, it demonstrates how two services can be wired together - such that one references and invokes the other. It also demonstrates how to - expose the Calculator component service as an Axis2C Web Service. - </P> - </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> - diff --git a/tags/cpp-1.0-incubating-M2-final/sca/doc/PythonExtension.html b/tags/cpp-1.0-incubating-M2-final/sca/doc/PythonExtension.html deleted file mode 100644 index 996262d663..0000000000 --- a/tags/cpp-1.0-incubating-M2-final/sca/doc/PythonExtension.html +++ /dev/null @@ -1,310 +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. ---> - - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<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"> -@import url("css/maven-base.css"); -@import url("css/maven-theme.css"); - </STYLE> - - <LINK HREF="css/maven-theme.css" MEDIA="print" REL="stylesheet" - TYPE="text/css"> - <TITLE>Tuscany SCA for C++ - Python Extension</TITLE> -</HEAD> - -<BODY> -<DIV ID="bodyColumn"> - <DIV ID="contentBox"> - <DIV CLASS="section"> - <H2>Tuscany SCA for C++ - Python Extension</H2> - - <P>The Tuscany Python extension allows Python scripts to be used as components in - SCA composites and as clients that can invoke SCA services. - </P> - <P>See <A HREF="../samples/PythonCalculator/README.html">PythonCalculator</A> for - a sample that demonstrates the use of the Python extension. - </P> - </DIV> - <DIV CLASS="section"> - <H2>Contents</H2> - <OL> - <LI><A HREF="#requirements">System Requirements</A></LI> - <LI><A HREF="#install">Installing the Tuscany SCA Python Extension..</A> - <UL> - <LI><A HREF="#linuxbin">..from the binary release on Linux</A></LI> - <LI><A HREF="#linuxsrc">..from the source release on Linux</A></LI> - <LI><A HREF="#winbin">..from the binary release on Windows</A></LI> - <LI><A HREF="#winsrc">..from the source release on Windows</A></LI> - </UL></LI> - <LI><A HREF="#pm">The Tuscany Python Programming Model</A></LI> - <UL> - <LI><A HREF="#clients">Clients</A></LI> - <LI><A HREF="#components">SCA Components</A></LI> - <LI><A HREF="#references">Component references</A></LI> - <LI><A HREF="#properties">Component properties</A></LI> - </UL> - <LI><A HREF="#help">Getting help</A></LI> - </OL> - </DIV> - <DIV CLASS="section"> - <A NAME="requirements"><H2>System Requirements</H2></A> - - <P>In order to install and use the Tuscany SCA Python Extension there are some - extra requirements in addition to the <A HREF="../GettingStarted.html#requirements">Tuscany - SCA requirements</A>:</P> - <TABLE CLASS="bodyTable"> - - <TBODY> - <TR CLASS="a"> - <TD><B>Software</B></TD> - <TD><B>Download Link</B></TD> - </TR> - <TR CLASS="b"> - <TD>Python version 2.4</TD> - - <TD> - <A HREF="http://www.python.org/download/" - TARGET="_blank">http://www.python.org/download/</A><BR/> - Please download and follow the installation instructions. You can build - the Tuscany SCA Python Extension with other versions of Python - versions 2.3.4 - and higher have been tested. - </TD> - </TR> - </TBODY> - </TABLE> - </DIV> - - <DIV CLASS="section"> - <A NAME="install"><H2>Installing the Tuscany SCA Python Extension</H2></A> - <A NAME="linuxbin"><H3>Getting the Tuscany SCA Python Extension working with the binary release on Linux</H3></A> - <OL> - <LI>Ensure the Python libraries are available on the PATH environment variable</LI> - <LI>Add the <tuscany_sca_install_dir>/extensions/python/lib directory to the PYTHONPATH environment variable</LI> - <LI>Use the following command sequence to enable the extension: - <UL> - <LI>cd <tuscany_sca_install_dir>/extensions/python</LI> - <LI>./deploy.sh</LI> - </UL> - </LI> - </OL> - <A NAME="linuxsrc"><H3>Getting the Tuscany SCA Python Extension working with the source release on Linux</H3></A> - <OL> - <LI>You will need the Tuscany SCA and SDO libraries - follow the instructions - <A HREF="../GettingStarted.html">here</A> to build the SCA libraries and default extensions</LI> - <LI>The following environment variables are required: - <UL> - <LI>TUSCANY_SCACPP=<path to built Tuscany SCA> - <LI>TUSCANY_SDOCPP=<path to installed Tuscany SDO> - <LI>PYTHON_LIB=<path to Python libraries></LI> - <LI>PYTHON_INCLUDE=<path to Python includes></LI> - <LI>PYTHON_VERSION=<name of the Python version><BR/> - Note: If you are using a default installation of Python 2.3 these are usually:<BR/> - PYTHON_LIB=/usr/lib<BR/> - PYTHON_INCLUDE=/usr/include/python2.3<BR/> - PYTHON_VERSION=python2.3<BR/></LI> - </UL></LI> - <LI>Build the Python source only with the following command sequence: - <UL> - <LI>cd <tuscany_sca_install_dir></LI> - <LI>./configure --prefix=$TUSCANY_SCACPP --enable-python --enable-cpp=no</LI> - <LI>make</LI> - <LI>make install</LI> - </UL> - NOTE: If you don't provide a --prefix configure option, it will by default install into - /usr/local/tuscany/sca</LI> - <LI>You will now need to follow the <A HREF="#linuxbin">instructions above</A> to enable - and use the extension.</LI> - </OL> - - <A NAME="winbin"><H3>Getting the Tuscany SCA Python Extension working with the binary release on Windows</H3></A> - <OL> - <LI>Ensure the Python libraries are available on the PATH environment variable</LI> - <LI>Add the <tuscany_sca_install_dir>\extensions\python\bin directory to the PYTHONPATH environment variable</LI> - <LI>Use the following command sequence to enable the extension: - <UL> - <LI>cd <tuscany_sca_install_dir>\extensions\python</LI> - <LI>deploy.cmd</LI> - </UL> - </LI> - </OL> - <A NAME="winsrc"><H3>Getting the Tuscany SCA Python Extension working with the source release on Windows</H3></A> - <OL> - <LI>Unzip the supplied source zip file</LI> - <LI>The following environment variables are required: - <UL> - <LI>TUSCANY_SCACPP=<path to built Tuscany SCA> - <LI>TUSCANY_SDOCPP=<path to installed Tuscany SDO> - <LI>PYTHON_HOME=<path to installed Python> - </UL></LI> - <LI>You must have set up the environment for Microsoft Visual C++ tools. The build command - will call vcvars32 to set the environment. Ensure the directory containing this is on your path. - This will be where you installed the compiler.</LI> - <LI>Build the source: - <UL> - <LI>cd <to where you unzipped the source></LI> - <LI>build</LI> - </UL> - This will build all the projects and put the required output into the 'deploy' directory<BR/><BR/> - Alternatively, open the workspace at <tuscany_sca_install_dir>/projects/tuscany_sca/tuscany_sca.dsw - in Visual Studio 6 or at at <tuscany_sca_install_dir>/projectsvc7/tuscany_sca/tuscany_sca.sln - in Visual Studio 7.1 - you can build projects individually - <LI>Set the TUSCANY_SCACPP environment variable to point to the 'deploy' directory that was just created</LI> - <LI>You will now need to follow the <A HREF="#winbin">instructions above</A> to enable - and use the extension.</LI> - </OL> - </DIV> - - - <DIV CLASS="section"> - <A NAME="pm"><H2>The Tuscany Python Programming Model</H2></A> - <P>This section will explain - the Tuscany Python programming model to help you to write your own Python - components and clients. - </P> - <P>The Tuscany Python component and client support comes from a Python extension - package that is built in the <tuscany_sca_install_dir>/extensions/python/bin - directory on Windows and <tuscany_sca_install_dir>/extensions/python/lib on - Linux. This package must be made available to your Python environment by - adding this directory to your PYTHONPATH environment variable. This makes the sca - module available for use by clients and allows references and properties to be - used in your Python components - </P> - <A NAME="clients"><H3>Clients</H3></A> - <P>Using the sca module, a Python client can search for an SCA service with: - </P> -<PRE>import sca - -calculator = sca.locateservice("CalculatorComponent/CalculatorService") -</PRE> - <P>This finds the component and service as defined in the composite and componentType - side files and returns a proxy object that can call the SCA service. You can then - simply call a business method on "calculator", like this: - </P> -<PRE>result = calculator.add(12.3, 45.6)</PRE> - </P> - <A NAME="components"><H3>Components</H3></A> - <P>Python component implementations are standard Python scripts, where class-level - functions or module-level functions can be invoked by the Tuscany runtime. To - use a Python component implementation, use the implementation.python element in - your .composite file. For example, the following snippet will use the Python script - at path/to/module/PythonModuleName.py, where the path is relative to the location of - the composite file: - </P> -<PRE><implementation.python module="PythonModuleName" path="path/to/module"/> -</PRE> - <P>To instantiate a class instance and use a class-level function, the Python class must - have a default constructor (an __init__ method that takes no arguments besides - 'self') and the class attribute must be defined in the implementation.python element - in your composite, like so: - </P> -<PRE><implementation.python module="PythonModuleName" path="relative/path/to/module" class="PythonClassName"/> -</PRE> - <P>Tuscany currently only supports passing simple types (strings, ints, floats, etc) into - and out of Python components. Support for more complex types, such as Service Data Objects, - will be added in later releases. - </P> - <P>Additionally, Tuscany currently requires a componentType file that corresponds to the - name of the Python module, e.g. for the Python Calculator sample, the module name is - 'CalculatorImpl' and the componentType file is 'CalculatorImpl.componentType'. The - componentType file specifies what services are available on the component and which - references are called by the component. For example, CalculatorImpl.componentType - contains the following: - </P> -<PRE><componentType xmlns="http://www.osoa.org/xmlns/sca/1.0"> - <service name="CalculatorService"> - <interface.python/> - </service> - <reference name="divideService"> - <interface.python/> - </reference> -</componentType> -</PRE> - <A NAME="references"><H3>References</H3></A> - <P>References are automatically added to your Python component implementation when - the runtime loads the implementation script, so they can be used like so: - </P> -<PRE># The module-level div function -def div(val1, val2): - # Use the divideService reference - result = divideService.divide(val1, val2) - return result -</PRE> - <P>and in your composite file: - </P> -<PRE><component name="CalculatorComponent"> - <implementation.python module="CalculatorImpl"/> - <reference name="divideService">DivideComponent/DivideService</reference> -</component> -</PRE> - <A NAME="properties"><H3>Properties</H3></A> - <P>A composite with a property defined for a component like so: - </P> -<PRE><component name="DivideComponent"> - <implementation.python module="DivideImpl"/> - <property name="doRounding">true</property> -</component> -</PRE> - <P>and in the associated .componentType file like so: - </P> -<PRE><componentType ... -... - <property name="doRounding" type="xsd:boolean"/> -</componentType> -</PRE> - <P>means the property is automatically instantiated and assigned the - property value in the Python component implementation, so it can be - used like so: - </P> -<PRE>def divide(val1, val2): - result = float(val1) / float(val2) - print "Python - DivideImpl.divide " + str(val1) + " / " + str(val2) + " = " + str(result) - - # Use the doRounding property - if doRounding: - result = round(result) - print "Python - DivideImpl.divide is rounding the result to " + str(result) - - return result -</PRE> -</P> - </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> - diff --git a/tags/cpp-1.0-incubating-M2-final/sca/doc/RubyExtension.html b/tags/cpp-1.0-incubating-M2-final/sca/doc/RubyExtension.html deleted file mode 100644 index a68bc283a9..0000000000 --- a/tags/cpp-1.0-incubating-M2-final/sca/doc/RubyExtension.html +++ /dev/null @@ -1,304 +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. ---> - - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<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"> -@import url("css/maven-base.css"); -@import url("css/maven-theme.css"); - </STYLE> - - <LINK HREF="css/maven-theme.css" MEDIA="print" REL="stylesheet" - TYPE="text/css"> - <TITLE>Tuscany SCA for C++ - Ruby Extension</TITLE> -</HEAD> - -<BODY> -<DIV ID="bodyColumn"> - <DIV ID="contentBox"> - <DIV CLASS="section"> - <H2>Tuscany SCA for C++ - Ruby Extension</H2> - - <P>The Tuscany Ruby extension allows Ruby scripts to be used as components in - SCA composites and as clients that can invoke SCA services. - </P> - <P>See <A HREF="../samples/RubyCalculator/README.html">RubyCalculator</A> and - <A HREF="../samples/RubyBank/README.html">RubyBank</A> for - two samples that demonstrate the use of the Ruby extension. - </P> - </DIV> - <DIV CLASS="section"> - <H2>Contents</H2> - <OL> - <LI><A HREF="#requirements">System Requirements</A></LI> - <LI><A HREF="#install">Installing the Tuscany SCA Ruby Extension..</A> - <UL> - <LI><A HREF="#linuxbin">..from the binary release on Linux</A></LI> - <LI><A HREF="#linuxsrc">..from the source release on Linux</A></LI> - <LI><A HREF="#winbin">..from the binary release on Windows</A></LI> - <LI><A HREF="#winsrc">..from the source release on Windows</A></LI> - </UL></LI> - <LI><A HREF="#pm">The Tuscany Ruby Programming Model</A></LI> - <UL> - <LI><A HREF="#clients">Clients</A></LI> - <LI><A HREF="#components">SCA Components</A></LI> - <LI><A HREF="#references">Component references</A></LI> - <LI><A HREF="#properties">Component properties</A></LI> - </UL> - <LI><A HREF="#help">Getting help</A></LI> - </OL> - </DIV> - <DIV CLASS="section"> - <A NAME="requirements"><H2>System Requirements</H2></A> - - <P>In order to install and use the Tuscany SCA Ruby Extension there are some - extra requirements in addition to the <A HREF="../GettingStarted.html#requirements">Tuscany - SCA requirements</A>:</P> - <TABLE CLASS="bodyTable"> - - <TBODY> - <TR CLASS="a"> - <TD><B>Software</B></TD> - <TD><B>Download Link</B></TD> - </TR> - <TR CLASS="b"> - <TD>Ruby version 1.8.x</TD> - - <TD> - <A HREF="http://www.ruby-lang.org" - TARGET="_blank">http://www.ruby-lang.org</A><BR/> - Please download and follow the installation instructions. You should - be able to build the Tuscany SCA Ruby Extension with other versions of Ruby. - </TD> - </TR> - </TBODY> - </TABLE> - </DIV> - - <DIV CLASS="section"> - <A NAME="install"><H2>Installing the Tuscany SCA Ruby Extension</H2></A> - <A NAME="linuxbin"><H3>Getting the Tuscany SCA Ruby Extension working with the binary release on Linux</H3></A> - <OL> - <LI>Ensure the Ruby libraries are available on the PATH environment variable</LI> - <LI>Use the following command sequence to enable the extension: - <UL> - <LI>cd <tuscany_sca_install_dir>/extensions/ruby</LI> - <LI>./deploy.sh</LI> - </UL> - </LI> - - </OL> - <A NAME="linuxsrc"><H3>Getting the Tuscany SCA Ruby Extension working with the source release on Linux</H3></A> - <OL> - <LI>You will need the Tuscany SCA and SDO libraries - follow the instructions - <A HREF="../GettingStarted.html">here</A> to build the SCA libraries and default extensions</LI> - <LI>The following environment variables are required: - <UL> - <LI>TUSCANY_SCACPP=<path to built Tuscany SCA> - <LI>TUSCANY_SDOCPP=<path to installed Tuscany SDO> - <LI>RUBY_LIB=<path to Ruby libraries></LI> - <LI>RUBY_INCLUDE=<path to Ruby includes><BR/> - Note: If you are using a default installation of Ruby these are usually:<BR/> - RUBY_LIB=/usr/lib<BR/> - RUBY_INCLUDE=/usr/lib/ruby/1.8/i386-linux</LI> - </UL></LI> - <LI>Build the Ruby source only with the following command sequence: - <UL> - <LI>cd <tuscany_sca_install_dir></LI> - <LI>./configure --prefix=$TUSCANY_SCACPP --enable-ruby --enable-cpp=no</LI> - <LI>make</LI> - <LI>make install</LI> - </UL> - NOTE: If you don't provide a --prefix configure option, it will by default install into - /usr/local/tuscany/sca</LI> - <LI>You will now need to follow the <A HREF="#linuxbin">instructions above</A> to enable - and use the extension.</LI> - - </OL> - - <A NAME="winbin"><H3>Getting the Tuscany SCA Ruby Extension working with the binary release on Windows</H3></A> - <OL> - <LI>Ensure the Ruby libraries are available on the PATH environment variable</LI> - <LI>Use the following command sequence to enable the extension: - <UL> - <LI>cd <tuscany_sca_install_dir>\extensions\ruby</LI> - <LI>deploy.cmd</LI> - </UL> - </LI> - </OL> - <A NAME="winsrc"><H3>Getting the Tuscany SCA Ruby Extension working with the source release on Windows</H3></A> - <OL> - <LI>Unzip the supplied source zip file</LI> - <LI>The following environment variables are required: - <UL> - <LI>TUSCANY_SCACPP=<path to built Tuscany SCA> - <LI>TUSCANY_SDOCPP=<path to installed Tuscany SDO> - <LI>RUBY_HOME=<path to installed Ruby> - </UL></LI> - <LI>You must have set up the environment for Microsoft Visual C++ tools. The build command - will call vcvars32 to set the environment. Ensure the directory containing this is on your path. - This will be where you installed the compiler.</LI> - <LI>Build the source: - <UL> - <LI>cd <to where you unzipped the source></LI> - <LI>build</LI> - </UL> - This will build all the projects and put the required output into the 'deploy' directory<BR/><BR/> - Alternatively, open the workspace at <tuscany_sca_install_dir>/projects/tuscany_sca/tuscany_sca.dsw - in Visual Studio 6 or at at <tuscany_sca_install_dir>/projectsvc7/tuscany_sca/tuscany_sca.sln - in Visual Studio 7.1 - you can build projects individually - or build the samples to rebuild all the projects</LI> - <LI>Set the TUSCANY_SCACPP environment variable to point to the 'deploy' directory that was just created</LI> - <LI>You will now need to follow the <A HREF="#winbin">instructions above</A> to enable - and use the extension.</LI> - - </OL> - </DIV> - - - <DIV CLASS="section"> - <A NAME="pm"><H2>The Tuscany Ruby Programming Model</H2></A> - <P>This section will explain the Tuscany Ruby programming model to help you to - write your own Ruby components and clients. - </P> - <P>The Tuscany Ruby component and client support comes from a Ruby extension - library that is built in the <tuscany_sca_install_dir>/extensions/ruby/bin - directory on Windows and <tuscany_sca_install_dir>/extensions/ruby/lib on - Linux. - </P> - <A NAME="clients"><H3>Clients</H3></A> - <P>Using the Ruby SCA extension library, a Ruby client can search for an SCA service with: - </P> -<PRE>require("libtuscany_sca_ruby") - -calculator = SCA::locateService("CalculatorComponent/CalculatorService") -</PRE> - <P>This finds the component and service as defined in the composite and componentType - side files and returns a proxy object that can call the SCA service. You can then - simply call a business method on "calculator", like this: - </P> -<PRE>result = calculator.add(12.3, 45.6)</PRE> - </P> - <A NAME="components"><H3>Components</H3></A> - <P>Ruby component implementations are standard Ruby scripts, where class-level - functions or module-level functions can be invoked by the Tuscany runtime. To - use a Ruby component implementation, use the implementation.ruby element in - your .composite file. For example: - </P> -<PRE><implementation.ruby script="CalculatorImpl.rb"/> -</PRE> - <P>To instantiate a class instance and use a class-level function, the Ruby class must - have a default constructor (an initialize() method that takes no arguments) and the - class attribute must be definde in the implementation.ruby element - in your composite, like so: - </P> -<PRE><implementation.ruby script="CalculatorImpl.rb" class="CalculatorImpl"/> -</PRE> - <P>Tuscany currently supports passing simple types (strings, ints, floats, etc) as well - as Service Data Objects into and out of Ruby components. Service Data Objects are represented - in Ruby as REXML Document objects (see the <A HREF="../samples/RubyBank/README.html">RubyBank - sample</A> for a demonstration). - </P> - <P>You can write a componentType file for your Ruby component, but you don't have to - the Ruby - extension introspects Ruby component implementation classes for you and binds public - attributes to references and properties. - </P> - <A NAME="references"><H3>References</H3></A> - <P>References can be invoked from Ruby component implementations by the use of public - attributes in the component implementation classes, like this: - </P> -<PRE>class CalculatorImpl - - # Define the public attribute that corresponds to the divideService reference - attr_writer :divideService - -... - - def div(arg1, arg2) - print "Ruby - CalculatorImpl.div\n" - # Invoke the divideService reference - @divideService.divide(arg1.to_f, arg2.to_f) - end - -... -end -</PRE> - <P>and in your composite file: - </P> -<PRE><component name="CalculatorComponent"> - <implementation.ruby script="CalculatorImpl.rb"/> - <reference name="divideService">DivideComponent/DivideService</reference> -</component> -</PRE> - <A NAME="properties"><H3>Properties</H3></A> - <P>A composite with a property defined for a component like so: - </P> -<PRE><component name="DivideComponent"> - <implementation.ruby script="DivideImpl.rb" class="DivideImpl"/> - <property name="round">true</property> -</component> -</PRE> - <P>allows a public attribute of a Ruby component implementation class to be - assigned the property value, so it can be used like so: - </P> -<PRE>class DivideImpl - - # Define the public attribute that corresponds to the round property - attr_writer :round - -... - - def divide(arg1, arg2) - print "Ruby - DivideImpl.divide ", arg1, " / ", arg2, "\n" - res = arg1.to_f / arg2.to_f - # Use the round property - if @round then - res = res.round - print "DivideImpl.divide rounding\n" - end - print "DivideImpl.divide ", res, "\n" - res - end -end -</PRE> -</P> - </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> - diff --git a/tags/cpp-1.0-incubating-M2-final/sca/doc/css/maven-base.css b/tags/cpp-1.0-incubating-M2-final/sca/doc/css/maven-base.css deleted file mode 100644 index f2c4be6f4e..0000000000 --- a/tags/cpp-1.0-incubating-M2-final/sca/doc/css/maven-base.css +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev:$ $Date:$ */ - -body { - margin: 0px; - padding: 0px; -} -img { - border:none; -} -table { - padding:0px; - width: 100%; - margin-left: -2px; - margin-right: -2px; -} -acronym { - cursor: help; - border-bottom: 1px dotted #feb; -} -table.bodyTable th, table.bodyTable td { - padding: 2px 4px 2px 4px; - vertical-align: top; -} -div.clear{ - clear:both; - visibility: hidden; -} -div.clear hr{ - display: none; -} -#bannerLeft, #bannerRight { - font-size: xx-large; - font-weight: bold; -} -#bannerLeft img, #bannerRight img { - margin: 0px; -} -.xleft, #bannerLeft img { - float:left; - text-shadow: #7CFC00; -} -.xright, #bannerRight img { - float:right; - text-shadow: #7CFC00; -} -#banner { - padding: 0px; -} -#banner img { - border: none; -} -#breadcrumbs { - padding: 3px 10px 3px 10px; -} -#leftColumn { - width: 150px; - float:left; -} -#bodyColumn { - margin-right: 1.5em; - margin-left: 177px; -} -#legend { - padding: 8px 0 8px 0; -} -#navcolumn { - padding: 8px 4px 0 8px; -} -#navcolumn h5 { - margin: 0; - padding: 0; - font-size: small; -} -#navcolumn ul { - margin: 0; - padding: 0; - font-size: small; -} -#navcolumn li { - list-style-type: none; - background-image: none; - background-repeat: no-repeat; - background-position: 0 0.4em; - padding-left: 16px; - list-style-position: ouside; - line-height: 1.2em; - font-size: smaller; -} -#navcolumn li.expanded { - background-image: url(../images/expanded.gif); -} -#navcolumn li.collapsed { - background-image: url(../images/collapsed.gif); -} -#poweredBy { - text-align: center; -} -#navcolumn img { - margin-top: 10px; - margin-bottom: 3px; -} -#poweredBy img { - display:block; - margin: 20px 0 20px 17px; - border: 1px solid black; - width: 90px; - height: 30px; -} -#search img { - margin: 0px; - display: block; -} -#search #q, #search #btnG { - border: 1px solid #999; - margin-bottom:10px; -} -#search form { - margin: 0px; -} -#lastPublished { - font-size: x-small; -} -.navSection { - margin-bottom: 2px; - padding: 8px; -} -.navSectionHead { - font-weight: bold; - font-size: x-small; -} -.section { - padding: 4px; -} -#footer { - padding: 3px 10px 3px 10px; - font-size: x-small; -} -#breadcrumbs { - font-size: x-small; - margin: 0pt; -} -.source { - padding: 12px; - margin: 1em 7px 1em 7px; -} -.source pre { - margin: 0px; - padding: 0px; -} diff --git a/tags/cpp-1.0-incubating-M2-final/sca/doc/css/maven-theme.css b/tags/cpp-1.0-incubating-M2-final/sca/doc/css/maven-theme.css deleted file mode 100644 index f0c0a9ac48..0000000000 --- a/tags/cpp-1.0-incubating-M2-final/sca/doc/css/maven-theme.css +++ /dev/null @@ -1,166 +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. - */ - -/* $Rev:$ $Date:$ */ - -body { - padding: 0px 0px 10px 0px; -} -body, td, select, input, li{ - font-family: Verdana, Helvetica, Arial, sans-serif; - font-size: 13px; - padding: 4px 4px 4px 4px; - line-height: 1.5em; -} -code{ - font-family: Courier, monospace; - font-size: 13px; -} -a { - text-decoration: none; -} -a:link { - color:#36a; -} -a:visited { - color:#47a; -} -a:active, a:hover { - color:#69c; -} -#legend li.externalLink { - background: url(../images/external.png) left top no-repeat; - padding-left: 18px; -} -a.externalLink, a.externalLink:link, a.externalLink:visited, a.externalLink:active, a.externalLink:hover { - background: url(../images/external.png) right center no-repeat; - padding-right: 18px; -} -#legend li.newWindow { - background: url(../images/newwindow.png) left top no-repeat; - padding-left: 18px; -} -a.newWindow, a.newWindow:link, a.newWindow:visited, a.newWindow:active, a.newWindow:hover { - background: url(../images/newwindow.png) right center no-repeat; - padding-right: 18px; -} -h2 { - padding: 4px 4px 4px 6px; - border: 1px solid #999; - color: #900; - background-color: #ddd; - font-weight:900; - font-size: x-large; -} -h3 { - padding: 4px 4px 4px 6px; - border: 1px solid #aaa; - color: #900; - background-color: #eee; - font-weight: normal; - font-size: large; -} -h4 { - padding: 4px 4px 4px 6px; - border: 1px solid #bbb; - color: #900; - background-color: #fff; - font-weight: normal; - font-size: large; -} -h5 { - padding: 4px 4px 4px 6px; - color: #900; - font-size: normal; -} -p { - line-height: 1.5em; - font-size: small; -} -#breadcrumbs { - border-top: 1px solid #aaa; - border-bottom: 1px solid #aaa; - background-color: #ccc; -} -#leftColumn { - margin: 10px 0 0 5px; - border: 1px solid #999; - background-color: #eee; -} -#navcolumn h5 { - font-size: smaller; - border-bottom: 1px solid #aaaaaa; - padding-top: 2px; - color: #000; -} - -table.bodyTable th { - color: white; - background-color: #bbb; - text-align: left; - font-weight: bold; -} - -table.bodyTable th, table.bodyTable td { - font-size: 1em; -} - -table.bodyTable tr.a { - background-color: #ddd; -} - -table.bodyTable tr.b { - background-color: #eee; -} - -.source { - border: 1px solid #999; -} -dl { - padding: 4px 4px 4px 6px; - border: 1px solid #aaa; - background-color: #ffc; -} -dt { - color: #900; -} -#organizationLogo img, #projectLogo img, #projectLogo span{ - margin: 8px; -} -#banner { - border-bottom: 1px solid #fff; -} -.sourcecode { - border: 1px solid #999; - font-family: Courier, monospace; - font-size: 13px; - white-space: pre; - padding: 4px 4px 4px 6px; - margin: 4px 4px 4px 6px; -} -pre { - border: 1px solid #999; - font-family: Courier, monospace; - font-size: 13px; - white-space: pre; - padding: 4px 4px 4px 6px; - margin: 4px 4px 4px 6px; -} - - |