use of org.entando.entando.aps.system.services.cache.CacheableInfo in project entando-core by entando.
the class GuiFragmentManager method getGuiFragmentCodesByWidgetType.
@Override
@CachePut(value = ICacheInfoManager.DEFAULT_CACHE_NAME, key = "'GuiFragment_codesByWidgetType_'.concat(#widgetTypeCode)")
// TODO improve group handling
@CacheableInfo(groups = "'GuiFragment_codesByWidgetTypeGroup'")
public List<String> getGuiFragmentCodesByWidgetType(String widgetTypeCode) throws ApsSystemException {
List<String> codes = null;
try {
FieldSearchFilter filter = new FieldSearchFilter("widgettypecode", widgetTypeCode, false);
filter.setOrder(FieldSearchFilter.Order.ASC);
FieldSearchFilter[] filters = { filter };
codes = this.searchGuiFragments(filters);
} catch (Throwable t) {
logger.error("Error loading fragments code by widget '{}'", widgetTypeCode, t);
throw new ApsSystemException("Error loading fragment codes by widget " + widgetTypeCode, t);
}
return codes;
}
use of org.entando.entando.aps.system.services.cache.CacheableInfo in project entando-core by entando.
the class BaseContentListHelper method getContentsId.
@Override
@CachePut(value = ICacheInfoManager.DEFAULT_CACHE_NAME, key = "T(com.agiletec.plugins.jacms.aps.system.services.content.helper.BaseContentListHelper).buildCacheKey(#bean, #user)", condition = "#bean.cacheable")
@CacheableInfo(groups = "T(com.agiletec.plugins.jacms.aps.system.JacmsSystemConstants).CONTENTS_ID_CACHE_GROUP_PREFIX.concat(#bean.contentType)", expiresInMinute = 30)
public List<String> getContentsId(IContentListBean bean, UserDetails user) throws Throwable {
this.releaseCache(bean, user);
List<String> contentsId = null;
try {
if (null == bean.getContentType()) {
throw new ApsSystemException("Content type not defined");
}
// this.getAllowedGroups(user);
Collection<String> userGroupCodes = getAllowedGroupCodes(user);
contentsId = this.getContentManager().loadPublicContentsId(bean.getContentType(), bean.getCategories(), bean.getFilters(), userGroupCodes);
} catch (Throwable t) {
_logger.error("Error extracting contents id", t);
throw new ApsSystemException("Error extracting contents id", t);
}
return contentsId;
}
use of org.entando.entando.aps.system.services.cache.CacheableInfo in project entando-core by entando.
the class ContentAuthorizationHelper method getAuthorizationInfo.
@Override
@CachePut(value = ICacheInfoManager.DEFAULT_CACHE_NAME, condition = "#cacheable", key = "T(com.agiletec.plugins.jacms.aps.system.JacmsSystemConstants).CONTENT_AUTH_INFO_CACHE_PREFIX.concat(#contentId)")
@CacheableInfo(groups = "T(com.agiletec.plugins.jacms.aps.system.services.cache.CmsCacheWrapperManager).getContentCacheGroupsCsv(#contentId)")
public PublicContentAuthorizationInfo getAuthorizationInfo(String contentId, boolean cacheable) {
PublicContentAuthorizationInfo authInfo = null;
try {
Content content = this.getContentManager().loadContent(contentId, true, cacheable);
if (null == content) {
_logger.debug("public content {} doesn't exist", contentId);
return null;
}
authInfo = new PublicContentAuthorizationInfo(content, this.getLangManager().getLangs());
} catch (Throwable t) {
_logger.error("error in getAuthorizationInfo for content {}", contentId, t);
}
return authInfo;
}
Aggregations