Class DocumentRevisionClientImpl
- java.lang.Object
-
- com.lexmark.saperion.client.implementation.document.DocumentRevisionClientImpl
-
- All Implemented Interfaces:
DocumentRevisionClient
public class DocumentRevisionClientImpl extends java.lang.Object implements DocumentRevisionClient
This is the default implementation ofDocumentRevisionClient
.- Author:
- jschwarz
-
-
Constructor Summary
Constructors Constructor Description DocumentRevisionClientImpl(com.lexmark.saperion.document.DocumentService documentService, com.lexmark.saperion.document.DocumentRevisionReferenceType reference)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
This method deletes the specified document.DocumentElementClient
getElement(com.lexmark.saperion.document.DocumentElementReferenceType elementReference)
This method returns the document element client for the given document element id.com.lexmark.saperion.document.DocumentRevisionType
load()
This method loads a document revision with its content.com.lexmark.saperion.document.DocumentRevisionType
loadMetadata()
This method loads a document revision without its content.void
purge()
This method removes every revision of this document as well as every element of those revisions.SearchClient<com.lexmark.saperion.PropertyType>
searchMultiValueField(java.lang.String fieldName)
This method returns a search client for the content of the given multi value field of the given document revision.com.lexmark.saperion.document.DocumentStoreInformationType
update(com.lexmark.saperion.document.DocumentElementType documentElement)
This is a shorthand forupdate(Collections.<String, PropertyType> emptyMap(), documentElement)
updating only the document element and leaving the index data untouched.com.lexmark.saperion.document.DocumentStoreInformationType
update(com.lexmark.saperion.document.UpdateDocumentInputType properties)
This method updates the document with the given properties containing index-data, structure-data and ACLs.com.lexmark.saperion.document.DocumentStoreInformationType
update(java.util.Map<java.lang.String,com.lexmark.saperion.PropertyType> indexData)
This is a shorthand forupdate(indexData, null)
updating only the index data and leaving the document structure untouched.com.lexmark.saperion.document.DocumentStoreInformationType
update(java.util.Map<java.lang.String,com.lexmark.saperion.PropertyType> indexData, com.lexmark.saperion.document.DocumentElementType documentElement)
This method updates the document instance and replaces the document with the given entity.void
writeFulltextData(java.lang.String fieldName, java.io.InputStream data)
This method adds fulltext data to the specified field without creating a new revision.
-
-
-
Method Detail
-
loadMetadata
public com.lexmark.saperion.document.DocumentRevisionType loadMetadata() throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:DocumentRevisionClient
This method loads a document revision without its content.- Specified by:
loadMetadata
in interfaceDocumentRevisionClient
- Returns:
- the document revision without its content
- Throws:
com.lexmark.saperion.exceptions.EcmException
- indicates that a system exception occurred
-
load
public com.lexmark.saperion.document.DocumentRevisionType load() throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:DocumentRevisionClient
This method loads a document revision with its content.- Specified by:
load
in interfaceDocumentRevisionClient
- Returns:
- the complete document revision
- Throws:
com.lexmark.saperion.exceptions.EcmException
- indicates that a system exception occurred
-
delete
public void delete() throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:DocumentRevisionClient
This method deletes the specified document.- Specified by:
delete
in interfaceDocumentRevisionClient
- Throws:
com.lexmark.saperion.exceptions.EcmException
- indicates that a system exception occurred
-
update
public com.lexmark.saperion.document.DocumentStoreInformationType update(java.util.Map<java.lang.String,com.lexmark.saperion.PropertyType> indexData, com.lexmark.saperion.document.DocumentElementType documentElement) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:DocumentRevisionClient
This method updates the document instance and replaces the document with the given entity.- Specified by:
update
in interfaceDocumentRevisionClient
- Parameters:
indexData
- the index data changes of the documentdocumentElement
- the new document root structure- Throws:
com.lexmark.saperion.exceptions.EcmException
- indicates that a system exception occurred
-
update
public com.lexmark.saperion.document.DocumentStoreInformationType update(com.lexmark.saperion.document.DocumentElementType documentElement) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:DocumentRevisionClient
This is a shorthand forupdate(Collections.<String, PropertyType> emptyMap(), documentElement)
updating only the document element and leaving the index data untouched.- Specified by:
update
in interfaceDocumentRevisionClient
- Parameters:
documentElement
- the new document root structure- Throws:
com.lexmark.saperion.exceptions.EcmException
-
update
public com.lexmark.saperion.document.DocumentStoreInformationType update(java.util.Map<java.lang.String,com.lexmark.saperion.PropertyType> indexData) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:DocumentRevisionClient
This is a shorthand forupdate(indexData, null)
updating only the index data and leaving the document structure untouched.- Specified by:
update
in interfaceDocumentRevisionClient
- Parameters:
indexData
- the index data changes of the document- Throws:
com.lexmark.saperion.exceptions.EcmException
-
update
public com.lexmark.saperion.document.DocumentStoreInformationType update(com.lexmark.saperion.document.UpdateDocumentInputType properties) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:DocumentRevisionClient
This method updates the document with the given properties containing index-data, structure-data and ACLs.- Specified by:
update
in interfaceDocumentRevisionClient
- Parameters:
properties
- the properties to update- Returns:
- information about the new revision
- Throws:
com.lexmark.saperion.exceptions.EcmException
- when updating the document failed
-
writeFulltextData
public void writeFulltextData(java.lang.String fieldName, java.io.InputStream data) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:DocumentRevisionClient
This method adds fulltext data to the specified field without creating a new revision. The field must be a fulltext-enabled text field. Note that fulltext data is stored in the database only.- Specified by:
writeFulltextData
in interfaceDocumentRevisionClient
- Parameters:
fieldName
- the name of the field used to store fulltext datadata
- the fulltext data- Throws:
com.lexmark.saperion.exceptions.EcmException
- when writing the data failed
-
searchMultiValueField
public SearchClient<com.lexmark.saperion.PropertyType> searchMultiValueField(java.lang.String fieldName) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:DocumentRevisionClient
This method returns a search client for the content of the given multi value field of the given document revision.- Specified by:
searchMultiValueField
in interfaceDocumentRevisionClient
- Parameters:
fieldName
- the name of the multi value field- Returns:
- a search client for the content of the given multi value field of the given document revision
- Throws:
com.lexmark.saperion.exceptions.EcmException
-
getElement
public DocumentElementClient getElement(com.lexmark.saperion.document.DocumentElementReferenceType elementReference) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:DocumentRevisionClient
This method returns the document element client for the given document element id.- Specified by:
getElement
in interfaceDocumentRevisionClient
- Parameters:
elementReference
- the document element reference- Returns:
- the document element client for the given document element id
- Throws:
com.lexmark.saperion.exceptions.EcmException
-
purge
public void purge() throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:DocumentRevisionClient
This method removes every revision of this document as well as every element of those revisions. This operation cannot be undone.- Specified by:
purge
in interfaceDocumentRevisionClient
- Throws:
com.lexmark.saperion.exceptions.EcmException
-
-