Class ContentResource
java.lang.Object
com.atlassian.confluence.plugins.restapi.resources.ContentResource
@Consumes("application/json")
@Produces("application/json")
@Path("/content")
public class ContentResource
extends Object
REST wrapper for the ContentService. Provides methods for finding, creating, modifying and deleting Content.
-
Constructor Summary
ConstructorsConstructorDescriptionContentResource
(ContentService contentService, SpaceService spaceService, ContentMacroService contentMacroService, ContentTrashService contentTrashService, CQLSearchService searchService, ContentDraftService contentDraftService, ObjectMapperProvider objectMapperProvider, ConfluenceScopesRequestCache scopesRequestCacheDelegate, PersonService personService) -
Method Summary
Modifier and TypeMethodDescriptioncreateContent
(Content content, ContentStatus status, String expand) jakarta.ws.rs.core.Response
delete
(ContentId contentId, ContentStatus status) getContent
(String type, String spaceKey, String title, List<ContentStatus> statuses, String postingDay, String expand, int start, int limit, List<String> ids, jakarta.ws.rs.core.UriInfo uriInfo, String username) getContentByGraph
(ContentId id, String expand, String type, String spaceKey, String title, String postingDay, List<ContentStatus> statuses, Integer version, int offset, String afterOffset, int limit, jakarta.ws.rs.core.UriInfo uriInfo) getContentById
(ContentId id, List<ContentStatus> statuses, Integer version, String expand, String username) getHistory
(ContentId contentId, String expand) getMacroBodyByHash
(ContentId contentId, int versionId, String hash) Deprecated.getMacroBodyByMacroId
(ContentId contentId, int versionId, String macroId) scanContent
(String spaceKey, List<ContentStatus> statuses, String expand, int limit, String cursor, String type, jakarta.ws.rs.core.UriInfo uriInfo) search
(String cql, String cqlcontext, String expand, int start, int limit, String username, jakarta.ws.rs.core.UriInfo uriInfo) update
(ContentId contentId, Content content, ContentStatus status, ContentDraftService.ConflictPolicy conflictPolicy, boolean asyncReconciliation)
-
Constructor Details
-
ContentResource
@Inject public ContentResource(ContentService contentService, SpaceService spaceService, ContentMacroService contentMacroService, ContentTrashService contentTrashService, CQLSearchService searchService, ContentDraftService contentDraftService, ObjectMapperProvider objectMapperProvider, ConfluenceScopesRequestCache scopesRequestCacheDelegate, PersonService personService)
-
-
Method Details
-
getContentByGraph
public PageResponse<Content> getContentByGraph(ContentId id, String expand, @DefaultValue("page") String type, String spaceKey, String title, String postingDay, List<ContentStatus> statuses, @DefaultValue("0") Integer version, @DefaultValue("0") int offset, String afterOffset, @DefaultValue("25") int limit, jakarta.ws.rs.core.UriInfo uriInfo) -
getContentById
@PublicApi @GET @Path("/{id}") public Content getContentById(@DefaultValue("") @PathParam("id") ContentId id, @QueryParam("status") List<ContentStatus> statuses, @QueryParam("version") Integer version, @QueryParam("expand") @DefaultValue("history,space,version") String expand, @QueryParam("xoauth_requestor_id") String username) throws ServiceException - Throws:
ServiceException
-
createContent
@PublicApi @POST public Content createContent(Content content, @QueryParam("status") @DefaultValue("current") ContentStatus status, @QueryParam("expand") @DefaultValue("body.storage,history,space,container.history,container.version,version,ancestors") String expand) throws ServiceException - Throws:
ServiceException
-
getContent
@PublicApi @GET public PageResponse<Content> getContent(@QueryParam("type") @DefaultValue("page") String type, @QueryParam("spaceKey") String spaceKey, @QueryParam("title") String title, @QueryParam("status") List<ContentStatus> statuses, @QueryParam("postingDay") String postingDay, @QueryParam("expand") @DefaultValue("") String expand, @QueryParam("start") int start, @QueryParam("limit") @DefaultValue("25") int limit, @QueryParam("ids") List<String> ids, @Context jakarta.ws.rs.core.UriInfo uriInfo, @QueryParam("xoauth_requestor_id") String username) throws ServiceException - Throws:
ServiceException
-
scanContent
@PublicApi @GET @Path("/scan") public PageResponse<Content> scanContent(@QueryParam("spaceKey") String spaceKey, @QueryParam("status") List<ContentStatus> statuses, @QueryParam("expand") @DefaultValue("") String expand, @QueryParam("limit") @DefaultValue("25") int limit, @QueryParam("cursor") String cursor, @QueryParam("type") String type, @Context jakarta.ws.rs.core.UriInfo uriInfo) throws ServiceException - Throws:
ServiceException
-
search
@PublicApi @GET @Path("/search") public PageResponse<Content> search(@QueryParam("cql") String cql, @QueryParam("cqlcontext") String cqlcontext, @QueryParam("expand") @DefaultValue("") String expand, @QueryParam("start") int start, @QueryParam("limit") @DefaultValue("25") int limit, @QueryParam("xoauth_requestor_id") String username, @Context jakarta.ws.rs.core.UriInfo uriInfo) -
getHistory
@PublicApi @GET @Path("/{id}/history") @Consumes("application/json") public History getHistory(@PathParam("id") ContentId contentId, @QueryParam("expand") @DefaultValue("previousVersion,nextVersion,lastUpdated") String expand) throws ServiceException - Throws:
ServiceException
-
getMacroBodyByHash
@Deprecated @PublicApi @GET @Consumes("application/json") @Path("/{id}/history/{version}/macro/hash/{hash}") public MacroInstance getMacroBodyByHash(@PathParam("id") ContentId contentId, @PathParam("version") int versionId, @PathParam("hash") String hash) throws ServiceException Deprecated.- Throws:
ServiceException
-
getMacroBodyByMacroId
@PublicApi @GET @Consumes("application/json") @Path("/{id}/history/{version}/macro/id/{macroId}") public MacroInstance getMacroBodyByMacroId(@PathParam("id") ContentId contentId, @PathParam("version") int versionId, @PathParam("macroId") String macroId) throws ServiceException - Throws:
ServiceException
-
update
@PublicApi @PUT @Path("/{contentId}") public Content update(@PathParam("contentId") ContentId contentId, Content content, @QueryParam("status") ContentStatus status, @QueryParam("conflictPolicy") @DefaultValue("abort") ContentDraftService.ConflictPolicy conflictPolicy, @QueryParam("asyncReconciliation") @DefaultValue("false") boolean asyncReconciliation) throws ServiceException - Throws:
ServiceException
-
delete
@PublicApi @DELETE @Path("/{id}") public jakarta.ws.rs.core.Response delete(@PathParam("id") ContentId contentId, @QueryParam("status") ContentStatus status) throws ServiceException - Throws:
ServiceException
-