Account services

XmlServer - Java-servlet extension for XML-based data exchange

Overview

The XmlServer component is a set of Java classes to enhance Java Servlet-based HTTP server to support XML-based data exchange. The XmlServer component helps to generate XML from database queries, and to store an XML document to the database. It also incorporates XSLT (eXtensible Stylesheet Language Transformation) processor to transform server-side the generated XML data to some other presentation format (HTML, WML, PDF), and a proprietary technology to upload HTML form data to the source XML document.

The XmlServer component is built on top Java Servlet SDK (JSDK 2.2, current implementation is based on Caucho Web Server - Resin 1.1.6, but it should be compatible with any Web server implementing JSDK 2.2). It can be used with any database supporting JDBC, although the XmlServer component takes advantage of DBMS transaction management, therefore preferably the used DBMS should support transactions.

The core of the XmlServer component XmlServer component contains also generic XSQL processor called XRS (XML RecordSet) processor, what is capable of generating XML-documents on most of SQL queries. The same processor is able to store information from XML-documents of this type into the database. The main advantage of this processor is, that the query result retains its structural representation (one-to-many relationships between master and detail tables, and what data comes from which table), while in most applications (including various database spreadsheet clients) the query result is flat. This structural representation makes possible to store the same document to the database by the processor itself without writing query specific update code. What the programmer has to do, is to specify the data source (i.e. write the SQL queries composing the document), and to data store handler write only business logic-dependent code. Although the XRS processor might be the most valuable part of the XML-framework, other processors for some other XML document type can be plugged in.

Modules

The other Java libraries needed to build XmlServer component, included in the distribution, are the following:

- xerces.jar 	- Apache XML parser
- xalan.jar	- Apache XSL transormer
- jsdk22.jar	- Sun JSDK 2.2 interface classes

Installation

The distribution includes the XmlServer component in binary format. The xmlserver.jar library has to be included in the Web-application classpath.

The component can be built also using included buildfile with Ant ver. 1.4.

Configuration

The following applies directly when XmlServer component is used with Resin 1.1.6 Web-server. With any other JSDK 2.2 compatible servers slight modifications may occur, although the deployment descriptor grammar should be JSDK 2.2 standard.

The XmlServer application matches with JSDK 2.2 application (<web-app> element), and the database connection definition used by the XmlServer component matches with Resin database connection pool definition (<dbpool.sql> element). The XmlServer component has to be included to the application with the help of the classpath directive, e.g. <classpath id='path/xmlserver.jar'/> Additional libraries needed for the XmlServer component are:

Apache Xerces-1 and Xalan-1 libraries:

	<classpath id='path/xerces.jar'/> - XML parser
	<classpath id='path/xalan.jar'/> - if we need also XSLT processor 
	

The JDBC driver used to connect to database have to be on the Web-server classpath.

XmlServer specific deployment descriptor settings are the following (given values are default, i.e. if this parameter is not explicitly written in the deployment descriptor, the default will be assumed):


    <context-param application-name='com.tee.xmlserver'/>
    
    Used to identify the application and to connect the application with
    the database connection definition. The application-name parameter
    value should match with the dbpool.sql id attribute value.


    <context-param module-db_pool='com.tee.xmlserver.caucho.CDBPool'/>

    Defines a class implementing a database connection pool defined by
    the com.tee.xmlserver.DBPoolIF interface.


    <context-param module-cache='com.tee.xmlserver.caucho.CCache'/>

    Defines a class implementing an LRU cache defined by the
    com.tee.xmlserver.CacheIF interface.


    <context-param cache-size='1024'/>

    Defines a maximum number of items stored in the LRU cache.


    <context-param
    module-proc_factory='com.tee.xmlserver.xrs.XRSFactory'/>

    Defines a class implementing an XSQL processor factory defined by
    the com.tee.xmlserver.ProcessorFactoryIF interface.


    <context-param module-xml_factory=
    'com.tee.xmlserver.apache.ApacheXMLFactory'/>

    Defines a class implementing an interface to XML parser/XSLT processor
    defined by the com.tee.xmlserver.XMLFactoryIF interface.


    <context-param module-db_vendor='com.tee.xmlserver.mysql.DBMySQL'/>

    Defines a class implementing a database vendor specific methods
    defined by the com.tee.xmlserver.DBVendorIF interface.


    <context-param app_cache='com.tee.xmlserver.def.AppCache'/>

    Defines a class implementing application directed cache management
    defined by the com.tee.xmlserver.AppCacheIF interface.


    <context-param authenticator='com.tee.xmlserver.def.AppUser'/>

    Defines a class implementing application user authenticator defined
    by the com.tee.xmlserver.AppUserIF interface. Default implementation
    does not impose any restrictions. If XmlServer security mechanism
    is used, has to be redefined.


    <context-param locale='...'/>

    Defines a locale to be used by the application in the form llCC, where
    ll is 2-letter lowercase language code and CC is 2-letter uppercase
    country code. If not specified, system's default locale will be used.


    <context-param log-level='1'/>

    Defines the logging level of the XmlServer component. The value
    1 means that only important messages and error information will
    be logged, value 5 means that all the debugging information will
    be logged.


    <context-param login-error-page='...'/>

    Defines the URL to the page, what will be displayed to the user,
    when login failed. If XmlServer security mechanism is used,
    login-error-page must be defined.

Documentation

The XmlServer distribution includes JavaDoc documentation.

Reporting bugs

You can report bugs to rando.valt@tietoenator.com. Please attach the extracts from XmlServer log file.

Primary author

XmlServer component is written by Rando Valt (rando.valt@tietoenator.com).

License

Copyright 2000-2000 TietoEnator Corp. XmlServer is free software. It is distributed it under the GNU General Public License (GPL). See the COPYRIGHT file, http://www.fsf.org/ and http://www.opensource.org/.

Distribution

New releases can be downloaded from http://www.eionet.eu.int/software/xmlserver, and from SVN at http://svn.eionet.eu.int/repositories/Reportnet/XmlServer/trunk