This is an automated email from the ASF dual-hosted git repository. pgil 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 38d4ef6 Implemented : Add sub-screen decorator DetailScreenDecorator and EmbeddedDecorator (OFBIZ-11813) 38d4ef6 is described below commit 38d4ef69b48a7ca4017406dfb0590f9ae8b4cfcf Author: Gil Portenseigne <p...@riseup.net> AuthorDate: Fri Jun 18 15:39:29 2021 +0200 Implemented : Add sub-screen decorator DetailScreenDecorator and EmbeddedDecorator (OFBIZ-11813) To homogenize and help each theme to implement correctly the screen engine concept, we add two sub-decorators like existing 'FindScreenDecorator'. DetailScreenDecorator can be used to display a sum up of an object and its related data. Embedded Decorator can be used to inject a specific screen in an structured page area. Those are composed of several sections that can be handled by the theme for specific display. Thanks Nicolas --- framework/common/widget/CommonScreens.xml | 41 +++++++++++ themes/common-theme/widget/CommonScreens.xml | 101 ++++++++++++++++++++++++++- themes/common-theme/widget/Theme.xml | 3 + 3 files changed, 144 insertions(+), 1 deletion(-) diff --git a/framework/common/widget/CommonScreens.xml b/framework/common/widget/CommonScreens.xml index 092be69..ca005a1 100644 --- a/framework/common/widget/CommonScreens.xml +++ b/framework/common/widget/CommonScreens.xml @@ -295,6 +295,12 @@ under the License. </section> </screen> + <!--FindScreenDecorator: Sub Screen to display a search sub screen area. + contains sections : + * menu-bar + * search-options: option for the search + * search-results: result displayed after a search + --> <screen name="FindScreenDecorator"> <section> <widgets> @@ -304,6 +310,41 @@ under the License. </section> </screen> + <!--DetailScreenDecorator: Sub Screen to show a sum up of + an object and its related data. Composed in six sections : + * menu-bar + * breadcrumbs: the pathway of this object + * summary: that display main data of the object + * action: action cover the object (modification, duplicate, ...) + * tab-bar: to give access to related data into detail section + * detail: area that will display related data + --> + <screen name="DetailScreenDecorator"> + <section> + <widgets> + <include-screen name="MinimalActions" /> + <include-screen name="DetailScreenDecorator" location="${groovy:commonScreenLocations.DetailScreenDecorator?commonScreenLocations.DetailScreenDecorator:commonDecoratorLocation}"/> + </widgets> + </section> + </screen> + + <!--EmbeddedDecorator: Decorator can be use as main decorator or sub screen decorator to display a sub screen area. + contains sections : + * menu-bar + * action: search filtering, history display… + * single: display element as single + * content: display element as content + * list: display element as list + --> + <screen name="EmbeddedDecorator"> + <section> + <widgets> + <include-screen name="MinimalActions"/> + <include-screen name="EmbeddedDecorator" location="${groovy:commonScreenLocations.EmbeddedDecorator?commonScreenLocations.EmbeddedDecorator:commonDecoratorLocation}"/> + </widgets> + </section> + </screen> + <screen name="help"> <section> <widgets> diff --git a/themes/common-theme/widget/CommonScreens.xml b/themes/common-theme/widget/CommonScreens.xml index 3536e9e..1a6a1f5 100644 --- a/themes/common-theme/widget/CommonScreens.xml +++ b/themes/common-theme/widget/CommonScreens.xml @@ -686,7 +686,7 @@ under the License. </screenlet> <screenlet padded="false"> <label style="h3" text="${uiLabelMap.CommonSearchResults}"/> - <container id="search-results"> + <container id="${screen:id(screenStack)}"> <decorator-section-include name="search-results"/> </container> </screenlet> @@ -694,6 +694,105 @@ under the License. </section> </screen> + <screen name="DetailScreenDecorator"> + <section> + <actions> + <set field="detailAreaId" value="${groovy:UUID.randomUUID().toString()}" global="true"/> + </actions> + <widgets> + <section> + <condition> + <if-empty field="titleProperty"/> + </condition> + <widgets> + <container style="page-title"><label text="${title}"></label></container> + </widgets> + <fail-widgets> + <container style="page-title"><label text="${uiLabelMap[titleProperty]}"></label></container> + </fail-widgets> + </section> + <container style="clear"/> + <container style="menu-bar"> + <decorator-section-include name="menu-bar"/> + </container> + <container style="breadcrumbs"> + <decorator-section-include name="breadcrumbs"/> + </container> + <container style="summary"> + <decorator-section-include name="summary"/> + </container> + <container style="actions"> + <decorator-section-include name="actions"/> + </container> + <container style="tab-bar"> + <decorator-section-include name="tab-bar"/> + </container> + <container style="details" id="${detailAreaId}"> + <decorator-section-include name="details"/> + </container> + </widgets> + </section> + </screen> + + <screen name="EmbeddedDecorator"> + <section name="embedded"> + <widgets> + <container style="embeddedScreen" id="${screen:id(screenStack)}"> + <section> + <condition> + <not><if-empty-section section-name="actions"/></not> + </condition> + <widgets> + <container style="actions"> + <decorator-section-include name="actions"/> + </container> + </widgets> + </section> + <section> + <condition> + <not><if-empty-section section-name="menu-bar"/></not> + </condition> + <widgets> + <container style="menu-bar"> + <decorator-section-include name="menu-bar"/> + </container> + </widgets> + </section> + <section> + <condition> + <not><if-empty-section section-name="single"/></not> + </condition> + <widgets> + <container style="single"> + <decorator-section-include name="single"/> + </container> + </widgets> + </section> + <section> + <condition> + <not><if-empty-section section-name="content"/></not> + </condition> + <widgets> + <container style="content"> + <decorator-section-include name="content"/> + </container> + </widgets> + </section> + <section> + <condition> + <not><if-empty-section section-name="list"/></not> + </condition> + <widgets> + <container style="list"> + <decorator-section-include name="list"/> + </container> + </widgets> + </section> + </container> + </widgets> + </section> + </screen> + <screen name="help"> <section> <actions> diff --git a/themes/common-theme/widget/Theme.xml b/themes/common-theme/widget/Theme.xml index 80a4825..fd7b726 100644 --- a/themes/common-theme/widget/Theme.xml +++ b/themes/common-theme/widget/Theme.xml @@ -120,12 +120,14 @@ under the License. <screen name="LookupDecorator"/> <screen name="ShortcutDecorator"/> <screen name="SimpleDecorator"/> + <screen name="EmbeddedDecorator"/> <screen name="FoReportDecorator"/> <screen name="GlobalFoDecorator"/> <screen name="LookupHelpDecorator" location="component://common-theme/widget/HelpScreens.xml"/> </root-decorator> <subtype-decorator default-location="component://common-theme/widget/CommonScreens.xml"> <screen name="FindScreenDecorator"/> + <screen name="DetailScreenDecorator"/> </subtype-decorator> <generic-screen default-location="component://common-theme/widget/CommonScreens.xml"> <screen name="geoChart"/> @@ -161,6 +163,7 @@ under the License. <form name="CommonBasicGrid"/> <form name="CommonSimpleList"/> <form name="CommonBasicList"/> + <form name="CommonDynamicList"/> <form name="CommonInLineEditList"/> <form name="CommonBasicSingle"/> </root-decorator>