[OFBiz] SVN: r6945 - in trunk: applications/content/data applications/content/src/org/ofbiz/content/data applications/ecommerce/config applications/ecommerce/data applications/ecommerce/webapp/ecommerce/WEB-INF applications/order/entitydef applications/order/src/org/ofbiz/order/order applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog applications/order/webapp/ordermgr/entry/catalog framework/images/webapp/images

jonesde@svn.ofbiz.org jonesde at svn.ofbiz.org
Wed Mar 8 02:51:30 CST 2006


Author: jonesde
Date: 2006-03-08 02:51:13 -0600 (Wed, 08 Mar 2006)
New Revision: 6945

Added:
   trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java
Modified:
   trunk/applications/content/data/ContentTypeData.xml
   trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java
   trunk/applications/ecommerce/config/EcommerceUiLabels.properties
   trunk/applications/ecommerce/data/DemoProduct.xml
   trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
   trunk/applications/order/entitydef/entitygroup.xml
   trunk/applications/order/entitydef/entitymodel_view.xml
   trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productdetail.bsh
   trunk/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl
   trunk/framework/images/webapp/images/ecommain.css
Log:
Some initial work for Digital Download products: demo data, show available in product detail, refactor DataResourceWorker method for streaming, downloadDigitalProduct event that checks order history; still some things left in this, like showing available downloads and links to actually download them

Modified: trunk/applications/content/data/ContentTypeData.xml
===================================================================
--- trunk/applications/content/data/ContentTypeData.xml	2006-03-08 03:56:27 UTC (rev 6944)
+++ trunk/applications/content/data/ContentTypeData.xml	2006-03-08 08:51:13 UTC (rev 6945)
@@ -138,15 +138,15 @@
     <DataResourceType dataResourceTypeId="LOCAL_FILE" description="Local File" hasTable="N" parentTypeId=""/>
     <DataResourceType dataResourceTypeId="OFBIZ_FILE" description="File (rel to OFBIZ_HOME)" hasTable="N" parentTypeId=""/>
     <DataResourceType dataResourceTypeId="CONTEXT_FILE" description="File (rel to webapp root)" hasTable="N" parentTypeId=""/>
+    <DataResourceType dataResourceTypeId="LOCAL_FILE_BIN" description="Local Binary File" hasTable="N" parentTypeId=""/>
+    <DataResourceType dataResourceTypeId="OFBIZ_FILE_BIN" description="Binary File (rel to OFBIZ_HOME)" hasTable="N" parentTypeId=""/>
+    <DataResourceType dataResourceTypeId="CONTEXT_FILE_BIN" description="Binary File (rel to webapp root)" hasTable="N" parentTypeId=""/>
     <DataResourceType dataResourceTypeId="LINK" description="HyperLink" hasTable="N" parentTypeId=""/>
     <DataResourceType dataResourceTypeId="URL_RESOURCE" description="URL Resource" hasTable="N" parentTypeId=""/>
     <DataResourceType dataResourceTypeId="SHORT_TEXT" description="Short Text" hasTable="N" parentTypeId=""/>
     <DataResourceType dataResourceTypeId="ELECTRONIC_TEXT" description="Long Text" hasTable="Y" parentTypeId=""/>
     <DataResourceType dataResourceTypeId="IMAGE_OBJECT" description="Image" hasTable="Y" parentTypeId=""/>
     <DataResourceType dataResourceTypeId="OTHER_OBJECT" description="Other" hasTable="Y" parentTypeId=""/>
-    <DataResourceType dataResourceTypeId="LOCAL_FILE_BIN" description="Local Binary File" hasTable="N" parentTypeId=""/>
-    <DataResourceType dataResourceTypeId="OFBIZ_FILE_BIN" description="Binary File (rel to OFBIZ_HOME)" hasTable="N" parentTypeId=""/>
-    <DataResourceType dataResourceTypeId="CONTEXT_FILE_BIN" description="Binary File (rel to webapp root)" hasTable="N" parentTypeId=""/>
     <DataResourceType dataResourceTypeId="SURVEY" description="Survey" hasTable="N" parentTypeId=""/>
     <DataResourceType dataResourceTypeId="SURVEY_RESPONSE" description="Survey Response" hasTable="N" parentTypeId=""/>
 

Modified: trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java
===================================================================
--- trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java	2006-03-08 03:56:27 UTC (rev 6944)
+++ trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java	2006-03-08 08:51:13 UTC (rev 6945)
@@ -30,6 +30,7 @@
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.OutputStream;
 import java.io.StringWriter;
 import java.io.Writer;
 import java.net.URL;
