com.atlassian.confluence.core
Interface ContentEntityManager

All Known Subinterfaces:
CommentManager, MailContentManager, PageManager, SpaceDescriptionManager, UserStatusManager
All Known Implementing Classes:
DefaultCommentManager, DefaultContentEntityManager, DefaultMailContentManager, DefaultPageManager, DefaultPersonalInformationManager, DefaultSpaceDescriptionManager, DefaultUserStatusManager

public interface ContentEntityManager


Field Summary
static int ITERATE_ALL
           
 
Method Summary
 java.util.Iterator getAllCurrentEntities()
          Deprecated. since 3.1 do not use. Retrieving all content in the system may cause performance issues.
 ContentEntityObject getById(long id)
           
 java.util.List getLockedBySpace(java.lang.String spaceKey)
          Deprecated. since 2.10. There is no replacement as this functionality was superseded by multiple page permissions (CONF-3701)
 ContentEntityObject getNextVersion(ContentEntityObject ceo)
           
 ContentEntityObject getOtherVersion(ContentEntityObject ceo, int version)
           
 ContentEntityObject getPreviousVersion(ContentEntityObject ceo)
           
 java.util.Iterator getRecentlyAddedEntities(java.lang.String spaceKey, int maxResults)
          Retrieve an iterator of recently added entities, in order of most recent to last.
 java.util.Iterator getRecentlyModifiedEntities(java.lang.String spaceKey, int maxResults)
          Retrieve an iterator of recently modified entities, in order of most recent to last.
 java.util.Iterator getRecentlyModifiedEntitiesForUser(java.lang.String username)
          Retrieve an iterator of recently modified entities, in order of most recent to last.
 java.util.List getRecentlyModifiedForChangeDigest(java.util.Date fromDate)
          Retrieves a list of ContentEntityObjects that have been newly added or modified since the date specified.
 java.util.List<VersionHistorySummary> getVersionHistorySummaries(ContentEntityObject ceo)
          Get a VersionHistorySummary for all previous versions of a ContentEntityObject, starting with the current content.
 void refreshContentEntity(ContentEntityObject obj)
          Deprecated. since 3.1 method is not used
 void removeContentEntity(ContentEntityObject obj)
          Removes given content entity object and all associated domain objects i.e.
 void revertContentEntityBackToVersion(ContentEntityObject obj, int version)
          Deprecated. since 2.9, use revertContentEntityBackToVersion(ContentEntityObject,int, String, boolean) instead
 void revertContentEntityBackToVersion(ContentEntityObject obj, int version, java.lang.String revertComment, boolean revertTitle)
          Reverts a ContentEntityObject back to its state at the version specified by version.
 void saveContentEntity(ContentEntityObject obj, ContentEntityObject origObj, SaveContext saveContext)
          In order to create a history for this object, we need to pass in the modified as well as the original version of the object.
 void saveContentEntity(ContentEntityObject obj, SaveContext saveContext)
           
 void setEventManager(com.atlassian.event.EventManager eventManager)
          Deprecated. since 3.1 do not use. Implementation detail mistakenly added to service interface.
 void updateContentLinkingTo(SpaceContentEntityObject contentBeingRefactored, java.lang.String newSpaceKey, java.lang.String newTitle)
          Loops through all the content that currently links to 'contentBeingChanged' and renames all the links.
 void updateOutgoingLinksInContent(SpaceContentEntityObject contentBeingRefactored, java.lang.String newSpaceKey)
          Update the links on the page itself.
 void updateSingleContentLinkinTo(ContentEntityObject referringContent, SpaceContentEntityObject contentBeingRefactored, java.lang.String newSpaceKey, java.lang.String newTitle)
          Renames all links contained in the 'referringContent' that currently links to 'contentBeingRefactored'.
 void updateSingleContentLinkinTo(ContentEntityObject referringContent, SpaceContentEntityObject contentBeingRefactored, java.lang.String newSpaceKey, java.lang.String newTitle, SaveContext saveContext)
           
 

Field Detail

ITERATE_ALL

static final int ITERATE_ALL
See Also:
Constant Field Values
Method Detail

saveContentEntity

void saveContentEntity(ContentEntityObject obj,
                       SaveContext saveContext)
Parameters:
obj - - the ContentEntityObject to save
saveContext - - a SaveContext object for the manager.

saveContentEntity

void saveContentEntity(ContentEntityObject obj,
                       ContentEntityObject origObj,
                       SaveContext saveContext)
In order to create a history for this object, we need to pass in the modified as well as the original version of the object.

Parameters:
saveContext - - a SaveContext holding additional parameters for the manager to use when saving.

removeContentEntity

void removeContentEntity(ContentEntityObject obj)
Removes given content entity object and all associated domain objects i.e. if we remove a page it removes all its labels and attachments


refreshContentEntity

void refreshContentEntity(ContentEntityObject obj)
Deprecated. since 3.1 method is not used


revertContentEntityBackToVersion

void revertContentEntityBackToVersion(ContentEntityObject obj,
                                      int version)
Deprecated. since 2.9, use revertContentEntityBackToVersion(ContentEntityObject,int, String, boolean) instead


revertContentEntityBackToVersion

