com.atlassian.confluence.api.impl.service.content.typebinding
Class PageContentTypeApiSupport

java.lang.Object
  extended by com.atlassian.confluence.content.apisupport.BaseContentTypeApiSupport<Page>
      extended by com.atlassian.confluence.api.impl.service.content.typebinding.PageContentTypeApiSupport
All Implemented Interfaces:
ContentTypeApiSupport<Page>

public class PageContentTypeApiSupport
extends BaseContentTypeApiSupport<Page>

Provides Pages for the API.


Constructor Summary
PageContentTypeApiSupport(ContentFactory contentFactory, PageManagerInternal pageManager, PaginationService paginationService, ApiSupportProvider apiSupportProvider, ContentCreator contentCreator)
           
 
Method Summary
 Page create(Content newContent)
          Create a new persistent entity for the given api content
protected  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 support
 Map<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)
           
 boolean supportsChildrenOfType(ContentType parentType)
          A check that to allow other ContentTypeApiSupports to provide children for this type
 Page update(Content updatedContent, Page page)
          Updates an existing persistent entity from the given api content
 ValidationResult validateCreate(Content newContent)
          Validate the create operation
 ValidationResult validateUpdate(Content updatedContent, Page sceo)
          Validate the update operation
 
Methods inherited from class com.atlassian.confluence.content.apisupport.BaseContentTypeApiSupport
getChildren, getChildrenForThisType, getChildrenOfThisTypeForOtherType, getContainer, getLinks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageContentTypeApiSupport

public PageContentTypeApiSupport(ContentFactory contentFactory,
                                 PageManagerInternal pageManager,
                                 PaginationService paginationService,
                                 ApiSupportProvider apiSupportProvider,
                                 ContentCreator contentCreator)
Method Detail

getHandledType

public ContentType getHandledType()
Returns:
the ContentType of the Content that this service provides.

getChildrenForThisType

protected PageResponse<Content> getChildrenForThisType(Page content,
                                                       LimitedRequest limitedRequest,
                                                       Expansions expansions,
                                                       Depth depth)
Specified by:
getChildrenForThisType in class BaseContentTypeApiSupport<Page>

supportsChildrenOfType

public boolean supportsChildrenOfType(ContentType parentType)
Description copied from class: BaseContentTypeApiSupport
A check that to allow other ContentTypeApiSupports to provide children for this type

Specified by:
supportsChildrenOfType in interface ContentTypeApiSupport<Page>
Specified by:
supportsChildrenOfType in class BaseContentTypeApiSupport<Page>
Parameters:
parentType - - the other Content type that wants to offer children of our type
Returns:
true if the children should be allowed

getChildrenOfThisTypeForOtherType

protected PageResponse<Content> getChildrenOfThisTypeForOtherType(ContentConvertible otherTypeParent,
                                                                  LimitedRequest limitedRequest,
                                                                  Expansions expansions,
                                                                  Depth depth)
Specified by:
getChildrenOfThisTypeForOtherType in class BaseContentTypeApiSupport<Page>

supportsChildrenForParentType

public boolean supportsChildrenForParentType(ContentType parentType)
Specified by:
supportsChildrenForParentType in interface ContentTypeApiSupport<Page>
Specified by:
supportsChildrenForParentType in class BaseContentTypeApiSupport<Page>
Returns:
true if Content of this binding's ContentType can be a child of contentEntity of the given type

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 interface ContentTypeApiSupport<Page>
Overrides:
getExtensions in class BaseContentTypeApiSupport<Page>

validateCreate

public ValidationResult validateCreate(Content newContent)
Description copied from interface: ContentTypeApiSupport
Validate the create operation

Specified by:
validateCreate in interface ContentTypeApiSupport<Page>
Overrides:
validateCreate in class BaseContentTypeApiSupport<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 interface ContentTypeApiSupport<Page>
Overrides:
validateUpdate in class BaseContentTypeApiSupport<Page>
Parameters:
updatedContent - the content that will be used to update the entity
sceo - 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 interface ContentTypeApiSupport<Page>
Overrides:
create in class BaseContentTypeApiSupport<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 interface ContentTypeApiSupport<Page>
Overrides:
update in class BaseContentTypeApiSupport<Page>
Parameters:
updatedContent - the updated content
page - the existing entity
Returns:
the updated entity


Copyright © 2003–2015 Atlassian. All rights reserved.