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 String
getApplicationId
(JpaTranslation translation) protected String
getCatalogId
(JpaTranslation translation) protected String
getTenantId
(JpaTranslation translation) protected TranslationRepository<com.broadleafcommerce.data.tracking.core.Trackable>
void
onApplicationEvent
(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, wait
Methods 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:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<com.broadleafcommerce.data.tracking.core.service.DeployCompletedEvent>
-
getTenantId
-
getCatalogId
-
getApplicationId
-
getTranslationRepository
protected TranslationRepository<com.broadleafcommerce.data.tracking.core.Trackable> getTranslationRepository()
-