Class CatalogEndpoint
java.lang.Object
com.broadleafcommerce.tenant.web.endpoint.CatalogEndpoint
@FrameworkRestController
@FrameworkMapping("/catalogs")
@DataRouteByExample(Catalog.class)
public class CatalogEndpoint
extends Object
API for managing
Catalog
instances.- Author:
- Jeff Fischer
-
Constructor Summary
ConstructorDescriptionCatalogEndpoint
(CatalogService<Catalog> service, ApplicationCatalogService applicationCatalogService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService, com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> parser) -
Method Summary
Modifier and TypeMethodDescriptioncreate
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, Catalog req, String applicationId) void
delete
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id) protected ApplicationCatalogService
protected com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node>
protected com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils
protected CatalogService<Catalog>
protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation>
org.springframework.data.domain.Page<Catalog>
readAll
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, org.springframework.data.domain.Pageable page, boolean visibility, String excludeCatalog, String nameQuery, cz.jirutka.rsql.parser.ast.Node filters) readById
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id) replace
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, Catalog req) com.broadleafcommerce.translation.service.dto.TranslationsPayload
replaceAllCatalogTranslations
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, Locale locale, com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest) void
setPolicyUtils
(com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils policyUtils) update
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, Catalog req) protected void
validateApplicationOwnership
(@NonNull Catalog catalog, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected void
validateParentCatalogRelationship
(@NonNull Catalog catalog, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected void
validateTenantOnlyOperation
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
Constructor Details
-
CatalogEndpoint
public CatalogEndpoint(CatalogService<Catalog> service, ApplicationCatalogService applicationCatalogService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService, com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> parser)
-
-
Method Details
-
setPolicyUtils
@Autowired public void setPolicyUtils(@Nullable com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils policyUtils) -
readAll
@FrameworkGetMapping @Policy(permissionRoots="TENANT") public org.springframework.data.domain.Page<Catalog> readAll(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @RequestParam(value="visibility",required=false) boolean visibility, @RequestParam(value="excludeCatalog",required=false) String excludeCatalog, @RequestParam(value="q",required=false) String nameQuery, cz.jirutka.rsql.parser.ast.Node filters) -
readById
-
update
@FrameworkPatchMapping(value="/{id}", consumes="application/json") @Policy(permissionRoots="TENANT") public Catalog update(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody Catalog req) -
replace
@FrameworkPutMapping(value="/{id}", consumes="application/json") @Policy(permissionRoots="TENANT") public Catalog replace(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody Catalog req) -
replaceAllCatalogTranslations
@FrameworkPutMapping(value="/{id}/translations/{locale}", consumes="application/json") @Policy(permissionRoots="TENANT") public com.broadleafcommerce.translation.service.dto.TranslationsPayload replaceAllCatalogTranslations(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @PathVariable("locale") Locale locale, @RequestBody com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest) -
create
@FrameworkPostMapping(consumes="application/json") @Policy(permissionRoots="TENANT") public Catalog create(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody Catalog req, @RequestParam(value="applicationId",required=false) String applicationId) -
delete
@FrameworkDeleteMapping("/{id}") @Policy(permissionRoots="TENANT") public void delete(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id) -
validateTenantOnlyOperation
protected void validateTenantOnlyOperation(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
validateParentCatalogRelationship
protected void validateParentCatalogRelationship(@NonNull @NonNull Catalog catalog, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
validateApplicationOwnership
protected void validateApplicationOwnership(@NonNull @NonNull Catalog catalog, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getService
-
getApplicationCatalogService
-
getTranslationEntityService
protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> getTranslationEntityService() -
getParser
protected com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> getParser() -
getPolicyUtils
@Nullable protected com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils getPolicyUtils()
-