com.atlassian.confluence.pages
Interface PageManager

All Superinterfaces:
ContentEntityManager
All Known Implementing Classes:
DefaultPageManager

public interface PageManager
extends ContentEntityManager

Manages the retrieval and manipulation both pages and blog entries. (Really this class manages "AbstractPage", but calling it AbstractPageManager would be just as confusing).


Field Summary
 
Fields inherited from interface com.atlassian.confluence.core.ContentEntityManager
ITERATE_ALL
 
Method Summary
 BlogPost findNextBlogPost(BlogPost post)
           
 BlogPost findNextBlogPost(String key, Date time)
           
 BlogPost findPreviousBlogPost(BlogPost post)
           
 BlogPost findPreviousBlogPost(String key, Date time)
           
 AbstractPage getAbstractPage(long id)
          Retrieve the AbstractPage subclass with the given content ID.
 AttachmentManager getAttachmentManager()
           
 int getAuthoredPagesCountByUser(String username)
          Get the number of pages that have been created by a particular user
 BlogPost getBlogPost(long id)
          Retrieve the blog post with the given content ID.
 BlogPost getBlogPost(String spaceKey, String pageTitle, Calendar day)
          Retrieve the latest version of a blog post by its space key, title, and the day on which it was published.
 List getBlogPosts(Space space, boolean currentOnly)
           
 List getBlogPosts(String spaceKey, Calendar postingDate, int period)
           
 Collection getDescendentIds(Page page)
           
 List getDescendents(Page page)
           
 NotificationManager getNotificationManager()
           
 List getOrphanedPages(String spaceKey)
          Retrieve a list of pages in a given space that are not linked to.
 Page getPage(long id)
          Retrieve the page with the given content ID.
 Page getPage(String spaceKey, String pageTitle)
          Retrieve the latest version of a page by its space key and title.
 AbstractPage getPageByVersion(AbstractPage mostRecentPage, int version)
          returns the historical version of a page
 List getPageInTrash(String spaceKey, String title)
           
 List getPages(Space space, boolean currentOnly)
           
 List getPagesCreatedOrUpdatedSinceDate(Date date)
          Get the list of all pages created or updated since a particular date.
 List getPagesStartingWith(Space space, String s)
           
 List getPermissionPages(Space space)
          Retrieve all pages within a particular space that have page level permissions applied to them.
 List getPossibleRedirects(String pageTitle)
           
 List getPossibleRedirectsForSpace(Space space, String pageTitle)
           
 List getRecentlyAddedBlogPosts(int maxPosts, Date timeSince, String spaceKey)
           
 List getRecentlyAddedBlogPosts(int maxCount, String spaceKey)
          Retrieve the most recently created blog posts in a given space.
 List getRecentlyAddedPages(int maxCount, String spaceKey)
          Retrieve the most recently created pages in a given space.
 List getRecentlyUpdatedPages(int maxCount, String spaceKey)
          Retrieve the most recently modified pages in a given space.
 List getTopLevelPages(Space space)
           
 List getUndefinedPages(String spaceKey)
          Retrieve a list of link destinations in a given space that do not have pages.
 void removeAllBlogPosts(Space space)
           
 void removeAllPages(Space space)
           
 void removePageFromAncestorCollections(Page page)
           
 void renamePage(AbstractPage page, String newPageTitle)
           
 void restorePage(AbstractPage page)
           
 void setAttachmentManager(AttachmentManager attachmentManager)
           
 void setNotificationManager(NotificationManager notificationManager)
           
 boolean spaceHasBlogPosts(String spaceKey)
           
 void trashPage(AbstractPage page)
           
 void updatePageInAncestorCollections(Page pageBeingUpdated, Page newParentPage)
           
 
Methods inherited from interface com.atlassian.confluence.core.ContentEntityManager
getAllCurrentEntities, getById, getEntitiesModifiedSince, getLockedBySpace, getNextVersion, getOtherVersion, getPreviousVersion, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesByType, getRecentlyModifiedEntitiesForUser, getVersionHistorySummaries, refreshContentEntity, removeContentEntity, revertContentEntityBackToVersion, saveContentEntity, saveContentEntity, setEventManager, updateContentLinkingTo, updateOutgoingLinksInContent, updateSingleContentLinkinTo, updateSingleContentLinkinTo
 

