Skip to content

Allow exporting and importing Microsoft Excel files

Remco de Man requested to merge fbl_2_export_ooxml_files into dev

Before this branch, all import and export functionality in Quizzard worked using CSV files. This opposes multiple problems. First of all, CSV files exported from Microsoft Office may use different column separators depending on the regional settings of the operating system (discussed in #2 (closed)). Also, applications used frequently in combination with Quizzard, such as Blackboard, export corrupt CSV file encodings (discussed in #1 (closed)). Although we could argue not have to fix the problems of other applications, these external implementations break the workflow of our users.

This branch introduces import and export functionality for multiple formats. The already supported CSV format was kept and is still the default, but support for Microsoft Excel spreadsheets was added.

This branch contains a lot of changes, the most important ones are:

  • Apache POI was added as a dependency to the pom.xml file. This gives us support for reading and writing Microsoft Excel files.
  • Adding a package nl.utwente.tnb3.nashorn.documents, which contains controller/model classes for different kind of documents. This all is built around the abstract Document interface which is a general interface for working with multiple formats of documents. An implementation was made for CSV files (CsvDocument), XLS files (HssfDocument extending PoiDocument) and XLSX files (XssfDocument extending PoiDocument).
  • The CsvExportService was replaced by the DocumentExportService. This new service contains the different document models for different export and import functionality, just like CsvExportService did. The only difference is that the DocumentExportService now generates Documents (based on the specified type).
  • The different CSV export controllers are merged with the page controllers to have better support for BindingResults. All hardcoded references to CSV export have been removed and changed to 'file export' or just 'export'. All export endpoints are now POST rather than GET because the exported document depends on some settings given in a form.
  • In all places that we expose export functionality the export download link has been replaced by an export modal that contains the different export options. In these modals you can choose the exported file type and set the column separator for CSV files. The modals use binding results to communicate back any form errors.
  • The audience import functionality was changed to support importing from multiple file types. You can now choose the file type you want to export inside the modal. There is no auto-detection of the format: when a wrong format was chosen an error will be shown to the end user. The user is only helped a little bit: When choosing a file the input file selector is set to the option that fits the extension, but this gives no guarantee.
  • Tests have been updated to use the new endpoints and to work with the changed modals.

Merge request reports

Loading