[OFBiz] SVN: r6957 - in trunk/applications: ecommerce/config ecommerce/webapp/ecommerce/WEB-INF ecommerce/webapp/ecommerce/customer ecommerce/widget product/entitydef product/script/org/ofbiz/product/product product/servicedef product/webapp/catalog/product product/webapp/catalog/store product/widget/catalog
jonesde@svn.ofbiz.org
jonesde at svn.ofbiz.org
Thu Mar 9 04:51:27 CST 2006
Author: jonesde
Date: 2006-03-09 04:51:10 -0600 (Thu, 09 Mar 2006)
New Revision: 6957
Added:
trunk/applications/ecommerce/webapp/ecommerce/customer/digitalproductedit.ftl
trunk/applications/ecommerce/webapp/ecommerce/customer/digitalproductlist.ftl
trunk/applications/product/script/org/ofbiz/product/product/CustomerDigitalDownloadServices.xml
Modified:
trunk/applications/ecommerce/config/EcommerceUiLabels.properties
trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
trunk/applications/ecommerce/webapp/ecommerce/customer/viewprofile.ftl
trunk/applications/ecommerce/widget/CustomerScreens.xml
trunk/applications/product/entitydef/entitymodel.xml
trunk/applications/product/servicedef/services.xml
trunk/applications/product/webapp/catalog/product/ProductForms.xml
trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml
trunk/applications/product/widget/catalog/CategoryScreens.xml
Log:
Added customer digital product maintenance pages and services with basic functionality; configured on the ProductStore entity with the enableDigProdUploadand digProdUploadCategoryId fields; uses SupplierProduct to associate with customer, etc
Modified: trunk/applications/ecommerce/config/EcommerceUiLabels.properties
===================================================================
--- trunk/applications/ecommerce/config/EcommerceUiLabels.properties 2006-03-09 07:16:16 UTC (rev 6956)
+++ trunk/applications/ecommerce/config/EcommerceUiLabels.properties 2006-03-09 10:51:10 UTC (rev 6957)
@@ -410,6 +410,7 @@
OrderVerifyConfiguration=Verify Configuration
OrderWhereShallWeShipIt=Where shall we ship it
OrderYesIsAGift=Yes, Is A Gift
+
PageTitleAddContent=Add Content
PageTitleAddResponse=Add Response
PageTitleAdditionalInfo=Additional Info
@@ -420,6 +421,8 @@
PageTitleCheckoutOptions=Checkout Options
PageTitleCheckoutReview=Checkout Review
PageTitleContentPage=Content Page
+PageTitleDigitalProductEdit=Edit My Digital Product
+PageTitleDigitalProductList=List My Digital Products
PageTitleEditAddContent=Edit/Add Content
PageTitleEditAddImage=Edit/Add Image
PageTitleEditContactMechanism=Edit Contact Mechanisam
@@ -463,6 +466,7 @@
PageTitleViewBlog=View Blog
PageTitleViewContent=View Content
PageTitleViewProfile=View Profile
+
PartyAddNewAddress=New Address
PartyAddNewPersonalInformation=Add New Personal Information
PartyAddPurpose=Add Purpose
Modified: trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
===================================================================
--- trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml 2006-03-09 07:16:16 UTC (rev 6956)
+++ trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml 2006-03-09 10:51:10 UTC (rev 6957)
@@ -722,6 +722,8 @@
<response name="error" type="view" value="newcustomer"/>
</request-map>
+ <!-- ======================= Customer Profile Requests ======================= -->
+
<request-map uri="viewprofile">
<security https="true" auth="true"/>
<response name="success" type="view" value="viewprofile"/>
@@ -937,10 +939,7 @@
<response name="error" type="view" value="error"/>
</request-map>
- <request-map uri="tellafriend">
- <security https="false" auth="false"/>
- <response name="success" type="view" value="tellafriend"/>
- </request-map>
+ <request-map uri="tellafriend"><security https="false" auth="false"/><response name="success" type="view" value="tellafriend"/></request-map>
<request-map uri="emailFriend">
<security https="false" auth="false"/>
<event type="java" path="org.ofbiz.product.product.ProductEvents" invoke="tellAFriend"/>
@@ -948,10 +947,7 @@
<response name="error" type="view" value="tellafriend"/>
</request-map>
- <request-map uri="giftcardbalance">
- <security https="true" auth="false"/>
- <response name="success" type="view" value="giftcardbalance"/>
- </request-map>
+ <request-map uri="giftcardbalance"><security https="true" auth="false"/><response name="success" type="view" value="giftcardbalance"/></request-map>
<request-map uri="querygcbalance">
<security https="true" auth="false"/>
<event type="service" invoke="balanceInquireGiftCard"/>
@@ -959,10 +955,7 @@
<response name="error" type="view" value="giftcardbalance"/>
</request-map>
- <request-map uri="giftcardlink">
- <security https="true" auth="false"/>
- <response name="success" type="view" value="giftcardlink"/>
- </request-map>
+ <request-map uri="giftcardlink"><security https="true" auth="false"/><response name="success" type="view" value="giftcardlink"/></request-map>
<request-map uri="linkgiftcard">
<security https="true" auth="false"/>
<event type="service" invoke="linkPhysicalGiftCard"/>
@@ -970,6 +963,32 @@
<response name="error" type="view" value="giftcardlink"/>
</request-map>
+ <!-- ======================= Customer Digital Product Requests ======================= -->
+
+ <request-map uri="digitalproductlist"><security https="true" auth="true"/><response name="success" type="view" value="digitalproductlist"/></request-map>
+ <request-map uri="digitalproductedit"><security https="true" auth="true"/><response name="success" type="view" value="digitalproductedit"/></request-map>
+
+ <request-map uri="createCustomerDigitalDownloadProduct">
+ <security https="true" auth="true"/>
+ <event type="service" invoke="createCustomerDigitalDownloadProduct"/>
+ <response name="success" type="view" value="digitalproductedit"/>
+ <response name="error" type="view" value="digitalproductedit"/>
+ </request-map>
+ <request-map uri="updateCustomerDigitalDownloadProduct">
+ <security https="true" auth="true"/>
+ <event type="service" invoke="updateCustomerDigitalDownloadProduct"/>
+ <response name="success" type="view" value="digitalproductedit"/>
+ <response name="error" type="view" value="digitalproductedit"/>
+ </request-map>
+ <request-map uri="deleteCustomerDigitalDownloadProduct">
+ <security https="true" auth="true"/>
+ <event type="service" invoke="deleteCustomerDigitalDownloadProduct"/>
+ <response name="success" type="view" value="digitalproductlist"/>
+ <response name="error" type="view" value="digitalproductlist"/>
+ </request-map>
+
+ <!-- ======================= Survey Requests ======================= -->
+
<request-map uri="takesurvey">
<security https="true" auth="true"/>
<response name="success" type="view" value="profilesurvey"/>
@@ -987,6 +1006,8 @@
<response name="error" type="view" value="main"/>
</request-map>
+ <!-- ======================= Communication Event Based Messaging ======================= -->
+
<request-map uri="messagelist">
<security https="true" auth="true"/>
<response name="success" type="view" value="messagelist"/>
@@ -1019,6 +1040,8 @@
<response name="error" type="view" value="contactus"/>
</request-map>
+ <!-- ======================= Content Requests: Forums/Content/Articles ======================= -->
+
<request-map uri="defaultcontent">
<security https="true" auth="false"/>
<response name="success" type="view" value="defaultcontent"/>
@@ -1259,6 +1282,9 @@
<view-map name="giftcardlink" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#giftcardlink"/>
<view-map name="profilesurvey" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#customersurvey"/>
+ <view-map name="digitalproductlist" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#digitalproductlist"/>
+ <view-map name="digitalproductedit" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#digitalproductedit"/>
+
<view-map name="contactus" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#contactus"/>
<view-map name="messagelist" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#messagelist"/>
<view-map name="messagedetail" type="screen" page="component://ecommerce/widget/CustomerScreens.xml#messagedetail"/>
Added: trunk/applications/ecommerce/webapp/ecommerce/customer/digitalproductedit.ftl
===================================================================
--- trunk/applications/ecommerce/webapp/ecommerce/customer/digitalproductedit.ftl 2006-03-09 07:16:16 UTC (rev 6956)
+++ trunk/applications/ecommerce/webapp/ecommerce/customer/digitalproductedit.ftl 2006-03-09 10:51:10 UTC (rev 6957)
@@ -0,0 +1,78 @@
+<#--
+$Id: $
+
+Copyright 2006-2006 The Apache Software Foundation
+
+Licensed 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.
+-->
+
+<#assign productPrice = productPriceList[0]?if_exists/>
+
+<div class="screenlet">
+ <div class="screenlet-header">
+ <div class="boxhead">${uiLabelMap.PageTitleDigitalProductEdit}</div>
+ </div>
+ <div class="screenlet-body">
+<#if !supplierProduct?has_content && parameters.productId?has_content>
+ <div><h3>Sorry, it appears that the specified product ID [${parameters.productId}] does not belong to you.</h3></div>
+<#else>
+
+ <#if !supplierProduct?exists>
+ <p class="head1">Add New Digital Product</p>
+ <form method="post" action="<@ofbizUrl>createCustomerDigitalDownloadProduct</@ofbizUrl>" name="editdigitaluploadform" style="margin: 0;">
+ <input type="hidden" name="productStoreId" value="${productStore.productStoreId}">
+ <#else>
+ <p class="head1">Update Digital Product</p>
+ <form method="post" action="<@ofbizUrl>updateCustomerDigitalDownloadProduct</@ofbizUrl>" name="editdigitaluploadform" style="margin: 0;">
+ <input type="hidden" name="productId" value="${parameters.productId}">
+ <input type="hidden" name="currencyUomId" value="${parameters.currencyUomId}">
+ <input type="hidden" name="minimumOrderQuantity" value="${parameters.minimumOrderQuantity}">
+ <input type="hidden" name="availableFromDate" value="${parameters.availableFromDate}">
+ </#if>
+ <a href="<@ofbizUrl>digitalproductlist</@ofbizUrl>" class="buttontext">Back to List</a>
+
+ <table width="90%" border="0" cellpadding="2" cellspacing="0">
+ <tr>
+ <td width="26%" align="right" valign="top"><div class="tabletext">Product Name</div></td>
+ <td width="5"> </td>
+ <td width="74%"><input type="text" class="inputBox" size="30" maxlength="60" name="productName" value="${(product.productName)?if_exists}"/>*</td>
+ </tr>
+ <tr>
+ <td width="26%" align="right" valign="top"><div class="tabletext">Description</div></td>
+ <td width="5"> </td>
+ <td width="74%"><input type="text" class="inputBox" size="30" maxlength="60" name="description" value="${(product.description)?if_exists}"/></td>
+ </tr>
+ <tr>
+ <td width="26%" align="right" valign="top"><div class="tabletext">Price</div></td>
+ <td width="5"> </td>
+ <td width="74%"><input type="text" class="inputBox" size="30" maxlength="60" name="price" value="${(productPrice.price)?if_exists}"/>*</td>
+ </tr>
+ <tr>
+ <td width="26%" align="right" valign="top"><div class="tabletext"> </div></td>
+ <td width="5"> </td>
+ <td width="74%"><a href="javascript:document.editdigitaluploadform.submit()" class="buttontext">${uiLabelMap.CommonSave}</a></td>
+ </tr>
+ </table>
+ </form>
+</#if>
+ </div>
+</div>
+
+<div class="screenlet">
+ <div class="screenlet-header">
+ <div class="boxhead">Digital Product Files</div>
+ </div>
+ <div class="screenlet-body">
+ <a href="<@ofbizUrl>digitalproductlist</@ofbizUrl>" class="buttontext">Back to List</a>
+ </div>
+</div>
Property changes on: trunk/applications/ecommerce/webapp/ecommerce/customer/digitalproductedit.ftl
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Id Rev Author"
Name: svn:eol-style
+ native
Added: trunk/applications/ecommerce/webapp/ecommerce/customer/digitalproductlist.ftl
===================================================================
--- trunk/applications/ecommerce/webapp/ecommerce/customer/digitalproductlist.ftl 2006-03-09 07:16:16 UTC (rev 6956)
+++ trunk/applications/ecommerce/webapp/ecommerce/customer/digitalproductlist.ftl 2006-03-09 10:51:10 UTC (rev 6957)
@@ -0,0 +1,68 @@
+<#--
+$Id: $
+
+Copyright 2006-2006 The Apache Software Foundation
+
+Licensed 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.
+-->
+
+<div class="screenlet">
+ <div class="screenlet-header">
+ <div class="boxhead">${uiLabelMap.PageTitleDigitalProductList}</div>
+ </div>
+ <div class="screenlet-body">
+ <div> <a href="<@ofbizUrl>digitalproductedit</@ofbizUrl>" class="buttontext">New Digital Product</a></div>
+ <table width="100%" cellpadding="1" cellspacing="0" border="0">
+ <tr>
+ <td width="30%">
+ <div class="tabletext"><b>${uiLabelMap.ProductProductName}</b></div>
+ </td>
+ <td width="5"> </td>
+ <td width="45%">
+ <div class="tabletext"><b>${uiLabelMap.CommonDescription}</b></div>
+ </td>
+ <td width="5"> </td>
+ <td width="20%"> </td>
+ </tr>
+ <#list supplierProductList as supplierProduct>
+ <#assign product = supplierProduct.getRelatedOneCache("Product")/>
+ <tr><td colspan="5"><hr class="sepbar"/></td></tr>
+ <tr>
+ <td>
+ <div class="tabletext">${(product.productName)?if_exists}</div>
+ </td>
+ <td width="5"> </td>
+ <td>
+ <div class="tabletext">${(product.description)?if_exists}</div>
+ </td>
+ <td width="5"> </td>
+ <td align="right">
+ <a href="<@ofbizUrl>digitalproductedit?productId=${supplierProduct.productId}&currencyUomId=${supplierProduct.currencyUomId}&minimumOrderQuantity=${supplierProduct.minimumOrderQuantity}&availableFromDate=${supplierProduct.availableFromDate}</@ofbizUrl>" class="buttontext">Edit</a>
+ </td>
+ </tr>
+ </#list>
+ <#if !supplierProductList?has_content>
+ <tr><td colspan="5"><div class="head3">No Digital Products Found</div></td></tr>
+ </#if>
+ </table>
+ </div>
+</div>
+
+<div class="screenlet">
+ <div class="screenlet-header">
+ <div class="boxhead">Digital Product Purchase History and Commission</div>
+ </div>
+ <div class="screenlet-body">
+ <div> <a href="<@ofbizUrl>digitalproductedit</@ofbizUrl>" class="buttontext">New Digital Product</a></div>
+ </div>
+</div>
Property changes on: trunk/applications/ecommerce/webapp/ecommerce/customer/digitalproductlist.ftl
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Id Rev Author"
Name: svn:eol-style
+ native
Modified: trunk/applications/ecommerce/webapp/ecommerce/customer/viewprofile.ftl
===================================================================
--- trunk/applications/ecommerce/webapp/ecommerce/customer/viewprofile.ftl 2006-03-09 07:16:16 UTC (rev 6956)
+++ trunk/applications/ecommerce/webapp/ecommerce/customer/viewprofile.ftl 2006-03-09 10:51:10 UTC (rev 6957)
@@ -46,6 +46,9 @@
<#else>
<a href="<@ofbizUrl>viewprofile?SHOW_OLD=true</@ofbizUrl>" class="buttontext">${uiLabelMap.PartyShowOld}</a>
</#if>
+ <#if (productStore.enableDigProdUpload)?if_exists == "Y">
+ <a href="<@ofbizUrl>digitalproductlist</@ofbizUrl>" class="buttontext">Digital Product Upload</a>
+ </#if>
</td>
</tr>
</table>
Modified: trunk/applications/ecommerce/widget/CustomerScreens.xml
===================================================================
--- trunk/applications/ecommerce/widget/CustomerScreens.xml 2006-03-09 07:16:16 UTC (rev 6956)
+++ trunk/applications/ecommerce/widget/CustomerScreens.xml 2006-03-09 10:51:10 UTC (rev 6957)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- * Copyright (c) 2005 The Open For Business Project - www.ofbiz.org
+ * Copyright (c) 2005-2006 The Open For Business Project - www.ofbiz.org
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -342,4 +342,71 @@
</widgets>
</section>
</screen>
+
+ <screen name="digitalproductlist">
+ <section>
+ <actions>
+ <set field="title-property" value="PageTitleDigitalProductList"/>
+
+ <entity-and entity-name="SupplierProduct" list-name="supplierProductList">
+ <field-map field-name="partyId" env-name="userLogin.partyId"/>
+ </entity-and>
+ </actions>
+ <widgets>
+ <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+ <decorator-section name="body">
+ <section>
+ <condition><if-compare field-name="productStore.enableDigProdUpload" operator="equals" value="Y"/></condition>
+ <widgets>
+ <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/customer/digitalproductlist.ftl"/></html></platform-specific>
+ </widgets>
+ <fail-widgets>
+ <container><label style="head2" text="Sorry, digital product upload is not enabled."></label></container>
+ </fail-widgets>
+ </section>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
+ <screen name="digitalproductedit">
+ <section>
+ <actions>
+ <set field="title-property" value="PageTitleDigitalProductEdit"/>
+
+ <set field="parameters.minimumOrderQuantity" value="1" type="Double"/>
+ <entity-one entity-name="SupplierProduct" value-name="supplierProduct" auto-field-map="false">
+ <field-map field-name="partyId" env-name="userLogin.partyId"/><!-- get from userLogin for security reasons -->
+ <field-map field-name="productId" env-name="parameters.productId"/>
+ <field-map field-name="currencyUomId" env-name="parameters.currencyUomId"/>
+ <field-map field-name="minimumOrderQuantity" env-name="parameters.minimumOrderQuantity"/>
+ <field-map field-name="availableFromDate" env-name="parameters.availableFromDate"/>
+ </entity-one>
+ <entity-one entity-name="Product" value-name="product"/>
+
+ <!-- should just be one, but don't have all pk fields so will just get first from list -->
+ <entity-and entity-name="ProductPrice" list-name="productPriceList">
+ <field-map field-name="productId" env-name="parameters.productId"/>
+ <field-map field-name="productPriceTypeId" value="DEFAULT_PRICE"/>
+ <field-map field-name="productPricePurposeId" value="PURCHASE"/>
+ <field-map field-name="productStoreGroupId" value="_NA_"/>
+ </entity-and>
+ </actions>
+ <widgets>
+ <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+ <decorator-section name="body">
+ <section>
+ <condition><if-compare field-name="productStore.enableDigProdUpload" operator="equals" value="Y"/></condition>
+ <widgets>
+ <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/customer/digitalproductedit.ftl"/></html></platform-specific>
+ </widgets>
+ <fail-widgets>
+ <container><label style="head2" text="Sorry, digital product upload is not enabled."></label></container>
+ </fail-widgets>
+ </section>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
</screens>
Modified: trunk/applications/product/entitydef/entitymodel.xml
===================================================================
--- trunk/applications/product/entitydef/entitymodel.xml 2006-03-09 07:16:16 UTC (rev 6956)
+++ trunk/applications/product/entitydef/entitymodel.xml 2006-03-09 10:51:10 UTC (rev 6957)
@@ -2927,6 +2927,8 @@
<field name="showTaxIsExempt" type="indicator"><description>default Y; if set to N do not show isExempt checkbox for PartyTaxAuthInfo, always force to N</description></field>
<field name="vatTaxAuthGeoId" type="id"></field>
<field name="vatTaxAuthPartyId" type="id"></field>
+ <field name="enableDigProdUpload" type="indicator"></field>
+ <field name="digProdUploadCategoryId" type="id"></field>
<prim-key field="productStoreId"/>
<relation type="one" fk-name="PROD_STR_PRSTRGP" title="Primary" rel-entity-name="ProductStoreGroup">
<key-map field-name="primaryStoreGroupId" rel-field-name="productStoreGroupId"/>
@@ -3439,6 +3441,7 @@
<field name="currencyUomId" type="id"></field>
<field name="supplierProductName" type="name"></field>
<field name="supplierProductId" type="id"></field>
+ <field name="supplierCommissionPerc" type="floating-point"></field>
<field name="comments" type="comment"></field>
<prim-key field="productId"/>
<prim-key field="partyId"/>
Added: trunk/applications/product/script/org/ofbiz/product/product/CustomerDigitalDownloadServices.xml
===================================================================
--- trunk/applications/product/script/org/ofbiz/product/product/CustomerDigitalDownloadServices.xml 2006-03-09 07:16:16 UTC (rev 6956)
+++ trunk/applications/product/script/org/ofbiz/product/product/CustomerDigitalDownloadServices.xml 2006-03-09 10:51:10 UTC (rev 6957)
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+$Id: $
+
+Copyright 2006-2006 The Apache Software Foundation
+
+Licensed 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.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/simple-methods.xsd">
+ <simple-method method-name="createCustomerDigitalDownloadProduct" short-description="createCustomerDigitalDownloadProduct">
+ <now-timestamp-to-env env-name="nowTimestamp"/>
+
+ <make-value value-name="createProductMap" entity-name="Product"/>
+ <sequenced-id-to-env sequence-name="Product" env-name="createProductMap.productId"/>
+ <set field="productId" from-field="createProductMap.productId"/>
+
+ <set field="createProductMap.productName" from-field="parameters.productName"/>
+ <set field="createProductMap.internalName" from-field="parameters.productName"/>
+ <set field="createProductMap.description" from-field="parameters.description"/>
+ <set field="createProductMap.productTypeId" value="DIGITAL_GOOD"/>
+ <create-value value-name="createProductMap"/>
+
+ <make-value value-name="createProductPriceMap" entity-name="ProductPrice"/>
+ <set field="createProductPriceMap.productId" from-field="productId"/>
+ <set field="createProductPriceMap.productPriceTypeId" value="DEFAULT_PRICE"/>
+ <set field="createProductPriceMap.productPricePurposeId" value="PURCHASE"/>
+ <set field="createProductPriceMap.currencyUomId" from-field="parameters.currencyUomId" default-value="USD"/>
+ <set field="createProductPriceMap.productStoreGroupId" value="_NA_"/>
+ <set field="createProductPriceMap.fromDate" from-field="nowTimestamp"/>
+ <set field="createProductPriceMap.price" from-field="parameters.price"/>
+ <create-value value-name="createProductPriceMap"/>
+
+ <make-value value-name="createProductSupplierMap" entity-name="SupplierProduct"/>
+ <set field="createProductSupplierMap.productId" from-field="productId"/>
+ <set field="createProductSupplierMap.partyId" from-field="userLogin.partyId"/>
+ <set field="createProductSupplierMap.currencyUomId" from-field="parameters.currencyUomId" default-value="USD"/>
+ <set field="createProductSupplierMap.minimumOrderQuantity" value="1" type="Double"/>
+ <set field="createProductSupplierMap.availableFromDate" from-field="nowTimestamp"/>
+ <create-value value-name="createProductSupplierMap"/>
+
+ <field-to-result field-name="productId"/>
+ <field-to-result field-name="createProductSupplierMap.currencyUomId" result-name="currencyUomId"/>
+ <field-to-result field-name="createProductSupplierMap.minimumOrderQuantity" result-name="minimumOrderQuantity"/>
+ <field-to-result field-name="createProductSupplierMap.availableFromDate" result-name="availableFromDate"/>
+
+ <!-- create association with ProductStore.digProdUploadCategoryId -->
+ <entity-one entity-name="ProductStore" value-name="productStore"/>
+ <if-not-empty field-name="productStore.digProdUploadCategoryId">
+ <make-value value-name="addProductToCategoryMap" entity-name="ProductCategoryMember"/>
+ <set field="addProductToCategoryMap.productId" from-field="productId"/>
+ <set field="addProductToCategoryMap.productCategoryId" from-field="productStore.digProdUploadCategoryId"/>
+ <create-value value-name="addProductToCategoryMap"/>
+ </if-not-empty>
+ </simple-method>
+ <simple-method method-name="updateCustomerDigitalDownloadProduct" short-description="updateCustomerDigitalDownloadProduct">
+ <now-timestamp-to-env env-name="nowTimestamp"/>
+
+ <!-- make sure SupplierProduct exists for userLogin.partyId -->
+ <set field="parameters.partyId" from-field="userLogin.partyId"/>
+ <entity-one entity-name="SupplierProduct" value-name="supplierProduct"/>
+
+ <if-empty field-name="supplierProductList">
+ <add-error><fail-message message="Cannot update this Product: you are not associated with it as the Supplier"/></add-error>
+ </if-empty>
+
+ <!-- update productName/description -->
+ <if>
+ <condition>
+ <or>
+ <not><if-empty field-name="parameters.productName"></if-empty></not>
+ <not><if-empty field-name="parameters.description"></if-empty></not>
+ </or>
+ </condition>
+ <then>
+ <entity-one entity-name="Product" value-name="product"/>
+ <set field="product.productName" from-field="parameters.productName" set-if-empty="false"/>
+ <set field="product.description" from-field="parameters.description" set-if-empty="false"/>
+ <store-value value-name="product"/>
+ </then>
+ </if>
+
+ <!-- update price -->
+ <if-not-empty field-name="parameters.price">
+ <entity-and entity-name="ProductPrice" list-name="productPriceList">
+ <field-map field-name="productId" env-name="parameters.productId"/>
+ <field-map field-name="productPriceTypeId" value="DEFAULT_PRICE"/>
+ <field-map field-name="productPricePurposeId" value="PURCHASE"/>
+ <field-map field-name="productStoreGroupId" value="_NA_"/>
+ </entity-and>
+ <!-- should just be one -->
+ <first-from-list entry-name="productPrice" list-name="productPriceList"/>
+ <set field="productPrice.price" from-field="parameters.price"/>
+ <store-value value-name="productPrice"/>
+ </if-not-empty>
+ </simple-method>
+ <simple-method method-name="deleteCustomerDigitalDownloadProduct" short-description="deleteCustomerDigitalDownloadProduct">
+ <now-timestamp-to-env env-name="nowTimestamp"/>
+
+ <!-- make sure SupplierProduct exists for userLogin.partyId -->
+ <entity-and entity-name="SupplierProduct" list-name="supplierProductList">
+ <field-map field-name="productId" env-name="parameters.productId"/>
+ <field-map field-name="partyId" env-name="userLogin.productId"/>
+ </entity-and>
+
+ <if-empty field-name="supplierProductList">
+ <add-error><fail-message message="Cannot update this Product: you are not associated with it as a Supplier"/></add-error>
+ </if-empty>
+
+ <!-- keep the product around, just expire SupplierProduct and ProductCategoryMember records -->
+ <iterate entry-name="supplierProduct" list-name="supplierProductList">
+ <set field="supplierProduct.availableThruDate" from-field="nowTimestamp"/>
+ <store-value value-name="supplierProduct"/>
+ </iterate>
+
+ <entity-and entity-name="ProductCategoryMember" list-name="productCategoryMemberList">
+ <field-map field-name="productId"/>
+ </entity-and>
+ <iterate entry-name="productCategoryMember" list-name="productCategoryMemberList">
+ <set field="productCategoryMember.thruDate" from-field="nowTimestamp"/>
+ <store-value value-name="productCategoryMember"/>
+ </iterate>
+ </simple-method>
+</simple-methods>
Property changes on: trunk/applications/product/script/org/ofbiz/product/product/CustomerDigitalDownloadServices.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ "Id Rev Author"
Name: svn:eol-style
+ native
Modified: trunk/applications/product/servicedef/services.xml
===================================================================
--- trunk/applications/product/servicedef/services.xml 2006-03-09 07:16:16 UTC (rev 6956)
+++ trunk/applications/product/servicedef/services.xml 2006-03-09 10:51:10 UTC (rev 6957)
@@ -735,16 +735,25 @@
location="org/ofbiz/product/product/CustomerDigitalDownloadServices.xml" invoke="createCustomerDigitalDownloadProduct">
<description></description>
<attribute name="productName" type="String" mode="IN" optional="false"/>
+ <attribute name="productStoreId" type="String" mode="IN" optional="false"/>
+ <attribute name="price" type="Double" mode="IN" optional="false"/>
<attribute name="description" type="String" mode="IN" optional="true"/>
- <attribute name="productStoreId" type="String" mode="IN" optional="false"/>
+ <attribute name="currencyUomId" type="String" mode="IN" optional="true"/>
<attribute name="productId" type="String" mode="OUT" optional="false"/>
+ <attribute name="currencyUomId" type="String" mode="OUT" optional="false"/>
+ <attribute name="minimumOrderQuantity" type="Double" mode="OUT" optional="false"/>
+ <attribute name="availableFromDate" type="Timestamp" mode="OUT" optional="false"/>
</service>
<service name="updateCustomerDigitalDownloadProduct" auth="true" engine="simple"
location="org/ofbiz/product/product/CustomerDigitalDownloadServices.xml" invoke="updateCustomerDigitalDownloadProduct">
<description></description>
<attribute name="productId" type="String" mode="IN" optional="false"/>
- <attribute name="productName" type="String" mode="IN" optional="false"/>
+ <attribute name="currencyUomId" type="String" mode="IN" optional="false"/>
+ <attribute name="minimumOrderQuantity" type="Double" mode="IN" optional="false"/>
+ <attribute name="availableFromDate" type="Timestamp" mode="IN" optional="false"/>
+ <attribute name="productName" type="String" mode="IN" optional="true"/>
<attribute name="description" type="String" mode="IN" optional="true"/>
+ <attribute name="price" type="Double" mode="IN" optional="true"/>
</service>
<service name="deleteCustomerDigitalDownloadProduct" auth="true" engine="simple"
location="org/ofbiz/product/product/CustomerDigitalDownloadServices.xml" invoke="deleteCustomerDigitalDownloadProduct">
Modified: trunk/applications/product/webapp/catalog/product/ProductForms.xml
===================================================================
--- trunk/applications/product/webapp/catalog/product/ProductForms.xml 2006-03-09 07:16:16 UTC (rev 6956)
+++ trunk/applications/product/webapp/catalog/product/ProductForms.xml 2006-03-09 10:51:10 UTC (rev 6957)
@@ -587,8 +587,9 @@
<display/>
</field>
<field name="availableFromDate" title="${uiLabelMap.ProductAvailableFromDate}" red-when="after-now"><display/></field>
- <field name="availableThruDate" title="${uiLabelMap.ProductAvailableThruDate}" red-when="after-now"><display/></field>
+ <field name="availableThruDate" title="${uiLabelMap.ProductAvailableThruDate}" red-when="before-now"><display/></field>
<field name="quantityUomId"><display/></field>
+ <field name="supplierCommissionPerc" title="Comm. Perc."><display/></field>
<field name="lastPrice" widget-area-style="tabletextright"
header-link="EditProductSuppliers?productId=${productId}&orderBy=lastPrice" header-link-style="buttontext">
<display type="currency" currency="${currencyUomId}"/>
Modified: trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml
===================================================================
--- trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml 2006-03-09 07:16:16 UTC (rev 6956)
+++ trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml 2006-03-09 10:51:10 UTC (rev 6957)
@@ -195,6 +195,10 @@
</field>
<field name="vatTaxAuthGeoId"><lookup target-form-name="LookupGeo"/></field>
<field name="vatTaxAuthPartyId"><lookup target-form-name="LookupPartyName"/></field>
+ <field name="enableDigProdUpload" widget-style="selectBox" title="Enable Digital Product Upload">
+ <drop-down allow-empty="false" no-current-selected-key="N"><option key="Y"/><option key="N"/></drop-down>
+ </field>
+ <field name="digProdUploadCategoryId"><lookup target-form-name="LookupProductCategory"/></field>
<field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>
Modified: trunk/applications/product/widget/catalog/CategoryScreens.xml
===================================================================
--- trunk/applications/product/widget/catalog/CategoryScreens.xml 2006-03-09 07:16:16 UTC (rev 6956)
+++ trunk/applications/product/widget/catalog/CategoryScreens.xml 2006-03-09 10:51:10 UTC (rev 6957)
@@ -330,7 +330,7 @@
<set field="labelTitleProperty" value="CategoryAttributes"/>
<set field="productCategoryId" from-field="parameters.productCategoryId"/>
<entity-one entity-name="ProductCategory" value-name="productCategory"/>
- <entity-and entity-name="ProductCategoryAttribute" list-name="categoryAttributes"/>
+ <entity-condition entity-name="ProductCategoryAttribute" list-name="categoryAttributes"/>
</actions>
<widgets>
<decorator-screen name="CommonCategoryDecorator">
More information about the Svn
mailing list