Hi,
I have an excel sheet with some 500 products, each with a price and image url. Is there a typical process for importing the product database to maintain the price and image associations correctly? Thanks Tom |
http://mail-archives.apache.org/mod_mbox/ofbiz-user/200610.mbox/%3C4524BDE9.1040901@...%3E
-Adrian On 1/1/2012 6:19 PM, Tom wrote: > Hi, > > I have an excel sheet with some 500 products, each with a price and > image url. > > Is there a typical process for importing the product database to > maintain the price and image associations correctly? > > Thanks > Tom |
In reply to this post by Tom-2
Here is another reference:
https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data See "Use the OFBiz's Data File Tools to read you Cvs in" for (maybe) an easy way of mapping entities. I've never tried the above, even so, you'll STILL need to become intimately familiar with ofbiz's product-related entities to properly create the maps, or do it the manual way (below). You have to turn each line into separate ofbiz entities: Here they are, in sequence, for the following example: https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductCategory https://demo-trunk.ofbiz.apache.org/webtools/control/FindGeneric?entityName=ProductCategoryRollup https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=Product https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductCategoryMember https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductPrice There ARE more.. For instance you want to create variant products, or products/categories/descriptions in multiple languages. To do this advanced stuff, there is no way around this. Yes, it can get very complex. Here would be ONE simple product (including category and price, which are separate entities) File: specialpurpose/ecommerce/data/TestProduct.xml -------------------------------------------------------------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <entity-engine-xml> <!-- BEGIN OF RECORD --> <ProductCategory description="DropShip Products" primaryParentCategoryId="CATALOG1" productCategoryId="dropShip" productCategoryTypeId="CATALOG_CATEGORY"/> <ProductCategoryRollup fromDate="2001-05-13 12:00:00.0" parentProductCategoryId="CATALOG1" productCategoryId="dropShip"/> <Product productId="dropShip1" productTypeId="FINISHED_GOOD" internalName="DropShip from DemoSupplier" productName="DropShip from DemoSupplier" smallImageUrl="/images/products/dropShip1/small.jpg" mediumImageUrl="/images/products/dropShip1/medium.jpg" largeImageUrl="/images/products/dropShip1/large.jpg" isVirtual="N" isVariant="N" requirementMethodEnumId="PRODRQM_DS" billOfMaterialLevel="0" createdDate="2007-05-05 14:50:58.584" createdByUserLogin="admin" lastModifiedDate="2007-05-05 15:05:41.62" lastModifiedByUserLogin="admin" inShippingBox="N" lastUpdatedStamp="2007-05-06 15:02:03.466" lastUpdatedTxStamp="2007-05-06 15:02:02.465" createdStamp="2007-05-05 14:50:58.586" createdTxStamp="2007-05-05 14:50:58.21"/> <ProductCategoryMember productCategoryId="dropShip" productId="dropShip1" sequenceNum="1" fromDate="2001-05-13 12:00:00.0"/> <ProductPrice productId="dropShip1" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="13.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/> <!-- NOW REPEAT FOR EACH PRODUCT --> </entity-engine-xml> -------------------------------------------------------------------------------------------------------------------- Save as a file, then manually test the import (ofbiz can be running), like this: ./ant run-install-file -Ddata-file=specialpurpose/ecommerce/data/TestProduct.xml Look for errors and correct: If you want to add additional fields, just look at the entity (i.e. Product), and add the field: description="whatever" There is no shortcut around this. Eventually, you'll need to import other types of data, and this is the only bullet proof way to do it. You have to become familiar with the data structure, so it is important to carefully study the demo data. Sequence is everything, For the above product, you must pre-defne the category first, then rollup, then product, product_category_member, then price. If you define one before the other, an error will occur. To do this on a mass scale, a little (or a lot) programming (perl/other) expertise is helpful. On Sun, Jan 1, 2012 at 10:19 AM, Tom <[hidden email]> wrote: > Hi, > > I have an excel sheet with some 500 products, each with a price and image > url. > > Is there a typical process for importing the product database to maintain > the price and image associations correctly? > > Thanks > Tom |
From my perspective, it is easier to import the CSV data into a
temporary entity that mirrors the CSV file structure. Then I write a service in mini-language to read the temporary entity and process the data it contains. Categories, products and prices can be generated with just a few lines of mini-language code. -Adrian On 1/1/2012 10:07 PM, Mike wrote: > Here is another reference: > > https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data > > See "Use the OFBiz's Data File Tools to read you Cvs in" for (maybe) > an easy way of mapping entities. > > I've never tried the above, even so, you'll STILL need to become > intimately familiar with ofbiz's product-related entities to properly > create the maps, or do it the manual way (below). > > You have to turn each line into separate ofbiz entities: Here they > are, in sequence, for the following example: > > https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductCategory > https://demo-trunk.ofbiz.apache.org/webtools/control/FindGeneric?entityName=ProductCategoryRollup > https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=Product > https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductCategoryMember > https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductPrice > > There ARE more.. For instance you want to create variant products, or > products/categories/descriptions in multiple languages. To do this > advanced stuff, there is no way around this. Yes, it can get very > complex. > > Here would be ONE simple product (including category and price, which > are separate entities) > > File: specialpurpose/ecommerce/data/TestProduct.xml > -------------------------------------------------------------------------------------------------------------------- > <?xml version="1.0" encoding="UTF-8"?> > <entity-engine-xml> > > <!-- BEGIN OF RECORD --> > <ProductCategory description="DropShip Products" > primaryParentCategoryId="CATALOG1" productCategoryId="dropShip" > productCategoryTypeId="CATALOG_CATEGORY"/> > > <ProductCategoryRollup fromDate="2001-05-13 12:00:00.0" > parentProductCategoryId="CATALOG1" productCategoryId="dropShip"/> > > <Product productId="dropShip1" productTypeId="FINISHED_GOOD" > internalName="DropShip from DemoSupplier" productName="DropShip from > DemoSupplier" smallImageUrl="/images/products/dropShip1/small.jpg" > mediumImageUrl="/images/products/dropShip1/medium.jpg" > largeImageUrl="/images/products/dropShip1/large.jpg" isVirtual="N" > isVariant="N" requirementMethodEnumId="PRODRQM_DS" > billOfMaterialLevel="0" createdDate="2007-05-05 14:50:58.584" > createdByUserLogin="admin" lastModifiedDate="2007-05-05 15:05:41.62" > lastModifiedByUserLogin="admin" inShippingBox="N" > lastUpdatedStamp="2007-05-06 15:02:03.466" > lastUpdatedTxStamp="2007-05-06 15:02:02.465" createdStamp="2007-05-05 > 14:50:58.586" createdTxStamp="2007-05-05 14:50:58.21"/> > > <ProductCategoryMember productCategoryId="dropShip" > productId="dropShip1" sequenceNum="1" fromDate="2001-05-13 > 12:00:00.0"/> > > <ProductPrice productId="dropShip1" > productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" > currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 > 12:00:00.0" price="13.99" createdDate="2001-05-13 12:00:00.0" > createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" > lastModifiedByUserLogin="admin"/> > > <!-- NOW REPEAT FOR EACH PRODUCT --> > > </entity-engine-xml> > -------------------------------------------------------------------------------------------------------------------- > > Save as a file, then manually test the import (ofbiz can be running), like this: > > ./ant run-install-file -Ddata-file=specialpurpose/ecommerce/data/TestProduct.xml > > Look for errors and correct: > > If you want to add additional fields, just look at the entity (i.e. > Product), and add the field: description="whatever" > > There is no shortcut around this. Eventually, you'll need to import > other types of data, and this is the only bullet proof way to do it. > You have to become familiar with the data structure, so it is > important to carefully study the demo data. Sequence is everything, > For the above product, you must pre-defne the category first, then > rollup, then product, product_category_member, then price. If you > define one before the other, an error will occur. > > To do this on a mass scale, a little (or a lot) programming > (perl/other) expertise is helpful. > > On Sun, Jan 1, 2012 at 10:19 AM, Tom<[hidden email]> wrote: >> Hi, >> >> I have an excel sheet with some 500 products, each with a price and image >> url. >> >> Is there a typical process for importing the product database to maintain >> the price and image associations correctly? >> >> Thanks >> Tom |
Sounds like a great plan Adrian. Would it be possible to post a
working example? Never too old to learn new tricks [grin]. On Sun, Jan 1, 2012 at 2:13 PM, Adrian Crum <[hidden email]> wrote: > From my perspective, it is easier to import the CSV data into a temporary > entity that mirrors the CSV file structure. Then I write a service in > mini-language to read the temporary entity and process the data it contains. > Categories, products and prices can be generated with just a few lines of > mini-language code. > > -Adrian > > > On 1/1/2012 10:07 PM, Mike wrote: >> >> Here is another reference: >> >> >> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data >> >> See "Use the OFBiz's Data File Tools to read you Cvs in" for (maybe) >> an easy way of mapping entities. >> >> I've never tried the above, even so, you'll STILL need to become >> intimately familiar with ofbiz's product-related entities to properly >> create the maps, or do it the manual way (below). >> >> You have to turn each line into separate ofbiz entities: Here they >> are, in sequence, for the following example: >> >> >> https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductCategory >> >> https://demo-trunk.ofbiz.apache.org/webtools/control/FindGeneric?entityName=ProductCategoryRollup >> >> https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=Product >> >> https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductCategoryMember >> >> https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductPrice >> >> There ARE more.. For instance you want to create variant products, or >> products/categories/descriptions in multiple languages. To do this >> advanced stuff, there is no way around this. Yes, it can get very >> complex. >> >> Here would be ONE simple product (including category and price, which >> are separate entities) >> >> File: specialpurpose/ecommerce/data/TestProduct.xml >> >> -------------------------------------------------------------------------------------------------------------------- >> <?xml version="1.0" encoding="UTF-8"?> >> <entity-engine-xml> >> >> <!-- BEGIN OF RECORD --> >> <ProductCategory description="DropShip Products" >> primaryParentCategoryId="CATALOG1" productCategoryId="dropShip" >> productCategoryTypeId="CATALOG_CATEGORY"/> >> >> <ProductCategoryRollup fromDate="2001-05-13 12:00:00.0" >> parentProductCategoryId="CATALOG1" productCategoryId="dropShip"/> >> >> <Product productId="dropShip1" productTypeId="FINISHED_GOOD" >> internalName="DropShip from DemoSupplier" productName="DropShip from >> DemoSupplier" smallImageUrl="/images/products/dropShip1/small.jpg" >> mediumImageUrl="/images/products/dropShip1/medium.jpg" >> largeImageUrl="/images/products/dropShip1/large.jpg" isVirtual="N" >> isVariant="N" requirementMethodEnumId="PRODRQM_DS" >> billOfMaterialLevel="0" createdDate="2007-05-05 14:50:58.584" >> createdByUserLogin="admin" lastModifiedDate="2007-05-05 15:05:41.62" >> lastModifiedByUserLogin="admin" inShippingBox="N" >> lastUpdatedStamp="2007-05-06 15:02:03.466" >> lastUpdatedTxStamp="2007-05-06 15:02:02.465" createdStamp="2007-05-05 >> 14:50:58.586" createdTxStamp="2007-05-05 14:50:58.21"/> >> >> <ProductCategoryMember productCategoryId="dropShip" >> productId="dropShip1" sequenceNum="1" fromDate="2001-05-13 >> 12:00:00.0"/> >> >> <ProductPrice productId="dropShip1" >> productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" >> currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 >> 12:00:00.0" price="13.99" createdDate="2001-05-13 12:00:00.0" >> createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" >> lastModifiedByUserLogin="admin"/> >> >> <!-- NOW REPEAT FOR EACH PRODUCT --> >> >> </entity-engine-xml> >> >> -------------------------------------------------------------------------------------------------------------------- >> >> Save as a file, then manually test the import (ofbiz can be running), like >> this: >> >> ./ant run-install-file >> -Ddata-file=specialpurpose/ecommerce/data/TestProduct.xml >> >> Look for errors and correct: >> >> If you want to add additional fields, just look at the entity (i.e. >> Product), and add the field: description="whatever" >> >> There is no shortcut around this. Eventually, you'll need to import >> other types of data, and this is the only bullet proof way to do it. >> You have to become familiar with the data structure, so it is >> important to carefully study the demo data. Sequence is everything, >> For the above product, you must pre-defne the category first, then >> rollup, then product, product_category_member, then price. If you >> define one before the other, an error will occur. >> >> To do this on a mass scale, a little (or a lot) programming >> (perl/other) expertise is helpful. >> >> On Sun, Jan 1, 2012 at 10:19 AM, Tom<[hidden email]> wrote: >>> >>> Hi, >>> >>> I have an excel sheet with some 500 products, each with a price and image >>> url. >>> >>> Is there a typical process for importing the product database to maintain >>> the price and image associations correctly? >>> >>> Thanks >>> Tom |
I use that process to integrate client legacy systems with OFBiz, and
NDAs prevent me from posting any of it. I could create a generic example if I had time. -Adrian On 1/2/2012 12:13 AM, Mike wrote: > Sounds like a great plan Adrian. Would it be possible to post a > working example? Never too old to learn new tricks [grin]. > > On Sun, Jan 1, 2012 at 2:13 PM, Adrian Crum > <[hidden email]> wrote: >> From my perspective, it is easier to import the CSV data into a temporary >> entity that mirrors the CSV file structure. Then I write a service in >> mini-language to read the temporary entity and process the data it contains. >> Categories, products and prices can be generated with just a few lines of >> mini-language code. >> >> -Adrian >> >> >> On 1/1/2012 10:07 PM, Mike wrote: >>> Here is another reference: >>> >>> >>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data >>> >>> See "Use the OFBiz's Data File Tools to read you Cvs in" for (maybe) >>> an easy way of mapping entities. >>> >>> I've never tried the above, even so, you'll STILL need to become >>> intimately familiar with ofbiz's product-related entities to properly >>> create the maps, or do it the manual way (below). >>> >>> You have to turn each line into separate ofbiz entities: Here they >>> are, in sequence, for the following example: >>> >>> >>> https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductCategory >>> >>> https://demo-trunk.ofbiz.apache.org/webtools/control/FindGeneric?entityName=ProductCategoryRollup >>> >>> https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=Product >>> >>> https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductCategoryMember >>> >>> https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductPrice >>> >>> There ARE more.. For instance you want to create variant products, or >>> products/categories/descriptions in multiple languages. To do this >>> advanced stuff, there is no way around this. Yes, it can get very >>> complex. >>> >>> Here would be ONE simple product (including category and price, which >>> are separate entities) >>> >>> File: specialpurpose/ecommerce/data/TestProduct.xml >>> >>> -------------------------------------------------------------------------------------------------------------------- >>> <?xml version="1.0" encoding="UTF-8"?> >>> <entity-engine-xml> >>> >>> <!-- BEGIN OF RECORD --> >>> <ProductCategory description="DropShip Products" >>> primaryParentCategoryId="CATALOG1" productCategoryId="dropShip" >>> productCategoryTypeId="CATALOG_CATEGORY"/> >>> >>> <ProductCategoryRollup fromDate="2001-05-13 12:00:00.0" >>> parentProductCategoryId="CATALOG1" productCategoryId="dropShip"/> >>> >>> <Product productId="dropShip1" productTypeId="FINISHED_GOOD" >>> internalName="DropShip from DemoSupplier" productName="DropShip from >>> DemoSupplier" smallImageUrl="/images/products/dropShip1/small.jpg" >>> mediumImageUrl="/images/products/dropShip1/medium.jpg" >>> largeImageUrl="/images/products/dropShip1/large.jpg" isVirtual="N" >>> isVariant="N" requirementMethodEnumId="PRODRQM_DS" >>> billOfMaterialLevel="0" createdDate="2007-05-05 14:50:58.584" >>> createdByUserLogin="admin" lastModifiedDate="2007-05-05 15:05:41.62" >>> lastModifiedByUserLogin="admin" inShippingBox="N" >>> lastUpdatedStamp="2007-05-06 15:02:03.466" >>> lastUpdatedTxStamp="2007-05-06 15:02:02.465" createdStamp="2007-05-05 >>> 14:50:58.586" createdTxStamp="2007-05-05 14:50:58.21"/> >>> >>> <ProductCategoryMember productCategoryId="dropShip" >>> productId="dropShip1" sequenceNum="1" fromDate="2001-05-13 >>> 12:00:00.0"/> >>> >>> <ProductPrice productId="dropShip1" >>> productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" >>> currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 >>> 12:00:00.0" price="13.99" createdDate="2001-05-13 12:00:00.0" >>> createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" >>> lastModifiedByUserLogin="admin"/> >>> >>> <!-- NOW REPEAT FOR EACH PRODUCT --> >>> >>> </entity-engine-xml> >>> >>> -------------------------------------------------------------------------------------------------------------------- >>> >>> Save as a file, then manually test the import (ofbiz can be running), like >>> this: >>> >>> ./ant run-install-file >>> -Ddata-file=specialpurpose/ecommerce/data/TestProduct.xml >>> >>> Look for errors and correct: >>> >>> If you want to add additional fields, just look at the entity (i.e. >>> Product), and add the field: description="whatever" >>> >>> There is no shortcut around this. Eventually, you'll need to import >>> other types of data, and this is the only bullet proof way to do it. >>> You have to become familiar with the data structure, so it is >>> important to carefully study the demo data. Sequence is everything, >>> For the above product, you must pre-defne the category first, then >>> rollup, then product, product_category_member, then price. If you >>> define one before the other, an error will occur. >>> >>> To do this on a mass scale, a little (or a lot) programming >>> (perl/other) expertise is helpful. >>> >>> On Sun, Jan 1, 2012 at 10:19 AM, Tom<[hidden email]> wrote: >>>> Hi, >>>> >>>> I have an excel sheet with some 500 products, each with a price and image >>>> url. >>>> >>>> Is there a typical process for importing the product database to maintain >>>> the price and image associations correctly? >>>> >>>> Thanks >>>> Tom |
Hi Mike:
I did a section on how to do something like this for the OFBiz Cookbook, but I don't think it ever made it into the final version. Contact me directly and I'll send you a copy of what I wrote. [hidden email] Best Regards and Happy New Year. Ruth Hoffman On 1/1/12 7:19 PM, Adrian Crum wrote: > I use that process to integrate client legacy systems with OFBiz, and > NDAs prevent me from posting any of it. I could create a generic > example if I had time. > > -Adrian > > On 1/2/2012 12:13 AM, Mike wrote: >> Sounds like a great plan Adrian. Would it be possible to post a >> working example? Never too old to learn new tricks [grin]. >> >> On Sun, Jan 1, 2012 at 2:13 PM, Adrian Crum >> <[hidden email]> wrote: >>> From my perspective, it is easier to import the CSV data into a >>> temporary >>> entity that mirrors the CSV file structure. Then I write a service in >>> mini-language to read the temporary entity and process the data it >>> contains. >>> Categories, products and prices can be generated with just a few >>> lines of >>> mini-language code. >>> >>> -Adrian >>> >>> >>> On 1/1/2012 10:07 PM, Mike wrote: >>>> Here is another reference: >>>> >>>> >>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data >>>> >>>> >>>> See "Use the OFBiz's Data File Tools to read you Cvs in" for (maybe) >>>> an easy way of mapping entities. >>>> >>>> I've never tried the above, even so, you'll STILL need to become >>>> intimately familiar with ofbiz's product-related entities to properly >>>> create the maps, or do it the manual way (below). >>>> >>>> You have to turn each line into separate ofbiz entities: Here they >>>> are, in sequence, for the following example: >>>> >>>> >>>> https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductCategory >>>> >>>> >>>> https://demo-trunk.ofbiz.apache.org/webtools/control/FindGeneric?entityName=ProductCategoryRollup >>>> >>>> >>>> https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=Product >>>> >>>> >>>> https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductCategoryMember >>>> >>>> >>>> https://demo-trunk.ofbiz.apache.org/webtools/control/ViewGeneric?entityName=ProductPrice >>>> >>>> >>>> There ARE more.. For instance you want to create variant products, or >>>> products/categories/descriptions in multiple languages. To do this >>>> advanced stuff, there is no way around this. Yes, it can get very >>>> complex. >>>> >>>> Here would be ONE simple product (including category and price, which >>>> are separate entities) >>>> >>>> File: specialpurpose/ecommerce/data/TestProduct.xml >>>> >>>> -------------------------------------------------------------------------------------------------------------------- >>>> >>>> <?xml version="1.0" encoding="UTF-8"?> >>>> <entity-engine-xml> >>>> >>>> <!-- BEGIN OF RECORD --> >>>> <ProductCategory description="DropShip Products" >>>> primaryParentCategoryId="CATALOG1" productCategoryId="dropShip" >>>> productCategoryTypeId="CATALOG_CATEGORY"/> >>>> >>>> <ProductCategoryRollup fromDate="2001-05-13 12:00:00.0" >>>> parentProductCategoryId="CATALOG1" productCategoryId="dropShip"/> >>>> >>>> <Product productId="dropShip1" productTypeId="FINISHED_GOOD" >>>> internalName="DropShip from DemoSupplier" productName="DropShip from >>>> DemoSupplier" smallImageUrl="/images/products/dropShip1/small.jpg" >>>> mediumImageUrl="/images/products/dropShip1/medium.jpg" >>>> largeImageUrl="/images/products/dropShip1/large.jpg" isVirtual="N" >>>> isVariant="N" requirementMethodEnumId="PRODRQM_DS" >>>> billOfMaterialLevel="0" createdDate="2007-05-05 14:50:58.584" >>>> createdByUserLogin="admin" lastModifiedDate="2007-05-05 15:05:41.62" >>>> lastModifiedByUserLogin="admin" inShippingBox="N" >>>> lastUpdatedStamp="2007-05-06 15:02:03.466" >>>> lastUpdatedTxStamp="2007-05-06 15:02:02.465" createdStamp="2007-05-05 >>>> 14:50:58.586" createdTxStamp="2007-05-05 14:50:58.21"/> >>>> >>>> <ProductCategoryMember productCategoryId="dropShip" >>>> productId="dropShip1" sequenceNum="1" fromDate="2001-05-13 >>>> 12:00:00.0"/> >>>> >>>> <ProductPrice productId="dropShip1" >>>> productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" >>>> currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 >>>> 12:00:00.0" price="13.99" createdDate="2001-05-13 12:00:00.0" >>>> createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" >>>> lastModifiedByUserLogin="admin"/> >>>> >>>> <!-- NOW REPEAT FOR EACH PRODUCT --> >>>> >>>> </entity-engine-xml> >>>> >>>> -------------------------------------------------------------------------------------------------------------------- >>>> >>>> >>>> Save as a file, then manually test the import (ofbiz can be >>>> running), like >>>> this: >>>> >>>> ./ant run-install-file >>>> -Ddata-file=specialpurpose/ecommerce/data/TestProduct.xml >>>> >>>> Look for errors and correct: >>>> >>>> If you want to add additional fields, just look at the entity (i.e. >>>> Product), and add the field: description="whatever" >>>> >>>> There is no shortcut around this. Eventually, you'll need to import >>>> other types of data, and this is the only bullet proof way to do it. >>>> You have to become familiar with the data structure, so it is >>>> important to carefully study the demo data. Sequence is everything, >>>> For the above product, you must pre-defne the category first, then >>>> rollup, then product, product_category_member, then price. If you >>>> define one before the other, an error will occur. >>>> >>>> To do this on a mass scale, a little (or a lot) programming >>>> (perl/other) expertise is helpful. >>>> >>>> On Sun, Jan 1, 2012 at 10:19 AM, Tom<[hidden email]> wrote: >>>>> Hi, >>>>> >>>>> I have an excel sheet with some 500 products, each with a price >>>>> and image >>>>> url. >>>>> >>>>> Is there a typical process for importing the product database to >>>>> maintain >>>>> the price and image associations correctly? >>>>> >>>>> Thanks >>>>> Tom > |
On 02/01/12 16:40, Ruth Hoffman wrote:
> Hi Mike: > I did a section on how to do something like this for the OFBiz > Cookbook, but I don't think it ever made it into the final version. > > Contact me directly and I'll send you a copy of what I wrote. Thanks, I managed to get that part working well. I had to create xml and csv files for the following entities to get the products in the right categories with the right prices; Category Product ProductCategoryMember ProductPrice But once that was done, everything is where it should be. I've not got the store 100% working yet, as I am trying to get UK/GBP localization, I am now having a problem with shipping... ;-) Thanks Tom <?xml version="1.0" encoding="UTF-8" ?> <data-files xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/datafiles.xsd"> <data-file name="product" separator-style="delimited" type-code="text" delimiter=","> <record name="ProductCategory" limit="many"> <field name="productCategoryId" type="String"/> <field name="categoryName" type="String"/> <field name="productCategoryTypeId" type="String"/> </record> </data-file> </data-files> <?xml version="1.0" encoding="UTF-8" ?> <data-files xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/datafiles.xsd"> <data-file name="item" separator-style="delimited" type-code="text" delimiter=","> <record name="ProductCategoryMember" limit="many"> <field name="productId" type="String"/> <field name="productCategoryId" type="String"/> <field name="fromDate" type="String"/> </record> </data-file> </data-files> <?xml version="1.0" encoding="UTF-8" ?> <data-files xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/datafiles.xsd"> <data-file name="item" separator-style="delimited" type-code="text" delimiter=","> <record name="ProductPrice" limit="many"> <field name="productId" type="String"/> <field name="productPriceTypeId" type="String"/> <field name="productPricePurposeId" type="String"/> <field name="currencyUomId" type="String"/> <field name="price" type="String"/> <field name="fromDate" type="String"/> </record> </data-file> </data-files> <?xml version="1.0" encoding="UTF-8" ?> <data-files xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/datafiles.xsd"> <data-file name="product" separator-style="delimited" type-code="text" delimiter=","> <record name="Product" limit="many"> <field name="productId" type="String"/> <field name="primaryProductCategoryId" type="String"/> <field name="productName" type="String"/> <field name="productTypeId" type="String"/> <field name="weight" type="String"/> <field name="originalImageUrl" type="String"/> <field name="smallImageUrl" type="String"/> <field name="longDescription" type="String"/> </record> </data-file> </data-files> |
Free forum by Nabble | Edit this page |