@ExperimentalSpi public class ContentCreator extends Object
BaseContentTypeApiSupport
Constructor and Description |
---|
ContentCreator(SpaceManager spaceManager,
ContentBodyConversionService contentBodyConversionService,
PermissionManager permissionManager,
PageManagerInternal pageManager,
CustomContentManager customContentEntityManager,
com.atlassian.event.api.EventPublisher eventPublisher,
DraftAttributesCopier draftAttributesCopier,
LabelManagerInternal labelManager,
RelationManager relationManager,
ContentEntityManagerInternal contentEntityManager) |
Modifier and Type | Method and Description |
---|---|
<T extends ContentEntityObject> |
cloneForUpdate(T ceo) |
<T extends ContentEntityObject> |
saveForCreate(T entity)
Deprecated.
since 6.13.0, use
saveNewContent(ContentEntityObject, Version, Draft) |
<T extends ContentEntityObject> |
saveForCreate(T entity,
com.atlassian.fugue.Option<Draft> draft)
Deprecated.
since 6.13.0, use
saveNewContent(ContentEntityObject, Version, Draft) |
<T extends ContentEntityObject> |
saveForCreate(T entity,
@Nullable Version version,
com.atlassian.fugue.Option<Draft> draft)
Deprecated.
since 7.0.1. Use
saveNewContent(ContentEntityObject, Version, Draft) |
<T extends ContentEntityObject> |
saveNewContent(T entity,
@Nullable Version version,
@Nullable Draft draft)
Save a newly created content entity object
|
<T extends ContentEntityObject> |
saveNewVersion(T ceo,
T originalCEO,
Version version)
Save a new version of the CEO due to an update
|
boolean |
setCommonMetadata(Content updatedContent,
ContentEntityObject entity)
Sets the common metadata on the entity
|
void |
setCommonPropertiesForCreate(Content newContent,
ContentEntityObject entity,
com.atlassian.user.User authenticatedUser)
Sets common properties on a newly created entity in preparation for being saved.
|
boolean |
setCommonPropertiesForUpdate(Content updatedContent,
ContentEntityObject entity)
Sets common properties on the entity in preparation for an update.
|
boolean |
setContentBodyOnEntity(Content updatedContent,
ContentEntityObject entity)
Sets the body content in updatedContent on the entity
|
boolean |
setContentStatusOnEntity(Content updatedContent,
ContentEntityObject entity)
Sets the content status from updatedContent on the entity
|
boolean |
setLabelsMetadataOnEntity(Content updatedContent,
ContentEntityObject entity)
Sets the labels metadata on the entity
|
void |
setSpaceForCreate(Content newContent,
SpaceContentEntityObject spacedEntity,
com.atlassian.user.User authenticatedUser)
Sets the space in newContent on this spacedEntity
|
boolean |
setTitleOnEntity(Content updatedContent,
ContentEntityObject entity)
Sets the title in updatedContent on the entity
|
<T extends ContentEntityObject> |
update(T ceo,
T originalCEO,
Version version)
Saves CEO
|
ValidationResult |
validateCreate(ConfluenceUser confluenceUser,
Content newContent,
Class<? extends ContentEntityObject> entityClass)
Perform common validation checks for creation of content in a space
|
ValidationResult |
validateUpdate(ConfluenceUser user,
Content updatedContent,
ContentEntityObject entity)
Perform common validation checks for updating content
|
public ContentCreator(SpaceManager spaceManager, ContentBodyConversionService contentBodyConversionService, PermissionManager permissionManager, PageManagerInternal pageManager, CustomContentManager customContentEntityManager, com.atlassian.event.api.EventPublisher eventPublisher, DraftAttributesCopier draftAttributesCopier, LabelManagerInternal labelManager, RelationManager relationManager, ContentEntityManagerInternal contentEntityManager)
public void setCommonPropertiesForCreate(Content newContent, ContentEntityObject entity, com.atlassian.user.User authenticatedUser)
The properties set include the title and content body, and if the entity is a SpacedContentEntityObject also the space
newContent
- the content containing the new properties to set on the entityentity
- the entity to set the new properties onauthenticatedUser
- the user that performing the operationpublic ValidationResult validateUpdate(ConfluenceUser user, Content updatedContent, ContentEntityObject entity)
user
- the user to perform permission checks onupdatedContent
- the content to be updatedentity
- the entity to be updatedpublic ValidationResult validateCreate(ConfluenceUser confluenceUser, Content newContent, Class<? extends ContentEntityObject> entityClass)
confluenceUser
- the user to perform permission checks onnewContent
- the content to be createdentityClass
- the class of content to createpublic boolean setCommonPropertiesForUpdate(Content updatedContent, ContentEntityObject entity)
updatedContent
- the content containing the properties to update on the entityentity
- the entity to be updatedpublic boolean setLabelsMetadataOnEntity(Content updatedContent, ContentEntityObject entity)
updatedContent
- the content with the new body contententity
- the entity to be updatedpublic boolean setCommonMetadata(Content updatedContent, ContentEntityObject entity)
updatedContent
- the content containing the properties to update on the entityentity
- the entity to be updatedpublic boolean setTitleOnEntity(Content updatedContent, ContentEntityObject entity)
updatedContent
- the content with the new titleentity
- the entity to be updatedpublic boolean setContentBodyOnEntity(Content updatedContent, ContentEntityObject entity)
updatedContent
- the content with the new body contententity
- the entity to be updatedpublic boolean setContentStatusOnEntity(Content updatedContent, ContentEntityObject entity)
updatedContent
- the content with the new titleentity
- the entity to be updatedpublic void setSpaceForCreate(Content newContent, SpaceContentEntityObject spacedEntity, com.atlassian.user.User authenticatedUser)
newContent
- the content with the new space to setspacedEntity
- the entity to be updated with the spacepublic <T extends ContentEntityObject> T saveNewVersion(T ceo, T originalCEO, Version version)
ceo
- the new version of the CEOoriginalCEO
- the original version of the ceoversion
- the version object with information about the new version to be savedpublic <T extends ContentEntityObject> T update(T ceo, T originalCEO, Version version)
ceo
- CEOoriginalCEO
- ceo we are updating fromversion
- current version to update to@Deprecated public <T extends ContentEntityObject> T saveForCreate(T entity)
saveNewContent(ContentEntityObject, Version, Draft)
entity
- the newly created CEO@Deprecated public <T extends ContentEntityObject> T saveForCreate(T entity, com.atlassian.fugue.Option<Draft> draft)
saveNewContent(ContentEntityObject, Version, Draft)
entity
- the newly created CEOdraft
- the draft object contains metadata which will be transferred into the entity@Deprecated public <T extends ContentEntityObject> T saveForCreate(T entity, @Nullable Version version, com.atlassian.fugue.Option<Draft> draft)
saveNewContent(ContentEntityObject, Version, Draft)
entity
- the entity object to be savedversion
- the versiondraft
- the draft object contains metadata which will be transferred into the entitypublic <T extends ContentEntityObject> T saveNewContent(T entity, @Nullable Version version, @Nullable Draft draft)
entity
- the entity object to be savedversion
- the versiondraft
- the draft object contains metadata which will be transferred into the entity. Can be null.public <T extends ContentEntityObject> T cloneForUpdate(T ceo)
Copyright © 2003–2020 Atlassian. All rights reserved.