You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2015/02/21 14:27:02 UTC
svn commit: r1661358 -
/ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java
Author: ashish
Date: Sat Feb 21 13:27:02 2015
New Revision: 1661358
URL: http://svn.apache.org/r1661358
Log:
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/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java?rev=1661358&r1=1661357&r2=1661358&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java Sat Feb 21 13:27:02 2015
@@ -588,7 +588,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);
}
}
}
@@ -626,7 +626,7 @@ public class DataResourceWorker impleme
String disableCache = EntityUtilProperties.getPropertyValue("content", "disable.ftl.template.cache", delegator);
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);
}