cache.put(getPrimaryGroup() + hostId + ":" + URI, WebKeys.Cache.CACHE_NOT_FOUND, getPrimaryGroup() + "_" + hostId);
return null;
}
}
Versionable asset;
if(id.getAssetType().equals("contentlet")){
User systemUser = APILocator.getUserAPI().getSystemUser();
try {
asset = APILocator.getContentletAPI().findContentletByIdentifier( id.getId(), true, languageId, systemUser, false );
} catch ( DotContentletStateException e ) {
Logger.debug( LiveCache.class, e.getMessage() );
//If we did not find the asset with for given language lets try with the default language
if ( !languageId.equals( APILocator.getLanguageAPI().getDefaultLanguage().getId() ) ) {
languageId = APILocator.getLanguageAPI().getDefaultLanguage().getId();
asset = APILocator.getContentletAPI().findContentletByIdentifier( id.getId(), true, languageId, systemUser, false );
} else {
throw e;
}
}
} else {
asset = APILocator.getVersionableAPI().findLiveVersion(id, APILocator.getUserAPI().getSystemUser(), false);
}
if(asset!=null && InodeUtils.isSet(asset.getInode()))
{
Logger.debug(PublishFactory.class, "Lazy Mapping: " + id.getURI() + " to " + URI);
//The cluster entry doesn't need to be invalidated when loading the entry lazily,
//if the entry gets invalidated from the cluster in this case causes an invalidation infinite loop
return addToLiveAssetToCache( asset, languageId );