XStreamDB Installation and Deployment Guide

Introduction

This document describes how to install and deploy XStreamDB.

Installation

XStreamDB install package is provided in an easy to use jar file. The installation jar file is named like this: xstreamdb<ver>_<platform>.jar

where <ver> is the version number of the XStreamDB product. As of the writing of the guide, the current version is "32". This is actually version 3.2 but the decimal point is not used in the <ver> portion of the jar file name.

where <platform> can be "win", "linux" or "mac" depending on the target operating system you selected when downloading the product.

The installation is started by opening a command window, changing to the location of the downloaded jar file and entering the following, modified for your platform:

java -jar xstreamdb32_<platform>.jar

Example: if you are installing onto a Windows system, then you would enter:

java -jar xstreamdb32_win.jar

Once the installation is complete, you will notice the following directory structure under your chosen location.

XStreamDB License File

The license file contains a serial number that is required for XStreamDB Server to run. The Server will not start if the serial number is not valid. If you require a new serial number, contact Bluestream Database Software Corp. Send an email message with your request to mailto:sales@bluestream.com .

Typically the license file is populated during installation by entering the serial number (which was sent to you via email) on the serial number entry screen. If this step was skipped, or if you need to place a new serial number in the license file, here is what you do.

Once the new serial number has been correctly placed in the serialnum.txt file, the XStreamDB Server will start successfully.

Running XStreamDB

In order to run XStreamDB you must start the server process first, then you can run your client process. An example client process is the XStreamDB Explorer application. If on windows, and you created shortcuts you can use those shortcuts.� Otherwise,� to run directly:

Changing Passwords

Passwords can be changed as needed via the Explorers Configuration tab. On the left hand side, there is a tree display of system features, one of which is USERS . Expanding the Users node displays all of the currently defined User Ids. Right-clicking on a User Id will present a menu which includes the Change Password option.

Deploying XStreamDB

The XStreamDB Client library is deployed separately from of the XStreamDB Server process. For example, in some cases you may deploy the server on a separate machine from the client.

Client Deployment

When the XStreamDB Client library is deployed, it is deployed within a user's process. This user process is typically one of the following:

Required configuration

In order for a user's process to use the XStreamDB client libraries, that process must be able to find the XStreamDB jars. As well, that process must set the location of the XStreamDB client home to access configuration information such as logs, property files and server connection parameters.

  • Find jars: In general, for web servers, jars are found by automatically scanning the lib directory in a web application (WebApp) and loading them from there. As well, Web servers have other variations for finding jars but these are not described here. For a standard java application you indicate the location of the jars by setting the classpath. Below is a list of client library jars that are located in the {InstallDir}/XStreamDB/Client/lib. For details on where to put these jars and how to access them see the web server and standard java application sections below.
    • xdbClient.jar
    • jaxp.jar
    • xercesImpl.jar
    • xmlParserAPIs.jar
    • excalibur.jar
    • logkit.jar
    • wutkaDTDparser.jar
  • Set client home: The client home is located by the XStreamDB client library by accessing the java system property called xdb.client.home . The system property xdb.client.home should be set to {InstallDir}/XStreamDB/Client. You can set this system property using the java -D option or by using another such facility offered by your process. An example of setting this for a Servlet container, such as TomCat, Resin or JRun, follows in the section below.� A better war deployment you may want to copy the entire Client directory into your WebApplication war and then use the web application context to set xdb.client.home - this makes your web application more deployable as a unit without requiring a separate install of the XStreamDB client.
Special Linux Solaris Configuration
Client Configuration
Before attempting to start a Client process, do the following one time only:

1. Change to the {InstallDir}/Client/Explorer directory.

2. Run the config.sh script to assign executable permission to the shell scripts in this directory as well as to scripts located in the Client/samples subdirectories. This example assumes Bash is the shell being used:

bash ./config.sh
Console Sample Environment
Prior to attempting to run the sample scripts in Client/samples/console, do the following once, to build the Java classes:

1. Change to the {InstallDir}/Client/Explorer directory.

2. Execute the setenv.sh script to prepare the environment to run the sample scripts, including the build script:

