Sitellite Application Framework
Class Tree         Index         All Elements

Class: Xindice

Source Location: Program_Root/XML/DB/Xindice.php

Class Overview


An abstraction to the XML-RPC API of the Apache Xindice XML database.


Author(s)

Version

  • 0.8, 2002-11-27, $Id: Xindice.php,v 1.2 2005/07/06 15:30:56 lux Exp $

Copyright

  • Copyright (C) 2001-2003, Simian Systems Inc.

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 62]
An abstraction to the XML-RPC API of the Apache Xindice XML database.

Requires the Apache Xindice XML database and the XML-RPC API to connect to it, available at http://xml.apache.org/xindice/ and http://xindice-xmlrpc.sourceforge.net/ , respectively.

New in 0.8:

  • Uses a new XML-RPC client library, was PEAR::XML_RPC, is now IXR (the Inutio XML-RPC Library), which has a much clearer API, _actual_ documentation, and doesn't require an RPCWrapper class to hide its API as PEAR::XML_RPC did.
  • Added an $errno property to contain the faultCode if an error occurs.
  • Added a _method() method to format the method calls based on the $handler property and the actual method name to call.

1 <?php
2
3 $xdb = new Xindice ('http://localhost:4080/', 'db');
4
5 echo '<pre>';
6 foreach ($xdb->listDocuments ('/db/employees') as $id) {
7 echo htmlentities_compat ($xdb->getDocument ('/db/employees', $id)) . "\n\n";
8 }
9 echo '</pre>';
10
11 ?>




Tags:

access:  public
version:  0.8, 2002-11-27, $Id: Xindice.php,v 1.2 2005/07/06 15:30:56 lux Exp $
license:  http://www.sitellite.org/index/license
copyright:  Copyright (C) 2001-2003, Simian Systems Inc.
author:  John Luxford <mailto:lux@simian.ca>


[ Top ]


Class Variables

$client =

[line 71]

The XML-RPC client object.



Tags:

access:  public

Type:   mixed


[ Top ]

$errno =

[line 79]

The error number (faultCode) if an error occurs.



Tags:

access:  public

Type:   mixed


[ Top ]

$error =

[line 87]

The error message (faultString) if an error occurs.



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


constructor Xindice [line 99]

Xindice Xindice( [string $source = 'http://localhost:4080/'], [string $handler = 'db'])

Constructor method.



Tags:

access:  public


Parameters:

string   $source  
string   $handler  

[ Top ]

method createCollection [line 133]

boolean createCollection( string $parent, string $name)

Creates the specified collection below the specified $parent collection. Returns true on success, unlike XML-RPC messages, which return 0 on success.



Tags:

access:  public


Parameters:

string   $parent  
string   $name  

[ Top ]

method createIndexer [line 153]

integer createIndexer( string $collection, string $index, string $pattern)

Creates a new index in the specified collection.



Tags:

access:  public


Parameters:

string   $collection  
string   $index  
string   $pattern  

[ Top ]

method createNewOID [line 172]

string createNewOID( string $collection)

Creates a new unique id for this collection. Returns the new OID.



Tags:

access:  public


Parameters:

string   $collection  

[ Top ]

method dropCollection [line 190]

integer dropCollection( string $collection)

Deletes the specified collection.



Tags:

access:  public


Parameters:

string   $collection  

[ Top ]

method dropIndexer [line 209]

integer dropIndexer( string $collection, string $index)

Deletes the specified index.



Tags:

access:  public


Parameters:

string   $collection  
string   $index  

[ Top ]

method getDocument [line 228]

string getDocument( string $collection, string $id)

Retrieves the specified document.



Tags:

access:  public


Parameters:

string   $collection  
string   $id  

[ Top ]

method getDocumentCount [line 246]

integer getDocumentCount( string $collection)

Returns the number of documents in the specified collection.



Tags:

access:  public


Parameters:

string   $collection  

[ Top ]

method insertDocument [line 267]

string insertDocument( string $collection, string $id, string $content)

Inserts a document into the specified collection. Returns the id of the inserted document.



Tags:

access:  public


Parameters:

string   $collection  
string   $id  
string   $content  

[ Top ]

method listCollections [line 285]

array listCollections( string $collection)

Returns a list of collections within the specified collection.



Tags:

access:  public


Parameters:

string   $collection  

[ Top ]

method listDocuments [line 303]

array listDocuments( string $collection)

Returns a list of documents within the specified collection.



Tags:

access:  public


Parameters:

string   $collection  

[ Top ]

method listIndexers [line 321]

array listIndexers( string $collection)

Returns a list of indexers within the specified collection.



Tags:

access:  public


Parameters:

string   $collection  

[ Top ]

method listXMLObjects [line 339]

array listXMLObjects( string $collection)

Returns a list of XML objects within the specified collection.



Tags:

access:  public


Parameters:

string   $collection  

[ Top ]

method queryCollection [line 364]

array queryCollection( string $collection, string $type, string $query, associative $namespaces)

Queries the specified collection. $type is the type of query to execute (valid types are 'XPath' and 'XUpdate'). $query is the query to execute, in the proper syntax of the specified $type. $namespaces is an associative array of namespace definitions.

The key is the prefix and the value is the namespace URI.




Tags:

access:  public


Parameters:

string   $collection  
string   $type  
string   $query  
associative   $namespaces   array $namespaces

[ Top ]

method queryDocument [line 386]

array queryDocument( string $collection, string $type, string $query, associative $namespaces, string $id)

Queries the specified document.



Tags:

access:  public


Parameters:

string   $collection  
string   $type  
string   $query  
string   $id  
associative   $namespaces   array $namespaces

[ Top ]

method removeDocument [line 405]

integer removeDocument( string $collection, string $id)

Deletes the specified document.



Tags:

access:  public


Parameters:

string   $collection  
string   $id  

[ Top ]

method setDocument [line 426]

string setDocument( string $collection, string $id, string $content)

Sets a document in the specified collection. Must be called after the document already exists.



Tags:

access:  public


Parameters:

string   $collection  
string   $id  
string   $content  

[ Top ]

method _method [line 115]

string _method( string $name)

Returns a proper method request with the $handler from the property of this class prepended if necessary.



Tags:

access:  public


Parameters:

string   $name  

[ Top ]


Copyright © 2007, SIMIAN systems Inc.
All rights reserved. Privacy policy
Documentation generated on Tue, 13 Feb 2007 17:20:21 -0600 by Sitellite AppDoc and phpDocumentor 1.2.2