org.exist.xmlrpc
Interface RpcAPI

All Known Implementing Classes:
RpcConnection

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

PROTECTED_MODE

static final String PROTECTED_MODE
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()
                 throws PermissionDeniedException
Shut down the database immediately.

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

shutdown

boolean shutdown(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()

isXACMLEnabled

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

Returns:
if XACML is enabled

getDocument

byte[] getDocument(String name,
                   String encoding,
                   int prettyPrint)
                   throws EXistException,
                          PermissionDeniedException
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.
Returns:
Document data as binary array.
Throws:
EXistException
PermissionDeniedException

getDocument

byte[] getDocument(String name,
                   String encoding,
                   int prettyPrint,
                   String stylesheet)
                   throws EXistException,
                          PermissionDeniedException
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.
Returns:
The document value
Throws:
EXistException
PermissionDeniedException

getDocument

byte[] getDocument(String name,
                   HashMap 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 - HashMap of parameters.
Returns:
The document value
Throws:
EXistException
PermissionDeniedException

getDocumentAsString

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

getDocumentAsString

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

getDocumentAsString

String getDocumentAsString(String name,
                           HashMap parameters)
                           throws EXistException,
                                  PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

getDocumentData

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

Parameters:
name -
parameters -
Throws:
EXistException
PermissionDeniedException

getNextChunk

HashMap getNextChunk(String handle,
                     int offset)
                     throws EXistException,
                            PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

getNextExtendedChunk

HashMap getNextExtendedChunk(String handle,
                             String offset)
                             throws EXistException,
                                    PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

getBinaryResource

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

hasDocument

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

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

hasCollection

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

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

getDocumentListing

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

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

getDocumentListing

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

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

listDocumentPermissions

HashMap listDocumentPermissions(String name)
                                throws EXistException,
                                       PermissionDeniedException,
                                       URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

listCollectionPermissions

HashMap listCollectionPermissions(String name)
                                  throws EXistException,
                                         PermissionDeniedException,
                                         URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

getCollectionDesc

HashMap getCollectionDesc(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
Returns:
The collectionDesc value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

describeCollection

HashMap describeCollection(String collectionName)
                           throws EXistException,
                                  PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

describeResource

HashMap describeResource(String resourceName)
                         throws EXistException,
                                PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

getResourceCount

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

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

retrieve

byte[] retrieve(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
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

retrieve

byte[] retrieve(String doc,
                String id,
                HashMap 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
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

retrieveFirstChunk

HashMap retrieveFirstChunk(String doc,
                           String id,
                           HashMap parameters)
                           throws EXistException,
                                  PermissionDeniedException
Retrieve a single node from a document. The node is identified by its internal id. It is fetched the first chunk, and the next ones should be fetched using getNextChunk or getNextExtendedChunk

Parameters:
doc - the document containing the node
id - the node's internal id
parameters - a HashMap value
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

retrieveAsString

String retrieveAsString(String doc,
                        String id,
                        HashMap parameters)
                        throws EXistException,
                               PermissionDeniedException,
                               URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

retrieveAll

byte[] retrieveAll(int resultId,
                   HashMap parameters)
                   throws EXistException,
                          PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

retrieveAllFirstChunk

HashMap retrieveAllFirstChunk(int resultId,
                              HashMap parameters)
                              throws EXistException,
                                     PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

compile

HashMap compile(byte[] xquery,
                HashMap parameters)
                throws Exception
Throws:
Exception

queryP

HashMap queryP(byte[] xpath,
               HashMap parameters)
               throws EXistException,
                      PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

queryP

HashMap queryP(byte[] xpath,
               String docName,
               String s_id,
               HashMap parameters)
               throws EXistException,
                      PermissionDeniedException,
                      URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

query

byte[] query(byte[] xquery,
             int howmany,
             int start,
             HashMap parameters)
             throws EXistException,
                    PermissionDeniedException
Deprecated. use Vector query() or int executeQuery() instead

execute XPath query and return howmany nodes from the result set, starting at position start. If prettyPrint is set to >0 (true), results are pretty printed.

Parameters:
howmany - maximum number of results to return.
start - item in the result set to start with.
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

querySummary

HashMap querySummary(String xquery)
                     throws EXistException,
                            PermissionDeniedException
Deprecated. use Vector query() or int executeQuery() instead

execute XPath query and return a summary of hits per document and hits per doctype. This method returns a struct with the following fields:
"queryTime" int
"hits" int
"documents" array of array: Object[][3]
"doctypes" array of array: Object[][2]
Documents and doctypes represent tables where each row describes one document or doctype for which hits were found. Each document entry has the following structure: docId (int), docName (string), hits (int) The doctype entry has this structure: doctypeName (string), hits (int)

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

printDiagnostics

String printDiagnostics(String query,
                        HashMap parameters)
                        throws EXistException,
                               PermissionDeniedException
Returns a diagnostic dump of the expression structure after compiling the query. The query is read from the query cache if it has already been run before.

Parameters:
query -
Throws:
EXistException
PermissionDeniedException

createResourceId

String createResourceId(String collection)
                        throws EXistException,
                               PermissionDeniedException,
                               URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

parse

boolean parse(byte[] xmlData,
              String docName)
              throws EXistException,
                     PermissionDeniedException,
                     URISyntaxException
Parse an XML document and store it into the database. The document will later be identified by docName. Some xmlrpc clients seem to have problems with character encodings when sending xml content. To avoid this, parse() accepts the xml document content as byte[]. If overwrite is >0, an existing document with the same name will be replaced by the new document.

Parameters:
xmlData - The document data
docName - The path where the document will be stored
Throws:
EXistException
PermissionDeniedException
URISyntaxException

parse

boolean parse(byte[] xmlData,
              String docName,
              int overwrite)
              throws EXistException,
                     PermissionDeniedException,
                     URISyntaxException
Parse an XML document and store it into the database. The document will later be identified by docName. Some xmlrpc clients seem to have problems with character encodings when sending xml content. To avoid this, parse() accepts the xml document content as byte[]. If overwrite is >0, an existing document with the same name will be replaced by the new document.

Parameters:
xmlData - The document data
docName - The path where the document will be stored
overwrite - Overwrite an existing document with the same path?
Throws:
EXistException
PermissionDeniedException
URISyntaxException

parse

boolean parse(byte[] xmlData,
              String docName,
              int overwrite,
              Date created,
              Date modified)
              throws EXistException,
                     PermissionDeniedException,
                     URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

parse

boolean parse(String xml,
              String docName,
              int overwrite)
              throws EXistException,
                     PermissionDeniedException,
                     URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

parse

boolean parse(String xml,
              String docName)
              throws EXistException,
                     PermissionDeniedException,
                     URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

upload

String upload(byte[] chunk,
              int length)
              throws EXistException,
                     PermissionDeniedException,
                     IOException
An alternative to parse() for larger XML documents. The document is first uploaded chunk by chunk using upload(), then parseLocal() is called to actually store the uploaded file.

Parameters:
chunk - the current chunk
length - total length of the file
Returns:
the name of the file to which the chunk has been appended.
Throws:
EXistException
PermissionDeniedException
IOException

upload

String upload(String file,
              byte[] chunk,
              int length)
              throws EXistException,
                     PermissionDeniedException,
                     IOException
An alternative to parse() for larger XML documents. The document is first uploaded chunk by chunk using upload(), then parseLocal() is called to actually store the uploaded file.

Parameters:
chunk - the current chunk
file - the name of the file to which the chunk will be appended. This should be the file name returned by the first call to upload.
length - total length of the file
Returns:
the name of the file to which the chunk has been appended.
Throws:
EXistException
PermissionDeniedException
IOException

uploadCompressed

String uploadCompressed(byte[] data,
                        int length)
                        throws EXistException,
                               PermissionDeniedException,
                               IOException
Throws:
EXistException
PermissionDeniedException
IOException

uploadCompressed

String uploadCompressed(String file,
                        byte[] data,
                        int length)
                        throws EXistException,
                               PermissionDeniedException,
                               IOException
Throws:
EXistException
PermissionDeniedException
IOException

parseLocal

boolean parseLocal(String localFile,
                   String docName,
                   boolean replace,
                   String mimeType)
                   throws EXistException,
                          PermissionDeniedException,
                          SAXException,
                          URISyntaxException
Parse a file previously uploaded with upload. The temporary file will be removed.

Parameters:
localFile -
Throws:
EXistException
IOException
PermissionDeniedException
SAXException
URISyntaxException

parseLocalExt

boolean parseLocalExt(String localFile,
                      String docName,
                      boolean replace,
                      String mimeType,
                      boolean treatAsXML)
                      throws EXistException,
                             PermissionDeniedException,
                             SAXException,
                             URISyntaxException
Throws:
EXistException
PermissionDeniedException
SAXException
URISyntaxException

parseLocal

boolean parseLocal(String localFile,
                   String docName,
                   boolean replace,
                   String mimeType,
                   Date created,
                   Date modified)
                   throws EXistException,
                          PermissionDeniedException,
                          SAXException,
                          URISyntaxException
Throws:
EXistException
PermissionDeniedException
SAXException
URISyntaxException

parseLocalExt

boolean parseLocalExt(String localFile,
                      String docName,
                      boolean replace,
                      String mimeType,
                      boolean treatAsXML,
                      Date created,
                      Date modified)
                      throws EXistException,
                             PermissionDeniedException,
                             SAXException,
                             URISyntaxException
Throws:
EXistException
PermissionDeniedException
SAXException
URISyntaxException

storeBinary

boolean storeBinary(byte[] data,
                    String docName,
                    String mimeType,
                    boolean replace)
                    throws EXistException,
                           PermissionDeniedException,
                           URISyntaxException
Store data as a binary resource.

Parameters:
data - the data to be stored
docName - the path to the new document
replace - if true, an old document with the same path will be overwritten
Throws:
EXistException
PermissionDeniedException
URISyntaxException

storeBinary

boolean storeBinary(byte[] data,
                    String docName,
                    String mimeType,
                    boolean replace,
                    Date created,
                    Date modified)
                    throws EXistException,
                           PermissionDeniedException,
                           URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

remove

boolean remove(String docName)
               throws EXistException,
                      PermissionDeniedException,
                      URISyntaxException
Remove a document from the database.

Parameters:
docName - path to the document to be removed
Throws:
EXistException
PermissionDeniedException
URISyntaxException

removeCollection

boolean removeCollection(String name)
                         throws EXistException,
                                PermissionDeniedException,
                                URISyntaxException
Remove an entire collection from the database.

Parameters:
name - path to the collection to be removed.
Throws:
EXistException
PermissionDeniedException
URISyntaxException

createCollection

boolean createCollection(String name)
                         throws EXistException,
                                PermissionDeniedException
Create a new collection on the database.

Parameters:
name - the path to the new collection.
Throws:
EXistException
PermissionDeniedException

createCollection

boolean createCollection(String name,
                         Date created)
                         throws EXistException,
                                PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

configureCollection

boolean configureCollection(String collection,
                            String configuration)
                            throws EXistException,
                                   PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

executeQuery

int executeQuery(byte[] xpath,
                 String encoding,
                 HashMap parameters)
                 throws EXistException,
                        PermissionDeniedException
Execute XPath query and return a reference to the result set. The returned reference may be used later to get a summary of results or retrieve the actual hits.

Parameters:
xpath - Description of the Parameter
encoding - Description of the Parameter
parameters - a HashMap value
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

executeQuery

int executeQuery(byte[] xpath,
                 HashMap parameters)
                 throws EXistException,
                        PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

executeQuery

int executeQuery(String xpath,
                 HashMap parameters)
                 throws EXistException,
                        PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

execute

HashMap execute(String path,
                HashMap parameters)
                throws EXistException,
                       PermissionDeniedException
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.

Throws:
EXistException
PermissionDeniedException

querySummary

HashMap querySummary(int resultId)
                     throws EXistException,
                            PermissionDeniedException,
                            XPathException
Retrieve a summary of the result set identified by it's result-set-id. This method returns a struct with the following fields: "queryTime" int "hits" int "documents" array of array: Object[][3] "doctypes" array of array: Object[][2] Documents and doctypes represent tables where each row describes one document or doctype for which hits were found. Each document entry has the following structure: docId (int), docName (string), hits (int) The doctype entry has this structure: doctypeName (string), hits (int)

Parameters:
resultId - Description of the Parameter
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception
XPathException

getPermissions

HashMap getPermissions(String resource)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

getHits

int getHits(int resultId)
            throws EXistException,
                   PermissionDeniedException
Get the number of hits in the result set identified by it's result-set-id.

Parameters:
resultId - Description of the Parameter
Returns:
The hits value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

retrieve

byte[] retrieve(int resultId,
                int num,
                HashMap parameters)
                throws EXistException,
                       PermissionDeniedException
Retrieve a single result from the result-set identified by resultId. The XML fragment at position num in the result set is returned.

Parameters:
resultId - Description of the Parameter
num - Description of the Parameter
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

retrieveFirstChunk

HashMap retrieveFirstChunk(int resultId,
                           int num,
                           HashMap parameters)
                           throws EXistException,
                                  PermissionDeniedException
Retrieve a single result from the result-set identified by resultId. The XML fragment at position num in the result set is returned. It is fetched the first chunk, and the next ones should be fetched using getNextChunk or getNextExtendedChunk

Parameters:
resultId - Description of the Parameter
num - Description of the Parameter
parameters - a HashMap value
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

setUser

boolean setUser(String name,
                String passwd,
                String digestPassword,
                Vector groups,
                String home)
                throws EXistException,
                       PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

setUser

boolean setUser(String name,
                String passwd,
                String digestPassword,
                Vector groups)
                throws EXistException,
                       PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

setPermissions

boolean setPermissions(String resource,
                       String permissions)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

setPermissions

boolean setPermissions(String resource,
                       int permissions)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

setPermissions

boolean setPermissions(String resource,
                       String owner,
                       String ownerGroup,
                       String permissions)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

setPermissions

boolean setPermissions(String resource,
                       String owner,
                       String ownerGroup,
                       int permissions)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

lockResource

boolean lockResource(String path,
                     String userName)
                     throws EXistException,
                            PermissionDeniedException,
                            URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

unlockResource

boolean unlockResource(String path)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

hasUserLock

String hasUserLock(String path)
                   throws EXistException,
                          PermissionDeniedException,
                          URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

getUser

HashMap getUser(String name)
                throws EXistException,
                       PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

getUsers

Vector getUsers()
                throws EXistException,
                       PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

removeUser

boolean removeUser(String name)
                   throws EXistException,
                          PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

getGroups

Vector getGroups()
                 throws EXistException,
                        PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

getIndexedElements

Vector getIndexedElements(String collectionName,
                          boolean inclusive)
                          throws EXistException,
                                 PermissionDeniedException,
                                 URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

scanIndexTerms

Vector scanIndexTerms(String collectionName,
                      String start,
                      String end,
                      boolean inclusive)
                      throws PermissionDeniedException,
                             EXistException,
                             URISyntaxException
Throws:
PermissionDeniedException
EXistException
URISyntaxException

scanIndexTerms

Vector scanIndexTerms(String xpath,
                      String start,
                      String end)
                      throws PermissionDeniedException,
                             EXistException,
                             XPathException
Throws:
PermissionDeniedException
EXistException
XPathException

releaseQueryResult

boolean releaseQueryResult(int handle)

releaseQueryResult

boolean releaseQueryResult(int handle,
                           int hash)

xupdate

int xupdate(String collectionName,
            byte[] xupdate)
            throws PermissionDeniedException,
                   EXistException,
                   SAXException,
                   XPathException,
                   LockException
Throws:
PermissionDeniedException
EXistException
SAXException
XPathException
LockException

xupdateResource

int xupdateResource(String resource,
                    byte[] xupdate)
                    throws PermissionDeniedException,
                           EXistException,
                           SAXException
Throws:
PermissionDeniedException
EXistException
SAXException

xupdateResource

int xupdateResource(String resource,
                    byte[] xupdate,
                    String encoding)
                    throws PermissionDeniedException,
                           EXistException,
                           SAXException,
                           XPathException,
                           LockException,
                           URISyntaxException
Throws:
PermissionDeniedException
EXistException
SAXException
XPathException
LockException
URISyntaxException

getCreationDate

Date getCreationDate(String collectionName)
                     throws PermissionDeniedException,
                            EXistException,
                            URISyntaxException
Throws:
PermissionDeniedException
EXistException
URISyntaxException

getTimestamps

Vector getTimestamps(String documentName)
                     throws PermissionDeniedException,
                            EXistException,
                            URISyntaxException
Throws:
PermissionDeniedException
EXistException
URISyntaxException

copyCollection

boolean copyCollection(String name,
                       String namedest)
                       throws PermissionDeniedException,
                              EXistException
Throws:
PermissionDeniedException
EXistException

getDocumentChunk

List getDocumentChunk(String name,
                      HashMap parameters)
                      throws EXistException,
                             PermissionDeniedException,
                             IOException
Throws:
EXistException
PermissionDeniedException
IOException

getDocumentChunk

byte[] getDocumentChunk(String name,
                        int start,
                        int stop)
                        throws EXistException,
                               PermissionDeniedException,
                               IOException
Throws:
EXistException
PermissionDeniedException
IOException

moveCollection

boolean moveCollection(String collectionPath,
                       String destinationPath,
                       String newName)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

moveResource

boolean moveResource(String docPath,
                     String destinationPath,
                     String newName)
                     throws EXistException,
                            PermissionDeniedException,
                            URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

copyCollection

boolean copyCollection(String collectionPath,
                       String destinationPath,
                       String newName)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

copyResource

boolean copyResource(String docPath,
                     String destinationPath,
                     String newName)
                     throws EXistException,
                            PermissionDeniedException,
                            URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

reindexCollection

boolean reindexCollection(String name)
                          throws EXistException,
                                 PermissionDeniedException,
                                 URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

backup

boolean backup(String userbackup,
               String password,
               String destcollection,
               String collection)
               throws EXistException,
                      PermissionDeniedException
Throws:
EXistException
PermissionDeniedException

dataBackup

boolean dataBackup(String dest)
                   throws PermissionDeniedException
Throws:
PermissionDeniedException

isValid

boolean isValid(String name)
                throws EXistException,
                       PermissionDeniedException,
                       URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException

getDocType

Vector getDocType(String documentName)
                  throws PermissionDeniedException,
                         EXistException,
                         URISyntaxException
Throws:
PermissionDeniedException
EXistException
URISyntaxException

setDocType

boolean setDocType(String documentName,
                   String doctypename,
                   String publicid,
                   String systemid)
                   throws EXistException,
                          PermissionDeniedException,
                          URISyntaxException
Throws:
EXistException
PermissionDeniedException
URISyntaxException


Copyright (C) Wolfgang Meier. All rights reserved.