nl.hippo.client.api.service
Class NOPWebdavService

java.lang.Object
  extended by nl.hippo.client.api.service.NOPWebdavService
All Implemented Interfaces:
WebdavService

public class NOPWebdavService
extends Object
implements WebdavService

Convenience NOP implementation of the WebdavService


Constructor Summary
NOPWebdavService()
           
 
Method Summary
 int executeCopy(DocumentPath targetPath, DocumentPath destinationPath, boolean overwrite)
          Execute a webdav COPY.
 int executeDelete(DocumentPath targetPath)
          Execute a webdav DELETE.
 int executeHead(DocumentPath targetPath)
          Execure a webdav HEAD
Checks if the path is available in the repository

 int executeMkCol(DocumentPath targetPath)
          Execute a webdav MKCOL.
 int executeMkCols(DocumentPath targetPath)
          Execute a recursive webdav MKCOL.
 int executeMove(DocumentPath targetPath, DocumentPath destinationPath, boolean overwrite)
          Execute a webdav MOVE.
 RawResponse executePropfind(DocumentPath path)
          Execute a webdav PROPFIND.
 int executePropPatch(DocumentPath targetPath, Property[] propertiesToRemove, Property[] propertiesToSet)
          Execute a webdav PROPPATCH.
 int executePut(DocumentPath path, InputStream putObject)
          Execute a webdav PUT.
 RawResponse executeSearch(DocumentPath path, InputStream dasl)
          Execute a webdav SEARCH.
 RawResponse executeSearch(DocumentPath path, String dasl)
          Execute a webdav SEARCH.
 DocumentCollection fetchCollection(DocumentPath path, InputStream dasl, boolean includeContent)
          Execute a DASL query and (optionally) get the content of all documents in the resultset.
 DocumentCollection fetchCollection(DocumentPath path, String dasl, boolean includeContent)
          Execute a DASL query and (optionally) get the content of all documents in the resultset.
 RawResponse fetchContent(DocumentPath path)
          Fetch document content, this will do a webdav GET.
 RawResponse fetchContentById(String documentId)
          Fetch the content of the document with the specied documentID.
 Document fetchDocument(DocumentPath path)
          Fetch document content and metadata, this will do a webdav GET and a webdav PROPFIND.
 Document fetchDocumentById(String documentId)
          Fetch the content and metadata of the document with the specied documentID.
 FacetCollection fetchFacets(DocumentPath targetPath, InputStream dasl)
          Execute a (Hippo proprietary) webdav FACETS and return the result as a FacetsCollection object structure.
 FacetCollection fetchFacets(DocumentPath targetPath, String dasl)
          Execute a (Hippo proprietary) webdav FACETS and return the result as a FacetsCollection object structure.
 DocumentMetadata fetchMetadata(DocumentPath path)
          Fetch document metadata, this will do a webdav PROPFIND.
 DocumentMetadata fetchMetadataById(String documentId)
          Fetch the metadata of the document with the specied documentID.
 DocumentPath getBasePath()
          Create a DocumentPath pointing to the root node.
 boolean isDocumentIdEnabled()
          Returns true if the documentId feature has been enabled.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NOPWebdavService

public NOPWebdavService()
Method Detail

getBasePath

public DocumentPath getBasePath()
Description copied from interface: WebdavService
Create a DocumentPath pointing to the root node.

Specified by:
getBasePath in interface WebdavService
Returns:
A DocumentPath pointing to the root node

isDocumentIdEnabled

public boolean isDocumentIdEnabled()
Description copied from interface: WebdavService
Returns true if the documentId feature has been enabled.
One of the properties managed by Hippo CMS v6.04 & up, 'UID' is set when a document is created and contains a repository-wide unique Id for that document. If your CMS is v6.04 or higher you can set the documentIdEnabled flag to true (in the WebdavServiceImpl constructor) and use the fetch...ById(String documentId) methods.

Specified by:
isDocumentIdEnabled in interface WebdavService
Returns:
true if the documentId feature has been enabled

fetchDocument

public Document fetchDocument(DocumentPath path)
                       throws ClientException
Description copied from interface: WebdavService
Fetch document content and metadata, this will do a webdav GET and a webdav PROPFIND.

Specified by:
fetchDocument in interface WebdavService
Parameters:
path - Path to the document in the repository
Returns:
A Document object containing content and metadata
Throws:
ClientException - If anything went wrong

fetchDocumentById

public Document fetchDocumentById(String documentId)
                           throws ClientException
Description copied from interface: WebdavService
Fetch the content and metadata of the document with the specied documentID.
One of the properties managed by Hippo CMS v6.04 & up, 'UID' is set when a document is created and contains a repository-wide unique Id for that document.

Specified by:
fetchDocumentById in interface WebdavService
Parameters:
documentId - A document Id
Returns:
A Document with content and metadata if a document with the specified Id exists, null otherwise.
Throws:
ClientException - If anything went wrong

fetchContent

