<?xml version="1.0" standalone="no"?>

<!--
* 
*
*  ProLinga-Data
*
*  Copyright (C) 2002-2008 Xobas Software.
*  All rights reserved.
*  
*  This file is part of ProLinga-Data.
*
*  ProLinga-Data is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  ProLinga-Data is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with ProLinga-Data.  If not, see <http://www.gnu.org/licenses/>.
*
*  More information is available at the following addresses:
*
*  Website     : http://www.prolinga.org
*
*  Email       : prolinga-list@prolinga.org
*
*
-->

<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [

<!ENTITY version SYSTEM "version.txt" >
<!ENTITY prolinga-data-API  SYSTEM "prolinga-data-API.xml" >
<!ENTITY prolinga-data-userguide  SYSTEM "prolinga-data-userguide.xml" >
<!ENTITY fdl  SYSTEM "fdl.xml" >
<!ENTITY PRODUCT "prolinga-data" >
<!ENTITY xobas '<emphasis><ulink url="http://www.xobas.com">Xobas Software</ulink></emphasis>'>
]>

<book id="prolinga-data" lang="en">
  <bookinfo>
    <title>ProLinga-Data Project</title>
    <releaseinfo>Release: &PRODUCT;-&version; - March 21, 2008</releaseinfo>
    <authorgroup>
      <author>
	<firstname>Bas</firstname>
	<surname>Driessen</surname>
	<affiliation>
          <orgname>&xobas;</orgname>
	    <address><email>bas.driessen@xobas.com</email></address>
	</affiliation>
	<contrib>Original author and current maintainer.</contrib>
      </author>
    </authorgroup>

    <copyright>
      <year>2002-2008</year>
      <holder>The ProLinga Team</holder>
    </copyright>

    <legalnotice>
      <para>Permission is granted to copy, distribute and/or modify this document
      under the terms of the GNU Free Documentation License, Version 1.2
      or any later version published by the Free Software Foundation;
      with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
      A copy of the license is included in the section entitled
      <ulink type="http"
      url="gfdl.html">"GNU Free Documentation License"</ulink>.</para>
    </legalnotice>

    <abstract>
      <para>This document describes the ProLinga-Data Project, how to
      build the software components and documents the API reference of the 
      prolinga-data library.</para>
    </abstract>
  </bookinfo>

  <chapter id="prolinga-data-product-info">
    <title>ProLinga-Data Project</title>

    <para><parameter>ProLinga-Data</parameter> is a project that uses the latest
<ulink type="http" url="http://www.gnome-db.org">libgda technologies</ulink>
    provide 
    access to the data providers PostgreSQL, MySQL, Oracle, Sybase, ODBC data sources, 
    mSQL, IBM DB2, FireBird/Interbase, FreeTDS, SQLite, LDAP, MS SQL Server, 
    Berkeley DB, MDB (MS Access) and xBase (dBase, Clipper, FoxPro) files.</para>

    <para>Since libgda is under active development itself, we have to introduce this 
    technology in seperate steps. The first (and implemented) step is that SQL queries
    can be passed on to a provider using its native language dialect (SQL92 or SQL99 for 
    instance). <parameter>ProLinga-Data</parameter> is in this instance "just" the 
    traffic agent of passing
    on a SQL statement and returning a result or data model (cursor).</para>

    <para>The next step is to introduce an easy way to modify schemas
    allowing the management of database objects (tables, views, users, procedures, etc)
    in the provider environment, without using any SQL at all. This feature will be
    available in upcoming releases of libgda and will then get implemented in
    <parameter>ProLinga-Data</parameter>. This feature gives us the advantage for instance
    to build and re-build data files from within the ProLinga Environment, without having to
    know if the data provider is PostgreSQL or MySQL for instance. The ability to create
    tables and indexes is available in the mean-time and the rebuild ability is not too
    far away.</para>

    <para>Fully functional updatable data models are available for the PostgreSQL and 
    MySQL providers.</para>

    <para>Future enhancement steps will include:</para>

    <itemizedlist>
      <listitem><para>XML Queries. Queries in a generic form that are put into an
       XML document are send to a provider where this query is transformed into a, for
       the data provider, understandable (SQL) query and where results are returned to 
       the caller.</para></listitem>
      <listitem><para>Reports</para></listitem>
    </itemizedlist>

    <para><parameter>ProLinga-Data</parameter> works according the Request-Response 
    mechanism. A request can be 
    for instance to execute a "SELECT * ..." in a data provider environment. 
    ProLinga-Data will send out
    this request to the data provider and returns a result or data model (cursor) as
    a response.</para>

    <para><parameter>ProLinga-Data</parameter> can be configured as a Web Service 
    (daemon) on the machine. 
    A sophisticated SOAP layer on top controls the flow and processing of incoming and 
    outgoing requests/responses over the TCP/IP network. Using this concept, programs 
    can run locally on a machine while accessing a remote database engine centrally 
    located in an intranet environment or anywhere in the world via the internet.
    </para>

    <para>Main purpose for the creation of this project, is to provide an
    easy way to access and store user data from the ProLinga environment.
    Since the result library of this project is very open, simple and easy to 
    implement, it can be used in other non-ProLinga related projects.
    </para>

    <para><parameter>ProLinga-Data</parameter> has been built and 
    tested on
    RedHat Fedora, Mandriva Linux,
    Debian, Ubuntu and openSUSE.
    Since all code is written
    in C++, it can be ported to all modern UNIX systems, Linux variants
    as well as Windows and Mac O/S platforms.</para>

    <sect1 id="prolinga-data-data_commands">
      <title>Data Commands</title>

      <para>Data Commands are used to access a data provider. A request XML document 
      containing a command is presented to the provider. This document is processed 
      and a response XML document is returned.</para>

      <para>Data Commands have the following format:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0" >
    <Command Name="]]><parameter>command</parameter><![CDATA[" Mode="Request">
      . . .
      . . .
    </Command>
  </Data>
