Author: pgil
Date: Thu Apr 21 21:57:06 2016 New Revision: 1740417 URL: http://svn.apache.org/viewvc?rev=1740417&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/release14.12/framework/widget/dtd/widget-common.xsd ofbiz/branches/release14.12/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java ofbiz/branches/release14.12/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java ofbiz/branches/release14.12/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java Modified: ofbiz/branches/release14.12/framework/widget/dtd/widget-common.xsd URL: http://svn.apache.org/viewvc/ofbiz/branches/release14.12/framework/widget/dtd/widget-common.xsd?rev=1740417&r1=1740416&r2=1740417&view=diff ============================================================================== --- ofbiz/branches/release14.12/framework/widget/dtd/widget-common.xsd (original) +++ ofbiz/branches/release14.12/framework/widget/dtd/widget-common.xsd Thu Apr 21 21:57:06 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/release14.12/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release14.12/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java?rev=1740417&r1=1740416&r2=1740417&view=diff ============================================================================== --- ofbiz/branches/release14.12/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java (original) +++ ofbiz/branches/release14.12/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java Thu Apr 21 21:57:06 2016 @@ -479,6 +479,20 @@ public final class CommonWidgetModels { return fullParameterMap; } + 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 String getPrefix(Map<String, Object> context) { return this.prefixExdr.expandString(context); } Modified: ofbiz/branches/release14.12/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release14.12/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java?rev=1740417&r1=1740416&r2=1740417&view=diff ============================================================================== --- ofbiz/branches/release14.12/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java (original) +++ ofbiz/branches/release14.12/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java Thu Apr 21 21:57:06 2016 @@ -2296,6 +2296,10 @@ public class ModelFormField { return link.getParameterMap(context); } + public Map<String, String> getParameterMap(Map<String, Object> context, String defaultEntityName, String defaultServiceName) { + return link.getParameterMap(context, defaultEntityName, defaultServiceName); + } + public String getPrefix(Map<String, Object> context) { return link.getPrefix(context); } @@ -3264,6 +3268,10 @@ public class ModelFormField { return link.getParameterMap(context); } + public Map<String, String> getParameterMap(Map<String, Object> context, String defaultEntityName, String defaultServiceName) { + return link.getParameterMap(context, defaultEntityName, defaultServiceName); + } + public String getPrefix(Map<String, Object> context) { return link.getPrefix(context); } Modified: ofbiz/branches/release14.12/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release14.12/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java?rev=1740417&r1=1740416&r2=1740417&view=diff ============================================================================== --- ofbiz/branches/release14.12/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java (original) +++ ofbiz/branches/release14.12/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java Thu Apr 21 21:57:06 2016 @@ -311,7 +311,8 @@ public final class MacroFormRenderer imp this.request.setAttribute("alternate", encodedAlternate); this.request.setAttribute("imageTitle", encodedImageTitle); this.request.setAttribute("descriptionSize", hyperlinkField.getSize()); - 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"); @@ -2946,7 +2947,8 @@ public final class MacroFormRenderer imp if (subHyperlink.shouldUse(context)) { 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 |