Author: pgil
Date: Thu Apr 21 21:56:52 2016 New Revision: 1740415 URL: http://svn.apache.org/viewvc?rev=1740415&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/trunk/framework/widget/dtd/widget-common.xsd ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java ofbiz/trunk/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml Modified: ofbiz/trunk/framework/widget/dtd/widget-common.xsd URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-common.xsd?rev=1740415&r1=1740414&r2=1740415&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/dtd/widget-common.xsd (original) +++ ofbiz/trunk/framework/widget/dtd/widget-common.xsd Thu Apr 21 21:56:52 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/trunk/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java?rev=1740415&r1=1740414&r2=1740415&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/CommonWidgetModels.java Thu Apr 21 21:56:52 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/trunk/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java?rev=1740415&r1=1740414&r2=1740415&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/model/ModelFormField.java Thu Apr 21 21:56:52 2016 @@ -2489,6 +2489,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); @@ -3601,6 +3605,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/trunk/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java?rev=1740415&r1=1740414&r2=1740415&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java Thu Apr 21 21:56:52 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"); @@ -3007,7 +3009,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); } Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=1740415&r1=1740414&r2=1740415&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml Thu Apr 21 21:56:52 2016 @@ -852,20 +852,14 @@ <field name="contentId" use-when="headerItem.equals("EditProjectContents")"> <display-entity entity-name="Content" key-field-name="contentId" description="${contentName}" also-hidden="true"> <sub-hyperlink target="EditProjectContents" description="${contentId}" link-style="buttontext" target-type="inter-app"> - <parameter param-name="contentId" from-field="contentId"/> - <parameter param-name="workEffortId" from-field="workEffortId"/> - <parameter param-name="fromDate" from-field="fromDate"/> - <parameter param-name="workEffortContentTypeId" from-field="workEffortContentTypeId"/> + <auto-parameters-entity/> </sub-hyperlink> </display-entity> </field> <field name="contentId" use-when="headerItem.equals("EditTaskContents")"> <display-entity entity-name="Content" key-field-name="contentId" description="${contentName}" also-hidden="true"> <sub-hyperlink target="EditTaskContents" description="${contentId}" link-style="buttontext" target-type="inter-app"> - <parameter param-name="contentId" from-field="contentId"/> - <parameter param-name="workEffortId" from-field="workEffortId"/> - <parameter param-name="fromDate" from-field="fromDate"/> - <parameter param-name="workEffortContentTypeId" from-field="workEffortContentTypeId"/> + <auto-parameters-entity/> </sub-hyperlink> </display-entity> </field> @@ -873,10 +867,7 @@ <field name="submitButton"><ignored/></field> <field name="deleteLink" title=" " widget-style="buttontext" use-when="headerItem.equals("EditProjectContents")"> <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="deleteProjectContent"> - <parameter param-name="contentId" from-field="contentId"/> - <parameter param-name="workEffortId" from-field="workEffortId"/> - <parameter param-name="fromDate" from-field="fromDate"/> - <parameter param-name="workEffortContentTypeId" from-field="workEffortContentTypeId"/> + <auto-parameters-entity/> </hyperlink> </field> <field name="downloadLink" title=" " widget-style="buttontext"> @@ -884,10 +875,7 @@ </field> <field name="deleteLink" title=" " widget-style="buttontext" use-when="headerItem.equals("EditTaskContents")"> <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="deleteTaskContent"> - <parameter param-name="contentId" from-field="contentId"/> - <parameter param-name="workEffortId" from-field="workEffortId"/> - <parameter param-name="fromDate" from-field="fromDate"/> - <parameter param-name="workEffortContentTypeId" from-field="workEffortContentTypeId"/> + <auto-parameters-entity/> </hyperlink> </field> </form> |
Free forum by Nabble | Edit this page |