Interface DocumentRevisionClient

  • All Known Implementing Classes:
    DocumentRevisionClientImpl

    public interface DocumentRevisionClient
    This client provides read and write functionality to a given revision of a given document. Note that write methods will only work if the revision is the latest one. A ConcurrentWriteException will be thrown otherwise.
    Author:
    jschwarz
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void delete()
      This method deletes the specified document.
      DocumentElementClient getElement​(com.lexmark.saperion.document.DocumentElementReferenceType reference)
      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 for update(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 for update(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

        com.lexmark.saperion.document.DocumentRevisionType loadMetadata()
                                                                 throws com.lexmark.saperion.exceptions.EcmException
        This method loads a document revision without its content.
        Returns:
        the document revision without its content
        Throws:
        com.lexmark.saperion.exceptions.EcmException - indicates that a system exception occurred
      • load

        com.lexmark.saperion.document.DocumentRevisionType load()
                                                         throws com.lexmark.saperion.exceptions.EcmException
        This method loads a document revision with its content.
        Returns:
        the complete document revision
        Throws:
        com.lexmark.saperion.exceptions.EcmException - indicates that a system exception occurred
      • searchMultiValueField

        SearchClient<com.lexmark.saperion.PropertyType> searchMultiValueField​(java.lang.String fieldName)
                                                                       throws com.lexmark.saperion.exceptions.EcmException
        This method returns a search client for the content of the given multi value field of the given document revision.
        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

        DocumentElementClient getElement​(com.lexmark.saperion.document.DocumentElementReferenceType reference)
                                  throws com.lexmark.saperion.exceptions.EcmException
        This method returns the document element client for the given document element id.
        Parameters:
        reference - the document element reference
        Returns:
        the document element client for the given document element id
        Throws:
        com.lexmark.saperion.exceptions.EcmException
      • delete

        void delete()
             throws com.lexmark.saperion.exceptions.EcmException
        This method deletes the specified document.
        Throws:
        com.lexmark.saperion.exceptions.EcmException - indicates that a system exception occurred
      • update

        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
        This method updates the document instance and replaces the document with the given entity.
        Parameters:
        indexData - the index data changes of the document
        documentElement - the new document root structure
        Throws:
        com.lexmark.saperion.exceptions.EcmException - indicates that a system exception occurred
      • update

        com.lexmark.saperion.document.DocumentStoreInformationType update​(com.lexmark.saperion.document.DocumentElementType documentElement)
                                                                   throws com.lexmark.saperion.exceptions.EcmException
        This is a shorthand for update(Collections.<String, PropertyType> emptyMap(), documentElement) updating only the document element and leaving the index data untouched.
        Parameters:
        documentElement - the new document root structure
        Throws:
        com.lexmark.saperion.exceptions.EcmException
      • update

        com.lexmark.saperion.document.DocumentStoreInformationType update​(java.util.Map<java.lang.String,​com.lexmark.saperion.PropertyType> indexData)
                                                                   throws com.lexmark.saperion.exceptions.EcmException
        This is a shorthand for update(indexData, null) updating only the index data and leaving the document structure untouched.
        Parameters:
        indexData - the index data changes of the document
        Throws:
        com.lexmark.saperion.exceptions.EcmException
      • update

        com.lexmark.saperion.document.DocumentStoreInformationType update​(com.lexmark.saperion.document.UpdateDocumentInputType properties)
                                                                   throws com.lexmark.saperion.exceptions.EcmException
        This method updates the document with the given properties containing index-data, structure-data and ACLs.
        Parameters:
        properties - the properties to update
        Returns:
        information about the new revision
        Throws:
        com.lexmark.saperion.exceptions.EcmException - when updating the document failed
      • purge

        void purge()
            throws com.lexmark.saperion.exceptions.EcmException
        This method removes every revision of this document as well as every element of those revisions. This operation cannot be undone.
        Throws:
        com.lexmark.saperion.exceptions.EcmException
      • writeFulltextData

        void writeFulltextData​(java.lang.String fieldName,
                               java.io.InputStream data)
                        throws com.lexmark.saperion.exceptions.EcmException
        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.
        Parameters:
        fieldName - the name of the field used to store fulltext data
        data - the fulltext data
        Throws:
        com.lexmark.saperion.exceptions.EcmException - when writing the data failed