</ProLinga>
]]></programlisting>


      <para>The following Data Commands are available:</para>

      <itemizedlist>
        <listitem><para>Connect</para></listitem>
        <listitem><para>Disconnect</para></listitem>
        <listitem><para>ListProviders</para></listitem>
        <listitem><para>ListDataSources</para></listitem>
        <listitem><para>OpenDataSource</para></listitem>
        <listitem><para>CloseDataSource</para></listitem>
        <listitem><para>ExecuteQuery</para></listitem>
        <listitem><para>ExecuteNonQuery</para></listitem>
        <listitem><para>ExecuteQueryDataModel</para></listitem>
        <listitem><para>ExecuteQueryTableDataModel</para></listitem>
        <listitem><para>DataModelGetRow</para></listitem>
        <listitem><para>DataModelAppendRow</para></listitem>
        <listitem><para>DataModelUpdateRow</para></listitem>
        <listitem><para>DataModelRemoveRow</para></listitem>
        <listitem><para>DataModelClose</para></listitem>
        <listitem><para>Transaction</para></listitem>
        <listitem><para>ManageData</para></listitem>
        <listitem><para>Ping</para></listitem>
      </itemizedlist>

      <sect2 id="prolinga-data-dc_connect">
        <title>Connect</title>

        <para>With the connect command, a session is created. A valid session is 
        required to be able to send Data Commands. Hhandles, cursor positions 
        etc will all be held internally in a session record.</para>

        <para>Example Connect Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="Connect" Mode="Request"/>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example Connect Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="Connect" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok"/>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>
      </sect2>

      <sect2 id="prolinga-data-dc_disconnect">
        <title>Disconnect</title>

        <para>With the disconnect command, a session is destroyed.</para>

        <para>Example Disconnect Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="Disconnect" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz"/>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example Disconnect Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="Disconnect" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok"/>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_listproviders">
        <title>ListProviders</title>

        <para>Administration/debug command. With the ListProviders command, 
        providers for which libgda has been configured for, will be shown. 
        This does not necessarily mean that the providers themselves are 
        installed and are available.</para>

        <para>Example ListProviders Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="ListProviders" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object Name="*" />
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example ListProviders Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="ListProviders" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
        <Object Name="MySQL"/>
        <Object Name="PostgreSQL"/>
        <Object Name="LDAP"/>
        <Object Name="XML"/>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_listdatasources">
        <title>ListDataSources</title>

        <para>Administration/debug command. With the ListDataSources, datasources 
        for which libgda has been configured, will be shown.</para>

        <para>Example ListDataSources Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="ListDataSources" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object Name="*" />
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example ListDataSources Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="ListDataSources" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
      <Object Name="stock_msql">
        <Provider>MySQL</Provider>
        <Cnc>PORT=3306;USER=prolinga;DATABASE=stock;HOST=localhost</Cnc>
        <Description>ProLinga MySQL.</Description>
        <UserName/>
        <Password/>
      </Object>
      <Object Name="stock_psql">
        <Provider>PostgreSQL</Provider>
        <Cnc>HOSTADDR=127.0.0.1;PORT=5432;USER=prolinga;DATABASE=stock;HOST=localhost</Cnc>
        <Description>Stock database in PostgreSQL</Description>
        <UserName/>
        <Password/>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_opendatasource">
        <title>OpenDataSource</title>

        <para>With the OpenDataSource command, a connection to a data source is 
        established.</para>

        <para>Example OpenDataSource Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="OpenDataSource" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object DataSource="stock_psql" >
        <UserName>prolinga</UserName>
        <Password/>
        <ReadOnlyConnection>False</ReadOnlyConnection>
        <DontShareConnection>False</DontShareConnection>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example OpenDataSource Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="OpenDataSource" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
      <Object DataSource="stock_psql" />
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_closedatasource">
        <title>CloseDataSource</title>

        <para>With the CloseDataSource command, a connection is destroyed.  
        This command is not required when followed by a disconnect command, since 
        a disconnect command will close all data sources linked to that session.</para>

        <para>Example CloseDataSource Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="CloseDataSource" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object DataSource="stock_psql" />
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example CloseDataSource Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="Connect" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
      <Object DataSource="stock_psql" />
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_executenonquery">
        <title>ExecuteNonQuery</title>

        <para>With the ExecuteNonQuery command, SQL queries as a DELETE or UPDATE 
        can be executed that do not return any data. Only the number of rows affected 
        will be returned.</para>

        <para>Example ExecuteNonQuery Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="ExecuteNonQuery" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object DataSource="stock_psql">
        <NonQuery>
          <Sql>INSERT INTO Parts VALUES ('12345','Nail U12','2.95','54')</Sql>
        </NonQuery>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example ExecuteNonQuery Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="ExecuteNonQuery" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
      <Object DataSource="stock_psql">
        <NonQuery>
          <RowsAffected>1</RowsAffected>
        </NonQuery>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_executequery">
        <title>ExecuteQuery</title>

        <para>With the ExecuteQuery command, SQL queries can be executed that return 
        data. All data is returned in a single XML response file. For large responses, 
        ExecuteQueryDataModel can be used instead to "just" load the datamodel 
        (cursor), which can be processed using DataModel commands.</para>

        <para>Example ExecuteQuery Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="ExecuteQuery" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object DataSource="stock_psql">
        <Query>
          <Sql>SELECT * FROM Parts</Sql>
        </Query>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example ExecuteQuery Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="ExecuteQuery" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
      <Object DataSource="stock_psql">
        <Query>
          <Result>
            <ColumnHeaderInstances>
              <ColumnHeaderInstance SequenceNo="1" Name="Part_Id" StorageType="string" Size="5"/>
              <ColumnHeaderInstance SequenceNo="2" Name="Desc" StorageType="string" Size="10"/>
              <ColumnHeaderInstance SequenceNo="3" Name="Price" StorageType="double" Size="5" Decimals="2" />
              <ColumnHeaderInstance SequenceNo="4" Name="InStock" StorageType="integer" Size="5"/>
            </ColumnHeaderInstances>
            <DataInstances>
              <DataInstance SequenceNo="1">
                <Part_Id>12345</Part_Id>
                <Desc>Nail U12</Desc>
                <Price>2.95</Price>
                <InStock>54</InStock>
              </DataInstance>
              <DataInstance SequenceNo="2">
                <Part_Id>12346</Part_Id>
                <Desc>Nail U15</Desc>
                <Price>2.90</Price>
                <InStock>14</InStock>
              </DataInstance>
            </DataInstances>
          </Result>
        </Query>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_executequerydatamodel">
        <title>ExecuteQueryDataModel</title>

        <para>With the ExecuteQueryDataModel command, SQL queries can be executed 
        that return data. All data is loaded in a DataModel. DataModel commands 
        can then be used to retrieve this data.</para>

        <para>Example ExecuteQueryDataModel Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="ExecuteQueryDataModel" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object DataSource="stock_psql" DataModel="dmParts">
        <Query>
          <Sql>SELECT * FROM Parts</Sql>
        </Query>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example ExecuteQueryDataModel Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="ExecuteQueryDataModel" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
      <Object DataSource="stock_psql" DataModel="dmParts" />
        <Query>
          <ColumnsDataModel>5</ColumnsDataModel>
          <RowsDataModel>12</RowsDataModel>
        </Query>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_executetabledatamodel">
        <title>ExecuteQueryTableDataModel</title>

        <para>With the ExecuteQueryTableDataModel command, a table can be loaded
        in the data model for update, so records can easily be changed, appended or
	removed resulting in the underlying data provider to be updated.</para>

        <para>Example ExecuteQueryTableDataModel Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="ExecuteQueryTableDataModel" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object DataSource="stock_psql" DataModel="dmParts">
        <Query>
          <Table>Parts</Table>
          <Condition>where price > '10.00'</Condition>
        </Query>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example ExecuteQueryTableDataModel Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="ExecuteQueryTableDataModel" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
      <Object DataSource="stock_psql" DataModel="dmParts" />
        <Query>
          <ColumnsDataModel>5</ColumnsDataModel>
          <RowsDataModel>12</RowsDataModel>
        </Query>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_datamodelgetrow">
        <title>DataModelGetRow</title>

        <para>With the DataModelGetRow command, a row can be retrieved from a 
        DataModel.</para>

        <para>Example DataModelGetRow Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="DataModelGetRow" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object DataSource="stock_psql" DataModel="dmParts">
        <DataModelRow RowId="2"/>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example DataModelGetRow Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="DataModelGetRow" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
      <Object DataSource="stock_psql" DataModel="dmParts">
        <DataModelRow RowId="2">
          <Result>
            <ColumnHeaderInstances>
              <ColumnHeaderInstance SequenceNo="1" Name="Part_Id" StorageType="string" Size="5"/>
              <ColumnHeaderInstance SequenceNo="2" Name="Desc" StorageType="string" Size="10"/>
              <ColumnHeaderInstance SequenceNo="3" Name="Price" StorageType="double" Size="5" Decimals="2" />
              <ColumnHeaderInstance SequenceNo="4" Name="InStock" StorageType="integer" Size="5"/>
            </ColumnHeaderInstances>
            <DataInstances>
              <DataInstance SequenceNo="1">
                <Part_Id>12346</Part_Id>
                <Desc>Nail U15</Desc>
                <Price>2.90</Price>
                <InStock>14</InStock>
              </DataInstance>
            </DataInstances>
          </Result>
        </DataModelRow>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>
      <sect2 id="prolinga-data-dc_datamodelappendrow">
        <title>DataModelAppendRow</title>

        <para>With the DataModelAppendRow command, a row can be appended to the
        DataModel generated with the ExecuteQueryTableDataModel command. At time of writing, 
	this functionality has not been implemented
        yet with all data providers supported by the libgda project. Please check the
        provider specific notes or mailing list (archive) for more info.</para>

        <para>Example DataModelAppendRow Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="DataModelAppendRow" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object DataSource="stock_psql" DataModel="dmParts">
        <DataModelAppendRow>
          <DataInstances>
            <DataInstance SequenceNo="1">
              <Part_Id>12346</Part_Id>
              <Desc>Nail U15</Desc>
              <Price>2.90</Price>
              <InStock>14</InStock>
            </DataInstance>
          </DataInstances>
        </DataModelAppendRow>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example DataModelAppendRow Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="DataModelAppendRow" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
      <Object DataSource="stock_psql" DataModel="dmParts">
        <DataModelAppendRow RowId="8"/>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_datamodelupdaterow">
        <title>DataModelUpdateRow</title>

        <para>With the DataModelUpdateRow command, a row can be updated in the
        DataModel generated with the ExecuteQueryTableDataModel command. This results 
	in the underlying database row's values being changed. 
	At time of writing, this functionality has not been implemented
        yet with all data providers supported by the libgda project. Please check their
        provider specific notes or mailing list (archive) for more info.</para>

        <para>Example DataModelUpdateRow Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="DataModelUpdateRow" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object DataSource="stock_psql" DataModel="dmParts">
        <DataModelUpdateRow RowId="8">
          <DataInstances>
            <DataInstance SequenceNo="1">
              <Part_Id>12346</Part_Id>
              <Desc>Nail U15</Desc>
              <Price>2.95</Price>
              <InStock>14</InStock>
            </DataInstance>
          </DataInstances>
        </DataModelUpdateRow>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example DataModelUpdateRow Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="DataModelUpdateRow" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
      <Object DataSource="stock_psql" DataModel="dmParts">
        <DataModelUpdateRow RowId="8"/>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_datamodelremoverow">
        <title>DataModelRemoveRow</title>

        <para>With the DataModelRemoveRow command, a row can be removed from a 
        DataModel generated with the ExecuteQueryTableDataModel command. This results in 
	the underlying database row being removed from 
	the database. At time of writing, this functionality has not been implemented
	yet with all data providers supported by the libgda project. Please check their
        provider specific notes or mailing list (archive) for more info.</para>

        <para>Example DataModelRemoveRow Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="DataModelRemoveRow" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object DataSource="stock_psql" DataModel="dmParts">
        <DataModelRemoveRow RowId="2"/>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example DataModelRemoveRow Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="DataModelRemoveRow" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
      <Object DataSource="stock_psql" DataModel="dmParts"/>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_datamodelclose">
        <title>DataModelClose</title>

        <para>With the DataModelClose command, one or all DataModels can be closed 
        and resources will be freed.</para>

        <para>Example DataModelClose Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="DataModelClose" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object DataSource="stock_psql" DataModel="dmParts"/>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example DataModelClose Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="DataModelClose" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
      <Object DataSource="stock_psql" DataModel="dmParts"/>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_transaction">
        <title>Transaction</title>

        <para>With the Transaction command, update SQL commands can be safeley executed 
        within a transaction environment. Transactions will only work if the underlying 
        tables are transaction safe tables. With MySQL for instance Transactions will 
        only work when using the type InnoDB or BDB. The default (My)ISAM type does not 
        have a transaction engine.</para>

        <para>Example Transaction Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="Transaction" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object DataSource="stock_psql">
        <Transaction Mode="Begin">   *
          <IsolationLevel>Serializable</IsolationLevel>  **
        </Transaction>
      </Object>
    </Command>
  </Data>
