Search in sources :

Example 1 with ResultType

use of org.broadleafcommerce.common.extension.ResultType in project BroadleafCommerce by BroadleafCommerce.

the class TranslationServiceImpl method removeTranslationFromCache.

@Override
public void removeTranslationFromCache(Translation translation) {
    if (BroadleafRequestContext.getBroadleafRequestContext().isProductionSandBox()) {
        ResultType resultType = ResultType.STANDARD;
        if (extensionManager != null) {
            ExtensionResultHolder<ResultType> response = new ExtensionResultHolder<ResultType>();
            extensionManager.getProxy().getResultType(translation, response);
            resultType = response.getResult();
            if (ResultType.STANDARD == resultType) {
                String key = getCacheKey(resultType, translation.getEntityType());
                LOG.debug("Removing key [" + key + "] for STANDARD site");
                getCache().remove(key);
            } else {
                List<String> cacheKeysList = getCacheKeyListForTemplateSite(translation.getEntityType().getFriendlyType());
                for (String key : cacheKeysList) {
                    LOG.debug("Removing key [" + key + "] for TEMPLATE site");
                    getCache().remove(key);
                }
            }
        }
    }
}
Also used : ResultType(org.broadleafcommerce.common.extension.ResultType) ExtensionResultHolder(org.broadleafcommerce.common.extension.ExtensionResultHolder)

Aggregations

ExtensionResultHolder (org.broadleafcommerce.common.extension.ExtensionResultHolder)1 ResultType (org.broadleafcommerce.common.extension.ResultType)1