ilscipio/scipio-erp

View on GitHub
framework/webtools/widget/MiscExtraScreens.xml

Summary

Maintainability
Test Coverage
<!--
This file is subject to the terms and conditions defined in the
files 'LICENSE' and 'NOTICE', which are part of this source
code package.
-->

<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">

    <!-- SCIPIO: Mostly here to test the include-screens directive (also decorator-screen) -->
    
    <screen name="DemoExtraActions1">
        <actions>
            <set field="demoExtraActions1Msg" value="This new-style actions screen should have gotten included using a delegate include-screen-actions directive by the include-screens top directive. [SUCCESS]"/>
        </actions>
    </screen>
    <screen name="DemoExtraActions2">
        <section>
            <actions>
                <set field="demoExtraActions2Msg" value="This old-style actions screen should have gotten included using a delegate include-screen-actions directive by the include-screens top directive. [SUCCESS]"/>
            </actions>
            <widgets/>
        </section>
    </screen>
    <screen name="DemoExtraActions3">
        <section>
            <actions>
                <set field="demoExtraActions3Msg" value="Because this has a widget it won't be included transitively by include-screen-actions after the placeholder are generated by include-screens"/>
            </actions>
            <widgets>
                <label text="DemoExtraActions3 label widget. here we print demoExtraActions3Msg: ${demoExtraActions3Msg}"/>
            </widgets>
        </section>
    </screen>
    <!-- SCIPIO: Removed this because it makes the log confusing for people; uncomment to test
    <screen name="DemoExtraActions4"><!- - NOTE: this screen generates an ERROR (section condition used without widgets) - ->
        <section>
            <condition><if-empty field="activeSubMenuItem"/></condition>
            <actions>
                <set field="demoExtraActions4Msg" value="Because this has a condition it won't be included transitively by include-screen-actions after the placeholder are generated by include-screens"/>
            </actions>
        </section>
    </screen>-->
    <screen name="DemoExtraActions4">
        <section>
            <actions>
            </actions>
            <widgets>
            </widgets>
        </section>
    </screen>
    
    <screen name="DemoExtraWidget1">
        <section>
            <widgets>
                <label text="This is an extra widget (1) included with include-screens directive. Also tests decorator-screen with no decorator-sections defined."/>
                <decorator-screen name="DemoExtraWidgetMidDecorator"/>
            </widgets>
        </section>
    </screen>
    
    <screen name="DemoExtraWidget2">
        <section>
            <widgets>
                <label text="This is an extra widget (2) included with include-screens directive. Also tests decorator-screen with only-passthrough decorator-sections."/>
                <decorator-screen name="DemoExtraWidgetMidDecorator">
                    <decorator-section name="section-1">
                        <label text="decorator section 1"/>
                    </decorator-section>
                    <decorator-section name="section-2">
                        <label text="decorator section 2"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    
    <screen name="DemoExtraWidgetMidDecorator">
        <section>
            <widgets>
                <!-- New in SCIPIO this fully substitutes for include-screen -->
                <decorator-screen name="DemoExtraWidgetLowDecorator"/>
            </widgets>
        </section>
    </screen>
    
    <screen name="DemoExtraWidgetLowDecorator">
        <section>
            <widgets>
                <decorator-section-include name="section-1"/>
                <decorator-section-include name="section-2"/>
            </widgets>
        </section>
    </screen>
    
    <!-- SCIPIO: Removed this because it makes the log confusing for people; uncomment to test
    <screen name="DemoInvalidErrorActionsScreen1">
        <section>
            <condition><if-empty field="testtesttest"/></condition>
            <actions>
                <set field="testtest" value="This screen is invalid should generate a log error; section condition is for widgets screens, not actions-only screens"/>
            </actions>
        </section>
    </screen>-->
    <screen name="DemoInvalidErrorActionsScreen1">
        <section>
            <actions>
            </actions>
            <widgets>
            </widgets>
        </section>
    </screen>

    <screen name="DemoSimpleLabelWidget">
        <section>
            <widgets>
                <label text="This is a simple label widget."/>
            </widgets>
        </section>
    </screen>
    
    <screen name="DemoLabelWidgetWithVars">
        <section>
            <actions>
                <script lang="groovy"><![CDATA[ context.testUtil.logVars(context, "executing-include"); ]]></script>
            </actions>
            <widgets>
                <label text="Hello from included widget. mySimpleVar1: ${groovy: context.mySimpleVar1 ?: 'missing'}. mySimpleVar2: ${groovy: context.mySimpleVar2 ?: 'missing'}."/>
            </widgets>
        </section>
    </screen>
    
</screens>