You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2020/06/14 03:40:36 UTC

[ofbiz-framework] branch trunk updated: Improved: Use Compound Widget on rest of the project (OFBIZ-11821)

This is an automated email from the ASF dual-hosted git repository.

jamesyong pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 28809d7  Improved: Use Compound Widget on rest of the project (OFBIZ-11821)
28809d7 is described below

commit 28809d71d8fea3457f7ff9ac9db98f3c12931523
Author: James Yong <ja...@apache.org>
AuthorDate: Sun Jun 14 11:40:16 2020 +0800

    Improved: Use Compound Widget on rest of the project (OFBIZ-11821)
    
    Refactor for Find Request
---
 .../order/webapp/ordermgr/WEB-INF/controller.xml   |   3 +-
 .../order/widget/ordermgr/CustRequestForms.xml     |  50 --------
 .../order/widget/ordermgr/CustRequestScreens.xml   |  47 -------
 .../order/widget/ordermgr/FindRequestCompound.xml  | 138 +++++++++++++++++++++
 4 files changed, 139 insertions(+), 99 deletions(-)

diff --git a/applications/order/webapp/ordermgr/WEB-INF/controller.xml b/applications/order/webapp/ordermgr/WEB-INF/controller.xml
index 2322b3f..c434730 100644
--- a/applications/order/webapp/ordermgr/WEB-INF/controller.xml
+++ b/applications/order/webapp/ordermgr/WEB-INF/controller.xml
@@ -23,6 +23,7 @@ under the License.
     <include location="component://common/webcommon/WEB-INF/common-controller.xml"/>
     <include location="component://commonext/webapp/WEB-INF/controller.xml"/>
     <include location="component://content/webapp/content/WEB-INF/controller.xml"/>
+    <include location="component://order/widget/ordermgr/FindRequestCompound.xml"/>
     <description>Order Manager Module Site Configuration File</description>
     
     <!-- Events to run on every request before security (chains exempt) -->
@@ -1327,7 +1328,6 @@ under the License.
     </request-map>
 
     <!-- =============== CustRequest mapping =================-->
-    <request-map uri="FindRequest"><security https="true" auth="true"/><response name="success" type="view" value="FindRequest"/></request-map>
     <request-map uri="ViewRequest"><security https="true" auth="true"/><response name="success" type="view" value="ViewRequest"/></request-map>
     <request-map uri="EditRequest"><security https="true" auth="true"/><response name="success" type="view" value="EditRequest"/></request-map>
     <request-map uri="EditRequestCustomer"><security https="true" auth="true"/><response name="success" type="view" value="EditRequestCustomer"/></request-map>
@@ -2107,7 +2107,6 @@ under the License.
     <view-map name="ListQuoteNotes" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#ListQuoteNotes"/>
     <view-map name="EditQuoteNote" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#EditQuoteNote"/>
 
-    <view-map name="FindRequest" type="screen" page="component://order/widget/ordermgr/CustRequestScreens.xml#FindRequest"/>
     <view-map name="ViewRequest" type="screen" page="component://order/widget/ordermgr/CustRequestScreens.xml#ViewRequest"/>
     <view-map name="EditRequest" type="screen" page="component://order/widget/ordermgr/CustRequestScreens.xml#EditRequest"/>
     <view-map name="EditRequestCustomer" type="screen" page="component://order/widget/ordermgr/CustRequestScreens.xml#EditRequestCustomer"/>
diff --git a/applications/order/widget/ordermgr/CustRequestForms.xml b/applications/order/widget/ordermgr/CustRequestForms.xml
index 4adf28a..9bf17bb 100644
--- a/applications/order/widget/ordermgr/CustRequestForms.xml
+++ b/applications/order/widget/ordermgr/CustRequestForms.xml
@@ -20,56 +20,6 @@ under the License.
 
 <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xmlns="http://ofbiz.apache.org/Widget-Form" xsi:schemaLocation="http://ofbiz.apache.org/Widget-Form http://ofbiz.apache.org/dtds/widget-form.xsd">
