From e3246afe9effa929ea0d366c1f28f83b78a59c95 Mon Sep 17 00:00:00 2001 From: cfsimplicity Date: Tue, 14 Nov 2023 16:18:22 +0000 Subject: [PATCH 1/4] 3.11.0-develop --- Spreadsheet.cfc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spreadsheet.cfc b/Spreadsheet.cfc index 9787ece..e7749dd 100644 --- a/Spreadsheet.cfc +++ b/Spreadsheet.cfc @@ -1,7 +1,7 @@ component accessors="true"{ //"static" - property name="version" default="3.11.0" setter="false"; + property name="version" default="3.11.0-develop" setter="false"; property name="osgiLibBundleVersion" default="5.2.4.1" setter="false"; //first 3 octets = POI version; increment 4th with other jar updates property name="osgiLibBundleSymbolicName" default="spreadsheet-cfml" setter="false"; property name="exceptionType" default="cfsimplicity.spreadsheet" setter="false"; From caa662a1f07276b8a64152cb2dd658e5fc4a64a5 Mon Sep 17 00:00:00 2001 From: cfsimplicity Date: Wed, 15 Nov 2023 10:39:16 +0000 Subject: [PATCH 2/4] readCsv: commons csv boolean options should default to true Fixes #345 --- objects/ReadCsv.cfc | 16 ++++++++-------- test/specs/readCsv.cfm | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/objects/ReadCsv.cfc b/objects/ReadCsv.cfc index e23169d..03f1669 100644 --- a/objects/ReadCsv.cfc +++ b/objects/ReadCsv.cfc @@ -35,12 +35,12 @@ component accessors="true"{ } /* Format configuration */ - public ReadCsv function withAllowMissingColumnNames( required boolean state ){ + public ReadCsv function withAllowMissingColumnNames( boolean state=true ){ variables.format = variables.format.builder().setAllowMissingColumnNames( JavaCast( "boolean", arguments.state ) ).build(); return this; } - public ReadCsv function withAutoFlush( required boolean state ){ + public ReadCsv function withAutoFlush( boolean state=true ){ variables.format = variables.format.builder().setAutoFlush( JavaCast( "boolean", arguments.state ) ).build(); return this; } @@ -81,17 +81,17 @@ component accessors="true"{ return this; } - public ReadCsv function withIgnoreEmptyLines( required boolean state ){ + public ReadCsv function withIgnoreEmptyLines( boolean state=true ){ variables.format = variables.format.builder().setIgnoreEmptyLines( JavaCast( "boolean", arguments.state ) ).build(); return this; } - public ReadCsv function withIgnoreHeaderCase( required boolean state ){ + public ReadCsv function withIgnoreHeaderCase( boolean state=true ){ variables.format = variables.format.builder().setIgnoreHeaderCase( JavaCast( "boolean", arguments.state ) ).build(); return this; } - public ReadCsv function withIgnoreSurroundingSpaces( required boolean state ){ + public ReadCsv function withIgnoreSurroundingSpaces( boolean state=true ){ variables.format = variables.format.builder().setIgnoreSurroundingSpaces( JavaCast( "boolean", arguments.state ) ).build(); return this; } @@ -106,17 +106,17 @@ component accessors="true"{ return this; } - public ReadCsv function withSkipHeaderRecord( required boolean state ){ + public ReadCsv function withSkipHeaderRecord( boolean state=true ){ variables.format = variables.format.builder().setSkipHeaderRecord( JavaCast( "boolean", arguments.state ) ).build(); return this; } - public ReadCsv function withTrailingDelimiter( required boolean state ){ + public ReadCsv function withTrailingDelimiter( boolean state=true ){ variables.format = variables.format.builder().setTrailingDelimiter( JavaCast( "boolean", arguments.state ) ).build(); return this; } - public ReadCsv function withTrim( required boolean state ){ + public ReadCsv function withTrim( boolean state=true ){ variables.format = variables.format.builder().setTrim( JavaCast( "boolean", arguments.state ) ).build(); return this; } diff --git a/test/specs/readCsv.cfm b/test/specs/readCsv.cfm index 646db6e..739c641 100644 --- a/test/specs/readCsv.cfm +++ b/test/specs/readCsv.cfm @@ -153,22 +153,22 @@ describe( "readCsv", function(){ it( "allows Commons CSV format options to be applied", function(){ var path = getTestFilePath( "test.csv" ); var object = s.readCsv( path ) - .withAllowMissingColumnNames( true ) - .withAutoFlush( true ) + .withAllowMissingColumnNames() + .withAutoFlush() .withCommentMarker( "##" ) .withDelimiter( "|" ) .withDuplicateHeaderMode( "ALLOW_EMPTY" ) .withEscapeCharacter( "\" ) .withHeader( [ "Name", "Number" ] ) .withHeaderComments( [ "comment1", "comment2" ] ) - .withIgnoreEmptyLines( true ) - .withIgnoreHeaderCase( true ) - .withIgnoreSurroundingSpaces( true ) + .withIgnoreEmptyLines() + .withIgnoreHeaderCase() + .withIgnoreSurroundingSpaces() .withNullString( "" ) .withQuoteCharacter( "'" ) - .withSkipHeaderRecord( true ) - .withTrailingDelimiter( true ) - .withTrim( true ); + .withSkipHeaderRecord() + .withTrailingDelimiter() + .withTrim(); expect( object.getFormat().getAllowMissingColumnNames() ).toBeTrue(); expect( object.getFormat().getAutoFlush() ).toBeTrue(); expect( object.getFormat().getCommentMarker() ).toBe( "##" ); From 66f8301b0fc34b5491d0e9e3f9930a84e72771da Mon Sep 17 00:00:00 2001 From: cfsimplicity Date: Wed, 15 Nov 2023 10:42:17 +0000 Subject: [PATCH 3/4] Readme: merge extra and convenience functions lists. --- README.md | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 2043545..4d59e8d 100644 --- a/README.md +++ b/README.md @@ -121,10 +121,15 @@ You may wish to place the spreadsheet library files in a central location with a * [addConditionalFormatting](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/addConditionalFormatting) * [addDataValidation](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/addDataValidation) * [addPrintGridlines](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/addPrintGridlines) +* [binaryFromQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/binaryFromQuery) * [cleanUpStreamingXml](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/cleanUpStreamingXml) * [clearCell](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/clearCell) * [clearCellRange](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/clearCellRange) * [createCellStyle](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/createCellStyle) +* [csvToQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/csvToQuery) +* [download](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/download) +* [downloadCsvFromFile](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/downloadCsvFromFile) +* [downloadFileFromQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/downloadFileFromQuery) * [getCellComments](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/getCellComments) * [getCellFormat](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/getCellFormat) * [getCellHyperLink](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/getCellHyperLink) @@ -142,6 +147,10 @@ You may wish to place the spreadsheet library files in a central location with a * [isRowHidden](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/isRowHidden) * [isStreamingXmlFormat](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/isStreamingXmlFormat) * [isXmlFormat](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/isXmlFormat) +* [newStreamingXlsx](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/newStreamingXlsx) +* [newXls](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/newXls) +* [newXlsx](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/newXlsx) +* [queryToCsv](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/queryToCsv) * [readCsv](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/readCsv) * [readLargeFile](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/readLargeFile) * [removePrintGridlines](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/removePrintGridlines) @@ -150,6 +159,7 @@ You may wish to place the spreadsheet library files in a central location with a * [setActiveCell](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setActiveCell) * [setCellHyperLink](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setCellHyperLink) * [setCellRangeValue](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setCellRangeValue) +* [setDateFormats](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setDateFormats) * [setFitToPage](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setFitToPage) * [setFooterImage](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setFooterImage) * [setHeaderImage](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setHeaderImage) @@ -167,23 +177,10 @@ You may wish to place the spreadsheet library files in a central location with a * [sheetInfo](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/sheetInfo) * [showColumn](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/showColumn) * [showRow](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/showRow) -* [writeToCsv](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/writeToCsv) - -### Additional Convenience methods - -* [binaryFromQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/binaryFromQuery) -* [csvToQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/csvToQuery) -* [download](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/download) -* [downloadCsvFromFile](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/downloadCsvFromFile) -* [downloadFileFromQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/downloadFileFromQuery) -* [newStreamingXlsx](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/newStreamingXlsx) -* [newXls](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/newXls) -* [newXlsx](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/newXlsx) -* [queryToCsv](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/queryToCsv) -* [setDateFormats](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setDateFormats) * [workbookFromCsv](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/workbookFromCsv) * [workbookFromQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/workbookFromQuery) * [writeFileFromQuery](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/writeFileFromQuery) +* [writeToCsv](https://github.com/cfsimplicity/spreadsheet-cfml/wiki/writeToCsv) ### Enhanced Read() method From bf972358ad10a85e8d269c440ec2914e24e08485 Mon Sep 17 00:00:00 2001 From: cfsimplicity Date: Wed, 15 Nov 2023 10:47:59 +0000 Subject: [PATCH 4/4] v3.11.1 --- CHANGELOG.md | 5 +++++ ModuleConfig.cfc | 2 +- Spreadsheet.cfc | 2 +- box.json | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1de547d..c50911e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ +## 3.11.1 - 15 November 2023 + +- \#345 readCsv(): Commons CSV boolean options should default to true + ## 3.11.0 - 14 November 2023 - Enhancements + - \#343 Improve csvToQuery() performance - \#340 Add readCsv() for large file/advanced csv processing - \#336 Add parallelization option to queryToCsv() diff --git a/ModuleConfig.cfc b/ModuleConfig.cfc index 3ec0edd..fa0edc3 100644 --- a/ModuleConfig.cfc +++ b/ModuleConfig.cfc @@ -4,7 +4,7 @@ component{ this.author = "Julian Halliwell"; this.webURL = "https://github.com/cfsimplicity/spreadsheet-cfml"; this.description = "CFML Spreadsheet Library"; - this.version = "3.11.0"; + this.version = "3.11.1"; this.autoMapModels = false; function configure(){ diff --git a/Spreadsheet.cfc b/Spreadsheet.cfc index e7749dd..27b9fc1 100644 --- a/Spreadsheet.cfc +++ b/Spreadsheet.cfc @@ -1,7 +1,7 @@ component accessors="true"{ //"static" - property name="version" default="3.11.0-develop" setter="false"; + property name="version" default="3.11.1" setter="false"; property name="osgiLibBundleVersion" default="5.2.4.1" setter="false"; //first 3 octets = POI version; increment 4th with other jar updates property name="osgiLibBundleSymbolicName" default="spreadsheet-cfml" setter="false"; property name="exceptionType" default="cfsimplicity.spreadsheet" setter="false"; diff --git a/box.json b/box.json index fb1e947..3164566 100644 --- a/box.json +++ b/box.json @@ -1,7 +1,7 @@ { "name" : "Spreadsheet CFML", "slug" : "spreadsheet-cfml", - "version" : "3.11.0", + "version" : "3.11.1", "shortDescription" : "CFML spreadsheet library", "author" : "Julian Halliwell", "location" : "forgeboxStorage",