Skip to content

Commit 7165768

Browse files
committed
Implemented: Add a framework method to get main webapp menu with the webapp name
(OFBIZ-10601) To improve theme management and provide better tools for new themes, we implement a method to obtain the main menu of a webapp. Instead of just managing a menu, we extend the functionality by offering a method to expose a summary of the webapp, to simplify the navigation. For this we add a new attribute on webapp definition app-shortcut-screen : <webapp name="mywebapp" ... app-shortcut-screen="component://mycomponent/widget/CommonScreens.xml#ShortcutApp" ... /> The idea is to define a new purpose screen *Shortcut* that contains what defines a webapp when an action or navigation has been requested. With this screen you can load a menu, a search, a complex description and use all screen powerfulness to resolve what displaying and support by theming <screen name="ShortcutApp"> <section> <actions> <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/> </actions> <widgets> <decorator-screen name="ShortcutDecorator" location="component://common/widget/CommonScreens.xml"> <decorator-section name="body"> <include-menu name="MyShortcutAppBar" location="component://mycomponent/widget/CommonMenus.xml"/> </decorator-section> </decorator-screen> </widgets> </section> </screen> Each component are self-sufficient to define what shortcuts to display without framework change or knowledge about other component. Each theme can implement and customize the display rendering at will. To illustrate an example of implementation we set sub menu for each webapp defined on applications and exploit it on bluelight theme. Thanks for Dennis Balkir, Jacques Leroux, Leila Mekika and Julien Nicolas for their involvement
1 parent c4d8f90 commit 7165768

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+596
-11
lines changed

applications/accounting/ofbiz-component.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,22 @@ under the License.
8080
server="default-server"
8181
location="webapp/accounting"
8282
base-permission="OFBTOOLS,ACCOUNTING"
83+
app-shortcut-screen="component://accounting/widget/CommonScreens.xml#ShortcutApp"
8384
mount-point="/accounting"/>
8485

8586
<webapp name="ar"
8687
title="Accounting - AR"
8788
server="default-server"
8889
location="webapp/ar"
8990
base-permission="OFBTOOLS,ACCOUNTING"
91+
app-shortcut-screen="component://accounting/widget/ar/CommonScreens.xml#ShortcutApp"
9092
mount-point="/ar"/>
9193

9294
<webapp name="ap"
9395
title="Accounting - AP"
9496
server="default-server"
9597
location="webapp/ap"
9698
base-permission="OFBTOOLS,ACCOUNTING"
99+
app-shortcut-screen="component://accounting/widget/ap/CommonScreens.xml#ShortcutApp"
97100
mount-point="/ap"/>
98101
</ofbiz-component>

applications/accounting/widget/AccountingMenus.xml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,38 @@ under the License.
5353
<menu-item name="companies" title="${uiLabelMap.AccountingOrgGlSettings}"><link target="ListCompanies"/></menu-item>
5454
</menu>
5555

