Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
cfsimplicity committed Feb 8, 2025
2 parents 98ec3b1 + 2eb5899 commit b83afd6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 27 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.4.0 - 8 February 2025

- \#297 readLargeFile() now works on ACF

## 4.3.1 - 29 January 2025

Fixes:
Expand Down
2 changes: 1 addition & 1 deletion ModuleConfig.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ component{
this.author = "Julian Halliwell";
this.webURL = "https://github.com/cfsimplicity/spreadsheet-cfml";
this.description = "CFML Spreadsheet Library";
this.version = "4.3.1";
this.version = "4.4.0";
this.autoMapModels = false;

function configure(){
Expand Down
5 changes: 1 addition & 4 deletions Spreadsheet.cfc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
component accessors="true"{

//"static"
property name="version" default="4.3.1" setter="false";
property name="version" default="4.4.0" setter="false";
property name="osgiLibBundleVersion" default="5.4.0.0" 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";
Expand Down Expand Up @@ -1297,9 +1297,6 @@ component accessors="true"{
,struct streamingReaderOptions
,boolean returnVisibleValues=false
){
if( !this.getIsLucee() ){
Throw( type=this.getExceptionType() & ".methodNotSupported", message="'readLargeFile()' is only supported on Lucee", detail="'readLargeFile()' currently only works with Lucee." );
}
getFileHelper().throwErrorIFfileNotExists( arguments.src );
getExceptionHelper().throwExceptionIFreadFormatIsInvalid( argumentCollection=arguments );
getSheetHelper().throwErrorIFSheetNameAndNumberArgumentsBothPassed( argumentCollection=arguments );
Expand Down
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "Spreadsheet CFML",
"slug" : "spreadsheet-cfml",
"version" : "4.3.1",
"version" : "4.4.0",
"shortDescription" : "CFML spreadsheet library",
"author" : "Julian Halliwell",
"location" : "forgeboxStorage",
Expand Down
10 changes: 8 additions & 2 deletions helpers/streamingReader.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ component extends="base"{
arguments.sheetToQueryArgs.workbook = getBuilder( arguments.builderOptions ).open( file );
return getSheetHelper().sheetToQuery( argumentCollection=arguments.sheetToQueryArgs );
}
catch( com.github.pjfanning.xlsx.exceptions.ReadException exception ){
getExceptionHelper().throwInvalidFileForReadLargeFileException();
catch( any exception ){
/*
for some reason ACF won't match the exception type as a catch() arg here, i.e.
catch( com.github.pjfanning.xlsx.exceptions.ReadException exception ){}
*/
if( exception.type == "com.github.pjfanning.xlsx.exceptions.ReadException" )
getExceptionHelper().throwInvalidFileForReadLargeFileException();
rethrow;
}
finally{
getFileHelper().closeLocalFileOrStream( local, "file" );
Expand Down
20 changes: 1 addition & 19 deletions test/specs/readLargeFile.cfm
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<cfscript>
describe(
title="readLargeFile (Lucee only)"
,body=function(){
describe( "readLargeFile", function(){
it( "Can read an XLSX file into a query", function(){
var path = getTestFilePath( "large.xlsx" );
Expand Down Expand Up @@ -460,21 +458,5 @@ describe(
});
}
,skip=!s.getIsLucee()
);
describe(
title="readLargeFile (when run on ACF)"
,body=function(){
it( "throws a methodNotSupported exception", function(){
expect( function(){
var path = getTestFilePath( "large.xlsx" );
s.readLargeFile( src=path );
}).toThrow( type="cfsimplicity.spreadsheet.methodNotSupported" );
});
}
,skip=s.getIsLucee()
);
</cfscript>

0 comments on commit b83afd6

Please sign in to comment.