Tuscany Samples - Getting Started - SDO C++ Milestone release 3
Tuscany SDO C++ includes some simple technology samples that demonstrate some of the basic sceanrios for C++ SDO.
This page describes the samples and what is needed to install and run them.
- The ObjectCreation sample demonstrates building the metadata programmatically, followed by use
of the metadata to instantiate objects in a graph.
- The XSDLoading sample shows how to load metadata from an XSD, and how to check for errors during
parsing. The parser gathers all non-fatal errors into one list, so all errors can be checked at one
time after parsing. Elements which contained errors will have been omitted from the resulting metadata.
- The ChangeSummarySave sample modifies a data graph of employees, and saves the modified graph with
its change summary. The output in ChangeSummarySave-output.xml shows the summary and its relationship
by references to the data graph.
- The Substitutes sample shows how to use substitites in XSD to achieve a property which will accept a
range of types.
- The Query sample shows how to use XPath to navigate within a graph to the required element. Note
that exceptions such as "path not found" may well be thrown if the XPath specified does not lead to
a real object in the graph.
The SDO samples are built together into a single executable called sdo_misc.exe on Windows and sdo_misc on Linux
Building the samples on Linux or Mac OS X
- The following environment variables are required:
- TUSCANY_SDOCPP=<path to installed Tuscany SDO>
- Build the source with the following command sequence:
- cd <tuscany_sdo_install_dir>/samples
- ./configure --prefix=<tuscany_sdo_install_dir>/deploy --enable-static=no
- make
- make install
NOTE: If you don't provide a --prefix configure option, it will by default install into
/usr/local/tuscany/sdo/samples/misc
A script, build.sh, is provided that will build and deploy the SDO for C++ samples to $TUSCANY_SCACPP/samples.
Running the samples on Linux or Mac OS X
- Ensure that <tuscany_sdo_install_dir>/lib is included in the LD_LIBRARY_PATH environment variable
- Run the sample with the following commands:
- cd <tuscany_sdo_install_dir>/samples/misc/deploy
- ./bin/sdo_misc
Building the samples on Windows
If using the binary distribution the samples are built and installed in
<tuscany_sdo_install_dir>/samples - go directly to Running the samples on Windows.
- The following environment variables are required:
- TUSCANY_SDOCPP=<path to installed Tuscany SDO>
- You must have set up the environment for Microsoft Visual Studio Express 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.
- Build the source, either via the Visual Studio Express projects under
<tuscany_sdo_install_dir>\samples\misc\VSExpress or via the command-line build file
found at <tuscany_sdo_install_dir>\samples\misc\build.bat
which will build and deploy the sample.
Building the samples on Windows with Apache STDCXX
STDCXX is an implementation of the C++ Standard Library provided by Apache.
The website is at http://incubator.apache.org/stdcxx/.
You must begin by downloading and building STDCXX as described here
STDCXX is supported only when used with Microsoft Visual Studio C++ V7.1. Launch the
MSVC++ 7.1 studio by opening the file
<tuscany_sdo_install_dir>samples\ides\devstudio7\projects\misc\misc.sln
The sdo_misc project includes build configurations that
use STDCXX. There are several ways to access the build configurations, and all
are equally effective. As an example, open the Property pages for sdo_misc by
right clicking on sdo_misc in the Solution Explorer pane and selecting
Properties. The Configuration property in the top left corner of the pane is a
drop down box offering four options: Debug, Release, stdcxx-Debug,
stdcxx-Release. Choose the one you want and then launch the build.
All components that are linked (by the linker) must all use the same C++
Standard library. Therefore, if either sdo_misc or sdo_runtime are built with
STDCXX then both must be.
Running the samples on Windows
- Ensure that <tuscany_sdo_install_dir>\bin is included in the PATH environment variable
- Run the sample with the following commands:
- cd <tuscany_sdo_install_dir>/samples/misc/deploy
- bin\sdo_misc