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

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

]>

<book id="prolinga-run" lang="en">
  <bookinfo>
    <title>ProLinga-Run 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@xobas.com</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-Run Project, how to
      build the software components and documents the API reference of the 
      prolinga-run library.</para>
    </abstract>
  </bookinfo>

  <chapter id="prolinga-run-product-info">
    <title>ProLinga-Run Project</title>

    <para>ProLinga-Run is a 4GL run-time engine. It is a interpreter that processes XML 
    documents generated from 4GL logic statements by ProLinga-Validate. 4GL statements 
    include bindings to the popular GTK+ User Interface for the GNU/Linux (GNOME) 
    desktop.</para>

    <para>ProLinga-Run communticates with other components in the ProLinga Network using
    request/response SOAP calls over a TCP/IP network. These other components include
    the application repository (prolingarepd) and user data (prolingadatd). Using this 
    concept, programs appear to run locally on a machine, but in fact they can access 
    a wide range of machines (= Web Services), centrally located in an intranet 
    environment or anywhere in the world via the internet, to share the load and 
    execute the application.</para>

    <para>ProLinga-Run has been built and tested on various popular GNU/Linux platforms as RedHat Fedora,
    Mandriva Linux, Debian,
    openSUSE, Ubuntu and MS-Windows (Cygwin), but 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. 
    Since GTK+ has been ported to many UNIX and MS-Windows platforms, future 
    releases of ProLinga-Run will include such ports as well.</para>

    <para>Currently there are two flavours of ProLinga-Run.</para>

    <orderedlist>
      <listitem><para>The Desktop/Client binary (prolingarun) that runs on a user desktop 
        machine. This binary is called from the start script prolinga.</para>
      </listitem>
      <listitem><para>The Web Service binary (prolingarund) that runs as a daemon and is 
        used by the ProLinga-Web component.</para>
      </listitem>
    </orderedlist>

    <para>In both cases, they contain the 4GL interpreter, while the desktop version 
    also contains bindings to the GTK+ user interface. With the run-time environment
    I also refer to the user 4GL development environment, since it runs in the 
    run-time environment being a development tool itself.</para>

    <sect1 id="prolinga-run-interpreter">
      <title>Interpreter</title>

      <para>The 4GL engine processes statements that have been generated from 4GL 
      logic by the generator. 4GL statements typed in by a developer user may look 
      like this for instance:</para>

<programlisting>
SCREEN TITLE "Variable - untitled"
MESSAGE "Created new variable."
CLEAR RECORD Variable.Variable
LET F-EditCode.Variable P-EditCode(1)
DISPLAY ALL
</programlisting>

    <para>To be able to process these statements we need to put them in a format 
    that can be processed in an efficient way by the interpreter. When this logic 
    is saved in the 4GL development tool, an XML document will be generated by 
    the Validate Web Service that looks like this:</para>

