Interface PublicationServiceLocal


public interface PublicationServiceLocal
Interface for a publication service class.

Since:
4.5.0-object-storage
  • Method Details

    • createPublicationQuery

      PublicationQuery createPublicationQuery()
      Creates a new PublicationQuery for querying publications.
      Returns:
      a new PublicationQuery instance
    • duplicatePublication

      PublicationId duplicatePublication(PublicationId publicationId, PublicationId destinationParentPublicationId, String name, boolean tryToUseDocumentTemplate)
      Duplicates a publication with documents and subpublications
      Parameters:
      publicationId - id of the publication to duplicate
      destinationParentPublicationId - id of the destination publication
      name - new name of the publication or empty for the same name
      tryToUseDocumentTemplate - duplicates documents within publication(s) based on the document template from the source document
      Returns:
      id of the new created (duplicated) publication
    • duplicateSinglePublication

      default PublicationId duplicateSinglePublication(PublicationId publicationId, PublicationId destinationParentPublicationId, String name, boolean duplicateDocuments, boolean tryToUseDocumentTemplate)
      Duplicates a publication with/without documents
      Parameters:
      publicationId - id of the publication to duplicate
      destinationParentPublicationId - id of the destination publication
      name - new name of the publication or empty for the same name
      duplicateDocuments - if true then documents are duplicated
      tryToUseDocumentTemplate - duplicates documents within publication(s) based on the document template from the source document
      Returns:
      id of the new created (duplicated) publication
    • createPublication

      PublicationId createPublication(PublicationId parentPublicationId, String label, String description, PublicationTypeId publicationTypeId)
      Creates a new publication
      Parameters:
      parentPublicationId - id of the parent publication
      label - publication label
      description - publication description
      publicationTypeId - publication type id
      Returns:
      id of the new created publication
    • isPublicationTypeInUse

      boolean isPublicationTypeInUse(PublicationTypeId publicationTypeId)
      Checks if publication type is used by any publication
      Parameters:
      publicationTypeId - publication type id
      Returns:
      true if it is used, false otherwise
    • update

      default void update(Publication publication) throws PublicationServiceException
      Updates an existing publication
      Parameters:
      publication - the publication to update
      Throws:
      PublicationServiceException
    • update

      default void update(List<Publication> publications) throws PublicationServiceException
      Updates existing publications
      Parameters:
      publications - list of the publications to update
      Throws:
      PublicationServiceException
    • delete

      default void delete(PublicationId publicationId) throws PublicationServiceException
      Deletes an existing publication. It is a soft deletion - moving a publication to the trash
      Parameters:
      publicationId - the id of the publication to delete
      Throws:
      PublicationServiceException
    • getAssignedDocumentTemplates

      default List<Document> getAssignedDocumentTemplates(PublicationId publicationId) throws PublicationServiceException
      Retrieves document templates assigned to the specific publication
      Parameters:
      publicationId - the id of the publication
      Throws:
      PublicationServiceException
    • assignDocumentTemplateToPublication

      default void assignDocumentTemplateToPublication(DocumentId documentTemplateId, PublicationId publicationId) throws PublicationServiceException
      Assigns document template to the publication
      Parameters:
      documentTemplateId - document template id
      publicationId - publication id
      Throws:
      PublicationServiceException
    • unAssignDocumentTemplateFromPublication

      default void unAssignDocumentTemplateFromPublication(DocumentId documentTemplateId, PublicationId publicationId) throws PublicationServiceException
      Un-assigns document template from the publication
      Parameters:
      documentTemplateId - document template id
      publicationId - publication id
      Throws:
      PublicationServiceException
    • assignTemplateToPublication

      default void assignTemplateToPublication(TemplateId templateId, PublicationId publicationId) throws PublicationServiceException
      Assigns template to the publication
      Parameters:
      templateId - template id
      publicationId - publication id
      Throws:
      PublicationServiceException
    • unAssignTemplateFromPublication

      default void unAssignTemplateFromPublication(TemplateId templateId, PublicationId publicationId) throws PublicationServiceException
      Un-assigns template from the publication
      Parameters:
      templateId - template id
      publicationId - publication id
      Throws:
      PublicationServiceException
    • assignPageTemplateToPublication

      default void assignPageTemplateToPublication(PageTemplateId pageTemplateId, PublicationId publicationId) throws PublicationServiceException
      Assigns page template to the publication
      Parameters:
      pageTemplateId - page template id
      publicationId - publication id
      Throws:
      PublicationServiceException
    • unAssignPageTemplateFromPublication

      default void unAssignPageTemplateFromPublication(PageTemplateId pageTemplateId, PublicationId publicationId) throws PublicationServiceException
      Un-assigns page template from the publication
      Parameters:
      pageTemplateId - page template id
      publicationId - publication id
      Throws:
      PublicationServiceException
    • createPublicationParameterQuery

      default PublicationParameterQuery createPublicationParameterQuery()
      Creates a new PublicationParameterQuery for querying publication parameters.
      Returns:
      a new PublicationParameterQuery instance
      Throws:
      NotImplementedException - if the method is not implemented
    • getPublicationParameterById

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

      default void updatePublicationParameter(PublicationParameter publicationParameter)
      Updates an existing publication parameter.
      Parameters:
      publicationParameter - the publication parameter to update
      Throws:
      NotImplementedException - if the method is not implemented
    • updatePublicationParameters

      default void updatePublicationParameters(List<PublicationParameter> publicationParameters)
      Updates a list of publication parameters.
      Parameters:
      publicationParameters - the list of publication parameters to update
      Throws:
      NotImplementedException - if the method is not implemented
    • copyPublicationElements

      default void copyPublicationElements(CopyPublicationElementsParams parameters)
      Copies publication elements from a source publication to a destination publication based on the provided parameters.
      Parameters:
      parameters - the parameters object containing source and destination publication IDs, and flags indicating which elements to copy
      Throws:
      NotImplementedException - if the method is not yet implemented
    • addPublicationParameter

      default Optional<PublicationParameter> addPublicationParameter(PublicationId publicationId, ParameterDefinitionId parameterId, boolean alsoForSubDocuments, boolean recursive) throws PublicationServiceException
      Add parameter to publication.
      Parameters:
      publicationId - the id of publication
      parameterId - the id of parameter to add
      alsoForSubDocuments - if true then parameter should be added also for documents of publication
      recursive - if true then parameter should be added also for subPublications
      Returns:
      an Optional containing the created publication parameter
      Throws:
      NotImplementedException - if the method is not implemented
      PublicationServiceException
    • deletePublicationParameter

      default void deletePublicationParameter(PublicationParameter parameter)
      Delete PublicationParameter.
      Parameters:
      parameter - the parameters object to delete
      Throws:
      NotImplementedException - if the method is not yet implemented
    • permanentlyDeletePublication

      default void permanentlyDeletePublication(PublicationId publicationId) throws PublicationServiceException
      Deletes publication at the specified ID

      Deletes publication and all sub publications of it and all documents from them.

      Parameters:
      publicationId - the id of the publication to delete
      Throws:
      PublicationServiceException
    • restoreDeletedPublication

      default void restoreDeletedPublication(PublicationId publicationId) throws PublicationServiceException
      change "deleted" the flag to "0" publication at the specified ID

      Restore publication and all children from the trash.

      Parameters:
      publicationId - the id of the publication to restore
      Throws:
      PublicationServiceException