Class ComponentWithUserController
java.lang.Object
de.hybris.platform.cmsocc.controllers.ComponentWithUserController
@Controller
@RequestMapping("/{baseSiteId}/users/{userId}/cms")
public class ComponentWithUserController
extends Object
Default Controller for CMS Component. This controller is used for all CMS components with user id path that don\"t have a specific
controller to handle them.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindComponentsByIdsAndUser(List<String> componentIds, String catalogCode, String productCode, String categoryCode, String fields, int currentPage, int pageSize, String sort) formatSearchPageDataResult(String fields, SearchPageData<AbstractCMSComponentData> searchPageDataResult) Transforms theSearchPageDatacontaining the list of cms component data into aListAdaptedComponentsobject.getComponentByIdAndUser(String componentId, String catalogCode, String productCode, String categoryCode, String fields) getComponentsByIds(List<String> componentIds, String catalogCode, String productCode, String categoryCode, String fields, SearchPageData<AbstractCMSComponentData> searchPageDataInput) Finds cms components by the specified IDs.protected SearchPageData<AbstractCMSComponentData>getSearchPageData(int currentPage, int pageSize, String sort) Finds SearchPageData cms components.voidsetComponentItemFacade(ComponentItemFacade componentItemFacade) voidsetDataMapper(CMSDataMapper dataMapper) voidsetWebPaginationUtils(WebPaginationUtils webPaginationUtils)
-
Field Details
-
DEFAULT_CURRENT_PAGE
- See Also:
-
DEFAULT_PAGE_SIZE
- See Also:
-
-
Constructor Details
-
ComponentWithUserController
public ComponentWithUserController()
-
-
Method Details
-
getComponentByIdAndUser
@SecurePortalUnauthenticatedAccess @GetMapping("/components/{componentId}") @ResponseBody public ComponentAdapterUtil.ComponentAdaptedData getComponentByIdAndUser(@PathVariable String componentId, @RequestParam(required=false) String catalogCode, @RequestParam(required=false) String productCode, @RequestParam(required=false) String categoryCode, @RequestParam(defaultValue="DEFAULT") String fields) throws CMSItemNotFoundException - Throws:
CMSItemNotFoundException
-
findComponentsByIdsAndUser
@SecurePortalUnauthenticatedAccess @GetMapping("/components") @ResponseBody public ComponentListWsDTOAdapter.ListAdaptedComponents findComponentsByIdsAndUser(@RequestParam(required=false) List<String> componentIds, @RequestParam(required=false) String catalogCode, @RequestParam(required=false) String productCode, @RequestParam(required=false) String categoryCode, @RequestParam(defaultValue="DEFAULT") String fields, @RequestParam(required=false,defaultValue="0") int currentPage, @RequestParam(required=false,defaultValue="10") int pageSize, @RequestParam(required=false) String sort) -
getComponentsByIds
protected ComponentListWsDTOAdapter.ListAdaptedComponents getComponentsByIds(List<String> componentIds, String catalogCode, String productCode, String categoryCode, String fields, SearchPageData<AbstractCMSComponentData> searchPageDataInput) Finds cms components by the specified IDs. When none is provided, this will retrieve all components. The components list will be filtered by the given catalog, product or category restrictions, as well as by the pagination information. The result will be sorted in the specified order.- Parameters:
componentIds- - the list of component uid'scatalogCode- - the catalog code determining the restriction to applyproductCode- - the product code determining the restriction to applycategoryCode- - the category code determining the restriction to applyfields- - the response configuration determining which fields to include in the responsesearchPageDataInput- - the search page information determining the page index- Returns:
- a list of cms component data
-
getSearchPageData
protected SearchPageData<AbstractCMSComponentData> getSearchPageData(int currentPage, int pageSize, String sort) Finds SearchPageData cms components.- Parameters:
currentPage- - the pagination information determining the page indexpageSize- - the pagination information determining the page sizesort- - the sorting information determining which field to sort on and the ordering direction (ASC or DESC)- Returns:
- a list of search page data
-
formatSearchPageDataResult
protected ComponentListWsDTOAdapter.ListAdaptedComponents formatSearchPageDataResult(String fields, SearchPageData<AbstractCMSComponentData> searchPageDataResult) Transforms theSearchPageDatacontaining the list of cms component data into aListAdaptedComponentsobject.- Parameters:
fields- - the response configuration determining which fields to include in the responsesearchPageDataResult- - the configuration containing the pagination and sorting information- Returns:
- a list of components of type
ComponentListWsDTOAdapter.ListAdaptedComponents
-
getComponentItemFacade
-
setComponentItemFacade
-
getDataMapper
-
setDataMapper
-
getWebPaginationUtils
-
setWebPaginationUtils
-