Interface PageContentService

All Superinterfaces:
ContentService
All Known Implementing Classes:
PageContentServiceImpl

public interface PageContentService extends ContentService
A service to read the content of a page and also to do all changes and to publish a page.
  • Method Details

    • getEditContent

      PageContent getEditContent(PageNode pageNode, String requestUrl)
      Get the content of a page to edit. Each page has two versions of its content: the one to edit in the backend and the other one, that is published in the frontend.
      Parameters:
      pageNode - The page to get the content from.
      requestUrl - Url which got requested
      Returns:
      The edit content of the page.
      Throws:
      PageContentException - If an error occurs.
      See Also:
    • getPreviewContent

      PageContent getPreviewContent(PageNode pageNode, String requestUrl)
    • getPublishedContent

      Optional<PageContent> getPublishedContent(PageNode pageNode, String requestUrl)
      Get the published content of a page. Each page has two versions of its content: the one to edit in the backend and the other one, that is published in the frontend.
      Parameters:
      pageNode - The page to get the content from.
      requestUrl - Url which got requested
      Returns:
      The published content of the page.
      Throws:
      PageContentException - If an error occurs.
      See Also:
    • addSection

      Section addSection(PrimaryKey pageKey, String containerName, Section section)
      Add a new section.
      Parameters:
      pageKey - The key of the page.
      containerName - The name of the container.
      section - The section to add.
      Returns:
      the created section.
      Throws:
      PageContentException - If an error occurs.
    • updateSection

      Section updateSection(Section section)
      Update the content of a section.
      Parameters:
      section - The section to update. Section.key must not be null.
      Returns:
      the updated section.
      Throws:
      PageContentException - If an error occurs.
    • deleteSection

      void deleteSection(PrimaryKey contentToSectionKey)
      Delete a section.
      Parameters:
      contentToSectionKey - The key of the Page_content_to_section entity.
      Throws:
      PageContentException - If an error occurs.
    • moveSection

      void moveSection(PrimaryKey contentToSectionKey, String containerName, int position)
      Move a section to a new position within the same page.
      Parameters:
      contentToSectionKey - The key of the Page_content_to_section entity.
      containerName - The container to move the section into.
      position - The new position within the given container (starts at 0).
      Throws:
      PageContentException - If an error occurs.
    • addSnipped

      PrimaryKey addSnipped(PrimaryKey contentToSectionKey, String snippedName)
      Create a new snippet from an ordinary section.
      Parameters:
      contentToSectionKey - The key of the Page_content_to_section entity.
      snippedName - The name for the snippet to create.
      Returns:
      the primary ke yof the created Snippet entity.
      Throws:
      PageContentException - If an error occurs.
    • getSnippets

      List<Snippet> getSnippets()
      Get a list of all snippets.
      Returns:
      a list of all snippets.
      Throws:
      PageContentException - If an error occurs.
    • insertSnippet

      PrimaryKey insertSnippet(PrimaryKey pageKey, String containerName, PrimaryKey snippetKey)
      Insert an existing snippet in a page.
      Parameters:
      pageKey - The key of the page.
      containerName - The name of the container.
      snippetKey - The key of the snippet to insert.
      Returns:
      the primary key of the created Page_content_to_section entity.
      Throws:
      PageContentException - If an error occurs.
    • copySnippetIntoPage

      void copySnippetIntoPage(PrimaryKey contentToSectionKey)
      Converts an inserted snippet into an ordinary section. The snippet entity itself remains.
      Parameters:
      contentToSectionKey - The key of the Page_content_to_section entity.
      Throws:
      PageContentException - If an error occurs.
    • deleteSnipped

      void deleteSnipped(PrimaryKey snippedKey)
    • setHiddenStates

      void setHiddenStates(PrimaryKey contentToSectionKey, Set<String> hiddenStates)
    • getAvailableContentStatuses

      List<Template> getAvailableContentStatuses(PrimaryKey contentToSectionKey)
    • setSectionVisibilities

      void setSectionVisibilities(PrimaryKey contentToSectionKey, SectionVisibility[] sectionVisibilities)