<programlisting><![CDATA[
<?xml version="1.0"?>
<ProLinga>
  <Runner version="1.0">
    <Statements>
      <Statement SequenceNo="1" NextTrue="2" NextFalse="2" Command="2">
        <Arguments>
          <Argument>TITLE</Argument>
          <Argument>"Variable -  untitled"</Argument>
        </Arguments>
      </Statement>
      <Statement SequenceNo="2" NextTrue="3" NextFalse="3" Command="3">
        <Arguments>
          <Argument>"Created new variable."</Argument>
        </Arguments>
      </Statement>
      <Statement SequenceNo="3" NextTrue="4" NextFalse="4" Command="4">
        <Arguments>
          <Argument>RECORD</Argument>
          <Argument>Variable.Variable</Argument>
        </Arguments>
      </Statement>
      <Statement SequenceNo="4" NextTrue="5" NextFalse="5" Command="5">
        <Arguments>
          <Argument>F-EditCode.Variable</Argument>
          <Argument>P-EditCode(1)</Argument>
        </Arguments>
      </Statement>
      <Statement SequenceNo="5" NextTrue="0" NextFalse="0" Command="8">
        <Arguments>
          <Argument>ALL</Argument>
        </Arguments>
      </Statement>
    </Statements>
  </Runner>
</ProLinga>
]]></programlisting>

      <para>Besides the statements and arguments, this document also contains 
      control information as where to go after processing a statement. This 
      is important when using statements like IF/THEN/ELSE or FOREVER loops. 
      All data references also have been validated for their existence. While 
      for the developer user it seems that the interpreter is a 4GL 
      interpreter, in fact it is an XML interpreter. Using this format also 
      opens the door for features as code generation and scripting. Since the 
      XML parser used from libxml2 is as so called DOM parser, this model will 
      work best with logic blocks of limited size. Benchmark test should tell 
      us, but initial testing suggests a maximum of 500 lines per logic block 
      must be set. For a 4GL this is a very reasonable limitation.</para>

    </sect1>

    <sect1 id="prolinga-run-user_interface">
      <title>User Interface</title>

      <para>For the User Interface in the desktop/client binary, the products 
      GTK+, Glade and Libglade are used. Glade is a GUI builder built on top 
      of the GTK+ widget set for the GNOME project. In the ProLinga Development 
      Tool <parameter>Developer</parameter>, Glade will be called when (new) 
      screens are to be painted. The screen will be stored in an XML format
      when saved in Glade. These Glade XML files will be stored in the 
      remote repository. Libglade is a library that at run-time will generate 
      the User Interface from the Glade XML documents. To be able to manage 
      the Glade XML documents in the ProLinga Environment, an extra header is 
      added (enveloppe) to the file.</para>

      <para>Below follows an example of a Glade file. Please note the 
      Repository Command header "Get", which retrieves this document from 
      the repository.</para>

<programlisting><![CDATA[
<ProLinga>
  <Repository Version="1.0">
    <Command Name="Get" Mode="Response" Status="Ok">
      <Object Application="stock" Type="Screen" Name="Parts">
        <Screen>
          <DisplayData>
            <glade-interface>
              <widget class="GtkWindow" id="Parts">
                <property name="visible">True</property>
                <property name="title" translatable="yes">Parts</property>
                <property name="type">GTK_WINDOW_TOPLEVEL</property>
                <property name="window_position">GTK_WIN_POS_NONE</property>
                <property name="modal">False</property>
                <property name="resizable">True</property>
                <property name="destroy_with_parent">False</property>
                <property name="decorated">True</property>
                <property name="skip_taskbar_hint">False</property>
                <property name="skip_pager_hint">False</property>
                <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
                <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
                <child>
                  <widget class="GtkScrolledWindow" id="parts_include">
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
                    <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
                    <property name="shadow_type">GTK_SHADOW_NONE</property>
                    <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
                    <child>
                      . . . .
                      . . . .
                      . . . .
                      . . . .
                    </child>
                  </widget>
                </child>
              </widget>
            </glade-interface>
          </DisplayData>
          <AllowMultipleInstances>False</AllowMultipleInstances>
          <Description/>
          <DetailDescription/>
          <Modified/>
        </Screen>
      </Object>
    </Command>
  </Repository>
</ProLinga>
]]></programlisting>

     <para>The full document contains 406 lines. Advanced compression techniques
     in the SOAP engine insures very efficient processing over the network. 
     The use of Libxml is widely accepted in the open source community and is 
     already very stable proven technology. When this document is processed at 
     run time by Libglade, the following screen will be visible on the desktop:
     </para>

     <mediaobject>
       <imageobject>
         <imagedata fileref="images/stock.png"/>
       </imageobject>
       <textobject>
         <phrase>screenshot stock application</phrase>
       </textobject>
     </mediaobject>

     <para>The contents (data) of the various fields in this screen will be 
     placed in this screen after processing by Libglade.</para>

    </sect1>

    <sect1 id="prolinga-run-web_commands">
      <title>Web Commands</title>

      <para>To interact with the 4GL interpreter without the need for a User 
      Interface, Web Commands (WC) can be used to process 4GL logic. ProLinga-Web 
      for instance generates WCs from URLs and sends/receives WC documents 
      to/from the ProLinga-Run Web Service. For details on the format of these 
      Web Commands, please have a look at the documentation of ProLinga-Web.
      </para>

      <para>At this stage only one Web Command has been implemented in ProLinga-Run 
      and that is the command RunLogic. This command will run a 4GL logic 
      block and returns a response after processing has been finished. Future 
      Web Commands can be commands like RunBackground for instance to start a 
      process as a background process (batch processing).</para>

    </sect1>
  </chapter>

  <chapter id="prolinga-run-programming_notes">
    <title>ProLinga-Run Programming Notes</title>

    <para>To test ProLinga-Run, the best and easiest way is to
    use the binaries that come with the product. A correctly
    configured ProLinga Network is required. Run <parameter>
    bin/prolinga</parameter> to start the desktop client. To
    test browser access, configure so ProLinga-Run is running
    as a Web Service, the ProLinga-Web CGI application is in place
    and a Web Browser is available. Please read the documentation
    of ProLinga-Web for details how to set up Web Access.</para>

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

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

      <para>To be able to send and receive Web Commands over 
      the network as SOAP calls from
      a C++ application to access the ProLinga-Run environment, 
      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 shown there you have to change the example
      XML request document with a valid Web Command. Alternatively
      have a look at the source code file <parameter>WebCgi.cpp</parameter>
      and <parameter>WCWebCommand.cpp</parameter> in the <parameter>src
      </parameter> directory of ProLinga-Web.
      </para>

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

    </sect1>

    <sect1 id="prolinga-run-run_library">
      <title>Run Library</title>

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

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

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

