Author: ashish Date: Sat Feb 21 13:28:31 2015 New Revision: 1661359 URL: http://svn.apache.org/r1661359 Log: 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/release14.12/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java Modified: ofbiz/branches/release14.12/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release14.12/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java?rev=1661359&r1=1661358&r2=1661359&view=diff ============================================================================== --- ofbiz/branches/release14.12/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java (original) +++ ofbiz/branches/release14.12/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java Sat Feb 21 13:28:31 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); }