queryMap.put("day", day);
queryMap.put("month", month);
queryMap.put("year", year);
queryMap.put("orderBy", orderBy);
Cache cache = WebappUtil.getCache();
if (cache != null) {
String cacheKey = WebappUtil.getCacheKey("/event/list", queryMap);
if (cacheKey != null) {
Object cobj = null;
CachedList cl = (CachedList)cache.get(cacheKey);
if (cl == null) {
// nothing in cache
cl = new CachedList(cacheKey);
// get a new cacheable page/partial
cobj = createCachePageObject(queryMap, response, request, mf);
cl.put(index, cobj);
if (cache.needsRefresh(false, cacheKey)) {
cache.put(cacheKey, cl, CacheFactory.getInstance().getCacheExpireInSeconds());
cache.doneRefresh(cacheKey, CacheFactory.getInstance().getCacheLockExpireInSeconds());
}
} else {
// something in the cache
cobj = cl.get(index); // we are using this whatever
Object newCobj = createCachePageObject(queryMap, response, request, mf);
cl.put(index, newCobj); // replaces existing value
if (cache.needsRefresh(true, cacheKey)) {
cache.put(cacheKey, cl, CacheFactory.getInstance().getCacheExpireInSeconds());
cache.doneRefresh(cacheKey, CacheFactory.getInstance().getCacheLockExpireInSeconds());
}
}
if (cobj != null) {
request.setAttribute("content", cobj);