56+
<menu name="AccountingShortcutAppBar" title="${uiLabelMap.AccountingManager}">
57+
<menu-item name="invoices" title="${uiLabelMap.AccountingInvoicesMenu}"><link target="/accounting/control/findInvoices" url-mode="inter-app"/></menu-item>
58+
<menu-item name="payments" title="${uiLabelMap.AccountingPaymentsMenu}"><link target="/accounting/control/findPayments" url-mode="inter-app"/></menu-item>
59+
<menu-item name="PaymentGroup" title="${uiLabelMap.AccountingPaymentGroup}"><link target="/accounting/control/FindPaymentGroup" url-mode="inter-app"/></menu-item>
60+
<menu-item name="transaction" title="${uiLabelMap.AccountingTransactions}">
61+
<condition>
62+
<or>
63+
<if-has-permission permission="MANUAL" action="_PAYMENT"/>
64+
<if-has-permission permission="ACCOUNTING" action="_CREATE"/>
65+
</or>
66+
</condition>
67+
<link target="/accounting/control/FindGatewayResponses" url-mode="inter-app"/>
68+
</menu-item>
69+
<menu-item name="PaymentGatewayConfig" title="${uiLabelMap.AccountingPaymentGatewayConfig}">
70+
<condition>
71+
<or>
72+
<if-has-permission permission="PAYPROC" action="_ADMIN"/>
73+
<if-has-permission permission="ACCOUNTING" action="_ADMIN"/>
74+
</or>
75+
</condition>
76+
<link target="/accounting/control/FindPaymentGatewayConfig" url-mode="inter-app"/>
77+
</menu-item>
78+
<menu-item name="billingaccount" title="${uiLabelMap.AccountingBillingMenu}"><link target="/accounting/control/FindBillingAccount" url-mode="inter-app"/></menu-item>
79+
<menu-item name="FindFinAccount" title="${uiLabelMap.AccountingFinAccount}"><link target="/accounting/control/FinAccountMain" url-mode="inter-app"/></menu-item>
80+
<menu-item name="TaxAuthorities" title="${uiLabelMap.AccountingTaxAuthorities}"><link target="/accounting/control/FindTaxAuthority" url-mode="inter-app"/></menu-item>
81+
<menu-item name="agreements" title="${uiLabelMap.AccountingAgreements}"><link target="/accounting/control/FindAgreement" url-mode="inter-app"/></menu-item>
82+
<menu-item name="ListFixedAssets" title="${uiLabelMap.AccountingFixedAssets}"><link target="/accounting/control/ListFixedAssets" url-mode="inter-app"/></menu-item>
83+
<menu-item name="ListBudgets" title="${uiLabelMap.AccountingBudgets}"><link target="/accounting/control/ListBudgets" url-mode="inter-app"/></menu-item>
84+
<menu-item name="GlobalGLSettings" title="${uiLabelMap.AccountingGlobalGLSettings}"><link target="/accounting/control/globalGLSettings" url-mode="inter-app"/></menu-item>
85+
<menu-item name="companies" title="${uiLabelMap.AccountingOrgGlSettings}"><link target="/accounting/control/ListCompanies" url-mode="inter-app"/></menu-item>
86+
</menu>
87+
5688
<menu name="InvoiceTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
5789
<menu-item name="find" title="${uiLabelMap.CommonFind}">
5890
<link target="findInvoices"/>

applications/accounting/widget/CommonScreens.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,21 @@ under the License.
4747
</widgets>
4848
</section>
4949
</screen>
50-
50+
<screen name="ShortcutApp">
51+
<section>
52+
<actions>
53+
<property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
54+
<property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
55+
</actions>
56+
<widgets>
57+
<decorator-screen name="ShortcutDecorator" location="component://common/widget/CommonScreens.xml">
58+
<decorator-section name="body">
59+
<include-menu name="AccountingShortcutAppBar" location="component://accounting/widget/AccountingMenus.xml"/>
60+
</decorator-section>
61+
</decorator-screen>
62+
</widgets>
63+
</section>
64+
</screen>
5165
<screen name="CommonFinAccountDecorator">
5266
<section>
5367
<actions>

applications/accounting/widget/ap/ApMenus.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ under the License.
2727
<menu-item name="reports" title="${uiLabelMap.AccountingReports}"><link target="listReports"/></menu-item>
2828
</menu>
2929

30+
<menu name="ApShortcutAppBar" title="${uiLabelMap.AccountingApManager}">
31+
<menu-item name="agreements" title="${uiLabelMap.AccountingAgreements}"><link target="/ap/control/FindAgreement" url-mode="inter-app"/></menu-item>
32+
<menu-item name="invoices" title="${uiLabelMap.AccountingInvoicesMenu}"><link target="/ap/control/FindApInvoices" url-mode="inter-app"/></menu-item>
33+
<menu-item name="payments" title="${uiLabelMap.AccountingPaymentsMenu}"><link target="/ap/control/findPayments" url-mode="inter-app"/></menu-item>
34+
<menu-item name="apPaymentGroups" title="${uiLabelMap.AccountingApPaymentGroupMenu}"><link target="/ap/control/FindApPaymentGroups" url-mode="inter-app"/></menu-item>
35+
<menu-item name="findVendors" title="${uiLabelMap.AccountingApPageTitleFindVendors}"><link target="/ap/control/findVendors" url-mode="inter-app"/></menu-item>
36+
<menu-item name="reports" title="${uiLabelMap.AccountingReports}"><link target="/ap/control/listReports" url-mode="inter-app"/></menu-item>
37+
</menu>
38+
3039
<menu name="ApInvoiceTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"
3140
default-menu-item-name="viewInvoices">
3241
<menu-item name="viewInvoices" title="${uiLabelMap.CommonMain}">

