com.atlassian.confluence.pages.persistence.dao.hibernate
Class HibernatePageDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate.support.HibernateDaoSupport
          extended by com.atlassian.hibernate.HibernateObjectDao
              extended by com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
                  extended by com.atlassian.confluence.core.persistence.hibernate.ContentEntityObjectHibernateDao
                      extended by com.atlassian.confluence.pages.persistence.dao.hibernate.HibernatePageDao
All Implemented Interfaces:
ObjectDao, ContentEntityObjectDao, VersionedObjectDao, PageDao, org.springframework.beans.factory.InitializingBean

public class HibernatePageDao
extends ContentEntityObjectHibernateDao
implements PageDao


Field Summary
 
Fields inherited from class com.atlassian.confluence.core.persistence.hibernate.ContentEntityObjectHibernateDao
ONE_DAY
 
Fields inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
cacheFactory
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
HibernatePageDao()
           
 
Method Summary
 List findPagesWithHistoricalTitle(String pageTitle)
           
 List<AbstractPage> findPagesWithHistoricalTitleInAllPermittedSpacesExcept(String pageTitle, Space space, int maxResultCount)
          Searches for pages in all spaces except the one specified, looking for those that have the given title in a previous version, and returns the first maxResultCount results.
 List<AbstractPage> findPagesWithHistoricalTitleInPermittedSpace(String pageTitle, Space space, int maxResultCount)
          Searches for pages in the space specified, looking for those that have the given title in a previous version, and returns the first maxResultCount results.
 int getAuthoredPagesCountByUser(String username)
           
 int getCommentCountOnPage(long id)
          Count the number of comments on the passed in page.
 List getDescendentIds(Page page)
           
 List<Page> getDescendents(Page page)
           
 List getOrphanedPages(String spaceKey)
           
 Page getPage(Space space, String pageTitle)
          Get the page by space and title.
 Page getPage(Space space, String pageTitle, boolean eagerLoadComments)
           
 Page getPage(String spaceKey, String pageTitle)
          Deprecated. 
 Page getPage(String spaceKey, String pageTitle, boolean eagerLoadComments)
          Deprecated. 
 Page getPageById(long id)
          Get the page with the given id.
 Page getPageByIdWithComments(long id)
          Get the page with the given id, and perform an eager load of the comments and their children.
 List getPageInTrash(String spaceKey, String title)
           
 List getPages(Space space, boolean currenOnly)
           
 List getPagesCreatedOrUpdatedSinceDate(Date previousLoginDate)
           
 List getPagesStartingWith(Space space, String s)
           
 Page getPageWithComments(Space space, String pageTitle)
          Get the page by space and title, and perform an eager load of the comments and their children.
 List getPermissionPages(Space space)
           
 Class getPersistentClass()
           
 List getRecentlyAddedPages(int maxCount, String spaceKey)
           
 List getRecentlyAuthoredPagesByUser(String username, int maxCount)
           
 List getRecentlyUpdatedPages(int maxCount, String spaceKey)
           
 List<Page> getTopLevelPages(Space space)
           
 List getUndefinedPages(String spaceKey)
           
 void removeFromPageKeyCache(String spaceKey, String pageTitle)
          Deprecated. 
 void setGroupManager(com.atlassian.user.GroupManager groupManager)
           
 void setHibernateConfig(com.atlassian.config.db.HibernateConfig hibernateConfig)
           
 void setLinkDao(LinkDao linkDao)
           
 
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.ContentEntityObjectHibernateDao
findPreviousVersions, getAllCurrentEntities, getById, getContentAuthoredByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getLockedContentBySpace, getObjectType, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getVersion, getVersionHistorySummary
 
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
findAllSorted, findLatestVersionsCount, findLatestVersionsIterator, save, setCacheFactory, updateModificationData
 
Methods inherited from class com.atlassian.hibernate.HibernateObjectDao
findAll, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, index, refresh, reIndex, remove, replicate, save, saveRaw, setIndexer, unIndex
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.confluence.core.persistence.ContentEntityObjectDao
findPreviousVersions, getAllCurrentEntities, getById, getContentAuthoredByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getLockedContentBySpace, getObjectType, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getVersion, getVersionHistorySummary
 
Methods inherited from interface com.atlassian.confluence.core.persistence.VersionedObjectDao
findLatestVersionsCount, findLatestVersionsIterator, save
 
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, refresh, remove, replicate, save, saveRaw
 

Constructor Detail

HibernatePageDao

public HibernatePageDao()
Method Detail

setHibernateConfig

public void setHibernateConfig(com.atlassian.config.db.HibernateConfig hibernateConfig)

setLinkDao

public void setLinkDao(LinkDao linkDao)

getPageById

public Page getPageById(long id)
Description copied from interface: PageDao
Get the page with the given id.

Specified by:
getPageById in interface PageDao
Parameters:
id - of the page to load
Returns:
the page with the given id, or null if no such page exists

getCommentCountOnPage

public int getCommentCountOnPage(long id)
Description copied from interface: PageDao
Count the number of comments on the passed in page.

Specified by:
getCommentCountOnPage in interface PageDao

getPageByIdWithComments

public Page getPageByIdWithComments(long id)
Description copied from interface: PageDao
Get the page with the given id, and perform an eager load of the comments and their children. This can be used as a performance optimisation when it is known that all comments will be displayed.

Specified by:
getPageByIdWithComments in interface PageDao
Parameters:
id - of the page to load
Returns:
the page with the given id, or null if no such page exists

getPage