Method Detail

getPage

public Page getPage(long id)
Retrieve the page with the given content ID.

Parameters:
id - the database content ID for the page to return
Returns:
the page with that id, or null if the page could not be found (or the object with that id is not a page)

getAbstractPage

public AbstractPage getAbstractPage(long id)
Retrieve the AbstractPage subclass with the given content ID. This will return either a page or a blogpost, depending on the type of the database entity.

Parameters:
id - the database content ID for the page to return
Returns:
the abstractpage with that id, or null if there is no AbstractPage with that ID.

getBlogPost

public BlogPost getBlogPost(long id)
Retrieve the blog post with the given content ID.

Parameters:
id - the database content ID for the blog post to return
Returns:
the page with that id, or null if the post could not be found (or the object with that id is not a blog post)

getPage

public Page getPage(String spaceKey,
                    String pageTitle)
Retrieve the latest version of a page by its space key and title. Pages that are not current (i.e. in the trash) will not be returned. Both the space key and page title matches are case-insensitive.

Returns:
the page specified by the spaceKey and pageTitle, or null if the page cannot be found, or is in the trash.

getBlogPost

public BlogPost getBlogPost(String spaceKey,
                            String pageTitle,
                            Calendar day)
Retrieve the latest version of a blog post by its space key, title, and the day on which it was published. Blog posts that are not current (i.e. in the trash) will not be returned. Both the space key and page title matches are case-insensitive.

Returns:
the appropriate blog post, or null if none can be found, or the post is in the trash.

getRecentlyAddedBlogPosts

public List getRecentlyAddedBlogPosts(int maxCount,
                                      String spaceKey)
Retrieve the most recently created blog posts in a given space. If no space key is supplied, the most recent blog posts from all spaces are returned. Only the latest version of each post is returned. Posts that are not current (i.e. in the trash) are not included. The SmartListManager provides a more flexible (and more efficient) way to perform this query, including accounting for user permissions.

Parameters:
maxCount - the maximum number of blog posts to retrieve
spaceKey - the key of the space to retrieve the posts from, or null to retrieve posts from all spaces
Returns:
a list of the most recently created blog posts in the given space

getRecentlyAddedPages

public List getRecentlyAddedPages(int maxCount,
                                  String spaceKey)
Retrieve the most recently created pages in a given space. If no space key is supplied, the most recent pages from all spaces are returned. Only the latest version of each page is returned. Pages that are not current (i.e. in the trash) are not included. The SmartListManager provides a more flexible (and more efficient) way to perform this query, including accounting for user permissions.

Parameters:
maxCount - the maximum number of pages to retrieve
spaceKey - the key of the space to retrieve the pages from, or null to retrieve posts from all spaces
Returns:
a list of the most recently created pages in the given space

getRecentlyUpdatedPages

public List getRecentlyUpdatedPages(int maxCount,
                                    String spaceKey)
Retrieve the most recently modified pages in a given space. If no space key is supplied, the most recent pages from all spaces are returned. Only the latest version of each page is returned. Pages that are not current (i.e. in the trash) are not included. The SmartListManager provides a more flexible (and more efficient) way to perform this query, including accounting for user permissions.

Parameters:
maxCount - the maximum number of pages to retrieve
spaceKey - the key of the space to retrieve the pages from, or null to retrieve posts from all spaces
Returns:
a list of the most recently updated pages in the given space

getOrphanedPages

public List getOrphanedPages(String spaceKey)
Retrieve a list of pages in a given space that are not linked to. If no space key is supplied, the search is performed across all spaces. Only the latest version of each page is returned. Pages that are not current (i.e. in the trash) are not returned. The orphaned pages search is not 100% accurate, as the algorithm used to track links doesn't account for all links. Hopefully this can be fixed with future versions of the wiki renderer that allow more accurate tracking of link destinations.