applications/accounting/widget/ap/CommonScreens.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,21 @@ under the License.
3838
</widgets>
3939
</section>
4040
</screen>
41+
<screen name="ShortcutApp">
42+
<section>
43+
<actions>
44+
<property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
45+
<property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
46+
</actions>
47+
<widgets>
48+
<decorator-screen name="ShortcutDecorator" location="component://common/widget/CommonScreens.xml">
49+
<decorator-section name="body">
50+
<include-menu name="ApShortcutAppBar" location="component://accounting/widget/ap/ApMenus.xml"/>
51+
</decorator-section>
52+
</decorator-screen>
53+
</widgets>
54+
</section>
55+
</screen>
4156

4257
<screen name="main">
4358
<section>

applications/accounting/widget/ar/ArMenus.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ under the License.
2626
<menu-item name="paymentGroups" title="${uiLabelMap.AccountingArPaymentGroupMenu}"><link target="FindArPaymentGroups"/></menu-item>
2727
<menu-item name="reports" title="${uiLabelMap.AccountingReports}"><link target="ListReports"/></menu-item>
2828
</menu>
29+
<menu name="ArShortcutAppBar" title="${uiLabelMap.AccountingArManager}">
30+
<menu-item name="agreements" title="${uiLabelMap.AccountingAgreements}"><link target="/ar/control/FindAgreement" url-mode="inter-app"/></menu-item>
31+
<menu-item name="invoices" title="${uiLabelMap.AccountingInvoicesMenu}"><link target="/ar/control/findInvoices" url-mode="inter-app"/></menu-item>
32+
<menu-item name="payments" title="${uiLabelMap.AccountingPaymentsMenu}"><link target="/ar/control/findPayments" url-mode="inter-app"/></menu-item>
33+
<menu-item name="paymentGroups" title="${uiLabelMap.AccountingArPaymentGroupMenu}"><link target="/ar/control/FindArPaymentGroups" url-mode="inter-app"/></menu-item>
34+
<menu-item name="reports" title="${uiLabelMap.AccountingReports}"><link target="/ar/control/ListReports" url-mode="inter-app"/></menu-item>
35+
</menu>
2936
<menu name="ArPaymentTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
3037
<menu-item name="findPayments" title="${uiLabelMap.PageTitleFindPayment}">
3138
<link target="findPayments"/>

applications/accounting/widget/ar/CommonScreens.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,21 @@ under the License.
4040
</widgets>
4141
</section>
4242
</screen>
43+
<screen name="ShortcutApp">
44+
<section>
45+
<actions>
46+
<property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
47+
<property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
48+
</actions>
49+
<widgets>
50+
<decorator-screen name="ShortcutDecorator" location="component://common/widget/CommonScreens.xml">
51+
<decorator-section name="body">
52+
<include-menu name="ArShortcutAppBar" location="component://accounting/widget/ar/ArMenus.xml"/>
53+
</decorator-section>
54+
</decorator-screen>
55+
</widgets>
56+
</section>
57+
</screen>
4358

4459
<screen name="main">
4560
<section>

applications/content/ofbiz-component.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ under the License.
4949
server="default-server"
5050
location="webapp/content"
5151
base-permission="OFBTOOLS,CONTENTMGR"
52+
app-shortcut-screen="component://content/widget/CommonScreens.xml#ShortcutApp"
5253
mount-point="/content"/>
5354

5455
<webapp name="contentimages"

applications/content/widget/CommonScreens.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,21 @@ under the License.
4444
</widgets>
4545
</section>
4646
</screen>
47-
47+
<screen name="ShortcutApp">
48+
<section>
49+
<actions>
50+
<property-map resource="ContentUiLabels" map-name="uiLabelMap" global="true"/>
51+
<property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
52+
</actions>
53+
<widgets>
54+
<decorator-screen name="ShortcutDecorator" location="component://common/widget/CommonScreens.xml">
55+
<decorator-section name="body">
56+
<include-menu name="ContentShortcutAppBar" location="component://content/widget/content/ContentMenus.xml"/>
57+
</decorator-section>
58+
</decorator-screen>
59+
</widgets>
60+
</section>
61+
</screen>
4862
<screen name="commonCmsDecorator">
4963
<section>
5064
<actions>

