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

<!--
* 
*
*  ProLinga-Repository
*
*  Copyright (C) 2002-2010 Xobas Software.
*  All rights reserved.
*  
*  This file is part of ProLinga-Repository.
*
*  ProLinga-Repository 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-Repository 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-Repository.  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 "0.0.3" >
<!ENTITY release-date "April 11, 2010" >
<!ENTITY copyright-year "2010" >
<!ENTITY prolinga-repository-API  SYSTEM "prolinga-repository-API.xml" >
<!ENTITY prolinga-repository-userguide  SYSTEM "prolinga-repository-userguide.xml" >
<!ENTITY fdl  SYSTEM "fdl.xml" >
<!ENTITY PRODUCT "prolinga-repository" >
<!ENTITY xobas '<emphasis><ulink url="http://www.xobas.com">Xobas Software</ulink></emphasis>'>

]>

<book id="prolinga-repository" lang="en">
  <bookinfo>
    <title>ProLinga-Repository Project</title>
    <releaseinfo>Release: &PRODUCT;-&version; - &release-date;</releaseinfo>
    <authorgroup>
      <author>
	<firstname>Bas</firstname>
	<surname>Driessen</surname>
	<affiliation>
           <orgname>&xobas;</orgname>
	   <address><email>bas.driessen@prolinga.org</email></address>
	</affiliation>
        <contrib>Original author and current maintainer.</contrib>
      </author>
    </authorgroup>

    <copyright>
      <year>2002-&copyright-year;</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-Repository Project, how to
      build the software components and documents the API reference of the 
      prolinga-repository library.</para>
    </abstract>
  </bookinfo>

  <chapter id="prolinga-repository-product-info">
    <title>ProLinga-Repository Project</title>

    <para>The ProLinga-Repository Project forms the foundation of the ProLinga Development
    and Run-Time tools. A native XML database, built on <ulink type="http"
    url="http://www.oracle.com/technology/products/berkeley-db/index.html">Berkeley DB XML</ulink>,
    that holds ProLinga application definitions as XML documents which can be stored and
    managed using an API and send over the network using the ProLinga-Soap client library.
    Storing and managing
    of data is controlled by Repository Commands (RC) using the concept of request
    and response. An RC request is an XML document containing a command as a read or a
    write action. This request is presented to the repository engine for processing.
    After processing, the result will be placed in an RC response document and returned
    to the caller.</para>

    <para>ProLinga-Repository contains a binary that can run as a Web Service (daemon) on
    the machine. The sophisticated prolinga-soap
    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 repository centrally located in an 
    intranet environment or anywhere in the world via the internet. ProLinga-Repository
    is the perfect base for platform independent multi-developer environments.
    Since all code is written in C++, it can be ported to all modern UNIX systems,
    GNU/Linux variants as well as MS-Windows and Mac O/S platforms. ProLinga-Repository is
    extremely fast and very reliable. It can hold up to 256 Terabytes of information
    with a maximum of 4 Gigabyte for a single XML document. XPath 1.0 queries can 
    be executed for addressing parts of an XML document. Non-XML information can be 
    stored as well, as long as it is has an XML envelope.</para>

    <para>Main purpose for the creation of this project, is to provide an
    easy way to store XML application documents into a database.
    Although the current implementation is optimized for use in the ProLinga Environment,
    it can be used in other Non-ProLinga related projects as well. Some minor index changes
    may be needed. </para>

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

    <sect1 id="prolinga-repository-XML_documents">
      <title>XML Documents</title>

      <para>All data in the repository is stored as XML documents. These documents 
      are placed in a container in the database that represents one or a collection 
      of applications. Only 3 index fields are required for an XML document in the 
      ProLinga environment: </para>

      <orderedlist>
        <listitem><parameter>Application</parameter> - The name of the application.</listitem>
        <listitem><parameter>Type</parameter> - The type of the object. (Examples: Variable or Constant)</listitem>
        <listitem><parameter>Name</parameter> - The name of the object.</listitem>
      </orderedlist>

      <para>The combination of these 3 index fields has to be unique. Note that these 
      three index fields are based on requirements by the ProLinga Developer and Run-Time Tools. 
      Different indexes can be defined, but that requires some program changes. Future releases
      will be more flexible.</para>

      <para>The XML documents have the following format:</para>

