ilscipio/scipio-erp

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

Summary

Maintainability
Test Coverage
<?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.
-->

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

    <screen name="EditFeature">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditFeature"/>
                <set field="activeSubMenuItem" value="ListFeatures"/>
                <set field="productFeatureId" from-field="parameters.productFeatureId"/>
                <entity-one entity-name="ProductFeature" value-field="productFeature" auto-field-map="true"/>
                <entity-and entity-name="SupplierProductFeature" list="supplierProductFeatures">
                    <field-map field-name="productFeatureId" from-field="parameters.productFeatureId"/>
                </entity-and>
                <set field="isCreateFeature" type="Boolean" value="${groovy: !(context.productFeature || (parameters.productFeatureId &amp;&amp; parameters.isCreate != 'true'))}"/>
                <set field="labelTitleProperty" value="${groovy: isCreateFeature ? 'ProductNewFeature' : 'ProductFeature'}"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonSpecificFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet><!-- title="${uiLabelMap.ProductEditFeature} : ${productFeature.description}" -->
                            <include-form name="EditProductFeature" location="component://product/widget/catalog/FeatureForms.xml"/>
                        </screenlet>
                        <!-- SCIPIO: these require a feature... -->
                        <section>
                            <condition>
                                <not><if-empty field="productFeature"/></not>
                            </condition>
                            <widgets>
                                <screenlet title="${uiLabelMap.PageTitleEditFeaturePrice}">
                                    <include-form name="ListFeaturePrice" location="component://product/widget/catalog/FeatureForms.xml"/>
                                </screenlet>
                                <screenlet title="${uiLabelMap.PageTitleAddFeaturePrice}">
                                    <include-form name="CreateFeaturePrice" location="component://product/widget/catalog/FeatureForms.xml"/>
                                </screenlet>
                                <screenlet title="${uiLabelMap.ProductSupplierSpecificFeatureInformation}">
                                    <include-form name="EditSupplierProductFeatures" location="component://product/widget/catalog/FeatureForms.xml"/>
                                </screenlet>
                                <screenlet title="${uiLabelMap.ProductCreateInformationNewSupplier}">
                                    <include-form name="CreateSupplierProductFeature" location="component://product/widget/catalog/FeatureForms.xml"/>
                                </screenlet>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditFeatureTypes">
        <section>
            <actions>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <!--<set field="titleProperty" value="PageTitleEditFeatureTypes"/>-->
                <set field="titleProperty" value="ProductFeatureTypes"/>
                <set field="activeSubMenuItem" value="FeatureType"/>
                <set field="activeSubMenuItem2" value="FeatureTypes"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="menu-bar">
                                <include-menu name="FeatureTypeSubTabBar" location="component://product/widget/catalog/CatalogMenus.xml"/>
                            </decorator-section>
                            <decorator-section name="search-options">
                                <include-form name="FindFeatureType" location="component://product/widget/catalog/FeatureForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListFeatureTypes" location="component://product/widget/catalog/FeatureForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditFeatureType">
        <section>
            <actions>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="titleProperty" value="PageTitleEditFeatureType"/>
                <set field="activeSubMenuItem" value="FeatureType"/>
                <set field="activeSubMenuItem2" value="FeatureType"/>
                <set field="productFeatureTypeId" from-field="parameters.productFeatureTypeId"/>
                <entity-one entity-name="ProductFeatureType" value-field="productFeatureType"/>
                
                <set field="isCreateFeatureType" type="Boolean" value="${groovy: !(context.productFeatureType || (parameters.productFeatureTypeId &amp;&amp; parameters.isCreate != 'true'))}"/>
                <set field="labelTitleProperty" value="${groovy: isCreateFeatureType ? 'ProductNewFeatureType' : 'ProductFeatureType' }"/>
                
                <set field="titleProperty" from-field="labelTitleProperty" default-value="${titleProperty}" />
                <set field="titleFormat" from-field="titleFormat" default-value="\${finalTitle} ${parameters.productFeatureTypeId} ${${extraFunctionName}}"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-menu name="FeatureTypeSubTabBar" location="component://product/widget/catalog/CatalogMenus.xml"/>
                        <screenlet>
                            <include-form name="EditFeatureType" location="component://product/widget/catalog/FeatureForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditFeatureInterActions">
        <section>
            <actions>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <!--<set field="titleProperty" value="PageTitleEditFeatureInterActions"/>-->
                <set field="titleProperty" value="ProductFeatureInterActions"/>
                <set field="activeSubMenuItem" value="FeatureInterAction"/>
                <set field="activeSubMenuItem2" value="FeatureInterActions"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="menu-bar">
                                <include-menu name="FeatureInterActionSubTabBar" location="component://product/widget/catalog/CatalogMenus.xml"/>
                            </decorator-section>
                            <decorator-section name="search-options">
                                <include-form name="FindFeatureInterAction" location="component://product/widget/catalog/FeatureForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListFeatureInterActions" location="component://product/widget/catalog/FeatureForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditFeatureInterAction">
        <section>
            <actions>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="titleProperty" value="PageTitleEditFeatureInterAction"/>
                <set field="activeSubMenuItem" value="FeatureInterAction"/>
                <set field="activeSubMenuItem2" value="FeatureInterAction"/>

                <set field="productFeatureId" from-field="parameters.productFeatureId"/>
                <set field="productFeatureIdTo" from-field="parameters.productFeatureIdTo"/>
                <entity-one entity-name="ProductFeatureIactn" value-field="productFeatureIactn"/>
                
                <set field="isCreateFeatureInterAction" type="Boolean" value="${groovy: !(context.productFeatureIactn || (parameters.productFeatureId &amp;&amp; parameters.productFeatureIdTo &amp;&amp; parameters.isCreate != 'true'))}"/>
                <set field="labelTitleProperty" value="${groovy: isCreateFeatureInterAction ? 'ProductNewFeatureInterAction' : 'ProductFeatureInterAction'}"/>
                
                <set field="titleProperty" from-field="labelTitleProperty" default-value="${titleProperty}" />
                <set field="titleFormat" from-field="titleFormat" default-value="\${finalTitle} ${parameters.productFeatureTypeId} ${${extraFunctionName}}"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-menu name="FeatureInterActionSubTabBar" location="component://product/widget/catalog/CatalogMenus.xml"/>
                        <screenlet><!-- title="${uiLabelMap.PageTitleAddFeatureInterAction}" -->
                            <include-form name="EditFeatureInterAction" location="component://product/widget/catalog/FeatureForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="CreateProductFeature">
        <section>
            <actions>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <!--<set field="titleProperty" value="PageTitleEditProductFeatureCategories"/>-->
                <!--<set field="titleProperty" value="ProductFeatureCategories"/>-->
                <set field="titleProperty" value="ProductNewFeatureCategory"/>
                <set field="activeSubMenuItem" value="FeatureCategory"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet><!-- title="${uiLabelMap.PageTitleEditFeatureType}" -->
                            <include-form name="CreateProductFeature" location="component://product/widget/catalog/FeatureForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditFeatureCategories">
        <section>
            <actions>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <!--<set field="titleProperty" value="PageTitleEditProductFeatureCategories"/>-->
                <set field="activeSubMenuItem" value="FeatureCategory"/>
                <set field="titleProperty" value="ProductFeatureCategories"/>
                <set field="viewIndex" from-field="parameters.VIEW_INDEX_1" type="Integer" default-value="0"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE_1" type="Integer" default-value="10"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="menu-bar">
                                <container style="button-bar">
                                    <link target="CreateProductFeature" text="${uiLabelMap.ProductNewFeatureCategory}" style="${styles.link_nav} ${styles.action_add}"/>
                                </container>
                            </decorator-section>
                            <decorator-section name="search-options">
                                <include-form name="FindProductFeatureCategory" location="component://product/widget/catalog/FeatureForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListProductFeatureCategory" location="component://product/widget/catalog/FeatureForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditFeatureCategoryFeatures">
        <section>
            <actions>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <!--<set field="titleProperty" value="PageTitleEditFeatureCategoryFeatures"/>-->
                <set field="titleProperty" value="ProductFeatureCategoryFeatures"/>

                <set field="activeSubMenuItem" value="FeatureCategory"/>

                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
                <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
                <script location="component://product/webapp/catalog/WEB-INF/actions/feature/EditFeatureCategoryFeatures.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <platform-specific>
                            <html><html-template location="component://product/webapp/catalog/feature/EditFeatureCategoryFeatures.ftl"/></html>
                        </platform-specific>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditFeatureGroups">
        <section>
            <actions>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <!--<set field="titleProperty" value="PageTitleEditProductFeatureGroups"/>-->
                <set field="titleProperty" value="ProductFeatureGroups"/>
                <set field="activeSubMenuItem" value="FeatureGroup"/>
                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
                <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
                <script location="component://product/webapp/catalog/WEB-INF/actions/feature/EditFeatureGroups.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="menu-bar">
                                <container style="button-bar">
                                    <link target="EditProductFeatureGroup" text="${uiLabelMap.ProductNewGroup}" style="${styles.link_nav} ${styles.action_add}"/>
                                </container>
                            </decorator-section>
                            <decorator-section name="search-options">
                                <include-form name="FindFeatureGroup" location="component://product/widget/catalog/FeatureForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <!--<include-form name="ListProductFeatureCategory" location="component://product/widget/catalog/FeatureForms.xml"/>-->
                                <platform-specific>
                                    <html><html-template location="component://product/webapp/catalog/feature/EditFeatureGroups.ftl"/></html>
                                </platform-specific>
                            </decorator-section>
                        </decorator-screen>

                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditFeatureGroup">
        <section>
            <actions>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <!--<set field="titleProperty" value="PageTitleEditProductFeatureGroups"/>-->
                <set field="titleProperty" value="ProductFeatureGroup"/>
                <set field="activeSubMenuItem" value="FeatureGroup"/>
                <set field="productFeatureGroupId" from-field="parameters.productFeatureGroupId"/>
                <entity-one entity-name="ProductFeatureGroup" value-field="productFeatureGroup" auto-field-map="true"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-form name="CreateFeatureGroup" location="component://product/widget/catalog/FeatureForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditFeatureGroupAppls">
        <section>
            <actions>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <!--<set field="titleProperty" value="ProductEditFeatureGroupAppls"/>-->
                <set field="titleProperty" value="ProductFeatureGroupAppls"/>
                
                <set field="activeSubMenuItem" value="FeatureGroup"/>
                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
                <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>

                <set field="productFeatureGroupId" from-field="parameters.productFeatureGroupId"/>
                <set field="productFeatureCategoryId" from-field="parameters.productFeatureCategoryId"/>
                <entity-and entity-name="ProductFeatureGroupAndAppl" list="productFeatureGroupAndAppls">
                    <field-map field-name="productFeatureGroupId"/>
                    <order-by field-name="sequenceNum"/>
                </entity-and>
                <entity-condition entity-name="ProductFeatureCategory" list="productFeatureCategories">
                    <order-by field-name="description"/>
                </entity-condition>
                <entity-and entity-name="ProductFeature" list="productFeatures">
                    <field-map field-name="productFeatureCategoryId"/>
                </entity-and>
            </actions>
            <widgets>
                <decorator-screen name="CommonFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.ProductEditFeatureGroupAppls}">
                            <include-form name="ListFeatureGroupAppls" location="component://product/widget/catalog/FeatureForms.xml"/>
                        </screenlet>
                        <screenlet title="${uiLabelMap.ProductQuickApplyFeature}">
                            <include-form name="QuickApplyFeatureToGroup" location="component://product/widget/catalog/FeatureForms.xml"/>
                        </screenlet>
                        <screenlet title="${uiLabelMap.ProductApplyFeaturesFromCategory}">
                            <include-form name="ApplyFeatureCategoryToGroup" location="component://product/widget/catalog/FeatureForms.xml"/>
                            <include-form name="ApplyFeaturesFromCategoryToGroup" location="component://product/widget/catalog/FeatureForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="QuickAddProductFeatures">
        <section>
            <actions>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <!--<set field="titleProperty" value="ProductAddProductFeatureInBulk"/>-->
                <set field="titleProperty" value="ProductAddFeatureInBulk"/>
                <set field="featureNum" from-field="parameters.featureNum" type="Integer"/>
                <set field="productFeatureCategoryId" from-field="parameters.productFeatureCategoryId"/>
                <set field="activeSubMenuItem" value="FeatureCategory"/>
                <script location="component://product/webapp/catalog/WEB-INF/actions/feature/QuickAddProductFeatures.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <platform-specific>
                            <html><html-template location="component://product/webapp/catalog/feature/BulkAddFeature.ftl"/></html>
                        </platform-specific>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="ListFeaturePrice">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditFeaturePrice"/>
                <set field="labelTitleProperty" value="FormFieldTitle_featurePrice"/>
                <set field="activeSubMenuItem" value="Feature"/>
                <set field="activeSubMenuItem2" value="FeaturePrice"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonSpecificFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.PageTitleEditFeaturePrice}">
                            <include-form name="ListFeaturePrice" location="component://product/widget/catalog/FeatureForms.xml"/>
                        </screenlet>
                        <screenlet title="${uiLabelMap.PageTitleAddFeaturePrice}">
                            <include-form name="CreateFeaturePrice" location="component://product/widget/catalog/FeatureForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="CreateFeaturePrice">
        <section>
           <actions>
                <set field="titleProperty" value="FormFieldTitle_featurePrice"/><!-- PageTitleEditFeature -->
                <set field="activeSubMenuItem" value="Feature"/>
                <set field="activeSubMenuItem2" value="FeaturePrice"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonSpecificFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.ProductQuickApplyFeature}">
                            <include-form name="CreateFeaturePrice" location="component://product/widget/catalog/FeatureForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="CreateFeature">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditFeature"/>
                <set field="labelTitleProperty" value="ProductFeature"/>
                <set field="activeSubMenuItem" value="ListFeatures"/>
                <entity-one entity-name="ProductFeature" value-field="productFeature" auto-field-map="true"/>
                <entity-and entity-name="SupplierProductFeature" list="supplierProductFeatures">
                    <field-map field-name="productFeatureId" from-field="parameters.productFeatureId"/>
                </entity-and>
                <set field="isCreateFeature" type="Boolean" value="${groovy: !(context.productFeature || (parameters.productFeatureId &amp;&amp; parameters.isCreate != 'true'))}"/>
                <set field="labelTitleProperty" value="${groovy: isCreateFeature ? 'ProductNewFeature' : 'ProductFeature'}"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonSpecificFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet><!-- title="${uiLabelMap.ProductEditFeature} : ${productFeature.description}" -->
                            <include-form name="EditProductFeature" location="component://product/widget/catalog/FeatureForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="ListFeatures">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditFeatures"/>
                <set field="labelTitleProperty" value="ProductFeature"/>
                <set field="activeSubMenuItem" value="ListFeatures"/>
                <set field="viewIndex" from-field="parameters.VIEW_INDEX_1" type="Integer" default-value="0"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE_1" type="Integer" default-value="10"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonFeatureDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="menu-bar">
                                <container style="button-bar">
                                    <link target="CreateFeature" text="${uiLabelMap.ProductNewFeature}" style="${styles.link_nav} ${styles.action_add}"/>
                                </container>
                            </decorator-section>
                            <decorator-section name="search-options">
                                <include-form name="FindProductFeature" location="component://product/widget/catalog/FeatureForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListProductFeature" location="component://product/widget/catalog/FeatureForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

</screens>