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 Summary
ConstructorsConstructorDescriptionTranslationDeploymentHandler(TranslationRepository<com.broadleafcommerce.data.tracking.core.Trackable> translationRepository) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetApplicationId(JpaTranslation translation) protected StringgetCatalogId(JpaTranslation translation) protected StringgetTenantId(JpaTranslation translation) protected TranslationRepository<com.broadleafcommerce.data.tracking.core.Trackable>voidonApplicationEvent(com.broadleafcommerce.data.tracking.core.service.DeployCompletedEvent event) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
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:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<com.broadleafcommerce.data.tracking.core.service.DeployCompletedEvent>
-
getTenantId
-
getCatalogId
-
getApplicationId
-
getTranslationRepository
protected TranslationRepository<com.broadleafcommerce.data.tracking.core.Trackable> getTranslationRepository()
-