int main(int argc, char *argv[])
{
        /*Init */
        xmlDocPtr docReq, docRes;
        xmlNodePtr curReq, curRes;
        xmlBufferPtr bufRes;
        PlRun run;

        /* Open Run Environment */
        run.runOpen("./prolingaruncfg.xml", argc, argv);

        /* Create Web 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 *)"Web", (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 *)"RunLogic");
        xmlNewProp (curReq, (const xmlChar *)"Mode", (const xmlChar *)"Request");
        xmlNewProp (curReq, (const xmlChar *)"SessionId", (const xmlChar *)"None");
        xmlNewProp (curReq, (const xmlChar *)"Format", (const xmlChar *)"HTML");
        curReq = xmlNewTextChild (curReq, NULL, (const xmlChar *)"Object", (const xmlChar *)"");
        xmlNewProp (curReq, (const xmlChar *)"Service", (const xmlChar *)"Runner");
        xmlNewProp (curReq, (const xmlChar *)"Application", (const xmlChar *)"stock");
        xmlNewProp (curReq, (const xmlChar *)"Name", (const xmlChar *)"WPartLst");
        curReq = xmlNewTextChild (curReq, NULL, (const xmlChar *)"Parameters", (const xmlChar *)"");
        curReq = xmlNewTextChild (curReq, NULL, (const xmlChar *)"Parameter", (const xmlChar *)"ALL");
        xmlNewProp (curReq, (const xmlChar *)"Name", (const xmlChar *)"group_id");

        /* Process Web Command */
        docRes = run.executeCommand(docReq);

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

        /* Close Run Environment */
        run.runClose();

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

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

      <para>When opening this connection an argument with the path
      and name of the run configuration file can be passed as
      an argument. The system then knows details as in where
      it can connect to to find the Repository etc. The configuration file has
      to be in a certain format, which is explained further on. The Web
      Command is then presented to the Run process engine.
      Within this Run environment, the <parameter>RunLogic
      </parameter> command is called. Arguments are the service
      name that represents a hostname and portnumber, the name of the 
      application to access and the name of the logic to execute. Additional
      parameters are parameters dependent on what the logic needs to be 
      able to execute. After executing a response is returned. This response is 
      printed to to stdout (screen). The connection
      to the Run environment is closed, so data get flushed etc. and the 
      program exits.</para>

      <para>After creating a connection using the openRun class function, more
      than one WC can be executed without the need to close and open the Run
      environment
      for every call. In fact performance wise this is the preferred 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 Run code will
      be changed as the project progresses.</note>
      <para/>

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

      <para>You may need to set the environment variable PKG_CONFIG_PATH to 
      point to the directories where prolinga-run.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-Run 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-run-build_instructions.html#prolinga-run-dependencies">
      dependencies</ulink> and <ulink type="http"
      url="prolinga-run-build.html#prolinga-run-prerequisites">
      prerequisites</ulink> section for more details.</para>
    </sect1>

  </chapter>

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

    </sect1>

  </chapter>

  <chapter id="prolinga-run-build">
    <title>Build ProLinga-Run</title>

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

      <para>ProLinga-Run &version; has been built and tested
      on RedHat Fedora, Mandriva Linux, Debian,
      openSUSE, Ubuntu and MS-Windows (Cygwin). 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://xmlsoft.org"><parameter>libxml2.</parameter></ulink>
          This product provides XML libraries.</para>
        </listitem>
        <listitem>
          <para><ulink type="http"
          url="http://xmlsoft.org/XSLT"><parameter>libxslt.</parameter></ulink>
          This product provides XSLT transformations.</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>
        <listitem>
          <para><ulink type="http"
          url="http://www.prolinga.org"><parameter>ProLinga-Calc</parameter></ulink>
          This product provides a C expression calculator.</para>
        </listitem>
        <listitem>
          <para><ulink type="http"
          url="http://www.daa.com.au/~james/software/libglade/"><parameter>Libglade</parameter></ulink>
          This product loads XML files to create the user interface dynamically.</para>
        </listitem>
        <listitem>
          <para><ulink type="http"
          url="http://gtk.org"><parameter>GTK+ (GLib, GTK+, Pango, ATK)</parameter></ulink>
          This project provides a complete set of widgets</para>
        </listitem>
      </itemizedlist>

      <note>If ProLinga-Run is to be linked with other ProLinga libraries like Repository
      to create a stand-alone project, these libraries need to be available as well.
      </note> 

      <para/>

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

      </sect2>

      <sect2 id="prolinga-run-3rd_party_libxslt">
        <title>Libxslt:</title>
        <para>Product root dir: /opt/builds/libxslt</para>
        <para>Current version: 1.1.22</para>
        <para>Download:
        <ulink type="http"
        url="ftp://xmlsoft.org/libxslt/libxslt-1.1.22.tar.gz">
        ftp://xmlsoft.org/libxslt/libxslt-1.1.22.tar.gz</ulink></para>
        <para>Build Instructions:</para>
                                                                                                                                             
<programlisting>
cd /opt/builds/libxslt/libxslt-1.1.22
./configure --prefix=/opt/builds/libxslt/libxslt-1.1.22
make
make install
</programlisting>

        <note>/opt/builds/libxml2/libxml2-2.6.30/lib/pkgconfig should be in your
        PKG_CONFIG_PATH if you want to link against the libxml2 built following
        the previous libxml2 installation instructions.</note>
        <para/>                                                                                                                                     
      </sect2>

      <sect2 id="prolinga-run-3rd_party_prolingasoap">
        <title>ProLinga-Soap:</title>
        <para>Product root dir: /opt/builds/prolinga</para>
        <para>Current version: 0.0.2</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.2
./configure --prefix=/opt/builds/prolinga/prolinga-soap-0.0.2
make
make install
</programlisting>

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

      </sect2>

      <sect2 id="prolinga-run-3rd_party_prolingacalc">
        <title>ProLinga-Calc:</title>
        <para>Product root dir: /opt/builds/prolinga</para>
        <para>Current version: 0.0.2</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-calc-0.0.2
./configure --prefix=/opt/builds/prolinga/prolinga-calc-0.0.2
make
make install
</programlisting>

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

      </sect2>

      <sect2 id="prolinga-ui-3rd_party_libglade">
        <title>Libglade:</title>
        <para>Product root dir: /opt/builds/libglade</para>
        <para>Current version: 2.6.0</para>
        <para>Download:
        <ulink type="http"
        url="ftp://ftp.gnome.org/pub/GNOME/sources/libglade/2.6/libglade-2.6.0.tar.gz">
        ftp://ftp.gnome.org/pub/GNOME/sources/libglade/2.6/libglade-2.6.0.tar.gz</ulink></para>
        <para>Build Instructions:</para>
                                                                                                                                             
<programlisting>
cd /opt/builds/libglade/libglade-2.6.0
./configure --prefix=/opt/builds/libglade/libglade-2.6.0
make
make install
</programlisting>
                                                                                                                                             
      </sect2>
                                                                                                                                             
      <sect2 id="prolinga-ui-3rd_party_gtk">
        <title>GTK+:</title>
        <para>Use the GTK+ version that ships with the O/S. Version 2.6.0 or higher required.</para>
                                                                                                                                             
      </sect2>

    </sect1>

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

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

        <para>Many of the ProLinga Projects are dependent on 3rd party libraries.
        These (non system) dependencies of ProLinga-Run 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.31</entry>
              <entry>--with-libxml-prefix=<parameter>/path/to/libxml2</parameter></entry>
            </row>
            <row>
              <entry>libxslt</entry>
              <entry>>=1.1.22</entry>
              <entry>--with-libxml-prefix=<parameter>/path/to/libxslt</parameter></entry>
            </row>
            <row>
              <entry>ProLinga-Soap</entry>
              <entry>>=0.0.2</entry>
              <entry>--with-prolingasoap-prefix=<parameter>/path/to/prolingasoap</parameter></entry>
            </row>
            <row>
              <entry>ProLinga-Calc</entry>
              <entry>>=0.0.2</entry>
              <entry>--with-prolingacalc-prefix=<parameter>/path/to/prolingacalc</parameter></entry>
            </row>
            <row>
              <entry>Libglade</entry>
              <entry>>=2.6.0</entry>
              <entry>--with-libglade-prefix=<parameter>/path/to/libglade</parameter></entry>
            </row>
            <row>
              <entry>GTK+</entry>
              <entry>>=2.6.0</entry>
              <entry>--with-gtk-prefix=<parameter>/path/to/gtk</parameter></entry>
            </row>
          </tbody>
        </tgroup>
        </table>
        <para></para>

        <table frame="all" tocentry="1" >
        <title>Optional Dependencies</title>
        <tgroup cols="3">
          <thead>
            <row>
              <entry>Dependency</entry>
              <entry>Version</entry>
              <entry>Configure Option</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>ProLinga-Data</entry>
              <entry>>=0.0.2</entry>
              <entry>--with-prolingadata-prefix=<parameter>/path/to/prolingadata</parameter></entry>
            </row>
            <row>
              <entry>ProLinga-Repository</entry>
              <entry>>=0.0.2</entry>
              <entry>--with-prolingarepository-prefix=<parameter>/path/to/prolingarepository</parameter></entry>
            </row>
            <row>
              <entry>ProLinga-Validate</entry>
              <entry>>=0.0.2</entry>
              <entry>--with-prolingavalidate-prefix=<parameter>/path/to/prolingavalidate</parameter></entry>
            </row>
          </tbody>
        </tgroup>
        </table>

      </sect2>

      <sect2 id="prolinga-run-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-run-development">
    <title>Further development of ProLinga-Run</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-run-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>The 4GL-interpreter should be split from the user interface.
           A new project <parameter>ProLinga-UI</parameter> is introduced to 
           realize this.
           </para>
         </listitem>
         <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-Run 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>Utilities.</para>
         </listitem>
         <listitem>
           <para>Code review and cleanup.</para>
         </listitem>
         <listitem>
           <para>Logging.</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>
       </itemizedlist>

    </sect1>

    <sect1 id="prolinga-run-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-run-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-run-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-run-development.html#prolinga-run-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.
           Please 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? Please 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-run-API">
    <title>ProLinga-Run C++ API</title>

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

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

  </part>

  <part id="prolinga-run-userguide">
    <title>ProLinga-Run User Guide</title>

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

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

  </part>

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

</book>
