Commit Graph

104 Commits

Author SHA1 Message Date
Marten Deinum
4fb5fb906d Update documentation
Document on how to use the BeanWrapperRowMapper with the StreamingXlsxItemReader as that requires a bit more configuration due to the streaming nature.

Next to the documentation also added a test case for this to show how to configure it as well.

Closes: #115
2024-09-18 16:50:02 +02:00
Marten Deinum
395560672a Customization of Apache POI helpers
Prior to this commit it was impossible to modify or configure the DataFormatter and FormulaEvaluator in use. With this commit we resolve this by introducing two interfaces. 1 DataFormatterCustomizer to customize/configure the the DataFormatter in use. 1 interface the FormulaEvaluatorFactory which is a factory used to create the FormulaEvaluator.

The default DataFormatterCustomizer will configure the formatter to use the cached values from cells instead of evaluating the formulas.

The default FormulaEvaluatorFactory in use will always return null instead of creating a FormulaEvaluator.

Fixes: #126
2024-09-18 15:52:18 +02:00
Marten Deinum
9b03569dd7 Improve IsoFormattingDateDataFormatter
Prior to this commit all date related fields were formatted as an
ISO_LOCAL_DATE_TIME.

With this commit we inspect the type it actually is date, time or
datetime and use the proper ISO_LOCAL formatting for that.

Another improvement is to use the cached result for the formula instead
of re-evaluating the formula and use that type.
2024-08-08 15:29:29 +02:00
Marten Deinum
9ee6eff5b7 Upgrade to spring-java-format 0.0.42
With this commit we upgrade the java formatting to the new version and
also adhere to the standards applied there. Mainly for Junit5 names of
the test classes and visibility of methods.

Closes: #138
2024-08-07 21:27:18 +02:00
Marten Deinum
cc72e8d616 Fix IsoFormattingDateDataFormatter
The format used the ISO_OFFSET_DATE_TIME is the wrong one and leads to errors
formatting the date. Instead we should have used the ISO_LOCAL_DATE_TIME instead.

This commit fixes that and also includes a bug fix for the XLSX variant as that didn't
use the overridden method. The correct method for this has been overridden now also
formatting the dates/times for that using the ISO_LOCAL_DATE_TIME format.

Tests for different types have been added as well, as to make sure this
keeps working for newer versions.

Closes: #121
2024-08-07 14:11:52 +02:00
Marten Deinum
b6e2b97068 Consistently open workbook in readonly mode
The itemreaders provided by this project are reading only. So it makes
sense to open them with only read-only priviliges. We already did this
for the streaming version of the itemreader. With this commit we also
enable this for the regular itemreader.

