[OFBiz] Users - Batch XML export

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

[OFBiz] Users - Batch XML export

T E Schmitz
I know this topic was discussed a few months back
(http://lists.ofbiz.org/mailman/htdig/users/2005-March/006884.html).
Sorry for bringing it up again but I'm afraid I need a bit of
hand-holding :-(

I need to export the new order data periodically to import them into
another system. I'd be quite happy with the <entity-engine-xml> format
as provided by the webtools xml export.

I know you have sketched a solution in the above-mentioned thread but
I'd very much appreciate it if you could give me a few more pointers.

--


Regards/Gruß,

Tarlika Elisabeth Schmitz
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: [OFBiz] Users - Batch XML export

T E Schmitz
T E Schmitz wrote:
> I know this topic was discussed a few months back
> (http://lists.ofbiz.org/mailman/htdig/users/2005-March/006884.html).
> Sorry for bringing it up again but I'm afraid I need a bit of
> hand-holding :-(

I figured it out myself, and indeed, with hindsight what seemed daunting
initially turned out to be quite simple.

Just in case another OFBiz newbie should be interested in exporting
orders automagically, here's what I did:

I decided to export the orders one by one producing an XML file just
like the Webtools XML export. Each export file is named after the
orderId and placed in ${ofbiz.home}\data\sync\orders from where Unison
or whatever can beam it to wherever it is going to be imported.

I created a service which exports an order when it is approved.

1) applications\order\entitydef\eecas.xml

define eca:

<eca entity="OrderHeader" operation="create-store" event="return">
   <condition field-name="statusId" operator="equals"
value="ORDER_APPROVED"/>
   <action service="exportOrder" mode="sync"/>
</eca>

2) applications\product\servicedef\services_facility.xml

define service:

<service name="exportOrder" engine="java" require-new-transaction="true"
max-retry="3" location="org.ofbiz.order.order.OrderServices"
invoke="exportOrder">
   <description>Export Order to XML</description>
   <attribute name="orderId" type="String" mode="IN" optional="false"/>
</service>

3) applications\order\src\org\ofbiz\order\OrderServices.java

write method orderExport, which does the actual export



Maybe the above is just a fudge rather than a solution but for the time
being it works for me.

--


Regards,

Tarlika Elisabeth Schmitz
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users