Parameters:
spaceKey - the key of the space to look for orphans in, or null to search all spaces
Returns:
the list of orphaned pages

getUndefinedPages

public List getUndefinedPages(String spaceKey)
Retrieve a list of link destinations in a given space that do not have pages. The undefined pages search is not 100% accurate, as the algorithm used to track links doesn't account for all links. Hopefully this can be fixed with future versions of the wiki renderer that allow more accurate tracking of link destinations.

Parameters:
spaceKey - the key of the space to look for undefined pages in, or null to search all spaces
Returns:
the list of undefined pages

getPermissionPages

public List getPermissionPages(Space space)
Retrieve all pages within a particular space that have page level permissions applied to them. Only the latest version of each page is returned. Pages that are not current (i.e. in the trash) are not returned.

Parameters:
space - the space to search
Returns:
the list of all pages in that space with page-level permissions

getAuthoredPagesCountByUser

public int getAuthoredPagesCountByUser(String username)
Get the number of pages that have been created by a particular user

Parameters:
username - the username of the user to search for
Returns:
the number of pages that have been created by that user.

getPagesCreatedOrUpdatedSinceDate

public List getPagesCreatedOrUpdatedSinceDate(Date date)
Get the list of all pages created or updated since a particular date.

Parameters:
date - the date the pages must have been created or edited after
Returns:
all pages created or edited since that date

getBlogPosts

public List getBlogPosts(String spaceKey,
                         Calendar postingDate,
                         int period)

getBlogPosts

public List getBlogPosts(Space space,
                         boolean currentOnly)

getPages

public List getPages(Space space,
                     boolean currentOnly)

getPagesStartingWith

public List getPagesStartingWith(Space space,
                                 String s)

findNextBlogPost

public BlogPost findNextBlogPost(BlogPost post)

findPreviousBlogPost

public BlogPost findPreviousBlogPost(BlogPost post)

getNotificationManager

public NotificationManager getNotificationManager()

setNotificationManager

public void setNotificationManager(NotificationManager notificationManager)

getAttachmentManager

public AttachmentManager getAttachmentManager()

setAttachmentManager

public void setAttachmentManager(AttachmentManager attachmentManager)

renamePage

public void renamePage(AbstractPage page,
                       String newPageTitle)

getPossibleRedirectsForSpace

public List getPossibleRedirectsForSpace(Space space,
                                         String pageTitle)

getPossibleRedirects

public List getPossibleRedirects(String pageTitle)

getRecentlyAddedBlogPosts

public List getRecentlyAddedBlogPosts(int maxPosts,
                                      Date timeSince,
                                      String spaceKey)

getPageInTrash

public List getPageInTrash(String spaceKey,
                           String title)

spaceHasBlogPosts

public boolean spaceHasBlogPosts(String spaceKey)

getDescendents

public List getDescendents(Page page)

updatePageInAncestorCollections

public void updatePageInAncestorCollections(Page pageBeingUpdated,
                                            Page newParentPage)

removePageFromAncestorCollections

public void removePageFromAncestorCollections(Page page)

getDescendentIds

public Collection getDescendentIds(Page page)

getTopLevelPages

public List getTopLevelPages(Space space)

getPageByVersion

public AbstractPage getPageByVersion(AbstractPage mostRecentPage,
                                     int version)
returns the historical version of a page

Parameters:
mostRecentPage - - must specify the most recent recent version of the page (page must be associated with a space)
version - - historical version to retrieve
Returns:
the specified version of the page

removeAllPages

public void removeAllPages(Space space)

removeAllBlogPosts

public void removeAllBlogPosts(Space space)

findPreviousBlogPost

public BlogPost findPreviousBlogPost(String key,
                                     Date time)

findNextBlogPost

public BlogPost findNextBlogPost(String key,
                                 Date time)

trashPage

public void trashPage(AbstractPage page)

restorePage

public void restorePage(AbstractPage page)


Confluence is developed by Atlassian.