Class PageContentTypeApiSupport
- java.lang.Object
-
- com.atlassian.confluence.content.apisupport.BaseContentTypeApiSupport<Page>
-
- com.atlassian.confluence.api.impl.service.content.typebinding.PageContentTypeApiSupport
-
- All Implemented Interfaces:
ContentTypeApiSupport<Page>
public class PageContentTypeApiSupport extends BaseContentTypeApiSupport<Page>
ProvidesPage
s for the API.
-
-
Constructor Summary
Constructors Constructor Description PageContentTypeApiSupport(ContentFactory contentFactory, PageManagerInternal pageManager, SpaceManager spaceManager, PaginationService paginationService, ApiSupportProvider apiSupportProvider, ContentCreator contentCreator, com.atlassian.event.api.EventPublisher eventPublisher, PageTemplateManager pageTemplateManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Page
create(Content newContent)
Create a new persistent entity for the given api contentprotected PageResponse<Content>
getChildrenForThisType(Page content, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
protected PageResponse<Content>
getChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
Class<Page>
getEntityClass()
Get the class of the hibernate object used to persist the content type handled by this api supportMap<ContentId,Map<String,Object>>
getExtensions(Iterable<Page> pages, 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 parentType)
Determines whether other ContentTypeApiSupports can provide children for this type.Page
update(Content updatedContent, Page page)
Updates an existing persistent entity from the given api contentValidationResult
validateCreate(Content newContent)
Validate the create operationValidationResult
validateUpdate(Content updatedContent, Page sceo)
Validate the update operation-
Methods inherited from class com.atlassian.confluence.content.apisupport.BaseContentTypeApiSupport
getChildren, getChildrenForThisType, getChildrenOfThisTypeForOtherType, getContainer, getFilteredChildrenForThisType, getFilteredChildrenOfThisTypeForOtherType, getLinks
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.content.apisupport.ContentTypeApiSupport
container, getFilteredChildren
-
-
-
-
Constructor Detail
-
PageContentTypeApiSupport
public PageContentTypeApiSupport(ContentFactory contentFactory, PageManagerInternal pageManager, SpaceManager spaceManager, PaginationService paginationService, ApiSupportProvider apiSupportProvider, ContentCreator contentCreator, com.atlassian.event.api.EventPublisher eventPublisher, PageTemplateManager pageTemplateManager)
-
-
Method Detail
-
getHandledType
public ContentType getHandledType()
- Returns:
- the
ContentType
of theContent
that this service provides.
-
getChildrenForThisType
protected PageResponse<Content> getChildrenForThisType(Page content, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
- Specified by:
getChildrenForThisType
in classBaseContentTypeApiSupport<Page>
-
supportsChildrenOfType
public boolean supportsChildrenOfType(ContentType parentType)
Description copied from interface:ContentTypeApiSupport
Determines whether other ContentTypeApiSupports can provide children for this type.For children of type
childType
to be allowed as children of this type, this type needs to returntrue
forsupportsChildrenOfType(childType)
, andchildType
needs to returntrue
forsupportsChildrenForParentType(thisType)
.- Parameters:
parentType
- the other Content type that wants to offer children below an instance of our type- Returns:
- true if
Content
ofotherType
'sContentType
should be allowed as children of this type (as far as this type is concerned:childType
also gets a say viaContentTypeApiSupport.supportsChildrenForParentType(ContentType)
) - See Also:
ContentTypeApiSupport.supportsChildrenForParentType(ContentType)
-
getChildrenOfThisTypeForOtherType
protected PageResponse<Content> getChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent, LimitedRequest limitedRequest, Expansions expansions, Depth depth)
- Specified by:
getChildrenOfThisTypeForOtherType
in classBaseContentTypeApiSupport<Page>
-
supportsChildrenForParentType
public boolean supportsChildrenForParentType(ContentType parentType)
Description copied from interface:ContentTypeApiSupport
Determines whether this ContentTypeApiSupport will provide children for other types.For children of this type to be allowed as children of
parentType
, this type needs to returntrue
forsupportsChildrenForParentType(parentType)
, andparentType
needs to returntrue
forsupportsChildrenOfType(thisType)
.- Parameters:
parentType
- the other Content type that our type is offering children to- Returns:
- true if
Content
of this type'sContentType
should be allowed to be a child ofparentType
(as far as this type is concerned:parentType
also gets a say viaContentTypeApiSupport.supportsChildrenOfType(ContentType)
) - See Also:
ContentTypeApiSupport.supportsChildrenOfType(ContentType)
-
getEntityClass
public Class<Page> getEntityClass()
Description copied from interface:ContentTypeApiSupport
Get the class of the hibernate object used to persist the content type handled by this api support- Returns:
- the class of the entity used to persist changes
-
getExtensions
public Map<ContentId,Map<String,Object>> getExtensions(Iterable<Page> pages, Expansions expansions)
Description copied from class:BaseContentTypeApiSupport
Get the set of extension properties for the collection of contentEntity Ids. Dealing with collections here may help reduce the number of db queries we need to execute.Implementors should override to provide extensions for the given contentEntity.
- Specified by:
getExtensions
in interfaceContentTypeApiSupport<Page>
- Overrides:
getExtensions
in classBaseContentTypeApiSupport<Page>
-
validateCreate
public ValidationResult validateCreate(Content newContent)
Description copied from interface:ContentTypeApiSupport
Validate the create operation- Specified by:
validateCreate
in interfaceContentTypeApiSupport<Page>
- Overrides:
validateCreate
in classBaseContentTypeApiSupport<Page>
- Parameters:
newContent
- the content that will be used to create an entity- Returns:
- a validation result wrapping any validation errors that were encountered
-
validateUpdate
public ValidationResult validateUpdate(Content updatedContent, Page sceo)
Description copied from interface:ContentTypeApiSupport
Validate the update operation- Specified by:
validateUpdate
in interfaceContentTypeApiSupport<Page>
- Overrides:
validateUpdate
in classBaseContentTypeApiSupport<Page>
- Parameters:
updatedContent
- the content that will be used to update the entitysceo
- the existing entity to be updated- Returns:
- a validation result wrapping any validation errors that were encountered
-
create
public Page create(Content newContent)
Description copied from interface:ContentTypeApiSupport
Create a new persistent entity for the given api content- Specified by:
create
in interfaceContentTypeApiSupport<Page>
- Overrides:
create
in classBaseContentTypeApiSupport<Page>
- Parameters:
newContent
- the model object to create a persistent entity for- Returns:
- the newly created persistent entity
-
update
public Page update(Content updatedContent, Page page)
Description copied from interface:ContentTypeApiSupport
Updates an existing persistent entity from the given api content- Specified by:
update
in interfaceContentTypeApiSupport<Page>
- Overrides:
update
in classBaseContentTypeApiSupport<Page>
- Parameters:
updatedContent
- the updated contentpage
- the existing entity- Returns:
- the updated entity
-
-