Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Done slight formating changed in available action section.

...

The available actions are :

  1. <create>

...

  1. :

...

  1. The entity

...

  1. loading

...

  1. mechanism

...

  1. checks

...

  1. all

...

  1. entity

...

  1. elements

...

  1. present

...

  1. under

...

  1. this

...

  1. action

...

  1. and

...

  1. if

...

  1. a

...

  1. research

...

  1. by

...

  1. the

...

  1. primary

...

  1. returns

...

  1. empty,

...

  1. creates

...

  1. it.

...


  1. Otherwise

...

  1. nothing

...

  1. is

...

  1. done.

  2. <create-update>

...

  1. :

...

  1. The entity

...

  1. loading

...

  1. mechanism

...

  1. checks

...

  1. all

...

  1. entity

...

  1. elements

...

  1. present

...

  1. under

...

  1. this

...

  1. action

...

  1. and

...

  1. if

...

  1. a

...

  1. research

...

  1. by

...

  1. primary

...

  1. key

...

  1. return

...

  1. empty,

...

  1. creates

...

  1. it.

...


  1. Otherwise

...

  1. it

...

  1. updates

...

  1. the

...

  1. existing

...

  1. element

...

  1. with

...

  1. the

...

  1. given

...

  1. field

...

  1. value.

...



  1. <create-replace>

...

  1. :

...

  1. The entity

...

  1. loading

...

  1. mechanism

...

  1. checks

...

  1. all

...

  1. entity

...

  1. elements

...

  1. present

...

  1. under

...

  1. this

...

  1. action

...

  1. and

...

  1. if

...

  1. a

...

  1. research

...

  1. by

...

  1. primary

...

  1. key

...

  1. return

...

  1. empty,

...

  1. creates

...

  1. it.

...


  1. Otherwise

...

  1. it

...

  1. replaces

...

  1. the

...

  1. existing

...

  1. element

...

  1. with

...

  1. the

...

  1. given

...

  1. field

...

  1. value.

...

  1. If

...

  1. a

...

  1. field

...

  1. is

...

  1. present

...

  1. in

...

  1. the

...

  1. database

...

  1. but

...

  1. not

...

  1. on

...

  1. xml

...

  1. definition,

...

  1. it

...

  1. will

...

  1. be

...

  1. set

...

  1. to

...

  1. empty.

...



  1. <delete>

...

  1. :

...

  1. The entity

...

  1. loading

...

  1. mechanism

...

  1. checks

...

  1. all

...

  1. entity

...

  1. elements

...

  1. present

...

  1. under

...

  1. this

...

  1. action

...

  1. and

...

  1. if

...

  1. a

...

  1. research

...

  1. by

...

  1. primary

...

  1. key

...

  1. return

...

  1. empty,

...

  1. tries

...

  1. to

...

  1. delete

...

  1. it.

...


  1. Warning

...

  1. the

...

  1. foreign

...

  1. keys

...

  1. haven't

...

  1. been

...

  1. tested.

...

  1. So

...

  1. if

...

  1. you

...

  1. broke

...

  1. a

...

  1. database

...

  1. constraint,

...

  1. all

...

  1. operations

...

  1. present

...

  1. in

...

  1. the

...

  1. file

...

  1. will

...

  1. be

...

  1. rolled

...

  1. back.

Here is an example:

Code Block
languagexml
titleEntity Xml Data Resource Exemple
<entity-engine-xml>
    <create>
        <Example exampleId="EX13" exampleName="Example 13" exampleTypeId="INSPIRED" statusId="EXST_IN_DESIGN"/>
        <Example exampleId="EX14" exampleName="Example 14" exampleTypeId="INSPIRED" statusId="EXST_IN_DESIGN"/>
    </create>
    <create-replace>
        <Example exampleId="EX12" exampleName="Example 12 after replace" exampleTypeId="INSPIRED" statusId="EXST_IN_DESIGN"/>
    </create-replace>
    <create-update>
        <Example exampleId="EX12" exampleName="Example 11 after update" exampleTypeId="INSPIRED" statusId="EXST_IN_DESIGN"/>
    </create-update>
    <delete>
        <Example exampleId="EX09"/>
    </delete>
    <Example exampleId="EX10" exampleName="Example 10 after update"/>
</entity-engine-xml>

...

  1. 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
    languagexml
        <entity-resource type="data" reader-name="ext" loader="main" location="data/MyImportData.xml"/>
    1.  See  How to preparing data for more information.
  2. Directly from webtools  in OFBiz, go to 

    1. https://localhost:8443/webtools/control/entityImport to load file by file or copy/paste text

    2. https://localhost:8443/webtools/control/EntityImportDir to load a directory content

  3. Call the OFBiz service importEntityFileDirectory if you have an automation process
  4. Directly from command line using Gradle command:

    Code Block
    gradlew "ofbiz --load-data file=data/MyImportDatamyimportdata.xml"

    Note: The data file name should be lowercase only.

    For all the files in the given directory:

    Code Block
    gradlew "ofbiz --load-data dir=data"


...

Here is a sample product import file row. This is a tab delimited file. If you prefer CSV (Comma Separated Values), change the delimiter to "," and the text-delimiter to "&quot;" 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

...