applications/content/widget/content/ContentMenus.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@ under the License.
3333
<menu-item name="CompDoc" title="${uiLabelMap.ContentCompDoc}"><link target="FindCompDoc"/></menu-item>
3434
</menu>
3535

36+
<menu name="ContentShortcutAppBar" title="${uiLabelMap.ContentContentManager}">
37+
<menu-item name="websites" title="${uiLabelMap.ContentWebSites}"><link target="FindWebSite" url-mode="inter-app"/></menu-item>
38+
<menu-item name="survey" title="${uiLabelMap.ContentSurvey}"><link target="FindSurvey" url-mode="inter-app"/></menu-item>
39+
<menu-item name="Forum" title="${uiLabelMap.ContentForum}"><link target="findForumGroups" url-mode="inter-app"/></menu-item>
40+
<menu-item name="Blog" title="${uiLabelMap.ContentBlog}"><link target="blogMain" url-mode="inter-app"/></menu-item>
41+
<menu-item name="Content" title="${uiLabelMap.ContentContent}"><link target="findContent" url-mode="inter-app"/></menu-item>
42+
<menu-item name="DataResource" title="${uiLabelMap.ContentDataResource}"><link target="findDataResource" url-mode="inter-app"/></menu-item>
43+
<menu-item name="ContentSetupMenu" title="${uiLabelMap.ContentContentSetup}"><link target="ContentSetupMenu" url-mode="inter-app"/></menu-item>
44+
<menu-item name="DataResourceSetupMenu" title="${uiLabelMap.ContentDataSetup}"><link target="DataSetupMenu" url-mode="inter-app"/></menu-item>
45+
<menu-item name="Layout" title="${uiLabelMap.ContentTemplate}"><link target="LayoutMenu" url-mode="inter-app"/></menu-item>
46+
<menu-item name="CMS" title="${uiLabelMap.ContentCMS}"><link target="CMSContentFind" url-mode="inter-app"/></menu-item>
47+
<menu-item name="CompDoc" title="${uiLabelMap.ContentCompDoc}"><link target="FindCompDoc" url-mode="inter-app"/></menu-item>
48+
</menu>
49+
3650
<menu name="content" menu-container-style="button-bar tab-bar" default-selected-style="selected" default-menu-item-name="content" default-permission-operation="HAS_AUTHOR_ROLE|CONTENT_ADMIN"
3751
default-permission-entity-action="_ADMIN" default-associated-content-id="${userLogin.userLoginId}" selected-menuitem-context-field-name="tabButtonItem"
3852
title="" type="simple">

applications/humanres/ofbiz-component.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ under the License.
3838
location="webapp/humanres"
3939
base-permission="OFBTOOLS,HUMANRES"
4040
mount-point="/humanres"
41+
app-shortcut-screen="component://humanres/widget/CommonScreens.xml#ShortcutApp"
4142
app-bar-display="true"/>
4243
</ofbiz-component>

applications/humanres/widget/CommonScreens.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,21 @@ under the License.
7070
</widgets>
7171
</section>
7272
</screen>
73-
73+
<screen name="ShortcutApp">
74+
<section>
75+
<actions>
76+
<property-map resource="HumanResUiLabels" map-name="uiLabelMap" global="true"/>
77+
<property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
78+
</actions>
79+
<widgets>
80+
<decorator-screen name="ShortcutDecorator" location="component://common/widget/CommonScreens.xml">
81+
<decorator-section name="body">
82+
<include-menu name="HumanResShortcutAppBar" location="component://humanres/widget/HumanresMenus.xml"/>
83+
</decorator-section>
84+
</decorator-screen>
85+
</widgets>
86+
</section>
87+
</screen>
7488
<screen name="OrgTree">
7589
<section>
7690
<actions>