@@ -945,20 +946,20 @@
     public static File getContentFile(String dataResourceTypeId, String objectInfo, String rootDir)  throws GeneralException, FileNotFoundException{
 
         File file = null;
-        if (dataResourceTypeId.startsWith("LOCAL_FILE")) {
+        if (dataResourceTypeId.equals("LOCAL_FILE") || dataResourceTypeId.equals("LOCAL_FILE_BIN")) {
             file = new File(objectInfo);
             if (!file.isAbsolute()) {
                 throw new GeneralException("File (" + objectInfo + ") is not absolute");
             }
             int c;
-        } else if (dataResourceTypeId.startsWith("OFBIZ_FILE")) {
+        } else if (dataResourceTypeId.equals("OFBIZ_FILE") || dataResourceTypeId.equals("OFBIZ_FILE_BIN")) {
             String prefix = System.getProperty("ofbiz.home");
             String sep = "";
             if (objectInfo.indexOf("/") != 0 && prefix.lastIndexOf("/") != (prefix.length() - 1)) {
                 sep = "/";
             }
             file = new File(prefix + sep + objectInfo);
-        } else if (dataResourceTypeId.startsWith("CONTEXT_FILE")) {
+        } else if (dataResourceTypeId.equals("CONTEXT_FILE") || dataResourceTypeId.equals("CONTEXT_FILE_BIN")) {
             String prefix = rootDir;
             String sep = "";
             if (objectInfo.indexOf("/") != 0 && prefix.lastIndexOf("/") != (prefix.length() - 1)) {
@@ -1058,17 +1059,12 @@
         }
         return latestDir;
     }
-    
-    public static ByteWrapper getContentAsByteWrapper(GenericDelegator delegator, String dataResourceId, String https, String webSiteId, Locale locale, String rootDir) throws IOException, GeneralException {
 
-    	ByteWrapper byteWrapper = new ByteWrapper(new byte[0]);
-    	GenericValue dataResource = null;
-    	String text = null;
+    public static void streamDataResource(OutputStream os, GenericDelegator delegator, String dataResourceId, String https, String webSiteId, Locale locale, String rootDir) throws IOException, GeneralException {
     	try {
-    		dataResource = delegator.findByPrimaryKeyCache("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId));
+        	GenericValue dataResource = delegator.findByPrimaryKeyCache("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId));
     		if (dataResource == null) {
-    			Debug.logInfo("DataResource for " + dataResourceId + " is null.", module);
-        		return byteWrapper;
+                throw new GeneralException("Error in streamDataResource: DataResource with ID [" + dataResourceId + "] was not found.");
     		}
 	        String dataResourceTypeId = dataResource.getString("dataResourceTypeId");
 	        if (UtilValidate.isEmpty(dataResourceTypeId)) {
@@ -1080,32 +1076,23 @@
 	        }
 	
 	        if (dataResourceTypeId.equals("SHORT_TEXT")) {
-	            text = dataResource.getString("objectInfo");
-	            byteWrapper = new ByteWrapper(text.getBytes());
+	            String text = dataResource.getString("objectInfo");
+	            os.write(text.getBytes());
 	        } else if (dataResourceTypeId.equals("ELECTRONIC_TEXT")) {
 	            GenericValue electronicText = delegator.findByPrimaryKeyCache("ElectronicText", UtilMisc.toMap("dataResourceId", dataResourceId));
 	            if (electronicText != null) {
-	                text = electronicText.getString("textData");
-	                byteWrapper = new ByteWrapper(text.getBytes());
+	            	String text = electronicText.getString("textData");
+		            os.write(text.getBytes());
 	            }
 	        } else if (dataResourceTypeId.equals("IMAGE_OBJECT")) {
-	        	byte [] imageBytes = acquireImage(delegator, dataResource);
-                byteWrapper = new ByteWrapper(imageBytes);
+	        	byte[] imageBytes = acquireImage(delegator, dataResource);
+	        	os.write(imageBytes);
 	        } else if (dataResourceTypeId.equals("LINK")) {
-	            text = dataResource.getString("objectInfo");
-	            byteWrapper = new ByteWrapper(text.getBytes());
+	        	String text = dataResource.getString("objectInfo");
+	            os.write(text.getBytes());
 	        } else if (dataResourceTypeId.equals("URL_RESOURCE")) {
 	            URL url = new URL(dataResource.getString("objectInfo"));
-	            if (url.getHost() != null) { // is absolute
-	                InputStream in = url.openStream();
-	                int c;
-	                StringWriter sw = new StringWriter();
-	                while ((c = in.read()) != -1) {
-	                    sw.write(c);
-	                }
-	                sw.close();
-	                text = sw.toString();
-	            } else {
+	            if (url.getHost() == null) { // is relative
 	                String prefix = buildRequestPrefix(delegator, locale, webSiteId, https);
 	                String sep = "";
 	                //String s = "";
@@ -1113,28 +1100,34 @@
 	                    sep = "/";
 	                }
 	                String s2 = prefix + sep + url.toString();
-	                URL url2 = new URL(s2);
-	                text = (String) url2.getContent();
+	                url = new URL(s2);
 	            }
-	            byteWrapper = new ByteWrapper(text.getBytes());
+                InputStream in = url.openStream();
+                int c;
+                while ((c = in.read()) != -1) {
+                    os.write(c);
+                }
 	        } else if (dataResourceTypeId.indexOf("_FILE") >= 0) {
 	            String objectInfo = dataResource.getString("objectInfo");
 	            File inputFile = getContentFile(dataResourceTypeId, objectInfo, rootDir);
-		    	long fileSize = inputFile.length();
+		    	//long fileSize = inputFile.length();
 		    	FileInputStream fis = new FileInputStream(inputFile);
-		    	ByteArrayOutputStream baos = new ByteArrayOutputStream((int)fileSize);
 		    	int c;
 		    	while ((c = fis.read()) != -1) {
-		    		baos.write(c);
+		    		os.write(c);
 		    	}
-	            byteWrapper = new ByteWrapper(baos.toByteArray());
 	        } else {
-	            throw new GeneralException("The dataResourceTypeId [" + dataResourceTypeId + "] is not supported in getContentAsByteWrapper");
+	            throw new GeneralException("The dataResourceTypeId [" + dataResourceTypeId + "] is not supported in streamDataResource");
 	        }
     	} catch(GenericEntityException e) {
-            throw new GeneralException(e.getMessage());
+            throw new GeneralException("Error in streamDataResource", e);
     	}
+    }
+    
+    public static ByteWrapper getContentAsByteWrapper(GenericDelegator delegator, String dataResourceId, String https, String webSiteId, Locale locale, String rootDir) throws IOException, GeneralException {
+    	ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    	streamDataResource(baos, delegator, dataResourceId, https, webSiteId, locale, rootDir);
+        ByteWrapper byteWrapper = new ByteWrapper(baos.toByteArray());
         return byteWrapper;
     }
-
 }

Modified: trunk/applications/ecommerce/config/EcommerceUiLabels.properties
===================================================================
--- trunk/applications/ecommerce/config/EcommerceUiLabels.properties	2006-03-08 03:56:27 UTC (rev 6944)
+++ trunk/applications/ecommerce/config/EcommerceUiLabels.properties	2006-03-08 08:51:13 UTC (rev 6945)
@@ -115,6 +115,7 @@
 EcommerceCustomerTaxID=Customer Tax ID
 EcommerceDataResourceId=Data Resource Id
 EcommerceDetailsButton=Details
+EcommerceDownloadFilesTitle=Download Files for this Product
 EcommerceEcommerce=Ecommerce
 EcommerceEmptyBody=Empty Body
 EcommerceEmptyCart=Empty Cart

Modified: trunk/applications/ecommerce/data/DemoProduct.xml
===================================================================
--- trunk/applications/ecommerce/data/DemoProduct.xml	2006-03-08 03:56:27 UTC (rev 6944)
+++ trunk/applications/ecommerce/data/DemoProduct.xml	2006-03-08 08:51:13 UTC (rev 6945)
@@ -128,25 +128,31 @@
     <ProdCatalogCategory prodCatalogId="TestCatalog" productCategoryId="TSTLTDADMIN" fromDate="2001-05-13 12:00:00.0"
         sequenceNum="1" prodCatalogCategoryTypeId="PCCT_ADMIN_ALLW"/>
 
-    <Product productId="GZ-1000" productTypeId="FINISHED_GOOD" primaryProductCategoryId="101" productName="Tiny Gizmo" internalName="Tiny Gizmo" description="The smallest gizmo in town." longDescription="This gizmo is very small and runs on solar power." taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2003-03-04 18:48:34.612" createdByUserLogin="admin" lastModifiedDate="2003-03-04 18:48:34.612" lastModifiedByUserLogin="admin"/>
-    <Product productId="GZ-1001" productTypeId="FINISHED_GOOD" primaryProductCategoryId="101" productName="Nan Gizmo" internalName="Nan Gizmo" description="Indian style Nan gizmo" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2003-03-04 18:57:27.248" createdByUserLogin="admin" lastModifiedDate="2003-03-04 18:57:27.248" lastModifiedByUserLogin="admin"/>
-    <Product productId="GZ-1004" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Rainbow Gizmo" internalName="Rainbow Gizmo" description="The only multi-colored gizmo" longDescription="This is the original multi-colored gizmo, only available from OFBiz!" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2003-03-04 18:50:33.463" createdByUserLogin="admin" lastModifiedDate="2003-03-04 18:50:33.463" lastModifiedByUserLogin="admin"/>
-    <Product productId="GZ-1005" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName=".NIT Gizmo" internalName=".NIT Gizmo" description="M$ .NIT gizmo" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2003-03-04 19:00:29.851" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:02:17.445" lastModifiedByUserLogin="admin">
+    <Product productId="GZ-1000" productTypeId="FINISHED_GOOD" primaryProductCategoryId="101" productName="Tiny Gizmo" internalName="Tiny Gizmo" description="The smallest gizmo in town." longDescription="This gizmo is very small and runs on solar power." taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <Product productId="GZ-1001" productTypeId="FINISHED_GOOD" primaryProductCategoryId="101" productName="Nan Gizmo" internalName="Nan Gizmo" description="Indian style Nan gizmo" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <Product productId="GZ-1004" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Rainbow Gizmo" internalName="Rainbow Gizmo" description="The only multi-colored gizmo" longDescription="This is the original multi-colored gizmo, only available from OFBiz!" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <Product productId="GZ-1005" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName=".NIT Gizmo" internalName=".NIT Gizmo" description="M$ .NIT gizmo" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin">
         <longDescription><![CDATA[This gizmo only works in certain areas and requires a lot of extra space to move around.<br/><br/>
         <b>*** WARNING: this gizmo is known to crash quite often and may malfunction or cease to function due to malicious misuse of certain features ***</b>]]></longDescription>
     </Product>
-    <Product productId="GZ-1006" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Open Gizmo" internalName="Open Gizmo" description="Gizmo based on open standards" longDescription="Highest quality gizmo around." taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="Y" isVariant="N" createdDate="2003-03-04 19:03:01.298" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:03:01.298" lastModifiedByUserLogin="admin"/>
-    <Product productId="GZ-1006-1" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Open Gizmo (LGPL)" internalName="Open Gizmo (LGPL)" description="Gizmo based on open standards" longDescription="Highest quality gizmo around." taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="Y" createdDate="2003-03-04 19:03:01.298" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:03:01.298" lastModifiedByUserLogin="admin"/>
-    <Product productId="GZ-1006-2" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Open Gizmo (GPL)" internalName="Open Gizmo (GPL)" description="Gizmo based on open standards" longDescription="Highest quality gizmo around." taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="Y" createdDate="2003-03-04 19:03:01.298" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:03:01.298" lastModifiedByUserLogin="admin"/>
-    <Product productId="GZ-1006-3" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Open Gizmo (BSD)" internalName="Open Gizmo (BSD)" description="Gizmo based on open standards" longDescription="Highest quality gizmo around." taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="Y" createdDate="2003-03-04 19:03:01.298" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:03:01.298" lastModifiedByUserLogin="admin"/>
-    <Product productId="GZ-1006-4" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Open Gizmo (MIT)" internalName="Open Gizmo (MIT)" description="Gizmo based on open standards" longDescription="Highest quality gizmo around." taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="Y" createdDate="2003-03-04 19:03:01.298" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:03:01.298" lastModifiedByUserLogin="admin"/>
+    <Product productId="GZ-1006" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Open Gizmo" internalName="Open Gizmo" description="Gizmo based on open standards" longDescription="Highest quality gizmo around." taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="Y" isVariant="N" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <Product productId="GZ-1006-1" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Open Gizmo (LGPL)" internalName="Open Gizmo (LGPL)" description="Gizmo based on open standards" longDescription="Highest quality gizmo around." taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="Y" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <Product productId="GZ-1006-2" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Open Gizmo (GPL)" internalName="Open Gizmo (GPL)" description="Gizmo based on open standards" longDescription="Highest quality gizmo around." taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="Y" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <Product productId="GZ-1006-3" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Open Gizmo (BSD)" internalName="Open Gizmo (BSD)" description="Gizmo based on open standards" longDescription="Highest quality gizmo around." taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="Y" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <Product productId="GZ-1006-4" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Open Gizmo (MIT)" internalName="Open Gizmo (MIT)" description="Gizmo based on open standards" longDescription="Highest quality gizmo around." taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="Y" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
 
-    <Product productId="GZ-2002" productTypeId="FINISHED_GOOD" primaryProductCategoryId="101" productName="Square Gizmo" internalName="Square Gizmo" description="A square gizmo" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2003-03-04 18:52:03.492" createdByUserLogin="admin" lastModifiedDate="2003-03-04 18:52:03.492" lastModifiedByUserLogin="admin"/>
+    <Product productId="GZ-DIG" productTypeId="DIGITAL_GOOD" primaryProductCategoryId="101" productName="Digital Gizmo" internalName="Digital Gizmo" description="A digital gizmo: can be downloaded immediately after purchase." longDescription="This gizmo is part of an exciting new breed that needs no corporeal form: it is all digital! Buy and download it now!" taxable="Y" chargeShipping="N" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <DataResource dataResourceId="GZ-DIG" dataResourceTypeId="OFBIZ_FILE_BIN" mimeTypeId="image/jpeg" dataResourceName="Digital Gizmo Image" objectInfo="framework/images/webapp/images/ofbiz_logo.jpg"/>
+    <Content contentId="GZ-DIG" contentTypeId="DOCUMENT" dataResourceId="GZ-DIG" mimeTypeId="image/jpeg" contentName="ofbiz_logo.jpg" description="Image of Digital Gizmo (actually the OFBiz logo)"/>
+    <ProductContent productId="GZ-DIG" contentId="GZ-DIG" productContentTypeId="DIGITAL_DOWNLOAD" fromDate="2001-05-13 12:00:00.0" useTime="3" useTimeUomId="TF_mon"/>
+    
+    <Product productId="GZ-2002" productTypeId="FINISHED_GOOD" primaryProductCategoryId="101" productName="Square Gizmo" internalName="Square Gizmo" description="A square gizmo" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
     <Product productId="GZ-2644" productTypeId="FINISHED_GOOD" primaryProductCategoryId="101" productName="Round Gizmo" internalName="Round Gizmo" description="Round Gizmo w/ Lights" longDescription="A small round gizmo with multi-colored lights. Works great in the dark. Small and compact." quantityIncluded="100.0" weight="7.0"/>
-    <Product productId="GZ-5005" productTypeId="FINISHED_GOOD" primaryProductCategoryId="101" productName="Purple Gizmo" internalName="Purple Gizmo" description="The stylish gizmo" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2003-03-04 19:05:51.323" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:05:51.323" lastModifiedByUserLogin="admin"/>
-    <Product productId="GZ-7000" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Massive Gizmo" internalName="Massive Gizmo" description="The biggest gizmo ever" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2003-03-04 19:11:58.441" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:11:58.441" lastModifiedByUserLogin="admin"/>
+    <Product productId="GZ-5005" productTypeId="FINISHED_GOOD" primaryProductCategoryId="101" productName="Purple Gizmo" internalName="Purple Gizmo" description="The stylish gizmo" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <Product productId="GZ-7000" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Massive Gizmo" internalName="Massive Gizmo" description="The biggest gizmo ever" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
     <Product productId="GZ-8544" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="Big Gizmo" internalName="Big Gizmo" description="Big Gizmo w/ Legs" longDescription="A large gizmo with legs. Walks on its own. Does not require a power supply." quantityIncluded="100.0" weight="12.0"/>
-    <Product productId="GZ-9290" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="His/Her Gizmo" internalName="His/Her Gizmo" description="A set of his/her gizmos" longDescription="The his/her gizmo is a perfect gift for your favorite couple. Once you try it out you&apos;ll want a set for yourself!" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2003-03-04 18:54:49.751" createdByUserLogin="admin" lastModifiedDate="2003-03-04 18:54:49.751" lastModifiedByUserLogin="admin"/>
+    <Product productId="GZ-9290" productTypeId="FINISHED_GOOD" primaryProductCategoryId="102" productName="His/Her Gizmo" internalName="His/Her Gizmo" description="A set of his/her gizmos" longDescription="The his/her gizmo is a perfect gift for your favorite couple. Once you try it out you&apos;ll want a set for yourself!" taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+
     <Product productId="WG-1111" productTypeId="FINISHED_GOOD" primaryProductCategoryId="20111" productName="Micro Chrome Widget" internalName="Micro Chrome Widget" description="Micro Widget - Chrome Colored" longDescription="This micro chrome widget makes a perfect gift. This one is so small that it floats in air." quantityIncluded="50.0" weight="2.0"/>
     <Product productId="WG-5569" productTypeId="FINISHED_GOOD" primaryProductCategoryId="201" productName="Tiny Chrome Widget" internalName="Tiny Chrome Widget" description="Tiny Chrome Widget" longDescription="This tiny chrome widget makes a perfect gift. The shine will last forever. No pollishing required." quantityIncluded="50.0" weight="4.0"/>
     <Product productId="WG-9943" productTypeId="FINISHED_GOOD" primaryProductCategoryId="202" productName="Giant Widget" internalName="Giant Widget" description="Giant Widget with Wheels" longDescription="This giant widget is mobile. It will seat one person safely. The wheels will never rust or break. Quite a unique item." quantityIncluded="10.0" weight="22.0" isVirtual="Y"/>
@@ -155,28 +161,30 @@
     <Product productId="WG-9943-S3" productTypeId="FINISHED_GOOD" primaryProductCategoryId="202" productName="Giant Widget S3" internalName="Giant Widget S3" description="Silver Giant Widget with 3 Wheels" longDescription="This giant widget is mobile. It will seat one person safely. The wheels will never rust or break. Quite a unique item." quantityIncluded="10.0" weight="22.0" isVariant="Y"/>
     <Product productId="WG-9943-S4" productTypeId="FINISHED_GOOD" primaryProductCategoryId="202" productName="Giant Widget S4" internalName="Giant Widget S4" description="Silver Giant Widget with 4 Wheels" longDescription="This giant widget is mobile. It will seat one person safely. The wheels will never rust or break. Quite a unique item." quantityIncluded="10.0" weight="22.0" isVariant="Y"/>
 
-    <ProductPrice productId="GZ-1000" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:49:03.163" price="15.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1000" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:48:49.113" price="15.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1001" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:57:38.033" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1001" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:57:29.421" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1004" productPricePurposeId="PURCHASE" productPriceTypeId="AVERAGE_COST" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:50:35.866" price="29.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1004" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:50:45.25" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1005" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:00:47.616" price="2799.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1005" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:00:32.034" price="2799.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1006" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:03:12.745" price="1.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1006" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:03:03.151" price="5.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-2002" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:52:45.463" price="47.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-2002" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:52:37.181" price="48.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1000" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="15.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1000" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="15.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1001" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1001" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1004" productPricePurposeId="PURCHASE" productPriceTypeId="AVERAGE_COST" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="29.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1004" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1005" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="2799.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1005" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="2799.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1006" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="1.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1006" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="5.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-2002" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="47.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-2002" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="48.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
     <ProductPrice productId="GZ-2644" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="47.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
     <ProductPrice productId="GZ-2644" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="48.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-5005" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:06:07.516" price="47.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:06:17.991" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-5005" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:05:56.39" price="48.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:06:07.286" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-7000" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:12:00.424" price="599.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:12:08.765" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-7000" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:12:09.006" price="999.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:12:22.736" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-5005" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="47.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:06:17.991" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-5005" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="48.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:06:07.286" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-7000" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="599.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:12:08.765" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-7000" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="999.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:12:22.736" lastModifiedByUserLogin="admin"/>
     <ProductPrice productId="GZ-8544" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="269.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
     <ProductPrice productId="GZ-8544" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="270.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-9290" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:55:00.196" price="97.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-9290" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:54:52.065" price="99.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-9290" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="97.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-9290" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="99.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-DIG" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="55.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-DIG" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="80.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
     <ProductPrice productId="WG-1111" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="59.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
     <ProductPrice productId="WG-1111" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="60.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
     <ProductPrice productId="WG-5569" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="59.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
@@ -295,11 +303,13 @@
     <ProductCategoryMember productCategoryId="100" productId="GZ-7000" fromDate="2001-05-13 12:00:00.0"/>
     <ProductCategoryMember productCategoryId="100" productId="GZ-8544" fromDate="2001-05-13 12:00:00.0"/>
     <ProductCategoryMember productCategoryId="100" productId="GZ-9290" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductCategoryMember productCategoryId="100" productId="GZ-DIG" fromDate="2001-05-13 12:00:00.0"/>
     <ProductCategoryMember productCategoryId="101" productId="GZ-1000" fromDate="2001-05-13 12:00:00.0"/>
     <ProductCategoryMember productCategoryId="101" productId="GZ-1001" fromDate="2001-05-13 12:00:00.0"/>
     <ProductCategoryMember productCategoryId="101" productId="GZ-2002" fromDate="2001-05-13 12:00:00.0"/>
     <ProductCategoryMember productCategoryId="101" productId="GZ-2644" fromDate="2001-05-13 12:00:00.0"/>
     <ProductCategoryMember productCategoryId="101" productId="GZ-5005" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductCategoryMember productCategoryId="101" productId="GZ-DIG" fromDate="2001-05-13 12:00:00.0"/>
     <ProductCategoryMember productCategoryId="102" productId="GZ-1004" fromDate="2001-05-13 12:00:00.0"/>
     <ProductCategoryMember productCategoryId="102" productId="GZ-1005" fromDate="2001-05-13 12:00:00.0"/>
     <ProductCategoryMember productCategoryId="102" productId="GZ-1006" fromDate="2001-05-13 12:00:00.0"/>
@@ -637,5 +647,4 @@
 
     <ProductCategoryMember productCategoryId="100" productId="GZ-KIT" fromDate="2001-05-13 12:00:00.0"/>
     <ProductCategoryMember productCategoryId="100" productId="GZ-BASKET" fromDate="2001-05-13 12:00:00.0"/>
-    
 </entity-engine-xml>

Modified: trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
===================================================================
--- trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml	2006-03-08 03:56:27 UTC (rev 6944)
+++ trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml	2006-03-08 08:51:13 UTC (rev 6945)
@@ -687,6 +687,13 @@
         <response name="error" type="view" value="orderstatus"/>
     </request-map>
 
+    <request-map uri="downloadDigitalProduct">
+        <security auth="true" https="true"/>
+        <event type="java" path="org.ofbiz.order.order.OrderEvents" invoke="downloadDigitalProduct"/>
+        <response name="success" type="none"/>
+        <response name="error" type="view" value="orderhistory"/>
+    </request-map>
+    
     <request-map uri="makeReturn">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="requestreturn"/>

Modified: trunk/applications/order/entitydef/entitygroup.xml
===================================================================
--- trunk/applications/order/entitydef/entitygroup.xml	2006-03-08 03:56:27 UTC (rev 6944)
+++ trunk/applications/order/entitydef/entitygroup.xml	2006-03-08 08:51:13 UTC (rev 6945)
@@ -52,6 +52,7 @@
     <entity-group group="org.ofbiz" entity="OrderHeaderNoteView" />
     <entity-group group="org.ofbiz" entity="OrderHeaderWorkEffort" />
     <entity-group group="org.ofbiz" entity="OrderItem" />
+    <entity-group group="org.ofbiz" entity="OrderItemAndProductContentInfo" />
     <entity-group group="org.ofbiz" entity="OrderItemAndShipGroupAssoc" />
     <entity-group group="org.ofbiz" entity="OrderItemAndShipGrpInvResAndItem" />
     <entity-group group="org.ofbiz" entity="OrderItemAssociation" />

Modified: trunk/applications/order/entitydef/entitymodel_view.xml
===================================================================
--- trunk/applications/order/entitydef/entitymodel_view.xml	2006-03-08 03:56:27 UTC (rev 6944)
+++ trunk/applications/order/entitydef/entitymodel_view.xml	2006-03-08 08:51:13 UTC (rev 6945)
@@ -592,6 +592,30 @@
         <key-map field-name="noteId"/>
       </view-link>
     </view-entity>
+    <view-entity entity-name="OrderItemAndProductContentInfo"
+        package-name="org.ofbiz.order.order"
+        title="OrderItem And ProductContent Info View Entity">
+        <member-entity entity-alias="OR" entity-name="OrderRole"/>
+        <member-entity entity-alias="OI" entity-name="OrderItem"/>
+        <member-entity entity-alias="PC" entity-name="ProductContent"/>
+        <member-entity entity-alias="CNT" entity-name="Content"/>
+        <alias-all entity-alias="OR"/>
+        <alias-all entity-alias="OI"/>
+        <alias-all entity-alias="PC"/>
+        <alias-all entity-alias="CNT"/>
+        <view-link entity-alias="OR" rel-entity-alias="OI">
+            <key-map field-name="orderId"/>
+        </view-link>
+        <view-link entity-alias="OI" rel-entity-alias="PC">
+            <key-map field-name="productId"/>
+        </view-link>
+        <view-link entity-alias="PC" rel-entity-alias="CNT">
+            <key-map field-name="contentId"/>
+        </view-link>
+        <relation type="one-nofk" rel-entity-name="Product">
+            <key-map field-name="productId"/>
+        </relation>
+    </view-entity>
     <view-entity entity-name="OrderItemAndShipGroupAssoc"
             package-name="org.ofbiz.order.order"
             never-cache="true"

Added: trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java
===================================================================
--- trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java	2006-03-08 03:56:27 UTC (rev 6944)
+++ trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java	2006-03-08 08:51:13 UTC (rev 6945)
@@ -0,0 +1,93 @@
+/*
+ * $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.
+ */
+package org.ofbiz.order.order;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.base.util.UtilHttp;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.content.data.DataResourceWorker;
+import org.ofbiz.entity.GenericDelegator;
+import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.GenericValue;
+
+/**
+ * Order Events
+ *
+ * @author <a href="mailto:jonesde at ofbiz.org">David E. Jones</a>
+ */
+public class OrderEvents {
+
+    public static final String module = OrderEvents.class.getName();
+
+    public static String downloadDigitalProduct(HttpServletRequest request, HttpServletResponse response) {
+    	HttpSession session = request.getSession();
+    	ServletContext application = session.getServletContext();
+    	GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
+    	GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
+    	String dataResourceId = request.getParameter("dataResourceId");
+    	
+    	try {
+			// has the userLogin.partyId ordered a product with DIGITAL_DOWNLOAD content associated for the given dataResourceId?
+			List orderItemAndProductContentInfoList = delegator.findByAnd("OrderItemAndProductContentInfo", 
+					UtilMisc.toMap("partyId", userLogin.get("partyId"), "dataResourceId", dataResourceId, "productContentTypeId", "DIGITAL_DOWNLOAD"));
+			
+			if (orderItemAndProductContentInfoList.size() == 0) {
+				request.setAttribute("_ERROR_MESSAGE_", "No record of purchase for digital download found (dataResourceId=[" + dataResourceId + "]).");
+				return "error";
+			}
+			
+			GenericValue orderItemAndProductContentInfo = (GenericValue) orderItemAndProductContentInfoList.get(0);
+			
+	    	// TODO: check validity based on ProductContent fields: useCountLimit, useTime/useTimeUomId
+	    	
+			if (orderItemAndProductContentInfo.getString("mimeTypeId") != null) {
+				response.setContentType(orderItemAndProductContentInfo.getString("mimeTypeId"));
+			}
+			OutputStream os = response.getOutputStream();
+			DataResourceWorker.streamDataResource(os, delegator, dataResourceId, "", application.getInitParameter("webSiteId"), UtilHttp.getLocale(request), application.getRealPath("/"));
+			os.flush();
+		} catch (GenericEntityException e) {
+			String errMsg = "Error downloading digital product content: " + e.toString();
+			Debug.logError(e, errMsg, module);
+			request.setAttribute("_ERROR_MESSAGE_", errMsg);
+			return "error";
+		} catch (GeneralException e) {
+			String errMsg = "Error downloading digital product content: " + e.toString();
+			Debug.logError(e, errMsg, module);
+			request.setAttribute("_ERROR_MESSAGE_", errMsg);
+			return "error";
+		} catch (IOException e) {
+			String errMsg = "Error downloading digital product content: " + e.toString();
+			Debug.logError(e, errMsg, module);
+			request.setAttribute("_ERROR_MESSAGE_", errMsg);
+			return "error";
+		}
+    	
+        return "success";
+    }
+}


Property changes on: trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + "Id Rev Author"
Name: svn:eol-style
   + native

Modified: trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productdetail.bsh
===================================================================
--- trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productdetail.bsh	2006-03-08 03:56:27 UTC (rev 6944)
+++ trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productdetail.bsh	2006-03-08 08:51:13 UTC (rev 6945)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2003-2005 The Open For Business Project - www.ofbiz.org
+ *  Copyright (c) 2003-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"), 
@@ -431,6 +431,9 @@
         }
     }
     
-    // not the best to save info in an action, but this is probably the best place to count a view
+    // get the DIGITAL_DOWNLOAD related Content records to show the contentName/description
+    downloadProductContentAndInfoList = delegator.findByAnd("ProductContentAndInfo", UtilMisc.toMap("productId", productId, "productContentTypeId, "DIGITAL_DOWNLOAD"));
+    
+    // not the best to save info in an action, but this is probably the best place to count a view; it is done async
     dispatcher.runAsync("countProductView", UtilMisc.toMap("productId", productId, "weight", new Long(1)), false);
 }

Modified: trunk/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl
===================================================================
--- trunk/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl	2006-03-08 03:56:27 UTC (rev 6944)
+++ trunk/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl	2006-03-08 08:51:13 UTC (rev 6945)
@@ -1,5 +1,5 @@
 <#--
- *  Copyright (c) 2003-2005 The Open For Business Project - www.ofbiz.org
+ *  Copyright (c) 2003-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"),
@@ -500,6 +500,16 @@
   </tr>
 </table>
 
+  <#-- Digital Download Files Associated with this Product -->
+  <#if downloadProductContentAndInfoList?has_content>
+    <div id="download-files">
+      <div class="tableheadtext">${uiLabelMap.EcommerceDownloadFilesTitle}:</div>
+      <#list downloadProductContentAndInfoList as downloadProductContentAndInfo>
+        <div class="tableheadtext">${downloadProductContentAndInfo.contentName}<#if downloadProductContentAndInfo.description?has_content> - ${downloadProductContentAndInfo.description}</#if></div>
+      </#list>
+    </div>
+  </#if>
+
   <#-- Long description of product -->
   <div id="long-description">
       <div class="tabletext">${productContentWrapper.get("LONG_DESCRIPTION")?if_exists}</div>

Modified: trunk/framework/images/webapp/images/ecommain.css
===================================================================
--- trunk/framework/images/webapp/images/ecommain.css	2006-03-08 03:56:27 UTC (rev 6944)
+++ trunk/framework/images/webapp/images/ecommain.css	2006-03-08 08:51:13 UTC (rev 6945)
@@ -872,6 +872,12 @@
 }
 
 /* ===== Product Detail Styles ===== */
+#productdetail #download-files {
+margin-top: 10px;
+padding-top: 5px;
+border-top: #999 solid 1px;
+}
+
 #productdetail #long-description {
 margin-top: 10px;
 padding-top: 5px;



More information about the Svn mailing list