Skip to content

Commit

Permalink
0.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 committed Nov 23, 2023
1 parent bb4a1ec commit 85c7a6c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.2] - 2023-11-24

## [0.4.1] - 2023-09-24

### Added

- queryFile handling in query-catalog.xml configuration file

### Fixed

- main class in pom

### Added

- Code of conduct badge and file
- [Sample jdk compatibility check workflow on branch develop](.github/workflows/build_maven_compatibility.yml)

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<artifactId>query-export-tool</artifactId>

<version>0.4.1</version>
<version>0.4.2</version>
<packaging>jar</packaging>

<name>query-export-tool</name>
Expand Down Expand Up @@ -144,7 +144,7 @@
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>org.fugerit.java.tool.Launcher</mainClass>
<mainClass>org.fugerit.java.query.export.tool.QueryExportToolMain</mainClass>
</manifest>
</archive>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class QueryConfig extends BasicIdConfigType {

@Getter @Setter private String sql;

@Getter @Setter private String queryFile;

@Getter @Setter private String outputFile;

@Getter @Setter private String outputFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.fugerit.java.core.cfg.xml.CustomListCatalogConfig;
import org.fugerit.java.core.cfg.xml.GenericListCatalogConfig;
import org.fugerit.java.core.function.SafeFunction;
import org.fugerit.java.core.io.FileIO;
import org.fugerit.java.core.io.helper.HelperIOException;
import org.fugerit.java.core.io.helper.StreamHelper;
import org.fugerit.java.core.lang.helpers.BooleanUtils;
Expand Down Expand Up @@ -64,6 +65,9 @@ public static void handle( Connection conn, QueryConfig queryConfig ) throws IOE
File file = new File( outputFile );
String format = queryConfig.getOutputFormat();
String query = queryConfig.getSql();
if ( StringUtils.isNotEmpty( queryConfig.getQueryFile() ) ) {
query = FileIO.readString( queryConfig.getQueryFile() );
}
Properties params = new Properties();
if ( StringUtils.isNotEmpty( queryConfig.getXlsResize() ) ) {
params.setProperty( QueryExportFacade.ARG_XLS_RESIZE , queryConfig.getXlsResize() );
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/sample/query-catalog-sample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<query id="Q003" sql="SELECT * FROM test_export" outputFormat="html" outputFile="target/catalog_test_003.html" createPath="1"/>
<query id="Q004" sql="SELECT * FROM test_export" outputFormat="xls" outputFile="target/catalog_test_004.xls" xlsResize="1"/>
<query id="Q005" sql="SELECT * FROM test_export" outputFormat="xlsx" outputFile="target/catalog_test_004.xlsx" xlsTemplate="src/test/resources/template/test_template.xlsx" />
<query id="Q006" queryFile="src/test/resources/sample/sample-query.sql" outputFormat="xlsx" outputFile="target/catalog_test_006.xlsx" />
</query-catalog>

<query-catalog id="fail-catalog">
Expand Down

0 comments on commit 85c7a6c

Please sign in to comment.