Map<String, Object> context = getDefaultVelocityContext();
String innerKeyCacheName = AdvancedCodeBlockCache.generateCacheKeyForRemoteMacro(remoteFileUrl, remoteFileHttpUser, remoteFileHttpPassword, macroid);
try {
AdvancedCodeBlockCache cacheObj = getFromCache(innerKeyCacheName);
if (cacheObj == null) {
String remoteFileContent = HttpDownloader.downloadFile(new URL(remoteFileUrl), remoteFileHttpUser, remoteFileHttpPassword);
codeblocks = parseConfigWithContent(body, remoteFileContent, macroid, conversionContext.getEntity().getId(), context, true);
// (re)create cache
cacheObj = new AdvancedCodeBlockCache();
cacheObj.setCreated(newDate());
cacheObj.setCodeblocks(codeblocks);
putToCache(codeblocks, innerKeyCacheName);
} else {
codeblocks = cacheObj.getCodeblocks();
}
context.put(VELOCITY_PLACEHOLDER_LAST_CACHE_UPDATE, cacheObj.getCreated());
final String refreshActionPath = bootstrapManager.getWebAppContextPath() + "/"+MACRO_ACTION_PREFIX+"/actions/refreshcache.action?pageId=" + GeneralUtil.urlEncode(conversionContext.getEntity().getIdAsString())+"&cachekey="+GeneralUtil.urlEncode(innerKeyCacheName);
context.put("refreshActionPath", refreshActionPath);
} catch (MalformedURLException e) {