Class ContentController
java.lang.Object
org.craftercms.studio.controller.rest.v2.ContentController
@Validated
@RestController
@RequestMapping("/api/2/content")
public class ContentController
extends Object
-
Constructor Summary
ConstructorsConstructorDescriptionContentController
(ContentService contentService, DependencyService dependencyService, ClipboardService clipboardService, WorkflowService workflowService) -
Method Summary
Modifier and TypeMethodDescriptioncontentExists
(@NotEmpty String siteId, String path) @Valid ResponseBody
delete
(DeleteRequestBody deleteRequestBody) @Valid ResponseBody
duplicateItem
(@Valid DuplicateRequest request) @Valid Result
getChildrenByPath
(@Valid GetChildrenByPathRequestBody request) Deprecated.getChildrenByPaths
(String siteId, @Valid GetChildrenBulkRequest request) @Valid org.springframework.http.ResponseEntity
<org.springframework.core.io.Resource> getContentByCommitId
(String siteId, String path, String commitId) @Valid ResponseBody
getDeletePackage
(@Valid GetDeletePackageRequestBody request) getDescriptor
(@NotEmpty String siteId, String path, boolean flatten) getHistory
(String siteId, String path) @Valid ResponseBody
getItemByPath
(String siteId, String path, boolean preferContent) getSandboxItemsByPath
(@Valid GetSandboxItemsByPathRequestBody request) @Valid ResponseBody
itemLockByPath
(@Valid LockItemByPathRequest request) @Valid ResponseBody
itemUnlockByPath
(@Valid UnlockItemByPathRequest request) @Valid ResponseBody
listQuickCreateContent
(String siteId) @Valid ResponseBody
pasteItems
(@Valid PasteRequest request) rename
(@Valid RenameRequestBody renameRequestBody)
-
Constructor Details
-
ContentController
@ConstructorProperties({"contentService","dependencyService","clipboardService","workflowService"}) public ContentController(ContentService contentService, DependencyService dependencyService, ClipboardService clipboardService, WorkflowService workflowService)
-
-
Method Details
-
contentExists
@GetMapping(value="/exists", produces="application/json") public ResultOne<Boolean> contentExists(@NotEmpty @RequestParam @NotEmpty String siteId, @RequestParam String path) throws SiteNotFoundException - Throws:
SiteNotFoundException
-
listQuickCreateContent
@Valid @GetMapping("/list_quick_create_content") public @Valid ResponseBody listQuickCreateContent(@RequestParam(name="siteId") String siteId) throws SiteNotFoundException - Throws:
SiteNotFoundException
-
getDeletePackage
@Valid @PostMapping("/get_delete_package") public @Valid ResponseBody getDeletePackage(@RequestBody @Valid @Valid GetDeletePackageRequestBody request) throws SiteNotFoundException - Throws:
SiteNotFoundException
-
delete
@Valid @PostMapping(value="/delete", consumes="application/json") public @Valid ResponseBody delete(@RequestBody @Validated DeleteRequestBody deleteRequestBody) throws UserNotFoundException, ServiceLayerException, DeploymentException -
getChildrenByPaths
@PostMapping(value="/{siteId}/children", produces="application/json") public Result getChildrenByPaths(@PathVariable String siteId, @Valid @RequestBody @Valid GetChildrenBulkRequest request) throws ServiceLayerException, UserNotFoundException -
getChildrenByPath
@Valid @Deprecated @PostMapping(value="/children_by_path", produces="application/json") public @Valid Result getChildrenByPath(@RequestBody @Valid @Valid GetChildrenByPathRequestBody request) throws ServiceLayerException, UserNotFoundException Deprecated. -
getDescriptor
@GetMapping(value="/descriptor", produces="application/json") public ResultOne<String> getDescriptor(@NotEmpty @RequestParam @NotEmpty String siteId, @RequestParam String path, @RequestParam(required=false,defaultValue="false") boolean flatten) throws ContentNotFoundException, SiteNotFoundException -
pasteItems
@Valid @PostMapping(value="/paste", produces="application/json") public @Valid ResponseBody pasteItems(@Valid @RequestBody @Valid PasteRequest request) throws Exception - Throws:
Exception
-
duplicateItem
@Valid @PostMapping(value="/duplicate", produces="application/json") public @Valid ResponseBody duplicateItem(@Valid @RequestBody @Valid DuplicateRequest request) throws Exception - Throws:
Exception
-
getItemByPath
@Valid @GetMapping(value="/item_by_path", produces="application/json") public @Valid ResponseBody getItemByPath(@RequestParam("siteId") String siteId, @RequestParam("path") String path, @RequestParam(value="preferContent",required=false,defaultValue="false") boolean preferContent) throws ServiceLayerException, UserNotFoundException -
getSandboxItemsByPath
@PostMapping(value="/sandbox_items_by_path", produces="application/json") public ResponseBody getSandboxItemsByPath(@RequestBody @Valid @Valid GetSandboxItemsByPathRequestBody request) throws ServiceLayerException, UserNotFoundException -
itemLockByPath
@Valid @PostMapping("/item_lock_by_path") public @Valid ResponseBody itemLockByPath(@RequestBody @Valid @Valid LockItemByPathRequest request) throws UserNotFoundException, ServiceLayerException -
itemUnlockByPath
@Valid @PostMapping("/item_unlock_by_path") public @Valid ResponseBody itemUnlockByPath(@RequestBody @Valid @Valid UnlockItemByPathRequest request) throws ContentNotFoundException, SiteNotFoundException -
getContentByCommitId
@Valid @GetMapping("/get_content_by_commit_id") public @Valid org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> getContentByCommitId(@RequestParam("siteId") String siteId, @RequestParam("path") String path, @RequestParam("commitId") String commitId) throws ServiceLayerException, UserNotFoundException -
rename
@PostMapping(value="/rename", consumes="application/json") public ResponseBody rename(@Valid @RequestBody @Valid RenameRequestBody renameRequestBody) throws AuthenticationException, UserNotFoundException, ServiceLayerException, DeploymentException, org.craftercms.commons.validation.ValidationException - Throws:
AuthenticationException
UserNotFoundException
ServiceLayerException
DeploymentException
org.craftercms.commons.validation.ValidationException
-
getHistory
@GetMapping("/item_history") public ResultList<ItemVersion> getHistory(@RequestParam("siteId") String siteId, @RequestParam("path") String path) throws ServiceLayerException - Throws:
ServiceLayerException
-