Interface ContentDraftManagerInternal
-
- All Known Subinterfaces:
ContentEntityManagerInternal
- All Known Implementing Classes:
DefaultCommentManager,DefaultContentEntityManager,DefaultCustomContentManager,DefaultPageManager,DefaultPersonalInformationManager,DefaultSpaceDescriptionManager
public interface ContentDraftManagerInternalInternal manager for common handling of drafts; see the package-info.java for rationale.- See Also:
ContentEntityObject.DRAFT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends ContentEntityObject>
TcreateDraft(T obj, SaveContext saveContext)This method sets the common properties of theContentEntityObjectto be saved as a draft<T extends ContentEntityObject>
List<T>findAllDraftsFor(long contentId)Retrieves a list of drafts for the given content ID if any exist.List<ContentEntityObject>findAllDraftsWithUnpublishedChangesForUser(String creatorName)Retrieves the drafts for the givenUser<T extends ContentEntityObject>
TfindDraftFor(long contentId)Retrieves the draft for the given content ID if it exists<T extends ContentEntityObject>
TfindDraftFor(T ceo)Retrieves the draft for the given content if exists.List<ContentEntityObject>findUnpublishedContentWithUserContributions(String username)Retrieves the drafts for the givenUserIMPORTANT: this method doesn't return published shared drafts, only personal drafts and unpublished shared drafts
-
-
-
Method Detail
-
createDraft
<T extends ContentEntityObject> T createDraft(T obj, SaveContext saveContext)
This method sets the common properties of theContentEntityObjectto be saved as a draft- Parameters:
obj- - theContentEntityObjectto save as draftsaveContext- - aSaveContextholding additional parameters for the manager to use when saving.- Returns:
- the obj created as draft
- See Also:
ContentEntityObject.DRAFT
-
findDraftFor
<T extends ContentEntityObject> T findDraftFor(T ceo)
Retrieves the draft for the given content if exists.- Parameters:
ceo- the entity object to retrieve the draft for- Returns:
- the draft for the given content if exists, null otherwise
- See Also:
ContentEntityObject.DRAFT
-
findAllDraftsFor
<T extends ContentEntityObject> List<T> findAllDraftsFor(long contentId)
Retrieves a list of drafts for the given content ID if any exist.- Parameters:
contentId- The content ID used to identify the drafts- Returns:
- A non-null list of drafts with 0 or more elements
- Since:
- 6.0.6
- See Also:
ContentEntityObject.DRAFT
-
findDraftFor
<T extends ContentEntityObject> T findDraftFor(long contentId)
Retrieves the draft for the given content ID if it exists- Parameters:
contentId- The content ID used to identify the draft- Returns:
- the draft for the given content ID if it exists, null otherwise
- See Also:
ContentEntityObject.DRAFT
-
findUnpublishedContentWithUserContributions
List<ContentEntityObject> findUnpublishedContentWithUserContributions(String username)
Retrieves the drafts for the givenUserIMPORTANT: this method doesn't return published shared drafts, only personal drafts and unpublished shared drafts- Parameters:
username- the owner of the drafts- Returns:
- a list of
ContentEntityObjectwith theContentEntityObject.DRAFTstatus
-
findAllDraftsWithUnpublishedChangesForUser
List<ContentEntityObject> findAllDraftsWithUnpublishedChangesForUser(String creatorName)
Retrieves the drafts for the givenUser- Parameters:
creatorName- the owner of the drafts- Returns:
- a list of user's drafts (
ContentEntityObjectobjejcts)
-
-