public Page getPage(Space space,
                    String pageTitle,
                    boolean eagerLoadComments)

getPageWithComments

public Page getPageWithComments(Space space,
                                String pageTitle)
Description copied from interface: PageDao
Get the page by space and title, and perform an eager load of the comments and their children. This can be used as a performance optimisation when it is known that all comments will be displayed.

Specified by:
getPageWithComments in interface PageDao
Parameters:
space - The space the page belongs to
pageTitle - The title of the page
Returns:
the page with the given title in the given space, or null if no such page exists

getPage

public Page getPage(Space space,
                    String pageTitle)
Description copied from interface: PageDao
Get the page by space and title.

Specified by:
getPage in interface PageDao
Parameters:
space - The space the page belongs to
pageTitle - The title of the page
Returns:
the page with the given title in the given space, or null if no such page exists

getPage

@Deprecated
public Page getPage(String spaceKey,
                               String pageTitle)
Deprecated. 

Specified by:
getPage in interface PageDao

getPage

@Deprecated
public Page getPage(String spaceKey,
                               String pageTitle,
                               boolean eagerLoadComments)
Deprecated. 

Description copied from interface: PageDao
Get the page by space key and title, and perform an eager load of the comments and their children. This can be used as a performance optimisation when it is known that all comments will be displayed.

Specified by:
getPage in interface PageDao
Parameters:
spaceKey - to match with
pageTitle - to match with
eagerLoadComments - true if comments should be loaded eagerly
Returns:
the page

removeFromPageKeyCache

@Deprecated
public void removeFromPageKeyCache(String spaceKey,
                                              String pageTitle)
Deprecated. 

Specified by:
removeFromPageKeyCache in interface PageDao

getPages

public List getPages(Space space,
                     boolean currenOnly)
Specified by:
getPages in interface PageDao

getPagesStartingWith

public List getPagesStartingWith(Space space,
                                 String s)
Specified by:
getPagesStartingWith in interface PageDao

getRecentlyAddedPages

public List getRecentlyAddedPages(int maxCount,
                                  String spaceKey)
Specified by:
getRecentlyAddedPages in interface PageDao

getRecentlyUpdatedPages

public List getRecentlyUpdatedPages(int maxCount,
                                    String spaceKey)
Specified by:
getRecentlyUpdatedPages in interface PageDao

getOrphanedPages

public List getOrphanedPages(String spaceKey)
Specified by:
getOrphanedPages in interface PageDao

getUndefinedPages

public List getUndefinedPages(String spaceKey)
Specified by:
getUndefinedPages in interface PageDao

getPermissionPages

public List getPermissionPages(Space space)
Specified by:
getPermissionPages in interface PageDao

getAuthoredPagesCountByUser

public int getAuthoredPagesCountByUser(String username)
Specified by:
getAuthoredPagesCountByUser in interface PageDao

getRecentlyAuthoredPagesByUser

public List getRecentlyAuthoredPagesByUser(String username,
                                           int maxCount)
Specified by:
getRecentlyAuthoredPagesByUser in interface PageDao

getPagesCreatedOrUpdatedSinceDate

public List getPagesCreatedOrUpdatedSinceDate(Date previousLoginDate)
Specified by:
getPagesCreatedOrUpdatedSinceDate in interface PageDao

getPersistentClass

public Class getPersistentClass()
Specified by:
getPersistentClass in interface ObjectDao
Overrides:
getPersistentClass in class ContentEntityObjectHibernateDao

findPagesWithHistoricalTitle

public List findPagesWithHistoricalTitle(String pageTitle)
Specified by:
findPagesWithHistoricalTitle in interface PageDao

findPagesWithHistoricalTitleInPermittedSpace

public List<AbstractPage> findPagesWithHistoricalTitleInPermittedSpace(String pageTitle,
                                                                       Space space,
                                                                       int maxResultCount)
Description copied from interface: PageDao
Searches for pages in the space specified, looking for those that have the given title in a previous version, and returns the first maxResultCount results.

Only pages in spaces the remote user is able to view will be returned.

Specified by:
findPagesWithHistoricalTitleInPermittedSpace in interface PageDao
Parameters:
pageTitle - title of a page in a previous version.
space - Space to search. Must not be null.
maxResultCount - maximum pages to return

findPagesWithHistoricalTitleInAllPermittedSpacesExcept

public List<AbstractPage> findPagesWithHistoricalTitleInAllPermittedSpacesExcept(String pageTitle,
                                                                                 Space space,
                                                                                 int maxResultCount)
Description copied from interface: PageDao
Searches for pages in all spaces except the one specified, looking for those that have the given title in a previous version, and returns the first maxResultCount results.

Only pages in spaces the remote user is able to view will be returned.

Specified by:
findPagesWithHistoricalTitleInAllPermittedSpacesExcept in interface PageDao
Parameters:
pageTitle - title of a page in a previous version.
space - Space to exclude from search. If null, all spaces are searched.
maxResultCount - maximum pages to return

getPageInTrash

public List getPageInTrash(String spaceKey,
                           String title)
Specified by:
getPageInTrash in interface PageDao

getDescendents

public List<Page> getDescendents(Page page)
Specified by:
getDescendents in interface PageDao

getDescendentIds

public List getDescendentIds(Page page)
Specified by:
getDescendentIds in interface PageDao

getTopLevelPages

public List<Page> getTopLevelPages(Space space)
Specified by:
getTopLevelPages in interface PageDao

setGroupManager

public void setGroupManager(com.atlassian.user.GroupManager groupManager)


Copyright © 2003-2010 Atlassian. All Rights Reserved.