Class ProductTagProductEndpoint
java.lang.Object
com.broadleafcommerce.catalog.web.endpoint.ProductTagProductEndpoint
@FrameworkRestController
@FrameworkMapping("/products/{productId}/tags")
@DataRouteByExample(Product.class)
public class ProductTagProductEndpoint
extends Object
Endpoint for managing
ProductTags
from a Product
context.- Author:
- Nathan Moore (nathandmoore)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionProductTagProductEndpoint
(ProductService<Product> productService, AdvancedTagService<AdvancedTag> tagService, ProductTagService<ProductTag> productTagService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService) -
Method Summary
Modifier and TypeMethodDescriptionaddProductTag
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String productId, ProductTag req) org.springframework.http.ResponseEntity<Void>
deleteProductTag
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String productId, String id) protected org.apache.commons.lang3.tuple.Pair<Product,
ProductTag> findWithRelatedProduct
(String productId, String productTagId, String operationType, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds theProductTag
and itsProduct
.protected ProductService<Product>
protected ProductTagService<ProductTag>
protected AdvancedTagService<AdvancedTag>
protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation>
org.springframework.data.domain.Page<ProductTag>
readAllProductTags
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String productId, boolean isSorted, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page) org.springframework.data.domain.Page<ProductTag>
readAllProductTags
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String productId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page) readProductTag
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String productId, String id) reorderProductTag
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String productId, String id, com.broadleafcommerce.data.tracking.core.sort.SortPositionRequest sortPositionRequest) com.broadleafcommerce.translation.service.dto.TranslationsPayload
replaceAllProductTagTranslations
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String productId, String id, Locale locale, com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest) replaceProductTag
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String productId, String id, ProductTag req) updateProductTag
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, String productId, String id, ProductTag req)
-
Field Details
-
BASE_URI
- See Also:
-
-
Constructor Details
-
ProductTagProductEndpoint
public ProductTagProductEndpoint(ProductService<Product> productService, AdvancedTagService<AdvancedTag> tagService, ProductTagService<ProductTag> productTagService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService)
-
-
Method Details
-
readAllProductTags
@FrameworkGetMapping @Policy(permissionRoots="PRODUCT") public org.springframework.data.domain.Page<ProductTag> readAllProductTags(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PathVariable("productId") String productId, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50) org.springframework.data.domain.Pageable page) -
readAllProductTags
@FrameworkGetMapping(params="isSorted") @Policy(permissionRoots="PRODUCT") public org.springframework.data.domain.Page<ProductTag> readAllProductTags(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PathVariable("productId") String productId, @RequestParam boolean isSorted, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50) org.springframework.data.domain.Pageable page) -
readProductTag
@FrameworkGetMapping("/{id}") @Policy(permissionRoots="PRODUCT") public ProductTag readProductTag(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PathVariable("productId") String productId, @PathVariable("id") String id) -
replaceProductTag
@FrameworkPutMapping(path="/{id}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public ProductTag replaceProductTag(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PathVariable("productId") String productId, @PathVariable("id") String id, @RequestBody ProductTag req) -
updateProductTag
@FrameworkPatchMapping(path="/{id}", consumes="application/json") @Policy(permissionRoots="PRODUCT") public ProductTag updateProductTag(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PathVariable("productId") String productId, @PathVariable("id") String id, @RequestBody ProductTag req) -
addProductTag
@FrameworkPostMapping(consumes="application/json") @Policy(permissionRoots="PRODUCT") public ProductTag addProductTag(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PathVariable("productId") String productId, @RequestBody ProductTag req) -
deleteProductTag
@FrameworkDeleteMapping("/{id}") @Policy(permissionRoots="PRODUCT") public org.springframework.http.ResponseEntity<Void> deleteProductTag(@ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PathVariable("productId") String productId, @PathVariable("id") String id) -
replaceAllProductTagTranslations
@FrameworkPutMapping(path="/{id}/translation/{locale}") @Policy(permissionRoots="PRODUCT") public com.broadleafcommerce.translation.service.dto.TranslationsPayload replaceAllProductTagTranslations(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("productId") String productId, @PathVariable("id") String id, @PathVariable("locale") Locale locale, @RequestBody com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest) -
reorderProductTag
@FrameworkPatchMapping("/{id}/sort") @Policy(permissionRoots="PRODUCT") public ProductTag reorderProductTag(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PathVariable("productId") String productId, @PathVariable("id") String id, @UpdateSortOperation com.broadleafcommerce.data.tracking.core.sort.SortPositionRequest sortPositionRequest) -
findWithRelatedProduct
protected org.apache.commons.lang3.tuple.Pair<Product,ProductTag> findWithRelatedProduct(String productId, String productTagId, String operationType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds theProductTag
and itsProduct
. This will also implicitly validate that both exist and the product is the parent of the product tag.- Parameters:
productId
- ID of the owning productproductTagId
- ID of the product tag to fetchcontextInfo
- Additional sandbox and multitenant info- Returns:
- The
ProductTag
and itsProduct
.
-
getProductService
-
getTagService
-
getProductTagService
-
getTranslationEntityService
protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> getTranslationEntityService()
-