|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.api.impl.service.content.ContentServiceImpl
public class ContentServiceImpl
Server implementation of the ContentService
. Contrast with the RemoteContentService.
Nested Class Summary | |
---|---|
class |
ContentServiceImpl.ValidatorImpl
|
Nested classes/interfaces inherited from interface com.atlassian.confluence.api.service.content.ContentService |
---|
ContentService.ContentFetcher, ContentService.ContentFinder, ContentService.ParameterContentFinder, ContentService.SingleContentFetcher, ContentService.Validator |
Constructor Summary | |
---|---|
ContentServiceImpl(PermissionManager permissionManager,
ContentFactory contentFactory,
AttachmentService attachmentService,
ContentFinderFactory contentFinderFactory,
ContentTrashService trashService,
ApiSupportProvider apiSupportProvider,
ContentEntityManagerInternal contentEntityManager)
|
Method Summary | |
---|---|
Content |
buildContent(ContentEntityObject entity,
List<ContentStatus> statuses,
Expansion... expansions)
|
Content |
create(Content newContent)
Create a piece of content. |
void |
delete(Content content)
Removes a piece of Content from the system. |
ContentService.ContentFinder |
find(Expansion... expansions)
Create a ContentFinder for locating content, the expansions will be applied to each piece of content that matches the finder. |
void |
setPermissionManager(PermissionManager permissionManager)
|
Content |
update(Content updatedContent)
Updates a piece of content. |
ContentServiceImpl.ValidatorImpl |
validator()
Get the validator view of the ContentService. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContentServiceImpl(PermissionManager permissionManager, ContentFactory contentFactory, AttachmentService attachmentService, ContentFinderFactory contentFinderFactory, ContentTrashService trashService, ApiSupportProvider apiSupportProvider, ContentEntityManagerInternal contentEntityManager)
Method Detail |
---|
public ContentService.ContentFinder find(Expansion... expansions)
ContentService
contentService.find()
.withSpace("DEV")
.withType(ContentType.BLOG_POST)
.fetchMany(new SimplePageRequest(0,50);
find
in interface ContentService
public Content create(Content newContent) throws ServiceException
ContentService
Valid ContentRepresentation
s for the ContentBody
can be found in the documentation on the
ContentBodyConversionService
.
create
in interface ContentService
newContent
- the content to create
ServiceException
- if the content cannot be createdpublic Content update(Content updatedContent) throws ServiceException
ContentService
Valid ContentRepresentation
s for the ContentBody
can be found in the documentation on the
ContentBodyConversionService
.
Content with an existing status of ContentStatus.TRASHED
that is updated to have status
ContentStatus.CURRENT
will be restored from the trash, provided that the version in the supplied
Content is correct and the user has permission to perform the restore.
Any other changes to the Content being restored will be discarded.
update
in interface ContentService
updatedContent
- the updated Content
ServiceException
public void delete(Content content) throws ServiceException
ContentService
The way that this method behaves depends on whether the Content being deleted supports trashing, and its current status:
current
, in which case calling this method will trash the contenttrashed
, in which case calling this method will fail. Clients should use
ContentTrashService.purge(Content)
to permanently delete trashed content.trashed
status.
The methods ContentTrashService.trash(Content)
and ContentTrashService.purge(Content)
can be used for content that is known to support trashing.
delete
in interface ContentService
content
- the content to remove
ServiceException
- if the content cannot be found, or cannot be deletedpublic ContentServiceImpl.ValidatorImpl validator()
ContentService
validator
in interface ContentService
public Content buildContent(ContentEntityObject entity, List<ContentStatus> statuses, Expansion... expansions)
public void setPermissionManager(PermissionManager permissionManager)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |