Class ApplicationEndpoint
java.lang.Object
com.broadleafcommerce.tenant.web.endpoint.ApplicationEndpoint
@FrameworkRestController
@FrameworkMapping("/applications")
@DataRouteByExample(Application.class)
public class ApplicationEndpoint
extends Object
API for managing
Application
instances.- Author:
- Jeff Fischer
-
Field Summary
-
Constructor Summary
ConstructorDescriptionApplicationEndpoint
(ApplicationService<Application> service, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService, ApplicationSecurityUtil applicationSecurityUtil) -
Method Summary
Modifier and TypeMethodDescriptioncreate
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, Application req) void
delete
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id) org.springframework.data.domain.Page<ApplicationCatalogRef>
findCatalogsForAdd
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, org.springframework.data.domain.Pageable page, String id) protected ApplicationSecurityUtil
protected com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils
protected ApplicationService<Application>
protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation>
org.springframework.data.domain.Page<Application>
readAll
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, org.springframework.data.domain.Pageable page, Boolean active, cz.jirutka.rsql.parser.ast.Node filters) readById
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id) replace
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, Application req) com.broadleafcommerce.translation.service.dto.TranslationsPayload
replaceAllApplicationTranslations
(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
(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, Application req) protected void
validateTenantOnlyOperation
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected void
validateUserAccess
(String applicationId) Validates the user has access to the application ID supplied.
-
Field Details
-
BASE_URI
- See Also:
-
-
Constructor Details
-
ApplicationEndpoint
public ApplicationEndpoint(ApplicationService<Application> service, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService, ApplicationSecurityUtil applicationSecurityUtil)
-
-
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<Application> readAll(javax.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @RequestParam(name="active",required=false) Boolean active, cz.jirutka.rsql.parser.ast.Node filters) -
readById
@FrameworkGetMapping("/{id}") @Policy(permissionRoots="TENANT") public Application readById(javax.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id) -
update
@FrameworkPatchMapping(value="/{id}", consumes="application/json") @Policy(permissionRoots="TENANT") public Application update(javax.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody Application req) -
replace
@FrameworkPutMapping(value="/{id}", consumes="application/json") @Policy(permissionRoots="TENANT") public Application replace(javax.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody Application req) -
create
@FrameworkPostMapping(consumes="application/json") @Policy(permissionRoots="TENANT") public Application create(javax.servlet.http.HttpServletRequest request, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody Application req) -
delete
@FrameworkDeleteMapping("/{id}") @Policy(permissionRoots="TENANT") public void delete(javax.servlet.http.HttpServletRequest request, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id) -
findCatalogsForAdd
@FrameworkGetMapping("/{id}/catalogs-for-add") @Policy(permissionRoots="TENANT") public org.springframework.data.domain.Page<ApplicationCatalogRef> findCatalogsForAdd(javax.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @PathVariable("id") String id) -
validateTenantOnlyOperation
protected void validateTenantOnlyOperation(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
replaceAllApplicationTranslations
@FrameworkPutMapping(value="/{id}/translations/{locale}", consumes="application/json") @Policy(permissionRoots="TENANT") public com.broadleafcommerce.translation.service.dto.TranslationsPayload replaceAllApplicationTranslations(@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) -
validateUserAccess
Validates the user has access to the application ID supplied. If they do not, aNotPermittedException
is thrown.- Parameters:
applicationId
- The application ID to check
-
getService
-
getTranslationEntityService
protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> getTranslationEntityService() -
getPolicyUtils
@Nullable protected com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils getPolicyUtils() -
getApplicationSecurityUtil
-