applications/humanres/widget/HumanresMenus.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@
3434
<menu-item name="Leave" title="${uiLabelMap.HumanResEmplLeave}"><link target="FindEmplLeaves"/></menu-item>
3535
<menu-item name="GlobalHRSettings" title="${uiLabelMap.HumanResGlobalHRSettings}" selected-style="selected"><link target="globalHRSettings"/></menu-item>
3636
</menu>
37+
<menu name="HumanResShortcutAppBar" title="${uiLabelMap.HumanResManager}">
38+
<menu-item name="Employees" title="${uiLabelMap.HumanResEmployees}"><link target="/humanres/control/findEmployees" url-mode="inter-app"/></menu-item>
39+
<menu-item name="Employment" title="${uiLabelMap.HumanResEmployment}"><link target="/humanres/control/FindEmployments" url-mode="inter-app"/></menu-item>
40+
<menu-item name="EmplPosition" title="${uiLabelMap.HumanResEmployeePosition}"><link target="/humanres/control/FindEmplPositions" url-mode="inter-app"/></menu-item>
41+
<menu-item name="PerfReview" title="${uiLabelMap.HumanResPerfReview}"><link target="/humanres/control/FindPerfReviews" url-mode="inter-app"/></menu-item>
42+
<menu-item name="EmplSkills" title="${uiLabelMap.HumanResSkills}"><link target="/humanres/control/FindPartySkills" url-mode="inter-app"/></menu-item>
43+
<menu-item name="PartyQual" title="${uiLabelMap.HumanResPartyQualification}"><link target="/humanres/control/FindPartyQuals" url-mode="inter-app"/></menu-item>
44+
<menu-item name="Recruitment" title="${uiLabelMap.HumanResRecruitment}"><link target="/humanres/control/FindJobRequisitions" url-mode="inter-app"/></menu-item>
45+
<menu-item name="Training" title="${uiLabelMap.HumanResTraining}"><link target="/humanres/control/TrainingCalendar" url-mode="inter-app"/></menu-item>
46+
<menu-item name="EmploymentApp" title="${uiLabelMap.HumanResEmploymentApp}"><link target="/humanres/control/FindEmploymentApps" url-mode="inter-app"/></menu-item>
47+
<menu-item name="PartyResume" title="${uiLabelMap.HumanResPartyResume}"><link target="/humanres/control/FindPartyResumes" url-mode="inter-app"/></menu-item>
48+
<menu-item name="Leave" title="${uiLabelMap.HumanResEmplLeave}"><link target="/humanres/control/FindEmplLeaves" url-mode="inter-app"/></menu-item>
49+
<menu-item name="GlobalHRSettings" title="${uiLabelMap.HumanResGlobalHRSettings}" selected-style="selected"><link target="/humanres/control/globalHRSettings" url-mode="inter-app"/></menu-item>
50+
</menu>
3751
<menu name="EmploymentBar" default-menu-item-name="EditPartyBenefit" default-selected-style="selected"
3852
type="simple" menu-container-style="button-bar tab-bar" selected-menuitem-context-field-name="tabButtonItem">
3953
<actions>

applications/manufacturing/ofbiz-component.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ under the License.
4949
server="default-server"
5050
location="webapp/manufacturing"
5151
base-permission="OFBTOOLS,MANUFACTURING"
52+
app-shortcut-screen="component://manufacturing/widget/manufacturing/CommonScreens.xml#ShortcutApp"
5253
mount-point="/manufacturing"/>
5354

5455
</ofbiz-component>

applications/manufacturing/widget/manufacturing/CommonScreens.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,21 @@ under the License.
7272
</widgets>
7373
</section>
7474
</screen>
75+
<screen name="ShortcutApp">
76+
<section>
77+
<actions>
78+
<property-map resource="ManufacturingUiLabels" map-name="uiLabelMap" global="true"/>
79+
<property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
80+
<property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
81+
</actions>
82+
<widgets>
83+
<decorator-screen name="ShortcutDecorator" location="component://common/widget/CommonScreens.xml">
84+
<decorator-section name="body">
85+
<include-menu name="ManufacturingShortcutAppBar" location="component://manufacturing/widget/manufacturing/ManufacturingMenus.xml"/>
86+
</decorator-section>
87+
</decorator-screen>
88+
</widgets>
89+
</section>
90+
</screen>
7591
</screens>
7692

0 commit comments

Comments
 (0)