</ProLinga>

*) Available Modes are Begin, Commit and Rollback
**) Available IsolationLevels are Unknown, ReadCommitted, ReadUncommitted, RepeatableRead and Serializable.
]]></programlisting>

        <para>Example Transaction Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="Transaction" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
      <Object DataSource="psql" />
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_managedata">
        <title>ManageData</title>

        <para>With the ManageData command the following actions can be performed:</para>

        <itemizedlist>
          <listitem><para>Create</para></listitem>
          <listitem><para>Drop</para></listitem>
          <listitem><para>Reformat (to do)</para></listitem>
          <listitem><para>Dump to text file (to do)</para></listitem>
          <listitem><para>Load from text file (to do)</para></listitem>
          <listitem><para>...</para></listitem>
        </itemizedlist>

        <para>Example ManageData Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="ManageData" Mode="Request" SessionId="XD-f8l5rowk7414eif077963ooqoicz">
      <Object DataSource="stock_psql" Table="Parts">
        <ManageData Option="Create">
          <ExternalTableName>Parts</ExternalTableName>
        </ManageData>
        <IndexInstances>
          <IndexInstance SequenceNo="1" Name="idxPart1" Primary="True"  Unique="True">
             <KeyInstances>
               <KeyInstance SequenceNo="1" Name="Part_Id" />
             </KeyInstances>
           </IndexInstance>
           <IndexInstance SequenceNo="2" Name="idxPart2" Primary="False" Unique="False" >
            <KeyInstances >
              <KeyInstance SequenceNo="1" Name="Desc" />
            </KeyInstances>
          </IndexInstance>
        </IndexInstances>
        <DataInstances>
          <DataInstance SequenceNo="1" Name="Part_Id" StorageType="Character" Size="5" AllowNulls="False" />
          <DataInstance SequenceNo="2" Name="Desc" StorageType="Character" Size="10" AllowNulls="True" />
          <DataInstance SequenceNo="3" Name="Price" StorageType="Double" Size="5" Decimals="2" AllowNulls="True" />
          <DataInstance SequenceNo="4" Name="InStock" StorageType="Integer" Size="5" AllowNulls="True" />
        </DataInstances>
       </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

        <para>Example ManageData Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0" >
    <Command Name="ManageData" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Ok">
      <Object DataSource="stock_psql" Table="Parts" />
    </Command>
  </Data>
