Class TranslationDeploymentHandler

java.lang.Object
com.broadleafcommerce.translation.service.TranslationDeploymentHandler
All Implemented Interfaces:
EventListener, org.springframework.context.ApplicationListener<com.broadleafcommerce.data.tracking.core.service.DeployCompletedEvent>

public class TranslationDeploymentHandler extends Object implements org.springframework.context.ApplicationListener<com.broadleafcommerce.data.tracking.core.service.DeployCompletedEvent>
Review special case for Translation deployment. Multiple users may create translations for the same field if a translation does not already exist. In this case, those translations are promoted and deployed separately, resulting in duplicate production state translations for the same thing. This handler serves rectify this state post deployment. The default business rule is that the most recent translation will win.
  • Constructor Details

    • TranslationDeploymentHandler

      public TranslationDeploymentHandler(TranslationRepository<com.broadleafcommerce.data.tracking.core.Trackable> translationRepository)
  • Method Details

    • onApplicationEvent

      public void onApplicationEvent(com.broadleafcommerce.data.tracking.core.service.DeployCompletedEvent event)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<com.broadleafcommerce.data.tracking.core.service.DeployCompletedEvent>
    • getTenantId

      @Nullable protected String getTenantId(JpaTranslation translation)
    • getCatalogId

      @Nullable protected String getCatalogId(JpaTranslation translation)
    • getApplicationId

      @Nullable protected String getApplicationId(JpaTranslation translation)
    • getTranslationRepository

      protected TranslationRepository<com.broadleafcommerce.data.tracking.core.Trackable> getTranslationRepository()