public RawResponse fetchContent(DocumentPath path)
                         throws ClientException
Description copied from interface: WebdavService
Fetch document content, this will do a webdav GET.

Specified by:
fetchContent in interface WebdavService
Parameters:
path - Path to a document in the repository
Returns:
A RawResponse containing the document content
Throws:
ClientException - If anything went wrong

fetchContentById

public RawResponse fetchContentById(String documentId)
                             throws ClientException
Description copied from interface: WebdavService
Fetch the content of the document with the specied documentID.
One of the properties managed by Hippo CMS v6.04 & up, 'UID' is set when a document is created and contains a repository-wide unique Id for that document.

Specified by:
fetchContentById in interface WebdavService
Parameters:
documentId - A document Id
Returns:
The content of the document with the specified Id (if it exists, null otherwise).
Throws:
ClientException - If anything went wrong

fetchMetadata

public DocumentMetadata fetchMetadata(DocumentPath path)
                               throws ClientException
Description copied from interface: WebdavService
Fetch document metadata, this will do a webdav PROPFIND.

Specified by:
fetchMetadata in interface WebdavService
Parameters:
path - Path to a document in the repository
Returns:
A DocumentMetadata object representing the webdav properties of the specified document.
Throws:
ClientException - If anything went wrong

fetchMetadataById

public DocumentMetadata fetchMetadataById(String documentId)
                                   throws ClientException
Description copied from interface: WebdavService
Fetch the metadata of the document with the specied documentID.
One of the properties managed by Hippo CMS v6.04 & up, 'UID' is set when a document is created and contains a repository-wide unique Id for that document.

Specified by:
fetchMetadataById in interface WebdavService
Parameters:
documentId - A document Id
Returns:
The DocumentMetadata of the document with the specified Id (if it exists, null otherwise).
Throws:
ClientException - If anything went wrong

fetchCollection

public DocumentCollection fetchCollection(DocumentPath path,
                                          InputStream dasl,
                                          boolean includeContent)
                                   throws ClientException
Description copied from interface: WebdavService
Execute a DASL query and (optionally) get the content of all documents in the resultset.
This will do a webdav SEARCH and (optionally) a webdav GET for each document in the resultset.

Specified by:
fetchCollection in interface WebdavService
Parameters:
path - The root path from which to run the query
dasl - The DASL query as an InputStream, see Using DASL Queries for information about the DASL syntax.
includeContent - If set to true a GET will be done to get the content for each document.
Returns:
A DocumentCollection respresenting the resultset of the query.
Throws:
ClientException - If anything went wrong

fetchCollection

public DocumentCollection fetchCollection(DocumentPath path,
                                          String dasl,
                                          boolean includeContent)
                                   throws ClientException
Description copied from interface: WebdavService
Execute a DASL query and (optionally) get the content of all documents in the resultset.
This will do a webdav SEARCH and (optionally) a webdav GET for each document in the resultset.

Specified by:
fetchCollection in interface WebdavService
Parameters:
path - The root path from which to run the query
dasl - The DASL query as a String, see Using DASL Queries for information about the DASL syntax.
includeContent - If set to true a GET will be done to get the content for each document.
Returns:
A DocumentCollection with the resultset of the query.
Throws:
ClientException - If anything went wrong

fetchFacets

public FacetCollection fetchFacets(DocumentPath targetPath,
                                   InputStream dasl)
                            throws ClientException
Description copied from interface: WebdavService
Execute a (Hippo proprietary) webdav FACETS and return the result as a FacetsCollection object structure.
See the Hippo custom webdav methods documentation for information about the FACETS method.

Specified by:
fetchFacets in interface WebdavService
Parameters:
targetPath - The root path from which to run the query
dasl - The DASL query as an InputStream, see Using DASL Queries for information about the DASL syntax.
Returns:
A FacetCollection containing the result of the facet search
Throws:
ClientException - If anything went wrong

fetchFacets

public FacetCollection fetchFacets(DocumentPath targetPath,
                                   String dasl)
                            throws ClientException
Description copied from interface: WebdavService
Execute a (Hippo proprietary) webdav FACETS and return the result as a FacetsCollection object structure.
See the Hippo custom webdav methods documentation for information about the FACETS method.

Specified by:
fetchFacets in interface WebdavService
Parameters:
targetPath - The root path from which to run the query
dasl - The DASL query as a String, see Using DASL Queries for information about the DASL syntax.
Returns:
A FacetCollection containing the result of the facet search
Throws:
ClientException - If anything went wrong

executePropfind

public RawResponse executePropfind(DocumentPath path)
                            throws ClientException
Description copied from interface: WebdavService
Execute a webdav PROPFIND.
Fetch all webdav properties (document metadata) of the specied document.

Specified by:
executePropfind in interface WebdavService
Parameters:
path - Path to a document in the repository
Returns:
A RawResponse containing the low-level webdav response
Throws:
ClientException - If anything went wrong

executeSearch

public RawResponse executeSearch(DocumentPath path,
                                 InputStream dasl)
                          throws ClientException
