org.exist.xmlrpc
Interface RpcAPI

All Known Implementing Classes:
RpcServer

public interface RpcAPI

Defines the methods callable through the XMLRPC interface.

Author:
Wolfgang Meier modified by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it

Field Summary
static String BASE_URI
           
static String COLUMN
           
static String ERROR
           
static String LINE
           
static String NAMESPACES
           
static String SORT_EXPR
           
static String STATIC_DOCUMENTS
           
static String VARIABLES
           
 
Method Summary
 boolean backup(User user, String userbackup, String password, String destcollection, String collection)
           
 Hashtable compile(User user, byte[] xquery, Hashtable parameters)
           
 boolean configureCollection(User user, String collection, String configuration)
           
 boolean copyCollection(User user, String name, String namedest)
           
 boolean copyCollection(User user, String collectionPath, String destinationPath, String newName)
           
 boolean copyResource(User user, String docPath, String destinationPath, String newName)
           
 boolean createCollection(User user, String name)
          Create a new collection on the database.
 boolean createCollection(User user, String name, Date created)
           
 String createResourceId(User user, String collection)
           
 boolean dataBackup(User user, String dest)
           
 Hashtable describeCollection(User user, String collectionName)
           
 Hashtable describeResource(User user, String resourceName)
           
 Hashtable execute(User user, String path, Hashtable parameters)
          Execute XPath/Xquery from path file (stored inside eXist) returned reference may be used later to get a summary of results or retrieve the actual hits.
 int executeQuery(User user, byte[] xpath, Hashtable parameters)
           
 int executeQuery(User user, byte[] xpath, String encoding, Hashtable parameters)
          Execute XPath query and return a reference to the result set.
 int executeQuery(User user, String xpath, Hashtable parameters)
           
 byte[] getBinaryResource(User user, String name)
           
 Hashtable getCollectionDesc(User user, String rootCollection)
          Describe a collection: returns a struct with the following fields:
 Date getCreationDate(User user, String collectionName)
           
 Vector getDocType(User user, String documentName)
           
 byte[] getDocument(User user, String name, Hashtable parameters)
          Retrieve document by name.
 byte[] getDocument(User user, String name, String encoding, int prettyPrint)
          Deprecated. Use getDocument(User, String, Hashtable) instead.
 byte[] getDocument(User user, String name, String encoding, int prettyPrint, String stylesheet)
          Deprecated. Use getDocument(User, String, Hashtable) instead.
 String getDocumentAsString(User user, String name, Hashtable parameters)
           
 String getDocumentAsString(User user, String name, int prettyPrint)
           
 String getDocumentAsString(User user, String name, int prettyPrint, String stylesheet)
           
 Vector getDocumentChunk(User user, String name, Hashtable parameters)
           
 byte[] getDocumentChunk(User user, String name, int start, int stop)
           
 Hashtable getDocumentData(User user, String name, Hashtable parameters)
          Retrieve the specified document, but limit the number of bytes transmitted to avoid memory shortage on the server.
 Vector getDocumentListing(User user)
          Get a list of all documents contained in the database.
 Vector getDocumentListing(User user, String collection)
          Get a list of all documents contained in the collection.
 Vector getGroups(User user)
           
 int getHits(User user, int resultId)
          Get the number of hits in the result set identified by it's result-set-id.
 Vector getIndexedElements(User user, String collectionName, boolean inclusive)
           
 Hashtable getNextChunk(User user, String handle, int offset)
           
 Hashtable getPermissions(User user, String resource)
           
 int getResourceCount(User user, String collectionName)
          Returns the number of resources in the collection identified by collectionName.
 Vector getTimestamps(User user, String documentName)
           
 Hashtable getUser(User user, String name)
           
 Vector getUsers(User user)
           
 boolean hasCollection(User user, String name)
          Does the Collection identified by name exist in the repository?
 boolean hasDocument(User user, String name)
          Does the document identified by name exist in the repository?
 String hasUserLock(User user, String path)
           
 boolean isValid(User user, String name)
           
 boolean isXACMLEnabled(User user)
          Returns true if XACML is enabled for the current database instance
 Hashtable listCollectionPermissions(User user, String name)
           
 Hashtable listDocumentPermissions(User user, String name)
           
 boolean lockResource(User user, String path, String userName)
           
 boolean moveCollection(User user, String collectionPath, String destinationPath, String newName)
           
 boolean moveResource(User user, String docPath, String destinationPath, String newName)
           
 boolean parse(User user, byte[] xmlData, String docName)
          Parse an XML document and store it into the database.
 boolean parse(User user, byte[] xmlData, String docName, int overwrite)
          Parse an XML document and store it into the database.
 boolean parse(User user, byte[] xmlData, String docName, int overwrite, Date created, Date modified)
           
 boolean parse(User user, String xml, String docName)
           
 boolean parse(User user, String xml, String docName, int overwrite)
           
 boolean parseLocal(User user, String localFile, String docName, boolean replace, String mimeType)
          Parse a file previously uploaded with upload.
 boolean parseLocal(User user, String localFile, String docName, boolean replace, String mimeType, Date created, Date modified)
           
 String printDiagnostics(User user, String query, Hashtable parameters)
          Returns a diagnostic dump of the expression structure after compiling the query.
 byte[] query(User user, byte[] xquery, int howmany, int start, Hashtable parameters)
          Deprecated. use Vector query() or int executeQuery() instead
 Hashtable queryP(User user, byte[] xpath, Hashtable parameters)
           
 Hashtable queryP(User user, byte[] xpath, String docName, String s_id, Hashtable parameters)
           
 Hashtable querySummary(User user, int resultId)
          Retrieve a summary of the result set identified by it's result-set-id.
 Hashtable querySummary(User user, String xquery)
          Deprecated. use Vector query() or int executeQuery() instead
 boolean reindexCollection(User user, String name)
           
 boolean releaseQueryResult(User user, int handle)
           
 boolean remove(User user, String docName)
          Remove a document from the database.
 boolean removeCollection(User user, String name)
          Remove an entire collection from the database.
 boolean removeUser(User user, String name)
           
 byte[] retrieve(User user, int resultId, int num, Hashtable parameters)
          Retrieve a single result from the result-set identified by resultId.
 byte[] retrieve(User user, String doc, String id)
          Retrieve a single node from a document.
 byte[] retrieve(User user, String doc, String id, Hashtable parameters)
          Retrieve a single node from a document.
 byte[] retrieveAll(User user, int resultId, Hashtable parameters)
           
 String retrieveAsString(User user, String doc, String id, Hashtable parameters)
           
 Vector scanIndexTerms(User user, String xpath, String start, String end)
           
 Vector scanIndexTerms(User user, String collectionName, String start, String end, boolean inclusive)
           
 boolean setDocType(User user, String documentName, String doctypename, String publicid, String systemid)
           
 boolean setPermissions(User user, String resource, int permissions)
           
 boolean setPermissions(User user, String resource, String permissions)
           
 boolean setPermissions(User user, String resource, String owner, String ownerGroup, int permissions)
           
 boolean setPermissions(User user, String resource, String owner, String ownerGroup, String permissions)
           
 boolean setUser(User user, String name, String passwd, String digestPassword, Vector groups)
           
 boolean setUser(User user, String name, String passwd, String digestPassword, Vector groups, String home)
           
 boolean shutdown(User user)
          Shut down the database immediately.
 boolean shutdown(User user, long delay)
          Shut down the database after the specified delay (in milliseconds).
 boolean storeBinary(User user, byte[] data, String docName, String mimeType, boolean replace)
          Store data as a binary resource.
 boolean storeBinary(User user, byte[] data, String docName, String mimeType, boolean replace, Date created, Date modified)
           
 boolean sync(User user)
           
 boolean unlockResource(User user, String path)
           
 String upload(User user, byte[] chunk, int length)
          An alternative to parse() for larger XML documents.
 String upload(User user, String file, byte[] chunk, int length)
          An alternative to parse() for larger XML documents.
 String uploadCompressed(User user, byte[] data, int length)
           
 String uploadCompressed(User user, String file, byte[] data, int length)
           
 int xupdate(User user, String collectionName, byte[] xupdate)
           
 int xupdateResource(User user, String resource, byte[] xupdate)
           
 int xupdateResource(User user, String resource, byte[] xupdate, String encoding)
           
 

