if(cacheKey != null && !cacheKey.equals(""))
key = cacheKey;
if(scheduleFetch && !preventQueueBean)
{
MatchingContentsQueueBean bean = new MatchingContentsQueueBean();
bean.setCacheInterval(cacheInterval);
bean.setCacheKey(cacheKey);
bean.setCacheName(cacheName);
bean.setCacheResult(cacheResult);
bean.setCategoryCondition(categoryConditionString);
bean.setContentTypeDefinitionNames(contentTypeDefinitionNamesString);
bean.setExpireFromDate(expireFromDate);
bean.setExpireToDate(expireToDate);
bean.setFreeText(freeText);
bean.setFreeTextAttributeNames(attributeNamesString.toString());
bean.setFromDate(fromDate);
bean.setToDate(toDate);
bean.setLanguageId(languageId);
bean.setMaximumNumberOfItems(maximumNumberOfItems);
bean.setRepositoryIds(repositoryIdString.toString());
bean.setScheduleFetch(scheduleFetch);
bean.setScheduleInterval(scheduleInterval);
bean.setSkipLanguageCheck(skipLanguageCheck);
bean.setStartNodeId(startNodeId);
bean.setVersionModifier(versionModifier);
bean.setSortColumn(sortColumn);
bean.setSortOrder(sortOrder);
bean.setValidateAccessRightsAsAnonymous(validateAccessRightsAsAnonymous);
bean.setLastFetched(System.currentTimeMillis());
//We cache on real username if in published mode - otherwise in anonymous mode
if(CmsPropertyHandler.getOperatingMode().equals("3"))
bean.setUserName(getPrincipal().getName());
else
bean.setUserName(CmsPropertyHandler.getAnonymousUser());
MatchingContentsQueue.getMatchingContentsQueue().addMatchingContentsQueueBean(key, bean);
}
logger.info("key: " + key);