Closes: #128
2024-08-07 13:04:42 +02:00
Marten Deinum
b3cbefb773 New development version (0.2) 2024-08-07 13:03:04 +02:00
Marten Deinum
61b3220ab8 Upgrade to AssertJ 3.26.3
Closes: #135
2024-08-07 11:52:20 +02:00
Marten Deinum
dafedb2e1d Upgrade to Mockito 5.12.0
Closes: #134
2024-08-07 11:50:20 +02:00
Marten Deinum
fe710f6245 Upgrade to JUnit JUpiter 5.10.2
Closes: #133
2024-08-07 11:48:45 +02:00
Marten Deinum
6b875f018b Upgrade to Spring Batch 5.3.0
Closes: #132
2024-08-07 11:46:41 +02:00
Marten Deinum
1ca8459de9 Upgrade to Apache POI 5.3.0
Closes: #131
2024-08-07 11:45:25 +02:00
Marten Deinum
ce21f2f529 Upgrade to Java17
Closes: #130
2024-08-07 11:44:15 +02:00
Marten Deinum
c076942628 Upgrade to Spring Batch 4.3.9 (#120)
* Upgrade to Spring Batch 4.3.8.
2023-10-02 20:26:40 +02:00
Joey Mason
7e2f5b9537 Bump spring-batch-excel Mockito version from 3.11.0 to 3.12.4 (#119) 2023-10-02 16:30:19 +02:00
Marten Deinum
38ce224502 Prefer ArrayList over LinkedList (#118)
Both the ArrayList and LinkedList keep the order
of insertion, there is no need to use the LinkedList.
2023-10-02 16:18:54 +02:00
Marten Deinum
7efdb2054a Update README.adoc
Include a FAQ section for commonly asked questions. 

Closes: #97
2023-10-02 16:02:20 +02:00
Marten Deinum
8a276f921c Update README.adoc
Include the supported Spring Batch versions in the documentation.

Closes: #111
2023-10-02 15:55:17 +02:00
Marten Deinum
f9709d9c35 Allow a Locale to be set for formatting (#100)
The internal DataFormatter used from Apache POI allows for setting a fixed
Locale to use when reading numbers, dates etc. Initially we didn't set this
and thus it always used the default Locale as set from the Java runtime. This
could lead to unexpected results. We now allow to set the userLocale property
and use this to configure the DataFormatter used internally.

We also took the opportunity to make this work with the streaming ItemReader
as well as the regular ItemReader. The streaming item reader now also uses
a pre-configured DataFormatter.

Closes: #98
2023-09-19 20:48:29 +02:00
Marten Deinum
3ba05fb4c6 Polish build file (#107) 2022-12-15 15:58:36 +01:00
Marten Deinum
3e8c0c5884 Downgrade to Checkstyle 9.3
Closes: #105
2022-12-06 15:43:14 +01:00
Marten Deinum
7a4762b675 Upgrade Maven Javadoc Plugin to 3.4.1
Closes: #104
2022-12-06 15:22:15 +01:00
Marten Deinum
8cfd20a722 Upgrade checkstyle plugin to 3.2.0
This commit also upgrades the used Checkstyle and
spring-java-format rules to respecive version 10.5.0
and 0.0.35.

Closes: #103
2022-12-06 15:22:15 +01:00
Marten Deinum
07a80c43cb Upgrade surefire/failsafe to version 3.0.0-M7
Closes: #102
2022-12-06 15:22:15 +01:00
Marten Deinum
0fe27c4821 Upgrade maven-compiler-plugin to 3.10.1
Closes: #101
2022-12-06 15:22:15 +01:00
Marten Deinum
e8c67a115d Add maven.config file
Reduce the output generated for the build. 

Add the -ntp (no transfer progress) as to not to pollute the server output
and thus improve performance.
2022-12-06 14:19:25 +01:00
Marten Deinum
ff44bc5db8 Fix error in pom.xml 2022-12-06 14:09:37 +01:00
Marten Deinum
700e3bfe15 Remove now obsolete log4j2.xml 2022-12-06 14:08:38 +01:00
Marten Deinum
cd72a2851d Reduce output during test
Instead of Log4j2 use the SLF4J NOP logger. This will disable logging output,
this will cleanup the output during a build.
2022-12-06 13:45:26 +01:00
Marten Deinum
3ed5093daa Fix dependency scope for AssertJ
Prior to this commit the dependency scope was not set and thus the default 
provided would apply. We now explicitly set it to a scope of test
2022-12-06 13:42:16 +01:00
Marten Deinum
005e4cb206 Update Spring Batch to 4.3.7 2022-12-06 10:59:59 +01:00
Spring Builds
08eac5b8a3 [artifactory-release] Next development version of spring-batch-excel 2022-04-28 09:13:14 +00:00
Spring Builds
a8bb0bb969 [artifactory-release] Release version 0.1.1 of spring-batch-excel 2022-04-28 09:13:12 +00:00
Marten Deinum
7820d8ea6a Optional iso dates (#94)
* Optionally use ISO formatting for dates

Prior to this commit we always used the date pattern as
assigned in the Excel workbook for the cell. Which could
lead to surprising results.

We now allow the dates to be formatted as an ISO date time with
offset, so dates/times are consistently formatted in the result.

Closes: #88
2022-04-12 10:58:18 +02:00
Marten Deinum
c8b48a05d5 Upgrade to Spring Batch 4.3.5 (#93)
Closes: #92
2022-04-12 10:48:56 +02:00
Marten Deinum
f22212b70b Improve resource file check (#90)
With this commit we use the isFile check introduced in
Spring 5 to check if something is an actaul file resource
instead of relying on FileNotFoundException.

Resource implementations didn't consistently throw a
FileNotFoundException (like the Google Big Query one)
leading to issues with reading.

Closes: 89
2022-02-03 08:29:48 +01:00
dependabot[bot]
9585996ed8 Bump log4j-core from 2.17.0 to 2.17.1 in /spring-batch-excel
Bumps log4j-core from 2.17.0 to 2.17.1.

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-core
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-04 16:50:38 +00:00
dependabot[bot]
e19d61fb11 Bump log4j-core from 2.16.0 to 2.17.0 in /spring-batch-excel
Bumps log4j-core from 2.16.0 to 2.17.0.

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-core
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-18 18:34:49 +00:00
dependabot[bot]
ae5037fe5c Bump log4j-core from 2.15.0 to 2.16.0 in /spring-batch-excel
Bumps log4j-core from 2.15.0 to 2.16.0.

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-core
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-14 21:55:09 +00:00
dependabot[bot]
bbf46056ee Bump log4j-core from 2.13.3 to 2.15.0 in /spring-batch-excel
Bumps log4j-core from 2.13.3 to 2.15.0.

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-core
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-10 01:52:41 +00:00
Marten Deinum
a2f746fa07 Upgrade to Spring Batch 4.3.4 2021-12-07 09:50:14 +01:00
Marten Deinum
6471d899b5 Polish testing
Enabled junit5 testing in Maven (upgrade plugin) and added
additional tests to the Streaming and XLSX reader.
2021-12-07 09:48:49 +01:00
Marten Deinum
3f81bdb75c Polish 2021-12-07 09:29:31 +01:00
Marten Deinum
029d2d5394 Update to Mockito 3.11.0 2021-12-07 09:29:31 +01:00
Marten Deinum
c793dbb9a2 Update to JUnit 5.7.2 2021-12-07 09:29:30 +01:00
César Alves
b378ac1dfd Move to next sheet when there are only empty/invalid rows (#82)
When there are blank or empty lines in the end of one sheet, null is returned by doRead without trying to read next sheet. A recursive call makes sheet moving happen when another exists.

Co-authored-by: Mahmoud Ben Hassine <mbenhassine@vmware.com>
Co-authored-by: cesar.alves@gmail.com <coa@pc-coa.caso.pt>
2021-12-07 09:27:46 +01:00
Spring Builds
19a6e33dc5 [artifactory-release] Next development version of of spring-batch-excel 2021-05-28 10:49:19 +00:00
Spring Builds
f98cf0aecf [artifactory-release] Release version 0.1.0 of spring-batch-excel 2021-05-28 10:49:16 +00:00
Mahmoud Ben Hassine
7d09b891db Rollback release 0.1.0 and fix Maven Central validation checks 2021-05-28 12:40:58 +02:00
Spring Builds
8297a93629 [artifactory-release] Next development version of spring-batch-excel 2021-05-28 10:13:39 +00:00