topical media & game development
server-php-xml-class-xindice-class-xindice.htm / htm
<html>
<head>
<title>Xindice (class_xindice.php)</title>
<link rel="stylesheet" href="main.css" type="text/css">
</head>
<body>
<div align="center">
<table border="0" width="80%" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#aaaaee" class="text" align="center"><a href="http://phpxmlclasses.sourceforge.net/">PHP XML Classes</a></td>
</tr>
</table>
<table border="0" width="80%" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#aaaaee" class="textblbl" align="center">Xindice (class_xindice.php)</td>
</tr>
</table>
<br/>
<table border="0" width="80%">
<tr>
<td bgcolor="#eeeeff" class="text">Description: This is a class to access an Xindice 1.0 xml database,
the class uses the Xindice XML-RPC plugin so you need to check/install the Xindice XML-RPC plugin.
</td>
</tr>
</table>
<br/>
<table border="0" bgcolor="ddddff" width="80%">
<tr>
<td valign="top" class="text" width="50%"><b>NEWS:</b>
<ul>
<li> 05-15-2002 Version 1.0 of this class is released.
</ul>
</td>
<td valign="top" width="50%" class="text">
This class code as well as documentation are hosted at <a href="http://www.sourceforge.net">SourceForge</a>
please visit our <a href="http://phpxmlclasses.sourceforge.net/">SourceForge page</a> for releases, documentation, bug-tracking, support
forums and mailing lists.
</td>
</tr>
</table>
<br/>
<table border="0" width="80%" cellpadding="0" cellspacing="0">
<tr>
<td class="textbl" bgcolor="aaaaee" width="50%">Resources</td>
<td class="textbl" bgcolor="aaaaee" width="50%">Requirements</td>
</tr>
</table>
<table border="1" width="80%" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" bgcolor="eeeeff" class="text" width="50%">
<ul>
<li><a class="textbl" href="http://www.sourceforge.net/projects/phpxmlclasses">Downloads</a>
<li><a class="textbl" href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpxmlclasses/xindice/">Browse CVS</a>
<li><a class="textbl" href="http://sourceforge.net/tracker/?atid=470965&group_id=53613&func=browse">Report Bugs</a>
</ul>
</td>
<td valign="top" bgcolor="eeeeff" class="text" width="50%">
<ul>
<li>PHP 4.0.5+
</ul>
</td>
</tr>
</table>
<br/>
<table border="0" width="80%" cellpadding="0" cellspacing="0">
<tr>
<td class="textbl" bgcolor="aaaaee" width="50%">Features</td>
<td class="textbl" bgcolor="aaaaee" width="50%">To-dos</td>
</tr>
</table>
<table border="1" width="80%" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" bgcolor="eeeeff" class="text" width="50%">
<ul>
<li> Full Xindice XML-RPC API implemented.
</ul>
</td>
<td valign="top" bgcolor="ddddff" class="text" width="50%">
<ul>
<li>
</ul>
</td>
</tr>
</table>
<br/>
<table border="0" bgcolor="ddddff" width="80%">
<tr>
<!--
<td valign="top" class="text" width="50%"><b>To-do/future releases:</b>
<ul>
<li>Class
<li>Class
<li>Class
</ul>
</td> -->
<td valign="top" width="100%" class="text">
Contact:
</td>
</tr>
</table>
<br/>
<table border="0" bgcolor="ddddff" width="80%">
<tr>
<!--
<td valign="top" class="text" width="50%"><b>To-do/future releases:</b>
<ul>
<li>Class
<li>Class
<li>Class
</ul>
</td> -->
<td valign="top" width="100%" class="text">
Detailed description and usage:<br/>
<pre>include_once("class_xindice.php");
// Create the Xindice access object
server",xi) {
die("Cannot create Xindice object, check servername and port<br />");
}
server_uri, int server_uri, int debug)</CODE>
<BR>
Sets the debug method of the XML-RPC library</TD>
</TR>
<!-- A ROW -->
<!-- A ROW -->
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="#class22method6">createCollection</A></B>(string collectionName)</CODE>
<BR>
Creates a collection from a base collection</TD>
</TR>
<!-- A ROW -->
<!-- A ROW -->
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> array</CODE></FONT></TD>
<TD><CODE><B><A HREF="#class22method4">listCollections</A></B>(string collectionPath)</CODE>
<BR>
Returns the number of documents in a collection</TD>
</TR>
<!-- A ROW -->
<!-- A ROW -->
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="#class22method7">dropCollection</A></B>(string collection, string content)</CODE>
<BR>
Inserts a new document in a collection</TD>
</TR>
<!-- A ROW -->
<!-- A ROW -->
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="#class22method9">setDocument</A></B>(string id, string collection, string collection)</CODE>
<BR>
Lists the documents under a collection</TD>
</TR>
<!-- A ROW -->
<!-- A ROW -->
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="#class22method12">removeDocument</A></B>(string id)</CODE>
<BR>
Removes a document from a collection</TD>
</TR>
<!-- A ROW -->
<!-- A ROW -->
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="#class22method13">createIndexer</A></B>(string indexName, string collection, string collection)</CODE>
<BR>
List indexes created on a collection</TD>
</TR>
<!-- A ROW -->
<!-- A ROW -->
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> string</CODE></FONT></TD>
<TD><CODE><B><A HREF="#class22method16">queryDocument</A></B>(string type, string id)</CODE>
<BR>
Queries a document</TD>
</TR>
<!-- A ROW -->
<!-- A ROW -->
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> string</CODE></FONT></TD>
<TD><CODE><B><A HREF="#class22method17">queryCollection</A></B>(string type, string server_uri, int server_uri - URI of the Xindice server, use "localhost" if local.<br>server_uri, int debug)</PRE>
<DL>
<DD>This class uses an XML-RPC library, if something goes wrong you can turn the XML-RPC debug of the library on using this method.<DD>
<DL>
<DT><B>Parameters:</B><DD>
base, string base - Name of the base collection where the new collection will be created<br>collection)</PRE>
<DL>
<DD>This method returns an array of strings with the names of collections under the parent collection passed as argument only child collections are returned not all the descendant collections<DD>
<DL>
<DT><B>Parameters:</B><DD>
collectionPath)</PRE>
<DL>
<DD>Returns the number of documents present in the collection passed as argument<DD>
<DL>
<DT><B>Parameters:</B><DD>
collectionPath)</PRE>
<DL>
<DD>Drops a collection all documents and subcollections under the collection are removed as well<DD>
<DL>
<DT><B>Parameters:</B><DD>
collection, string content)</PRE>
<DL>
<DD>Inserts a new document in a collection<DD>
<DL>
<DT><B>Parameters:</B><DD>
id - A string identifying the document inside the collection<br>collection, string content)</PRE>
<DL>
<DD>Updates/sets a document<DD>
<DL>
<DT><B>Parameters:</B><DD>
id - Id of the document to be updated<br>collection, string collection - Collection name<br>collection)</PRE>
<DL>
<DD>Returns an array of document names blonging to the given collection<DD>
<DL>
<DT><B>Parameters:</B><DD>
collection, string collection - Name of the collection<br>collection, string pattern)</PRE>
<DL>
<DD>This method creates an index on a collection given a pattern<DD>
<DL>
<DT><B>Parameters:</B><DD>
indexName - Name of the index that will be created<br>collection, string collection - Name of the collection<br>collection)</PRE>
<DL>
<DD>List indexes created on a collection<DD>
<DL>
<DT><B>Parameters:</B><DD>
collection, string query, string collection - Name of the collection where the document belongs<br>query - Query to be executed<br>collection, string query)</PRE>
<DL>
<DD>This method is used to query all the documents in a collection<DD>
<DL>
<DT><B>Parameters:</B><DD>
type - Type of query (XPath or XUpdate)<br>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.