<programlisting><![CDATA[
<Object Application="]]><parameter>appn</parameter><![CDATA[" Type="]]><parameter>type</parameter><![CDATA[" Name="]]><parameter>name</parameter><![CDATA[">
  <]]><parameter>type</parameter><![CDATA[>
    ....
    ....
  <]]><parameter>/type</parameter><![CDATA[>
</Object>
]]></programlisting>

      <para>Example:</para>

<programlisting><![CDATA[
<Object Application="MyOrder" Type="Constant" Name="Standard">
  <Constant>
     <Value>Standard</Value>
  </Constant>
</Object>
]]></programlisting>
    
      <para>In the example above, the "Type" is both an attribute as an element. Using 
      it this way has the advantage that a validation mechanism as XML schemas is much
      easier to implement.</para>

      <para>The type of object is not a pre-defined value. New object types can be 
      introduced all the time. No code changes are required for this, but if validation
      with XML Schemas is in place to check for valid object types, this XML schema
      need some modifications to allow for the new types. In the current release 
      there is no internal XML Schema validation implemented yet, but future releases
      will have this.</para>

    </sect1>

    <sect1 id="prolinga-repository-repository_commands">
      <title>Repository Commands</title>

      <para>Repository Commands are used to retrieve data from, write data to or delete
      data from the repository. A request XML document containing a command is presented
      to the repository. This document is processed and a response XML document is
      returned.</para>

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

<programlisting><![CDATA[
<ProLinga>
  <Repository Version="1.0">
    <Command Name="]]><parameter>command</parameter><![CDATA[" Mode="Request">
      <Object Application="]]><parameter>appn</parameter><![CDATA[" Type="]]><parameter>type</parameter><![CDATA[" Name="]]><parameter>name</parameter><![CDATA[">
         ....
         ....
      </Object>
    </Command>
  </Repository>
</ProLinga>
]]></programlisting>

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

      <sect2 id="prolinga-repository-rc_list">
        <title>List</title>

        <para>With the list command a list of object names can be retrieved, Wildcards 
        can be used for the object name. This command is typically used whereby the 
        user is given a selection of choices or for batch processing.</para>

        <para>Example List Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Repository Version="1.0">
    <Command Name="List" Mode="Request">
      <Object Application="MyOrder" Type="Constant" Name="Sta*"/>
    </Command>
  </Repository>
</ProLinga>
]]></programlisting>

        <para>Example List Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Repository Version="1.0">
    <Command Name="List" Mode="Response" Status="Ok">
      <Object Application="MyOrder" Type="Constant" Name="Standard"/>
      <Object Application="MyOrder" Type="Constant" Name="State"/>
      <Object Application="MyOrder" Type="Constant" Name="Static"/>
    </Command>
  </Repository>
</ProLinga>
]]></programlisting>


        <para>List on Application or Type is not implemented as such. To achieve 
        this you can introduce an object type "Application" and "Type" for instance.</para>

      </sect2>

      <sect2 id="prolinga-repository-rc_get">
        <title>Get</title>

        <para>With the list command an XML document can be retrieved from the
        repository.</para>

        <para>Example Get Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Repository Version="1.0">
    <Command Name="Get" Mode="Request">
      <Object Application="MyOrder" Type="Constant" Name="Standard"/>
    </Command>
  </Repository>
</ProLinga>
]]></programlisting>

        <para>Example Get Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Repository Version="1.0">
    <Command Name="Get" Mode="Response" Status="Ok">
      <Object Application="MyOrder" Type="Constant" Name="Standard">
        <Constant>
          <Value>Standard</Value>
        </Constant>
      </Object>
    </Command>
  </Repository>