-    <form name="FindRequests" target="FindRequest" title="" type="single" default-map-name="parameters"
-        header-row-style="header-row" default-table-style="basic-table">
-        <auto-fields-entity entity-name="CustRequest" default-field-type="find"/>
-        <field name="custRequestTypeId" position="2">
-            <drop-down allow-empty="true" allow-multiple="true">
-                <entity-options entity-name="CustRequestType" key-field-name="custRequestTypeId"/>
-            </drop-down>
-        </field>
-        <field name="statusId">
-            <drop-down allow-multiple="true">
-                <entity-options entity-name="StatusItem" key-field-name="statusId">
-                    <entity-constraint name="statusTypeId" operator="equals" value="CUSTREQ_STTS"/>
-                    <entity-order-by field-name="sequenceId"/>
-                </entity-options>
-            </drop-down>
-        </field>
-        <field name="salesChannelEnumId" title="${uiLabelMap.OrderSalesChannel}" position="2">
-            <drop-down allow-empty="true" allow-multiple="true">
-                <entity-options entity-name="Enumeration" key-field-name="enumId">
-                    <entity-constraint name="enumTypeId" value="ORDER_SALES_CHANNEL"/>
-                    <entity-order-by field-name="sequenceId"/>
-                </entity-options>
-            </drop-down>
-        </field>
-        <field name="fromPartyId" position="2"><lookup target-form-name="LookupPartyName"/></field>
-        <field name="currencyUomId"><ignored/></field>
-        <field name="maximumAmountUomId"><ignored/></field>
-        <field name="custRequestCategoryId"><ignored/></field>
-        <field name="fulfillContactMechId"><ignored/></field>
-        <field name="priority"><ignored/></field>
-        <field name="description"><ignored/></field>
-        <field name="createdDate"><ignored/></field>
-        <field name="createdByUserLogin"><ignored/></field>
-        <field name="lastModifiedDate"><ignored/></field>
-        <field name="lastModifiedByUserLogin"><ignored/></field>
-        <field name="closedDateTime" position="2"><date-find/></field>
-        <field name="responseRequiredDate" position="2"><date-find/></field>
-        <field name="productStoreId" title="${uiLabelMap.ProductProductStore}">
-            <drop-down allow-empty="true" allow-multiple="true">
-                <entity-options description="${storeName}" entity-name="ProductStore" key-field-name="productStoreId">
-                    <entity-order-by field-name="storeName"/>
-                </entity-options>
-            </drop-down>
-        </field>
-        <field name="reason" position="2"><text/></field>
-        <field name="submitButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit">
-            <submit button-type="button"/>
-        </field>
-        <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
-    </form>
 
     <form name="ListRequests" type="list" extends="ListRequestList" list-name="listIt">
         <actions>
diff --git a/applications/order/widget/ordermgr/CustRequestScreens.xml b/applications/order/widget/ordermgr/CustRequestScreens.xml
index 427cfe4..dcf5f47 100644
--- a/applications/order/widget/ordermgr/CustRequestScreens.xml
+++ b/applications/order/widget/ordermgr/CustRequestScreens.xml
@@ -20,53 +20,6 @@ under the License.
 
 <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://ofbiz.apache.org/Widget-Screen" xsi:schemaLocation="http://ofbiz.apache.org/Widget-Screen http://ofbiz.apache.org/dtds/widget-screen.xsd">
-    <screen name="FindRequest">
-        <section>
-            <actions>
-                <set field="titleProperty" value="OrderFindRequests"/>
-                <set field="headerItem" value="request"/>
-                <set field="entityName" value="CustRequest"/>
-                <set field="asm_multipleSelectForm" value="FindRequests"/>
-                <set field="asm_asmListItemPercentOfForm" value="110"/>
-                <set field="custRequestType.asm_multipleSelect"  value="FindRequests_custRequestTypeId"/>
-                <set field="custRequestType.asm_sortable" value="true"/>
-                <set field="custRequestType.asm_title" value=" "/>
-                <set field="statusId.asm_multipleSelect"  value="FindRequests_statusId"/>
-                <set field="statusId.asm_sortable" value="true"/>
-                <set field="statusId.asm_title" value=" "/>
-                <set field="productStoreId.asm_multipleSelect"  value="FindRequests_productStoreId"/>
-                <set field="productStoreId.asm_sortable" value="true"/>
-                <set field="productStoreId.asm_title" value=" "/>
-                <set field="salesChannelEnumId.asm_multipleSelect"  value="FindRequests_salesChannelEnumId"/>
-                <set field="salesChannelEnumId.asm_sortable" value="true"/>
-                <set field="salesChannelEnumId.asm_title" value=" "/>
-                <set field="asm_listField[]" from-field="custRequestType"/>
-                <set field="asm_listField[]" from-field="statusId"/>
-                <set field="asm_listField[]" from-field="productStoreId"/>
-                <set field="asm_listField[]" from-field="salesChannelEnumId"/>
-            </actions>
-            <widgets>
-                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
-                    <decorator-section name="body">
-                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
-                            <decorator-section name="menu-bar">
-                                <container style="button-bar">
-                                    <link target="request" text="${uiLabelMap.OrderNewRequest}" style="buttontext create"/>
-                                </container>
-                            </decorator-section>
-                            <decorator-section name="search-options">
-                                <platform-specific><html><html-template multi-block="true" location="component://common-theme/template/includes/SetMultipleSelectJsList.ftl"/></html></platform-specific>
-                                <include-form name="FindRequests" location="component://order/widget/ordermgr/CustRequestForms.xml"/>
-                            </decorator-section>
-                            <decorator-section name="search-results">
-                                <include-form name="ListRequests" location="component://order/widget/ordermgr/CustRequestForms.xml"/>
-                            </decorator-section>
-                        </decorator-screen>
-                    </decorator-section>
-                </decorator-screen>
-            </widgets>
-         </section>
-    </screen>
     
     <screen name="ViewCustRequest">
         <section>