</ProLinga>
]]></programlisting>
        <para/>

      </sect2>

      <sect2 id="prolinga-data-dc_ping">
        <title>Ping</title>

        <para>The ping command can be used to test if a data host is on-line
        and responding to requests.</para>

        <para>Example Ping Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="Ping" Mode="Request"/>
  </Repository>
</ProLinga>
]]></programlisting>

        <para>Example Ping Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="Ping" Mode="Response" Status="Ok"/>
  </Repository>
</ProLinga>
]]></programlisting>

        <para>Additionial error information from the underlying SOAP layer will be 
        presented as well in the response document in case of an error.</para>

      </sect2>

    </sect1>

    <sect1 id="prolinga-data-error_handling">
      <title>Error Handling</title>

      <para>As soon as something goes wrong when processing a request, an error is 
      generated and put into the response document. The status of the response will 
      be set to "Error" or "Warning" depending on the severity of the error. In 
      case of an error, processing will abort immediately, while in case of a 
      warning processing continues.</para>

      <para>An error has the following format:</para>

<programlisting><![CDATA[
<Error Id=”12345”>
  <Severity>Error/Warning</Severity>
  <Description>Short description</Description>
  <ExternalDescription>An external error text if available</ExternalDescription>
</Error>
]]></programlisting>

      <para>Example response when trying to connect to a non-existent data source.
      </para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version="1.0">
    <Command Name="OpenDataSource" Mode="Response" SessionId="XD-f8l5rowk7414eif077963ooqoicz" Status="Error">
      <Object DataSource="non_existent">
        <Error Id="70001">
          <Severity>Error</Severity>
          <Description>Can not open GDA connection.</Description>
          <ExternalDescription/>
        </Error>
      </Object>
    </Command>
  </Data>
</ProLinga>
]]></programlisting>

       <para>The "External" element will contain any error text passed on from
       the O/S or 3rd party products.</para>

       <para>The following errors are defined:</para>

        <table frame="all" tocentry="1" >
        <title>Errors</title>
        <tgroup cols="3">
          <thead>
            <row>
              <entry>Error Id</entry>
              <entry>Severity</entry>
              <entry>Description</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>70000</entry>
              <entry>Ok</entry>
              <entry>No Error</entry>
            </row>
            <row>
              <entry>70001</entry>
              <entry>Error</entry>
              <entry>Can not open GDA connection</entry>
            </row>
            <row>
              <entry>70002</entry>
              <entry>Error</entry>
              <entry>GDA connection does not exist</entry>
            </row>
            <row>
              <entry>70003</entry>
              <entry>Error</entry>
              <entry>Error processing query</entry>
            </row>
            <row>
              <entry>70004</entry>
              <entry>Error</entry>
              <entry>Data Model does not exist</entry>
            </row>
            <row>
              <entry>70005</entry>
              <entry>Error</entry>
              <entry>Invalid value RowId</entry>
            </row>
            <row>
              <entry>70006</entry>
              <entry>Error</entry>
              <entry>Other transaction already in progress</entry>
            </row>
            <row>
              <entry>70007</entry>
              <entry>Error</entry>
              <entry>No transaction in progress</entry>
            </row>
            <row>
              <entry>70008</entry>
              <entry>Warning</entry>
              <entry>UNDEFINED</entry>
            </row>
            <row>
              <entry>70009</entry>
              <entry>Warning</entry>
              <entry>Invalid Session ID</entry>
            </row>
            <row>
              <entry>70010</entry>
              <entry>Error</entry>
              <entry>UNDEFINED</entry>
            </row>
            <row>
              <entry>70011</entry>
              <entry>Error</entry>
              <entry>Error parsing file</entry>
            </row>
            <row>
              <entry>70012</entry>
              <entry>Error</entry>
              <entry>UNDEFINED</entry>
            </row>
            <row>
              <entry>70013</entry>
              <entry>Error</entry>
              <entry>Invalid Build Option</entry>
            </row>
            <row>
              <entry>70014</entry>
              <entry>Warning</entry>
              <entry>GDA connection already open</entry>
            </row>
          </tbody>
        </tgroup>
        </table>

    </sect1>

    <sect1 id="prolinga-data-multiple_dcs">
      <title>Multiple Data Commands</title>

      <para>It is possible to combine DCs in one single request. There will be
      one response file, but with results for every command, unless an error has
      been encountered before the end of processing. The format is as follows:
      </para>

