...
By entity XML import reader : on your component indicate to load your files by with ext reader. When you want load your data, run ./ant load-ext from your OFBIz home directory.
For instance in your component/ofbiz-component.xml:Code Block language xml <entity-resource type="data" reader-name="ext" loader="main" location="data/MyImportData.xml"/>
- See How to preparing data for more information.
Directly from webtools in OFBiz, go to
https://localhost:8443/webtools/control/entityImport to load file by file or copy/paste text
https://localhost:8443/webtools/control/EntityImportDir to load a directory content
- Call the OFBiz service importEntityFileDirectory if you have an automation process
Use the OFBiz's Data File Tools to import
...
a CSV or tab-delimited file
It uses a map to put the data in the entity fields. This is also good for adding static data such as new products.
Here is a sample product import file row. this This is a tab delimited file. If you prefer CSV (Comma Separated Values), change the delimiter to "," and the text-delimiter to """ in the XML below.
Code Block |
---|
PRODUCT_ID SKU TITLE CATEGORIES IMAGE_URL BRAND DESCRIPTION DETAILS WEIGHT DIMENSIONS GOING REFURB FREIGHT ITEM_NAME MAP PRICE MSRP QTY_AVAIL EST_AVAIL EXPECTED_SHIPPING_COST EXPECTED_DROP_SHIP_FEE UPC ITEM_ID 100 213 Atwater Carey EMT Shears leisure and sport|camping/hiking|accessories http://images.doba.com/products/2/213.jpg Atwater Carey The choice of EMTs worldwide, the 5-1/2'' trauma shears contained in all Pro Series kits or sold separately features an oversized rivet to overcome the rigors of backcountry emergencies. Identified by the bright orange handles, these shears will cut through cloth, plastic, and even light-gauge metal.<br><br> 0.100000002 N N N Atwater Carey EMT Shears 0 3.92 4.99 6 0000-00-00 6.63 2 7.39657E+11 100 |
...
Code Block |
---|
<Product productId="100" primaryProductCategoryId="dropShip" productTypeId="FINISHED_GOOD" internalName="213" description="Atwater Carey EMT Shears" brandName="Atwater Carey" longDescription="The choice of EMTs worldwide, the 5-1/2'' trauma shears contained in all Pro Series kits or sold separately features an oversized rivet to overcome the rigors of backcountry emergencies. Identified by the bright orange handles, these shears will cut through cloth, plastic, and even light-gauge metal.<br><br>" weight="0.1000000015" weightUomId="WT_lb" chargeShipping="Y" productName="Atwater Carey EMT Shears" quantityIncluded="1" isVirtual="N" returnable="Y" isVariant="N" /> |
Load the csv and save it as an xls file. Use the PIO to read the xls file
Importing XLS files
Microsoft Excel prior to 2007 used the proprietary XLS file format. XLS files can be read by Java and Groovy applications using the POI library. See Import Data Using Apache POI api and the JIRA issue OFBIZ-1810 for more information.
The new XLSX format is fundamentally XML files packaged in the Zip file format. You could extract data from the XLSX file and apply an XSLT transform to create an OFBiz XML file. You can then search of the product is new or already in and create or update the product. This one requires coding.
You can add a flt that lets a user find the xls and load it that way, or add a service that runs as a job to read from a folder say every midnight.
You can pull the CSV into worksheet and add columns between the data
...
To add in the xml to make it an entity import. An example:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
1651143 "31090002101" "2.4G Media Pointer/Presenter" "computer and laptop|input devices|mice" http://images.doba.com/products/4/31090002101.jpg "Genius" "Genius 2.4G Media Pointer, USB, Blue-black. 2.4GHz professional presenter with time management and lazer pointer. Mini receiver can be stored inside; up to 15 meters anti-interference. LCD time controller, easy to control your presentation. Integrated media functions work just like a simple remote control." "" "0.6000000238" "" N N N "2.4G Media Pointer/Presenter" 0 31.9 50.37 2 0000-00-00 7.41 0 91163218432 1969225 |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<Product productId="1651143" productTypeId="FINISHED_GOOD" internalName="31090002101" productName="2.4G Media Pointer/Presenter" longDescription= "Genius 2.4G Media Pointer, USB, Blue-black. 2.4GHz professional presenter with time management and lazer pointer. Mini receiver can be stored inside; up to 15 meters anti-interference. LCD time controller, easy to control your presentation. Integrated media functions work just like a simple remote control." weight="0.6000000238" taxable="Y" chargeShipping="N" description="2.4G Media Pointer/Presenter" autoCreateKeywords="Y" isVirtual="N" isVariant="N" /> |
...