Class History
- java.lang.Object
-
- com.atlassian.confluence.api.model.content.History
-
- All Implemented Interfaces:
NavigationAware
@ExperimentalApi public class History extends Object implements NavigationAware
Contains the history of a piece ofContent.History refers to the published version of Content. Be careful when using
expand=historywhen looking at content withstatus=draft: the information will refer to the published Content, if any. See the javadoc on individual methods for more details, e.g.getCreatedDate(),getLastUpdatedRef(),getNextVersionRef().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHistory.ExpansionsProvides property names that can be used to expandHistoryobjects.static classHistory.HistoryBuilderCreatesHistoryinstances.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static History.HistoryBuilderbuilder()static Reference<History>buildReference(Reference<Content> contentParent)Reference<Content>getContentParentRef()Reference<Contributors>getContributors()PersongetCreatedBy()Get the original creator of the first published non-draft version of the content.org.joda.time.DateTimegetCreatedDate()Get the original publish time of the first published non-draft version of the content.Reference<Version>getLastUpdatedRef()Get information about the latest published non-draft version of the content.Reference<Version>getNextVersionRef()Get the next version, if this is not the newest version.static Reference<Content>getParentReference(Reference<History> historyReference)Reference<Version>getPreviousVersionRef()Get the previous version, if this is not the oldest version.booleanisLatest()Is this the latest published (non-draft) version of the content?Navigation.BuilderresolveNavigation(NavigationService navigationService)
-
-
-
Method Detail
-
builder
public static History.HistoryBuilder builder()
-
getParentReference
public static Reference<Content> getParentReference(Reference<History> historyReference)
-
getLastUpdatedRef
public Reference<Version> getLastUpdatedRef()
Get information about the latest published non-draft version of the content.Special notes for drafts:
- For drafts of existing published content, this shows the last published version, not the draft.
- For drafts of new content (unpublished), this will be an empty reference, because there is no history yet.
expand=version.- Returns:
- the latest published non-draft version, or an empty reference if this is an unpublished draft
-
getNextVersionRef
public Reference<Version> getNextVersionRef()
Get the next version, if this is not the newest version.Note draft content only has a single version, so will return an empty reference.
- Returns:
- the next version, or an empty reference if there is no next version or if draft
-
getPreviousVersionRef
public Reference<Version> getPreviousVersionRef()
Get the previous version, if this is not the oldest version.Note draft content only has a single version, so will return an empty reference.
- Returns:
- the previous version, or an empty reference if there is no previous version or if draft
-
isLatest
public boolean isLatest()
Is this the latest published (non-draft) version of the content?This method will always return
falsefor draft content.- Returns:
- true if this content is the highest version (hence it will have no
nextVersion); false if not highest, or if draft
-
getCreatedBy
public Person getCreatedBy()
Get the original creator of the first published non-draft version of the content.Special notes for drafts:
- For drafts of existing published content, this shows the original creator, not the draft editor.
- For drafts of new content (unpublished), this will be null, because there is no history yet.
expand=versionand seeVersion.getBy().- Returns:
- the creator of the first published non-draft version, or null if this is an unpublished draft
-
getCreatedDate
public org.joda.time.DateTime getCreatedDate()
Get the original publish time of the first published non-draft version of the content.Special notes for drafts:
- For drafts of existing published content, this shows the original publish time, not the draft modification time.
- For drafts of new content (unpublished), this will be null, because there is no history yet.
expand=versionand seeVersion.getWhen().- Returns:
- the publish time of the first published non-draft version, or null if this is an unpublished draft
-
getContributors
public Reference<Contributors> getContributors()
-
resolveNavigation
public Navigation.Builder resolveNavigation(NavigationService navigationService)
- Specified by:
resolveNavigationin interfaceNavigationAware
-
-