String appName = window.getPortletDefinition().getApplication().getName();
String portletName = window.getPortletDefinition().getPortletName();
String entityId = window.getPortletEntityId();
String cacheKey = getUserPreferenceKey(appName, portletName, entityId, userName);
// first search in cache
CacheElement cachedElement = preferenceCache.get(cacheKey);
if (cachedElement != null)
{
JetspeedPreferencesMap map = (JetspeedPreferencesMap)cachedElement.getContent();
return map;
}
// not found in cache, lookup in database
JetspeedPreferencesMap map = new JetspeedPreferencesMap();
Criteria c = new Criteria();