. ./setenv.sh

3. Execute the build.sh script to generate the sample Java classes.

./build.sh

4. Once the console classes have been built, the scripts can be run. The first script must be

./runGenerateDB.sh

This generates a loaded database with sample documents for use with the other console sample scripts.

5. After the console sample database has been created and populated, other sample scripts will run successfully; for example:

./QueryAll.sh

This script retrieves all 100 of the sample documents used in the console sample.

Note that the setenv.sh script must be run once in any command window, prior to any sample script being invoked.

Optional Client Configuration

The configuration options described here are optional.

  • Helper Environment Variable: A handy helper when refering to the {InstallDir}XStreamDB/Client location is an environment variable called XDB_CLIENT_HOME which you set to {InstallDir}/XStreamDB/Client - where {InstallDir} is the location you installed XStreamDB under.

    In Windows, for example, this can be set by using the command:

    set XDB_CLIENT_HOME=C:/XStreamDB/Client

    Assuming that C:/ is your {InstallDir}. To make this setting permanent in Windows you can set XDB_CLIENT_HOME using the Windows menus selections:

    Start, Settings, ControlPanel, System, Advanced, Environment Variables
  • Setting Up Server Names: The XStreamDB system ships with one server named "MyServer". MyServer is configured to communicate with an XStreamDB server listening on port 1223. This configuration is set in the {XStreamDB-InstallDir}/Client/conf/XDBClientConfig.xml file with the tag:
    <Servers>
              <Server name = "MyServer" host = "localhost" port = "1223"/>
         </Servers>

    The ' host ' attribute may either be a Host Name as shown above, or it can be a Host Address as shown here:

    <Servers>
              <Server name = "DocumentServer" host = "192.57.233.19" port = "1223"/>
         </Servers>

    If you wish to connect to an XDBServer running on another port you may either add a new configuration tag to the XML file directly, or use the Explorer login screen to do it for you. This configuration file supports multiple <Server/> entries which is especially useful if your client machine is going to be accessing multiple XStreamDB servers.

Custom XStreamDB Client -- Standard Java Application

Deployment of a standard Java application relies on the required configuration discussed above: set the classpath to each of the six jars in "{InstallDir}/XStreamDB/Client/lib" to find the jars and set xdb.client.home to "{install dir}/XStreamDB/Client" .

Custom XStreamDB Client -- WebServer Deployment

When your web application uses the XStreamDB Client libraries it is necessary to set the classpath to the XStreamDB client libraries and to set the xdb.client.home java system property to the XStreamDB client home. The main mode of deployment of web applications described here is the standard J2EE WAR file.

WAR files the standard approach

When accessing XStreamDB from a web application your web application must find the XStreamDB jar files and it must find the XStreamDB client configuration information. As a standard approach we recommend you use WAR files to deploy your WebApp and that the WAR file contain in its lib directory the 6 client jars listed above. Since the lib directory will be scanned automatically these jars will be found without modifying your WebServer's classpath.

Servlet Configuration

Below are instructions for making the XStreamDB client library accessible from a web application, or Servlet:

  • Config Files: Ensure that the XStreamDB Client/conf directory and files are also placed in the WAR file. The conf directory should reside in the WEB-INF directory and should contain these files:
    • XDBClient.prop
    • XDBClientConfig.xml
    • XDBClientConfig.DTD
  • Find jars: put the 6 jars into lib directory in WAR file. For this explanation, it is assumed that the lib directory resides in the WEB-INF directory of the deployed web application.
  • Set client home: In the Servlet.init() method of your primary servlet class, set the xdb.client.home property as shown below:
    public void init(ServletConfig servletConfig)
      {
        ...
    
        String path = "/WEB-INF";
        ServletContext ctx = servletConfig.getServletContext();
        String home = ctx.getRealPath(path);
        System.setProperty("xdb.client.home", home);
    
        ...
      }
    This property must be set prior to issuing any calls to the XStreamDB client API.

Server Deployment

