public interface

PageService

com.atlassian.confluence.content.service.PageService
Known Indirect Subclasses

Class Overview

The PageService is a service layer implementation of the PageManager.

Summary

Public Methods
abstract PageLocator getIdPageLocator(long pageId)
Creates a page locator that can locate a page based on an id.
abstract PageLocator getTitleAndSpaceKeyPageLocator(String spaceKey, String title)
Creates a page locator that can locate a page based on a space key and title.
abstract ServiceCommand newCreatePageCommand(PageProvider provider, ContentPermissionProvider permissionProvider, User user, boolean notifySelf)
Retrieve a command for creating a new page for the specified user.
abstract ServiceCommand newCreatePageCommandFromExisting(PageProvider provider, ContentPermissionProvider permissionProvider, User user, boolean notifySelf)

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.

abstract ServiceCommand newDeletePageCommand(PageLocator pageLocator)
Retrieve a command to remove an existing page
abstract MovePageCommand newMovePageCommand(PageLocator sourcePageLocator, PageLocator targetPageLocator, String position)
Retrieve a command to perform a simple move operation.
abstract MovePageCommand newMovePageCommand(PageLocator sourcePageLocator, SpaceLocator targetSpaceLocator)
Retrieve a command that performs a move operation of a page to a top level of a target space.
abstract ServiceCommand newRevertPageCommand(PageLocator pageToRevert, int version, String revertComment, boolean revertTitle)
Retrieve a command to revert a page
abstract ServiceCommand newRevertPageOrderCommand(PageLocator parentPageLocator)
Retrieve a command to clear any existing positions for children of the located Page.
abstract ServiceCommand newSetPageOrderCommand(PageLocator parentPageLocator, List<Long> childPageIds)
Retrieve a command to set the order of all children for a supplied parent Page locator.

Public Methods

public abstract PageLocator getIdPageLocator (long pageId)

Creates a page locator that can locate a page based on an id.

public abstract PageLocator getTitleAndSpaceKeyPageLocator (String spaceKey, String title)

Creates a page locator that can locate a page based on a space key and title.

public abstract ServiceCommand newCreatePageCommand (PageProvider provider, ContentPermissionProvider permissionProvider, User user, boolean notifySelf)

Retrieve a command for creating a new page for the specified user.

Parameters
provider an object that will provide the page to be created.
permissionProvider provide the permissions to be applied to the created page.
user the user creating this page
notifySelf a flag indicating whether the user wants to be notified about this page creation.
Returns
  • a CreatePageCommand for creating the specified page.

public abstract ServiceCommand newCreatePageCommandFromExisting (PageProvider provider, ContentPermissionProvider permissionProvider, User user, boolean notifySelf)

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. 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 newCreatePageCommand(PageProvider, ContentPermissionProvider, User, boolean).

This logic in this command originates from CopyPageAction which differs from that of CreatePageAction.

I hope that when we get a chance to analyse why CopyPageAction has different permission and validation logic we will eventually remove this method.

Parameters
provider an object that will provide the page to be created.
permissionProvider provide the permissions to be applied to the created page.
user the user creating this page
notifySelf a flag indicating whether the user wants to be notified about this page creation.
Returns
  • a CreatePageCommand for creating the specified page.

public abstract ServiceCommand newDeletePageCommand (PageLocator pageLocator)

Retrieve a command to remove an existing page

public abstract MovePageCommand newMovePageCommand (PageLocator sourcePageLocator, PageLocator targetPageLocator, String position)

Retrieve a command to perform a simple move operation.

Parameters
position the point describing where the source should be moved to in relation to the target, see MovePageCommand
Returns
  • an appropriate command instance

public abstract MovePageCommand newMovePageCommand (PageLocator sourcePageLocator, SpaceLocator targetSpaceLocator)

Retrieve a command that performs a move operation of a page to a top level of a target space.

public abstract ServiceCommand newRevertPageCommand (PageLocator pageToRevert, int version, String revertComment, boolean revertTitle)

Retrieve a command to revert a page

public abstract ServiceCommand newRevertPageOrderCommand (PageLocator parentPageLocator)

Retrieve a command to clear any existing positions for children of the located Page.

public abstract ServiceCommand newSetPageOrderCommand (PageLocator parentPageLocator, List<Long> childPageIds)

Retrieve a command to set the order of all children for a supplied parent Page locator.

Parameters
parentPageLocator locator for the parent Page object
childPageIds a list of child page ids