You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ad...@apache.org on 2007/11/12 23:03:24 UTC

svn commit: r594314 [3/9] - in /incubator/tuscany/sandbox/crestani/das_distribution_example: ./ bin/ bin/antscripts/ bin/bin/ bin/include/ bin/include/apache/ bin/include/apache/das/ bin/include/apache/das/rdb/ bin/lib/ bin/samples/ bin/samples/Company...

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/StatementPtr.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/StatementPtr.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/StatementPtr.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/StatementPtr.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+#ifndef STATEMENT_PTR_H
+#define STATEMENT_PTR_H
+
+#include "apache/das/RefCountingPointer.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+	class Statement;
+	typedef ::apache::das::RefCountingPointer<Statement> StatementPtr;
+
+		};
+	};
+};
+
+#endif //STATEMENT_PTR_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/Table.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/Table.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/Table.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/Table.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,84 @@
+/*
+ * 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.    
+ */
+#ifndef TABLE_H
+#define TABLE_H
+
+#include <map>
+#include <list>
+#include <string>
+#include <stdexcept>
+#include <algorithm>
+
+#include "apache/das/rdb/das_constants.h"
+#include "apache/das/rdb/RelationshipWrapper.h"
+#include "apache/das/rdb/Relationship.h"
+#include "apache/das/rdb/KeyPair.h"
+#include "apache/das/rdb/ResultSet.h"
+#include "apache/das/rdb/Column.h"
+#include "apache/das/rdb/DASImpl.h"
+#include "apache/das/rdb/ODBCTypeHelper.h"
+#include "apache/das/DASInvalidTypeNameException.h"
+
+#include "commonj/sdo/DataFactory.h"
+#include "commonj/sdo/DataObject.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class Column;
+class GraphBuilderMetaData;
+
+class Table {
+
+	private:
+		std::map<std::string, const Column*>* columns;
+		std::string tableName;
+		std::string typeName;
+
+		Column& newColumn(Column& column);
+		
+	public:
+		Table(std::string tableName);
+		Table(std::string tableName, std::string typeName);
+		Table(const Table& table);
+		virtual ~Table(void);
+
+		Column& addColumn(std::string columnName, SQLSMALLINT sqlType);
+		Column& addColumn(const Column& column);
+		void setTypeName(std::string typeName);
+		
+		std::string getTypeName(void) const;
+		std::string getTableName(void) const;
+		const Column* getColumn(std::string columnName) const;
+		Column* getColumn(std::string columnName);
+		const Column* getColumnByProperty(std::string propertyName) const;
+		const std::map<std::string, const Column*>& getColumns(void) const;
+		unsigned int getPKColumnCount(void) const;
+		const Column* getOCCColumn(void) const;
+		
+		void createGraph(const GraphBuilderMetaData& graphBuilderMetaData, commonj::sdo::DataFactoryPtr dataFactory) const;
+		
+};
+
+			};
+		};
+	};
+
+#endif //TABLE_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/TableData.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/TableData.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/TableData.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/TableData.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,66 @@
+/*
+ * 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.    
+ */
+#ifndef TABLE_DATA_H
+#define TABLE_DATA_H
+
+#include <list>
+#include <map>
+#include <string>
+#include <stdexcept>
+
+#include "apache/das/rdb/PKObject.h"
+#include "apache/das/rdb/Table.h"
+
+#include "commonj/sdo/DataObject.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class ColumnData;
+class ResultSet;
+class GraphBuilder;
+class Table;
+
+typedef std::map<std::string, ColumnData*> KeyDataList;
+
+class TableData : public PKObject {
+
+	protected:
+		commonj::sdo::DataObjectPtr dataObject;
+		std::map<std::string, ColumnData*> columnsData;
+	
+	public:
+		TableData(const Table& table, ResultSetPtr resultSet);
+		virtual ~TableData(void);
+
+		bool hasPK(void) const;
+		commonj::sdo::DataObjectPtr getGraphObject(void) const;
+
+		ColumnData* getColumnData(std::string columnName) const;
+		
+		void populateDataGraph(GraphBuilder& graphBuilder);
+		
+};
+
+		};
+	};
+};
+
+#endif //TABLE_DATA_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/das_constants.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/das_constants.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/das_constants.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/bin/include/apache/das/rdb/das_constants.h Mon Nov 12 14:02:46 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.    
+ */
+
+#define DAS_ROOT_NAME "DAS_ROOT"
+#define DAS_NAMESPACE "apache.das"
+#define SDO_NAMESPACE "commonj.sdo"
+#define SQL_NULL_VALUE "NULL"

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/bin/lib/tuscany_das.lib
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/bin/lib/tuscany_das.lib?rev=594314&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/tuscany/sandbox/crestani/das_distribution_example/bin/lib/tuscany_das.lib
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/Readme.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/Readme.html?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/Readme.html (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/Readme.html Mon Nov 12 14:02:46 2007
@@ -0,0 +1,148 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+<HEAD>
+	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
+	<TITLE>Tuscany RDB DAS Sample</TITLE>
+	<META NAME="GENERATOR" CONTENT="BrOffice.org 2.0  (Win32)">
+	<META NAME="CREATED" CONTENT="20070623;3134782">
+	<META NAME="CHANGEDBY" CONTENT="a a">
+	<META NAME="CHANGED" CONTENT="20070625;523460">
+	<META NAME="ProgId" CONTENT="Word.Document">
+	<META NAME="Originator" CONTENT="Microsoft Word 10">
+	<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
+	<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+  <o:Author>IBM_USER</o:Author>
+  <o:LastAuthor>IBM_USER</o:LastAuthor>
+  <o:Revision>5</o:Revision>
+  <o:TotalTime>25</o:TotalTime>
+  <o:Created>2006-10-19T16:54:00Z</o:Created>
+  <o:LastSaved>2006-10-24T16:41:00Z</o:LastSaved>
+  <o:Pages>1</o:Pages>
+  <o:Words>739</o:Words>
+  <o:Characters>4216</o:Characters>
+  <o:Company>IBM</o:Company>
+  <o:Lines>35</o:Lines>
+  <o:Paragraphs>9</o:Paragraphs>
+  <o:CharactersWithSpaces>4946</o:CharactersWithSpaces>
+  <o:Version>10.6735</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]-->
+	<!--[if gte mso 9]><xml>
+ <w:WordDocument>
+  <w:SpellingState>Clean</w:SpellingState>
+  <w:GrammarState>Clean</w:GrammarState>
+  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
+ </w:WordDocument>
+</xml><![endif]-->
+	<!--[if !mso]><object
+ classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
+<style>
+st1\:*{behavior:url(#ieooui) }
+</style>
+<![endif]-->
+	<!--[if gte mso 10]>
+<style>
+ /* Style Definitions */
+ table.MsoNormalTable
+	{mso-style-name:"Table Normal";
+	mso-tstyle-rowband-size:0;
+	mso-tstyle-colband-size:0;
+	mso-style-noshow:yes;
+	mso-style-parent:"";
+	mso-padding-alt:0in 5.4pt 0in 5.4pt;
+	mso-para-margin:0in;
+	mso-para-margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:10.0pt;
+	font-family:"Times New Roman";}
+</style>
+<![endif]-->
+	<!--[if gte mso 9]><xml>
+ <u1:shapelayout u2:ext="edit">
+  <u1:idmap u2:ext="edit" data="1"/>
+ </u1:shapelayout>
+</xml><![endif]-->
+	<!--[if gte mso 9]><xml>
+ <o:shapedefaults v:ext="edit" spidmax="3074"/>
+</xml><![endif]-->
+	<!--[if gte mso 9]><xml>
+ <o:shapelayout v:ext="edit">
+  <o:idmap v:ext="edit" data="1"/>
+ </o:shapelayout></xml><![endif]-->
+	<!-- <p class=MsoNormal><span style="font-size: 9pt">&nbsp;</span></p>
+<pre><a name="header-text">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
+&quot;License&quot;); 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
+&quot;AS IS&quot; 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.   </a></pre>
+<p class=MsoNormal><span style="font-size: 9pt"><br>
+&nbsp;</span></p>
+<p class=MsoNormal><span style='font-size:9.0pt'>
+<o:p>&nbsp;</o:p></span></p>
+
+-->
+	<STYLE>
+	<!--
+		H1 { color: #000000 }
+		P { color: #000000; font-family: "Verdana", "Helvetica", "Arial", sans-serif; font-size: 12pt }
+		H2 { background: #dddddd; border: 1px solid #999999; padding-top: 0.11cm; padding-bottom: 0.11cm; padding-left: 0.16cm; padding-right: 0.11cm; color: #990000 }
+		A:visited { color: #800080 }
+		A:link { color: #3366aa; text-decoration: none }
+	-->
+	</STYLE>
+</HEAD>
+<BODY LANG="en-US" TEXT="#000000" LINK="#3366aa" VLINK="#800080" DIR="LTR" STYLE="border: none; padding: 0cm">
+<H1 LANG="pt-BR">Tuscany RDB DAS Sample (CompanySample)&nbsp;</H1>
+<P LANG="pt-BR">This sample shows how to load data from a RDB
+					source, using RDB DAS, into a SDO graph, then retrieve data
+					from it, modify the graph and update the data source based on the modified graph.</P>
+<H2 LANG="pt-BR">Setup</H2>
+<UL>
+	<LI><P LANG="pt-BR"><SPAN STYLE="text-decoration: none"><FONT COLOR="#000000">Follow
+	the
+	<A HREF="https://svn.apache.org/repos/asf/incubator/tuscany/cpp/das/GettingStarted.html">https://svn.apache.org/repos/asf/incubator/tuscany/cpp/das/GettingStarted.html</A>
+	document to download, compile and install Tuscany DAS for C++.</FONT></SPAN></P>
+	<LI><P  ><SPAN STYLE="text-decoration: none">Download
+			the latest version of Postgres Core and ODBC Driver. You can find it
+			here: <A HREF="http://www.postgresql.org/download/">http://www.postgresql.org/download/</A>.</SPAN></P>
+			<LI><P  ><SPAN STYLE="text-decoration: none">Install both, Postgres Core and ODBC Driver, on your OS.</SPAN></P>
+
+</UL>
+<H2 LANG="pt-BR">Compiling the Sample</H2>
+<P LANG="pt-BR">Compile the sample source using Visual Studio Express
+solution under &lt;tuscany_das_cpp&gt;/samples/CompanySample/VSExpress/.</P>
+<H2 LANG="pt-BR">Running the Sample</H2>
+<P LANG="pt-BR">To run the sample execute the file
+&lt;tuscany_das_cpp&gt;/samples/CompanySample/VSExpress/debug/CompanySample.exe</P>
+<P LANG="pt-BR"><B>Requirements</B>:</P>
+<UL>
+	<LI><P LANG="pt-BR">Postgres server must be running accepting connection from localhost.</P>
+				<LI><P  >The sample access a data source using DSN, it by default access a DSN named "DAStestcases" using "postgres" user with "tuscany" password. However this settings can be modified on main function defined on &lt;tuscany_das_cpp&gt;/samples/CompanySample/src/main.cpp:
+<P STYLE="margin-left: 2cm; margin-bottom: 0cm"><FONT SIZE=2>...<BR>std::string
+		dsn = <FONT COLOR="#800000">&quot;DASCompanySample&quot;</FONT><FONT COLOR="#000000">;</FONT><BR><FONT COLOR="#000000">std::string
+		user = <FONT COLOR="#800000">&quot;postgres&quot;</FONT><FONT COLOR="#000000">;</FONT><BR><FONT COLOR="#000000">std::string
+		password = <FONT COLOR="#800000">&quot;tuscany&quot;</FONT<FONT COLOR="#000000">;</FONT><BR><FONT COLOR="#000000">...</FONT></FONT></FONT></P>
+</UL>
+<H2 LANG="pt-BR"><FONT SIZE=5><B>Sample Architecture</B></FONT></H2>
+<P LANG="pt-BR"><FONT SIZE=2>The sample files are located under
+&lt;tuscany_das_cpp&gt;/samples/CompanySample/.</FONT></P>
+<P LANG="pt-BR"><FONT SIZE=2><B>Contents</B>:</FONT></P>
+
+<UL>
+	<LI><P LANG="pt-BR"><FONT SIZE=2>/src/main.cpp: This file contains the sample source code.</FONT></P>
+</UL>
+
+</BODY>
+</HTML>
\ No newline at end of file

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/bin/CompanySample.exe
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/bin/CompanySample.exe?rev=594314&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/bin/CompanySample.exe
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/bin/CompanySample.exe.manifest
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/bin/CompanySample.exe.manifest?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/bin/CompanySample.exe.manifest (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/bin/CompanySample.exe.manifest Mon Nov 12 14:02:46 2007
@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
+<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
+  <dependency>
+    <dependentAssembly>
+      <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
+    </dependentAssembly>
+  </dependency>
+</assembly>

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/build.xml?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/build.xml (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/build.xml Mon Nov 12 14:02:46 2007
@@ -0,0 +1,134 @@
+<?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.
+-->
+<project name="TuscanyDASNative_Sample_CompanySample" default="all" basedir="../..">
+
+  <import file="${basedir}/antscripts/system.xml"/>
+  <import file="${basedir}/antscripts/compile-targets.xml"/>
+
+  <!--
+    Notice that the basedir for this project is set to the TuscanyDAS root dir
+    This makes path setting in system.xml much simpler, but we'll just have to
+    set a property here to this directory.
+  -->
+
+  <target name="init">
+    <tstamp/>
+    <property name="this.dir" location="${basedir}/samples/CompanySample"/>
+    <property name="sample.CompanySample.dir"            location="${this.dir}/build"/>
+    <property name="sample.CompanySample.src.dir"            location="${this.dir}/src/"/>
+    <property name="sample.CompanySample.build.dir"      location="${sample.CompanySample.dir}/build"/>
+    <property name="CompanySample.install.dir"
+              location="${tuscanyDAS.install.dir}/samples/CompanySample/bin"/>
+
+
+  </target>
+
+  <!--
+    Public targets
+  -->
+  <target name="all"
+          description="build and install the TuscanyDASNative CompanySample sample">
+    <antcall target="build"/>
+    <antcall target="install"/>
+  </target>
+
+  <target name="build"
+          description="build the TuscanyDASNative CompanySample sample">
+    <antcall target="build.sample.CompanySample"/>
+  </target>
+
+  <target name="install"
+          description="Install the TuscanyDASNative CompanySample sample">
+    <antcall target="install.sample.CompanySample"/>
+  </target>
+
+  <target name="clean"
+          description="Clean the TuscanyDASNative CompanySample sample">
+    <antcall target="clean.sample.CompanySample"/>
+    
+  </target>
+
+  <target name="distribution" description="Generate the necessary  distribution files of Company
+Sample and copy it to the distribution dir">
+    <antcall target="sample.CompanySample.distribution"/>
+  </target>
+
+  <!--
+    Internal targets
+    They can still be called, they're just not described, so wont show up in "ant -p"
+  -->
+
+    <!-- build -->
+
+  <target name="build.sample.CompanySample" depends="init,check.sdo">
+    <mkdir dir="${sample.CompanySample.build.dir}"/>
+
+    <copy todir="${sample.CompanySample.build.dir}">
+      <fileset dir="${sample.CompanySample.dir}" includes="*.h"/>
+      <fileset dir="${sample.CompanySample.dir}" includes="*.cpp"/>
+    </copy>
+    <!-- build the library -->
+    <cpp-build
+        srcdir="${sample.CompanySample.src.dir}"
+        infiles="*.cpp"
+        outdir="${sample.CompanySample.build.dir}/.libs"
+	outtype="executable"
+        outfile="CompanySample">
+      <custom-build-elements>
+	<includepath path="${tuscanyDAS.install.dir}/include"/>
+	<includepath path="${tuscany.sdo.home.dir}/include"/>
+
+        <libset dir="${tuscanyDAS.install.dir}/lib" libs="tuscany_das"/>
+	<libset dir="${tuscany.sdo.home.dir}/lib" libs="tuscany_sdo"/>
+	<libset libs="odbc32"/>
+
+      </custom-build-elements>
+    </cpp-build>
+  </target>
+
+  
+    <!-- install -->
+
+  <target name="install.sample.CompanySample" depends="init">
+    <cpp-install-files
+        files="*.exe*"
+        srcdir="${sample.CompanySample.dir}/build/.libs/"
+        destdir="${CompanySample.install.dir}"/>
+    <copy todir="${CompanySample.install.dir}/../rsc" overwrite="true">
+	  <fileset dir="${this.dir}/rsc/"/>
+    </copy>
+
+  </target> 
+
+    <!-- clean -->
+
+  <target name="clean.sample.CompanySample" depends="init">
+    <delete dir="${sample.CompanySample.dir}" quiet="true"/>
+  </target>
+
+ <target name="sample.CompanySample.distribution">
+    <copy todir="${distribution.bin.dir}/samples/CompanySample" overwrite="true">
+	  <fileset dir="${this.dir}/CompanySample" excludes="build/ rsc/ VSExpress/"/>
+    </copy>
+   
+
+  </target>
+
+</project>

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/rsc/sampleConfig.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/rsc/sampleConfig.xml?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/rsc/sampleConfig.xml (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/rsc/sampleConfig.xml Mon Nov 12 14:02:46 2007
@@ -0,0 +1,35 @@
+<?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.
+ -->
+
+<Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd" uri="test.composite.relationship"> 
+
+	<Command name="get all tables" SQL="SELECT * from department, company, employee;"/>
+
+	<Table tableName="department">
+      	<Column sqlType="integer" columnName="id" primaryKey="true"/>
+		<Column sqlType="varchar" columnName="name" primaryKey="true"/>
+	</Table>
+
+	<Relationship primaryKeyTable="department" foreignKeyTable="employee" many="true">
+      	<KeyPair primaryKeyColumn="id" foreignKeyColumn="department_id"/>
+		<KeyPair primaryKeyColumn="name" foreignKeyColumn="department_name"/>
+	</Relationship>
+
+</Config>
\ No newline at end of file

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/src/main.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/src/main.cpp?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/src/main.cpp (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/bin/samples/CompanySample/src/main.cpp Mon Nov 12 14:02:46 2007
@@ -0,0 +1,175 @@
+/*
+ * 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.    
+ */
+
+#include <string>
+#include <iostream>
+#include <direct.h>
+
+// including DAS headers
+#include <apache/das/rdb/Connection.h>
+#include <apache/das/rdb/DASImpl.h>
+#include <apache/das/rdb/SQLException.h>
+#include <apache/das/CommandPtr.h>
+
+// including SDO header
+#include <commonj/sdo/DataObject.h>
+
+using namespace apache::das::rdb;
+using namespace apache::das;
+using namespace commonj::sdo;
+using namespace std;
+
+std::string clearDBStatements[] = {	"delete from employee",
+									"delete from department",
+									"delete from company",
+									"drop table employee",
+									"drop table department",
+									"drop table company"
+								  };
+
+std::string resetDBStatements[] = {	"create table company ( id int not null, name varchar(20), primary key(id) )",
+									"create table department ( id int not null, name varchar(20) not null, company_id int, foreign key (company_id) references company (id), primary key(id, name) )",
+									"create table employee ( id int not null, name varchar(20), department_id int, department_name varchar(20), primary key(id) )",
+									"insert into company values (1, 'apache')",
+									"insert into company values (2, 'acme')",
+									"insert into company values (3, 'google')",
+									"insert into company values (4, 'ibm')",
+									"insert into company values (5, 'yahoo')",
+									"insert into department values (1, 'department1', 1)",
+									"insert into department values (2, 'department1', 1)",
+									"insert into department values (3, 'department2', 2)",
+									"insert into department values (5, 'department3', 3)",
+									"insert into department values (4, 'department5', 2)",
+									"insert into department values (6, 'department6', 3)",
+									"insert into employee values (1, 'adriano', 1, 'department1')",
+									"insert into employee values (2, 'paul', 1, 'department1')",
+									"insert into employee values (3, 'richard', 1, 'department1')",
+									"insert into employee values (4, 'ema', 2, 'department2')",
+									"insert into employee values (5, 'james', 2, 'department2')"
+								};
+
+Connection* getConnection() {
+	Connection* conn;
+
+	try {
+		//Connect to a database using a DSN
+		std::string dsn = "DASCompanySample";
+		std::string user = "postgres";
+		std::string password = "tuscany";
+
+		conn = new Connection(dsn, user, password);
+		
+	} catch (SQLException& ex) {
+		cout << "couldn't connect to the data source: " << ex.what() << endl;
+		system("PAUSE");
+		exit(1);
+
+	}
+
+	// Create and populate the database tables
+
+	StatementPtr stmt = conn->createStatement();
+
+	for (unsigned int i = 0 ; i < 6 ; i++) {
+
+		try {
+			stmt->executeQuery(clearDBStatements[i]);
+		} catch (SQLException& ex) {cout << ex.what() << endl;}
+
+	}
+
+	for (unsigned int i = 0 ; i < 19 ; i++) {
+
+		try {
+			stmt->executeQuery(resetDBStatements[i]);
+		} catch (SQLException& ex) {cout << ex.what() << endl;}
+	
+	}
+
+	// Commit the changes
+	stmt->executeQuery("commit");
+	
+	return conn;
+
+}
+
+void main() {
+	ConfigImpl config("../rsc/sampleConfig.xml");
+	
+	// Get a connection
+	Connection* connection = getConnection();
+	
+	// Create a DAS instance providing a connection using a factory 
+	DASImpl* das = (DASImpl*) DASImpl::getFACTORY().createDAS(config, *connection);
+
+	// Get a SQL command from the config
+	CommandPtr command = das->getCommand("get all tables");
+
+	// Execute the sql command and generate a SDO graph with the returned data
+	DataObjectPtr root = command->executeQuery();
+
+	// Get all companies
+	DataObjectList& companyList = root->getList("COMPANY");
+	
+	// Print each company id and name
+	for (int i = 0 ; i < companyList.size() ; i++) {
+		// Get the company id
+		long id = companyList[i]->getInt("ID");
+
+		// Get the name string length and allocate enough space for it
+		unsigned int stringLength = companyList[i]->getLength("NAME");
+		wchar_t* buffer = new wchar_t[stringLength];
+
+		// Get the company name
+		companyList[i]->getString("NAME", buffer, stringLength);
+		wstring name = wstring(buffer, stringLength);
+
+		// Print the company data
+		wcout << "Company: " << i << endl;
+		wcout << "   id = " << id << endl;
+		wcout << "   name = " << name << endl << endl;
+
+		// Free the allocated memory
+		delete [] buffer;
+
+	}
+
+	// Get a company named "apache"
+	DataObjectPtr company = root->getDataObject("COMPANY[NAME='apache']");
+
+	// Remove the first department of this company and get it
+	commonj::sdo::DataObjectPtr department = company->getList("DEPARTMENT").remove(0);;
+	
+	// Change the company name to "amd"
+	wstring companyName = L"amd";
+	company->setString("NAME", companyName.c_str(), companyName.size());
+
+	// The department is added to the company named "ibm"
+	root->getDataObject("COMPANY[NAME='ibm']")->getList("DEPARTMENT").append(department);
+
+	// The graph changes are persited on the database
+	das->applyChanges(root);
+	
+	// Free the allocated connection and DAS instance
+	delete das;
+	delete connection;
+
+	system("PAUSE");
+
+}

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/GettingStarted.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/GettingStarted.html?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/GettingStarted.html (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/GettingStarted.html Mon Nov 12 14:02:46 2007
@@ -0,0 +1,228 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+<HEAD>
+	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
+	<TITLE>Tuscany - Getting Started</TITLE>
+	<META NAME="GENERATOR" CONTENT="BrOffice.org 2.0  (Win32)">
+	<META NAME="CREATED" CONTENT="20070623;19202290">
+	<META NAME="CHANGEDBY" CONTENT="a a">
+	<META NAME="CHANGED" CONTENT="20070626;1131872">
+	<!-- 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.
+-->
+	<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
+	<STYLE>
+	<!--
+		TD P { color: #000000; font-family: "Verdana", "Helvetica", "Arial", sans-serif; font-size: 12pt }
+		H1 { color: #000000 }
+		P { color: #000000; font-family: "Verdana", "Helvetica", "Arial", sans-serif; font-size: 12pt }
+		H2 { background: #dddddd; border: 1px solid #999999; padding-top: 0.11cm; padding-bottom: 0.11cm; padding-left: 0.16cm; padding-right: 0.11cm; color: #990000 }
+		H3 { color: #000000 }
+		A:link { color: #3366aa; text-decoration: none }
+	-->
+	</STYLE>
+</HEAD>
+<BODY LANG="en-US" TEXT="#000000" LINK="#3366aa" DIR="LTR" STYLE="border: none; padding: 0cm">
+<DIV ID="bodyColumn" DIR="LTR">
+	<P  ><BR><BR>
+	</P>
+	<DIV ID="contentBox" DIR="LTR">
+		<H1  ><FONT SIZE=6 STYLE="font-size: 28pt">Tuscany -
+		Getting Started - DAS C++</FONT></H1>
+		<P  >This document describes what is needed to install
+		Tuscany DAS for C++. If you haven't already done so, the first step
+		is to download the DAS C++ from its repository:
+		<A HREF="https://svn.apache.org/repos/asf/incubator/tuscany/cpp/das/" TARGET="_blank">https://svn.apache.org/repos/asf/incubator/tuscany/cpp/das/</A>.
+				</P>
+		<H2  >Contents</H2>
+		<OL>
+			<LI><P STYLE="margin-bottom: 0cm"><A HREF="#requirements">System
+			Requirements</A> 
+			</P>
+			<LI><P STYLE="margin-bottom: 0cm"><A HREF="#Installing">Installing
+			Tuscany DAS C++ on Windows.</A></P>
+			<LI><P STYLE="margin-bottom: 0cm"><A HREF="#samples">Samples</A>
+						</P>
+			<LI><P  ><A HREF="#help">Getting Help</A> 
+			</P>
+		</OL>
+		<H2  ><A NAME="requirements"></A>System Requirements</H2>
+		<P  >In order to use Tuscany DAS there are some minimum
+		requirements:</P>
+		<TABLE WIDTH=896 BORDER=1 CELLPADDING=2 CELLSPACING=0>
+			<COL WIDTH=150>
+			<COL WIDTH=736>
+			<TR>
+				<TD WIDTH=150>
+					<P  ><B>Software</B></P>
+				</TD>
+				<TD WIDTH=736>
+					<P  ><B>Download Link</B></P>
+				</TD>
+			</TR>
+			<TR>
+				<TD WIDTH=150>
+					<P  >Operating systems: 
+					</P>
+					<UL>
+						<LI><P  >Windows XP SP2 
+						</P>
+					</UL>
+				</TD>
+				<TD WIDTH=736></TD>
+			</TR>
+			<TR>
+				<TD WIDTH=150>
+					<P  >Tuscany SDO C++ (from the trunk)</P>
+				</TD>
+				<TD WIDTH=736>
+					<P  >To compile and install Tuscany SDO C++ follow
+					the instructions on
+					<A HREF="https://svn.apache.org/repos/asf/incubator/tuscany/cpp/sdo/GettingStarted.html">https://svn.apache.org/repos/asf/incubator/tuscany/cpp/sdo/GettingStarted.html</A><FONT COLOR="#000000">
+					page. But instead of download the source from Tuscany downloads
+					page, download the SDO C++ source from the trunk:
+					<A HREF="https://svn.apache.org/repos/asf/incubator/tuscany/cpp/sdo/" TARGET="_blank">https://svn.apache.org/repos/asf/incubator/tuscany/cpp/sdo/</A></FONT></P>
+				</TD>
+			</TR>
+			<TR>
+				<TD WIDTH=150>
+					<P  >libxml2 version 2.6.20 
+					</P>
+				</TD>
+				<TD WIDTH=736>
+					<P  >You need to download and install libxml2, iconv
+					and zlib from <A HREF="http://www.zlatkovic.com/libxml.en.html">http://www.zlatkovic.com/libxml.en.html</A>.
+					Please read the installation notes for libxml2 particularly
+					regarding it's pre-req's iconv and zlib on Windows. 
+					</P>
+				</TD>
+			</TR>
+			<TR>
+				<TD WIDTH=150>
+					<P  >iconv latest version</P>
+				</TD>
+				<TD WIDTH=736>
+					<P  >You can find iconv for windows here:
+					<A HREF="http://sourceforge.net/project/downloading.php?groupname=gnuwin32&amp;filename=libiconv-1.9.2-1-lib.zip">http://sourceforge.net/project/downloading.php?groupname=gnuwin32&amp;filename=libiconv-1.9.2-1-lib.zip</A>&amp;use_mirror=ufpr</P>
+				</TD>
+			</TR>
+		</TABLE>
+		<H2  ><A NAME="Installing"></A>Installing and Compiling
+		Tuscany DAS C++ on Windows</H2> 
+		<h3>1. Downloading the Source Code</h3>
+		<OL>
+			<P STYLE="margin-bottom: 0cm">1.1 Download the
+			contents under
+			<A HREF="https://svn.apache.org/repos/asf/incubator/tuscany/cpp/das/">https://svn.apache.org/repos/asf/incubator/tuscany/cpp/das/</A><FONT COLOR="#000000">
+			into directory &lt;tuscany_das_cpp&gt;.</FONT></P>
+		</OL>
+		<h3>2. Preparing Environment</h3>
+		<OL>
+			<P STYLE="margin-bottom: 0cm">2.1 The following
+			environment variables are required: 
+			</P>
+			<UL>
+				<LI><P STYLE="margin-bottom: 0cm">TUSCANY_SDOCPP=&lt;path
+				to tuscany sdo for c++ directory&gt; 
+				</P>
+				<LI><P STYLE="margin-bottom: 0cm">LIBXML2_HOME=&lt;path
+				to libxml2 directory&gt; 
+				</P>
+				<LI><P  >ICONV_HOME=&lt;path to iconv directory&gt;</P>
+			</UL>
+		</OL>
+		<h3>3. Compiling using Visual Studio Express</h3>
+		<OL START=3>
+			<P STYLE="margin-bottom: 0cm">3.1 Build the source
+			using Visual Studio Express solution under directory
+			&lt;tuscany_das_cpp&gt;/VSExpress/tuscany_das/.</P>
+		</OL>
+		<h3>4. Compiling using Apache Ant (does not compile test cases yet)</h3>
+		<OL START=3>
+			<P STYLE="margin-bottom: 0cm">4.1 Follow the instructions on &lt;tuscany_das_cpp&gt;/README_ANT_INSTALL to set up Apache Ant correctly.</P>
+			<P STYLE="margin-bottom: 0cm">4.2 Execute the following command on &lt;tuscany_das_cpp&gt; directory: <OL><P>ant</P></OL></P>
+		</OL>
+		<h3>5. Installing</h3>
+		<OL>
+			<P STYLE="margin-bottom: 0cm">5.1 Set environment
+			variable TUSCANY_DASCPP=&lt;tuscany_das_cpp&gt;/deploy/</P></LI>
+		</OL>
+
+		<H2  >Test Cases</H2>
+		<H3  >Setup</H3>
+		<UL>
+			<LI><P  ><SPAN STYLE="text-decoration: none">Download
+			the latest version of Postgres Core and ODBC Driver. You can find it
+			here: <A HREF="http://www.postgresql.org/download/">http://www.postgresql.org/download/</A>.</SPAN></P>
+			<LI><P  ><SPAN STYLE="text-decoration: none">Install both, Postgres Core and ODBC Driver, on your OS.</SPAN></P>
+			<LI><P  >The test cases access a data source using DSN, das_test by default access a DSN named "DAStestcases" using "postgres" user with "tuscany" password. However this settings can be modified on getConnection function defined on &lt;tuscany_das_cpp&gt;/runtime/test/src/main.cpp:
+<P STYLE="margin-left: 2cm; margin-bottom: 0cm"><FONT SIZE=2>...<BR>std::string
+		dsn = <FONT COLOR="#800000">&quot;DAStestcases&quot;</FONT><FONT COLOR="#000000">;</FONT><BR><FONT COLOR="#000000">std::string
+		user = <FONT COLOR="#800000">&quot;postgres&quot;</FONT><FONT COLOR="#000000">;</FONT><BR><FONT COLOR="#000000">std::string
+		password = <FONT COLOR="#800000">&quot;tuscany&quot;</FONT<FONT COLOR="#000000">;</FONT><BR><FONT COLOR="#000000">...</FONT></FONT></FONT></P>
+			
+		</UL>
+		<H3>Running</H3>
+		<OL>
+			<P  >To run test cases you
+			just need to execute the file: 
+			</P>
+			<UL>
+				<P STYLE="margin-bottom: 0cm">&lt;tuscany_das_cpp&gt;/VSExpress/tuscany_das/das_test/Debug/das_test.exe
+								</P>
+			</UL>
+			<P  >The output of all tests must show &ldquo;OK&rdquo;.</P>
+		</OL>
+		<h3>Requirements:</h3>
+		<UL>
+			<LI><P  >Postgres server must be running accepting connection from localhost.</P>
+		</UL>
+		
+		
+		<H2><A NAME="samples"></A>Samples</H2>
+		<TABLE BORDER=1 CELLPADDING=2 CELLSPACING=2>
+			<TR>
+				<TD>
+					<P  >CompanySample</P>
+				</TD>
+				<TD>
+					<P  >This sample shows how to load data from a RDB
+					source, using RDB DAS, into a SDO graph, then retrieve data
+					from it, modify the graph and update the data source based on the modified graph. 
+					</P>
+				</TD>
+			</TR>
+		</TABLE>
+		<H2  ><A NAME="help"></A>Getting Help</H2>
+		<P  >Any problem with this release can be reported to
+		the Tuscany <A HREF="http://cwiki.apache.org/TUSCANY/mailing-lists.html" TARGET="_blank">mailing
+		lists</A> or create a JIRA issue
+		at&nbsp;<A HREF="http://issues.apache.org/jira/browse/Tuscany" TARGET="_blank">http://issues.apache.org/jira/browse/Tuscany</A>.</P>
+		<P  >&nbsp;</P>
+		<TABLE CELLPADDING=2 CELLSPACING=2>
+			<TR>
+				<TD>
+					<P  >Thank you for your interest in Tuscany.</P>
+					<P  ><EM><STRONG>-The Tuscany Development Team</STRONG></EM>
+										</P>
+				</TD>
+			</TR>
+		</TABLE>
+	</DIV>
+</DIV>
+</BODY>
+</HTML>
\ No newline at end of file

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/README_ANT_INSTALL
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/README_ANT_INSTALL?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/README_ANT_INSTALL (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/README_ANT_INSTALL Mon Nov 12 14:02:46 2007
@@ -0,0 +1,290 @@
+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.
+
+Using ant to build TuscanyDAS Native
+
+This guide shows how to build TuscanyDAS Native with apache ant. 
+Above all, using ant will standardize the build system across 
+all platforms, obviating the need to support both automake and 
+microsoft VC projects. The ant build process is still in its beta 
+and will be formalized for Release M4. Currently the only item 
+remaining is to write an ant build file for the samples.
+
+
+Required Software to build TuscanySDO Native with ant
+=====================================================
+
+Java:
+        Most Linux, Mac, and Windows systems come with Java
+        Java 1.4.2 or later
+
+Ant:
+        Ant comes installed with almost all Linux distributions
+        version 1.6 or later
+        Download: http://ant.apache.org/
+
+antcontrib:
+        version 1.0b3 or later
+        Download: http://ant-contrib.sourceforge.net/
+
+antcontrib cpptasks.jar
+        version 1.0b4 or later
+        Download: http://ant-contrib.sourceforge.net/
+        Information: http://ant-contrib.sourceforge.net/cc.html
+
+
+Installation Instructions
+=========================
+
+Linux/Mac
+---------
+
+Make sure JAVA_HOME is set before starting.
+
+Install ant according to http://ant.apache.org/manual/index.html.
+
+Set the ANT_HOME variable to the directory where you install ant.
+export ANT_HOME="/home/your/ant"
+
+Add $ANT_HOME/bin to your path.
+export PATH="${PATH}:${ANT_HOME}/bin"
+
+The optional ant tasks included in antcontrib and cpptasks are needed to
+compile Tuscany Native with ant. Additional ant tasks (antcontrib and cpptasks)
+should be installed in $ANT_HOME/lib
+So place the antcontrib and cpptasks jars there.
+
+If you dont have write access to $ANT_HOME/lib, do the following:
+- create ${user.home}/.ant/lib
+- place the jars here
+
+Typically its a good idea to avoid adding optional ant tasks to your classpath,
+this can be problematic.
+
+Since the antcontrib compiler adaptor for microsoft msvc 8 has several bugs, we've
+written our own. Even though this compiler is for Windows, it is referenced in the
+ant build scripts and thus needs to be added to the classpath even for Linux/Mac.
+Add the TuscanyMSVC8DevStudioCCompiler jar to your classpath.
+export CLASSPATH="${CLASSPATH}:/TuscanySourceDir/antscripts/TuscanyMSVC8DevStudioCCompiler.jar"
+
+Windows
+-------
+
+Make sure JAVA_HOME is set before starting.
+
+Install ant according to http://ant.apache.org/manual/index.html.
+
+Set the ANT_HOME variable to the directory where you install ant.
+set ANT_HOME=c:\ant
+
+Add %ANT_HOME%\bin to your path.
+set PATH=%PATH%;%ANT_HOME%\bin
+
+The optional ant tasks included in antcontrib and cpptasks are needed to
+compile Tuscany Native with ant. Additional ant tasks (antcontrib and cpptasks)
+should be installed in %ANT_HOME%\lib
+So place the antcontrib and cpptasks jars there.
+
+If you dont have write access to %ANT_HOME%\lib, do the following:
+- create %user.home%\.ant\lib
+- place the jars here
+
+Typically its a good idea to avoid adding optional ant tasks to your classpath,
+this can be problematic.
+
+Since the antcontrib compiler adaptor for microsoft msvc 8 has several bugs, we've
+written our own, namely TuscanyMSVC8DevStudioCCompiler. The Tuscany MSVC8 adaptor 
+just makes sure that the correct parameters are passed to the compiler.
+Add the TuscanyMSVC8DevStudioCCompiler jar to your classpath.
+set CLASSPATH=%CLASSPATH%:c:\TuscanySourceDir\antscripts\TuscanyMSVC8DevStudioCCompiler.jar
+
+USAGE
+=====
+
+From the TuscanyDAS Native root source directory, the entire application can be 
+compiled, linked, and installed by simply executing ant with no targets. This will
+execute the default "all" target.
+
+# ant
+
+The ant build system will scan your environment variables and ant configuration file
+and try to autoconfigure everything needed to build.  The environment variables can be 
+overridden by the ant configuration file: antscripts/platform.properties.  The only 
+configuration that is mandatory to build TuscanyDAS Native is the location of libxml2 and TuscanySDO.
+
+To configure the location of libxml2, do one of the following:
+  export LIBXML2_LIB=/libxml2/lib/dir
+  export LIBXML2_INCLUDE=/libxml2/include/dir
+  -- OR --
+  edit antscripts/platform.properties
+  platform.libxml2.lib.dir=/libxml2/lib/dir
+  platform.libxml2.include.dir=/libxml2/include/dir
+
+To configure the location of TuscanySDO, do one of the following:
+  export TUSCANY_SDOCPP=/tuscanySDOHome/
+  -- OR --
+  edit antscripts/platform.properties
+  platform.tuscany.sdo.home.dir=/tuscanySDOHome/
+  
+The platform.properties configuration always overrides environment variables.
+See the CONFIGURATION section below for more information.
+
+To compile in debug mode, add the following define to the ant command line or
+edit the platform.properties file as seen in the CONFIGURATION section below.
+
+# ant -Ddebug=true
+
+The TuscanySDO Native ant build process is hierarchical. Currently there are 
+build scripts in the following locations, which can all be invoked from the 
+root TuscanySDO directory:
+  TUSCANY_DAS_SRC_ROOT/build.xml
+  TUSCANY_DAS_SRC_ROOT/runtime/core/build.xml
+
+For a listing of public targets for any build.xml file, execute the following: 
+(display shown for the root src directory)
+
+# ant -p
+Buildfile: build.xml
+
+Main targets:
+
+ all      		build and install all TuscanyDASNative source code and documentation
+ build    		Build all TuscanyDASNative source code and documentation
+ clean    		Clean all TuscanyDASNative compiled source code
+ samples  		Build and install all TuscanyDASNative samples
+ install  		Install TuscanyDASNative libraries and headers
+ test     		Build and run all tests
+ distribution   	Create a source and bin distribution structure
+ pack.distribution      Pack the bin and source distribution into .zip and .tar.gz files. Also generates the .asc and .md5 files
+Default target: all
+
+
+Public targets are those that have descriptions and are usually the only ones needed for
+compiling, installing and cleaning. For more avanced use, the private targets can be seen 
+by looking at the actual build.xml file.
+
+
+CONFIGURATION
+==============
+
+The following explains how to configure the TuscanyDAS Native ant build system.
+The build system is configured either by environment variables and/or by the
+antscripts/platform.properties file. Some options can only be configured via the
+platform.properties file. If an option can be configured in both places, the option
+specified in the platform.properties file overrides the environment variable.
+
+The TuscanyDAS Native ant build system is capable of automatically configuring 
+everything except the location of the libxml2 and TuscanySDO libraries. All other configuration 
+options can be determined.
+
+From anywhere there is a TuscanyDAS Native build.xml file, the current system
+configuration can be displayed by executing the display.system ant target as 
+follows:
+
+# ant display.system
+Buildfile: build.xml
+
+check.sdo:
+
+display.system:
+     [echo]
+     [echo] TuscanyDAS paths
+     [echo]   tuscanyDAS.root.dir=           /home/Adriano/Tuscany/cpp/das
+     [echo]   tuscanyDAS.root.src.dir=       /home/Adriano/Tuscany/cpp/das/runtime
+     [echo]   tuscanyDAS.install.dir=        /home/Adriano/Tuscany/cpp/das/deploy
+     [echo]   tuscanyDAS.library.version=    ''
+     [echo]   tuscanyDAS.release.file.name=  'tuscany_das_cpp-1.0-incubator-M4-'
+
+     [echo]
+     [echo] TuscanyDAS compiler configuration
+     [echo]   compiler.name=               'msvc8'
+     [echo]   debug.compile=               'false'
+     [echo]   lib.ext=                     '.lib'
+     [echo]   dll.ext=                     '.dll'
+     [echo]   lib.prefix=                  ''
+     [echo]   object.ext=                  '.obj'
+     [echo]   exe.ext=                     '.exe'
+     [echo]   script.ext=                  '.bat'
+     [echo]   external.definitions.file=   ''
+     [echo]
+     [echo] sdo location
+     [echo]   tuscany.sdo.home.dir=          /home/Adriano/Tuscany/cpp/sdo/deploy
+     [echo]
+
+BUILD SUCCESSFUL
+Total time: 0 second
+
+Compilation configuration
+-------------------------
+
+The compilation options can all be determined by the ant build system by
+examining the platform.  The values can only be overriden by editing the 
+platform.properties file. Following is a list of the options and their 
+default values:
+
+platform.lib.ext=        (Defaults to ".so" for Unix and ".lib" for Windows)
+platform.dll.ext=        (Defaults to "" for Unix and ".dll" for Windows. Not used for Unix)
+platform.exe.ext=        (Defaults to "" for Unix and ".exe" for Windows)
+platform.object.ext=     (Defaults to ".o" for Unix and ".obj" for Windows)
+platform.script.ext=     (Defaults to ".sh" for Unix and ".bat" for Windows)
+platform.compiler.name=  (Defaults to "g++" for Unix and "msvc8" for Windows)
+platform.debug.compile=  (Defaults to "false" for both Unix and Windows)
+
+To configure ant to use a compiler other than g++ or msvc, or to add your own
+ant tasks/definitions, specify a path for the platform.external.definitions.file
+and platform.compiler.name in the platform.properties configuration file. This 
+is especially useful for compiling on other platforms like AIX or Solaris.
+
+Tuscany DAS installation path
+-----------------------------
+
+The Tuscany DAS installation directory can be configured as follows:
+  export TUSCANY_DASCPP=/tuscany/das/native/install/dir
+  -- OR --
+  edit antscripts/platform.properties
+  platform.tuscanyDAS.install.dir=/tuscany/das/native/install/dir
+
+The Tuscany DAS installation directory defaults to:
+  TUSCANY_DAS_SRC_ROOT/deploy
+
+Tuscany SDO Configuration
+-------------------------
+
+TuscanySDO:
+If not specified, then the the build will fail.
+
+  export TUSCANY_SDOCPP=/tuscanySDOHome/
+    -- OR --
+  edit antscripts/platform.properties
+  platform.libxml2.lib.dir=/libxml2/library/directory
+  platform.libxml2.include.dir=/libxml2/include/directory
+
+
+3rd Party configuration
+-----------------------
+
+LIBXML2:
+If not specified, then the the build will fail.
+
+  export LIBXML2_LIB=/libxml2/library/directory
+  export LIBXML2_INCLUDE=/libxml2/include/directory
+    -- OR --
+  edit antscripts/platform.properties
+  platform.tuscany.sdo.home.dir=/tuscanySDOHome/
+
+
+

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/TuscanyMSVC8DevStudioCCompiler.jar
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/TuscanyMSVC8DevStudioCCompiler.jar?rev=594314&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/TuscanyMSVC8DevStudioCCompiler.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/compile-targets.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/compile-targets.xml?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/compile-targets.xml (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/compile-targets.xml Mon Nov 12 14:02:46 2007
@@ -0,0 +1,311 @@
+<?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.
+-->
+<project name='compiler-targets'>
+
+  <import file="./system.xml"/>
+
+  <!--
+    Do a cpp compilation.
+    Inherits from "Tuscany-BaseCompiler", which has an include path of:
+        ${tuscanyDAS.root.src.dir}/core/src
+    @param objdir - directory where the object files will be written
+    @param srcdir - directory where the source files are located.
+    @param infiles - a space seperated list of the files to compile
+    @param custom-cc-elements - any extra cpp elements, may also be extra <includepath> elements
+  -->
+  <macrodef name="cpp-compile">
+    <attribute name="objdir" default="."/>
+    <attribute name="srcdir" default="."/>
+    <attribute name="infiles" default="*.cpp"/>
+    <element name="custom-cc-elements" optional="true"/>
+    <sequential>
+      <mkdir dir='@{objdir}'/>
+      <cc subsystem='console'
+          objdir='@{objdir}'
+          debug='${debug.compile}'>
+            <compiler refid='${compiler.name}-Compiler'/>
+            <fileset dir='@{srcdir}' includes='@{infiles}'/>
+            <custom-cc-elements/>
+      </cc>
+
+    </sequential>
+  </macrodef>
+
+  <!--
+    Do a cpp link which results in either a library (linktype of plugin, shared, or static)
+    or an executable (linktype of executable).
+    Inherits from "Tuscany-BaseLinker"
+    @param outfile - name of the library to create, OS prefixes and suffixes will be added
+    @param destdir - directory where the library will be written
+    @param infiles - a space seperated list of the object files to link
+    @param linktype - executable, plugin, shared, static
+    @param custom-ld-elements - any extra cpp elements, may also be extra <libset> elements
+  -->
+  <macrodef name="cpp-link">
+    <attribute name="outfile" default="out"/>
+    <attribute name="outdir" default="."/>
+    <attribute name="indir" default="${env}"/>
+    <attribute name="infiles" default="*${object.ext}"/>
+    <attribute name="linktype" default="shared"/>
+    <element name="custom-ld-elements" optional="true"/>
+    <sequential>
+      <mkdir dir='@{outdir}'/>
+      <cc link='@{linktype}'
+          subsystem='console'
+          outfile='@{outdir}/@{outfile}'
+          debug='${debug.compile}'>
+            <linker refid='${compiler.name}-Linker'/>
+            <fileset dir='@{indir}' includes='@{infiles}'/>
+            <custom-ld-elements/>
+      </cc>
+  <!--<cpp-embed-manifest dir="@{outdir}" file="@{outfile}" outtype="@{outtype}"/>-->
+    </sequential>
+  </macrodef>
+
+  <!--
+    Do a cpp build which compiles and links, resulting in either a library (linktype
+    of plugin, shared, or static) or an executable (linktype of executable).
+    Inherits from both "Tuscany-BaseCompiler" and "Tuscany-BaseLinker"
+    @param srcdir  - directory where the source files are located.
+    @param infiles - a space seperated list of the source files to compile and link
+    @param outdir  - directory where the output file will be written
+    @param outfile - name of the library or binary to create, OS prefixes and suffixes may be added
+    @param outtype - executable, plugin, shared, static
+    @param custom-build-elements - any extra elements needed for compiling or linking
+                                   may also be extra <includepath> or <libset> elements
+  -->
+  <macrodef name="cpp-build">
+    <attribute name="srcdir" default="."/>
+    <attribute name="infiles" default="**/*.cpp"/>
+    <attribute name="outdir" default="."/>
+    <attribute name="outfile" default="out"/>
+    <attribute name="outtype" default="shared"/>
+    <element name="custom-build-elements" optional="true"/>
+    <sequential>
+      <mkdir dir='@{outdir}'/>
+      <cc outtype='@{outtype}'
+          subsystem='console'
+          objdir='@{outdir}'
+          outfile='@{outdir}/@{outfile}'
+          debug='${debug.compile}'>
+            <compiler refid='${compiler.name}-Compiler'/>
+            <linker refid='${compiler.name}-Linker'/>
+            <fileset dir='@{srcdir}' includes='@{infiles}'/>
+<compilerarg value="/D_VC80_UPGRADE=0x0600"/>
+            <custom-build-elements/>
+      </cc>
+  <!--<cpp-embed-manifest dir="@{outdir}" file="@{outfile}" outtype="@{outtype}"/>-->
+    </sequential>
+  </macrodef>
+
+  <!--
+    Install a single file
+    @param file - file to install
+    @param srcdir - directory of file to install
+    @param destdir - Where to install the file
+    @param executable - set permissions to executable, defaults true
+  -->
+  <macrodef name="cpp-install-file">
+    <attribute name="srcfile"/>
+    <attribute name="srcdir" default="."/>
+    <attribute name="destfile" default="@{srcfile}"/>
+    <attribute name="destdir"/>
+    <attribute name="executable" default="true"/>
+    <sequential>
+      <mkdir dir="@{destdir}"/>
+      <copy file="@{srcdir}/@{srcfile}" tofile="@{destdir}/@{destfile}" overwrite='true'/>
+      <if>
+        <equals arg1="@{executable}" arg2="true"/>
+        <then>
+          <chmod file="@{destdir}/@{destfile}" perm="755"/>
+        </then>
+      </if>
+    </sequential>
+  </macrodef>
+
+  <!--
+    Install multiple files
+    @param files - space seperated list of files to install
+    @param srcdir - location of files to install
+    @param destdir - Where to install files
+    @param executable - set permissions to executable, defaults false
+  -->
+  <macrodef name="cpp-install-files">
+    <attribute name="files" default="*.*"/>
+    <attribute name="srcdir" default="."/>
+    <attribute name="destdir"/>
+    <attribute name="executable" default="false"/>
+    <sequential>
+      <mkdir dir="@{destdir}"/>
+      <copy todir="@{destdir}" overwrite='true'>
+        <fileset dir="@{srcdir}" includes="@{files}"/>
+      </copy>
+      <if>
+        <equals arg1="@{executable}" arg2="true"/>
+        <then>
+          <chmod file="@{destdir}/@{files}" perm="755"/>
+        </then>
+      </if>
+    </sequential>
+  </macrodef>
+
+  <!--
+    Install a library
+    @param lib - library to install
+    @param srcdir - directory of file to install
+    @param destdir - Where to install the file
+    @param executable - set permissions to executable, defaults true
+  -->
+  <macrodef name="cpp-install-lib">
+    <attribute name="lib"/>
+    <attribute name="srcdir" default="."/>
+    <attribute name="destrootdir"/>
+    <attribute name="version" default="${tuscanyDAS.library.version}"/>
+    <sequential>
+      <cpp-install-file
+          srcfile="${lib.prefix}@{lib}${lib.ext}"
+          srcdir="@{srcdir}"
+          destfile="${lib.prefix}@{lib}${lib.ext}@{version}"
+          destdir="@{destrootdir}/lib"/>
+      <if>
+        <os family="windows"/>
+        <then>
+          <cpp-install-file
+              srcfile="${lib.prefix}@{lib}${dll.ext}"
+              srcdir="@{srcdir}"
+              destfile="${lib.prefix}@{lib}${dll.ext}@{version}"
+              destdir="@{destrootdir}/bin"/>
+        </then>
+      </if>
+    </sequential>
+  </macrodef>
+
+  <!--
+    Create a symlink on unix and mac only
+    @param lib - library file to install
+    @param srclibdir - location of library files to install
+    @param destlibdir - Where to install library files
+  -->
+  <macrodef name="cpp-symlink">
+    <attribute name="linkdir" default=""/>
+    <attribute name="resourcedir" default="."/>
+    <attribute name="link"/>
+    <attribute name="resource"/>
+    <sequential>
+      <if>
+        <or>
+          <os family="unix"/>
+          <os family="mac"/>
+        </or>
+        <then>
+          <mkdir dir="@{linkdir}"/>
+          <symlink
+              link="@{linkdir}/@{link}"
+              resource="@{resourcedir}/@{resource}"
+              overwrite="true"/>
+        </then>
+      </if>
+    </sequential>
+  </macrodef>
+
+  <!--
+    Delete files from a directory, and possible delete the directory
+    @param files - space seperated list of files to delete
+    @param headerdir - directory where files to delete are
+    @param quiet - verbosity, "true" or "false"
+    @param rmdir - delete the directory after deleting files, "true" or "false"
+    @param custom-delete-elements - anything else you need done additionally
+  -->
+  <macrodef name="cpp-clean-files">
+    <attribute name="files" default="*.*"/>
+    <attribute name="dir" default="."/>
+    <attribute name="quiet" default="true"/>
+    <attribute name="rmdir" default="false"/>
+    <element name="custom-delete-elements" optional="true"/>
+    <sequential>
+      <delete quiet="@{quiet}">
+        <fileset dir="@{dir}" includes="@{files}"/>
+      </delete>
+      <if>
+        <equals arg1="@{rmdir}" arg2="true"/>
+        <then>
+          <delete dir="@{dir}"/>
+        </then>
+      </if>
+      <custom-delete-elements/>
+    </sequential>
+  </macrodef>
+
+  <!--
+    Embed the manifest in the library or executable on Windows only
+    Uses the Microsoft manifest tool "mt"
+    @param dir - the directory where the lib/exe resides
+    @param file - the filename with no suffixes or prefixes
+    @param outtype - the outtype that's passed to the cc task, used to create the filename
+    -->
+  <macrodef name="cpp-embed-manifest">
+    <attribute name="dir"/>
+    <attribute name="file"/>
+    <attribute name="outtype"/>
+      <sequential>
+      <if>
+        <os family="windows"/>
+        <then>
+          <if>
+            <equals arg1="@{outtype}" arg2="executable"/>
+            <then>
+              <property name="file.name" value="@{file}${exe.ext}"/>
+            </then>
+          </if>
+          <property name="file.name" value="${lib.prefix}@{file}${dll.ext}"/>
+
+          <exec executable="mt">
+            <arg line="-manifest @{dir}/${file.name}.manifest -outputresource:@{dir}/${file.name};2"/>
+          </exec>
+        </then>
+      </if>
+    </sequential>
+  </macrodef>
+	
+  <!--
+    Delete a library from a root library directory, and possible delete the directory
+    On windows, it will delete both bin/<library>.dll and lib/<library>.lib
+    On Unix, it will delete lib/<library>
+    @param lib - library to delete
+    @param librootdir - directory where the library to delete is located
+    @param quiet - verbosity, "true" or "false"
+  -->
+  <macrodef name="cpp-clean-lib">
+  	<attribute name="lib"/>
+  	<attribute name="librootdir"/>
+    <attribute name="quiet" default="true"/>
+  	<attribute name="version" default="${tuscanyDAS.library.version}"/>
+  	<sequential>
+      <delete quiet="@{quiet}" file="@{librootdir}/lib/${lib.prefix}@{lib}${lib.ext}@{version}"/>
+      <if>
+        <os family="windows"/>
+        <then>
+          <delete quiet="@{quiet}" file="@{librootdir}/bin/${lib.prefix}@{lib}${dll.ext}@{version}"/>
+        </then>
+      </if>
+  	</sequential>
+  </macrodef>
+
+</project>

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/platform.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/platform.properties?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/platform.properties (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/platform.properties Mon Nov 12 14:02:46 2007
@@ -0,0 +1,34 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#    
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+platform.lib.ext=
+platform.dll.ext=
+platform.exe.ext=
+platform.object.ext=
+platform.script.ext=
+platform.compiler.name=
+platform.debug.compile=
+platform.external.definitions.file=
+
+platform.tuscanyDAS.root.dir=
+platform.tuscanyDAS.install.dir=
+platform.tuscanyDAS.release.file.name=
+
+platform.axis2c.home.dir=
+platform.libxml2.lib.dir=
+platform.libxml2.include.dir=
+platform.tuscany.sdo.home.dir=

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/system.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/system.xml?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/system.xml (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/antscripts/system.xml Mon Nov 12 14:02:46 2007
@@ -0,0 +1,514 @@
+<?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.
+-->
+<project name="system-import">
+
+  <property file="${basedir}/antscripts/platform.properties"/>
+  <property environment="env"/>
+
+  <!-- These 3 lines pull in antcontrib and cctasks -->
+  <taskdef resource="net/sf/antcontrib/antlib.xml"/>
+  <taskdef resource="cpptasks.tasks"/>
+  <typedef resource="cpptasks.types"/>
+
+  <!--
+     Configure the tuscanyDAS.root.dir
+     Take the override value from platform.properties if set
+  -->
+  <if>
+    <and>
+      <isset property="platform.tuscanyDAS.root.dir"/>
+      <length string="${platform.tuscanyDAS.root.dir}" when="greater" length="0" trim="true"/>
+    </and>
+    <then>
+      <property name="tuscanyDAS.root.dir" location="${platform.tuscanyDAS.root.dir}"/>
+    </then>
+    <else>
+      <property name="tuscanyDAS.root.dir" location="."/>
+    </else>
+  </if>
+
+  <property name="tuscanyDAS.root.src.dir" location="${tuscanyDAS.root.dir}/runtime"/>
+
+  <!--
+     Configure the tuscanyDAS.install.dir
+     Take the override value from platform.properties if set
+     Else take it from the env var TUSCANY_DASCPP
+     Else use a default of ${tuscanyDAS.root.dir}/deploy
+  -->
+  <if>
+    <and>
+      <isset property="platform.tuscanyDAS.install.dir"/>
+      <length string="${platform.tuscanyDAS.install.dir}" when="greater" length="0" trim="true"/>
+    </and>
+    <then>
+      <property name="tuscanyDAS.install.dir" location="${platform.tuscanyDAS.install.dir}"/>
+    </then>
+    <elseif>
+      <isset property="env.TUSCANY_DASCPP"/>
+      <then>
+        <property name="tuscanyDAS.install.dir" location="${env.TUSCANY_DASCPP}"/>
+      </then>
+    </elseif>
+    <else>
+      <property name="tuscanyDAS.install.dir" location="${tuscanyDAS.root.dir}/deploy"/>
+    </else>
+  </if>
+
+  <!--
+     Configure the version for all tuscanyDAS libraries
+     If on windows, set it to empty
+     Else take the override value from platform.properties if set
+     Else default it to "0.0.0"
+  -->
+  <if>
+    <os family="windows"/>
+    <then>
+      <property name="tuscanyDAS.library.version" value=""/>
+    </then>
+    <elseif>
+      <and>
+        <isset property="platform.tuscanyDAS.library.version"/>
+        <length string="${platform.tuscanyDAS.library.version}" when="greater" length="0" trim="true"/>
+      </and>
+      <then>
+        <property name="tuscanyDAS.library.version" value="${platform.tuscanyDAS.library.version}"/>
+      </then>
+    </elseif>
+    <else>
+      <property name="tuscanyDAS.library.version" value=".0.0.0"/>
+    </else>
+  </if>
+
+<!--
+     Configure tuscanyDAS.release.file.name that defines the generated packed file used on releases
+     Take the override value from platform.properties if set
+     Else use as default "tuscany_das_cpp" name
+  -->
+  <if>
+    <and>
+      <isset property="platform.tuscanyDAS.release.file.name"/>
+        <length string="${platform.tuscanyDAS.release.file.name}" when="greater" length="0" trim="true"/>
+      </and>
+      <then>
+        <property name="tuscanyDAS.release.file.name" value="${platform.tuscanyDAS.release.file.name}"/>
+      </then>
+    <else>
+      <property name="tuscanyDAS.release.file.name" value="tuscany_das_cpp"/>
+    </else>
+  </if>
+
+
+
+  <!--
+     Configure ${enable_sdo} and ${axis2c.home.dir}, which is needed to compile the ws extension
+     Take the override value from platform.properties if set
+     Else take it from the env var AXIS2C_HOME
+  -->
+  <target name="check.sdo">
+    <if>
+      <and>
+        <isset property="platform.libxml2.lib.dir"/>
+        <isset property="platform.libxml2.include.dir"/>
+	  <isset property="platform.tuscany.sdo.home.dir"/>
+        <length string="${platform.libxml2.lib.dir}" when="greater" length="0" trim="true"/>
+        <length string="${platform.tuscany.sdo.home.dir}" when="greater" length="0" trim="true"/>
+        <length string="${platform.libxml2.include.dir}" when="greater" length="0" trim="true"/>
+      </and>
+      <then>
+        <property name="enable_sdo" value="true"/>
+        <property name="libxml2.lib.dir"     location="${platform.libxml2.lib.dir}"/>
+        <property name="libxml2.include.dir" location="${platform.libxml2.include.dir}"/>
+        <property name="tuscany.sdo.home.dir" location="${platform.tuscany.sdo.home.dir}"/>
+        <condition property="iconv.home.dir" value="${platform.iconv.home.dir}">
+          <os family="windows"/>
+        </condition>
+      </then>
+      <elseif>
+        <and>
+          <isset property="env.LIBXML2_LIB"/>
+          <isset property="env.LIBXML2_INCLUDE"/>
+	    <isset property="env.TUSCANY_SDOCPP"/>
+        </and>
+        <then>
+          <property name="enable_sdo" value="true"/>
+          <property name="libxml2.lib.dir"     location="${env.LIBXML2_LIB}"/>
+          <property name="libxml2.include.dir" location="${env.LIBXML2_INCLUDE}"/>
+	    <property name="tuscany.sdo.home.dir" location="${env.TUSCANY_SDOCPP}"/>
+          <condition property="iconv.home.dir" value="${env.ICONV_HOME}">
+            <os family="windows"/>
+          </condition>
+        </then>
+      </elseif>
+      <else>
+        <fail message="Unable to find sdo installation, must be set by TUSCANY_SDOCPP, LIBXML2_LIB and LIBXML2_INCLUDE or in platform.properties file"/>
+      </else>
+    </if>
+  </target>
+
+  <!--
+     Configure the debug.compile flag
+     Try looking first on the command line
+     Then take the override value from platform.properties if set
+     Else its false
+  -->
+  <if>
+    <isset property="debug"/>
+    <then>
+      <!-- Tests if its set on the ant command line "ant -Ddebug=true" -->
+      <if>
+        <istrue value="${debug}"/>
+        <then>
+          <property name="debug.compile" value="true"/>
+        </then>
+      </if>
+    </then>
+    <elseif>
+      <and>
+        <isset property="platform.debug.compile"/>
+        <istrue value="${platform.debug.compile}"/>
+        <length string="${platform.debug.compile}" when="greater" length="0" trim="true"/>
+      </and>
+      <then>
+        <property name="debug.compile" value="true"/>
+      </then>
+    </elseif>
+  </if>
+  <property name="debug.compile" value="false"/>
+
+  <!--
+     Configure the compiler.name
+     Take the override value from platform.properties if set
+     Else set it based on the OS
+  -->
+  <if>
+    <and>
+      <isset property="platform.compiler.name"/>
+      <length string="${platform.compiler.name}" when="greater" length="0" trim="true"/>
+    </and>
+    <then>
+      <property name="compiler.name" value="${platform.compiler.name}"/>
+    </then>
+    <else>
+      <condition property="compiler.name" value="msvc8">
+        <os family="windows"/>
+      </condition>
+
+      <condition property="compiler.name" value="g++">
+        <or>
+          <os family="unix"/>
+          <os family="mac"/>
+        </or>
+      </condition>
+    </else>
+  </if>
+
+  <!--
+     Configure the lib.ext
+     Take the override value from platform.properties if set
+     Else set it based on the OS
+  -->
+  <if>
+    <and>
+      <isset property="platform.lib.ext"/>
+      <length string="${platform.lib.ext}" when="greater" length="0" trim="true"/>
+    </and>
+    <then>
+      <property name="lib.ext" value="${platform.lib.ext}"/>
+    </then>
+    <else>
+      <condition property="lib.ext" value=".lib">
+        <os family="windows"/>
+      </condition>
+
+      <condition property="lib.ext" value=".dylib">
+        <os family="mac"/>
+      </condition>
+
+      <condition property="lib.ext" value=".so">
+        <os family="unix"/>
+      </condition>
+    </else>
+  </if>
+
+  <!--
+     Configure the dll.ext, used for windows only
+     Take the override value from platform.properties if set
+     Else set it based on the OS
+  -->
+  <if>
+    <and>
+      <isset property="platform.dll.ext"/>
+      <length string="${platform.dll.ext}" when="greater" length="0" trim="true"/>
+    </and>
+    <then>
+      <property name="dll.ext" value="${platform.dll.ext}"/>
+    </then>
+    <else>
+      <condition property="dll.ext" value=".dll">
+        <os family="windows"/>
+      </condition>
+
+      <property name="dll.ext" value=""/>
+
+    </else>
+  </if>
+
+  <!--
+     Configure the lib.prefix
+     Take the override value from platform.properties if set
+     Else set it based on the OS
+  -->
+  <if>
+    <and>
+      <isset property="platform.lib.prefix"/>
+      <length string="${platform.lib.prefix}" when="greater" length="0" trim="true"/>
+    </and>
+    <then>
+      <property name="lib.prefix" value="${platform.lib.prefix}"/>
+    </then>
+    <else>
+      <condition property="lib.prefix" value="">
+        <os family="windows"/>
+      </condition>
+
+      <condition property="lib.prefix" value="lib">
+        <or>
+          <os family="unix"/>
+          <os family="mac"/>
+        </or>
+      </condition>
+    </else>
+  </if>
+
+
+
+  <!--
+     Configure the object.ext
+     Take the override value from platform.properties if set
+     Else set it based on the OS
+  -->
+  <if>
+    <and>
+      <isset property="platform.object.ext"/>
+      <length string="${platform.object.ext}" when="greater" length="0" trim="true"/>
+    </and>
+    <then>
+      <property name="object.ext" value="${platform.object.ext}"/>
+    </then>
+    <else>
+      <condition property="object.ext" value=".obj">
+        <os family="windows"/>
+      </condition>
+
+      <condition property="object.ext" value=".o">
+        <or>
+          <os family="unix"/>
+          <os family="mac"/>
+        </or>
+      </condition>
+    </else>
+  </if>
+
+
+  <!--
+     Configure the exe.ext
+     Take the override value from platform.properties if set
+     Else set it based on the OS
+  -->
+  <if>
+    <and>
+      <isset property="platform.exe.ext"/>
+      <length string="${platform.exe.ext}" when="greater" length="0" trim="true"/>
+    </and>
+    <then>
+      <property name="exe.ext" value="${platform.exe.ext}"/>
+    </then>
+    <else>
+      <condition property="exe.ext" value=".exe">
+        <os family="windows"/>
+      </condition>
+
+      <condition property="exe.ext" value="">
+        <or>
+          <os family="unix"/>
+          <os family="mac"/>
+        </or>
+      </condition>
+    </else>
+  </if>
+
+
+  <!--
+     Configure the script.ext
+     Take the override value from platform.properties if set
+     Else set it based on the OS
+  -->
+  <if>
+    <and>
+      <isset property="platform.script.ext"/>
+      <length string="${platform.script.ext}" when="greater" length="0" trim="true"/>
+    </and>
+    <then>
+      <property name="script.ext" value="${platform.script.ext}"/>
+    </then>
+    <else>
+      <condition property="script.ext" value=".bat">
+        <os family="windows"/>
+      </condition>
+
+      <condition property="script.ext" value=".sh">
+        <or>
+          <os family="unix"/>
+          <os family="mac"/>
+        </or>
+      </condition>
+    </else>
+  </if>
+
+
+  <condition property="windows" value="true">
+    <os family="windows"/>
+  </condition>
+
+  <condition property="mac" value="true">
+    <os family="mac"/>
+  </condition>
+
+  <!--
+     Base compiler definition
+     For now the base compiler is empty.
+    -->
+  <compiler id="Tuscany-BaseCompiler" multithreaded="true" exceptions="true" rtti="true"/>
+
+  <!--
+     Specific compiler definitions
+     The compilerarg location functionality completely omits the arg: antcontrib bug 1794857
+    -->
+
+    <!-- MSVC compilers for windows -->
+  <compiler id="msvc-Compiler" extends="Tuscany-BaseCompiler" name="msvc">
+    <defineset define="WIN32,_CRT_SECURE_NO_DEPRECATE,_CRT_NON_CONFORMING_SWPRINTFS"/>
+  </compiler>
+
+    <!-- MSVC compilers for windows 
+         The standard msvc ant contrib cc task compiler doesnt work so well,
+         so we made our own until the bugs are resolved. The actual implementation
+         of TuscanyDASMSVC8DevStudioCCompiler is in TuscanyDAS/tools/ant_cpptasks
+     -->
+
+ <compiler id="msvc8-Compiler"
+            extends="Tuscany-BaseCompiler"
+            classname="tuscany.antCompilers.das.TuscanyMSVC8DevStudioCCompiler">
+    <defineset define="WIN32,_CRT_SECURE_NO_DEPRECATE,_CRT_NON_CONFORMING_SWPRINTFS"/>
+  </compiler>
+
+
+    <!-- g++ compiler for most Unix platforms -->
+  <compiler id="g++-Compiler" extends="Tuscany-BaseCompiler" name="g++"/>
+  
+    <!-- g++ compiler for most Unix platforms
+         Used for cross compilation with the -m32 flag -->
+  <compiler id="g++m32-Compiler" extends="Tuscany-BaseCompiler" name="g++">
+    <compilerarg value="-m32"/>
+  </compiler>
+
+    <!-- g++ compiler for Apple mac -->
+  <compiler id="mac_g++-Compiler" extends="Tuscany-BaseCompiler" name="g++">
+    <defineset define="IS_DARWIN"/>
+  </compiler>
+
+  <!--
+     Base linker definition
+    -->
+  <linker id="Tuscany-BaseLinker">
+    <syslibset if="windows" libs="kernel32,user32,ws2_32"/>
+  </linker>
+
+  <!--
+     Specific linker definitions
+    -->
+  <linker id="msvc-Linker" extends="Tuscany-BaseLinker" name="msvc"/>
+  <linker id="msvc8-Linker" extends="Tuscany-BaseLinker" name="msvc"/>
+  <linker id="g++-Linker" extends="Tuscany-BaseLinker" name="g++"/>
+  <linker id="g++m32-Linker" extends="Tuscany-BaseLinker" name="g++">
+    <linkerarg value="-m32"/>
+  </linker>
+
+  <if>
+    <and>
+      <isset property="platform.external.definitions.file"/>
+      <length string="${platform.external.definitions.file}" when="greater" length="0" trim="true"/>
+    </and>
+    <then>
+      <property name="external.definitions.file" value="${platform.external.definitions.file}"/>
+      <import file="${external.definitions.file}"/>
+    </then>
+  </if>
+  <property name="external.definitions.file" value=""/>
+
+  <target name="display.system" depends="check.sdo">
+
+    <!-- Tuscany paths, etc -->
+    <echo message=" "/>
+    <echo message="TuscanyDAS paths"/>
+    <echo message="  tuscanyDAS.root.dir=           ${tuscanyDAS.root.dir}"/>
+    <echo message="  tuscanyDAS.root.src.dir=       ${tuscanyDAS.root.src.dir}"/>
+    <echo message="  tuscanyDAS.install.dir=        ${tuscanyDAS.install.dir}"/>
+    <echo message="  tuscanyDAS.library.version=    '${tuscanyDAS.library.version}'"/>
+    <echo message="  tuscanyDAS.release.file.name=  '${tuscanyDAS.release.file.name}'"/>
+
+    <!-- compilers, libs, etc -->
+    <echo message=" "/>
+    <echo message="TuscanyDAS compiler configuration"/>
+    <echo message="  compiler.name=               '${compiler.name}'"/>
+    <echo message="  debug.compile=               '${debug.compile}'"/>
+    <echo message="  lib.ext=                     '${lib.ext}'"/>
+    <echo message="  dll.ext=                     '${dll.ext}'"/>
+    <echo message="  lib.prefix=                  '${lib.prefix}'"/>
+    <echo message="  object.ext=                  '${object.ext}'"/>
+    <echo message="  exe.ext=                     '${exe.ext}'"/>
+    <echo message="  script.ext=                  '${script.ext}'"/>
+    <echo message="  external.definitions.file=   '${external.definitions.file}'"/>
+
+    <!-- libxml2 -->
+    <if>
+      <isset property="enable_sdo"/>
+      <then>
+        <echo message=" "/>
+        <echo message="sdo location"/>
+        <echo message="  tuscany.sdo.home.dir=          ${tuscany.sdo.home.dir}"/>
+      </then>
+    </if>
+
+    <!-- axis2c -->
+    <if>
+      <isset property="enable_ws"/>
+      <then>
+        <echo message=" "/>
+        <echo message="axis2c location"/>
+        <echo message="  axis2c.home.dir=          ${axis2c.home.dir}"/>
+      </then>
+    </if>
+
+    <echo message=" "/>
+
+  </target>
+
+</project>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org