<programlisting><![CDATA[
<ProLinga>
  <Data Version=”1.0”>
    <Command Name="]]><parameter>command</parameter><![CDATA[" Mode="Request">
      <Object DataSource="]]><parameter>dsrcname</parameter><![CDATA[">
        ...
        ...
      </Object>
      <Object DataSource="]]><parameter>dsrcname</parameter><![CDATA[">
        ...
        ...
      </Object>
    </Command>
  </Repository>
</ProLinga>
]]></programlisting>

      <para>Combining multiple DCs will result in better performance.</para>

    </sect1>

    <sect1 id="prolinga-data-storage_types">
      <title>Storage Types</title>

      <para>The the following storage types are defined in libgda:</para>

      <itemizedlist>
        <listitem><para>null</para></listitem>
        <listitem><para>bigint</para></listitem>
        <listitem><para>biguint</para></listitem>
        <listitem><para>binary</para></listitem>
        <listitem><para>blob</para></listitem>
        <listitem><para>boolean</para></listitem>
        <listitem><para>date</para></listitem>
        <listitem><para>double</para></listitem>
        <listitem><para>geometric_point (point)</para></listitem>
        <listitem><para>gobject</para></listitem>
        <listitem><para>integer</para></listitem>
        <listitem><para>list</para></listitem>
        <listitem><para>money</para></listitem>
        <listitem><para>numeric</para></listitem>
        <listitem><para>single</para></listitem>
        <listitem><para>smallint</para></listitem>
        <listitem><para>smalluint</para></listitem>
        <listitem><para>string</para></listitem>
        <listitem><para>time</para></listitem>
        <listitem><para>timestamp</para></listitem>
        <listitem><para>tinyint</para></listitem>
        <listitem><para>tinyuint</para></listitem>
        <listitem><para>type</para></listitem>
        <listitem><para>uinteger</para></listitem>
        <listitem><para>unknown</para></listitem>
      </itemizedlist>

      <para>Not all storage types are implemented (yet) and/or supported in all 
      the various providers libgda can link with.</para>

      <para>Within the ProLinga 4GL environment, only the basic data storage types are defined:</para>

      <itemizedlist>
        <listitem><para>Character</para></listitem>
        <listitem><para>Integer</para></listitem>
        <listitem><para>Long (Integer)</para></listitem>
        <listitem><para>Single (Precision Number)</para></listitem>
        <listitem><para>Double (Precision Number)</para></listitem>
        <listitem><para>Date</para></listitem>
      </itemizedlist>
      
      <table frame="all" tocentry="0" >
        <title>ProLinga 4GL -> libgda mapping</title>
        <tgroup cols="2">
          <thead>
            <row>
              <entry>ProLinga Storage Type</entry>
              <entry>LibGDA Storage Type</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>Character</entry>
              <entry>string</entry>
            </row>
            <row>
              <entry>Integer</entry>
              <entry>integer</entry>
            </row>
            <row>
              <entry>Long Integer</entry>
              <entry>bigint</entry>
            </row>
            <row>
              <entry>Single Precision Number</entry>
              <entry>single</entry>
            </row>
            <row>
              <entry>Double Precision Number</entry>
              <entry>double</entry>
            </row>
            <row>
              <entry>Date</entry>
              <entry>date</entry>
            </row>
          </tbody>
        </tgroup>
      </table>

      <table frame="all" tocentry="0" >
        <title>libgda -> ProLinga 4GL mapping</title>
        <tgroup cols="2">
          <thead>
            <row>
              <entry>LibGDA Storage Type</entry>
              <entry>ProLinga Storage Type</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>null</entry>
              <entry>Character</entry>
            </row>
            <row>
              <entry>bigint</entry>
              <entry>Long Integer</entry>
            </row>
            <row>
              <entry>biguint (not implemented yet in libgda)</entry>
              <entry>--</entry>
            </row>
            <row>
              <entry>binary</entry>
              <entry>Character</entry>
            </row>
            <row>
              <entry>blob</entry>
              <entry>Character</entry>
            </row>
            <row>
              <entry>boolean</entry>
              <entry>Character</entry>
            </row>
            <row>
              <entry>date</entry>
              <entry>Date</entry>
            </row>
            <row>
              <entry>double</entry>
              <entry>Double Precision Number</entry>
            </row>
            <row>
              <entry>geometric_point (point)</entry>
              <entry>N/A</entry>
            </row>
            <row>
              <entry>gobject (not implemented yet in libgda)</entry>
              <entry>--</entry>
            </row>
            <row>
              <entry>list</entry>
              <entry>N/A</entry>
            </row>
            <row>
              <entry>money (not implemented yet in libgda)</entry>
              <entry>--</entry>
            </row>
            <row>
              <entry>numeric</entry>
              <entry>Double Precision Number</entry>
            </row>
            <row>
              <entry>single</entry>
              <entry>Single Precision Number</entry>
            </row>
            <row>
              <entry>smallint</entry>
              <entry>Integer</entry>
            </row>
            <row>
              <entry>smalluint (not implemented yet in libgda)</entry>
              <entry>--</entry>
            </row>
            <row>
              <entry>string</entry>
              <entry>Character</entry>
            </row>
            <row>
              <entry>time</entry>
              <entry>Character</entry>
            </row>
            <row>
              <entry>timestamp</entry>
              <entry>Character</entry>
            </row>
            <row>
              <entry>tinyint</entry>
              <entry>Integer</entry>
            </row>
            <row>
              <entry>tinyuint (not implemented yet in libgda)</entry>
              <entry>--</entry>
            </row>
            <row>
              <entry>type (not implemented yet in libgda)</entry>
              <entry>--</entry>
            </row>
            <row>
              <entry>uinteger (not implemented yet in libgda)</entry>
              <entry>--</entry>
            </row>
            <row>
              <entry>unknown (not implemented yet in libgda)</entry>
              <entry>--</entry>
            </row>
          </tbody>
        </tgroup>
      </table>
      
      <para>For libgda &lt;-&gt; data provider mappings, please look at provider specific 
      documentation at <ulink type="http"
      url="http://www.gnome-db.org">
      http://www.gnome-db.org</ulink>.</para>

    </sect1>

  </chapter>

  <chapter id="prolinga-data-programming_notes">
    <title>ProLinga-Data Programming Notes</title>

    <para>To test ProLinga-Data, the best and easiest way is to
    use the binaries that come with the product. Configure so the product is 
    running as a Web Service and use the client binary to send and
    receive Data Commands. See the <ulink type="http"
    url="prolinga-data-userguide.html">
    user guide</ulink> section for more 
    details.</para>

    <para>To access the Data engine from a C++ application,
    either network (SOAP) calls to send and receive Data
    Commands over the network or the C++ API to
    link with the Data library can be used.</para>

    <sect1 id="prolinga-data-network_client">
      <title>Network Client</title>

      <para>To be able to send and receive Data commands over 
      the network as SOAP calls from
      a C++ application, the application must link with the ProLinga-Soap
      Client Library (libprolingasoapclient). Details of how to do so are
      in the section "Programming Notes" of the ProLinga-Soap Project
      documentation. In the example you have to change the example
      XML request document with a valid Data Command. Alternatively,
      have a look at the source code file <parameter>DataClient.cpp
      </parameter> in the <parameter>src</parameter> directory of
      ProLinga-Data.</para>

      <para>When using this method, ProLinga-Data must be running as 
      a Web Service.</para>

    </sect1>

    <sect1 id="prolinga-data-data_library">
      <title>Data Library</title>

      <para>To be able to link directly with Data from a C++
      application, the Data Library (C++ API) can be used.</para>

      <para>A very basic example program using the Data Library
      looks like this:</para>

