Class DefaultPageService
- java.lang.Object
-
- com.atlassian.confluence.content.service.DefaultPageService
-
- All Implemented Interfaces:
PageService
public class DefaultPageService extends Object implements PageService
-
-
Constructor Summary
Constructors Constructor Description DefaultPageService(PageManager pageManager, PermissionManager permissionManager, ContentPermissionManager contentPermissionManager, DraftService draftService, AttachmentManager attachmentManager, NotificationManager notificationManager, com.atlassian.event.api.EventPublisher eventPublisher, ContentPropertyManager contentPropertyManager, LabelManager labelManager, com.google.common.base.Supplier<DraftsTransitionHelper> draftsTransitionHelperSupplier, MovePageCommandHelper movePageCommandHelper)DefaultPageService(PageManager pageManager, PermissionManager permissionManager, ContentPermissionManager contentPermissionManager, DraftService draftService, AttachmentManager attachmentManager, NotificationManager notificationManager, com.atlassian.event.api.EventPublisher eventPublisher, ContentPropertyManager contentPropertyManager, LabelManager labelManager, com.google.common.base.Supplier<DraftsTransitionHelper> draftsTransitionHelperSupplier, LongRunningTaskManagerInternal longRunningTaskManager)Deprecated.since 8.1
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PageLocatorgetIdPageLocator(long pageId)Creates a page locator that can locate a page based on an id.PageLocatorgetPageVersionLocator(long pageId, int version)PageLocatorgetTitleAndSpaceKeyPageLocator(String spaceKey, String title)Creates a page locator that can locate a page based on a space key and title.ServiceCommandnewCreatePageCommand(PageProvider provider, ContentPermissionProvider permissionProvider, CreateContextProvider contextProvider, ContentEntityObject draft, com.atlassian.user.User user, boolean notifySelf)Retrieve a command for creating a new page for the specified user.ServiceCommandnewCreatePageCommand(PageProvider provider, ContentPermissionProvider permissionProvider, CreateContextProvider contextProvider, Draft draft, com.atlassian.user.User user, boolean notifySelf)Retrieve a command for creating a new page for the specified user.ServiceCommandnewCreatePageCommand(PageProvider provider, ContentPermissionProvider permissionProvider, CreateContextProvider contextProvider, Page draft, com.atlassian.user.User user, boolean notifySelf)Retrieve a command for creating a new page for the specified user.ServiceCommandnewCreatePageCommandFromExisting(PageProvider pageProvider, ContentPermissionProvider permissionProvider, CreateContextProvider contextProvider, ContentEntityObject draft, com.atlassian.user.User user, boolean notifySelf, SpaceProvider spaceProvider)This is not a public API method! Creating a page from an existing page has different authorisation and validation logic from creating a brand new page.ServiceCommandnewCreatePageCommandFromExisting(PageProvider pageProvider, ContentPermissionProvider permissionProvider, CreateContextProvider contextProvider, Page draft, com.atlassian.user.User user, boolean notifySelf, SpaceProvider spaceProvider)This is not a public API method! Creating a page from an existing page has different authorisation and validation logic from creating a brand new page.ServiceCommandnewCreatePageCommandFromExisting(PageProvider provider, ContentPermissionProvider permissionProvider, ContentEntityObject draft, com.atlassian.user.User user, boolean notifySelf, SpaceProvider spaceProvider)This is not a public API method! Creating a page from an existing page has different authorisation and validation logic from creating a brand new page.ServiceCommandnewCreatePageCommandFromExisting(PageProvider provider, ContentPermissionProvider permissionProvider, Draft draft, com.atlassian.user.User user, boolean notifySelf, SpaceProvider spaceProvider)This is not a public API method! Creating a page from an existing page has different authorisation and validation logic from creating a brand new page.ServiceCommandnewDeletePageCommand(PageLocator pageLocator)Retrieve a command to remove an existing pageMovePageCommandnewMovePageCommand(PageLocator sourcePageLocator, PageLocator targetPageLocator, String position)Retrieve a command to perform a simple move operation.MovePageCommandnewMovePageCommand(PageLocator sourcePageLocator, SpaceLocator targetSpaceLocator)Retrieve a command that performs a move operation of a page to a top level of a target space.ServiceCommandnewRemovePageVersionCommand(PageLocator pageLocator)ServiceCommandnewRevertPageCommand(PageLocator pageToRevert, int version, String revertComment, boolean revertTitle)Retrieve a command to revert a pageServiceCommandnewRevertPageOrderCommand(PageLocator parentPageLocator)Retrieve a command to clear any existing positions for children of the located Page.ServiceCommandnewSetPageOrderCommand(PageLocator parentPageLocator, List<Long> childPageIds)Retrieve a command to set the order of all children for a supplied parent Page locator.voidsetPermissionManager(PermissionManager permissionManager)
-
-
-
Constructor Detail
-
DefaultPageService
public DefaultPageService(PageManager pageManager, PermissionManager permissionManager, ContentPermissionManager contentPermissionManager, DraftService draftService, AttachmentManager attachmentManager, NotificationManager notificationManager, com.atlassian.event.api.EventPublisher eventPublisher, ContentPropertyManager contentPropertyManager, LabelManager labelManager, com.google.common.base.Supplier<DraftsTransitionHelper> draftsTransitionHelperSupplier, MovePageCommandHelper movePageCommandHelper)
- Since:
- 8.1
-
DefaultPageService
@Deprecated public DefaultPageService(PageManager pageManager, PermissionManager permissionManager, ContentPermissionManager contentPermissionManager, DraftService draftService, AttachmentManager attachmentManager, NotificationManager notificationManager, com.atlassian.event.api.EventPublisher eventPublisher, ContentPropertyManager contentPropertyManager, LabelManager labelManager, com.google.common.base.Supplier<DraftsTransitionHelper> draftsTransitionHelperSupplier, LongRunningTaskManagerInternal longRunningTaskManager)
Deprecated.since 8.1- Since:
- 5.10
-
-
Method Detail
-
newMovePageCommand
public MovePageCommand newMovePageCommand(PageLocator sourcePageLocator, PageLocator targetPageLocator, String position)
Description copied from interface:PageServiceRetrieve a command to perform a simple move operation.- Specified by:
newMovePageCommandin interfacePageServiceposition- the point describing where the source should be moved to in relation to the target, seeMovePageCommand- Returns:
- an appropriate command instance
-
newMovePageCommand
public MovePageCommand newMovePageCommand(PageLocator sourcePageLocator, SpaceLocator targetSpaceLocator)
Description copied from interface:PageServiceRetrieve a command that performs a move operation of a page to a top level of a target space.- Specified by:
newMovePageCommandin interfacePageService
-
newSetPageOrderCommand
public ServiceCommand newSetPageOrderCommand(PageLocator parentPageLocator, List<Long> childPageIds)
Description copied from interface:PageServiceRetrieve a command to set the order of all children for a supplied parent Page locator.- Specified by:
newSetPageOrderCommandin interfacePageService- Parameters:
parentPageLocator- locator for the parent Page objectchildPageIds- a list of child page ids
-
newRevertPageOrderCommand
public ServiceCommand newRevertPageOrderCommand(PageLocator parentPageLocator)
Description copied from interface:PageServiceRetrieve a command to clear any existing positions for children of the located Page.- Specified by:
newRevertPageOrderCommandin interfacePageService
-
newDeletePageCommand
public ServiceCommand newDeletePageCommand(PageLocator pageLocator)
Description copied from interface:PageServiceRetrieve a command to remove an existing page- Specified by:
newDeletePageCommandin interfacePageService
-
newRemovePageVersionCommand
public ServiceCommand newRemovePageVersionCommand(PageLocator pageLocator)
- Specified by:
newRemovePageVersionCommandin interfacePageService- Parameters:
pageLocator- a page locator that identifies either the historical version of a page directly (e.g.IdPageLocator) or the page and a version (e.g.IdAndVersionPageLocator).- Returns:
- a command to remove a version of a page.
-
getIdPageLocator
public PageLocator getIdPageLocator(long pageId)
Description copied from interface:PageServiceCreates a page locator that can locate a page based on an id.- Specified by:
getIdPageLocatorin interfacePageService
-
getTitleAndSpaceKeyPageLocator
public PageLocator getTitleAndSpaceKeyPageLocator(String spaceKey, String title)
Description copied from interface:PageServiceCreates a page locator that can locate a page based on a space key and title.- Specified by:
getTitleAndSpaceKeyPageLocatorin interfacePageService
-
getPageVersionLocator
public PageLocator getPageVersionLocator(long pageId, int version)
- Specified by:
getPageVersionLocatorin interfacePageService- Parameters:
pageId- the id of the original version of the pageversion- a historical version, where 1 refers to version 1.- Returns:
- a page locator that will locate a historical version of a page.
-
newRevertPageCommand
public ServiceCommand newRevertPageCommand(PageLocator pageToRevert, int version, String revertComment, boolean revertTitle)
Description copied from interface:PageServiceRetrieve a command to revert a page- Specified by:
newRevertPageCommandin interfacePageService
-
newCreatePageCommand
public ServiceCommand newCreatePageCommand(PageProvider provider, ContentPermissionProvider permissionProvider, CreateContextProvider contextProvider, Page draft, com.atlassian.user.User user, boolean notifySelf)
Description copied from interface:PageServiceRetrieve a command for creating a new page for the specified user.- Specified by:
newCreatePageCommandin interfacePageService- Parameters:
provider- an object that will provide the page to be created.permissionProvider- provide the permissions to be applied to the created page.contextProvider- an object that can provide a context to be included when publishing the page creation eventuser- the user creating this pagenotifySelf- a flag indicating whether the user wants to be notified about this page creation.- Returns:
- a CreatePageCommand for creating the specified page.
-
newCreatePageCommand
public ServiceCommand newCreatePageCommand(PageProvider provider, ContentPermissionProvider permissionProvider, CreateContextProvider contextProvider, ContentEntityObject draft, com.atlassian.user.User user, boolean notifySelf)
Description copied from interface:PageServiceRetrieve a command for creating a new page for the specified user.- Specified by:
newCreatePageCommandin interfacePageService- Parameters:
provider- an object that will provide the page to be created.permissionProvider- provide the permissions to be applied to the created page.contextProvider- an object that can provide a context to be included when publishing the page creation eventuser- the user creating this pagenotifySelf- a flag indicating whether the user wants to be notified about this page creation.- Returns:
- a CreatePageCommand for creating the specified page.
-
newCreatePageCommand
public ServiceCommand newCreatePageCommand(PageProvider provider, ContentPermissionProvider permissionProvider, CreateContextProvider contextProvider, Draft draft, com.atlassian.user.User user, boolean notifySelf)
Description copied from interface:PageServiceRetrieve a command for creating a new page for the specified user.- Specified by:
newCreatePageCommandin interfacePageService- Parameters:
provider- an object that will provide the page to be created.permissionProvider- provide the permissions to be applied to the created page.contextProvider- an object that can provide a context to be included when publishing the page creation eventuser- the user creating this pagenotifySelf- a flag indicating whether the user wants to be notified about this page creation.- Returns:
- a CreatePageCommand for creating the specified page.
-
newCreatePageCommandFromExisting
public ServiceCommand newCreatePageCommandFromExisting(PageProvider provider, ContentPermissionProvider permissionProvider, Draft draft, com.atlassian.user.User user, boolean notifySelf, SpaceProvider spaceProvider)
Description copied from interface:PageServiceThis is not a public API method! Creating a page from an existing page has different authorisation and validation logic from creating a brand new page. This method allows creation of a command that implements that difference in logic. Apart from that the command created here will have the same logic as that created by
PageService.newCreatePageCommand(PageProvider, ContentPermissionProvider, CreateContextProvider, Draft, User, boolean).This logic in this command originates from
CopyPageActionwhich differs from that ofCreatePageAction.I hope that when we get a chance to analyse why
CopyPageActionhas different permission and validation logic we will eventually remove this method.- Specified by:
newCreatePageCommandFromExistingin interfacePageService- Parameters:
provider- an object that will provide the page to be created.permissionProvider- provide the permissions to be applied to the created page.draft- the draft associated with the copy, if present.user- the user creating this pagenotifySelf- a flag indicating whether the user wants to be notified about this page creation. @return a CreatePageCommand for creating the specified page.spaceProvider- provide the space where page will be created.
-
newCreatePageCommandFromExisting
public ServiceCommand newCreatePageCommandFromExisting(PageProvider provider, ContentPermissionProvider permissionProvider, ContentEntityObject draft, com.atlassian.user.User user, boolean notifySelf, SpaceProvider spaceProvider)
Description copied from interface:PageServiceThis is not a public API method! Creating a page from an existing page has different authorisation and validation logic from creating a brand new page. This method allows creation of a command that implements that difference in logic. Apart from that the command created here will have the same logic as that created by
PageService.newCreatePageCommand(PageProvider, ContentPermissionProvider, CreateContextProvider, Draft, User, boolean).This logic in this command originates from
CopyPageActionwhich differs from that ofCreatePageAction.I hope that when we get a chance to analyse why
CopyPageActionhas different permission and validation logic we will eventually remove this method.- Specified by:
newCreatePageCommandFromExistingin interfacePageService- Parameters:
provider- an object that will provide the page to be created.permissionProvider- provide the permissions to be applied to the created page.draft- the draft associated with the copy, if present.user- the user creating this pagenotifySelf- a flag indicating whether the user wants to be notified about this page creation. @return a CreatePageCommand for creating the specified page.spaceProvider- provide the space where page will be created.
-
newCreatePageCommandFromExisting
public ServiceCommand newCreatePageCommandFromExisting(PageProvider pageProvider, ContentPermissionProvider permissionProvider, CreateContextProvider contextProvider, ContentEntityObject draft, com.atlassian.user.User user, boolean notifySelf, SpaceProvider spaceProvider)
Description copied from interface:PageServiceThis is not a public API method! Creating a page from an existing page has different authorisation and validation logic from creating a brand new page. This method allows creation of a command that implements that difference in logic. Apart from that the command created here will have the same logic as that created by
PageService.newCreatePageCommand(PageProvider, ContentPermissionProvider, CreateContextProvider, Draft, User, boolean).This logic in this command originates from
CopyPageActionwhich differs from that ofCreatePageAction.I hope that when we get a chance to analyse why
CopyPageActionhas different permission and validation logic we will eventually remove this method.- Specified by:
newCreatePageCommandFromExistingin interfacePageService- Parameters:
pageProvider- an object that will provide the page to be created.permissionProvider- provide the permissions to be applied to the created page.contextProvider- an object that provides context for the new page creationdraft- the draft associated with the copy, if present.user- the user creating this pagenotifySelf- a flag indicating whether the user wants to be notified about this page creation. @return a CreatePageCommand for creating the specified page.spaceProvider- provide the space where page will be created.
-
newCreatePageCommandFromExisting
public ServiceCommand newCreatePageCommandFromExisting(PageProvider pageProvider, ContentPermissionProvider permissionProvider, CreateContextProvider contextProvider, Page draft, com.atlassian.user.User user, boolean notifySelf, SpaceProvider spaceProvider)
Description copied from interface:PageServiceThis is not a public API method! Creating a page from an existing page has different authorisation and validation logic from creating a brand new page. This method allows creation of a command that implements that difference in logic. Apart from that the command created here will have the same logic as that created by
PageService.newCreatePageCommand(PageProvider, ContentPermissionProvider, CreateContextProvider, Draft, User, boolean).This logic in this command originates from
CopyPageActionwhich differs from that ofCreatePageAction.I hope that when we get a chance to analyse why
CopyPageActionhas different permission and validation logic we will eventually remove this method.- Specified by:
newCreatePageCommandFromExistingin interfacePageService- Parameters:
pageProvider- an object that will provide the page to be created.permissionProvider- provide the permissions to be applied to the created page.contextProvider- an object that provides context for the new page creationdraft- the draft associated with the copy, if present.user- the user creating this pagenotifySelf- a flag indicating whether the user wants to be notified about this page creation. @return a CreatePageCommand for creating the specified page.spaceProvider- provide the space where page will be created.
-
setPermissionManager
public void setPermissionManager(PermissionManager permissionManager)
-
-