Class ContentStoreRestController
- java.lang.Object
-
- org.craftercms.core.controller.rest.RestControllerBase
-
- org.craftercms.core.controller.rest.ContentStoreRestController
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
@RestController @RequestMapping("${crafter.core.rest.base.uri}/content_store") public class ContentStoreRestController extends RestControllerBase implements org.springframework.beans.factory.InitializingBean
REST service that provides several methods to access the Crafter content store.- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description static String
CACHE_CONTROL_HEADER_NAME
static String
MUST_REVALIDATE_HEADER_VALUE
static String
REQUEST_PARAM_CONTEXT_ID
static String
REQUEST_PARAM_TREE_DEPTH
static String
REQUEST_PARAM_URL
static String
URL_CHILDREN
static String
URL_DESCRIPTOR
static String
URL_ITEM
static String
URL_ROOT
static String
URL_TREE
-
Fields inherited from class org.craftercms.core.controller.rest.RestControllerBase
MESSAGE_MODEL_ATTRIBUTE_NAME, REST_BASE_URI
-
-
Constructor Summary
Constructors Constructor Description ContentStoreRestController(ContentStoreService storeService)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
afterPropertiesSet()
List<Item>
getChildren(org.springframework.web.context.request.WebRequest request, javax.servlet.http.HttpServletResponse response, String contextId, String url, boolean flatten)
org.dom4j.Document
getDescriptor(org.springframework.web.context.request.WebRequest request, javax.servlet.http.HttpServletResponse response, String contextId, String url, boolean flatten)
Deprecated.Will be removed in 4.1, usegetItem
insteadItem
getItem(org.springframework.web.context.request.WebRequest request, javax.servlet.http.HttpServletResponse response, String contextId, String url, boolean flatten)
Tree
getTree(org.springframework.web.context.request.WebRequest request, javax.servlet.http.HttpServletResponse response, String contextId, String url, Integer depth, boolean flatten)
void
setAllowedUrlPatterns(String[] allowedUrlPatterns)
void
setForbiddenUrlPatterns(String[] forbiddenUrlPatterns)
-
Methods inherited from class org.craftercms.core.controller.rest.RestControllerBase
createResponseMessage, createSingletonModifiableMap
-
-
-
-
Field Detail
-
URL_ROOT
public static final String URL_ROOT
- See Also:
- Constant Field Values
-
CACHE_CONTROL_HEADER_NAME
public static final String CACHE_CONTROL_HEADER_NAME
- See Also:
- Constant Field Values
-
MUST_REVALIDATE_HEADER_VALUE
public static final String MUST_REVALIDATE_HEADER_VALUE
- See Also:
- Constant Field Values
-
REQUEST_PARAM_CONTEXT_ID
public static final String REQUEST_PARAM_CONTEXT_ID
- See Also:
- Constant Field Values
-
REQUEST_PARAM_URL
public static final String REQUEST_PARAM_URL
- See Also:
- Constant Field Values
-
REQUEST_PARAM_TREE_DEPTH
public static final String REQUEST_PARAM_TREE_DEPTH
- See Also:
- Constant Field Values
-
URL_DESCRIPTOR
public static final String URL_DESCRIPTOR
- See Also:
- Constant Field Values
-
URL_ITEM
public static final String URL_ITEM
- See Also:
- Constant Field Values
-
URL_CHILDREN
public static final String URL_CHILDREN
- See Also:
- Constant Field Values
-
URL_TREE
public static final String URL_TREE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ContentStoreRestController
@ConstructorProperties("storeService") public ContentStoreRestController(ContentStoreService storeService)
-
-
Method Detail
-
setAllowedUrlPatterns
public void setAllowedUrlPatterns(String[] allowedUrlPatterns)
-
setForbiddenUrlPatterns
public void setForbiddenUrlPatterns(String[] forbiddenUrlPatterns)
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
getDescriptor
@RequestMapping(value="/descriptor", method=GET) public org.dom4j.Document getDescriptor(org.springframework.web.context.request.WebRequest request, javax.servlet.http.HttpServletResponse response, @RequestParam("contextId") String contextId, @RequestParam("url") String url, @RequestParam(required=false,defaultValue="false") boolean flatten) throws InvalidContextException, StoreException, PathNotFoundException, ForbiddenPathException, ItemProcessingException, XmlMergeException, XmlFileParseException
Deprecated.Will be removed in 4.1, usegetItem
instead
-
getItem
@RequestMapping(value="/item", method=GET) public Item getItem(org.springframework.web.context.request.WebRequest request, javax.servlet.http.HttpServletResponse response, @RequestParam("contextId") String contextId, @RequestParam("url") String url, @RequestParam(required=false,defaultValue="false") boolean flatten) throws InvalidContextException, StoreException, PathNotFoundException, ForbiddenPathException, ItemProcessingException, XmlMergeException, XmlFileParseException
-
getChildren
@RequestMapping(value="/children", method=GET) public List<Item> getChildren(org.springframework.web.context.request.WebRequest request, javax.servlet.http.HttpServletResponse response, @RequestParam("contextId") String contextId, @RequestParam("url") String url, @RequestParam(required=false,defaultValue="false") boolean flatten) throws InvalidContextException, StoreException, PathNotFoundException, ForbiddenPathException, ItemProcessingException, XmlMergeException, XmlFileParseException
-
getTree
@RequestMapping(value="/tree", method=GET) public Tree getTree(org.springframework.web.context.request.WebRequest request, javax.servlet.http.HttpServletResponse response, @RequestParam("contextId") String contextId, @RequestParam("url") String url, @RequestParam(value="depth",required=false) Integer depth, @RequestParam(required=false,defaultValue="false") boolean flatten) throws InvalidContextException, StoreException, PathNotFoundException, ForbiddenPathException, ItemProcessingException, XmlMergeException, XmlFileParseException
-
-