ErrorsError IdSeverityDescription10000OkNo Error10001ErrorError parsing document10002ErrorEmpty Document10003ErrorInvalid root element10004ErrorInvalid repository XML file10005WarningNo document match10006WarningDocument not found10007WarningDocument already deleted10008ErrorCan not parse return string
Multiple Repository CommandsIt 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:
]]>Combining multiple RCs will result in better performance.ProLinga-Repository Programming NotesTo 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
user guide section for more
details.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.Network ClientTo 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 RepositoryClient.cpp
in the src directory of
ProLinga-Repository.When using this method, ProLinga-Repository must be running as
a Web Service.Repository LibraryTo be able to link directly into the Repository from a C++
application, the Repository Library (C++ API) can be used.A very basic example program using the Repository Library, so
it can access the Repository looks like this:
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;
}
]]>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.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.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
libxml++.
Internal Repository code will
be changed as the project progresses.To compile the program, use the following command:
g++ repository_test.cpp -o repository_test `pkg-config --cflags --libs prolinga-repository`
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 /usr/lib/pkgconfig or
directory /usr/local/lib/pkgconfig on GNU/Linux for
example.
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
dependencies and
prerequisites section for more details.Download ProLinga-RepositoryThere are two types of product versions available for download:Production VersionDevelopment VersionProduction VersionThe 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
download page for the latest details.Development VersionThe 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 Subversion section
of how to obtain the latest development version.Build ProLinga-RepositoryPrerequisitesProLinga-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.
Required 3rd party package(s) for a successful build:Berkeley DBXML.
This product provides a native XML database.libxml2.
This product provides XML libraries.ProLinga-Soap
This product provides a SOAP/XML engine.Optional 3rd party package(s):xsltproc. Command line processor.
This package
is only required to re-generate the HTML pages after making changes to the documentation.General Download and Installation Instructions 3rd Party Products.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.Download source tar/gz archive to /opt/builds/[product] Example:
place libxml2-x.x.x.tar.gz in /opt/builds/libxml2Use 'gunzip' to unzip the archiveUse 'tar xvf [product.tar] to extract the archive. Example:
tar xvf libxml2-x.x.x.tar.A new sub directory will be created with the new version of
the product. Example: /opt/builds/libxml2/libxml2-x.x.x
This way several versions of the same products can be installed next to
each other.For product specific installation instructions see following sections.Berkeley DBXML:To be able to build Berkeley DBXML, several other products need to be
installed as well. These are:Berkeley DB.
This product provides a general purpose database.Xerces.
This product provides XML libraries.XQilla.
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.
It is recommended to first download all products before installing them because
of dependencies.
Berkeley DB:Product root dir: /opt/builds/dbCurrent version: 4.8.26Download:
http://download.oracle.com/berkeley-db/db-4.8.26.tar.gzBuild Instructions:
cd /opt/builds/db/db-4.8.26
../dist/configure --enable-cxx
make
make install
The --enable-cxx option is required.Xerces-c:Product root dir: /opt/builds/xercesCurrent version: 2.7.0Download:
http://www.apache.org/dist/xml/xerces-c/source/xerces-c-src_2_7_0.tar.gzBuild Instructions:
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
XQilla:Product root dir: /opt/builds/xqillaCurrent version: 2.2.3 (customized release shipped with dbxml 2.5.16) Download: Ships with Berkeley DBXML 2.5.16.Build Instructions:
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
Product root dir: /opt/builds/dbxmlCurrent version: 2.5.16Download:
http://download.oracle.com/berkeley-db/dbxml-2.5.16.tar.gzBuild Instructions:
cd /opt/builds/dbxml/dbxml-2.5.16/build_unix
../dist/configure
make
make install
See file docs/ref/xml_unix/intro.html which ships with dbxml for more
installation information.Check for and apply latest dbxml patches.Libxml2:Product root dir: /opt/builds/libxml2Current version: 2.6.31Download:
ftp://xmlsoft.org/libxml2/libxml2-2.6.31.tar.gzBuild Instructions:
cd /opt/builds/libxml2/libxml2-2.6.31
./configure
make
make install
ProLinga-Soap:Product root dir: /opt/builds/prolingaCurrent version: 0.0.1Download:
http://download.prolinga.orgBuild Instructions:
cd /opt/builds/prolinga/prolinga-soap-0.0.1
./configure --prefix=/opt/builds/prolinga/prolinga-soap-0.0.1
make
make install
See the ProLinga-Soap Project documentation for more installation
information.Build InstructionsExtracting archiveThe product archive can be extracted to any desired directory
using unzip (.zip file extension) or
gunzip (.gz file extension)/
bunzip2 (.bz2 file extension) and
tar. After extracting, the following directories
will be created:
Directory Structure.DirectoryDescription&PRODUCT;-&version;Product version root directory.&PRODUCT;-&version;/configConfig build information.&PRODUCT;-&version;/docDocumentation.&PRODUCT;-&version;/srcAll source and internal header files.&PRODUCT;-&version;/testsSelf tests.&PRODUCT;-&version;/prolingaExternal (API) header files.
Compiling and LinkingTo build the product go to the product root directory and run the
configure script. For default installation in /usr/local type:
./configure
To install into another directory type:
./configure --prefix=/any/dirname/For all other configure options, type:
./configure --help
After running the configure script, the product can be build with:
make
To run the optional self-test type:
make check
After compilation, the binaries, libraries and header files can be
installed with:
make install
You may need root access for this last option.By default, HTML documentation pages are available in
the doc/html directory. These pages are generated from
DocBook XML file format
files in /doc. To re-generate the HTML pages from these files type:
make html
The command line XSLT processor xsltproc must be
available from $PATH to be able to generate the HTML documentation.DependenciesMany 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.
Choosing the right type of buildThe 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.In production 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:
./configure --enable-final
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.In development environments, builds are needed producing warnings, enabling
maximum debugging info etc. Several options are available here.--enable-warnings : Set all compiler warning flags--enable-debug : Enable all debug messages--enable-gprof : Enables profiling with gprof (GCC only)Further development of ProLinga-RepositoryAll 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.To-do ListThis 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
ProLinga Bugzilla Server.
Implement XML Schemas for validation. Libxml2 is finishing up XML schemas.
If it is still too far away, start with DTD.ProLinga-Repository is written in C++. Libxml2 however is C only. There is a C++ wrapper
for this XML parser library. Details at http://libxmlplusplus.sourceforge.net/.
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.Some strings/paths are hardcoded in the product. This all should be
reviewed and be removed or made all configurable using a config file.Utilities. prolingarepcreate at the moment can only
be used to initialize
the Repository. We should have options available as creating application
dump, reading application dump etc.Code review and cleanup.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).Self-tests need to be developed for quality control.Porting to other platforms. (MS-Windows/Solaris?), so we can make a distribution
available on a specific port if we need to.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.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.SubversionA Subversion tree containing the latest project sources is available
at http://svn.prolinga.org.
For access please contact the ProLinga Development team.BugzillaBugzilla software development and bug tracking system to manage the
ProLinga projects is available at
http://bugzilla.prolinga.org.
For access please contact the ProLinga Development team.Help to DevelopAre you ready to join the ProLinga development team? There are several ways you
can help:Use the product. Tell us what you think, ideas, bugs etc.Fixing bugs. Visit the development section of the ProLinga Web Site,
choose a
bug, fix it and send us the code changes.
Enhancements. Have a look at the enhancement section of the
to-do list
and let us know which new feature you
want to help to develop.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 us know if and how you can help out.
Real world examples. Are you using ProLinga products or do you know people
who are happily using it. Tell us the story and provide some screenshots.
ProLinga-Repository C++ APIThis section contains the API reference for ProLinga-Repository. All
the public interfaces are documented here.
&prolinga-repository-API;
ProLinga-Repository User GuideThis section contains the user guide for the ProLinga-Repository. All
the binaries are documented here.
&prolinga-repository-userguide;
&fdl;