Comments
bruce.armstrong wrote: Somebody just said it better than I did, and with more chops to say it: Open Letter to Mark Zuckerberg, Sheryl Sandberg & Facebook Mobile
Cloud Expo on Google News


2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
SYS-CON.TV
Top Links You Must Click On


XML Product Review: "Getting to Know Xindice"
An open source native XML database

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:

  1. Install Java 1.4.x SDK.
  2. Set JAVA_HOME environment variable to the installation directory (on my system the value of JAVA_HOME is D:\j2sdk1.4.2_03).
  3. 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.)
  4. Unzip the Xindice webapp distribution, and rename the .war file (xindice-1.1b4.war) to xindice.war.
  5. 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).
  6. Start Tomcat using the "Configure Tomcat" application (it's located under Start->All Programs->Apache Tomcat 5.0->Configure Tomcat).
  7. 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.
  8. 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.
  9. 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 the Server
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
Listing Collections
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

About 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.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

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.


Your Feedback
SYS-CON Australia News Desk wrote: 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 lan...
Enterprise Open Source Magazine Latest Stories . . .
In this CTO Power Panel at the 10th International Cloud Expo, moderated by Cloud Expo Conference Chair Jeremy Geelan, industry-leading CTOs & VPs of Technology will discuss such topics as: Which do you think is the most important cloud computing standard still to tackle? Who should...
Private clouds solve many problems for enterprises and bring unique operational challenges along with them. There are dozens of companies of all sizes that will build you a private cloud and turn over the keys – then what? Trying to convert a traditional enterprise IT operations team t...
The networking industry has gone through different waves over last 30+ years. In the ’80s, the first wave was all about connecting and sharing; how to connect a computer to other peripheral devices and other computers. There were many players who developed technology and services to ad...
The impact of Big Data is extremely broad for business, information management and technology. Being able to analyze your growing mountain of data can give you a distinct competitive advantage, but Big Data can be more than traditional tools can handle. In his session at the 10th Int...
Cloud computing is creating the new Wall Street boom, according to NIA. The only industry that is as bright as cloud computing on Wall Street is social networking, NIA said in a recent report. 2012 will be known as the year cloud computing became widely adopted worldwide. Cloud comput...
If your organization already uses virtualized infrastructure, you are well on your way to providing IT as a Service. But as businesses demand faster results in today’s competitive market, organizations look to gain more benefits from cloud computing than just virtualized infrastructure...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON Featured Whitepapers
ADS BY GOOGLE