diff --git a/applications/order/widget/ordermgr/FindRequestCompound.xml b/applications/order/widget/ordermgr/FindRequestCompound.xml
new file mode 100644
index 0000000..114e9c6
--- /dev/null
+++ b/applications/order/widget/ordermgr/FindRequestCompound.xml
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<compound-widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                  xmlns:sc="http://ofbiz.apache.org/Site-Conf"
+                  xmlns:sm="http://ofbiz.apache.org/Simple-Method"
+                  xmlns:wf="http://ofbiz.apache.org/Widget-Form"
+                  xmlns:wt="http://ofbiz.apache.org/Widget-Tree"
+                  xmlns:wm="http://ofbiz.apache.org/Widget-Menu"
+                  xmlns:ws="http://ofbiz.apache.org/Widget-Screen"
+                  xsi:noNamespaceSchemaLocation="../../../../framework/widget/dtd/compound-widgets.xsd">
+    <sc:site-conf>
+        <sc:request-map uri="FindRequest">
+            <sc:security https="true" auth="true"/>
+            <sc:response name="success" type="view" value="FindRequest"/>
+        </sc:request-map>
+        <sc:view-map name="FindRequest" type="screen" page="component://order/widget/ordermgr/RequestFindCompound.xml#FindRequest"/>
+    </sc:site-conf>
+
+    <ws:screens>
+        <ws:screen name="FindRequest">
+            <ws:section>
+                <ws:actions>
+                    <ws:set field="titleProperty" value="OrderFindRequests"/>
+                    <ws:set field="headerItem" value="request"/>
+                    <ws:set field="entityName" value="CustRequest"/>
+                    <ws:set field="asm_multipleSelectForm" value="FindRequests"/>
+                    <ws:set field="asm_asmListItemPercentOfForm" value="110"/>
+                    <ws:set field="custRequestType.asm_multipleSelect"  value="FindRequests_custRequestTypeId"/>
+                    <ws:set field="custRequestType.asm_sortable" value="true"/>
+                    <ws:set field="custRequestType.asm_title" value=" "/>
+                    <ws:set field="statusId.asm_multipleSelect"  value="FindRequests_statusId"/>
+                    <ws:set field="statusId.asm_sortable" value="true"/>
+                    <ws:set field="statusId.asm_title" value=" "/>
+                    <ws:set field="productStoreId.asm_multipleSelect"  value="FindRequests_productStoreId"/>
+                    <ws:set field="productStoreId.asm_sortable" value="true"/>
+                    <ws:set field="productStoreId.asm_title" value=" "/>
+                    <ws:set field="salesChannelEnumId.asm_multipleSelect"  value="FindRequests_salesChannelEnumId"/>
+                    <ws:set field="salesChannelEnumId.asm_sortable" value="true"/>
+                    <ws:set field="salesChannelEnumId.asm_title" value=" "/>
+                    <ws:set field="asm_listField[]" from-field="custRequestType"/>
+                    <ws:set field="asm_listField[]" from-field="statusId"/>
+                    <ws:set field="asm_listField[]" from-field="productStoreId"/>
+                    <ws:set field="asm_listField[]" from-field="salesChannelEnumId"/>
+                </ws:actions>
+                <ws:widgets>
+                    <ws:decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                        <ws:decorator-section name="body">
+                            <ws:decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
+                                <ws:decorator-section name="menu-bar">
+                                    <ws:container style="button-bar">
+                                        <ws:link target="request" text="${uiLabelMap.OrderNewRequest}" style="buttontext create"/>
+                                    </ws:container>
+                                </ws:decorator-section>
+                                <ws:decorator-section name="search-options">
+                                    <ws:platform-specific><html><html-template multi-block="true" location="component://common-theme/template/includes/SetMultipleSelectJsList.ftl"/></html></ws:platform-specific>
+                                    <ws:include-form name="FindRequests" location="component://order/widget/ordermgr/RequestFindCompound.xml"/>
+                                </ws:decorator-section>
+                                <ws:decorator-section name="search-results">
+                                    <ws:include-form name="ListRequests" location="component://order/widget/ordermgr/CustRequestForms.xml"/>
+                                </ws:decorator-section>
+                            </ws:decorator-screen>
+                        </ws:decorator-section>
+                    </ws:decorator-screen>
+                </ws:widgets>
+            </ws:section>
+        </ws:screen>
+    </ws:screens>
+
+    <wf:forms>
+        <wf:form name="FindRequests" target="FindRequest" title="" type="single" default-map-name="parameters"
+              header-row-style="header-row" default-table-style="basic-table">
+            <wf:auto-fields-entity entity-name="CustRequest" default-field-type="find"/>
+            <wf:field name="custRequestTypeId" position="2">
+                <wf:drop-down allow-empty="true" allow-multiple="true">
+                    <wf:entity-options entity-name="CustRequestType" key-field-name="custRequestTypeId"/>
+                </wf:drop-down>
+            </wf:field>
+            <wf:field name="statusId">
+                <wf:drop-down allow-multiple="true">
+                    <wf:entity-options entity-name="StatusItem" key-field-name="statusId">
+                        <wf:entity-constraint name="statusTypeId" operator="equals" value="CUSTREQ_STTS"/>
+                        <wf:entity-order-by field-name="sequenceId"/>
+                    </wf:entity-options>
+                </wf:drop-down>
+            </wf:field>
+            <wf:field name="salesChannelEnumId" title="${uiLabelMap.OrderSalesChannel}" position="2">
+                <wf:drop-down allow-empty="true" allow-multiple="true">
+                    <wf:entity-options entity-name="Enumeration" key-field-name="enumId">
+                        <wf:entity-constraint name="enumTypeId" value="ORDER_SALES_CHANNEL"/>
+                        <wf:entity-order-by field-name="sequenceId"/>
+                    </wf:entity-options>
+                </wf:drop-down>
+            </wf:field>
+            <wf:field name="fromPartyId" position="2"><wf:lookup target-form-name="LookupPartyName"/></wf:field>
+            <wf:field name="currencyUomId"><wf:ignored/></wf:field>
+            <wf:field name="maximumAmountUomId"><wf:ignored/></wf:field>
+            <wf:field name="custRequestCategoryId"><wf:ignored/></wf:field>
+            <wf:field name="fulfillContactMechId"><wf:ignored/></wf:field>
+            <wf:field name="priority"><wf:ignored/></wf:field>
+            <wf:field name="description"><wf:ignored/></wf:field>
+            <wf:field name="createdDate"><wf:ignored/></wf:field>
+            <wf:field name="createdByUserLogin"><wf:ignored/></wf:field>
+            <wf:field name="lastModifiedDate"><wf:ignored/></wf:field>
+            <wf:field name="lastModifiedByUserLogin"><wf:ignored/></wf:field>
+            <wf:field name="closedDateTime" position="2"><wf:date-find/></wf:field>
+            <wf:field name="responseRequiredDate" position="2"><wf:date-find/></wf:field>
+            <wf:field name="productStoreId" title="${uiLabelMap.ProductProductStore}">
+                <wf:drop-down allow-empty="true" allow-multiple="true">
+                    <wf:entity-options description="${storeName}" entity-name="ProductStore" key-field-name="productStoreId">
+                        <wf:entity-order-by field-name="storeName"/>
+                    </wf:entity-options>
+                </wf:drop-down>
+            </wf:field>
+            <wf:field name="reason" position="2"><wf:text/></wf:field>
+            <wf:field name="submitButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit">
+                <wf:submit button-type="button"/>
+            </wf:field>
+            <wf:field name="noConditionFind"><wf:hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></wf:field>
+        </wf:form>
+    </wf:forms>
+</compound-widgets>
\ No newline at end of file