Field Detail

SORT_EXPR

static final String SORT_EXPR
See Also:
Constant Field Values

NAMESPACES

static final String NAMESPACES
See Also:
Constant Field Values

VARIABLES

static final String VARIABLES
See Also:
Constant Field Values

BASE_URI

static final String BASE_URI
See Also:
Constant Field Values

STATIC_DOCUMENTS

static final String STATIC_DOCUMENTS
See Also:
Constant Field Values

ERROR

static final String ERROR
See Also:
Constant Field Values

LINE

static final String LINE
See Also:
Constant Field Values

COLUMN

static final String COLUMN
See Also:
Constant Field Values
Method Detail

shutdown

boolean shutdown(User user)
                 throws PermissionDeniedException
Shut down the database immediately.

Returns:
true if the shutdown succeeded, false otherwise
Throws:
PermissionDeniedException

shutdown

boolean shutdown(User user,
                 long delay)
                 throws PermissionDeniedException
Shut down the database after the specified delay (in milliseconds).

Returns:
true if the shutdown succeeded, false otherwise
Throws:
PermissionDeniedException

sync

boolean sync(User user)

isXACMLEnabled

boolean isXACMLEnabled(User user)
Returns true if XACML is enabled for the current database instance

Returns:
if XACML is enabled

getDocument

