Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As you have setup your custom entities, now is the time to prepare some sample xmldata data for it. You can do it in data xmlfiles XML files already setup under data directory of your component as  $OFBIZ_HOME/hot-deploy/ofbizdemo/data/OfbizDemoTypeData.xml and  $OFBIZ_HOME/hot-deploy/ofbizdemo/data/OfbizDemoDemoData.xml. Set it up as shown below:

 

Code Block
languagexml
titleOfbizDemoTypeData.xml
 <?xml version="1.0" encoding="UTF-8"?>
<entity-engine-xml>
    <OfbizDemoType ofbizDemoTypeId="INTERNAL" description="Internal Demo - Office"/>
    <OfbizDemoType ofbizDemoTypeId="EXTERNAL" description="External Demo - On Site"/>
</entity-engine-xml>
Code Block
languagexml
titleOfbizDemoDemoData.xml
<?xml version="1.0" encoding="UTF-8"?>
<entity-engine-xml>
    <OfbizDemo ofbizDemoId="SAMPLE_DEMO_1" ofbizDemoTypeId="INTERNAL" firstName="Sample First 1" lastName="Sample Last 1" comments="This is test comment for first record."/>
    <OfbizDemo ofbizDemoId="SAMPLE_DEMO_2" ofbizDemoTypeId="INTERNAL" firstName="Sample First 2" lastName="Sample last 2" comments="This is test comment for second record."/>
    <OfbizDemo ofbizDemoId="SAMPLE_DEMO_3" ofbizDemoTypeId="EXTERNAL" firstName="Sample First 3" lastName="Sample last 3" comments="This is test comment for third record."/>
    <OfbizDemo ofbizDemoId="SAMPLE_DEMO_4" ofbizDemoTypeId="EXTERNAL" firstName="Sample First 4" lastName="Sample last 4" comments="This is test comment for fourth record."/>
</entity-engine-xml>

Now again have a look at $OFBIZ_HOME/hot-deploy/ofbizdemo/ofbiz-component.xml file. You already have resource entry made in it for loading data prepared in these files as:

...