Author: hansbak
Date: Tue Oct 30 01:16:44 2007 New Revision: 589981 URL: http://svn.apache.org/viewvc?rev=589981&view=rev Log: Which this change it is possible to directly upload 'digital download' files connected to a product using the latest content management services. These files can be offered on the ecommerce site for download Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductContentServices.xml ofbiz/trunk/applications/product/servicedef/services.xml ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductContentServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductContentServices.xml?rev=589981&r1=589980&r2=589981&view=diff ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductContentServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductContentServices.xml Tue Oct 30 01:16:44 2007 @@ -25,7 +25,7 @@ <make-value value-name="newEntity" entity-name="ProductContent"/> <set-pk-fields map-name="parameters" value-name="newEntity"/> <set-nonpk-fields map-name="parameters" value-name="newEntity"/> - + <if-empty field-name="fromDate" map-name="newEntity"> <now-timestamp-to-env env-name="nowTimestamp"/> <set field="newEntity.fromDate" from-field="nowTimestamp" /> @@ -73,10 +73,12 @@ <call-service service-name="updateEmailContent" in-map-name="updateEmail"/> </simple-method> - <simple-method method-name="createDownloadContentForProduct" short-description="Create Email Content For Product"> + <simple-method method-name="createDownloadContentForProduct" short-description="Create Download Content For Product"> <set-service-fields service-name="createProductContent" map-name="parameters" to-map-name="createProductContent"/> - <set-service-fields service-name="createDownloadContent" map-name="parameters" to-map-name="createDownload"/> - <call-service service-name="createDownloadContent" in-map-name="createDownload" break-on-error="true" > + <set-service-fields service-name="persistContentAndAssoc" map-name="parameters" to-map-name="persistContentAndAssoc"/> + <set field="persistContentAndAssoc.contentTypeId" value="DOCUMENT"/> + <set field="persistContentAndAssoc.dataResourceTypeId" value="IMAGE_OBJECT"/> + <call-service service-name="persistContentAndAssoc" in-map-name="persistContentAndAssoc" break-on-error="true" > <result-to-field result-name="contentId" map-name="createProductContent" /> </call-service> <call-service service-name="createProductContent" in-map-name="createProductContent"/> Modified: ofbiz/trunk/applications/product/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services.xml?rev=589981&r1=589980&r2=589981&view=diff ============================================================================== --- ofbiz/trunk/applications/product/servicedef/services.xml (original) +++ ofbiz/trunk/applications/product/servicedef/services.xml Tue Oct 30 01:16:44 2007 @@ -368,11 +368,13 @@ </service> <service name="createDownloadContentForProduct" default-entity-name="ProductContent" engine="simple" location="org/ofbiz/product/product/ProductContentServices.xml" invoke="createDownloadContentForProduct" auth="true"> - <auto-attributes include="pk" mode="IN" optional="false"/> + <auto-attributes include="pk" mode="IN" optional="true"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> - <auto-attributes mode="IN" entity-name="Content" optional="true"/> - <attribute name="file" type="String" mode="IN" optional="false"/> - <override name="contentId" optional="true"/> + <auto-attributes include="nonpk" mode="IN" entity-name="Content" optional="true"/> + <attribute mode="IN" name="imageData" optional="true" type="java.nio.ByteBuffer"/> + <attribute mode="IN" name="_imageData_contentType" optional="true" type="String"/> + <attribute mode="IN" name="_imageData_fileName" optional="true" type="String"/> + <override name="productContentTypeId" optional="false"/> </service> <service name="updateDownloadContentForProduct" default-entity-name="ProductContent" engine="simple" location="org/ofbiz/product/product/ProductContentServices.xml" invoke="updateDownloadContentForProduct" auth="true"> Modified: ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml?rev=589981&r1=589980&r2=589981&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml (original) +++ ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml Tue Oct 30 01:16:44 2007 @@ -351,13 +351,7 @@ </form> <!-- ProductContent --> - <form name="ListProductContentInfos" type="list" title="" list-name="productContentInfos"> - <actions> - <entity-and entity-name="ProductContentAndInfo" list-name="productContentInfos"> - <field-map field-name="productId" env-name="productId"/> - <order-by field-name="productContentTypeId"/> - </entity-and> - </actions> + <form name="ListProductContentInfos" type="list" title="" list-name="productContent"> <field name="editProductContentInfo" title="${uiLabelMap.ProductContent}" widget-style="buttontext"> <hyperlink target="EditProductContentContent?productId=${productId}&contentId=${contentId}&productContentTypeId=${productContentTypeId}&fromDate=${fromDate}" description="${description} [${contentId}]" also-hidden="false"/> @@ -517,10 +511,10 @@ <field use-when="contentId == null" name="submitButton" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit"><submit button-type="button"/></field> <field use-when="contentId != null" name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field> </form> - <form name="EditProductContentDownload" type="single" target="updateDownloadContentForProduct" title="${uiLabelMap.ProductUpdateDownloadContentProduct}"> + <form name="EditProductContentDownload" type="upload" target="updateDownloadContentForProduct" title="${uiLabelMap.ProductUpdateDownloadContentProduct}"> <alt-target use-when="contentId==null" target="createDownloadContentForProduct"/> <auto-fields-entity entity-name="ProductContent" map-name="productContentData"/> - <field name="fromDate" title="${uiLabelMap.CommonFromDate}" ></field> + <field name="fromDate" title="${uiLabelMap.CommonFromDate}" ></field> <field name="thruDate" title="${uiLabelMap.CommonThruDate}"></field> <field name="purchaseFromDate" title="${uiLabelMap.ProductPurchaseFromDate}"></field> <field name="purchaseThruDate" title="${uiLabelMap.ProductPurchaseThruDate}"></field> @@ -538,7 +532,7 @@ <field name="description" title="${uiLabelMap.ProductDescription}" map-name="content"><text size="40"/></field> <field use-when="contentId == null" name="contentId" title="${uiLabelMap.ProductContentId}" tooltip="${uiLabelMap.ProductOptional}"><text maxlength="20"/></field> <field use-when="contentId != null" name="contentId" title="${uiLabelMap.ProductContentId}" tooltip="${uiLabelMap.ProductNotModificationRecrationProductContentAssociation}" map-name="productContentData" ><display/></field> - <field name="file" title="${uiLabelMap.ProductFile}" map-name="downloadData"><text size="40"/></field> + <field name="imageData" title="${uiLabelMap.ProductFile}"><file/></field> <field name="fileDataResourceId" map-name="downloadData"><hidden/></field> <field name="productId"><hidden/></field> <field name="productContentTypeId"><hidden/></field> |
Free forum by Nabble | Edit this page |