Server Deployment is simpler than client deployment since the server runs in its own process. To deploy the server on a separate machine simply copy the "{InstallDir}/XStreamDB/Server" directory to the separate machine in some directory of your choice (hereinafter called ServerInstallDir). and then run the server using {ServerInstallDir}/Server/bin/runServer.bat" (Windows) or {ServerInstallDir}/Server/bin/runServer.sh" (Linux or Solaris).

Special Linux/Solaris Server Configuration
Before attempting to start the Server, do the following once only:

1. Change to the {ServerInstallDir}/Server/bin directory.

2. Run the config.sh script to assign executable permission to the runServer.sh script (which assumes Bash is the shell being used):

bash ./config.sh

Setting the Server Listen Port

The server listen port is set by changing a setting in this file:

{ServerInstallDir}/Server/conf/XDBServer.prop

The properties are:

  • server.port : This is the listen port and is set to 1223 by default .
  • server.control.port : This is the shutdown port and is set to 1224 by default.

Installing XStreamDB as a Windows Service

The XStreamDB Server may optionally be installed as a Windows Service. This method of installation ensures that the XStreamDB Server will be properly started and stopped by the operating system whenever it is started and stopped.

Note: the Server/service/ReadMe.htm file has more detailed information on running the XStreamDB Server as a service.

These instructions explain how to install XStreamDB as a service:

  • Install XStreamDB Server to your chosen location, hereafter referred to as {XStreamDB-install-dir}.
  • Open a command window and change to {XStreamDB-install-dir}/service directory.
  • Edit the install.bat file using a plain text editor (Notepad.exe is a good example of such an editor)
  • Edit the install.bat and locate the line near the top which looks like:
    :set XDB_SERVER_HOME=C:\XStreamDB\Server
  • Modify this line, removing the colon at the beginning of the line and changing the path to reflect the {XStreamDB-install-dir} on your machine. As an example, if XDB was installed into a directory such as "D:\Programs\XStreamDB", then the modified line would look like this:
    set XDB_SERVER_HOME=D:\Programs\XStreamDB\Server
  • Optionally, do the same for the JAVA_HOME variable if it is not already set in your environment.
  • Save the changed file.
  • Run install.bat
  • Go to the Windows Services panel and locate the service named XStreamDB . Right-click on this entry and select Start.

The XStreamDB Server should now be running as a service. You can verify that it is working by checking the current Server/log file which should contain an entry stating that the Server has started and this entry should possess a current time stamp.

Alternatively, you can go to the Client/samples/console directory and use some of the scripts to issue XQuery statements against the running XStreamDB Server.

XDB WebDav Installation and Deployment

Basic Install

WebDav comes preconfigured with XStreamDb. The starting war name is xrwebdav.war

  • start XStreamDB Server
  • start tomcat - will expand xrwebdav.war web application
  • type " http://localhost:8080/xrwebdav " - you should see:
    Bluestream Content Management WebDAV server Version 1.0
      Build: 2005-03-10T15:30:32Z
  • logon using "administrator" "goxmldb"
  • you will see a directory of resource - this is limited since we only ship with a limited number of resources

Renaming to xdbres Install

It is often necessary to change the context name for your WebDav web application. The default context is xrwebdav.war. One reason to change the context is so all your web links start with a prefix of your choosing. We recommend that you use a prefix called "xdbres". As well, if you are using the Bluestream XdbWeb application, you will want to use the same context for that web application as well - "xdbres". In order to have two web applications with the same context name, you will need two instances of the web server. Here we describe how to configure the Tomcat instance included with XStreamDB to use xdbres instead of xrwebdav for the context name.� Note, we assume if you also configure XdbWeb to use xdbres, that XdbWeb will run in a different instance of Tomcat.

  • Only do this if you fear WebServer ports will collide or you need a different port than 8080. Access the server.xml file under [Tomcat install-dir]/conf, and change the following:
    • the shutdown port which you will find in the "<Server ...>" tag
    • the startup port which you will find in the "<Connector ...>" tag
    • any other ports which will be used
  • Rename the xrwebdav.war to xdbres.war
  • Start the XStreamDB server
  • Start XdbWeb Tomcat so that the xdbres.war files are expanded
  • Shutdown the XdbWeb install of Tomcat Under [Tomcat install-dir]/webapps/xdbres/WEB-INF, edit the web.xml file by changing the setting for "webdav.url" so that its value corresponds to the url which is being used for the Tomcat install where the xrwebdav.war was placed. Restart this install of Tomcat
  • In a browser, type the url in the location field, for example: http://localhost:8080/xdbres � You should first be presented with:
    Bluestream Content Management WebDAV server Version 1.0
      Build: 2005-03-10T15:30:32Z
  • If you do this rename - note all examples below should use context /xdbres not /xrwebdav.

