Class PageContentServiceImpl
java.lang.Object
ch.tocco.nice2.optional.cms.impl.content.PageContentServiceImpl
- All Implemented Interfaces:
ContentService
,PageContentService
-
Constructor Summary
ConstructorDescriptionPageContentServiceImpl
(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.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
publish
(PrimaryKey pageKey) Publish current content of the node.void
publishAll
(PrimaryKey key, String entityName) Publish current content of the node and his child nodes.void
revert
(PrimaryKey pageKey) Revert the pending changes.void
revertAll
(PrimaryKey key, String entityName) Revert the pending changes.void
setChanged
(PrimaryKey pageKey) Set node state to changed.void
setHiddenStates
(PrimaryKey contentToSectionKey, Set<String> hiddenStates) void
setSectionVisibilities
(PrimaryKey contentToSectionKey, SectionVisibility[] sectionVisibilities) void
unpublish
(PrimaryKey pageKey) Set node state to offline and delete published contentvoid
unpublishAll
(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:PageContentService
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.- Specified by:
getEditContent
in 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:
getPreviewContent
in interfacePageContentService
-
getPublishedContent
Description copied from interface:PageContentService
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.- Specified by:
getPublishedContent
in 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:PageContentService
Add a new section.- Specified by:
addSection
in 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:PageContentService
Update the content of a section.- Specified by:
updateSection
in interfacePageContentService
- Parameters:
section
- The section to update.Section.key
must not be null.- Returns:
- the updated section.
-
deleteSection
Description copied from interface:PageContentService
Delete a section.- Specified by:
deleteSection
in interfacePageContentService
- Parameters:
contentToSectionKey
- The key of the Page_content_to_section entity.
-
moveSection
Description copied from interface:PageContentService
Move a section to a new position within the same page.- Specified by:
moveSection
in 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:PageContentService
Create a new snippet from an ordinary section.- Specified by:
addSnipped
in 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:PageContentService
Get a list of all snippets.- Specified by:
getSnippets
in interfacePageContentService
- Returns:
- a list of all snippets.
-
insertSnippet
Description copied from interface:PageContentService
Insert an existing snippet in a page.- Specified by:
insertSnippet
in 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:PageContentService
Converts an inserted snippet into an ordinary section. The snippet entity itself remains.- Specified by:
copySnippetIntoPage
in interfacePageContentService
- Parameters:
contentToSectionKey
- The key of the Page_content_to_section entity.
-
deleteSnipped
- Specified by:
deleteSnipped
in interfacePageContentService
-
setHiddenStates
- Specified by:
setHiddenStates
in interfacePageContentService
-
getAvailableContentStatuses
- Specified by:
getAvailableContentStatuses
in interfacePageContentService
-
setSectionVisibilities
public void setSectionVisibilities(PrimaryKey contentToSectionKey, SectionVisibility[] sectionVisibilities) - Specified by:
setSectionVisibilities
in interfacePageContentService
-
publish
Description copied from interface:ContentService
Publish current content of the node.- Specified by:
publish
in interfaceContentService
- Parameters:
pageKey
- The key of the node to publish.
-
publishAll
Description copied from interface:ContentService
Publish current content of the node and his child nodes.- Specified by:
publishAll
in interfaceContentService
- Parameters:
key
- The key.entityName
- The entityName, Domain or Page for example.
-
revert
Description copied from interface:ContentService
Revert the pending changes.- Specified by:
revert
in interfaceContentService
- Parameters:
pageKey
- The key of the node.
-
revertAll
Description copied from interface:ContentService
Revert the pending changes.- Specified by:
revertAll
in interfaceContentService
- Parameters:
key
- The key.entityName
- The entityName, Domain or Page for example.
-
unpublish
Description copied from interface:ContentService
Set node state to offline and delete published content- Specified by:
unpublish
in interfaceContentService
- Parameters:
pageKey
- The key of the node.
-
unpublishAll
Description copied from interface:ContentService
Set node state of the current node and all his children to offline.- Specified by:
unpublishAll
in interfaceContentService
- Parameters:
key
- The key.entityName
- The entityName, Domain or Page for example.
-
setChanged
Description copied from interface:ContentService
Set node state to changed.- Specified by:
setChanged
in interfaceContentService
- Parameters:
pageKey
- The key of the node.
-