byte[] getDocument(User user,
                   String name,
                   String encoding,
                   int prettyPrint)
                   throws EXistException,
                          PermissionDeniedException
Deprecated. Use getDocument(User, String, Hashtable) instead.

Retrieve document by name. XML content is indented if prettyPrint is set to >=0. Use supplied encoding for output. This method is provided to retrieve a document with encodings other than UTF-8. Since the data is handled as binary data, character encodings are preserved. byte[]-values are automatically BASE64-encoded by the XMLRPC library.

Parameters:
name - the document's name.
prettyPrint - pretty print XML if >0.
encoding - character encoding to use.
user -
Returns:
Document data as binary array.
Throws:
EXistException
PermissionDeniedException

getDocument

byte[] getDocument(User user,
                   String name,
                   String encoding,
                   int prettyPrint,
                   String stylesheet)
                   throws EXistException,
                          PermissionDeniedException
Deprecated. Use getDocument(User, String, Hashtable) instead.

Retrieve document by name. XML content is indented if prettyPrint is set to >=0. Use supplied encoding for output and apply the specified stylesheet. This method is provided to retrieve a document with encodings other than UTF-8. Since the data is handled as binary data, character encodings are preserved. byte[]-values are automatically BASE64-encoded by the XMLRPC library.

Parameters:
name - the document's name.
prettyPrint - pretty print XML if >0.
encoding - character encoding to use.
user - Description of the Parameter
Returns:
The document value
Throws:
EXistException
PermissionDeniedException

getDocument

byte[] getDocument(User user,
                   String name,
                   Hashtable parameters)
                   throws EXistException,
                          PermissionDeniedException
Retrieve document by name. All optional output parameters are passed as key/value pairs int the hashtable parameters. Valid keys may either be taken from OutputKeys or EXistOutputKeys. For example, the encoding is identified by the value of key OutputKeys.ENCODING.

Parameters:
name - the document's name.
parameters - Hashtable of parameters.
Returns:
The document value
Throws:
EXistException
PermissionDeniedException

getDocumentAsString

String getDocumentAsString(User user,
                           String name,
                           int prettyPrint)
                           throws EXistException,
                                  PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

getDocumentAsString

String getDocumentAsString(User user,
                           String name,
                           int prettyPrint,
                           String stylesheet)
                           throws EXistException,
                                  PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

getDocumentAsString

String getDocumentAsString(User user,
                           String name,
                           Hashtable parameters)
                           throws EXistException,
                                  PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

getDocumentData

Hashtable getDocumentData(User user,
                          String name,
                          Hashtable parameters)
                          throws EXistException,
                                 PermissionDeniedException