<programlisting><![CDATA[
#include <prolinga/Data.hpp>
                                                                                                                                             
int main(int argc, char **argv)
{
        /*Init */
        xmlDocPtr docReq, docRes;
        xmlNodePtr curReq, curRes;
        xmlBufferPtr bufRes;
        PlData dat;
                                                                                                                                             
        /* Open Data Environment */
        dat.dataOpen("./prolingadatcfg.xml", argc, argv);
                                                                                                                                             
        /* Create Data Command */
        docReq = xmlNewDoc((const xmlChar *)"1.0");
        docReq->children = xmlNewDocNode(docReq, NULL, (const xmlChar *)"ProLinga", NULL);
        curReq = xmlDocGetRootElement(docReq);
        curReq = xmlNewTextChild (curReq, NULL, (const xmlChar *)"Data", (const xmlChar *)"");
        xmlNewProp (curReq, (const xmlChar *)"Version", (const xmlChar *)"1.0");
        curReq = xmlNewTextChild (curReq, NULL, (const xmlChar *)"Command", (const xmlChar *)"");
        xmlNewProp (curReq, (const xmlChar *)"Name", (const xmlChar *)"Connect");
        xmlNewProp (curReq, (const xmlChar *)"Mode", (const xmlChar *)"Request");
                                                                                                                                             
        /* Process Data Command */
        docRes = dat.executeCommand(docReq);
                                                                                                                                             
        /* Print Response */
        bufRes = xmlBufferCreate();
        curRes = xmlDocGetRootElement(docRes);
        xmlNodeDump(bufRes, docRes, curRes, 0, 1);
        printf("%s\n", (char *)xmlBufferContent(bufRes));
                                                                                                                                             
        /* Close Data Environment */
        dat.dataClose();
                                                                                                                                             
        /* Free */
        xmlBufferFree(bufRes);
        xmlFreeDoc(docRes);
        xmlFreeDoc(docReq);
                                                                                                                                             
        /* Return */
        return 0;
}
]]></programlisting>

      <para>When running this application, a connection is made to the
      Data environment. When opening this connection an argument with the path
      and name of the data configuration file can be passed as
      an argument. The system then knows environment details.
      The configuration file has
      to be in a certain format, which is explained further on. The Data
      Command is then presented to the Data process engine and a response
      is returned. This response is printed to to stdout (screen). The connection
      to Data is closed and the program exits.</para>

      <para>After creating a connection using the openData class function, more
      than one VC can be executed without the need to close and open the Data
      environment for every call. In fact performance wise this is the 
      prefered method.</para>

      <note>The C API of the libxml2 toolkit has been used in this example, 
      while it is probably better
      to use a C++ implementation of this toolkit as <ulink type="http"
      url="http://libxmlplusplus.sourceforge.net/">
      libxml++</ulink>. 
      Internal Data code will
      be changed as the project progresses.</note>

      <para>To compile the program
      use the following command:</para>
<programlisting>
g++ data_test.cpp -o data_test `pkg-config --cflags --libs prolinga-data`
</programlisting>

      <para>ProLinga-Data Library <parameter>libprolingarepository</parameter> has to be available 
      for this option as well as the libgda libraries.</para>

      <para>You may need to set the environment variable PKG_CONFIG_PATH to 
      point to the directories where prolinga-data.pc is located. 
      This can be directory <parameter>/usr/lib/pkgconfig</parameter> or
      directory <parameter>/usr/local/lib/pkgconfig</parameter> on Linux for
      example.
      </para>

      <para>ProLinga-Data is built using various 3rd party open source packages.
      These packages need to be available at compile time for a sucessful result. See
      the <ulink type="http"
      url="prolinga-data-build_instructions.html#prolinga-data-dependencies">
      dependencies</ulink> and <ulink type="http"
      url="prolinga-data-build.html#prolinga-data-prerequisites">
      prerequisites</ulink> section for more details.</para>
    </sect1>

  </chapter>

  <chapter id="prolinga-data-download">
    <title>Download ProLinga-Data</title>

    <para>There are two types of product versions available for download:</para>

    <orderedlist>
      <listitem><para>Production Version</para></listitem>
      <listitem><para>Development Version</para></listitem>
    </orderedlist>

    <sect1 id="prolinga-data-production_version">
      <title>Production Version</title>

      <para>The production version is an official product release. This is a
      stable completed version which should be used in production environments. At this 
      stage the product is only available as a source archive. Binary packages for a wide
      range of platforms will be available for download as the project progresses.
      Please visit the 
      <ulink type="http"
      url="http://download.prolinga.org">
      download page</ulink> for the latest details.</para>
    </sect1>

    <sect1 id="prolinga-data-development_version">
      <title>Development Version</title>

      <para>The development version is a snapshot of the latest source files. Since
      it can contain bugs as part of "work in progress", this version should not
      be used in production environments. Only developers who want to help with
      further development of the ProLinga Projects should download this version. Please
      read the details at the <ulink type="http"
      url="prolinga-data-subversion.html">Subversion section</ulink>
      of how to obtain the latest development version.</para>

    </sect1>

  </chapter>

  <chapter id="prolinga-data-build">
    <title>Build ProLinga-Data</title>

    <sect1 id="prolinga-data-prerequisites">
      <title>Prerequisites</title>

      <para>ProLinga-Data &version; has been built and tested
      on various popular GNU/Linux platforms as RedHat Fedora, Mandriva Linux,
      Debian, Ubuntu and openSUSE. The product 
      should compile and run successfully on
      other Linux distributions as well as UNIX.
      GNU gcc/g++ >= 3.3 compilers/tools are required
      for a successful build.</para>

      <para>Required 3rd party package(s) for a successful build:</para>
      <itemizedlist>
        <listitem>
          <para><ulink type="http"
          url="http://xmlsoft.org"><parameter>libxml2.</parameter></ulink>
          This product provides XML libraries.</para>
        </listitem>
        <listitem>
          <para><ulink type="http"
          url="http://www.gnome-db.org"><parameter>libgda</parameter></ulink>
          This product provides a data abstraction layer.</para>
        </listitem>
        <listitem>
          <para><ulink type="http"
          url="http://www.prolinga.org"><parameter>ProLinga-Soap</parameter></ulink>
          This product provides a SOAP/XML engine.</para>
        </listitem>
      </itemizedlist>

      <para>Optional 3rd party package(s) for a successful run-time/test environment:</para>
      <itemizedlist>
        <listitem>
          <para>Data providers like <ulink type="http"
          url="http://www.postgresql.com"><parameter>PostgreSQL</parameter></ulink>
          or <ulink type="http"
          url="http://www.mysql.com"><parameter>MySQL</parameter></ulink>
          </para>
        </listitem>
        <listitem>
          <para>
          <ulink type="http"
          url="http://xmlsoft.org/XSLT"><parameter>xsltproc</parameter></ulink>. Command line processor.
          This package
          is only required to re-generate the HTML pages after making changes to the documentation.</para>
        </listitem>
      </itemizedlist>

      <sect2 id="prolinga-data-3rd_party_download">
        <title>General Download and Installation Instructions 3rd Party Products.</title>

        <para>Assuming the directory /opt/builds will be used for 3rd party products, 
        then in general the following steps need to be taken to download and extract
        a 3rd party product source archive.</para>

      <itemizedlist>
        <listitem>
          <para>Download source tar/gz archive to /opt/builds/[product] Example: 
           place libxml2-<parameter>x.x.x</parameter>.tar.gz in /opt/builds/libxml2</para>
        </listitem>
        <listitem>
          <para>Use 'gunzip' to unzip the archive</para>
        </listitem>
        <listitem>
          <para>Use 'tar xvf [product.tar] to extract the archive. Example:
           tar xvf libxml2-<parameter>x.x.x.</parameter>tar.</para>
        </listitem>
        <listitem>
          <para>A new sub directory will be created with the new version of
          the product. Example: /opt/builds/libxml2/libxml2-<parameter>x.x.x</parameter>
          This way several versions of the same products can be installed next to
          each other.</para>
        </listitem>
      </itemizedlist>

      <para>For product specific installation instructions see following sections.</para>

      </sect2>

      <sect2 id="prolinga-data-3rd_party_libxml2">
        <title>Libxml2:</title>
        <para>Product root dir: /opt/builds/libxml2</para>
        <para>Current version: 2.6.31</para>
        <para>Download:
        <ulink type="http"
        url="ftp://xmlsoft.org/libxml2/libxml2-2.6.31.tar.gz">
        ftp://xmlsoft.org/libxml2/libxml2-2.6.31.tar.gz</ulink></para>
        <para>Build Instructions:</para>