void revertContentEntityBackToVersion(ContentEntityObject obj,
                                      int version,
                                      java.lang.String revertComment,
                                      boolean revertTitle)
Reverts a ContentEntityObject back to its state at the version specified by version. Creates a new latest version that resembles the previous state.

Parameters:
obj - The ContentEntityObject to revert
version - The version to revert to
revertComment - A comment to be associated with the revert
revertTitle - If true, the ContentEntityObject title will be reverted to the old state

getRecentlyAddedEntities

java.util.Iterator getRecentlyAddedEntities(java.lang.String spaceKey,
                                            int maxResults)
Retrieve an iterator of recently added entities, in order of most recent to last. The iterator is lazy-loading, so you can filter the output and return the first 'n' that interest you. For performance reasons, it's a VERY bad idea to supply both a space key, and infinite results. If you supply a space key, this WILL NOT RETURN ANY COMMENTS. There is currently no way around this, you have to retrieve comments separately and splice the results together. Sorry.

Parameters:
spaceKey - the space key to look up the entities for. If spaceKey is null, there is assumed to be no space, and things like user info and space descriptions will also be returned.
maxResults - the maximum number of entities to return in the iterator. Any number zero or less (Use the ITERATE_ALL constant) will cause the iterator to go over every entity.

getRecentlyModifiedEntities

java.util.Iterator getRecentlyModifiedEntities(java.lang.String spaceKey,
                                               int maxResults)
Retrieve an iterator of recently modified entities, in order of most recent to last. The iterator is lazy-loading, so you can filter the output and return the first 'n' that interest you. For performance reasons, it's a VERY bad idea to supply both a space key, and infinite results.

Parameters:
spaceKey - the space key to look up the entities for.
maxResults - the maximum number of entities to return in the iterator. Any number zero or less (Use the ITERATE_ALL constant) will cause the iterator to go over every entity.

getAllCurrentEntities

java.util.Iterator getAllCurrentEntities()
Deprecated. since 3.1 do not use. Retrieving all content in the system may cause performance issues.


getRecentlyModifiedForChangeDigest

java.util.List getRecentlyModifiedForChangeDigest(java.util.Date fromDate)
Retrieves a list of ContentEntityObjects that have been newly added or modified since the date specified. This list excludes drafts, space descriptions and mail.

Parameters:
fromDate - content modified after this date will be returned
Returns:
a list of ContentEntityObjects that have been newly added or modified since the date specified

getRecentlyModifiedEntitiesForUser

java.util.Iterator getRecentlyModifiedEntitiesForUser(java.lang.String username)
Retrieve an iterator of recently modified entities, in order of most recent to last. The iterator is lazy-loading, so you can filter the output and return the first 'n' that interest you.

Parameters:
username - the user for which to retrieve the modified content

getLockedBySpace

@Deprecated
java.util.List getLockedBySpace(java.lang.String spaceKey)
Deprecated. since 2.10. There is no replacement as this functionality was superseded by multiple page permissions (CONF-3701)


getById

ContentEntityObject getById(long id)

updateContentLinkingTo

void updateContentLinkingTo(SpaceContentEntityObject contentBeingRefactored,
                            java.lang.String newSpaceKey,
                            java.lang.String newTitle)
Loops through all the content that currently links to 'contentBeingChanged' and renames all the links.
This will skip any referring content that is the 'contentBeingChanged' (i.e. content links to itself).
If you only want to change the links of a specific content object, use the 'updateSingleContentLinkinTo' function.
This rename will be recorded in the content's history


updateOutgoingLinksInContent

void updateOutgoingLinksInContent(SpaceContentEntityObject contentBeingRefactored,
                                  java.lang.String newSpaceKey)
Update the links on the page itself. If links are local (refering to the current space), a spacekey has to be added to the link


updateSingleContentLinkinTo

void updateSingleContentLinkinTo(ContentEntityObject referringContent,
                                 SpaceContentEntityObject contentBeingRefactored,
                                 java.lang.String newSpaceKey,
                                 java.lang.String newTitle)
Renames all links contained in the 'referringContent' that currently links to 'contentBeingRefactored'.
This rename will be recorded in the content's history


updateSingleContentLinkinTo

void updateSingleContentLinkinTo(ContentEntityObject referringContent,
                                 SpaceContentEntityObject contentBeingRefactored,
                                 java.lang.String newSpaceKey,
                                 java.lang.String newTitle,
                                 SaveContext saveContext)

setEventManager

void setEventManager(com.atlassian.event.EventManager eventManager)
Deprecated. since 3.1 do not use. Implementation detail mistakenly added to service interface.


getPreviousVersion

ContentEntityObject getPreviousVersion(ContentEntityObject ceo)

getNextVersion

ContentEntityObject getNextVersion(ContentEntityObject ceo)

getOtherVersion

ContentEntityObject getOtherVersion(ContentEntityObject ceo,
                                    int version)

getVersionHistorySummaries

java.util.List<VersionHistorySummary> getVersionHistorySummaries(ContentEntityObject ceo)
Get a VersionHistorySummary for all previous versions of a ContentEntityObject, starting with the current content.

Parameters:
ceo - the entity object to return the version history of
Returns:
the full version history of that object, as VersionHistorySummary objects.


Copyright © 2003-2011 Atlassian. All Rights Reserved.