Author: ashish
Date: Mon Feb 23 08:21:21 2015
New Revision: 1661611
URL:
http://svn.apache.org/r1661611Log:
Applied bug fix from trunk r1661358.
==================================================================================
Applied patch from jira issue - OFBIZ-5930 - Data resouce caching issue while render data resource on multi tenant environment.
Thanks Deepak for the contribution. Thanks Scott and Adrian for sharing your thoughts here.
==================================================================================
Modified:
ofbiz/branches/release13.07/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java
Modified: ofbiz/branches/release13.07/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java?rev=1661611&r1=1661610&r2=1661611&view=diff==============================================================================
--- ofbiz/branches/release13.07/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java (original)
+++ ofbiz/branches/release13.07/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java Mon Feb 23 08:21:21 2015
@@ -590,7 +590,7 @@ public class DataResourceWorker impleme
if (dataResource != null) {
String dataTemplateTypeId = dataResource.getString("dataTemplateTypeId");
if ("FTL".equals(dataTemplateTypeId)) {
- FreeMarkerWorker.clearTemplateFromCache("DataResource:" + dataResourceId);
+ FreeMarkerWorker.clearTemplateFromCache(delegator.getDelegatorName() + ":DataResource:" + dataResourceId);
}
}
}
@@ -628,7 +628,7 @@ public class DataResourceWorker impleme
String disableCache = UtilProperties.getPropertyValue("content", "disable.ftl.template.cache");
if (disableCache == null || !disableCache.equalsIgnoreCase("true")) {
try {
- Template cachedTemplate = FreeMarkerWorker.getTemplate("DataResource:" + dataResourceId);
+ Template cachedTemplate = FreeMarkerWorker.getTemplate(delegator.getDelegatorName() + ":DataResource:" + dataResourceId);
if (cachedTemplate != null) {
String subContentId = (String) templateContext.get("subContentId");
if (UtilValidate.isNotEmpty(subContentId)) {
@@ -688,7 +688,7 @@ public class DataResourceWorker impleme
}
// render the FTL template
- FreeMarkerWorker.renderTemplate("DataResource:" + dataResourceId, templateText, templateContext, out);
+ FreeMarkerWorker.renderTemplate(delegator.getDelegatorName() + ":DataResource:" + dataResourceId, templateText, templateContext, out);
} catch (TemplateException e) {
throw new GeneralException("Error rendering FTL template", e);
}