Files
ofbiz-plugins/example/widget/example/ExampleCompoundWidgets.xml
T
Jacques Le Roux 54917e8bbd A last slightly modified patch from James Yong for "Autocompletion for Compound Widget" - https://issues.apache.org/jira/browse/OFBIZ-7061
I have uploaded a patch for the simple methods schema.
In general, the top level attributes are converted to simpleType, and attributeGroups to complexType.

Changed the following attribute name
1. ‘field’ to ‘fieldType’
2. ‘level’ to ‘levelType'

Denormalize the following attributeGroups
1. attlist.compare
2. attlist.compare-field

Left attributeGroup ‘typeDefaultString’ unchanged, cos it doesn’t matter. Not in use, it seem.

jleroux: we also fixed an issue with 
<xs:element name="field" type="fieldType"/> 
to 
<xs:element ref="field"/>
In the patch 

And I found a small issue (not minilang related) in ExampleCompoundWidgets.xml
-            <sm:log message="CompoundWidgetsFunc runs" sm:level="info"/>
+            <sm:log message="CompoundWidgetsFunc runs" level="info"/>


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1750647 13f79535-47bb-0310-9956-ffa450edef68
2016-06-29 14:06:29 +00:00

122 lines
6.1 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.
-->
<!-- This document serves as an example for Compound Screen Widget feature -->
<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="CompoundWidgets1">
<sc:security https="true" auth="true"/>
<sc:event type="simple" invoke="CompoundWidgetsFunc" path="component://example/widget/example/ExampleCompoundWidgets.xml"/>
<sc:response name="success" type="view" value="CompoundWidgets1"/>
</sc:request-map>
<sc:request-map uri="CompoundWidgets2"><sc:security https="true" auth="true"/><sc:response name="success" type="view" value="CompoundWidgets2"/></sc:request-map>
<sc:view-map name="CompoundWidgets1" type="screen" page="component://example/widget/example/ExampleCompoundWidgets.xml#CompoundWidgets1"/>
<sc:view-map name="CompoundWidgets2" type="screen" page="component://example/widget/example/ExampleCompoundWidgets.xml#CompoundWidgets2"/>
</sc:site-conf>
<wm:menus>
<wm:menu name="CompoundWidgetsMenu" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
<wm:menu-item name="Example1" title="${uiLabelMap.ExampleExample} 1">
<wm:link target="CompoundWidgets1"/>
</wm:menu-item>
<wm:menu-item name="Example2" title="${uiLabelMap.ExampleExample} 2">
<wm:link target="CompoundWidgets2"/>
</wm:menu-item>
</wm:menu>
</wm:menus>
<ws:screens>
<ws:screen name="CompoundWidgets1">
<ws:section>
<ws:actions>
<ws:set field="headerItem" value="ExampleCompoundWidgets" />
<ws:set field="tabButtonItem" value="Example1"/>
</ws:actions>
<ws:widgets>
<ws:decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<ws:decorator-section name="pre-body">
<ws:include-menu name="CompoundWidgetsMenu" location="component://example/widget/example/ExampleCompoundWidgets.xml" />
</ws:decorator-section>
<ws:decorator-section name="body">
<ws:section>
<ws:widgets>
<ws:container style="clear" />
<ws:label>Demo For Compound Screen Widget</ws:label>
<ws:include-form location="component://example/widget/example/ExampleCompoundWidgets.xml" name="CompoundWidgetsForm1"/>
</ws:widgets>
</ws:section>
</ws:decorator-section>
</ws:decorator-screen>
</ws:widgets>
</ws:section>
</ws:screen>
<ws:screen name="CompoundWidgets2">
<ws:section>
<ws:actions>
<ws:set field="headerItem" value="ExampleCompoundWidgets" />
<ws:set field="tabButtonItem" value="Example2"/>
</ws:actions>
<ws:widgets>
<ws:decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<ws:decorator-section name="pre-body">
<ws:include-menu name="CompoundWidgetsMenu" location="component://example/widget/example/ExampleCompoundWidgets.xml" />
</ws:decorator-section>
<ws:decorator-section name="body">
<ws:section>
<ws:widgets>
<ws:container style="clear" />
<ws:label>Demo For Compound Screen Widget</ws:label>
<ws:include-form location="component://example/widget/example/ExampleCompoundWidgets.xml" name="CompoundWidgetsForm2"/>
</ws:widgets>
</ws:section>
</ws:decorator-section>
</ws:decorator-screen>
</ws:widgets>
</ws:section>
</ws:screen>
</ws:screens>
<wf:forms>
<wf:form name="CompoundWidgetsForm1">
<wf:field name="exampleName" title="${uiLabelMap.FormFieldTitle_exampleName} 1" required-field="true"><wf:text /></wf:field>
</wf:form>
<wf:form name="CompoundWidgetsForm2">
<wf:field name="exampleName" title="${uiLabelMap.FormFieldTitle_exampleName} 2" required-field="true"><wf:text /></wf:field>
</wf:form>
</wf:forms>
<sm:simple-methods>
<sm:simple-method method-name="CompoundWidgetsFunc">
<sm:log message="CompoundWidgetsFunc runs" level="info"/>
</sm:simple-method>
</sm:simple-methods>
</compound-widgets>