You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Sumesh R Acharya <7....@gmail.com> on 2022/06/21 07:06:19 UTC

Creating new import spreadsheet service or modifying existing service

Hello community,

I seen there is a productimportfromspreadsheet service in ofbiz which is
used for import product entries from excel sheets in to the database.

If I want to do same for some other table so will i need to create a new
service for that ?? If yes how to achieve that.

Or i can modify the above service ??

One thing also i need to know how to read the date fields from the excel
sheets and convert those values to date datatype as per  the database
columns. Please do share some resources for doing this.

Regards,
Sumesh

Re: Creating new import spreadsheet service or modifying existing service

Posted by Ashish Vijaywargiya <as...@hotwaxsystems.com>.
Hello Sumesh,

Please refer
OFBIZ_HOME/applications/product/src/main/java/org/apache/ofbiz/product/spreadsheetimport/ImportProductServices.java
file.
Please read the code present inside service: productImportFromSpreadsheet

Please refer my comments inline:

--
Kind Regards,
Ashish Vijaywargiya
Vice President of Operations
*HotWax Systems*
*Enterprise open source experts*
http://www.hotwaxsystems.com

On Tue, Jun 21, 2022 at 12:36 PM Sumesh R Acharya <7....@gmail.com>
wrote:

> Hello community,
>
> I seen there is a productimportfromspreadsheet service in ofbiz which is
> used for import product entries from excel sheets in to the database.
>
> If I want to do same for some other table so will i need to create a new
> service for that ?? If yes how to achieve that.
>

Yes, you need to create other services.


>
> Or i can modify the above service ??
>

My recommendation for you is to create a custom component in OFBiz and
write your services in that component. Please refer following links:
https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Tutorial+-+A+Beginners+Development+Guide
https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Tutorial+-+A+Beginners+Development+Guide+for+18.12(Assuming
that you are exploring the code base of this stable branch)


>
> One thing also i need to know how to read the date fields from the excel
> sheets and convert those values to date datatype as per  the database
> columns. Please do share some resources for doing this.
>

I have used the Apache POI project when I have implemented this feature in
the Apache OFBiz project. So I request you to read more details about
Apache POI from here:
https://poi.apache.org


>
> Regards,
> Sumesh
>