Class DefaultPageService

    • Method Detail

      • newSetPageOrderCommand

        public ServiceCommand newSetPageOrderCommand​(PageLocator parentPageLocator,
                                                     List<Long> childPageIds)
        Description copied from interface: PageService
        Retrieve a command to set the order of all children for a supplied parent Page locator.
        Specified by:
        newSetPageOrderCommand in interface PageService
        Parameters:
        parentPageLocator - locator for the parent Page object
        childPageIds - a list of child page ids
      • getPageVersionLocator

        public PageLocator getPageVersionLocator​(long pageId,
                                                 int version)
        Specified by:
        getPageVersionLocator in interface PageService
        Parameters:
        pageId - the id of the original version of the page
        version - a historical version, where 1 refers to version 1.
        Returns:
        a page locator that will locate a historical version of a page.
      • newCreatePageCommand

        public ServiceCommand newCreatePageCommand​(PageProvider provider,
                                                   ContentPermissionProvider permissionProvider,
                                                   CreateContextProvider contextProvider,
                                                   Page draft,
                                                   com.atlassian.user.User user,
                                                   boolean notifySelf)
        Description copied from interface: PageService
        Retrieve a command for creating a new page for the specified user.
        Specified by:
        newCreatePageCommand in interface PageService
        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 event
        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.
      • newCreatePageCommand

        public ServiceCommand newCreatePageCommand​(PageProvider provider,
                                                   ContentPermissionProvider permissionProvider,
                                                   CreateContextProvider contextProvider,
                                                   ContentEntityObject draft,
                                                   com.atlassian.user.User user,
                                                   boolean notifySelf)
        Description copied from interface: PageService
        Retrieve a command for creating a new page for the specified user.
        Specified by:
        newCreatePageCommand in interface PageService
        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 event
        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.
      • newCreatePageCommand

        public ServiceCommand newCreatePageCommand​(PageProvider provider,
                                                   ContentPermissionProvider permissionProvider,
                                                   CreateContextProvider contextProvider,
                                                   Draft draft,
                                                   com.atlassian.user.User user,
                                                   boolean notifySelf)
        Description copied from interface: PageService
        Retrieve a command for creating a new page for the specified user.
        Specified by:
        newCreatePageCommand in interface PageService
        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 event
        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.
      • newCreatePageCommandFromExisting

        public ServiceCommand newCreatePageCommandFromExisting​(PageProvider provider,
                                                               ContentPermissionProvider permissionProvider,
                                                               Draft draft,
                                                               com.atlassian.user.User user,
                                                               boolean notifySelf,
                                                               SpaceProvider spaceProvider)
        Description copied from interface: PageService

        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 PageService.newCreatePageCommand(PageProvider, ContentPermissionProvider, CreateContextProvider, Draft, 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.

        Specified by:
        newCreatePageCommandFromExisting in interface PageService
        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 page
        notifySelf - 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: PageService

        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 PageService.newCreatePageCommand(PageProvider, ContentPermissionProvider, CreateContextProvider, Draft, 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.

        Specified by:
        newCreatePageCommandFromExisting in interface PageService
        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 page
        notifySelf - 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: PageService

        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 PageService.newCreatePageCommand(PageProvider, ContentPermissionProvider, CreateContextProvider, Draft, 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.

        Specified by:
        newCreatePageCommandFromExisting in interface PageService
        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 creation
        draft - the draft associated with the copy, if present.
        user - the user creating this page
        notifySelf - 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: PageService

        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 PageService.newCreatePageCommand(PageProvider, ContentPermissionProvider, CreateContextProvider, Draft, 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.

        Specified by:
        newCreatePageCommandFromExisting in interface PageService
        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 creation
        draft - the draft associated with the copy, if present.
        user - the user creating this page
        notifySelf - 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)