public class DummyAvailableContentTypeSupport extends CustomContentTypeApiSupport
Modifier and Type | Field and Description |
---|---|
static ContentType |
contentType |
static String |
moduleKey |
Constructor and Description |
---|
DummyAvailableContentTypeSupport(CustomContentApiSupportParams parentParams) |
Modifier and Type | Method and Description |
---|---|
protected void |
createCustomContentEntity(Content content,
CustomContentEntityObject newVersion)
Set the extension properties on the entity.
|
protected PageResponse<Content> |
getChildrenForThisType(CustomContentEntityObject content,
LimitedRequest limitedRequest,
Expansions expansions,
Depth depth) |
Class<CustomContentEntityObject> |
getEntityClass()
Get the class of the hibernate object used to persist the content type handled by this api support
|
Map<ContentId,Map<String,Object>> |
getExtensions(Iterable<CustomContentEntityObject> contentEntities,
Expansions expansions)
Get the set of extension properties for the collection of contentEntity Ids.
|
ContentType |
getHandledType() |
boolean |
supportsChildrenForParentType(ContentType parentType)
Determines whether this ContentTypeApiSupport will provide children for other types.
|
boolean |
supportsChildrenOfType(ContentType otherType)
Determines whether other ContentTypeApiSupports can provide children for this type.
|
protected boolean |
updateCustomContentEntity(Content content,
CustomContentEntityObject newVersion,
CustomContentEntityObject original)
Set the extension properties on the entity.
|
ValidationResult |
validateCreate(Content newContent)
Validate the create operation
|
ValidationResult |
validateUpdate(Content updatedContent,
CustomContentEntityObject existingEntity)
Validate the update operation
|
create, getChildrenOfThisTypeForOtherType, getChildrenOfThisTypeForOtherType, update
getChildren, getChildrenForThisType, getContainer, getFilteredChildrenForThisType, getFilteredChildrenOfThisTypeForOtherType, getLinks
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
container, getFilteredChildren
public static final String moduleKey
public static final ContentType contentType
public DummyAvailableContentTypeSupport(CustomContentApiSupportParams parentParams)
public ContentType getHandledType()
ContentType
of the Content
that this service provides.protected PageResponse<Content> getChildrenForThisType(CustomContentEntityObject content, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
getChildrenForThisType
in class BaseContentTypeApiSupport<CustomContentEntityObject>
public boolean supportsChildrenOfType(ContentType otherType)
ContentTypeApiSupport
For children of type childType
to be allowed as children of this type,
this type needs to return true
for
supportsChildrenOfType(childType)
,
and childType
needs to return true
for
supportsChildrenForParentType(thisType)
.
otherType
- the other Content type that wants to offer children below an instance of our typeContent
of otherType
's ContentType
should be allowed
as children of this type (as far as this type is concerned:
childType
also gets a say via ContentTypeApiSupport.supportsChildrenForParentType(ContentType)
)ContentTypeApiSupport.supportsChildrenForParentType(ContentType)
public boolean supportsChildrenForParentType(ContentType parentType)
ContentTypeApiSupport
For children of this type to be allowed as children of parentType
,
this type needs to return true
for
supportsChildrenForParentType(parentType)
,
and parentType
needs to return true
for
supportsChildrenOfType(thisType)
.
parentType
- the other Content type that our type is offering children toContent
of this type's ContentType
should be allowed to be a child of
parentType
(as far as this type is concerned:
parentType
also gets a say via ContentTypeApiSupport.supportsChildrenOfType(ContentType)
)ContentTypeApiSupport.supportsChildrenOfType(ContentType)
public Map<ContentId,Map<String,Object>> getExtensions(Iterable<CustomContentEntityObject> contentEntities, Expansions expansions)
BaseContentTypeApiSupport
Implementors should override to provide extensions for the given contentEntity.
getExtensions
in interface ContentTypeApiSupport<CustomContentEntityObject>
getExtensions
in class BaseContentTypeApiSupport<CustomContentEntityObject>
public Class<CustomContentEntityObject> getEntityClass()
ContentTypeApiSupport
getEntityClass
in interface ContentTypeApiSupport<CustomContentEntityObject>
getEntityClass
in class CustomContentTypeApiSupport
protected boolean updateCustomContentEntity(Content content, CustomContentEntityObject newVersion, CustomContentEntityObject original)
CustomContentTypeApiSupport
Implementors can also use this hook to fire relevant update events
This method will be called from the default update method in this class. Common properties, including body and title are populated before this methods is called.
Implementors that override create and update methods directly in this class should call this method for consistency.
updateCustomContentEntity
in class CustomContentTypeApiSupport
content
- the map of extension properties to set on the entitynewVersion
- the entity to updateoriginal
- the original copy of the entityprotected void createCustomContentEntity(Content content, CustomContentEntityObject newVersion)
CustomContentTypeApiSupport
Implementors can also use this hook to fire relevant create events
This method will be called from the default create method in this class. Common properties, including title, space and body are populated before this method is called.
Implementors that override create and update behaviour directly in this class should call this method for consistency.
createCustomContentEntity
in class CustomContentTypeApiSupport
content
- the map of extension properties to set on the entitynewVersion
- the entity to updatepublic ValidationResult validateCreate(Content newContent)
ContentTypeApiSupport
validateCreate
in interface ContentTypeApiSupport<CustomContentEntityObject>
validateCreate
in class BaseContentTypeApiSupport<CustomContentEntityObject>
newContent
- the content that will be used to create an entitypublic ValidationResult validateUpdate(Content updatedContent, CustomContentEntityObject existingEntity)
ContentTypeApiSupport
validateUpdate
in interface ContentTypeApiSupport<CustomContentEntityObject>
validateUpdate
in class BaseContentTypeApiSupport<CustomContentEntityObject>
updatedContent
- the content that will be used to update the entityexistingEntity
- the existing entity to be updatedCopyright © 2003–2020 Atlassian. All rights reserved.