Class CharacteristicEndpoint

java.lang.Object
com.broadleafcommerce.catalog.web.endpoint.CharacteristicEndpoint

@FrameworkRestController @FrameworkMapping("/characteristics") @DataRouteByExample(Characteristic.class) public class CharacteristicEndpoint extends Object
Since:
Catalog Service 2.2.0, Release Train 2.2.0
  • Field Details

  • Constructor Details

    • CharacteristicEndpoint

      public CharacteristicEndpoint(CharacteristicService<Characteristic> characteristicService, BusinessTypeService<BusinessType> businessTypeService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, org.springframework.context.MessageSource messageSource, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService, ObjectDeepCopyUtility objectDeepCopyUtility)
  • Method Details

    • readAllCharacteristics

      @FrameworkGetMapping @Policy(permissionRoots="CHARACTERISTIC") public org.springframework.data.domain.Page<Characteristic> readAllCharacteristics(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestParam(value="q",required=false) String query, cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50,sort="name",direction=ASC) org.springframework.data.domain.Pageable page)
    • readCharacteristicById

      @FrameworkGetMapping("/{id}") @Policy(permissionRoots="CHARACTERISTIC") public Characteristic readCharacteristicById(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String characteristicId)
    • createCharacteristic

      @FrameworkPostMapping(consumes="application/json") @Policy(permissionRoots="CHARACTERISTIC") public Characteristic createCharacteristic(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody Characteristic characteristic)
    • updateCharacteristic

      @FrameworkPatchMapping(value="/{id}", consumes="application/json") @Policy(permissionRoots="CHARACTERISTIC") public Characteristic updateCharacteristic(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody Characteristic characteristic)
    • replaceCharacteristic

      @FrameworkPutMapping(value="/{id}", consumes="application/json") @Policy(permissionRoots="CHARACTERISTIC") public Characteristic replaceCharacteristic(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody Characteristic characteristic)
    • deleteCharacteristic

      @FrameworkDeleteMapping("/{id}") @Policy(permissionRoots="CHARACTERISTIC") public org.springframework.http.ResponseEntity<Void> deleteCharacteristic(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id)
    • replaceAllCharacteristicTranslations

      @FrameworkPutMapping(value="/{id}/translations/{locale}", consumes="application/json") @Policy(permissionRoots="CHARACTERISTIC") public com.broadleafcommerce.translation.service.dto.TranslationsPayload replaceAllCharacteristicTranslations(@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)
    • hydrateCharacteristicValueValueTypes

      protected void hydrateCharacteristicValueValueTypes(Characteristic characteristic)
    • shouldOverrideCharacteristicForInheritedCharacteristic

      protected boolean shouldOverrideCharacteristicForInheritedCharacteristic(Characteristic characteristic, String parentCharacteristicId, BusinessType parentBusinessType, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      For Characteristics that are being updated, if the Characteristic.inheritanceType is INHERITED, then we want to create a new characteristic whose inheritance type is OVERRIDDEN so that we can create a version of the characteristic for the business type that inherited it without affecting the original.
      Parameters:
      characteristic - The Characteristic to check
      parentCharacteristicId - The possible parent Characteristic.id
      parentBusinessType - The parent BusinessType of this characteristic
      contextInfo - Context surrounding sandboxing and multitenant state
      Returns:
      whether to create a new overridden characteristic
      Since:
      Catalog Services 2.3.0, Release Train 2.3.0
    • createOverrideCharacteristicAndUpdateBusinessType

      protected Characteristic createOverrideCharacteristicAndUpdateBusinessType(Characteristic originalCharacteristic, BusinessType parentBusinessType, String parentBusinessTypeId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Creates a new OVERRIDDEN Characteristic that is a copy of the passed in characteristic whose inheritance type is INHERITED. The overridden characteristic is then assigned to the passed in business type as a replacement for the inherited characteristic.
      Parameters:
      originalCharacteristic - The original inherited characteristic to be overridden
      parentBusinessType - The business type that the inherited characteristic is being overridden for
      parentBusinessTypeId - The business type ID that the inherited characteristic is being overridden for
      contextInfo - Context surrounding sandboxing and multitenant state
      Returns:
      the created overridden characteristic
      Since:
      Catalog Services 2.3.0, Release Train 2.3.0
    • getCharacteristicService

      protected CharacteristicService<Characteristic> getCharacteristicService()
    • getBusinessTypeService

      protected BusinessTypeService<BusinessType> getBusinessTypeService()
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
    • getMessageSource

      protected org.springframework.context.MessageSource getMessageSource()
    • getTranslationEntityService

      protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> getTranslationEntityService()
    • getObjectDeepCopyUtility

      protected ObjectDeepCopyUtility getObjectDeepCopyUtility()