Class ComponentController


  • @Controller
    @RequestMapping("/{baseSiteId}/cms")
    public class ComponentController
    extends java.lang.Object
    Default Controller for CMS Component. This controller is used for all CMS components that don\"t have a specific controller to handle them.
    • Field Detail

      • DEFAULT_CURRENT_PAGE

        public static final java.lang.String DEFAULT_CURRENT_PAGE
        See Also:
        Constant Field Values
      • DEFAULT_PAGE_SIZE

        public static final java.lang.String DEFAULT_PAGE_SIZE
        See Also:
        Constant Field Values
    • Constructor Detail

      • ComponentController

        public ComponentController()
    • Method Detail

      • getComponentById

        @GetMapping("/components/{componentId}")
        @ResponseBody
        public ComponentAdapterUtil.ComponentAdaptedData getComponentById​(@PathVariable
                                                                          java.lang.String componentId,
                                                                          @RequestParam(required=false)
                                                                          java.lang.String catalogCode,
                                                                          @RequestParam(required=false)
                                                                          java.lang.String productCode,
                                                                          @RequestParam(required=false)
                                                                          java.lang.String categoryCode,
                                                                          @RequestParam(defaultValue="DEFAULT")
                                                                          java.lang.String fields)
                                                                   throws CMSItemNotFoundException
        Throws:
        CMSItemNotFoundException
      • searchComponentsByIds

        @PostMapping("/components")
        @ResponseBody
        @Deprecated(since="1905",
                    forRemoval=true)
        public ComponentListWsDTOAdapter.ListAdaptedComponents searchComponentsByIds​(@RequestBody
                                                                                     ComponentIDListWsDTO componentIdList,
                                                                                     @RequestParam(required=false)
                                                                                     java.lang.String catalogCode,
                                                                                     @RequestParam(required=false)
                                                                                     java.lang.String productCode,
                                                                                     @RequestParam(required=false)
                                                                                     java.lang.String categoryCode,
                                                                                     @RequestParam(defaultValue="DEFAULT")
                                                                                     java.lang.String fields,
                                                                                     @RequestParam(required=false,defaultValue="0")
                                                                                     int currentPage,
                                                                                     @RequestParam(required=false,defaultValue="10")
                                                                                     int pageSize,
                                                                                     @RequestParam(required=false)
                                                                                     java.lang.String sort)
        Deprecated, for removal: This API element is subject to removal in a future version.
        This endpoint will trigger CORS preflight requests by the browser in a cross-origin setup, which is the most common cases. You can use the GET endpoint (findComponentsByIds(List, String, String, String, String, int, int, String)) to easily circumvent the browser's preflight requests.

        However, when requesting for a very large number of components using the GET endpoint, you may eventually reach the maximum number of characters allowed in a URL request. For example:
        Request Method: GET
        Request URL: /cms/components?componentIds=uid1,uid2,uid3,...,uid1000&catalogCode=...

        This POST endpoint allows you to request for such large number of components, but you will have to address the preflight requests issues in a cross-origin setup.

      • findComponentsByIds

        @GetMapping("/components")
        @ResponseBody
        public ComponentListWsDTOAdapter.ListAdaptedComponents findComponentsByIds​(@RequestParam(required=false)
                                                                                   java.util.List<java.lang.String> componentIds,
                                                                                   @RequestParam(required=false)
                                                                                   java.lang.String catalogCode,
                                                                                   @RequestParam(required=false)
                                                                                   java.lang.String productCode,
                                                                                   @RequestParam(required=false)
                                                                                   java.lang.String categoryCode,
                                                                                   @RequestParam(defaultValue="DEFAULT")
                                                                                   java.lang.String fields,
                                                                                   @RequestParam(required=false,defaultValue="0")
                                                                                   int currentPage,
                                                                                   @RequestParam(required=false,defaultValue="10")
                                                                                   int pageSize,
                                                                                   @RequestParam(required=false)
                                                                                   java.lang.String sort)
      • getComponentsByIds

        protected ComponentListWsDTOAdapter.ListAdaptedComponents getComponentsByIds​(java.util.List<java.lang.String> componentIds,
                                                                                     java.lang.String catalogCode,
                                                                                     java.lang.String productCode,
                                                                                     java.lang.String categoryCode,
                                                                                     java.lang.String fields,
                                                                                     int currentPage,
                                                                                     int pageSize,
                                                                                     java.lang.String sort)
        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's
        catalogCode - - the catalog code determining the restriction to apply
        productCode - - the product code determining the restriction to apply
        categoryCode - - the category code determining the restriction to apply
        fields - - the response configuration determining which fields to include in the response
        currentPage - - the pagination information determining the page index
        pageSize - - the pagination information determining the page size
        sort - - the sorting information determining which field to sort on and the ordering direction (ASC or DESC)
        Returns:
        a list of cms component data
      • setComponentItemFacade

        public void setComponentItemFacade​(ComponentItemFacade componentItemFacade)
      • setDataMapper

        public void setDataMapper​(CMSDataMapper dataMapper)
      • setWebPaginationUtils

        public void setWebPaginationUtils​(WebPaginationUtils webPaginationUtils)