Package org.dd4t.test.web.controller
Class SpringComponentPresentationController
- java.lang.Object
-
- org.dd4t.mvc.controllers.AbstractComponentPresentationController
-
- org.dd4t.test.web.controller.SpringComponentPresentationController
-
public class SpringComponentPresentationController extends org.dd4t.mvc.controllers.AbstractComponentPresentationControllerSpringComponentPresentationController. Example controller to load DCPs. Extend as needed.- Author:
- R. Kempees
-
-
Constructor Summary
Constructors Constructor Description SpringComponentPresentationController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetComponentViewPath()voidsetComponentViewPath(String componentViewPath)StringshowComponentPresentation(String componentViewName, int componentId, javax.servlet.http.HttpServletRequest request)Renders the component/model, which must be put on the request usingComponentUtils#setComponentPresentation.StringshowComponentPresentation(String componentViewPrefix, String componentViewName, int componentId, javax.servlet.http.HttpServletRequest request)Renders the component template response, the exact mapping needs to be determined.
-
-
-
Method Detail
-
showComponentPresentation
@RequestMapping(value="/{componentViewName}/{componentId}.dcp", method={GET,HEAD}) public String showComponentPresentation(@PathVariable String componentViewName, @PathVariable int componentId, javax.servlet.http.HttpServletRequest request)Renders the component/model, which must be put on the request usingComponentUtils#setComponentPresentation.- Overrides:
showComponentPresentationin classorg.dd4t.mvc.controllers.AbstractComponentPresentationController- Parameters:
componentViewName- the viewName to be used to render this componentcomponentId- the id as an int, not a tcm uri!request- the request on which the component must be present- Returns:
- the view name to render
-
showComponentPresentation
@RequestMapping(value="/{componentViewPrefix}/{componentViewName}/{componentId}.dcp", method={GET,HEAD}) public String showComponentPresentation(@PathVariable String componentViewPrefix, @PathVariable String componentViewName, @PathVariable int componentId, javax.servlet.http.HttpServletRequest request)Renders the component template response, the exact mapping needs to be determined.- Overrides:
showComponentPresentationin classorg.dd4t.mvc.controllers.AbstractComponentPresentationController- Parameters:
componentViewPrefix- the prefix to use for the viewcomponentViewName- the viewName to be used to render this componentcomponentId- the id as an int, not a tcm uri!request- the request on which the component must be present- Returns:
- the view name to render
-
getComponentViewPath
public String getComponentViewPath()
- Overrides:
getComponentViewPathin classorg.dd4t.mvc.controllers.AbstractComponentPresentationController- Returns:
- the component view path
-
setComponentViewPath
public void setComponentViewPath(String componentViewPath)
- Overrides:
setComponentViewPathin classorg.dd4t.mvc.controllers.AbstractComponentPresentationController- Parameters:
componentViewPath- , sets the component view path relative to the view resolver path
-
-