Excel

The Excel module provides the ability to read from Excel spreadsheets, which can be useful for certain use cases, eg bulk import of data. Each row of a spreadsheet can be mapped to a domain object, usually a view model. The view model can validate itself and then be applied.

The module also supports the opposite use case, converting a collection of domain objects into an Excel spreadsheet.

In addition, the library provides fixture support, allowing test data to be specified in a spreadsheet.

Setup

Dependency Management

Add a section for Excel module’s own BOM:

pom.xml
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.apache.causeway.extensions</groupId>
            <artifactId>causeway-extensions-excel</artifactId>
            <scope>import</scope>
            <type>pom</type>
            <version>2.0.0-RC1</version>
        </dependency>
    </dependencies>
</dependencyManagement>

Dependencies

In the modules of your application that will use the Excel extension, add the following dependency/ies:

  • for export/import, add:

    pom.xml
    <dependencies>
        <dependency>
            <groupId>org.apache.causeway.extensions</groupId>
            <artifactId>causeway-extensions-excel-applib</artifactId>
        </dependency>
    </dependencies>
  • for fixture support, add:

    pom.xml
    <dependencies>
        <dependency>
            <groupId>org.apache.causeway.extensions</groupId>
            <artifactId>causeway-extensions-excel-testing</artifactId>
        </dependency>
    </dependencies>

Export and Import

TODO - v2

Fixture Support

TODO - v2

See also