Author: jleroux
Date: Fri Nov 14 11:15:54 2014
New Revision: 1639606

URL: http://svn.apache.org/r1639606
Log:
A patch from Pierre Gaudin for "use requestParameters for customMethod call" 
https://issues.apache.org/jira/browse/OFBIZ-5822

For a content, you can set a custom method that perform an action before 
content's rendering.
Unfortunately, in the customMethod call, the request Parameters can't be used 
because they are not set into the map that is used to create custom method IN 
parameters.
This patch solves this problem

Modified:
    
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java

Modified: 
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java?rev=1639606&r1=1639605&r2=1639606&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
 Fri Nov 14 11:15:54 2014
@@ -189,6 +189,8 @@ public class ContentWorker implements or
             DispatchContext dctx = dispatcher.getDispatchContext();
             ModelService service = dctx.getModelService(serviceName);
             if (service != null) {
+                //put all requestParameters into templateContext to use them 
as IN service parameters
+                templateContext.putAll((Map<String, 
Object>)templateContext.get("requestParameters"));
                 Map<String,Object> serviceCtx = 
service.makeValid(templateContext, ModelService.IN_PARAM);
                 Map<String,Object> serviceRes;
                 try {


Reply via email to