Author: mor
Date: Tue Jan 25 11:19:27 2011
New Revision: 1063227
URL: http://svn.apache.org/viewvc?rev=1063227&view=rev
Log:
Parameterized CommonProductDecorator screen so that custom apps can override it
easily.
Modified:
ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml
ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml
Modified: ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml?rev=1063227&r1=1063226&r2=1063227&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml Tue Jan
25 11:19:27 2011
@@ -48,93 +48,6 @@ under the License.
</section>
</screen>
- <screen name="CommonProductDecorator">
- <section>
- <actions>
- <set field="headerItem" value="products"/>
- <property-map resource="PartyUiLabels" map-name="uiLabelMap"
global="true"/>
- <property-map resource="OrderUiLabels" map-name="uiLabelMap"
global="true"/>
- <set field="productId" from-field="parameters.productId"/>
- <entity-one entity-name="Product" value-field="product"/>
- <set field="productName" from-field="product.productName"/>
- </actions>
- <widgets>
- <decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
- <decorator-section name="pre-body">
- <section>
- <condition>
- <and>
- <if-has-permission permission="CATALOG"
action="_VIEW"/>
- <not><if-empty field="product"/></not>
- </and>
- </condition>
- <widgets>
- <include-menu name="ProductTabBar"
location="component://product/widget/catalog/CatalogMenus.xml"/>
- </widgets>
- </section>
- </decorator-section>
- <decorator-section name="left-column">
- <include-screen name="leftbar"/>
- </decorator-section>
- <decorator-section name="body">
- <section>
- <!-- do check for CATALOG, _VIEW permission -->
- <condition>
- <if-has-permission permission="CATALOG"
action="_VIEW"/>
- </condition>
- <widgets>
- <section>
- <condition>
- <not><if-empty field="product"/></not>
- </condition>
- <widgets>
- <container>
- <label
style="h1">${uiLabelMap[labelTitleProperty]} ${uiLabelMap.CommonFor}:
${product.internalName} [${uiLabelMap.CommonId}:${productId}]
${${extraFunctionName}}</label>
- <image
src="${product.smallImageUrl}" height="40" width="40" url-mode="content"
alt="${product.internalName}"/>
- </container>
-
- <!-- add Create Product and View
Product (in ecommerce) links -->
- <container style="button-bar">
- <link target="EditProduct"
text="${uiLabelMap.ProductNewProduct}" style="buttontext create"/>
- <link
target="CreateVirtualWithVariantsForm"
text="${uiLabelMap.ProductNewVirtualProduct}" style="buttontext create"/>
- <link
target="/ecommerce/control/product" url-mode="inter-app"
text="${uiLabelMap.ProductProductPage}" style="buttontext">
- <parameter
param-name="product_id" from-field="productId"/>
- </link>
- <link target="ProductBarCode.pdf"
target-window="_blank" text="${uiLabelMap.ProductBarcode}" style="buttontext">
- <parameter
param-name="productId"/>
- <parameter
param-name="productName"/>
- </link>
-
- <link
target="javascript:expandAll(true);" text="${uiLabelMap.CommonExpandAll}"
style="buttontext expand-all" url-mode="plain"/>
- <link
target="javascript:expandAll(false);" text="${uiLabelMap.CommonCollapseAll}"
style="buttontext collapse-all" url-mode="plain"/>
- </container>
- </widgets>
- </section>
- <section>
- <condition>
- <or>
- <not><if-empty
field="product"/></not>
- <if-empty field="productId"/>
- </or>
- </condition>
- <widgets>
- <decorator-section-include name="body"/>
- </widgets>
- <fail-widgets>
- <label
style="h3">${uiLabelMap.ProductNoExistingProductsFound}</label>
- </fail-widgets>
- </section>
- </widgets>
- <fail-widgets>
- <label
style="h3">${uiLabelMap.ProductCatalogViewPermissionError}</label>
- </fail-widgets>
- </section>
- </decorator-section>
- </decorator-screen>
- </widgets>
- </section>
- </screen>
-
<screen name="CommonCatalogDecorator">
<section>
<widgets>
Modified: ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml?rev=1063227&r1=1063226&r2=1063227&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml
(original)
+++ ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml Tue Jan
25 11:19:27 2011
@@ -21,13 +21,103 @@ under the License.
<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
+ <!-- Custom apps can use their own Product Decorator by specifying its
+ location in parameters.productDecoratorLocation -->
+
+ <screen name="CommonProductDecorator">
+ <section>
+ <actions>
+ <set field="headerItem" value="products"/>
+ <property-map resource="PartyUiLabels" map-name="uiLabelMap"
global="true"/>
+ <property-map resource="OrderUiLabels" map-name="uiLabelMap"
global="true"/>
+ <set field="productId" from-field="parameters.productId"/>
+ <entity-one entity-name="Product" value-field="product"/>
+ <set field="productName" from-field="product.productName"/>
+ </actions>
+ <widgets>
+ <decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-section name="pre-body">
+ <section>
+ <condition>
+ <and>
+ <if-has-permission permission="CATALOG"
action="_VIEW"/>
+ <not><if-empty field="product"/></not>
+ </and>
+ </condition>
+ <widgets>
+ <include-menu name="ProductTabBar"
location="component://product/widget/catalog/CatalogMenus.xml"/>
+ </widgets>
+ </section>
+ </decorator-section>
+ <decorator-section name="left-column">
+ <include-screen name="leftbar"
location="component://product/widget/catalog/CommonScreens.xml"/>
+ </decorator-section>
+ <decorator-section name="body">
+ <section>
+ <!-- do check for CATALOG, _VIEW permission -->
+ <condition>
+ <if-has-permission permission="CATALOG"
action="_VIEW"/>
+ </condition>
+ <widgets>
+ <section>
+ <condition>
+ <not><if-empty field="product"/></not>
+ </condition>
+ <widgets>
+ <container>
+ <label
style="h1">${uiLabelMap[labelTitleProperty]} ${uiLabelMap.CommonFor}:
${product.internalName} [${uiLabelMap.CommonId}:${productId}]
${${extraFunctionName}}</label>
+ <image
src="${product.smallImageUrl}" height="40" width="40" url-mode="content"
alt="${product.internalName}"/>
+ </container>
+
+ <!-- add Create Product and View
Product (in ecommerce) links -->
+ <container style="button-bar">
+ <link target="EditProduct"
text="${uiLabelMap.ProductNewProduct}" style="buttontext create"/>
+ <link
target="CreateVirtualWithVariantsForm"
text="${uiLabelMap.ProductNewVirtualProduct}" style="buttontext create"/>
+ <link
target="/ecommerce/control/product" url-mode="inter-app"
text="${uiLabelMap.ProductProductPage}" style="buttontext">
+ <parameter
param-name="product_id" from-field="productId"/>
+ </link>
+ <link target="ProductBarCode.pdf"
target-window="_blank" text="${uiLabelMap.ProductBarcode}" style="buttontext">
+ <parameter
param-name="productId"/>
+ <parameter
param-name="productName"/>
+ </link>
+
+ <link
target="javascript:expandAll(true);" text="${uiLabelMap.CommonExpandAll}"
style="buttontext expand-all" url-mode="plain"/>
+ <link
target="javascript:expandAll(false);" text="${uiLabelMap.CommonCollapseAll}"
style="buttontext collapse-all" url-mode="plain"/>
+ </container>
+ </widgets>
+ </section>
+ <section>
+ <condition>
+ <or>
+ <not><if-empty
field="product"/></not>
+ <if-empty field="productId"/>
+ </or>
+ </condition>
+ <widgets>
+ <decorator-section-include name="body"/>
+ </widgets>
+ <fail-widgets>
+ <label
style="h3">${uiLabelMap.ProductNoExistingProductsFound}</label>
+ </fail-widgets>
+ </section>
+ </widgets>
+ <fail-widgets>
+ <label
style="h3">${uiLabelMap.ProductCatalogViewPermissionError}</label>
+ </fail-widgets>
+ </section>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
+
<screen name="FindProduct">
<section>
<actions>
<set field="titleProperty" value="PageTitleFindProduct"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<section>
<condition>
@@ -68,7 +158,7 @@ under the License.
<entity-one entity-name="Product" value-field="product"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet title="${uiLabelMap.PageTitleEditProduct}">
<include-form name="EditProduct"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -134,7 +224,7 @@ under the License.
<property-to-field field="defaultCurrencyUomId"
resource="general" property="currency.uom.id.default" default="USD"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductPrices}">
<include-form name="UpdateProductPrice"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -176,7 +266,7 @@ under the License.
</entity-and>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<container>
<link target="/accounting/control/EditAgreement"
url-mode="inter-app" text="${uiLabelMap.PageTitleEditAgreement}"
style="buttontext">
@@ -272,7 +362,7 @@ under the License.
</entity-condition>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductAssetUsage}">
<include-form name="EditProductAssetUsage"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -302,7 +392,7 @@ under the License.
<entity-one entity-name="FixedAssetProduct"
value-field="fixedAssetProduct"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductAssetUsage}">
<container>
@@ -493,7 +583,7 @@ under the License.
<script
location="component://product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<section>
<widgets>
@@ -560,7 +650,7 @@ under the License.
</entity-condition>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductFacilityLocations}">
<include-form
name="UpdateProductFacilityLocations"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -620,7 +710,7 @@ under the License.
<script
location="component://product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.groovy"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<section>
<condition>
@@ -667,7 +757,7 @@ under the License.
</entity-condition>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductGoodIdentifications}">
<include-form
name="UpdateProductGoodIdentifications"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -702,7 +792,7 @@ under the License.
</entity-condition>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductGlAccounts}">
<section>
@@ -754,7 +844,7 @@ under the License.
</entity-condition>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductPaymentMethodType}">
<include-form
name="UpdateProductPaymentMethodType"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -783,7 +873,7 @@ under the License.
</entity-and>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<container>
<section>
@@ -827,7 +917,7 @@ under the License.
<entity-one entity-name="SupplierProduct"
value-field="supplierProduct" auto-field-map="true"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditSupplierProduct}">
<include-form name="ListSupplierProducts"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -861,7 +951,7 @@ under the License.
<script
location="component://product/webapp/catalog/WEB-INF/actions/product/EditProductContent.groovy"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductContent}">
<include-form name="ListProductContentInfos"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -900,7 +990,7 @@ under the License.
<script
location="component://product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.groovy"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductContent}">
<include-form name="${contentFormName}"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -932,7 +1022,7 @@ under the License.
</entity-and>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductAttributes}">
<include-form name="UpdateProductAttribute"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -957,7 +1047,7 @@ under the License.
<script
location="component://product/webapp/catalog/WEB-INF/actions/product/EditProductAssoc.groovy"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<container>
<section>
@@ -993,7 +1083,7 @@ under the License.
</entity-and>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<include-form name="ListProductAssocs"
location="component://product/widget/catalog/ProductForms.xml"/>
<include-form name="ListProductAssocsTo"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -1019,7 +1109,7 @@ under the License.
<script
location="component://product/webapp/catalog/WEB-INF/actions/product/ApplyFeaturesFromGroup.groovy"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<platform-specific>
<html><html-template
location="component://product/webapp/catalog/product/ApplyFeaturesFromCategory.ftl"/></html>
@@ -1065,7 +1155,7 @@ under the License.
<set field="productId" from-field="parameters.productId"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductMaintenance}">
<include-form name="ListProductMaints"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -1087,7 +1177,7 @@ under the License.
<set field="productId" from-field="parameters.productId"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductMeters}">
<include-form name="ListProductMeters"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -1109,7 +1199,7 @@ under the License.
<set field="labelTitleProperty" value="ProductGeos"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductGeos}">
<include-form name="ListProductGeos"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -1132,7 +1222,7 @@ under the License.
<set field="productId" from-field="parameters.productId"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductSubscriptionResources}">
<include-form
name="ListProductSubscriptionResources"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -1155,7 +1245,7 @@ under the License.
<set field="productId" from-field="parameters.productId"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductWorkEffort}">
<include-form name="ListProductWorkEfforts"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -1205,7 +1295,7 @@ under the License.
</entity-condition>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditProductParties}">
<platform-specific>
@@ -1234,7 +1324,7 @@ under the License.
</entity-condition>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.PageTitleEditVendorProduct}">
<include-form name="ListVendorProducts"
location="component://product/widget/catalog/ProductForms.xml"/>
@@ -1283,7 +1373,7 @@ under the License.
<script
location="component://order/webapp/ordermgr/WEB-INF/actions/order/FindOrders.groovy"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<platform-specific>
<html><html-template
location="component://product/webapp/catalog/product/ViewProductOrders.ftl"/></html>
@@ -1306,7 +1396,7 @@ under the License.
</entity-and>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<link style="buttontext"
target="AddCommEventForProduct" text="${uiLabelMap.CommonNew}">
<parameter param-name="productId"/>
@@ -1331,7 +1421,7 @@ under the License.
<entity-one entity-name="CommunicationEvent"
value-field="communicationEvent"/>
</actions>
<widgets>
- <decorator-screen name="CommonProductDecorator"
location="${parameters.mainDecoratorLocation}">
+ <decorator-screen name="CommonProductDecorator"
location="${parameters.productDecoratorLocation}">
<decorator-section name="body">
<screenlet
title="${uiLabelMap.ProductAddCommunicationEvent}">
<include-form name="EditCommEvent"
location="component://product/widget/catalog/ProductForms.xml"/>