<!--
* 
*
*  ProLinga-Repository
*
*  Copyright (C) 2002-2008 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
*
*
-->

<refentry id="prolinga-repository-repository">
  <refmeta>
    <refentrytitle>Repository</refentrytitle>
    <manvolnum>3</manvolnum>
  <refmiscinfo>ProLinga-Repository Library</refmiscinfo>
</refmeta>

<refnamediv>
  <refname>Repository</refname>
  <refpurpose>Class used to manage Repository connections and process Repository Commands.</refpurpose>
</refnamediv>

<refsynopsisdiv>
  <title>Synopsis</title>

  <synopsis>
#include &lt;prolinga/Repository.hpp&gt;

class <anchor id="class_PlRepository"/>PlRepository
{
        public:
                <link linkend="PlRepository">PlRepository</link>();
                ~<link linkend="PlRepository">PlRepository</link>();
                <link linkend="void">void</link>         <link linkend="PlRepository__repositoryOpen">repositoryOpen</link>           (const <link linkend="char">char</link> *configFileName);
                <link linkend="void">void</link>         <link linkend="PlRepository__repositoryClose">repositoryClose</link>          (<link linkend="void">void</link>);
                <link linkend="xmlDocPtr">xmlDocPtr</link>    <link linkend="PlRepository__executeCommand">executeCommand</link>           (const <link linkend="xmlDocPtr">xmlDocPtr</link> repositoryRequest);
                ...
};
typedef <link linkend="class_PlRepository">PlRepository</link> *PlRepositoryPtr;

  </synopsis>
</refsynopsisdiv>

<refsect1>
  <title>Description</title>
    <para>
    This class is used to connect to a Repository and execute a Repository Command.
    </para>
</refsect1>

<refsect1>
  <title>Details</title>
    <para/>
    <refsect2>
      <title><anchor id="PlRepository__repositoryOpen"/>PlRepository::repositoryOpen ()</title>
        <indexterm>
          <primary>PlRepository::repositoryOpen</primary>
        </indexterm>
        <programlisting><link linkend="void">void</link>       PlRepository::repositoryOpen           (const <link linkend="char">char</link> *configFileName);
</programlisting>
        <para>
        This function is called to initialize a connection to the Repository. The configuration file which
        is passed as an argument, is processed and the XML database is opened. If the argument is set to
        NULL, the Repository default configuration file (etc/prolingarepcfg.xml) will be used.</para>

        <para>Function <link linkend="PlRepository__repositoryClose">PlRepository::repositoryClose</link> 
        must be called when access to the Repository is no longer needed in order to flush XML data
        to the database and close all handles.</para>
        <para>
        </para>
        <variablelist role="params">
          <varlistentry>
            <term><parameter>configFileName</parameter>&nbsp;:</term>
            <listitem>
              <simpara> the name or the Repository configuration file. If the argument is set to
              NULL, the Repository default configuration file (etc/prolingarepcfg.xml) will be used.</simpara>
            </listitem>
          </varlistentry>
        </variablelist>
    </refsect2>

    <para/>
    <refsect2>
      <title><anchor id="PlRepository__repositoryClose"/>PlRepository::repositoryClose ()</title>
        <indexterm>
          <primary>PlRepository::repositoryClose</primary>
        </indexterm>
        <programlisting><link linkend="void">void</link>       PlRepository::repositoryClose           (<link linkend="void">void</link>);
</programlisting>
        <para>
        This function is called to close a connection to the Repository. All XML data that may be in cache
        is flushed to the XML database and file handles are closed. </para>
        <para>
        </para>
        <variablelist role="params">
        </variablelist>
    </refsect2>

    <para/>
    <refsect2>
      <title><anchor id="PlRepository__executeCommand"/>PlRepository::executeCommand ()</title>
        <indexterm>
          <primary>PlRepository::executeCommand</primary>
        </indexterm>
        <programlisting><link linkend="xmlDocPtr">xmlDocPtr</link>       PlRepository::executeCommand           (const <link linkend="xmlDocPtr">xmlDocPtr</link> repositoryRequest);
</programlisting>
        <para>
        This function presents a Repository Command to the Repository. The command gets processed and a result
        returned. The returned XML document needs to be freed manually when it
        is no longer needed.
        </para>

        <para>
        </para>
        <variablelist role="params">
          <varlistentry>
            <term><emphasis>Returns</emphasis>&nbsp;:</term>
            <listitem>
              <simpara> the Repository Command response as a libxml2 XML document.</simpara>
            </listitem>
          </varlistentry>
        </variablelist>
    </refsect2>

  </refsect1>
</refentry>

