Class DefaultContentDao

    • Constructor Detail

      • DefaultContentDao

        public DefaultContentDao()
    • Method Detail

      • getLatestOrderedWikiContentFromContentId

        public 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 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 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 List<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.
      • getXhtmlSpaceDescriptionsFromContentId

        public 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<ContentEntityObject>
        Parameters:
        objectToSave - the object that is about to be saved