Class PageContentServiceImpl
java.lang.Object
ch.tocco.nice2.optional.cms.impl.content.PageContentServiceImpl
- All Implemented Interfaces:
ContentService, PageContentService
-
Constructor Summary
ConstructorsConstructorDescriptionPageContentServiceImpl(CommandExecutor commandExecutor, CascadingDeleteService cascadingDeleteService, QueryBuilderFactory queryBuilderFactory, ContentTreeService contentTreeService, CopyWidgetConfigService copyWidgetConfigService, SecurityManager securityManager, ClientQuestionService clientQuestionService, ContentReferenceParseService contentReferenceParseService, TextResources textResources, WidgetService widgetService) -
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.voidcopySnippetIntoPage(PrimaryKey contentToSectionKey) Converts an inserted snippet into an ordinary section.voiddeleteSection(PrimaryKey contentToSectionKey) Delete a section.voiddeleteSnipped(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.voidmoveSection(PrimaryKey contentToSectionKey, String containerName, int position) Move a section to a new position within the same page.voidpublish(PrimaryKey pageKey) Publish current content of the node.voidpublishAll(PrimaryKey key, String entityName) Publish current content of the node and his child nodes.voidrevert(PrimaryKey pageKey) Revert the pending changes.voidrevertAll(PrimaryKey key, String entityName) Revert the pending changes.voidsetChanged(PrimaryKey pageKey) Set node state to changed.voidsetHiddenStates(PrimaryKey contentToSectionKey, Set<String> hiddenStates) voidsetSectionVisibilities(PrimaryKey contentToSectionKey, SectionVisibility[] sectionVisibilities) voidunpublish(PrimaryKey pageKey) Set node state to offline and delete published contentvoidunpublishAll(PrimaryKey key, String entityName) Set node state of the current node and all his children to offline.updateSection(Section section) Update the content of a section.
-
Constructor Details
-
PageContentServiceImpl
public PageContentServiceImpl(CommandExecutor commandExecutor, CascadingDeleteService cascadingDeleteService, QueryBuilderFactory queryBuilderFactory, ContentTreeService contentTreeService, CopyWidgetConfigService copyWidgetConfigService, SecurityManager securityManager, ClientQuestionService clientQuestionService, ContentReferenceParseService contentReferenceParseService, TextResources textResources, WidgetService widgetService)
-
-
Method Details
-
getEditContent
Description copied from interface:PageContentServiceGet 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.- Specified by:
getEditContentin interfacePageContentService- Parameters:
pageNode- The page to get the content from.requestUrl- Url which got requested- Returns:
- The edit content of the page.
- See Also:
-
getPreviewContent
- Specified by:
getPreviewContentin interfacePageContentService
-
getPublishedContent
Description copied from interface:PageContentServiceGet 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.- Specified by:
getPublishedContentin interfacePageContentService- Parameters:
pageNode- The page to get the content from.requestUrl- Url which got requested- Returns:
- The published content of the page.
- See Also:
-
addSection
Description copied from interface:PageContentServiceAdd a new section.- Specified by:
addSectionin interfacePageContentService- Parameters:
pageKey- The key of the page.containerName- The name of the container.section- The section to add.- Returns:
- the created section.
-
updateSection
Description copied from interface:PageContentServiceUpdate the content of a section.- Specified by:
updateSectionin interfacePageContentService- Parameters:
section- The section to update.Section.keymust not be null.- Returns:
- the updated section.
-
deleteSection
Description copied from interface:PageContentServiceDelete a section.- Specified by:
deleteSectionin interfacePageContentService- Parameters:
contentToSectionKey- The key of the Page_content_to_section entity.
-
moveSection
Description copied from interface:PageContentServiceMove a section to a new position within the same page.- Specified by:
moveSectionin interfacePageContentService- 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).
-
addSnipped
Description copied from interface:PageContentServiceCreate a new snippet from an ordinary section.- Specified by:
addSnippedin interfacePageContentService- 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.
-
getSnippets
Description copied from interface:PageContentServiceGet a list of all snippets.- Specified by:
getSnippetsin interfacePageContentService- Returns:
- a list of all snippets.
-
insertSnippet
Description copied from interface:PageContentServiceInsert an existing snippet in a page.- Specified by:
insertSnippetin interfacePageContentService- 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.
-
copySnippetIntoPage
Description copied from interface:PageContentServiceConverts an inserted snippet into an ordinary section. The snippet entity itself remains.- Specified by:
copySnippetIntoPagein interfacePageContentService- Parameters:
contentToSectionKey- The key of the Page_content_to_section entity.
-
deleteSnipped
- Specified by:
deleteSnippedin interfacePageContentService
-
setHiddenStates
- Specified by:
setHiddenStatesin interfacePageContentService
-
getAvailableContentStatuses
- Specified by:
getAvailableContentStatusesin interfacePageContentService
-
setSectionVisibilities
public void setSectionVisibilities(PrimaryKey contentToSectionKey, SectionVisibility[] sectionVisibilities) - Specified by:
setSectionVisibilitiesin interfacePageContentService
-
publish
Description copied from interface:ContentServicePublish current content of the node.- Specified by:
publishin interfaceContentService- Parameters:
pageKey- The key of the node to publish.
-
publishAll
Description copied from interface:ContentServicePublish current content of the node and his child nodes.- Specified by:
publishAllin interfaceContentService- Parameters:
key- The key.entityName- The entityName, Domain or Page for example.
-
revert
Description copied from interface:ContentServiceRevert the pending changes.- Specified by:
revertin interfaceContentService- Parameters:
pageKey- The key of the node.
-
revertAll
Description copied from interface:ContentServiceRevert the pending changes.- Specified by:
revertAllin interfaceContentService- Parameters:
key- The key.entityName- The entityName, Domain or Page for example.
-
unpublish
Description copied from interface:ContentServiceSet node state to offline and delete published content- Specified by:
unpublishin interfaceContentService- Parameters:
pageKey- The key of the node.
-
unpublishAll
Description copied from interface:ContentServiceSet node state of the current node and all his children to offline.- Specified by:
unpublishAllin interfaceContentService- Parameters:
key- The key.entityName- The entityName, Domain or Page for example.
-
setChanged
Description copied from interface:ContentServiceSet node state to changed.- Specified by:
setChangedin interfaceContentService- Parameters:
pageKey- The key of the node.
-