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

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ApplicationEndpoint(ApplicationService<Application> service, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService, ApplicationSecurityUtil applicationSecurityUtil)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(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 com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils
     
     
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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

      protected void validateUserAccess(String applicationId)
      Validates the user has access to the application ID supplied. If they do not, a NotPermittedException is thrown.
      Parameters:
      applicationId - The application ID to check
    • getService

      protected ApplicationService<Application> 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

      protected ApplicationSecurityUtil getApplicationSecurityUtil()