Search in sources :

Example 6 with Catalog

use of org.broadleafcommerce.common.site.domain.Catalog in project BroadleafCommerce by BroadleafCommerce.

the class SolrIndexCachedOperation method getCache.

/**
 * Retrieve the cache bound to the current thread.
 *
 * @return The cache for the current thread, or null if not set
 */
public static CatalogStructure getCache() {
    BroadleafRequestContext ctx = BroadleafRequestContext.getBroadleafRequestContext();
    Catalog currentCatalog = ctx == null ? null : ctx.getCurrentCatalog();
    if (currentCatalog != null) {
        return MapUtils.getObject(CACHE.get(), currentCatalog.getId());
    } else {
        return MapUtils.getObject(CACHE.get(), DEFAULT_CATALOG_CACHE_KEY);
    }
}
Also used : BroadleafRequestContext(org.broadleafcommerce.common.web.BroadleafRequestContext) Catalog(org.broadleafcommerce.common.site.domain.Catalog)

Aggregations

Catalog (org.broadleafcommerce.common.site.domain.Catalog)6 BroadleafRequestContext (org.broadleafcommerce.common.web.BroadleafRequestContext)4 Site (org.broadleafcommerce.common.site.domain.Site)3 ArrayList (java.util.ArrayList)1 Set (java.util.Set)1 ExtensionResultHolder (org.broadleafcommerce.common.extension.ExtensionResultHolder)1 CatalogStructure (org.broadleafcommerce.core.search.dao.CatalogStructure)1 AdminUser (org.broadleafcommerce.openadmin.server.security.domain.AdminUser)1