ilscipio/scipio-erp

View on GitHub
applications/product/widget/catalog/SubscriptionScreens.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<!--
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: NOTE: The old parameters.subscriptionDecoratorLocation pattern that existed here has been supplanted
        by the decorator default-fallback-location pattern for parameters.mainDecoratorLocation (see CommonScreens.xml). -->

    <!-- Subscription Screens -->
    <screen name="FindSubscription">
        <section>
            <actions>
                <property-map resource="OrderUiLabels" map-name="uiLabelMap"/>
                <set field="titleProperty" value="PageTitleFindSubscription"/>
                <set field="activeSubMenuItem" value="Subscription"/>
                <set field="isSpecificSubscription" type="Boolean" value="false"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonSubscriptionDecorator" location="${parameters.mainDecoratorLocation}">            
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <if-service-permission service-name="subscriptionPermissionCheck" main-action="VIEW"/>
                            </condition>
                            <widgets>
                                <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                                    <decorator-section name="search-options">
                                        <include-form name="FindSubscription" location="component://product/widget/catalog/SubscriptionForms.xml"/>
                                    </decorator-section>
                                    <decorator-section name="search-results">
                                        <include-form name="ListFindSubscription" location="component://product/widget/catalog/SubscriptionForms.xml"/>
                                    </decorator-section>
                                </decorator-screen>
                            </widgets>
                            <fail-widgets>
                                <label style="common-msg-error-perm">${uiLabelMap.ProductSubscriptionViewPermissionError}</label>
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    
    <screen name="EditSubscription">
        <section>
            <actions>
                <property-map resource="OrderUiLabels" map-name="uiLabelMap"/>
                <set field="titleProperty" value="PageTitleEditSubscription"/>
                <set field="activeSubMenuItem" value="EditSubscription"/>
                <set field="subscriptionId" from-field="parameters.subscriptionId"/>
                <entity-one entity-name="Subscription" value-field="subscription"/>
                <set field="isCreateSubscription" type="Boolean" value="${groovy: !(context.subscription || (parameters.subscriptionId &amp;&amp; parameters.isCreate != 'true'))}"/>
            </actions>
            <widgets>
                <section>
                    <condition><if-empty field="subscriptionId"/></condition>
                    <actions><set field="titleProperty" value="ProductNewSubscription"/></actions>
                </section>
                <decorator-screen name="CommonSubscriptionDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet id="editSubscription" collapsible="true">
                            <include-form name="EditSubscription" location="component://product/widget/catalog/SubscriptionForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="EditSubscriptionAttributes">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditSubscriptionAttributes"/>
                <set field="activeSubMenuItem" value="EditSubscriptionAttributes"/>
                <set field="subscriptionId" from-field="parameters.subscriptionId"/>
                <entity-and entity-name="SubscriptionAttribute" use-cache="false" list="subscriptionAttributes">
                    <field-map field-name="subscriptionId"/>
                    <order-by field-name="attrName"/>
                </entity-and>
            </actions>
            <widgets>
                <decorator-screen name="CommonSubscriptionDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet id="addSubscriptionAttribute" title="${uiLabelMap.PageTitleAddSubscriptionAttributes}" collapsible="true">
                            <include-form name="AddSubscriptionAttribute" location="component://product/widget/catalog/SubscriptionForms.xml"/>
                        </screenlet>
                        <include-form name="EditSubscriptionAttributes" location="component://product/widget/catalog/SubscriptionForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <!-- SubscriptionResource Screens -->
    <screen name="FindSubscriptionResource">
        <section>
            <actions>
                <property-map resource="ContentUiLabels" map-name="uiLabelMap"/>
                <set field="titleProperty" value="PageTitleFindSubscriptionResource"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonSubscriptionResourceDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <if-service-permission service-name="subscriptionPermissionCheck" main-action="VIEW"/>
                            </condition>
                            <widgets>
                                <container style="button-bar">
                                    <link target="EditSubscriptionResource" text="${uiLabelMap.ProductNewSubscriptionResource}" style="${styles.link_nav} ${styles.action_add}"/>
                                </container>
                                <include-form name="ListSubscriptionResources" location="component://product/widget/catalog/SubscriptionForms.xml"/>
                            </widgets>
                            <fail-widgets>
                                <label style="common-msg-error-perm">${uiLabelMap.ProductSubscriptionViewPermissionError}</label>
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="EditSubscriptionResource">
        <section>
            <actions>
                <property-map resource="ContentUiLabels" map-name="uiLabelMap"/>
                <set field="titleProperty" value="PageTitleEditSubscriptionResource"/>
                <set field="activeSubMenuItem" value="EditSubscriptionResource"/>
                <set field="subscriptionResourceId" from-field="parameters.subscriptionResourceId"/>
                <entity-one entity-name="SubscriptionResource" value-field="subscriptionResource"/>
            </actions>
            <widgets>
                <section>
                    <condition><if-empty field="subscriptionResourceId"/></condition>
                    <actions><set field="titleProperty" value="ProductNewSubscriptionResource"/></actions>
                </section>
                <decorator-screen name="CommonSubscriptionResourceDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet id="EditSubscriptionResource" collapsible="true">
                            <include-form name="EditSubscriptionResource" location="component://product/widget/catalog/SubscriptionForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="EditSubscriptionResourceProducts">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditSubscriptionResourceProducts"/>
                <set field="activeSubMenuItem" value="EditSubscriptionResourceProducts"/>
                <set field="subscriptionResourceId" from-field="parameters.subscriptionResourceId"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonSubscriptionResourceDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet id="addSubscriptionResourceProduct" title="${uiLabelMap.PageTitleAddSubscriptionResourceProducts}" collapsible="true">
                            <include-form name="AddSubscriptionResourceProduct" location="component://product/widget/catalog/SubscriptionForms.xml"/>
                        </screenlet>
                        <include-form name="ListSubscriptionResourceProducts" location="component://product/widget/catalog/SubscriptionForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="EditSubscriptionCommEvent">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditSubscriptionCommEvent"/>
                <set field="activeSubMenuItem" value="EditSubscriptionCommEvent"/>
                <set field="subscriptionId" from-field="parameters.subscriptionId"/>
                <entity-and entity-name="SubscriptionAndCommEvent" use-cache="false" list="subscriptionCommEvent">
                    <field-map field-name="subscriptionId"/>
                </entity-and>
            </actions>
            <widgets>
                <decorator-screen name="CommonSubscriptionDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet id="addSubscriptionCommEvent" title="${uiLabelMap.PageTitleAddSubscriptionCommEvent}" collapsible="true">
                            <include-form name="createSubscriptionCommEvent" location="component://product/widget/catalog/SubscriptionForms.xml"/>
                        </screenlet>
                        <include-form name="listSubscriptionCommEvent" location="component://product/widget/catalog/SubscriptionForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

</screens>