Retrieve the specified document, but limit the number of bytes transmitted to avoid memory shortage on the server.

Parameters:
user -
name -
parameters -
Throws:
EXistException
PermissionDeniedException

getNextChunk

Hashtable getNextChunk(User user,
                       String handle,
                       int offset)
                       throws EXistException,
                              PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

getBinaryResource

byte[] getBinaryResource(User user,
                         String name)
                         throws EXistException,
                                PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

hasDocument

boolean hasDocument(User user,
                    String name)
                    throws EXistException,
                           PermissionDeniedException
Does the document identified by name exist in the repository?

Parameters:
name - Description of the Parameter
user - Description of the Parameter
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

hasCollection

boolean hasCollection(User user,
                      String name)
                      throws EXistException,
                             PermissionDeniedException
Does the Collection identified by name exist in the repository?

Parameters:
name - Description of the Parameter
user - Description of the Parameter
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

getDocumentListing

Vector getDocumentListing(User user)
                          throws EXistException,
                                 PermissionDeniedException
Get a list of all documents contained in the database.

Parameters:
user -
Returns:
list of document paths
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

getDocumentListing

Vector getDocumentListing(User user,
                          String collection)
                          throws EXistException,
                                 PermissionDeniedException
Get a list of all documents contained in the collection.

Parameters:
collection - the collection to use.
user - Description of the Parameter
Returns:
list of document paths
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

listDocumentPermissions

Hashtable listDocumentPermissions(User user,
                                  String name)
                                  throws EXistException,
                                         PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

listCollectionPermissions

Hashtable listCollectionPermissions(User user,
                                    String name)
                                    throws EXistException,
                                           PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

getCollectionDesc

Hashtable getCollectionDesc(User user,
                            String rootCollection)
                            throws EXistException,
                                   PermissionDeniedException
Describe a collection: returns a struct with the following fields:
        name                            The name of the collection
        
        owner                           The name of the user owning the collection.
        
        group                           The group owning the collection.
        
        permissions     The permissions that apply to this collection (int value)
        
        created                 The creation date of this collection (long value)
        
        collections             An array containing the names of all subcollections.
        
        documents               An array containing a struct for each document in the collection.
        
Each of the elements in the "documents" array is another struct containing the properties of the document:
        name                            The full path of the document.
        
        owner                           The name of the user owning the document.
        
        group                           The group owning the document.
        
        permissions     The permissions that apply to this document (int)
        
        type                                    Type of the resource: either "XMLResource" or "BinaryResource"
        

Parameters:
rootCollection - Description of the Parameter
user - Description of the Parameter
Returns:
The collectionDesc value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

describeCollection

Hashtable describeCollection(User user,
                             String collectionName)
                             throws EXistException,
                                    PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

describeResource

Hashtable describeResource(User user,
                           String resourceName)
                           throws EXistException,
                                  PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

getResourceCount

int getResourceCount(User user,
                     String collectionName)
                     throws EXistException,
                            PermissionDeniedException
Returns the number of resources in the collection identified by collectionName.

Parameters:
user -
collectionName -
Returns:
Number of resources
Throws:
EXistException
PermissionDeniedException

retrieve

byte[] retrieve(User user,
                String doc,
                String id)
                throws EXistException,
                       PermissionDeniedException
Retrieve a single node from a document. The node is identified by it's internal id.

Parameters:
doc - the document containing the node
id - the node's internal id
user - Description of the Parameter
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

retrieve

byte[] retrieve(User user,
                String doc,
                String id,
                Hashtable parameters)
                throws EXistException,
                       PermissionDeniedException
Retrieve a single node from a document. The node is identified by it's internal id.

Parameters:
doc - the document containing the node
id - the node's internal id
user - Description of the Parameter
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

retrieveAsString

String retrieveAsString(User user,
                        String doc,
                        String id,
                        Hashtable parameters)
                        throws EXistException,
                               PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

retrieveAll

byte[] retrieveAll(User user,
                   int resultId,
                   Hashtable parameters)
                   throws EXistException,
                          PermissionDeniedException
Throws:
EXistException
PermissionDeniedException