ilscipio/scipio-erp

View on GitHub
applications/product/widget/catalog/ConfigForms.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.
-->

<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
    
    <form name="FindProductConfigItems" type="single" target="FindProductConfigItems"
        default-map-name="productconfigitems" header-row-style="header-row"> <!-- orig: default-table-style=-style="basic-table" -->
        <field name="configItemId" title="${uiLabelMap.CommonId}"><text-find/></field>
        <field name="configItemName" title="${uiLabelMap.CommonName}" position="2"><text-find/></field>
        <field name="description" title="${uiLabelMap.CommonDescription}"><text-find/></field>
        <field name="configItemTypeId" title="${uiLabelMap.CommonType}" position="2">
            <drop-down>
                <option key="SINGLE" description="${uiLabelMap.ProductSingleChoice}"/>
                <option key="MULTIPLE" description="${uiLabelMap.ProductMultiChoice}"/>
            </drop-down>
        </field>
        <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
        <field name="submitAction" title="${uiLabelMap.CommonFind}" widget-style="${styles.link_run_sys} ${styles.action_find}"><submit button-type="button"/></field>
    </form>
    
    <form name="ListProductConfigItems" type="list" list-name="listIt"
        odd-row-style="alternate-row" paginate-target="FindProductConfigItems"
        target="" header-row-style="header-row-2" paginate="true"> <!-- orig: default-table-style=-style="basic-table" -->
        <actions>
            <service service-name="performFind" result-map-list="listIt" result-map="performFindResult">
                <field-map field-name="inputFields" from-field="parameters"/>
                <field-map field-name="entityName" value="ProductConfigItem"/>
                <field-map field-name="viewIndex" from-field="viewIndex"/>
                <field-map field-name="viewSize" from-field="viewSize"/>
            </service>
        </actions>
        <row-actions>
            <set field="typeDescription" value="${groovy: return &quot;SINGLE&quot;.equals(configItemTypeId) ? uiLabelMap.get(&quot;ProductSingleChoice&quot;) : uiLabelMap.get(&quot;ProductMultiChoice&quot;)}"/>
        </row-actions>
        <field name="configItemId" title="${uiLabelMap.CommonId}" widget-style="${styles.link_nav_info_id}">
            <hyperlink target="EditProductConfigItem" description="${configItemId}">
                <parameter param-name="configItemId"/>
            </hyperlink>
        </field>
        <field name="configItemName" title="${uiLabelMap.CommonName}"><display/></field>
        <field name="typeDescription" title="${uiLabelMap.CommonType}">
            <display description="${typeDescription}"/>
        </field>
        <field name="description"><display/></field>
    </form>
    
    <form name="EditProductConfigItem" type="single" target="updateProductConfigItem" title="" default-map-name="configItem"
        header-row-style="header-row"> <!-- orig: default-table-style=-style="basic-table" -->
        <alt-target use-when="configItem==null" target="createProductConfigItem"/>
        <field name="longDescription" title="${uiLabelMap.ProductLongDescription}"><ignored/></field>
        <field name="imageUrl"><ignored/></field>
        <field use-when="configItem!=null" name="configItemId" title="${uiLabelMap.CommonId}" tooltip="${uiLabelMap.ProductNotModificationRecreatingProductConfigItems}"><display/></field>
        <field use-when="configItem==null&amp;&amp;configItemId!=null" name="configItemId" title="${uiLabelMap.CommonId}" tooltip="${uiLabelMap.ProductCouldNotFindProductConfigItemWithId} [${configItemId}]"><display description="" also-hidden="false"/></field>
        <field use-when="configItem==null&amp;&amp;configItemId==null" name="configItemId" title="${uiLabelMap.CommonId}"><ignored/></field>
        <field name="configItemTypeId" title="${uiLabelMap.CommonType}" position="2">
            <drop-down allow-empty="false">
                <option key="SINGLE" description="${uiLabelMap.ProductSingleChoice}"/>
                <option key="MULTIPLE" description="${uiLabelMap.ProductMultiChoice}"/>
            </drop-down>
        </field>
        <field name="configItemName" title="${uiLabelMap.CommonName}"><text/></field>
        <field name="description" title="${uiLabelMap.CommonDescription}" position="2"><textarea/></field>

        <field name="submitAction" title="${uiLabelMap.CommonUpdate}" widget-style="${styles.link_run_sys} ${styles.action_update}"><submit button-type="button"/></field>
    </form>
    
    <form name="EditConfigOption" type="list" target="updateProductConfigOption" title="" list-name="configOptionList" list-entry-name="configOption"
        odd-row-style="alternate-row"> <!-- orig: default-table-style=-style="basic-table" -->

        <auto-fields-service service-name="updateProductConfigOption" map-name="configOption"/>
        <field use-when="configOption!=null" name="configOptionId"><hidden/></field>
        <field name="configItemId"><hidden/></field>
        <field name="submitAction" title="${uiLabelMap.CommonUpdate}" widget-style="${styles.link_run_sys} ${styles.action_update}"><submit button-type="button"/></field>
    </form>
    
    <form name="CreateConfigOption" type="single" target="createProductConfigOption" title="" default-map-name="configOption"
        header-row-style="header-row"> <!-- orig: default-table-style=-style="basic-table" -->
        <alt-target use-when="configOption!=null" target="updateProductConfigOption"/>
        <auto-fields-service service-name="createProductConfigOption"/>

        <field use-when="configOption!=null" name="configOptionId"><hidden/></field>
        <field name="configItemId" ><hidden value="${configItemId}"/></field>
        <field name="configOptionName" title="${uiLabelMap.CommonName}"><text/></field>
        <field name="description" title="${uiLabelMap.CommonDescription}"><textarea/></field>
        <field use-when="configOption!=null" name="submitAction" title="${uiLabelMap.CommonUpdate}" widget-style="${styles.link_run_sys} ${styles.action_update}"><submit button-type="button"/></field>
        <field name="submitAction" title="${uiLabelMap.CommonCreate}" widget-style="${styles.link_run_sys} ${styles.action_add}"><submit button-type="button"/></field>
    </form>
    
    <form name="CreateProductConfigProduct" type="single" target="createProductConfigProduct" title="" default-map-name="productConfigProduct"
        header-row-style="header-row"> <!-- orig: default-table-style=-style="basic-table" -->
        <alt-target use-when="productConfigProduct!=null" target="updateProductConfigProduct"/>
        <auto-fields-service service-name="createProductConfigProduct"/>

        <field name="configItemId"><hidden value="${configItemId}"/></field>
        <field name="configOptionId"><hidden value="${configOptionId}"/></field>
        <field use-when="productConfigProduct!=null" name="productId" title="${uiLabelMap.CommonProduct}"><display/></field>
        <field use-when="productConfigProduct==null" name="productId" title="${uiLabelMap.CommonProduct}">
            <lookup target-form-name="LookupProduct"/>
        </field>
        <field use-when="productConfigProduct!=null" name="submitAction" title="${uiLabelMap.CommonUpdate}" widget-style="${styles.link_run_sys} ${styles.action_update}"><submit button-type="button"/></field>
        <field name="submitAction" title="${uiLabelMap.CommonCreate}" widget-style="${styles.link_run_sys} ${styles.action_add}"><submit button-type="button"/></field>
    </form>

    <!-- ProdConfItemContent -->
    <form name="AddProductConfigItemContentAssoc" type="single" target="addContentToProductConfigItem" title="Add ProdConfItemContent (select Content Id, enter From Date):"
        header-row-style="header-row"> <!-- orig: default-table-style=-style="basic-table" -->
        <auto-fields-entity entity-name="ProdConfItemContent"/>
        <field name="configItemId" title="${uiLabelMap.ProductConfigItemId}" map-name="productConfigItem"><hidden/></field>
        <field name="contentId" title="${uiLabelMap.ProductContentId}" ></field>
        <field name="confItemContentTypeId" title="${uiLabelMap.ProductProductConfigItemContentTypeId}">
            <drop-down>
                <entity-options entity-name="ProdConfItemContentType" description="${description}">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
         <field name="fromDate" title="${uiLabelMap.CommonFrom}" ></field>
        <field name="thruDate" title="${uiLabelMap.CommonThru}"></field>
        <field name="submitAction" title="${uiLabelMap.CommonAdd}" widget-style="${styles.link_run_sys} ${styles.action_add}"><submit button-type="button"/></field>
    </form>
    <form name="PrepareAddProductConfigItemContentAssoc" type="single" target="prepareAddContentToProductConfigItem" title="Add ProdConfItemContent (select Content Id, enter From Date):"
        header-row-style="header-row"> <!-- orig: default-table-style=-style="basic-table" -->
        <auto-fields-entity entity-name="ProdConfItemContent"/>
        <field name="contentId"><ignored/></field>
        <field name="fromDate" title="${uiLabelMap.CommonFrom}"><ignored/></field>
        <field name="thruDate" title="${uiLabelMap.CommonThru}" position="2"><ignored/></field>
        <field name="configItemId" map-name="productConfigItem"><hidden/></field>
        <field name="confItemContentTypeId" title="${uiLabelMap.ProductProductConfigItemContentTypeId}">
            <drop-down>
                <entity-options entity-name="ProdConfItemContentType" description="${description}">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <!-- <field name="description"><text size="40"/></field> -->
        <field name="submitAction" title="${uiLabelMap.ProductPrepareCreate}" widget-style="${styles.link_run_sys} ${styles.action_add}"><submit button-type="button"/></field>
    </form>
    <form name="UpdateProductConfigItemContentAssoc" type="list" target="updateContentToProductConfigItem" title="" list-name="productContentDatas"
        odd-row-style="alternate-row"> <!-- orig: default-table-style=-style="basic-table" -->
        <!-- each entry in the list will be a Map with the entries: productContent and content -->
        <auto-fields-service service-name="updateProductConfigItemContent" map-name="productContent"/>
        <field name="configItemId"><hidden/></field>
        <field name="contentId" title="${uiLabelMap.ProductContent_Id}" widget-style="${styles.link_nav_info_desc}">
            <hyperlink target="EditProductConfigItemContentContent" description="${content.description} [${productContent.contentId}]">
                <parameter param-name="configItemId" from-field="productContent.configItemId"/>
                <parameter param-name="contentId" from-field="productContent.contentId"/>
            </hyperlink>
        </field>
        <field name="confItemContentTypeId" title="${uiLabelMap.ProductProductContentTypeId}">
            <drop-down>
                <entity-options entity-name="ProdConfItemContentType" description="${description}">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="submitAction" title="${uiLabelMap.CommonUpdate}" widget-style="${styles.link_run_sys} ${styles.action_update}"><submit button-type="button"/></field>
        <field name="deleteAction" title=" " widget-style="${styles.link_run_sys} ${styles.action_remove}">
            <hyperlink target="removeContentFromProductConfigItem" description="[${uiLabelMap.CommonDelete}]" also-hidden="false">
                <parameter param-name="configItemId" from-field="productContent.configItemId"/>
                <parameter param-name="contentId" from-field="productContent.contentId"/>
                <parameter param-name="confItemContentTypeId" from-field="productContent.confItemContentTypeId"/>
                <parameter param-name="fromDate" from-field="productContent.fromDate"/>
            </hyperlink>
        </field>
    </form>
    <form name="EditProductConfigItemContentSimpleText" type="single" target="updateSimpleTextContentForProductConfigItem" title="Update Simple Text Content for Product"
        header-row-style="header-row"> <!-- orig: default-table-style=-style="basic-table" -->
        <alt-target use-when="contentId==null" target="createSimpleTextContentForProductConfigItem"/>
        <auto-fields-entity entity-name="ProdConfItemContent" map-name="productContentData"/>
        <field name="fromDate" title="${uiLabelMap.CommonFrom}" ></field>
        <field name="thruDate" title="${uiLabelMap.CommonThru}" position="2"></field>
        <field name="description" title="${uiLabelMap.ProductProductDescription}" map-name="content"><text size="40"/></field>
        <field name="localeString" title="${uiLabelMap.ProductLocaleString}" map-name="content"><text size="40"/></field>
        <field use-when="contentId == null" name="contentId"><ignored/></field>
        <field use-when="contentId != null" name="contentId" tooltip="${uiLabelMap.ProductNotModificationRecrationProductContentAssociation}" map-name="productContentData" ><display/></field>
        <field name="text" title="${uiLabelMap.ProductText}" map-name="textData"><textarea cols="60" rows="7"/></field>
        <field name="textDataResourceId" title="${uiLabelMap.ProductTextDataResourceId}" map-name="textData"><hidden/></field>
        <field name="configItemId"><hidden/></field>
        <field name="confItemContentTypeId"><hidden/></field>
        <field use-when="contentId == null" name="submitAction" title="${uiLabelMap.CommonCreate}" widget-style="${styles.link_run_sys} ${styles.action_add}"><submit button-type="button"/></field>
        <field use-when="contentId != null" name="submitAction" title="${uiLabelMap.CommonUpdate}" widget-style="${styles.link_run_sys} ${styles.action_update}"><submit button-type="button"/></field>
    </form>

    <form name="ListProductConfigItem" type="list" list-name="productConfigs"
        odd-row-style="alternate-row" paginate-target="FindProductConfigItems"
        target="" header-row-style="header-row-2" paginate="true"> <!-- orig: default-table-style=-style="basic-table" -->
        <actions>
            <entity-condition entity-name="ProductConfigAndProduct" list="productConfigs" distinct="true">
                <condition-list>
                    <condition-expr field-name="configItemId" operator="equals" from-field="configItemId"/>
                </condition-list>
                <select-field field-name="productId"/>
                <select-field field-name="configItemId"/>
                <select-field field-name="productName"/>
                <select-field field-name="piecesIncluded"/>
            </entity-condition>
        </actions>
        <auto-fields-entity entity-name="ProductConfigAndProduct" default-field-type="hidden"/>
        <field name="productId" title="${uiLabelMap.CommonProduct}" widget-style="${styles.link_nav_info_id}" >
            <hyperlink target="EditProductConfigs" description="${productId}">
                <parameter param-name="productId"/>
            </hyperlink>
        </field>
        <field name="productName" title="${uiLabelMap.CommonName}"><display description="${productName}"/></field>
        <field name="piecesIncluded" title="${uiLabelMap.ProductPiecesIncluded}"><display description="${piecesIncluded}"/></field>
    </form>

    <form name="ProductConfigOptionList" type="list" list-name="configOptionList"
        odd-row-style="alternate-row" paginate-target="FindProductConfigItems"
        target="" header-row-style="header-row-2" paginate="true"> <!-- orig: default-table-style=-style="basic-table" -->
        <auto-fields-entity entity-name="ProductConfigOption" default-field-type="display"/>
        <field name="configItemId" widget-style="${styles.link_nav_info_idname}" title="${uiLabelMap.ProductConfigItem}">
            <hyperlink target="EditProductConfigOptions" description="${configOptionId} - ${configOptionName}">
                <parameter param-name="configItemId"/>
                <parameter param-name="configOptionId"/>
            </hyperlink>
        </field>
        <field name="configOptionId" ><hidden/></field>
        <field name="configOptionName" ><hidden/></field>
        <field name="removeAction" title="${uiLabelMap.CommonRemove}" widget-style="${styles.link_run_sys} ${styles.action_remove}" >
            <hyperlink target="deleteProductConfigOption" description="${uiLabelMap.CommonRemove}">
                <parameter param-name="configItemId"/>
                <parameter param-name="configOptionId"/>
            </hyperlink>
        </field>
    </form>

    <form name="ProductConfigList" type="list" list-name="configProducts"
        odd-row-style="alternate-row" paginate-target="FindProductConfigItems"
        target="" header-row-style="header-row-2" paginate="true"> <!-- orig: default-table-style=-style="basic-table" -->
        <row-actions>
            <entity-one entity-name="Product" value-field="product">
                <field-map field-name="productId"/>
            </entity-one>
        </row-actions>
        <auto-fields-service service-name="createProductConfigProduct" default-field-type="display"/>
        <field name="configItemId" ><hidden/></field>
        <field name="configOptionId" ><hidden/></field>
        <field name="productId" title="${uiLabelMap.CommonProduct}" widget-style="${styles.link_nav_info_idname}">
            <hyperlink target="EditProduct" description="${product.productId} - ${product.productName}">
                <parameter param-name="productId" from-field="product.productId"/>
            </hyperlink>
        </field>
        <field name="removeAction" widget-style="${styles.link_run_sys} ${styles.action_remove}" >
            <hyperlink target="deleteProductConfigProduct" description="${uiLabelMap.CommonRemove}">
                <parameter param-name="configItemId"/>
                <parameter param-name="configOptionId"/>
                <parameter param-name="productId" from-field="product.productId"/>
            </hyperlink>
        </field>
    </form>

</forms>