(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
301 lines
14 KiB
XML
301 lines
14 KiB
XML
<?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.
|
|
-->
|
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
|
|
<xs:element name="ofbiz-component">
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element minOccurs="0" maxOccurs="unbounded" ref="depends-on"/>
|
|
<xs:element minOccurs="0" maxOccurs="unbounded" ref="resource-loader"/>
|
|
<xs:element minOccurs="0" maxOccurs="unbounded" ref="classpath"/>
|
|
<xs:element minOccurs="0" maxOccurs="unbounded" ref="entity-resource"/>
|
|
<xs:element minOccurs="0" maxOccurs="unbounded" ref="service-resource"/>
|
|
<xs:element minOccurs="0" maxOccurs="unbounded" ref="test-suite"/>
|
|
<xs:element minOccurs="0" maxOccurs="unbounded" ref="keystore"/>
|
|
<xs:element minOccurs="0" maxOccurs="unbounded" ref="webapp"/>
|
|
<xs:element minOccurs="0" maxOccurs="unbounded" ref="container"/>
|
|
</xs:sequence>
|
|
<xs:attributeGroup ref="attlist.ofbiz-component"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.ofbiz-component">
|
|
<xs:attribute type="xs:string" name="name" use="required"/>
|
|
<xs:attribute type="xs:string" name="enabled" use="optional" default="true"/>
|
|
</xs:attributeGroup>
|
|
<xs:element name="depends-on">
|
|
<xs:complexType>
|
|
<xs:attributeGroup ref="attlist.depends-on">
|
|
<xs:annotation>
|
|
<xs:documentation>
|
|
Alter the way components are loaded.
|
|
|
|
By default components are loaded in the order they are found (i.e. alphabetic or creation date).
|
|
For the plugins, all components will be loaded after the OFBiz components, including, in this order, those in:
|
|
framework
|
|
themes
|
|
applications
|
|
The plugins Auto-Loading feature also loads all components in the order they are found (i.e. alphabetic or creation date).
|
|
|
|
Using depends-on allows to create a series of dependencies for component loading, before loading a particular component.
|
|
For instance we can define dependency for a component like component ebaystore is dependent on component ebay
|
|
(even multiple dependencies for a single component is supported).
|
|
|
|
If any anomaly is found loading of components will stop.
|
|
|
|
We can declare it in this fashion in ofbiz-component.xml file (beware ebaystore is disabled by default)
|
|
<![CDATA[
|
|
<ofbiz-component name="ebaystore" enabled="true"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
|
|
<depends-on component-name="ebay"/>
|
|
]]>
|
|
</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:attributeGroup>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.depends-on">
|
|
<xs:attribute type="xs:string" name="component-name" use="required"/>
|
|
</xs:attributeGroup>
|
|
<xs:element name="resource-loader">
|
|
<xs:complexType>
|
|
<xs:attributeGroup ref="attlist.resource-loader"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.resource-loader">
|
|
<xs:attribute type="xs:string" name="name" use="required"/>
|
|
<xs:attribute name="type" default="component">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="component"/>
|
|
<xs:enumeration value="file"/>
|
|
<xs:enumeration value="classpath"/>
|
|
<xs:enumeration value="url"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:attribute>
|
|
<xs:attribute type="xs:string" name="prepend-env"/>
|
|
<xs:attribute type="xs:string" name="prefix"/>
|
|
</xs:attributeGroup>
|
|
<xs:element name="classpath">
|
|
<xs:complexType>
|
|
<xs:attributeGroup ref="attlist.classpath"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.classpath">
|
|
<xs:attribute name="type" use="required">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="jar"/>
|
|
<xs:enumeration value="dir"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:attribute>
|
|
<xs:attribute type="xs:string" name="location" use="required"/>
|
|
</xs:attributeGroup>
|
|
<xs:element name="entity-resource">
|
|
<xs:complexType>
|
|
<xs:attributeGroup ref="attlist.entity-resource"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.entity-resource">
|
|
<xs:attribute name="type" use="required">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="model"/>
|
|
<xs:enumeration value="group"/>
|
|
<xs:enumeration value="eca"/>
|
|
<xs:enumeration value="data"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:attribute>
|
|
<xs:attribute type="xs:string" name="reader-name" use="required"/>
|
|
<xs:attribute type="xs:string" name="loader" use="required"/>
|
|
<xs:attribute type="xs:string" name="location" use="required"/>
|
|
</xs:attributeGroup>
|
|
<xs:element name="service-resource">
|
|
<xs:complexType>
|
|
<xs:attributeGroup ref="attlist.service-resource"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.service-resource">
|
|
<xs:attribute name="type" use="required">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="model"/>
|
|
<xs:enumeration value="group"/>
|
|
<xs:enumeration value="eca"/>
|
|
<xs:enumeration value="mca"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:attribute>
|
|
<xs:attribute type="xs:string" name="loader" use="required"/>
|
|
<xs:attribute type="xs:string" name="location" use="required"/>
|
|
</xs:attributeGroup>
|
|
<xs:element name="test-suite">
|
|
<xs:complexType>
|
|
<xs:attributeGroup ref="attlist.test-suite"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.test-suite">
|
|
<xs:attribute type="xs:string" name="loader" use="required"/>
|
|
<xs:attribute type="xs:string" name="location" use="required"/>
|
|
</xs:attributeGroup>
|
|
<xs:element name="keystore">
|
|
<xs:complexType>
|
|
<xs:attributeGroup ref="attlist.keystore"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.keystore">
|
|
<xs:attribute name="name" type="xs:string" use="required"/>
|
|
<xs:attribute name="type" use="required">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="jks"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:attribute>
|
|
<xs:attribute name="password" type="xs:string" use="required"/>
|
|
<xs:attribute name="is-truststore" type="xs:boolean" use="required"/>
|
|
<xs:attribute name="is-certstore" type="xs:boolean" use="required"/>
|
|
<xs:attribute type="xs:string" name="loader" use="required"/>
|
|
<xs:attribute type="xs:string" name="location" use="required"/>
|
|
</xs:attributeGroup>
|
|
<xs:element name="webapp">
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element minOccurs="0" maxOccurs="unbounded" ref="virtual-host"/>
|
|
<xs:element minOccurs="0" maxOccurs="unbounded" ref="init-param"/>
|
|
</xs:sequence>
|
|
<xs:attributeGroup ref="attlist.webapp"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.webapp">
|
|
<xs:attribute type="xs:string" name="name" use="required"/>
|
|
<xs:attribute type="xs:string" name="title">
|
|
<xs:annotation>
|
|
<xs:documentation>
|
|
This value is shown in the application menu, when no uiLabelMap is available.
|
|
</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:attribute>
|
|
<xs:attribute type="xs:string" name="description"/>
|
|
<xs:attribute name="menu-name" use="optional" default="main">
|
|
<xs:annotation>
|
|
<xs:documentation>
|
|
This value determines in which application menu the application is shown.
|
|
For instance "secondary" is used by plugins and webtools webapps to put their menu-names in the second menu.
|
|
Note that not all OOTB themes use this "secondary" option, for instance Flat-Grey does not.
|
|
</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:attribute>
|
|
<xs:attribute name="app-shortcut-screen" use="optional">
|
|
<xs:annotation>
|
|
<xs:documentation>
|
|
This value determines the location of a screen to use as application main menu shortcut.
|
|
This can be used to display sub-menu on application main menu hover.
|
|
</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:attribute>
|
|
<xs:attribute type="xs:string" name="position"/>
|
|
<xs:attribute type="xs:string" name="server" use="required"/>
|
|
<xs:attribute type="xs:string" name="location" use="required"/>
|
|
<xs:attribute type="xs:string" name="mount-point"/>
|
|
<xs:attribute type="xs:string" name="access-permission">
|
|
<xs:annotation>
|
|
<xs:documentation>
|
|
A user must have this permission to access the application.
|
|
When omitted, the application can be used by anyone. This
|
|
attribute takes precedence over the base-permission attribute -
|
|
if both attributes are not empty, this attribute will be used.
|
|
</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:attribute>
|
|
<xs:attribute type="xs:string" name="base-permission">
|
|
<xs:annotation>
|
|
<xs:documentation>
|
|
Deprecated - use access-permission.
|
|
A user must have ALL of the permissions in the list to access the application.
|
|
When set to "NONE", the application can be used by anyone.
|
|
</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:attribute>
|
|
<xs:attribute name="privileged" type="xs:boolean" default="false"/>
|
|
<xs:attribute name="app-bar-display" type="xs:boolean" default="true"/>
|
|
<xs:attribute name="use-autologin-cookie" type="xs:boolean" default="false">
|
|
<xs:annotation>
|
|
<xs:documentation>
|
|
Defines if the webapp uses the auto login feature which keeps a memory of the user last visit.
|
|
This allows an user easier login by showing his/her username.
|
|
</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:attribute>
|
|
</xs:attributeGroup>
|
|
<xs:element name="virtual-host">
|
|
<xs:complexType>
|
|
<xs:attributeGroup ref="attlist.virtual-host"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.virtual-host">
|
|
<xs:attribute type="xs:string" name="host-name" use="required"/>
|
|
</xs:attributeGroup>
|
|
<xs:element name="init-param">
|
|
<xs:complexType>
|
|
<xs:attributeGroup ref="attlist.init-param"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.init-param">
|
|
<xs:attribute type="xs:string" name="name" use="required"/>
|
|
<xs:attribute type="xs:string" name="value" use="required"/>
|
|
</xs:attributeGroup>
|
|
|
|
<xs:element name="container">
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element minOccurs="0" maxOccurs="unbounded" ref="property"/>
|
|
</xs:sequence>
|
|
<xs:attributeGroup ref="attlist.container"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.container">
|
|
<xs:attribute type="xs:string" name="name" use="required"/>
|
|
<xs:attribute type="xs:string" name="class" use="required"/>
|
|
<xs:attribute type="xs:string" name="loaders"/>
|
|
</xs:attributeGroup>
|
|
<xs:element name="property">
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element minOccurs="0" maxOccurs="unbounded" ref="property"/>
|
|
<xs:element minOccurs="0" ref="property-value"/>
|
|
</xs:sequence>
|
|
<xs:attributeGroup ref="attlist.property"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
<xs:attributeGroup name="attlist.property">
|
|
<xs:attribute type="xs:string" name="name" use="required"/>
|
|
<xs:attribute type="xs:string" name="value"/>
|
|
</xs:attributeGroup>
|
|
<xs:element name="property-value" type="any"/>
|
|
<xs:complexType name="any" mixed="true">
|
|
<xs:sequence>
|
|
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
</xs:schema>
|