Description copied from interface: WebdavService
Execute a webdav SEARCH.

Specified by:
executeSearch in interface WebdavService
Parameters:
path - The root path from which to run the query
dasl - The DASL query as an InputStream, see Using DASL Queries for information about the DASL syntax.
Returns:
A RawResponse containing the low-level webdav response.
Throws:
ClientException - If anything went wrong

executeSearch

public RawResponse executeSearch(DocumentPath path,
                                 String dasl)
                          throws ClientException
Description copied from interface: WebdavService
Execute a webdav SEARCH.

Specified by:
executeSearch in interface WebdavService
Parameters:
path - The root path from which to run the query
dasl - The DASL query as a String, see Using DASL Queries for information about the DASL syntax.
Returns:
A RawResponse containing the low-level webdav response.
Throws:
ClientException - If anything went wrong

executePut

public int executePut(DocumentPath path,
                      InputStream putObject)
               throws ClientException
Description copied from interface: WebdavService
Execute a webdav PUT.
Add a new document in the repository.

WARNING: This is a write operation and must only be used if you know what you are doing:

Specified by:
executePut in interface WebdavService
Parameters:
path - The path in the repository where to add the new document
putObject - An inputStream on the document to put
Returns:
The Http response code
Throws:
ClientException - If anything went wrong

executePropPatch

public int executePropPatch(DocumentPath targetPath,
                            Property[] propertiesToRemove,
                            Property[] propertiesToSet)
                     throws ClientException
Description copied from interface: WebdavService
Execute a webdav PROPPATCH.
Update the webdav properties (document metadata) of an existing document.

WARNING: This is a write operation and must only be used if you know what you are doing:

Specified by:
executePropPatch in interface WebdavService
Parameters:
targetPath - The path in the repository to the document to update
propertiesToRemove - An array of webdav properties to remove
propertiesToSet - An array of webdav properties to set
Returns:
The Http response code
Throws:
ClientException - If anything went wrong

executeDelete

public int executeDelete(DocumentPath targetPath)
                  throws ClientException
Description copied from interface: WebdavService
Execute a webdav DELETE.
Delete a webdav item (collection or document) in the repository.

Specified by:
executeDelete in interface WebdavService
Parameters:
targetPath - The path in the repository to be deleted
Returns:
The Http response code
Throws:
ClientException - If anything went wrong

executeMkCol

public int executeMkCol(DocumentPath targetPath)
                 throws ClientException
Description copied from interface: WebdavService
Execute a webdav MKCOL.
Add a new webdav collection (folder) in the repository.

Specified by:
executeMkCol in interface WebdavService
Parameters:
targetPath - The path in the repository where to add the new collection.
Returns:
The Http response code
Throws:
ClientException - If anything went wrong

executeMkCols

public int executeMkCols(DocumentPath targetPath)
                  throws ClientException
Description copied from interface: WebdavService
Execute a recursive webdav MKCOL.
Add a new webdav collection (folder) in the repository and its parents if they don't exist.

Specified by:
executeMkCols in interface WebdavService
Parameters:
targetPath - The path in the repository where to add the new collection.
Returns:
The Http response code
Throws:
ClientException - If anything went wrong

executeHead

public int executeHead(DocumentPath targetPath)
                throws ClientException
Description copied from interface: WebdavService
Execure a webdav HEAD
Checks if the path is available in the repository

Specified by:
executeHead in interface WebdavService
Parameters:
targetPath - The path in the reposutory to be checked
Returns:
The Http response code
Throws:
ClientException - If anything went wrong

executeMove

public int executeMove(DocumentPath targetPath,
                       DocumentPath destinationPath,
                       boolean overwrite)
                throws ClientException
Description copied from interface: WebdavService
Execute a webdav MOVE.
Moves or renames a webdav document or collection (folder) in the repository to a new location.

WARNING: This is a write operation and must only be used if you know what you are doing:

Specified by:
executeMove in interface WebdavService
Parameters:
targetPath - The path in the repository which will be moved or renamed.
destinationPath - The path in the repository to where the document or collection will be moved or renamed.
overwrite - True if the destination may be overwritten, false otherwise.
Returns:
The Http response code
Throws:
ClientException - If anything went wrong

executeCopy

public int executeCopy(DocumentPath targetPath,
                       DocumentPath destinationPath,
                       boolean overwrite)
                throws ClientException
Description copied from interface: WebdavService
Execute a webdav COPY.
Copies a webdav document or collection (folder) in the repository to a new location.

WARNING: This is a write operation and must only be used if you know what you are doing:

Specified by:
executeCopy in interface WebdavService
Parameters:
targetPath - The path in the repository which will be moved or renamed.
destinationPath - The path in the repository to where the document or collection will be moved or renamed.
overwrite - True if the destination may be overwritten, false otherwise.
Returns:
The Http response code
Throws:
ClientException - If anything went wrong


Copyright © 2006-2009 Hippo. All Rights Reserved.