Author: pgil
Date: Thu Apr 21 21:57:02 2016 New Revision: 1740416 URL: http://svn.apache.org/viewvc?rev=1740416&view=rev Log: OFBIZ-5703 : Fix a regression on <auto-parameters-entity/> and <auto-parameters-service/> in which default-entity-name and default-service-name weren't taken in consideration anymore. Thanks Dhiraj Gupta for reporting the issue, Thanks Jacques and Divesh for the analysis Modified: ofbiz/branches/release15.12/framework/widget/dtd/widget-common.xsd ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java Modified: ofbiz/branches/release15.12/framework/widget/dtd/widget-common.xsd URL: http://svn.apache.org/viewvc/ofbiz/branches/release15.12/framework/widget/dtd/widget-common.xsd?rev=1740416&r1=1740415&r2=1740416&view=diff ============================================================================== --- ofbiz/branches/release15.12/framework/widget/dtd/widget-common.xsd (original) +++ ofbiz/branches/release15.12/framework/widget/dtd/widget-common.xsd Thu Apr 21 21:57:02 2016 @@ -579,6 +579,8 @@ under the License. </xs:element> <xs:complexType name="link"> <xs:sequence> + <xs:element minOccurs="0" ref="auto-parameters-service"/> + <xs:element minOccurs="0" ref="auto-parameters-entity"/> <xs:element minOccurs="0" maxOccurs="unbounded" ref="parameter" /> <xs:element minOccurs="0" name="image" type="image" /> </xs:sequence> Modified: ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java?rev=1740416&r1=1740415&r2=1740416&view=diff ============================================================================== --- ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java (original) +++ ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java Thu Apr 21 21:57:02 2016 @@ -481,6 +481,20 @@ public final class CommonWidgetModels { return parameterList; } + public Map<String, String> getParameterMap(Map<String, Object> context, String defaultEntityName, String defaultServiceName) { + Map<String, String> fullParameterMap = new HashMap<String, String>(); + for (Parameter parameter : this.parameterList) { + fullParameterMap.put(parameter.getName(), parameter.getValue(context)); + } + if (autoServiceParameters != null) { + fullParameterMap.putAll(autoServiceParameters.getParametersMap(context, defaultServiceName)); + } + if (autoEntityParameters != null) { + fullParameterMap.putAll(autoEntityParameters.getParametersMap(context, defaultEntityName)); + } + return fullParameterMap; + } + public Map<String, String> getParameterMap(Map<String, Object> context) { Map<String, String> fullParameterMap = new HashMap<String, String>(); for (Parameter parameter : this.parameterList) { Modified: ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java?rev=1740416&r1=1740415&r2=1740416&view=diff ============================================================================== --- ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java (original) +++ ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java Thu Apr 21 21:57:02 2016 @@ -2480,6 +2480,10 @@ public class ModelFormField { public List<Parameter> getParameterList() { return link.getParameterList(); } + + public Map<String, String> getParameterMap(Map<String, Object> context, String defaultEntityName, String defaultServiceName) { + return link.getParameterMap(context, defaultEntityName, defaultServiceName); + } public Map<String, String> getParameterMap(Map<String, Object> context) { return link.getParameterMap(context); @@ -3592,6 +3596,10 @@ public class ModelFormField { return link.getParameterList(); } + public Map<String, String> getParameterMap(Map<String, Object> context, String defaultEntityName, String defaultServiceName) { + return link.getParameterMap(context, defaultEntityName, defaultServiceName); + } + public Map<String, String> getParameterMap(Map<String, Object> context) { return link.getParameterMap(context); } Modified: ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java?rev=1740416&r1=1740415&r2=1740416&view=diff ============================================================================== --- ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java (original) +++ ofbiz/branches/release15.12/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java Thu Apr 21 21:57:02 2016 @@ -316,7 +316,9 @@ public final class MacroFormRenderer imp this.request.setAttribute("id", hyperlinkField.getId(context)); this.request.setAttribute("width", hyperlinkField.getWidth()); this.request.setAttribute("height", hyperlinkField.getHeight()); - makeHyperlinkByType(writer, hyperlinkField.getLinkType(), modelFormField.getWidgetStyle(), hyperlinkField.getUrlMode(), hyperlinkField.getTarget(context), hyperlinkField.getParameterMap(context), hyperlinkField.getDescription(context), hyperlinkField.getTargetWindow(context), + makeHyperlinkByType(writer, hyperlinkField.getLinkType(), modelFormField.getWidgetStyle(), hyperlinkField.getUrlMode(), hyperlinkField.getTarget(context), + hyperlinkField.getParameterMap(context, modelFormField.getEntityName(), modelFormField.getServiceName()), + hyperlinkField.getDescription(context), hyperlinkField.getTargetWindow(context), hyperlinkField.getConfirmation(context), modelFormField, this.request, this.response, context); this.appendTooltip(writer, context, modelFormField); this.request.removeAttribute("image"); @@ -3019,7 +3021,7 @@ public final class MacroFormRenderer imp if (UtilValidate.isNotEmpty(subHyperlink.getHeight())) this.request.setAttribute("height", subHyperlink.getHeight()); writer.append(' '); makeHyperlinkByType(writer, subHyperlink.getLinkType(), subHyperlink.getStyle(context), subHyperlink.getUrlMode(), - subHyperlink.getTarget(context), subHyperlink.getParameterMap(context), subHyperlink.getDescription(context), + subHyperlink.getTarget(context), subHyperlink.getParameterMap(context, subHyperlink.getModelFormField().getEntityName(), subHyperlink.getModelFormField().getServiceName()), subHyperlink.getDescription(context), subHyperlink.getTargetWindow(context), "", subHyperlink.getModelFormField(), this.request, this.response, context); } |
Free forum by Nabble | Edit this page |