About WebDAV

Security

HTTP digest security is in effect for WebDAV. Because of this you will be prompted for a username and password when you access WebDAV. A good client will cache this information to avoid re-prompting for authentication.

WebDAV and Resources

WebDAV is an extension to the http protocol that allows a WebDAV client to access resources located on a WebDAV server. Example WebDAV clients are XMLSpy, Microsoft Web Folders and XMetaL. The XStreamDB WebDAV server is a java servlet, running on a WebServer, that accesses the XStreaWebDAVmDB native XML database server. The resources being served up by the XDB WebDAV servlet are the documents and binary resources stored in the XStreamDB database server.

Before resources can be served by XStreamDB, however, it is necessary to configure the resource categories and their resources using the XStreamDB Explorer Resources tab.

Links and the URI Prefix

With the standard setup the WebDAV root is at http://{host}/xdb/resource. If you wish to link to other XML documents from within an XML document, then you have to decide on a linking strategy. The most common linking strategy is the "root relative link". When using a root relative link you refer to other documents by first specifying /xdb/resource followed by the {DatabaseName}/{RootName}[/{more categories}...]/DocumentName. See the section called "Rich Edit" in the documentation.

XMLSpy Access to WebDAV

  • To mount a WebDAV folder in XMLSpy:
    • Start XMLSpy version 4.3 or better.
    • Select menu options: Project, Add External Web Folder to project .
    • In the dialog box enter:
      http://localhost:8080/xrwebdav
      for Server and press Browse button.

      Note: that the host address, 'localhost', and port number used above, '8080', are typical default values. You should change these values as needed to reflect your Servlet container installation.

    • Select a root in the Browse window and press OK.
    • This will mount the root collection.
    • At this point, all of the documents in the mounted collection will be displayed in the Browse window.
  • To save a new file:
    • Open any XML file and modify it.
    • Select menu options: File, Save to URL.
    • Browse to TestCol and it should go into the top text box labelled File URL:
    • Type a unique name on the end of the URL, otherwise the file will show up without a name.
    • Press OK.
    • Go to the left project pane, right click to refresh the list of files.
    • Your file should now be displayed in this list.
  • Once your file is stored in XStreamDB, you can edit it by selecting it from the left project pane. You can also save it using the standard Save button or menu selection.

Mounting a WebDAV Folder

Another way to view the documents hosted by the XDB WebApp is to use a WebDAV compliant folder to display them.

To open the XDB WebApp in a Windows WebDAV folder:

  • Open Windows Explorer and go to " My Network Places ".
  • Right click and choose " Map a Network Drive ".
  • The dialog has a link called " Web folder or FTP site ". Choose this link. Enter
    http://localhost:8080/xrwebdav
    Press Next , and then, Finish on the next dialog.
  • Note that the host address, 'localhost', and port number used above, '8080', are typical default values. You should change these values as needed to reflect your Servlet container installation.

XMetaL Access To WebDAV

You must have Corel XMetaL version 3.1.3.058 or later to use XStreamDB WebDAV. The XMetaL editor is very well suited to visualizing XML document data as standard documents. In fact, this document is authored using XMetaL and the Journalist.xsd schema. In order to load a document using XMetaL you must mount it as a microsoft web folder as described above. Once mounted as a WebFolder files are simply opened using the standard file/open menu from within XMetaL.

The journalist schema is a subset of the more extensive DocBook XML vocabulary. The journalist schema and the macros necessary to view journalist documents ship with XMetaL right out of the box.

Last Modified Date: Monday, March 22, 2004 10:45:54 AM