public List<StructuredContentDTO> lookupStructuredContentItemsByName(StructuredContentType contentType,
String contentName, org.broadleafcommerce.common.locale.domain.Locale locale,
Integer count, Map<String, Object> ruleDTOs, boolean secure) {
List<StructuredContentDTO> contentDTOList = null;
Locale languageOnlyLocale = findLanguageOnlyLocale(locale);
BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
String cacheKey = buildNameKey(context.getSandBox(), languageOnlyLocale, contentType.getName(), contentName);
cacheKey = cacheKey+"-"+secure;
if (context.isProductionSandBox()) {
contentDTOList = getStructuredContentListFromCache(cacheKey);
}
if (contentDTOList == null) {
List<StructuredContent> productionContentList = structuredContentDao.findActiveStructuredContentByNameAndType(
contentType, contentName, locale, languageOnlyLocale);
contentDTOList = buildStructuredContentDTOList(productionContentList, secure);
if (context.isProductionSandBox()) {
addStructuredContentListToCache(cacheKey, contentDTOList);
}
}
return evaluateAndPriortizeContent(contentDTOList, count, ruleDTOs);