Class AbstractController
java.lang.Object
com.emc.documentum.rest.controller.AbstractController
The abstract class for resource controllers.
It registers a number of property editors for query parameters.
-
Field Summary
Modifier and TypeFieldDescription -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends Linkable>
TgetRenderedObject
(String repositoryName, T object, boolean links, UriInfo uriInfo, Map<String, Object> others) Get the rendered linkable object from the view definition.getRenderedPage
(String repositoryName, Page<T> page, boolean links, boolean inline, UriInfo uriInfo, Map<String, Object> others) Get the rendered atom feed from the view definition.void
initBinder
(org.springframework.web.bind.WebDataBinder binder) Initialize the binding for registered query parameters.protected void
validateCollectionNotAllowed
(jakarta.servlet.http.HttpServletRequest request) protected void
validateOnlyPageItemsPerPageCollectionAllowed
(jakarta.servlet.http.HttpServletRequest request) protected void
validatePaginationNotAllowed
(jakarta.servlet.http.HttpServletRequest request) protected void
validateTargetControllerAccessible
(Class<? extends AbstractController> controllerClazz) validate the accessibility of the target resource controller.
-
Field Details
-
POST_FROM_COLLECTION_MAP
-
-
Constructor Details
-
AbstractController
public AbstractController()
-
-
Method Details
-
initBinder
@InitBinder public void initBinder(org.springframework.web.bind.WebDataBinder binder) Initialize the binding for registered query parameters. This method is called by Spring MVC handlers.- Parameters:
binder
- the binder- See Also:
-
InitBinder
-
getRenderedObject
protected <T extends Linkable> T getRenderedObject(String repositoryName, T object, boolean links, UriInfo uriInfo, Map<String, Object> others) Get the rendered linkable object from the view definition. The view definition classes are loaded fromViewFactory
. The default view definition can be annotated on the controller definition byResourceViewBinding
.- Type Parameters:
T
- serializable model data- Parameters:
repositoryName
- repository nameobject
- linkable model objectlinks
- indicate whether to return linksuriInfo
- uri infoothers
- other parameters- Returns:
- the rendered model object
-
getRenderedPage
protected <T extends Linkable> AtomFeed getRenderedPage(String repositoryName, Page<T> page, boolean links, boolean inline, UriInfo uriInfo, Map<String, Object> others) Get the rendered atom feed from the view definition. The view definition classes are loaded fromViewFactory
. The default view definition can be annotated on the controller definition byResourceViewBinding
.- Type Parameters:
T
- serializable model data- Parameters:
repositoryName
- repository namepage
- the paged itemslinks
- indicate whether to return linksuriInfo
- uri infoothers
- other parametersinline
- whether embed the entry in the feed- Returns:
- the rendered atom feed for the page
-
validateTargetControllerAccessible
protected void validateTargetControllerAccessible(Class<? extends AbstractController> controllerClazz) validate the accessibility of the target resource controller. If the target controller class is not active, aRestClientErrorException
is thrown with error code E_TARGET_RESOURCE_DISABLED and status 403.- Parameters:
controllerClazz
- the controller
-
validatePaginationNotAllowed
protected void validatePaginationNotAllowed(jakarta.servlet.http.HttpServletRequest request) -
validateCollectionNotAllowed
protected void validateCollectionNotAllowed(jakarta.servlet.http.HttpServletRequest request) -
validateOnlyPageItemsPerPageCollectionAllowed
protected void validateOnlyPageItemsPerPageCollectionAllowed(jakarta.servlet.http.HttpServletRequest request)
-