</ProLinga>
]]></programlisting>

        <para>Wildcards can be used for "Name" to retrieve a series
        of XML documents with one single RC.</para>

      </sect2>

      <sect2 id="prolinga-repository-rc_put">
        <title>Put</title>

        <para>With the put command an XML document can be written to the 
        repository. The whole document needs to be presented, as no partial 
        updates are possible.</para>

        <para>Example Put Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Repository Version="1.0">
    <Command Name="Put" Mode="Request">
      <Object Application="MyOrder" Type="Constant" Name="Standard">
        <Constant>
          <Value>Standard</Value>
        </Constant>
      </Object>
    </Command>
  </Repository>
</ProLinga>
]]></programlisting>

        <para>Example Put Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Repository Version="1.0">
    <Command Name="Put" Mode="Response" Status="Ok"/>
      <Object Application="MyOrder" Type="Constant" Name="Standard"/>
    </Command>
  </Repository>
</ProLinga>
]]></programlisting>
<para/>

      </sect2>

      <sect2 id="prolinga-repository-rc_delete">
        <title>Delete</title>

        <para>With the list command an XML document can be removed from the 
        repository.</para>

        <para>Example Delete Request:</para>

<programlisting><![CDATA[
<ProLinga>
  <Repository Version="1.0">
    <Command Name="Delete" Mode="Request">
      <Object Application="MyOrder" Type="Constant" Name="Standard"/>
    </Command>
  </Repository>
</ProLinga>
]]></programlisting>

        <para>Example Delete Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Repository Version="1.0">
    <Command Name="Delete" Mode="Response" Status="Ok">
      <Object Application="MyOrder" Type="Constant" Name="Standard"/>
    </Command>
  </Repository>
</ProLinga>
]]></programlisting>
<para/>

      </sect2>

      <sect2 id="prolinga-repository-rc_sysinfo">
        <title>SysInfo</title>

        <para>The SysInfo command can be used to retrieve system and enviroment
        details from the server where ProLinga-Repository is running.</para>

        <para>Example SysInfo Request:</para>

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

        <para>Example SysInfo Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Repository Version="1.0">
    <Command Name="SysInfo" Mode="Response" Status="Ok">
      <ServiceId>Live Server Stock Admininstration</ServiceId>
      <ServerHost>M1</ServerHost>
      <ServerPort>8001</ServerPort>
      <SystemPath>/home/prolinga/prolinga/system</SystemPath>
      <NumberOfThreads>3</NumberOfThreads>
      <LogFile>/tmp/prolingarep.log</LogFile>
      <LogLevel>5</LogLevel>
      <ServerCompressionLevel>6</ServerCompressionLevel>
      <SystemHostName>M1</SystemHostName>
    </Command>
  </Repository>
</ProLinga>
]]></programlisting>
<para/>

      </sect2>

      <sect2 id="prolinga-repository-rc_ping">
        <title>Ping</title>

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

        <para>Example Ping Request:</para>

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

        <para>Example Ping Response:</para>

