com.atlassian.confluence.content.render.xhtml.migration
Class DefaultContentDao

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.content.render.xhtml.migration.DefaultContentDao
All Implemented Interfaces:
ObjectDao, ContentDao, ContentEntityObjectDao, VersionedObjectDao, org.springframework.beans.factory.InitializingBean

public class DefaultContentDao
extends ContentEntityObjectHibernateDao
implements ContentDao


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, confluenceUserDao
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
DefaultContentDao()
           
 
Method Summary
 ContentEntityObject getById(long id)
           
 int getCountOfLatestXhtmlContent()
           This is for internal use only, Do not rely on it as a public API.
 int getCountOfXhtmlContent()
           This is for internal use only, Do not rely on it as a public API.
 int getCountOfXhtmlSpaceDescriptions()
           This is for internal use only, Do not rely on it as a public API.
 int getLatestContentCount()
           
 java.util.List<ContentEntityObject> getLatestOrderedWikiContentFromContentId(long startContentId, int maxRows)
           
 java.util.List<ContentEntityObject> getLatestOrderedXhtmlContentFromContentIds(long startContentId, long endContentId)
           This is for internal use only, Do not rely on it as a public API.
 java.util.List<java.lang.Long> getLatestOrderedXhtmlContentIds(long startContentId, int maxRows)
           This is for internal use only, Do not rely on it as a public API.
 java.util.List<ContentEntityObject> getMailEntities(int startRow, int maxRows)
           
 int getMailEntitiesCount()
           
 java.util.List<ContentEntityObject> getOrderedXhtmlContentFromContentId(long startContentId, int maxRows)
           This is for internal use only, Do not rely on it as a public API.
 java.lang.Class getPersistentClass()
           
 java.util.List<ContentEntityObject> getXhtmlSpaceDescriptionsFromContentId(long startContentId, int maxRows)
           This is for internal use only, Do not rely on it as a public API.
 void saveRawWithoutReindex(com.atlassian.core.bean.EntityObject objectToSave)
           This is for internal use only, Do not rely on it as a public API.
protected  void updateModificationData(com.atlassian.core.bean.EntityObject objectToSave)
          This method overrides the default behaviour which is to get the current user from a thread local and to set the last updated time to the current time.
 
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.ContentEntityObjectHibernateDao
countContentBySpaceIdAndStatus, findContentBySpaceIdAndStatus, findHistoricalVersionsAfterVersion, findPreviousVersions, getAllCurrentEntities, getContentAuthoredByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getLockedContentBySpace, getObjectType, getOldestPageCreationDate, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getVersion, getVersionHistorySummary
 
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
findAllSorted, findLatestVersionsCount, findLatestVersionsIterator, save, setCacheFactory, setConfluenceUserDao
 
Methods inherited from class com.atlassian.hibernate.HibernateObjectDao
findAll, findAllSorted, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, getCountResult, index, refresh, reIndex, remove, replicate, save, saveRaw, setIndexer, unIndex, uniqueResult
 
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
countContentBySpaceIdAndStatus, findContentBySpaceIdAndStatus, findHistoricalVersionsAfterVersion, findPreviousVersions, getAllCurrentEntities, getContentAuthoredByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getLockedContentBySpace, getObjectType, getOldestPageCreationDate, 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, findAllSorted, refresh, remove, replicate, save, saveRaw
 

Constructor Detail

DefaultContentDao

public DefaultContentDao()
Method Detail

getById

public ContentEntityObject getById(long id)
Specified by:
getById in interface ContentDao
Specified by:
getById in interface ContentEntityObjectDao
Overrides:
getById in class ContentEntityObjectHibernateDao

getPersistentClass

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

getLatestContentCount

public int getLatestContentCount()
Specified by:
getLatestContentCount in interface ContentDao

getLatestOrderedWikiContentFromContentId

public java.util.List<ContentEntityObject> getLatestOrderedWikiContentFromContentId(long startContentId,
                                                                                    int maxRows)
Specified by:
getLatestOrderedWikiContentFromContentId in interface ContentDao
Parameters:
startContentId - start content id
maxRows - max rows
Returns:
the latest versions of wiki content within the specified bounds

getOrderedXhtmlContentFromContentId

public java.util.List<ContentEntityObject> getOrderedXhtmlContentFromContentId(long startContentId,
                                                                               int maxRows)
Description copied from interface: ContentDao

This is for internal use only, Do not rely on it as a public API. This is used to retrieve batches of data during migration or upgrades.

