|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.core.DefaultContentEntityManager
public class DefaultContentEntityManager
Field Summary | |
---|---|
protected AttachmentManager |
attachmentManager
|
protected ContentEntityObjectDao |
contentEntityObjectDao
|
protected com.atlassian.event.EventManager |
eventManager
|
protected HibernateSessionManager |
hibernateSessionManager
|
protected ConfluenceIndexer |
indexer
|
protected LabelManager |
labelManager
|
protected LinkManager |
linkManager
|
Fields inherited from interface com.atlassian.confluence.core.ContentEntityManager |
---|
ITERATE_ALL |
Constructor Summary | |
---|---|
DefaultContentEntityManager()
|
Method Summary | ||
---|---|---|
Iterator |
getAllCurrentEntities()
|
|
ContentEntityObject |
getById(long id)
|
|
protected com.atlassian.event.EventManager |
getEventManager()
|
|
ContentEntityObject |
getNextVersion(ContentEntityObject ceo)
|
|
ContentEntityObject |
getOtherVersion(ContentEntityObject ceo,
int version)
|
|
protected PageDao |
getPageDao()
|
|
ContentEntityObject |
getPreviousVersion(ContentEntityObject ceo)
|
|
Iterator |
getRecentlyAddedEntities(String spaceKey,
int maxResults)
Retrieve an iterator of recently added entities, in order of most recent to last. |
|
Iterator |
getRecentlyModifiedEntities(String spaceKey,
int maxResults)
Retrieve an iterator of recently modified entities, in order of most recent to last. |
|
Iterator |
getRecentlyModifiedEntitiesForUser(String username)
Retrieve an iterator of recently modified entities, in order of most recent to last. |
|
List |
getRecentlyModifiedForChangeDigest(Date fromDate)
Retrieves a list of ContentEntityObject s that have been newly added or modified
since the date specified. |
|
List<VersionHistorySummary> |
getVersionHistorySummaries(ContentEntityObject ceo)
Get a VersionHistorySummary for all previous versions of a ContentEntityObject, starting with the current content. |
|
protected void |
publishCreateEvent(ContentEntityObject obj)
This method publishes *CreateEvents s. |
|
protected void |
publishRemoveEvent(ContentEntityObject obj)
This method publishes *RemoveEvent s. |
|
protected void |
publishUpdateEvent(ContentEntityObject obj,
ContentEntityObject origObj,
SaveContext saveContext)
This method publishes *UpdateEvent s. |
|
void |
refreshContentEntity(ContentEntityObject obj)
Refreshes the specified entity (including content) in the Hibernate session to ensure that subsequent retrievals are up-to-date. |
|
void |
removeContentEntity(ContentEntityObject obj)
Removes given content entity object and all associated domain objects i.e. |
|
void |
removeHistoricalVersion(ContentEntityObject historicalVersion)
Removes a historical ContentEntityObject. |
|
void |
revertContentEntityBackToVersion(ContentEntityObject obj,
int version)
|
|
void |
revertContentEntityBackToVersion(ContentEntityObject obj,
int version,
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)
|
|
|
saveNewVersion(T current,
Modification<T> modification)
Applies the state changes supplied by modification and persists those changes to a new version. |
|
|
saveNewVersion(T current,
Modification<T> modification,
SaveContext saveContext)
Applies the state changes supplied by modification and persists those changes to a new version. |
|
void |
setAttachmentManager(AttachmentManager attachmentManager)
|
|
void |
setContentEntityObjectDao(ContentEntityObjectDao contentEntityObjectDao)
|
|
void |
setEventManager(com.atlassian.event.EventManager eventManager)
|
|
void |
setHibernateSessionManager(HibernateSessionManager hibernateSessionManager)
|
|
void |
setIndexer(ConfluenceIndexer indexer)
|
|
void |
setLabelManager(LabelManager labelManager)
|
|
void |
setLinkManager(LinkManager linkManager)
|
|
void |
updateContentLinkingTo(SpaceContentEntityObject contentBeingRefactored,
String newSpaceKey,
String newTitle)
Deprecated. since 4.0. |
|
void |
updateContentLinkingTo(SpaceContentEntityObject contentBeingRefactored,
String newSpaceKey,
String newTitle,
boolean saveNewVersion)
Deprecated. since 4.0. |
|
void |
updateOutgoingLinksInContent(SpaceContentEntityObject contentBeingRefactored,
String newSpaceKey)
Deprecated. since 4.0. |
|
void |
updateOutgoingLinksInContent(SpaceContentEntityObject contentBeingRefactored,
String newSpaceKey,
boolean saveNewVersion)
Deprecated. since 4.0. |
|
void |
updateSingleContentLinkinTo(ContentEntityObject referringContent,
SpaceContentEntityObject contentBeingRefactored,
String newSpaceKey,
String newTitle)
Deprecated. since 4.0. |
|
void |
updateSingleContentLinkinTo(ContentEntityObject referringContent,
SpaceContentEntityObject contentBeingRefactored,
String newSpaceKey,
String newTitle,
SaveContext saveContext)
Deprecated. since 4.0. |
|
void |
updateSingleContentLinkinTo(ContentEntityObject referringContent,
SpaceContentEntityObject contentBeingRefactored,
String newSpaceKey,
String newTitle,
SaveContext saveContext,
boolean saveNewVersion)
Deprecated. since 4.0. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ContentEntityObjectDao contentEntityObjectDao
protected LinkManager linkManager
protected ConfluenceIndexer indexer
protected com.atlassian.event.EventManager eventManager
protected LabelManager labelManager
protected AttachmentManager attachmentManager
protected HibernateSessionManager hibernateSessionManager
Constructor Detail |
---|
public DefaultContentEntityManager()
Method Detail |
---|
public void refreshContentEntity(ContentEntityObject obj)
ContentEntityManager
refreshContentEntity
in interface ContentEntityManager
obj
- the object to be refreshed in the Hibernate session.public void saveContentEntity(ContentEntityObject obj, SaveContext saveContext)
saveContentEntity
in interface ContentEntityManager
obj
- - the ContentEntityObject
to savesaveContext
- - a SaveContext
object for the manager.public void saveContentEntity(ContentEntityObject obj, ContentEntityObject origObj, SaveContext saveContext)
ContentEntityManager
saveContentEntity
in interface ContentEntityManager
saveContext
- - a SaveContext
holding additional parameters for the manager to use when saving.public <T extends ContentEntityObject> void saveNewVersion(T current, Modification<T> modification)
ContentEntityManager
manager.<Page>saveNewVersion(page, new Modification<Page>() { public void modify(Page page) { page.setTitle("foobar"); } });
saveNewVersion
in interface ContentEntityManager
T
- the type content. This ensures that the type of current is the same as the type passed to the modificationcurrent
- the current / latest versionmodification
- an implementation of Modification
which describes the state changes you requirepublic <T extends ContentEntityObject> void saveNewVersion(T current, Modification<T> modification, SaveContext saveContext)
ContentEntityManager
manager.<Page>saveNewVersion(page, new Modification<Page>() { public void modify(Page page) { page.setTitle("foobar"); } }, new DefaultSaveContext());
saveNewVersion
in interface ContentEntityManager
T
- the type content. This ensures that the type of current is the same as the type passed to the modificationcurrent
- the current / latest versionmodification
- an implementation of Modification
which describes the state changes you requiresaveContext
- the save context (null if you have no specific requirements - or just use ContentEntityManager.saveNewVersion(ContentEntityObject, Modification)
).public void removeContentEntity(ContentEntityObject obj)
ContentEntityManager
removeContentEntity
in interface ContentEntityManager
public ContentEntityObject getById(long id)
getById
in interface ContentEntityManager
public void revertContentEntityBackToVersion(ContentEntityObject obj, int version)
revertContentEntityBackToVersion
in interface ContentEntityManager
public void revertContentEntityBackToVersion(ContentEntityObject obj, int version, String revertComment, boolean revertTitle)
ContentEntityManager
Reverts a ContentEntityObject
back to its state at the version specified by version
.
Creates a new latest version that resembles the previous state.
Since Confluence 4.0 most ContentEntityObjects are assumed to be XHTML formatted. So in reverting a ContentEntityObject which
actually has a WIKI BodyType
this will be migrated on the fly to XHTML.
revertContentEntityBackToVersion
in interface ContentEntityManager
obj
- The ContentEntityObject to revertversion
- The version to revert torevertComment
- A comment to be associated with the revertrevertTitle
- If true, the ContentEntityObject title will be reverted to the old statepublic Iterator getRecentlyAddedEntities(String spaceKey, int maxResults)
ContentEntityManager
getRecentlyAddedEntities
in interface ContentEntityManager
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.public Iterator getRecentlyModifiedEntities(String spaceKey, int maxResults)
ContentEntityManager
getRecentlyModifiedEntities
in interface ContentEntityManager
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.public Iterator getAllCurrentEntities()
getAllCurrentEntities
in interface ContentEntityManager
public Iterator getRecentlyModifiedEntitiesForUser(String username)
ContentEntityManager
getRecentlyModifiedEntitiesForUser
in interface ContentEntityManager
username
- the user for which to retrieve the modified contentpublic List getRecentlyModifiedForChangeDigest(Date fromDate)
ContentEntityManager
ContentEntityObject
s that have been newly added or modified
since the date specified. This list excludes drafts, space descriptions and mail.
getRecentlyModifiedForChangeDigest
in interface ContentEntityManager
fromDate
- content modified after this date will be returned
ContentEntityObject
s that have been newly added or modified
since the date specified@Deprecated public void updateOutgoingLinksInContent(SpaceContentEntityObject contentBeingRefactored, String newSpaceKey)
ContentEntityManager
updateOutgoingLinksInContent
in interface ContentEntityManager
@Deprecated public void updateOutgoingLinksInContent(SpaceContentEntityObject contentBeingRefactored, String newSpaceKey, boolean saveNewVersion)
@Deprecated public void updateContentLinkingTo(SpaceContentEntityObject contentBeingRefactored, String newSpaceKey, String newTitle)
ContentEntityManager
updateContentLinkingTo
in interface ContentEntityManager
@Deprecated public void updateContentLinkingTo(SpaceContentEntityObject contentBeingRefactored, String newSpaceKey, String newTitle, boolean saveNewVersion)
@Deprecated public void updateSingleContentLinkinTo(ContentEntityObject referringContent, SpaceContentEntityObject contentBeingRefactored, String newSpaceKey, String newTitle)
ContentEntityManager
updateSingleContentLinkinTo
in interface ContentEntityManager
@Deprecated public void updateSingleContentLinkinTo(ContentEntityObject referringContent, SpaceContentEntityObject contentBeingRefactored, String newSpaceKey, String newTitle, SaveContext saveContext)
updateSingleContentLinkinTo
in interface ContentEntityManager
@Deprecated public void updateSingleContentLinkinTo(ContentEntityObject referringContent, SpaceContentEntityObject contentBeingRefactored, String newSpaceKey, String newTitle, SaveContext saveContext, boolean saveNewVersion)
public ContentEntityObject getPreviousVersion(ContentEntityObject ceo)
getPreviousVersion
in interface ContentEntityManager
public ContentEntityObject getNextVersion(ContentEntityObject ceo)
getNextVersion
in interface ContentEntityManager
public ContentEntityObject getOtherVersion(ContentEntityObject ceo, int version)
getOtherVersion
in interface ContentEntityManager
public List<VersionHistorySummary> getVersionHistorySummaries(ContentEntityObject ceo)
ContentEntityManager
getVersionHistorySummaries
in interface ContentEntityManager
ceo
- the entity object to return the version history of
public void removeHistoricalVersion(ContentEntityObject historicalVersion)
ContentEntityManager
removeHistoricalVersion
in interface ContentEntityManager
historicalVersion
- a historical entity object to removeprotected PageDao getPageDao()
protected void publishCreateEvent(ContentEntityObject obj)
*CreateEvents
s.
Specific content entity object manager that need to publish those events should override this method.
obj
- the created content entity objectprotected void publishUpdateEvent(ContentEntityObject obj, ContentEntityObject origObj, SaveContext saveContext)
*UpdateEvent
s.
Specific content entity object manager that need to publish those events should override this method.
obj
- the updated content entity objectorigObj
- the old version of the content entity object, for history purposesaveContext
- the associated SaveContext
protected void publishRemoveEvent(ContentEntityObject obj)
*RemoveEvent
s.
Specific content entity object manager that need to publish those events should override this method.
obj
- the removed content entity objectpublic void setEventManager(com.atlassian.event.EventManager eventManager)
setEventManager
in interface ContentEntityManager
public void setLabelManager(LabelManager labelManager)
protected com.atlassian.event.EventManager getEventManager()
public void setIndexer(ConfluenceIndexer indexer)
public void setAttachmentManager(AttachmentManager attachmentManager)
public void setContentEntityObjectDao(ContentEntityObjectDao contentEntityObjectDao)
public void setLinkManager(LinkManager linkManager)
public void setHibernateSessionManager(HibernateSessionManager hibernateSessionManager)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |