Interface DocumentServiceLocal


public interface DocumentServiceLocal
Interface for a document service class.

Since:
4.5.0-object-storage
  • Method Details

    • getDocumentById

      Optional<Document> getDocumentById(DocumentId documentId)
      Parameters:
      documentId - id of the document
      Returns:
      document object
    • createDocumentQuery

      DocumentQuery createDocumentQuery()
      Creates a new DocumentQuery for querying documents.
      Returns:
      a new DocumentQuery instance
    • duplicateDocument

      DocumentId duplicateDocument(DocumentId documentId, PublicationId destinationPublicationId, String name, boolean tryToUseDocumentTemplate) throws DocumentServiceException
      Duplicates a document
      Parameters:
      documentId - id of the (source) document to duplicate
      destinationPublicationId - id of the destination publication
      name - new name of the document or empty for the same name
      tryToUseDocumentTemplate - create a new document based on the document template from the source document
      Returns:
      id of the new created (duplicated) document
      Throws:
      DocumentServiceException
    • createDocumentFromTemplate

      DocumentId createDocumentFromTemplate(PublicationId parentPublicationId, DocumentId documentTemplateId, String newDocumentName, String masterPage) throws DocumentServiceException
      Creates a new document from document template
      Parameters:
      parentPublicationId - id of the destination publication
      documentTemplateId - id of the document template
      newDocumentName - name of the new document
      masterPage - master page of document template
      Returns:
      id of the new created document
      Throws:
      DocumentServiceException
    • createMultipleDocumentsFromTemplate

      List<DocumentId> createMultipleDocumentsFromTemplate(PublicationId parentPublicationId, DocumentId documentTemplateId, List<String> newDocumentNames, String masterPage) throws DocumentServiceException
      Creates multiple documents from document template
      Parameters:
      parentPublicationId - id of the destination publication
      documentTemplateId - id of the document template
      newDocumentNames - list of names of the new documents
      masterPage - master page of document template
      Returns:
      id of the new created document
      Throws:
      DocumentServiceException
    • update

      void update(Document document) throws DocumentServiceException
      Updates an existing document
      Parameters:
      document - the document to update
      Throws:
      DocumentServiceException
    • update

      void update(List<Document> documents) throws DocumentServiceException
      Updates existing documents
      Parameters:
      documents - list of the documents to update
      Throws:
      DocumentServiceException
    • delete

      void delete(DocumentId documentId) throws DocumentServiceException
      Deletes an existing document. It is a soft deletion - moving a document to the trash
      Parameters:
      documentId - the id of the document to delete
      Throws:
      DocumentServiceException
    • createDocumentParameterQuery

      default DocumentParameterQuery createDocumentParameterQuery()
      Creates a new DocumentParameterQuery for querying document parameters.
      Returns:
      a new DocumentParameterQuery instance
      Throws:
      NotImplementedException - if the method is not implemented
    • getDocumentParameterById

      default Optional<DocumentParameter> getDocumentParameterById(ParameterId parameterId)
      Retrieves a document parameter by its ID.
      Parameters:
      parameterId - the ID of the document parameter
      Returns:
      an Optional containing the document parameter if found, or an empty Optional if not
      Throws:
      NotImplementedException - if the method is not implemented
    • updateDocumentParameter

      default void updateDocumentParameter(DocumentParameter documentParameter)
      Updates an existing document parameter.
      Parameters:
      documentParameter - the document parameter to update
      Throws:
      NotImplementedException - if the method is not implemented
    • updateDocumentParameters

      default void updateDocumentParameters(List<DocumentParameter> documentParameters)
      Updates a list of document parameters.
      Parameters:
      documentParameters - the list of document parameters to update
      Throws:
      NotImplementedException - if the method is not implemented