nl.hippo.client.api.service
Interface WebdavService

All Known Implementing Classes:
NOPWebdavService

public interface WebdavService

Main interface of the Webdav Client component of the Hippo Repository Java Adapter.


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 docPath)
          Execute a webdav PROPFIND.
 int executePropPatch(DocumentPath targetPath, Property[] propertiesToRemove, Property[] propertiesToSet)
          Execute a webdav PROPPATCH.
 int executePut(DocumentPath targetPath, InputStream putObject)
          Execute a webdav PUT.
 RawResponse executeSearch(DocumentPath targetPath, InputStream dasl)
          Execute a webdav SEARCH.
 RawResponse executeSearch(DocumentPath targetPath, String dasl)
          Execute a webdav SEARCH.
 DocumentCollection fetchCollection(DocumentPath targetPath, InputStream dasl, boolean includeContent)
          Execute a DASL query and (optionally) get the content of all documents in the resultset.
 DocumentCollection fetchCollection(DocumentPath targetPath, String dasl, boolean includeContent)
          Execute a DASL query and (optionally) get the content of all documents in the resultset.
 RawResponse fetchContent(DocumentPath docPath)
          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 docPath)
          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 docPath)
          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.
 

Method Detail

getBasePath

DocumentPath getBasePath()
Create a DocumentPath pointing to the root node.

Returns:
A DocumentPath pointing to the root node

fetchDocument

Document fetchDocument(DocumentPath docPath)
                       throws ClientException
Fetch document content and metadata, this will do a webdav GET and a webdav PROPFIND.

Parameters:
docPath - Path to the document in the repository
Returns:
A Document object containing content and metadata
Throws:
ClientException - If anything went wrong

fetchContent

RawResponse fetchContent(DocumentPath docPath)
                         throws ClientException
Fetch document content, this will do a webdav GET.

Parameters:
docPath - Path to a document in the repository
Returns:
A RawResponse containing the document content
Throws:
ClientException - If anything went wrong

fetchMetadata

DocumentMetadata fetchMetadata(DocumentPath docPath)
                               throws ClientException
Fetch document metadata, this will do a webdav PROPFIND.

Parameters:
docPath - 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

fetchCollection

DocumentCollection fetchCollection(DocumentPath targetPath,
                                   InputStream dasl,
                                   boolean includeContent)
                                   throws ClientException
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.

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.
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

DocumentCollection fetchCollection(DocumentPath targetPath,
                                   String dasl,
                                   boolean includeContent)
                                   throws ClientException
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.

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.
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

FacetCollection fetchFacets(DocumentPath targetPath,
                            InputStream dasl)
                            throws ClientException
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.

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

FacetCollection fetchFacets(DocumentPath targetPath,
                            String dasl)
                            throws ClientException
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.

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

RawResponse executePropfind(DocumentPath docPath)
                            throws ClientException
Execute a webdav PROPFIND.
Fetch all webdav properties (document metadata) of the specied document.

Parameters:
docPath - Path to a document in the repository
Returns:
A RawResponse containing the low-level webdav response
Throws:
ClientException - If anything went wrong

executePut

int executePut(DocumentPath targetPath,
               InputStream putObject)
               throws ClientException
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:

Parameters:
targetPath - 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

executeMkCol

int executeMkCol(DocumentPath targetPath)
                 throws ClientException
Execute a webdav MKCOL.
Add a new webdav collection (folder) in the repository.

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

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

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

executeMove

int executeMove(DocumentPath targetPath,
                DocumentPath destinationPath,
                boolean overwrite)
                throws ClientException
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:

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

int executeCopy(DocumentPath targetPath,
                DocumentPath destinationPath,
                boolean overwrite)
                throws ClientException
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:

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

executeDelete

int executeDelete(DocumentPath targetPath)
                  throws ClientException
Execute a webdav DELETE.
Delete a webdav item (collection or document) in the repository.

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

executeHead

int executeHead(DocumentPath targetPath)
                throws ClientException
Execure a webdav HEAD
Checks if the path is available in the repository

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

executePropPatch

int executePropPatch(DocumentPath targetPath,
                     Property[] propertiesToRemove,
                     Property[] propertiesToSet)
                     throws ClientException
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:

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

executeSearch

RawResponse executeSearch(DocumentPath targetPath,
                          InputStream dasl)
                          throws ClientException
Execute a webdav SEARCH.

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 RawResponse containing the low-level webdav response.
Throws:
ClientException - If anything went wrong

executeSearch

RawResponse executeSearch(DocumentPath targetPath,
                          String dasl)
                          throws ClientException
Execute a webdav SEARCH.

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 RawResponse containing the low-level webdav response.
Throws:
ClientException - If anything went wrong

isDocumentIdEnabled

boolean isDocumentIdEnabled()
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.

Returns:
true if the documentId feature has been enabled

fetchDocumentById

Document fetchDocumentById(String documentId)
                           throws ClientException
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.

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

fetchMetadataById

DocumentMetadata fetchMetadataById(String documentId)
                                   throws ClientException
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.

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

fetchContentById

RawResponse fetchContentById(String documentId)
                             throws ClientException
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.

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


Copyright © 2006-2009 Hippo. All Rights Reserved.