<programlisting><![CDATA[
<ProLinga>
  <Repository 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-repository-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 retieve a non-existent document:
      </para>

<programlisting><![CDATA[
<ProLinga>
  <Repository Version="1.0">
    <Command Name="Get" Mode="Response" Status="Warning">
      <Object Application="MyOrder" Type="Constant" Name="Standard">
        <Error Id="10006">
          <Severity>Warning</Severity>
          <Description>Document not found</Description>
          <ExternalDescription/>
        </Error>
      </Object>
    </Command>
  </Repository>
</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 initial 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>10000</entry>
              <entry>Ok</entry>
              <entry>No Error</entry>
            </row>
            <row>
              <entry>10001</entry>
              <entry>Error</entry>
              <entry>Error parsing document</entry>
            </row>
            <row>
              <entry>10002</entry>
              <entry>Error</entry>
              <entry>Empty Document</entry>
            </row>
            <row>
              <entry>10003</entry>
              <entry>Error</entry>
              <entry>Invalid root element</entry>
            </row>
            <row>
              <entry>10004</entry>
              <entry>Error</entry>
              <entry>Invalid repository XML file</entry>
            </row>
            <row>
              <entry>10005</entry>
              <entry>Warning</entry>
              <entry>No document match</entry>
            </row>
            <row>
              <entry>10006</entry>
              <entry>Warning</entry>
              <entry>Document not found</entry>
            </row>
            <row>
              <entry>10007</entry>
              <entry>Warning</entry>
              <entry>Document already deleted</entry>
            </row>
            <row>
              <entry>10008</entry>
              <entry>Error</entry>
              <entry>Can not parse return string</entry>
            </row>
          </tbody>
        </tgroup>
        </table>

    </sect1>

    <sect1 id="prolinga-repository-multiple_rcs">
      <title>Multiple Repository Commands</title>

      <para>It is possible to combine RCs 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>
  <Repository Version=”1.0”>
    <Command Name="]]><parameter>command</parameter><![CDATA[" Mode="Request">
      <Object Application="]]><parameter>appn</parameter><![CDATA[" Type="]]><parameter>type</parameter><![CDATA[" Name="]]><parameter>name</parameter><![CDATA[">
        ...
        ...
      </Object>
      <Object Application="]]><parameter>appn</parameter><![CDATA[" Type="]]><parameter>type</parameter><![CDATA[" Name="]]><parameter>name</parameter><![CDATA[">
        ...
        ...
      </Object>
    </Command>
  </Repository>
</ProLinga>
]]></programlisting>

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

    </sect1>
  </chapter>

  <chapter id="prolinga-repository-programming_notes">
    <title>ProLinga-Repository Programming Notes</title>

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

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

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

      <para>To be able to send and receive Repository 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 Repository Command. Alternatively
      have a look at the source code file <parameter>RepositoryClient.cpp
      </parameter> in the <parameter>src</parameter> directory of 
      ProLinga-Repository.</para>

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

    </sect1>

    <sect1 id="prolinga-repository-repository_library">
      <title>Repository Library</title>

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

      <para>A very basic example program using the Repository Library, so
      it can access the Repository looks like this:</para>

<programlisting><![CDATA[
#include <prolinga/Repository.hpp>

int main()
{
        /*Init */
        xmlDocPtr docReq, docRes;
        xmlNodePtr curReq, curRes;
        xmlBufferPtr bufRes;
        PlRepository rep;

        /* Open Repository Environment */
        rep.repositoryOpen("./prolingarepcfg.xml");

        /* Create Repository 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 *)"Repository", (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 *)"SysInfo");
        xmlNewProp (curReq, (const xmlChar *)"Mode", (const xmlChar *)"Request");

        /* Process Repository Command */
        docRes = rep.executeCommand(docReq);

        /* Print Response */
        bufRes = xmlBufferCreate();
        curRes = xmlDocGetRootElement(docRes);
        xmlNodeDump(bufRes, docRes, curRes, 0, 1);
        printf("%s\n", (char *)xmlBufferContent(bufRes));

        /* Close Repository Environment */
        rep.repositoryClose();

        /* Free */
        xmlBufferFree(bufRes);
        xmlFreeDoc(docRes);
        xmlFreeDoc(docReq);

        /* Return */
        return 0;
}
]]></programlisting>

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

      <para>After creating a connection using the openRepository class function, more
      than one RC can be executed without the need to close and open the Repository
      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 Repository code will
      be changed as the project progresses.</note>

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

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

      <para>ProLinga-Repository 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-repository-build_instructions.html#prolinga-repository-dependencies">
      dependencies</ulink> and <ulink type="http"
      url="prolinga-repository-build.html#prolinga-repository-prerequisites">
      prerequisites</ulink> section for more details.</para>
    </sect1>

  </chapter>

  <chapter id="prolinga-repository-download">
    <title>Download ProLinga-Repository</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-repository-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-repository-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-repository-subversion.html">Subversion section</ulink>
      of how to obtain the latest development version.</para>

    </sect1>

  </chapter>

  <chapter id="prolinga-repository-build">
    <title>Build ProLinga-Repository</title>

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

      <para>ProLinga-Repository &version; has been built and tested
      on Fedora Core, Mandriva Linux, Debian, 
      Ubuntu, openSUSE. The product 
      should compile and run successfully on
      other GNU/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://www.oracle.com/technology/products/berkeley-db/index.html"><parameter>Berkeley DBXML.</parameter></ulink>
          This product provides a native XML database.</para>
        </listitem>
        <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.prolinga.org"><parameter>ProLinga-Soap</parameter></ulink>
          This product provides a SOAP/XML engine.</para>
        </listitem>
      </itemizedlist>

      <para>Optional 3rd party package(s):</para>
      <itemizedlist>
        <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-repository-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-repository-3rd_party_bdbxml">
        <title>Berkeley DBXML:</title>

        <para>To be able to build Berkeley DBXML, several other products need to be 
        installed as well. These are:</para>

        <itemizedlist>
          <listitem>
            <para><ulink type="http"
            url="http://www.oracle.com/technology/products/berkeley-db/index.html"><parameter>Berkeley DB.</parameter></ulink>
            This product provides a general purpose database.</para>
          </listitem>
          <listitem>
            <para><ulink type="http"
            url="http://xml.apache.org/xerces-c/index.html"><parameter>Xerces.</parameter></ulink>
            This product provides XML libraries.</para>
          </listitem>
          <listitem>
            <para>
            <parameter>XQilla.</parameter>
            XQilla is an implementation of XQuery 1.0 and XPath 2.0 using Xerces DOM.
            Berkeley DB XML requires a version of XQilla that is not publicly available 
            and is distributed with Berkeley DB XML.
            </para>
          </listitem>
        </itemizedlist>

        <para>It is recommended to first download all products before installing them because
        of dependencies.</para>

        <blockquote>

          <sect3 id="prolinga-repository-3rd_party_bdb">
            <title>Berkeley DB:</title>

            <para>Product root dir: /opt/builds/db</para>
            <para>Current version: 4.8.26</para>
            <para>Download:
            <ulink type="http"
            url="http://download.oracle.com/berkeley-db/db-4.8.26.tar.gz">
            http://download.oracle.com/berkeley-db/db-4.8.26.tar.gz</ulink></para>
            <para>Build Instructions:</para>

<programlisting>
cd /opt/builds/db/db-4.8.26
../dist/configure --enable-cxx 
make
make install
</programlisting>

            <note>The --enable-cxx option is required.</note>

          </sect3>

          <sect3 id="prolinga-repository-3rd_party_xerces-c">
            <title>Xerces-c:</title>

            <para>Product root dir: /opt/builds/xerces</para>
            <para>Current version: 2.7.0</para>
            <para>Download:
            <ulink type="http"
            url="http://www.apache.org/dist/xml/xerces-c/source/xerces-c-src_2_7_0.tar.gz">
            http://www.apache.org/dist/xml/xerces-c/source/xerces-c-src_2_7_0.tar.gz</ulink></para>
            <para>Build Instructions:</para>

<programlisting>
cd /opt/builds/xerces/xerces-c-src_2_7_0
export XERCESCROOT=`pwd`
cd src/xercesc
./runConfigure -P $XERCESCROOT -plinux -cgcc -xg++ -minmem -nsocket -tnative -rnone [-b64]
make
make install
</programlisting>

          </sect3>

          <sect3 id="prolinga-repository-3rd_party_xqilla">
            <title>XQilla:</title>

            <para>Product root dir: /opt/builds/xqilla</para>
            <para>Current version: 2.2.3 (customized release shipped with dbxml 2.5.16) </para>
            <para>Download: Ships with Berkeley DBXML 2.5.16.</para>
            <para>Build Instructions:</para>

<programlisting>
cd /opt/builds/xqilla/xqilla-2.2.3
mkdir build
cd build
../configure --with-xerces=/opt/builds/xerces/xerces-c-src_2_7_0 
make
make install
</programlisting>

          </sect3>

        </blockquote>


        <para>Product root dir: /opt/builds/dbxml</para>
        <para>Current version: 2.5.16</para>
        <para>Download:
        <ulink type="http"
        url="http://download.oracle.com/berkeley-db/dbxml-2.5.16.tar.gz">
        http://download.oracle.com/berkeley-db/dbxml-2.5.16.tar.gz</ulink></para>
        <para>Build Instructions:</para>

<programlisting>
cd /opt/builds/dbxml/dbxml-2.5.16/build_unix
../dist/configure
make
make install
</programlisting>

        <note>See file docs/ref/xml_unix/intro.html which ships with dbxml for more
        installation information.</note>

        <note>Check for and apply latest dbxml patches.</note>
        <para/>

      </sect2>

      <sect2 id="prolinga-repository-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 
make
make install
</programlisting>

      </sect2>

      <sect2 id="prolinga-repository-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-repository-build_instructions">
      <title>Build Instructions</title>

      <sect2 id="prolinga-repository-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-repository-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-repository-dependencies">
        <title>Dependencies</title>

        <para>Many of the ProLinga-Projects are dependent on 3rd party libraries.
        These (non system) dependencies of ProLinga-Repository 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>Berkeley DB</entry>
              <entry>>=4.8.26</entry>
              <entry>--with-berkeleydb-prefix=<parameter>/path/to/berkeleydb</parameter></entry>
            </row>
            <row>
              <entry>Berkeley DBXML</entry>
              <entry>>=2.5.16</entry>
              <entry>--with-berkeleydbxml-prefix=<parameter>/path/to/berkeleydbxml</parameter></entry>
            </row>
            <row>
              <entry>XQilla</entry>
              <entry>>=2.2.3</entry>
              <entry>--with-xqilla-prefix=<parameter>/path/to/xqilla</parameter></entry>
            </row>
            <row>
              <entry>Xerces</entry>
              <entry>>=2.7.0</entry>
              <entry>--with-xerces-prefix=<parameter>/path/to/xerces</parameter></entry>
            </row>
            <row>
              <entry>libxml2</entry>
              <entry>>=2.6.5</entry>
              <entry>--with-libxml-prefix=<parameter>/path/to/libxml2</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-repository-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-repository-development">
    <title>Further development of ProLinga-Repository</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-repository-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-Repository 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>Libxml2 is used in ProLinga-Repository as the Xml Parser. Libxml2 is a 
           high level parser used in the Gnome projects.  DbXml (xml database) however
           is using Xerces. There may be performance improvements possible if Libxml2
           is replaced by Xerces. XML documents returned from the database for instance
           can be passed on directly, rather then being parsed again by Libxml2.</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>Utilities. <parameter>prolingarepcreate</parameter> at the moment can only 
           be used to initialize 
           the Repository. We should have options available as creating application 
           dump, reading application dump etc.</para>
         </listitem>
         <listitem>
           <para>Code review and cleanup.</para>
         </listitem>
         <listitem>
           <para>Logging. A simple logging mechanism has been implemented. However, it 
           appears that DbXml has a logging system of its own. This should be investigated 
           and implemented (if useful).</para>
         </listitem>
         <listitem>
           <para>Self-tests need to be developed for quality control.</para>
         </listitem>
         <listitem>
           <para>Porting to other platforms. (MS-Windows/Solaris?), so we can make a distribution
            available on a specific port if we need to.</para>
         </listitem>
         <listitem>
           <para>Locking. At the moment, records are not being locked when updated. This 
           mechanism is available, as well as technologies as Transactions and rollback. 
           Need to be looked into.</para>
         </listitem>
         <listitem>
           <para>As enhancements, we should look into making ProLinga-Repository a more 
           useful product by itself. This means not the hardcoded indexes Application,
           Type and Name as we have now. It is all we need for the ProLinga Development
           tools, but there maybe more benefits in this product by itself. At the
           moment it is "just" an Application Repository.</para>
         </listitem>
       </itemizedlist>

    </sect1>

    <sect1 id="prolinga-repository-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-repository-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-repository-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 of 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-repository-development.html#prolinga-repository-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-repository-API">
    <title>ProLinga-Repository C++ API</title>

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

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

  </part>

  <part id="prolinga-repository-userguide">
    <title>ProLinga-Repository User Guide</title>

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

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

  </part>

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

</book>