<programlisting>
cd /opt/builds/libxml2/libxml2-2.6.31
./configure --prefix=/opt/builds/libxml2/libxml2-2.6.31 --disable-gtk-doc
make
make install
</programlisting>

      </sect2>

      <sect2 id="prolinga-data-3rd_party_libgda">
        <title>LibGDA:</title>
        <para>Product root dir: /opt/builds/libgda</para>
        <para>Current version: 3.0.1</para>
        <para>Download:
        <ulink type="http"
        url="ftp://ftp.gnome.org/pub/GNOME/sources/libgda/3.0/libgda-3.0.1.tar.gz">
        ftp://ftp.gnome.org/pub/GNOME/sources/libgda/3.0/libgda-3.0.1.tar.gz</ulink></para>
        <para>Build Instructions:</para>

<programlisting>
cd /opt/builds/libgda/libgda-3.0.1
./configure --prefix=/opt/builds/libgda-3.0.1
make
make install
</programlisting>

      </sect2>

      <sect2 id="prolinga-data-3rd_party_prolingasoap">
        <title>ProLinga-Soap:</title>
        <para>Product root dir: /opt/builds/prolinga</para>
        <para>Current version: 0.0.1</para>
        <para>Download:
        <ulink type="http"
        url="http://download.prolinga.org">
        http://download.prolinga.org</ulink></para>
        <para>Build Instructions:</para>

<programlisting>
cd /opt/builds/prolinga/prolinga-soap-0.0.1
./configure --prefix=/opt/builds/prolinga/prolinga-soap-0.0.1
make
make install
</programlisting>

       <note>See the ProLinga-Soap Project documentation for more installation
       information.</note>

      </sect2>

    </sect1>

    <sect1 id="prolinga-data-build_instructions">
      <title>Build Instructions</title>

      <sect2 id="prolinga-data-extracting_archive">
        <title>Extracting archive</title>

        <para>The product archive can be extracted to any desired directory
        using <parameter>unzip</parameter> (.zip file extension) or
        <parameter>gunzip</parameter> (.gz file extension)/
        <parameter>bunzip2</parameter> (.bz2 file extension) and 
        <parameter>tar</parameter>. After extracting, the following directories
        will be created:
        </para>

        <table frame="all" tocentry="0" >
        <title>Directory Structure.</title>
        <tgroup cols="2">
          <thead>
            <row>
              <entry>Directory</entry>
              <entry>Description</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>&PRODUCT;-&version;</entry>
              <entry>Product version root directory.</entry>
            </row>
            <row>
              <entry>&PRODUCT;-&version;/config</entry>
              <entry>Config build information.</entry>
            </row>
            <row>
              <entry>&PRODUCT;-&version;/doc</entry>
              <entry>Documentation.</entry>
            </row>
            <row>
              <entry>&PRODUCT;-&version;/src</entry>
              <entry>All source and internal header files.</entry>
            </row>
            <row>
              <entry>&PRODUCT;-&version;/tests</entry>
              <entry>Self tests.</entry>
            </row>
            <row>
              <entry>&PRODUCT;-&version;/prolinga</entry>
              <entry>External (API) header files.</entry>
            </row>
          </tbody>
        </tgroup>
        </table>

      </sect2>

      <sect2 id="prolinga-data-compiling_linking">
        <title>Compiling and Linking</title>

        <para>To build the product go to the product root directory and run the 
        configure script. For default installation in /usr/local type:</para>

<programlisting>
./configure
</programlisting>

        <para>To install into another directory type:</para>

<programlisting>
./configure --prefix=<parameter>/any/dirname/</parameter>
</programlisting>

        <para>For all other configure options, type:</para>

<programlisting>
./configure --help
</programlisting>

        <para>After running the configure script, the product can be build with:</para>

<programlisting>
make
</programlisting>

        <para>To run the optional self-test type:</para>

<programlisting>
make check
</programlisting>

        <para>After compilation, the binaries, libraries and header files can be 
        installed with:</para>

<programlisting>
make install
</programlisting>

        <para>You may need root access for this last option.</para>

        <para>By default, HTML documentation pages are available in
        the doc/html directory. These pages are generated from 
        <ulink type="http"
        url="http://www.docbook.org">DocBook</ulink> XML file format
        files in /doc. To re-generate the HTML pages from these files type: </para>

<programlisting>
make html
</programlisting>

        <para>The command line XSLT processor <parameter>xsltproc</parameter> must be
        available from $PATH to be able to generate the HTML documentation.</para>

      </sect2>

      <sect2 id="prolinga-data-dependencies">
        <title>Dependencies</title>

        <para>Many of the ProLinga Projects are dependent on 3rd party libraries.
        These (non system) dependencies of ProLinga-Data are outlined below. 
        If these 3rd party
        products are not installed in either /usr/bin, /usr/lib, /usr/include
        or /usr/local/bin, /usr/local/lib, /usr/local/include, the additional
        configure option needs to be provided when building.</para>

        <table frame="all" tocentry="1" >
        <title>Dependencies</title>
        <tgroup cols="3">
          <thead>
            <row>
              <entry>Dependency</entry>
              <entry>Version</entry>
              <entry>Configure Option</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>libxml2</entry>
              <entry>>=2.6.5</entry>
              <entry>--with-libxml-prefix=<parameter>/path/to/libxml2</parameter></entry>
            </row>
            <row>
              <entry>libgda</entry>
              <entry>>=3.0.1</entry>
              <entry>--with-libgda-prefix=<parameter>/path/to/libgda</parameter></entry>
            </row>
            <row>
              <entry>ProLinga Soap</entry>
              <entry>>=0.0.1</entry>
              <entry>--with-prolingasoap-prefix=<parameter>/path/to/prolingasoap</parameter></entry>
            </row>
          </tbody>
        </tgroup>
        </table>
        <para></para>

      </sect2>

      <sect2 id="prolinga-data-choose_build">
        <title>Choosing the right type of build</title>

        <para>The default configuration options provide libraries which 
        can be used both to develop/debug as to run the product. However better builds 
        are possible for a dedicated development or production environment.</para>

        <para>In <emphasis>production</emphasis> environments, builds are needed which contain minimal (debug) 
        overhead, so they are fast and small. To build such binaries/libraries, the 
        --enable-final options can be used. Example:</para>