Warning: You will want to keep maxRows as small as possible because a list of CEO can be a very memory hungry structure. A good example is the default used in content migration which is 500.

Specified by:
getOrderedXhtmlContentFromContentId in interface ContentDao
Returns:
a list ordered by id of all the ContentEntityObjects with XHTML formatted bodies.

getLatestOrderedXhtmlContentFromContentIds

public java.util.List<ContentEntityObject> getLatestOrderedXhtmlContentFromContentIds(long startContentId,
                                                                                      long endContentId)
Description copied from interface: ContentDao

This is for internal use only, Do not rely on it as a public API. This is used to retrieve batches of data during migration or upgrades.

Warning: You will want to keep maxRows as small as possible because a list of CEO can be a very memory hungry structure. A good example is the default used in content migration which is 500.

Specified by:
getLatestOrderedXhtmlContentFromContentIds in interface ContentDao
Returns:
a list ordered by id of all the latest ContentEntityObjects with XHTML formatted bodies.

getLatestOrderedXhtmlContentIds

public java.util.List<java.lang.Long> getLatestOrderedXhtmlContentIds(long startContentId,
                                                                      int maxRows)
Description copied from interface: ContentDao

This is for internal use only, Do not rely on it as a public API. This is used to retrieve batches of data during migration or upgrades.

Specified by:
getLatestOrderedXhtmlContentIds in interface ContentDao
Returns:
a ordered list of IDs of all the latest ContentEntityObjects with XHTML formatted bodies.

getCountOfXhtmlContent

public int getCountOfXhtmlContent()
Description copied from interface: ContentDao

This is for internal use only, Do not rely on it as a public API.

This is used to calculate the amount of work required when migrating or upgrading content.

Specified by:
getCountOfXhtmlContent in interface ContentDao
Returns:
the number of CEO's with XHTML content.

getCountOfLatestXhtmlContent

public int getCountOfLatestXhtmlContent()
Description copied from interface: ContentDao

This is for internal use only, Do not rely on it as a public API.

This is used to calculate the amount of work required when migrating or upgrading content.

Specified by:
getCountOfLatestXhtmlContent in interface ContentDao
Returns:
the number of latest CEO's with XHTML content.

saveRawWithoutReindex

public void saveRawWithoutReindex(com.atlassian.core.bean.EntityObject objectToSave)
Description copied from interface: ContentDao

This is for internal use only, Do not rely on it as a public API.

Perform a saveRaw but without performing the re-index; it is unnecessary in the context of a migration or upgrade.

Specified by:
saveRawWithoutReindex in interface ContentDao

getMailEntitiesCount

public int getMailEntitiesCount()
Specified by:
getMailEntitiesCount in interface ContentDao

getMailEntities

public java.util.List<ContentEntityObject> getMailEntities(int startRow,
                                                           int maxRows)
Specified by:
getMailEntities in interface ContentDao

getXhtmlSpaceDescriptionsFromContentId

public java.util.List<ContentEntityObject> getXhtmlSpaceDescriptionsFromContentId(long startContentId,
                                                                                  int maxRows)
Description copied from interface: ContentDao

This is for internal use only, Do not rely on it as a public API. This is used to retrieve batches of data during migration or upgrades.

Warning: You will want to keep maxRows as small as possible because a list of CEO can be a very memory hungry structure. A good example is the default used in content migration which is 500.

Specified by:
getXhtmlSpaceDescriptionsFromContentId in interface ContentDao
Returns:
a list ordered by id of all the SpaceDescriptions with BodyContent of type BodyType.XHTML

getCountOfXhtmlSpaceDescriptions

public int getCountOfXhtmlSpaceDescriptions()
Description copied from interface: ContentDao

This is for internal use only, Do not rely on it as a public API.

This is used to calculate the amount of work required when migrating or upgrading content.

Specified by:
getCountOfXhtmlSpaceDescriptions in interface ContentDao
Returns:
the number of SpaceDescriptions with BodyContent of type BodyType.XHTML

updateModificationData

protected void updateModificationData(com.atlassian.core.bean.EntityObject objectToSave)
This method overrides the default behaviour which is to get the current user from a thread local and to set the last updated time to the current time. We do not want this for the migration. We do however need to set the creationdate if it is not set.

Overrides:
updateModificationData in class VersionedHibernateObjectDao
Parameters:
objectToSave -


Copyright © 2003-2013 Atlassian. All Rights Reserved.