Interface PageContentService
- All Superinterfaces:
ContentService
- All Known Implementing Classes:
PageContentServiceImpl
A service to read the content of a page and also to do all changes and to publish a page.
-
Method Summary
Modifier and TypeMethodDescriptionaddSection
(PrimaryKey pageKey, String containerName, Section section) Add a new section.addSnipped
(PrimaryKey contentToSectionKey, String snippedName) Create a new snippet from an ordinary section.void
copySnippetIntoPage
(PrimaryKey contentToSectionKey) Converts an inserted snippet into an ordinary section.void
deleteSection
(PrimaryKey contentToSectionKey) Delete a section.void
deleteSnipped
(PrimaryKey snippedKey) getAvailableContentStatuses
(PrimaryKey contentToSectionKey) getEditContent
(PageNode pageNode, String requestUrl) Get the content of a page to edit.getPreviewContent
(PageNode pageNode, String requestUrl) getPublishedContent
(PageNode pageNode, String requestUrl) Get the published content of a page.Get a list of all snippets.insertSnippet
(PrimaryKey pageKey, String containerName, PrimaryKey snippetKey) Insert an existing snippet in a page.void
moveSection
(PrimaryKey contentToSectionKey, String containerName, int position) Move a section to a new position within the same page.void
setHiddenStates
(PrimaryKey contentToSectionKey, Set<String> hiddenStates) void
setSectionVisibilities
(PrimaryKey contentToSectionKey, SectionVisibility[] sectionVisibilities) updateSection
(Section section) Update the content of a section.Methods inherited from interface ch.tocco.nice2.dms.spi.content.ContentService
publish, publishAll, revert, revertAll, setChanged, unpublish, unpublishAll
-
Method Details
-
getEditContent
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
-
getPublishedContent
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
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
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
Delete a section.- Parameters:
contentToSectionKey
- The key of the Page_content_to_section entity.- Throws:
PageContentException
- If an error occurs.
-
moveSection
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
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
Get a list of all snippets.- Returns:
- a list of all snippets.
- Throws:
PageContentException
- If an error occurs.
-
insertSnippet
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
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
-
setHiddenStates
-
getAvailableContentStatuses
-
setSectionVisibilities
void setSectionVisibilities(PrimaryKey contentToSectionKey, SectionVisibility[] sectionVisibilities)
-