<programlisting>
./configure --enable-final
</programlisting>

        <para>The enable-final flag is configured to be used with GCC environments only. 
        If access to more compilers become available over time, the enable-flag will be 
        ported to those compilers as well.</para>

        <para>In <emphasis>development</emphasis> environments, builds are needed producing warnings, enabling
        maximum debugging info etc. Several options are available here.</para>

        <itemizedlist>
           <listitem>
             <para>--enable-warnings : Set all compiler warning flags</para>
           </listitem>
           <listitem>
             <para>--enable-debug : Enable all debug messages</para>
           </listitem>
           <listitem>
             <para>--enable-gprof : Enables profiling with gprof (GCC only)</para>
           </listitem>
        </itemizedlist>

      </sect2>

    </sect1>

  </chapter>

  <chapter id="prolinga-data-development">
    <title>Further development of ProLinga-Data</title>

    <para>All ProLinga Projects are under constant active development. This includes
    issues related to fixing bugs, increasing performance etc, as well as expanding
    the various projects with new features. This chapter provides information of
    all these types of tasks as well as details of how to join the development team.</para>

    <sect1 id="prolinga-data-todo">
      <title>To-do List</title>

      <para>This section contains a list of work that needs to be done on the product.
      A more detailed and up to date list is available on the
      <ulink type="http" url="http://bugzilla.prolinga.org">ProLinga Bugzilla Server</ulink>.
      </para>

      <itemizedlist>
         <listitem>
           <para>Implement XML Schemas for validation. Libxml2 is finishing up XML schemas.
           If it is still too far away, start with DTD.</para>
         </listitem>
         <listitem>
           <para>ProLinga-Data is written in C++. Libxml2 however is C only. There is a C++ wrapper
           for this XML parser library. Details at <ulink type="http"
           url="http://libxmlplusplus.sourceforge.net/">http://libxmlplusplus.sourceforge.net/</ulink>.
           </para>
         </listitem>
         <listitem>
           <para>Some strings/paths are hardcoded in the product. This all should be
           reviewed and be removed or made all configurable using a config file.</para>
         </listitem>
         <listitem>
           <para>Code review and cleanup. Make it more C++ Object Oriented.</para>
         </listitem>
         <listitem>
           <para>Logging. A simple logging mechanism has been implemented.</para>
         </listitem>
         <listitem>
           <para>Self-tests need to be developed for quality control.</para>
         </listitem>
         <listitem>
           <para>Porting to other platforms. (Windows/Solaris?), so we can make a distribution
            available on a specific port if we need to.</para>
         </listitem>
         <listitem>
           <para>Look into XML Queries (XQL). </para>
         </listitem>
         <listitem>
           <para>Locking???</para>
         </listitem>
         <listitem>
           <para>Look into SQL 92 and SQL 99. Need a independent flavour of SQL if user want to in 
           combination with XML Queries. Will always need to support native SQL for data provider.</para>
         </listitem>
         <listitem>
           <para> Add command line options to the binaries. 
           </para>
         </listitem>
       </itemizedlist>

    </sect1>

    <sect1 id="prolinga-data-subversion">
      <title>Subversion</title>

      <para>A Subversion tree containing the latest project sources is available at
      <ulink type="http" url="http://svn.prolinga.org">http://svn.prolinga.org</ulink>.
      For access please contact the <ulink type="http"
      url="http://lists.prolinga.org">ProLinga Development team</ulink>.</para>

    </sect1>

    <sect1 id="prolinga-data-bugzilla">
      <title>Bugzilla</title>

      <para>Bugzilla software development and bug tracking system to manage the ProLinga
      projects is available at
      <ulink type="http" url="http://bugzilla.prolinga.org">http://bugzilla.prolinga.org</ulink>.
      For access please contact the <ulink type="http"
      url="http://lists.prolinga.org">ProLinga Development team</ulink>.</para>

    </sect1>

    <sect1 id="prolinga-data-help_develop">
      <title>Help to Develop</title>

      <para>Are you ready to join the ProLinga development team? There are several ways you
      can help:</para>

      <itemizedlist>
         <listitem>
           <para>Use the product. Tell <ulink type="http"
           url="http://lists.prolinga.org">us</ulink> what you think, ideas, bugs etc.</para>
         </listitem>
         <listitem>
           <para>Fixing bugs. Visit the development section on the <ulink type="http"
           url="http://www.prolinga.org">ProLinga Web Site</ulink>,
           choose a
           bug, fix it and send <ulink type="http"
           url="http://lists.prolinga.org">us</ulink> the code changes.
           </para>
         </listitem>
         <listitem>
           <para>Enhancements. Have a look at the enhancement section of the
           <ulink type="http"
           url="prolinga-data-development.html#prolinga-data-todo">to-do list</ulink>
           and let <ulink type="http"
           url="http://lists.prolinga.org">us</ulink> know which new feature you
           want to help to develop.</para>
         </listitem>
         <listitem>
           <para>Porting. To be successful it is essential that the ProLinga Projects
           are available on a wide range of platforms. We need help in porting and
           testing as well as providing binary releases for many different platforms.
           Let <ulink type="http"
           url="http://lists.prolinga.org">us</ulink> know if and how you can help out.
           </para>
         </listitem>
         <listitem>
           <para>Real world examples. Are you using ProLinga products or do you know people
           who are happily using it. Tell <ulink type="http"
           url="http://lists.prolinga.org">us</ulink> the story and provide some screenshots.
           </para>
         </listitem>
      </itemizedlist>

    </sect1>

  </chapter>

  <part id="prolinga-data-API">
    <title>ProLinga-Data C++ API</title>

    <partintro>
      <para>This section contains the API reference for ProLinga-Data.  All
      the public interfaces are documented here.</para>
    </partintro>

    <!-- The API documentation -->
    &prolinga-data-API;

  </part>

  <part id="prolinga-data-userguide">
    <title>ProLinga-Data User Guide</title>

    <partintro>
      <para>This section contains the user guide for the ProLinga-Data. All
      the binaries are documented here.</para>
    </partintro>

    <!-- The API documentation -->
    &prolinga-data-userguide;

  </part>

  <!-- The document license -->
  &fdl;

</book>
