@FrameworkRestController @FrameworkMapping(value="/catalog/", produces={"application/json","application/xml"}) public class CatalogEndpoint extends BaseEndpoint
javax.ws.rs.@Scope
javax.ws.rs.@Path
javax.ws.rs.@Produces
javax.ws.rs.@Consumes
javax.ws.rs.@Context
javax.ws.rs.@Path annotations
, javax.ws.rs.@Context
,
javax.ws.rs.@PathParam
, javax.ws.rs.@QueryParam
,
javax.ws.rs.@GET
, javax.ws.rs.@POST
, etc... Essentially, the subclass
will override and extend the methods of this class, add new methods, and control the JAX-RS behavior
using annotations according to the JAX-RS specification.Modifier and Type | Field and Description |
---|---|
protected org.broadleafcommerce.core.catalog.service.CatalogService |
catalogService |
protected org.broadleafcommerce.common.security.service.ExploitProtectionService |
exploitProtectionService |
protected org.broadleafcommerce.core.web.service.SearchFacetDTOService |
facetService |
protected org.broadleafcommerce.core.inventory.service.InventoryService |
inventoryService |
protected PromotionMessageDTOWrapperService |
promotionMessageDTOWrapperService |
protected org.broadleafcommerce.core.search.service.SearchService |
searchService |
protected org.broadleafcommerce.common.file.service.StaticAssetPathService |
staticAssetPathService |
context, messageSource
Constructor and Description |
---|
CatalogEndpoint() |
Modifier and Type | Method and Description |
---|---|
CategoriesWrapper |
findActiveSubCategories(javax.servlet.http.HttpServletRequest request,
Long id,
int limit,
int offset) |
CategoriesWrapper |
findAllCategories(javax.servlet.http.HttpServletRequest request,
String name,
int limit,
int offset) |
List<CategoryAttributeWrapper> |
findCategoryAttributesForCategory(javax.servlet.http.HttpServletRequest request,
Long categoryId) |
CategoryWrapper |
findCategoryById(javax.servlet.http.HttpServletRequest request,
Long id,
int productLimit,
int productOffset,
int subcategoryLimit,
int subcategoryOffset) |
CategoryWrapper |
findCategoryByIdOrName(javax.servlet.http.HttpServletRequest request,
String searchParameter,
int productLimit,
int productOffset,
int subcategoryLimit,
int subcategoryOffset)
Allows you to search for a category by ID or by name.
|
List<RelatedProductWrapper> |
findCrossSaleProductsByProduct(javax.servlet.http.HttpServletRequest request,
Long id,
int limit,
int offset) |
SkuWrapper |
findDefaultSkuByProductId(javax.servlet.http.HttpServletRequest request,
Long id) |
List<InventoryWrapper> |
findInventoryForSkus(javax.servlet.http.HttpServletRequest request,
List<Long> ids) |
List<MediaWrapper> |
findMediaForCategory(javax.servlet.http.HttpServletRequest request,
Long id) |
List<MediaWrapper> |
findMediaForProduct(javax.servlet.http.HttpServletRequest request,
Long id) |
List<MediaWrapper> |
findMediaForSku(javax.servlet.http.HttpServletRequest request,
Long id) |
CategoriesWrapper |
findParentCategoriesForProduct(javax.servlet.http.HttpServletRequest request,
Long id) |
List<ProductAttributeWrapper> |
findProductAttributesForProduct(javax.servlet.http.HttpServletRequest request,
Long id) |
ProductWrapper |
findProductById(javax.servlet.http.HttpServletRequest request,
Long id)
Search for
Product by product id |
ProductWrapper |
findProductById(javax.servlet.http.HttpServletRequest request,
Long id,
Boolean includePromotionMessages,
Boolean includePriceData)
Search for
Product by product id |
SearchResultsWrapper |
findSearchResultsByCategoryAndQuery(javax.servlet.http.HttpServletRequest request,
Long categoryId,
String q,
Integer pageSize,
Integer page,
Boolean includePromotionMessages,
Boolean includePriceData)
This uses Broadleaf's search service to search for products or skus within a category.
|
SearchResultsWrapper |
findSearchResultsByQuery(javax.servlet.http.HttpServletRequest request,
String q,
Integer pageSize,
Integer page,
Boolean includePromotionMessages,
Boolean includePriceData)
Queries for products or skus.
|
List<SkuAttributeWrapper> |
findSkuAttributesForSku(javax.servlet.http.HttpServletRequest request,
Long id) |
SkuWrapper |
findSkuById(javax.servlet.http.HttpServletRequest request,
Long id) |
List<SkuWrapper> |
findSkusByProductById(javax.servlet.http.HttpServletRequest request,
Long id)
Search for
Sku instances for a given product |
CategoriesWrapper |
findSubCategories(javax.servlet.http.HttpServletRequest request,
Long id,
int limit,
int offset,
boolean active) |
List<RelatedProductWrapper> |
findUpSaleProductsByProduct(javax.servlet.http.HttpServletRequest request,
Long id,
int limit,
int offset) |
protected org.broadleafcommerce.core.search.service.SearchService |
getSearchService() |
getApplicationContext, getMessageSource, setApplicationContext, setMessageSource
protected org.broadleafcommerce.core.catalog.service.CatalogService catalogService
protected org.broadleafcommerce.core.search.service.SearchService searchService
protected org.broadleafcommerce.core.web.service.SearchFacetDTOService facetService
protected org.broadleafcommerce.common.security.service.ExploitProtectionService exploitProtectionService
protected org.broadleafcommerce.common.file.service.StaticAssetPathService staticAssetPathService
protected org.broadleafcommerce.core.inventory.service.InventoryService inventoryService
protected PromotionMessageDTOWrapperService promotionMessageDTOWrapperService
public ProductWrapper findProductById(javax.servlet.http.HttpServletRequest request, Long id)
Product
by product idid
- the product id@FrameworkMapping(value="product/{id}", method=GET) public ProductWrapper findProductById(javax.servlet.http.HttpServletRequest request, @PathVariable(value="id") Long id, @RequestParam(value="includePromotionMessages",required=false) Boolean includePromotionMessages, @RequestParam(value="includePriceData",required=false) Boolean includePriceData)
Product
by product idid
- the product idincludePromotionMessages
- whether or not PromotionMessages should be includedincludePriceData
- @FrameworkMapping(value="search/category/{categoryId}", method=GET) public SearchResultsWrapper findSearchResultsByCategoryAndQuery(javax.servlet.http.HttpServletRequest request, @PathVariable(value="categoryId") Long categoryId, @RequestParam(value="q",required=false) String q, @RequestParam(value="pageSize",required=false,defaultValue="15") Integer pageSize, @RequestParam(value="page",required=false,defaultValue="1") Integer page, @RequestParam(value="includePromotionMessages",required=false) Boolean includePromotionMessages, @RequestParam(value="includePriceData",required=false) Boolean includePriceData)
request
- q
- categoryId
- pageSize
- page
- @FrameworkMapping(value="search", method=GET) public SearchResultsWrapper findSearchResultsByQuery(javax.servlet.http.HttpServletRequest request, @RequestParam(value="q") String q, @RequestParam(value="pageSize",defaultValue="15") Integer pageSize, @RequestParam(value="page",defaultValue="1") Integer page, @RequestParam(value="includePromotionMessages",required=false) Boolean includePromotionMessages, @RequestParam(value="includePriceData",required=false) Boolean includePriceData)
request
- q
- pageSize
- page
- @FrameworkMapping(value="product/{productId}/skus", method=GET) public List<SkuWrapper> findSkusByProductById(javax.servlet.http.HttpServletRequest request, @PathVariable(value="productId") Long id)
Sku
instances for a given productid
- @FrameworkMapping(value="product/{productId}/defaultSku", method=GET) public SkuWrapper findDefaultSkuByProductId(javax.servlet.http.HttpServletRequest request, @PathVariable(value="productId") Long id)
@FrameworkMapping(value="categories", method=GET) public CategoriesWrapper findAllCategories(javax.servlet.http.HttpServletRequest request, @RequestParam(value="name",required=false) String name, @RequestParam(value="limit",defaultValue="20") int limit, @RequestParam(value="offset",defaultValue="0") int offset)
@FrameworkMapping(value="category/{categoryId}/categories", method=GET) public CategoriesWrapper findSubCategories(javax.servlet.http.HttpServletRequest request, @PathVariable(value="categoryId") Long id, @RequestParam(value="limit",defaultValue="20") int limit, @RequestParam(value="offset",defaultValue="0") int offset, @RequestParam(value="active",defaultValue="true") boolean active)
@FrameworkMapping(value="category/{categoryId}/activeSubcategories", method=GET) public CategoriesWrapper findActiveSubCategories(javax.servlet.http.HttpServletRequest request, @PathVariable(value="categoryId") Long id, @RequestParam(value="limit",defaultValue="20") int limit, @RequestParam(value="offset",defaultValue="0") int offset)
@FrameworkMapping(value="category/{categoryId}", method=GET) public CategoryWrapper findCategoryById(javax.servlet.http.HttpServletRequest request, @PathVariable(value="categoryId") Long id, @RequestParam(value="productLimit",defaultValue="20") int productLimit, @RequestParam(value="productOffset",defaultValue="1") int productOffset, @RequestParam(value="subcategoryLimit",defaultValue="20") int subcategoryLimit, @RequestParam(value="subcategoryOffset",defaultValue="1") int subcategoryOffset)
@FrameworkMapping(value="category", method=GET) public CategoryWrapper findCategoryByIdOrName(javax.servlet.http.HttpServletRequest request, @RequestParam(value="searchParameter") String searchParameter, @RequestParam(value="productLimit",defaultValue="20") int productLimit, @RequestParam(value="productOffset",defaultValue="1") int productOffset, @RequestParam(value="subcategoryLimit",defaultValue="20") int subcategoryLimit, @RequestParam(value="subcategoryOffset",defaultValue="1") int subcategoryOffset)
request
- searchParameter
- productLimit
- productOffset
- subcategoryLimit
- subcategoryOffset
- @FrameworkMapping(value="category/{categoryId}/attributes", method=GET) public List<CategoryAttributeWrapper> findCategoryAttributesForCategory(javax.servlet.http.HttpServletRequest request, @PathVariable(value="categoryId") Long categoryId)
@FrameworkMapping(value="product/{productId}/upsale", method=GET) public List<RelatedProductWrapper> findUpSaleProductsByProduct(javax.servlet.http.HttpServletRequest request, @PathVariable(value="productId") Long id, @RequestParam(value="limit",defaultValue="20") int limit, @RequestParam(value="offset",defaultValue="0") int offset)
@FrameworkMapping(value="product/{productId}/crosssale", method=GET) public List<RelatedProductWrapper> findCrossSaleProductsByProduct(javax.servlet.http.HttpServletRequest request, @PathVariable(value="productId") Long id, @RequestParam(value="limit",defaultValue="20") int limit, @RequestParam(value="offset",defaultValue="0") int offset)
@FrameworkMapping(value="product/{productId}/attributes", method=GET) public List<ProductAttributeWrapper> findProductAttributesForProduct(javax.servlet.http.HttpServletRequest request, @PathVariable(value="productId") Long id)
@FrameworkMapping(value="sku/{skuId}/attributes", method=GET) public List<SkuAttributeWrapper> findSkuAttributesForSku(javax.servlet.http.HttpServletRequest request, @PathVariable(value="skuId") Long id)
@FrameworkMapping(value="sku/{skuId}/media", method=GET) public List<MediaWrapper> findMediaForSku(javax.servlet.http.HttpServletRequest request, @PathVariable(value="skuId") Long id)
@FrameworkMapping(value="sku/{skuId}", method=GET) public SkuWrapper findSkuById(javax.servlet.http.HttpServletRequest request, @PathVariable(value="skuId") Long id)
@FrameworkMapping(value="sku/inventory", method=GET) public List<InventoryWrapper> findInventoryForSkus(javax.servlet.http.HttpServletRequest request, @RequestParam(value="id") List<Long> ids)
@FrameworkMapping(value="product/{productId}/media", method=GET) public List<MediaWrapper> findMediaForProduct(javax.servlet.http.HttpServletRequest request, @PathVariable(value="productId") Long id)
@FrameworkMapping(value="category/{id}/media", method=GET) public List<MediaWrapper> findMediaForCategory(javax.servlet.http.HttpServletRequest request, @PathVariable(value="id") Long id)
@FrameworkMapping(value="product/{productId}/categories", method=GET) public CategoriesWrapper findParentCategoriesForProduct(javax.servlet.http.HttpServletRequest request, @PathVariable(value="productId") Long id)
protected org.broadleafcommerce.core.search.service.SearchService getSearchService()
Copyright © 2020. All rights reserved.