private String addToCache(String componentURI, String key, CacheElement<String> cacheElement, String result) throws ParseException { String toReturn = result == null ? "" : result; cacheElement.setPayload(toReturn); TCMURI tcmUri = new TCMURI(componentURI); cacheProvider.storeInItemCache(key, cacheElement, tcmUri.getPublicationId(), tcmUri.getItemId()); LOG.debug("Added link url: {} for uri: {} to cache", result, componentURI); return toReturn; }
if (publicationMeta != null) { cacheElement.setPayload(publicationMeta); cacheProvider.storeInItemCache(key, cacheElement); cacheElement.setExpired(false); LOG.debug("Stored Publication Meta with key: {} in cache", key);
cacheProvider.storeInItemCache(key, cacheElement); cacheElement.setExpired(false); LOG.debug("Stored Publication Id with key: {} in cache", key);
if (publicationMeta != null) { cacheElement.setPayload(publicationMeta); cacheProvider.storeInItemCache(key, cacheElement); cacheElement.setExpired(false); LOG.debug("Stored Publication Meta with key: {} in cache", key);
cacheProvider.storeInItemCache(key, cacheElement); cacheElement.setExpired(false); LOG.debug("Stored Publication Id with key: {} in cache", key);
LOG.debug("Publication Id for URL: {}, is {}", url, result); cacheElement.setPayload(result); cacheProvider.storeInItemCache(key, cacheElement); cacheElement.setExpired(false); LOG.debug("Stored Publication Id with key: {} in cache", key);
result = pageMeta.getPublicationId(); cacheElement.setPayload(result); cacheProvider.storeInItemCache(key, cacheElement); cacheElement.setExpired(false); LOG.debug("Publication Id for URL: {}, is {}", url, result);
cacheProvider.storeInItemCache(cacheKey, cacheElement); cacheElement.setExpired(true); throw new ItemNotFoundException("XML Page with url: " + url + " not found."); cacheProvider.storeInItemCache(cacheKey, cacheElement); cacheElement.setExpired(false);
if (taxonomySource == null || taxonomySource.length() == 0) { cacheElement.setPayload(null); cacheProvider.storeInItemCache(taxonomyURI, cacheElement); cacheElement.setExpired(true); throw new ItemNotFoundException(String.format("Taxonomy with uri: %s not found.", cacheProvider.storeInItemCache(taxonomyURI, cacheElement, tcmUri.getPublicationId(), tcmUri .getItemId()); cacheElement.setExpired(false);
if (taxonomySource == null || taxonomySource.length() == 0) { cacheElement.setPayload(null); cacheProvider.storeInItemCache(taxonomyURI, cacheElement); cacheElement.setExpired(true); throw new ItemNotFoundException("Taxonomy with uri: " + taxonomyURI + " not found."); cacheProvider.storeInItemCache(key, cacheElement, tcmUri.getPublicationId(), tcmUri.getItemId ()); cacheElement.setExpired(false); } catch (ItemNotFoundException e) { cacheElement.setPayload(null); cacheProvider.storeInItemCache(taxonomyURI, cacheElement); cacheElement.setExpired(true); LOG.error(e.getLocalizedMessage(), e);
cacheProvider.storeInItemCache(cacheKey, cacheElement); cacheElement.setExpired(true); throw new ItemNotFoundException("Unable to find page by id " + tcmId); cacheProvider.storeInItemCache(cacheKey, cacheElement); cacheElement.setExpired(false); } else {
cacheProvider.storeInItemCache(key, cacheElement, tcmuri.getPublicationId(), tcmuri.getItemId ()); cacheElement.setExpired(false); result = 0; cacheElement.setPayload(result); cacheProvider.storeInItemCache(key, cacheElement); cacheElement.setExpired(false);
cacheProvider.storeInItemCache(cacheKey, cacheElement); cacheElement.setExpired(true); throw new ItemNotFoundException("Page with url: " + url + " not found."); cacheProvider.storeInItemCache(cacheKey, cacheElement, resultItem.getPublicationId(), resultItem .getItemId()); cacheElement.setExpired(false);
cacheElement.setPayload(null); cacheElement.setNull(true); cacheProvider.storeInItemCache(uri, cacheElement); throw new ItemNotFoundException("Unable to find page by id " + uri); cacheProvider.storeInItemCache(uri, cacheElement, tcmUri.getPublicationId(), tcmUri.getItemId()); cacheElement.setExpired(false); LOG.debug("Added page with uri: {} to cache", uri);
cacheElement.setPayload(binary); TCMURI binaryURI = new TCMURI(tcmUri); cacheProvider.storeInItemCache(tcmUri, cacheElement, binaryURI.getPublicationId(), binaryURI .getItemId()); cacheElement.setExpired(false); } catch (ParseException e) { cacheElement.setPayload(null); cacheProvider.storeInItemCache(tcmUri, cacheElement); cacheElement.setExpired(true); throw new ItemNotFoundException(e);
cacheProvider.storeInItemCache(key, cacheElement, tcmUri.getPublicationId(), tcmUri.getItemId ()); cacheElement.setExpired(false);
TCMURI tcmuri = new TCMURI(results[0]); cacheElement.setPayload(result); cacheProvider.storeInItemCache(key, cacheElement, tcmuri.getPublicationId(), tcmuri .getItemId()); cacheElement.setExpired(false); result = 0; cacheElement.setPayload(result); cacheProvider.storeInItemCache(key, cacheElement); cacheElement.setExpired(false);
cacheElement.setPayload(null); cacheElement.setNull(true); cacheProvider.storeInItemCache(key, cacheElement, publicationId, componentId); throw new ItemNotFoundException(String.format("Could not find DCP with componentURI: %s and " + "templateURI: %s", parsedComponentUri, templateURI)); this.executeProcessors(componentPresentation.getComponent(), RunPhase.BEFORE_CACHING, context); cacheElement.setPayload(componentPresentation); cacheProvider.storeInItemCache(key, cacheElement, publicationId, componentId); cacheElement.setExpired(false); LOG.debug("Added component with uri: {} and template: {} to cache", parsedComponentUri, templateURI);