| By Selim Mimaroglu | Article Rating: |
|
| February 14, 2006 07:45 PM EST | Reads: |
21,082 |
Apache Software Foundation's Xindice is an open source native XML database. Apache provides great software to developers such as the Apache Web Server, Tomcat Application Server, Cocoon Web Development Framework, Struts Framework, Ant, and many more under an open source license. Apache Web Server is an industrial-strength product that is used by many high-traffic Web sites. Apache Tomcat is a servlet container that implements both Java Servlets and Java Server Pages. The fact that Xindice is a member of the Apache Software Foundation gives it substantial credibility, because Apache produces well-known, well-respected software. We will explore the Xindice native XML database beginning with its installation and advancing step by step. As the Xindice home page suggests, you are encouraged to pronounce it as "zeen-dee-chay" with your best faux Italian accent. Xindice supports XPath query language, XML:DB, and XUpdate standards in Java, in addition to XML-RPC API for non-Java programmers.
Installation
You can download both the source files and the binaries from the home page of Xindice at http://xml.apache.org/xindice/. As I write, the latest stable release is 1.0, and the current milestone is 1.1b4. I downloaded the binary files in both webapp and .jar formats. You don't need to download the source files if you aren't interested in reading or modifying them.
Version 1.1 of Xindice doesn't run as a stand-alone server, but instead runs under a servlet 2.2-compliant application server. The documentation states that it's tested both with Tomcat and Jetty. Since Tomcat is very popular and I am familiar with it, I decided to run Xindice with Tomcat. You can download Tomcat from http://tomcat.apache.org. I downloaded the Windows executable, binary core distribution version 5.0.28.
Because I already have a Java SDK (Software Development Kit) installed on my machine, I didn't need to download it again, but if you don't have a Java SDK, you have to download version 1.4.x of J2SE (Java 2 Standard Edition) from http://java.sun.com.
I installed Xindice and Tomcat and tested all of the examples in this article on my laptop, a 1.4GHz Pentium M processor, running on Windows XP Professional with 512MB main memory, without any problems. These are the installations steps I followed:
- Install Java 1.4.x SDK.
- Set JAVA_HOME environment variable to the installation directory (on my system the value of JAVA_HOME is D:\j2sdk1.4.2_03).
- Install Tomcat. (This step is straightforward because Tomcat comes with an installer. By default Tomcat will install under C:\Program Files, with a space between the words Program and Files: unfortunately there will be some problems when running Xindice, so I changed the installation location to D:\Tomcat_5.0. Any location will do as long as it doesn't have any space in it.)
- Unzip the Xindice webapp distribution, and rename the .war file (xindice-1.1b4.war) to xindice.war.
- Drop xindice.war (the extension war stands for web archive) under Tomcat's webapps directory (this is D:\Tomcat_5.0\webapps on my system).
- Start Tomcat using the "Configure Tomcat" application (it's located under Start->All Programs->Apache Tomcat 5.0->Configure Tomcat).
- In a few minutes Tomcat will unzip the .war file. When it does, you should see a new Xindice directory under D:\Tomcat_5.0\webapps.
- Now it's time to create a new environment variable called XINDICE_HOME. If you followed the locations I suggested, XINDICE_HOME should have D:\Tomcat_5.0\webapps\xindice\WEB-INF as its value. If you didn't, modify the value accordingly.
- As the last step, put D:\Tomcat_5.0\webapps\xindice\WEB-INF under your Path since it contains the Xindice's command-line tool.
Starting or stopping the Xindice native XML database means starting or stopping the Tomcat Server. Tomcat by default runs on port 8080, and you can change the port during or after the installation. To check if your Tomcat is running properly, after starting it visit http://localhost:8080/ (or http://127.0.0.1:8080/ ): you should see the welcome page.
Command-Line Tool
We can perform the following tasks using the command-line tool:
- Add/remove a collection
- List collections
- Add/remove a document
- Retrieve documents
- Import/export a directory tree
- Add/remove a collection index
- Execute an XPath query
Let's list the collections installed by Xindice after the installation. Remember that the server should be running in order to execute this command successfully:
> xindice list_collections -c xmldb:xindice://localhost:8080/db
trying to register database
system
meta
Total collections: 2
Each command has an abbreviated version. For example, we could have used lc instead of list_collections. For clarity, in this article I will use the full name of the commands. After familiarizing yourself with Xindice, you probably won't want to write the commands in full. You can find the abbreviated versions and the descriptions of all the commands at the Xindice Commandline Tool Guide.
In this example, the full context is xmldb:xindice://localhost:8080/db, which is specified by the -c option. When using Tomcat we have to specify the full context: Tomcat runs on port 8080, but Xindice is preconfigured for Jetty, which runs on port 8888. If you don't want to specify the full context, you have two options: change the Tomcat's port to 8888 or install Jetty instead of Tomcat. If the server is running on a different machine and not on the localhost, you should replace the localhost portion of the context with the correct URL.
After executing this command the system responded by telling us that there are two collections: systems and meta. Like the other popular open source native XML databases such as eXist and Berkeley DB XML, Xindice too uses the idea of collection. A collection is similar to a folder in terms of functionality. You can have several XML files under a collection, which is a neat way of organizing the documents.
Adding a Collection
Let's create a new collection called dictionary:
> xindice add_collection -c xmldb:xindice://localhost:8080/db -n dictionary
trying to register database
Created : xmldb:xindice://localhost:8080/db/dictionary
As in the previous example, -c specifies the context that is the root location (all of the data files and collections are stored under this location). By executing this command successfully we created a subcollection called dictionary. The context of this new location is xmldb:xindice://localhost:8080/db/dictionary.
Listing the collections reveals that now we have three collections, of which two of them were previously created.
> xindice list_collections -c xmldb:xindice://localhost:8080/db
trying to register database
dictionary
system
meta
Total collections: 3
Published February 14, 2006 Reads 21,082
Copyright © 2006 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Selim Mimaroglu
Selim Mimaroglu is a PhD candidate in computer science at the University of Massachusetts in Boston. He holds an MS in computer science from that school and has a BS in electrical engineering.
![]() |
SYS-CON Australia News Desk 02/14/06 07:22:33 PM EST | |||
Apache Software Foundation's Xindice is an open source native XML database. Apache provides great software to developers such as the Apache Web Server, Tomcat Application Server, Cocoon Web Development Framework, Struts Framework, Ant, and many more under an open source license. Apache Web Server is an industrial-strength product that is used by many high-traffic Web sites. Apache Tomcat is a servlet container that implements both Java Servlets and Java Server Pages. The fact that Xindice is a member of the Apache Software Foundation gives it substantial credibility, because Apache produces well-known, well-respected software. We will explore the Xindice native XML database beginning with its installation and advancing step by step. As the Xindice home page suggests, you are encouraged to pronounce it as 'zeen-dee-chay' with your best faux Italian accent. Xindice supports XPath query language, XML:DB, and XUpdate standards in Java, in addition to XML-RPC API for non-Java programmers. |
||||
- Publishing Synergy: Blog, Twitter and Ulitzer
- Will PR Firms Survive The New Media Avalanche?
- Typhoon Ondoy (Ketsana) Hits the Philippines (Part 2)
- Confessions of a Ulitzer Addict
- Cloud Computing Expo 2010 East to Attract More Than 5,000 Delegates in New York City
- Cloud Computing Journal Continues To Publish World's Best Cloud Analysts
- CIA Falls for Cloud Computing in a Big Way
- Are You Comfortable With Where Your Data Sleeps at Night?
- Dr. Leslie Lenert of CDC Speaks on Healthcare IT
- Game-Changing Innovations and the Evolving SOA Appliance
- What Happened To SOA?
- Instant Professionalism Online Despite Yourself...with Ulitzer
- Cloud CEOs, CTOs & SVPs to Speak at 4th International Cloud Computing Expo
- Publishing Synergy: Blog, Twitter and Ulitzer
- Will PR Firms Survive The New Media Avalanche?
- Typhoon Ondoy (Ketsana) Hits the Philippines (Part 2)
- Confessions of a Ulitzer Addict
- My Thoughts on Ulitzer
- Combining the Cloud with the Computing: Application Delivery Networks
- Cloud Computing Expo 2010 East to Attract More Than 5,000 Delegates in New York City
- Ulitzer vs. Ning
- Cloud Computing Journal Continues To Publish World's Best Cloud Analysts
- CIA Falls for Cloud Computing in a Big Way
- Are You Comfortable With Where Your Data Sleeps at Night?
- Where Are RIA Technologies Headed in 2008?
- AJAX World RIA Conference & Expo Kicks Off in New York City
- JSON vs XML - A Jason vs Freddie Sequel
- Processing XML with C# and .NET
- Has the Technology Bounceback Begun?
- BPEL Processes and Human Workflow
- The Top 250 Players in the Cloud Computing Ecosystem
- Open Source Database Special Feature: An Introduction to Berkeley DB XML
- "HP's Problem Ain't the SAP Install," Says Sun's Schwartz
- eXist - An Introduction To Open Source Native XML Database
- Digitizing the Planet: Google Earth vs MSN Virtual Earth vs MapQuest
- Generating XML from Relational Database Tables


































