Newbie: Where is the data coming from?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Newbie: Where is the data coming from?

Johnny Kewl
SVN'd ant'd... and it worked first time, well done.

Its made accounts and tons of other stuff in derby, I'm just wondering how?
Where did that data come from, and if I want to add an account and perform
the same magic, where do I put that data... so it also populates derby or
postgres like the ofbiz did?

Thanks

Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Where is the data coming from?

Bruno Busco
Johnny,
in every ofbiz component there is a "data" folder that contains several XML
files.
See for example:
\ofbiz\applications\accounting\data\AccountingSecurityData.xml

These files defines the entity records that must be created.

In order to be loaded in the database, a data file must be referenced in the
component ofbiz-componet.xml file with a line like this:
    <entity-resource type="data" reader-name="seed" loader="main"
location="data/UsTaxAccountGroups.xml"/>

This line associates the data xml file to a "reader".
Some reader like "seed", "ext", "demo" are already defined and loaded with
the various ant option (like run-install-seed or run-install-extseed).
More readers can be defined by the user in custom components.

Hope this helps,
-Bruno


2008/6/19 Johnny Kewl <[hidden email]>:

> SVN'd ant'd... and it worked first time, well done.
>
> Its made accounts and tons of other stuff in derby, I'm just wondering how?
> Where did that data come from, and if I want to add an account and perform
> the same magic, where do I put that data... so it also populates derby or
> postgres like the ofbiz did?
>
> Thanks
>
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Where is the data coming from?

Johnny Kewl

----- Original Message -----
From: "Bruno Busco" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, June 19, 2008 7:11 PM
Subject: Re: Newbie: Where is the data coming from?


> Johnny,
> in every ofbiz component there is a "data" folder that contains several
> XML
> files.
> See for example:
> \ofbiz\applications\accounting\data\AccountingSecurityData.xml
>
> These files defines the entity records that must be created.
>
> In order to be loaded in the database, a data file must be referenced in
> the
> component ofbiz-componet.xml file with a line like this:
>    <entity-resource type="data" reader-name="seed" loader="main"
> location="data/UsTaxAccountGroups.xml"/>
>
> This line associates the data xml file to a "reader".
> Some reader like "seed", "ext", "demo" are already defined and loaded with
> the various ant option (like run-install-seed or run-install-extseed).
> More readers can be defined by the user in custom components.
>
> Hope this helps,
> -Bruno

Yes I see it, quite a system, thanks....

Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Where is the data coming from?

Ashish Vijaywargiya
In reply to this post by Bruno Busco
Few more details :-

See the entitydef folder of any component.

entitymodel.xml files that are present in each component(for eg :-
accounting,content) to define the entities.
This entities are grouped into entitygroup.xml and this file also present in
each component.

In the entitygroup.xml all the entities are grouped into the "group"
attribute of <entity-group> tag.
In most of the entitygroup.xml file entities are grouped into "org.ofbiz"
group.
For eg :- <entity-group group="org.ofbiz" entity="Budget" />

These groups are called from entityengine.xml to put the definition of all
the entities into particular database.
See the code sample shown below that is taken from entityengine.xml file :-

    <delegator name="default" entity-model-reader="main"
entity-group-reader="main" entity-eca-reader="main"
distributed-cache-clear-enabled="false">
        <group-map group-name="org.ofbiz" datasource-name="localderby"/>
        <group-map group-name="org.ofbiz.olap"
datasource-name="localderbyolap"/>
    </delegator>

In the above code <group-map> tag calls the group "org.ofbiz" and sends the
definition of all the entities comes inside it to localderby database.

Please let us know if you need more assistance on this :-)

--
Ashish


On Thu, Jun 19, 2008 at 1:11 PM, Bruno Busco <[hidden email]> wrote:

> Johnny,
> in every ofbiz component there is a "data" folder that contains several XML
> files.
> See for example:
> \ofbiz\applications\accounting\data\AccountingSecurityData.xml
>
> These files defines the entity records that must be created.
>
> In order to be loaded in the database, a data file must be referenced in
> the
> component ofbiz-componet.xml file with a line like this:
>    <entity-resource type="data" reader-name="seed" loader="main"
> location="data/UsTaxAccountGroups.xml"/>
>
> This line associates the data xml file to a "reader".
> Some reader like "seed", "ext", "demo" are already defined and loaded with
> the various ant option (like run-install-seed or run-install-extseed).
> More readers can be defined by the user in custom components.
>
> Hope this helps,
> -Bruno
>
>
> 2008/6/19 Johnny Kewl <[hidden email]>:
>
> > SVN'd ant'd... and it worked first time, well done.
> >
> > Its made accounts and tons of other stuff in derby, I'm just wondering
> how?
> > Where did that data come from, and if I want to add an account and
> perform
> > the same magic, where do I put that data... so it also populates derby or
> > postgres like the ofbiz did?
> >
> > Thanks
> >
>