Generator-jhipster: Bulk Import/export of entities by CSV files

Created on 18 Jan 2016  Â·  16Comments  Â·  Source: jhipster/generator-jhipster

A commonly asked featured is to have CSV import and export features of entities. I think this would be interesting to have it in the main generator with endpoints that can take file or text/csv data (REST + Json is sometimes not performant enough) and buttons in the angular views to import/export the data. But if there is not enough interest to do it in the main generator, I can do it as a module.

area needs-discussion

Most helpful comment

OK.
One note though: the idea is to give the end user the possibility to import data, not the developper. So liquibase can't be used here and you have to use a 3rd party lib like for exports.

All 16 comments

yes its a very good feature. :+1: either in main generator as default or as module

Actually http://ui-grid.info/docs/#/tutorial/312_exporting_data_complex has these features, may be we could refer that

Yes ! :+1: too !

I'm not fully convinced by CSV exporting done by a JS grid, in my experience you'll get better performance from server download unless of course you want to be able to select which rows to export.

BTW, what about replacing our entity table by a real grid with better look and more features like either ui-grid you mentioned or ag-grid ?

I've used this on a project before:

https://github.com/asafdav/ng-csv
On Sat, Jan 23, 2016 at 10:28 Gaël Marziou [email protected] wrote:

I'm not fully convinced by CSV exporting done by a JS grid, in my
experience you'll get better performance from server download unless of
course you want to be able to select which rows to export.

BTW, what about replacing our entity table by a real grid with better look
and more features like either ui-grid you mentioned or ag-grid
https://www.ag-grid.com/ ?

—
Reply to this email directly or view it on GitHub
https://github.com/jhipster/generator-jhipster/issues/2648#issuecomment-174197992
.

I used Ui grid on a JHipster project and i was satisfied with performance
and quality of the csv download and pdf rather than doing a server side
option, but if i wanted excel etc i might go sever side
On 24 Jan 2016 00:30, "Matt Raible" [email protected] wrote:

I've used this on a project before:

https://github.com/asafdav/ng-csv
On Sat, Jan 23, 2016 at 10:28 Gaël Marziou [email protected]
wrote:

I'm not fully convinced by CSV exporting done by a JS grid, in my
experience you'll get better performance from server download unless of
course you want to be able to select which rows to export.

BTW, what about replacing our entity table by a real grid with better
look
and more features like either ui-grid you mentioned or ag-grid
https://www.ag-grid.com/ ?

—
Reply to this email directly or view it on GitHub
<
https://github.com/jhipster/generator-jhipster/issues/2648#issuecomment-174197992

.

—
Reply to this email directly or view it on GitHub
https://github.com/jhipster/generator-jhipster/issues/2648#issuecomment-174198188
.

@deepu105 does the csv download work with our server-side pagination ?

I didn't use server side pagination with Ui grid coz it was handling 50,000
rows without a sweat so client side pagination was more than sufficient,
reading ui grid docs they do support server side pagination and sort
On 24 Jan 2016 02:00, "Christophe Bornet" [email protected] wrote:

@deepu105 https://github.com/deepu105 does the csv download work with
our server-side pagination ?

—
Reply to this email directly or view it on GitHub
https://github.com/jhipster/generator-jhipster/issues/2648#issuecomment-174208821
.

If ng-csv can work with our server-side pagination, then that would be the best solution to the problem: no server-side change to do, only add the directive when it's needed, I love it!

But ng-csv is a small project compared to ui-grid and ag-grid.
It seems quite simple to use ui-grid with spring server-side pagination : https://github.com/naory/spring-data-rest-ng-grid-example
ui-grid and ag-grid also look much more powerful than bootstrap.

OK, then if this can be easily achieve by using one of those 3rd party libs I don't think we should do anything in the project.
It's our usual job -> we make it easy to integrate those, so if people need this it's easy for them to add

Then it would be nice to have this documented somewhere, I think a "tip" on the website would be great!

Hi, it'll be a nice function if built-in !

Remember you can do it with liquibase :

  • add your csv in a directory
  • manually create a changelog to load data :

entity:D"

I'm using it for legacy data transfer for example, but even for every data patch ! Remember liquibase is async, so for large data file, could take time at startup so you get strange behavior on front side.

Remember me another very usefull related function : Excel export. Can be very simple (just need to avoid pagination at some point) : http://jsfiddle.net/lesson8/jWAJ7/light/

OK I'm closing this as I guess we have settled this:

  • For imports, use Liquibase. This is what we already do for users, for example.
  • For exports, use a third-party JS library that does the trick -> if someone has experience with one that works well, please submit a tip

OK.
One note though: the idea is to give the end user the possibility to import data, not the developper. So liquibase can't be used here and you have to use a 3rd party lib like for exports.

Is there any update on this?
I would like to have a exposed api for CSV/XML Imports from end users.

No, once a ticket is closed we stop working on it

@singhfulda I recommend PrimeNG's Table component for easily exporting data to CSV

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pascalgrimaud picture pascalgrimaud  Â·  4Comments

frantzynicolas picture frantzynicolas  Â·  3Comments

Steven-Garcia picture Steven-Garcia  Â·  3Comments

kaidohallik picture kaidohallik  Â·  3Comments

SudharakaP picture SudharakaP  Â·  3Comments