You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/11/20 11:51:48 UTC

svn commit: r1640718 - in /ofbiz/branches/release13.07: ./ applications/content/src/org/ofbiz/content/content/ContentWorker.java

Author: jleroux
Date: Thu Nov 20 10:51:48 2014
New Revision: 1640718

URL: http://svn.apache.org/r1640718
Log:
"Applied fix from trunk for revision: 1640717" 
------------------------------------------------------------------------
r1640717 | jleroux | 2014-11-20 11:49:56 +0100 (jeu. 20 nov. 2014) | 1 ligne

At r1639887 I forgot to put the content of templateContext in the local tempTemplateContext. Thanks to Deepak for the warning.
------------------------------------------------------------------------


Modified:
    ofbiz/branches/release13.07/   (props changed)
    ofbiz/branches/release13.07/applications/content/src/org/ofbiz/content/content/ContentWorker.java

Propchange: ofbiz/branches/release13.07/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1640717

Modified: ofbiz/branches/release13.07/applications/content/src/org/ofbiz/content/content/ContentWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/content/src/org/ofbiz/content/content/ContentWorker.java?rev=1640718&r1=1640717&r2=1640718&view=diff
==============================================================================
--- ofbiz/branches/release13.07/applications/content/src/org/ofbiz/content/content/ContentWorker.java (original)
+++ ofbiz/branches/release13.07/applications/content/src/org/ofbiz/content/content/ContentWorker.java Thu Nov 20 10:51:48 2014
@@ -23,7 +23,6 @@ import java.io.StringReader;
 import java.io.StringWriter;
 import java.io.Writer;
 import java.sql.Timestamp;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -75,31 +74,38 @@ public class ContentWorker implements or
 
     public ContentWorker() { }
 
+    @Override
     public GenericValue getWebSitePublishPointExt(Delegator delegator, String contentId, boolean ignoreCache) throws GenericEntityException {
         return ContentManagementWorker.getWebSitePublishPoint(delegator, contentId, ignoreCache);
     }
 
+    @Override
     public GenericValue getCurrentContentExt(Delegator delegator, List<Map<String, ? extends Object>> trail, GenericValue userLogin, Map<String, Object> ctx, Boolean nullThruDatesOnly, String contentAssocPredicateId) throws GeneralException {
         return getCurrentContent(delegator, trail, userLogin, ctx, nullThruDatesOnly, contentAssocPredicateId);
     }
 
+    @Override
     public String getMimeTypeIdExt(Delegator delegator, GenericValue view, Map<String, Object> ctx) {
         return getMimeTypeId(delegator, view, ctx);
     }
 
     // new rendering methods
+    @Override
     public void renderContentAsTextExt(LocalDispatcher dispatcher, Delegator delegator, String contentId, Appendable out, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException {
         renderContentAsText(dispatcher, delegator, contentId, out, templateContext, locale, mimeTypeId, null, null, cache);
     }
 
+    @Override
     public void renderSubContentAsTextExt(LocalDispatcher dispatcher, Delegator delegator, String contentId, Appendable out, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException {
         renderSubContentAsText(dispatcher, delegator, contentId, out, mapKey, templateContext, locale, mimeTypeId, cache);
     }
 
+    @Override
     public String renderSubContentAsTextExt(LocalDispatcher dispatcher, Delegator delegator, String contentId, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException {
         return renderSubContentAsText(dispatcher, delegator, contentId, mapKey, templateContext, locale, mimeTypeId, cache);
     }
 
+    @Override
     public String renderContentAsTextExt(LocalDispatcher dispatcher, Delegator delegator, String contentId, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException {
         return renderContentAsText(dispatcher, delegator, contentId, templateContext, locale, mimeTypeId, cache);
     }
@@ -187,10 +193,8 @@ public class ContentWorker implements or
             ModelService service = dctx.getModelService(serviceName);
             if (service != null) {
                 //put all requestParameters into templateContext to use them as IN service parameters
-                Map<String,Object> tempTemplateContext = new HashMap<>();
-                @SuppressWarnings("unchecked")
-                Map<String,Object> temp = (Map<String, Object>) templateContext.get("requestParameters");
-                tempTemplateContext.putAll(temp);
+                Map<String,Object> tempTemplateContext = UtilMisc.<String,Object>toMap(templateContext);
+                tempTemplateContext.putAll(UtilGenerics.<String,Object>checkMap(templateContext.get("requestParameters")));
                 Map<String,Object> serviceCtx = service.makeValid(tempTemplateContext, ModelService.IN_PARAM);
                 Map<String,Object> serviceRes;
                 try {