diff software/eXist/mpdl-modules/src/de/mpg/mpiwg/berlin/mpdl/xmlrpc/MpdlXmlRpcInterface.java @ 0:408254cf2f1d

Erstellung
author Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
date Wed, 24 Nov 2010 17:24:23 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/software/eXist/mpdl-modules/src/de/mpg/mpiwg/berlin/mpdl/xmlrpc/MpdlXmlRpcInterface.java	Wed Nov 24 17:24:23 2010 +0100
@@ -0,0 +1,76 @@
+package de.mpg.mpiwg.berlin.mpdl.xmlrpc;
+
+import de.mpg.mpiwg.berlin.mpdl.exception.ApplicationException;
+
+public interface MpdlXmlRpcInterface {
+  /**
+   * Get all document names of a collection (without subcollections)
+   * @param collection
+   * @return string array of document names e.g. {"/db/test/test1.xml", "/db/test/test1.xml"}
+   */
+  public String[] getDocumentNames(String collection) throws ApplicationException;
+
+  /**
+   * Read a document of a collection into a local file
+   * @param collection  collection name e.g. /db/test
+   * @param documentName  document name in the collection e.g. test.xml 
+   * @param localFile  file name (with file path) to which the document has to be stored
+   * @return true if document is read into local file else false
+   */
+  public boolean readDocumentIntoLocalFile(String collection, String documentName, String localFile) throws ApplicationException;
+  
+  /**
+   * Save a local file into a collection. If a document with that name already exists in that collection it is overwritten.
+   * @param collection  collection name e.g. /db/test
+   * @param documentName  document name in the collection where the document should be saved e.g. test.xml 
+   * @param localFile  file name (with file path) of the origin from where the document should be saved into the collection
+   * @return true if the local file is saved in collection else false
+   */
+  public boolean saveDocument(String collection, String documentName, String localFile) throws ApplicationException;
+  
+  /**
+   * Save all local files of a directory (without subdirectories) into a collection. Existing documents with same name in that collection are overwritten.
+   * @param collection  collection name e.g. /db/test
+   * @param localFileDirectory  directory name of the origin from where the documents should be saved recursively into the exist collection
+   * @return true if all local files in localFileDirectory are saved in collection else false
+   */
+  public boolean saveDocuments(String collection, String localFileDirectory) throws ApplicationException;
+  
+  /**
+   * Save all local files of a directory with the fileExtension (without subdirectories) into a collection. Existing documents with same name in that collection are overwritten.
+   * @param collection  collection name e.g. /db/test
+   * @param localFileDirectory  directory name of the origin from where the documents should be saved recursively into the exist collection
+   * @param fileExtension file extension name: e.g. xml
+   * @return true if all local files in localFileDirectory are saved in collection else false
+   */
+  public boolean saveDocuments(String collection, String localFileDirectory, String fileExtension) throws ApplicationException;
+  /**
+   * Delete all documents of a collection
+   * @param collection  collection name e.g. /db/test
+   * @return true if all documents in that collection could be deleted else false
+   */
+  public boolean deleteDocuments(String collection) throws ApplicationException;
+  
+  /**
+   * Delete a document of a collection
+   * @param collection  collection name e.g. /db/test
+   * @param documentName  document name in the collection e.g. test.xml 
+   * @return true if document could be deleted else false
+   */
+  public boolean deleteDocument(String collection, String documentName) throws ApplicationException;
+  
+  /**
+   * Create the collection
+   * @param collection e.g. /db/test
+   * @return true if collection could be created else false
+   */
+  public boolean createCollection(String collection) throws ApplicationException;
+  
+  /**
+   * Deletes the collection with all documents and subcollections
+   * @param collection  collection name e.g. /db/test
+   * @return true if collection could be deleted else false
+   */
+  public boolean deleteCollection(String collection) throws ApplicationException;
+
+}