This sounds fine. Why is the "default" reader needed? Couldn't we just
add readers on the fly if referenced in ofbiz-component.xml files just
like if they were specified in the entityengine.xml file?
I guess the only downside to this would be that if someone was trying
to use an existing reader and had a typo then it would create a new
reader instead of giving them an error, but for flexibility's sake it
is probably worth it.
-David
On Jan 30, 2009, at 7:23 AM, Jacopo Cappellato wrote:
Hi all,
I have a proposal and a question about entity-data-readers (seed,
seed-initial, demo, ext, ext-test, ext-demo).
*Question*
what is the meaning of specifying the readers in the datasource
element? Is it not enough to define them and then just use them in
the ofbiz-component files?
*Proposal*
I would like to give more flexibility in the way data files are
defined in custom (hot-deploy) ofbiz-component.xml files; for
example, if I define:
<entity-resource type="data" reader-name="production" loader="main"
location="data/CustomSeedData.xml"/>
<entity-resource type="data" reader-name="test" loader="main"
location="data/CustomSeedData.xml"/>
<entity-resource type="data" reader-name="test" loader="main"
location="data/CustomDemoData.xml"/>
<entity-resource type="data" reader-name="test2" loader="main"
location="data/CustomSeedData.xml"/>
<entity-resource type="data" reader-name="test2" loader="main"
location="data/CustomDemoData2.xml"/>
I would like to load them with an ant command like:
ant run-install -Dreaders=test
(to load CustomSeedData.xml and CustomDemoData.xml)
but *without* the need to add the readers test, test2 and production
into the entityengine.xml file).
The trick is the following: in the entityengine.xml file a catchall
reader is added (named "default"):
<entity-data-reader name="default"/>
and then use it for all the readers referenced in ofbiz-
component.xml but not found in entityengine.xml.
I have a working patch right now, that I can cleanup and submit soon.
What do you think?
Jacopo