Revamp Excel Importer module - Mendix Forum

Revamp Excel Importer module

23

The Excel Importer module is one of the most downloaded modules. Looking at the java code it has been created some 12 years ago and since then not much has changed in the Java code of the module. I am suggesting two ideas in one:

Refactoring

The Java library it uses, Apache POI, has evolved A LOT and has undergone many upgrades, like for instance easily reading the data from Excel and manipulating in Java. Mendix has it's own (quite complicated) Java code for reading the data via the intermediate XMLs an XLS(X) file consists of, which has become obsolete in my opinion. It also makes it very hard to debug and to extend if there are specific client needs. For this reason we created an Excel Importer which consists of some 30 % of the amount of code the current Excel Importer module uses!

I would like to suggest a revamp of this module, it can get rid of a lot of unnecessary custom Mendix code that is now handled with the newest versions of the Apache POI which is already included in this module as a JAR file as well.

Checking headers

A common requirement is that when importing an Excel file the logic checks whether the actually uploaded Excel has the same headers/column names as the template has. There could be a two level check: check if same amount of columns as template, if not tell which ones differ and fail. This will prevent users from uploading the wrong Excel. I have seen this happening many times. I would like to suggest to make it an extra boolean in the StartImportByTemplate MF, so developers can choose to enable/disable it per type of upload.  

Shouldn’t be too much work, as there is already a java method ‘checkHeaders’ in the Excel Import module which is used throughout the module, but not used to compare to the template columns. Could be easily extended to do so.

asked
2 answers

Hi Boris, I also filed a ticket for this as I believe this should be owned by Mendix itself. It is part of the platform and should stay that way. An easy win for Mendix I would say.

Created

Hi Ivo – can’t you provide your Excel Importer to the App Store?

Or is this about making Mendix to take the Mendix-Supported ownership for it?

Created