From 188b19990cf77ba8251d4f7f233274572341e05c Mon Sep 17 00:00:00 2001 From: Bruno Ferreira Date: Fri, 3 Mar 2017 15:55:05 +0000 Subject: [PATCH 1/9] changed version to beta7.3 (but it is still unreleased and under development) --- dbptk-bindings/pom.xml | 2 +- dbptk-core/pom.xml | 4 +- dbptk-model/pom.xml | 4 +- dbptk-modules/dbptk-module-db2/pom.xml | 4 +- dbptk-modules/dbptk-module-dbml/pom.xml | 4 +- dbptk-modules/dbptk-module-jdbc/pom.xml | 4 +- .../dbptk-module-list-tables/pom.xml | 4 +- dbptk-modules/dbptk-module-ms-access/pom.xml | 4 +- dbptk-modules/dbptk-module-mysql/pom.xml | 4 +- dbptk-modules/dbptk-module-odbc/pom.xml | 4 +- dbptk-modules/dbptk-module-oracle/pom.xml | 4 +- dbptk-modules/dbptk-module-postgresql/pom.xml | 4 +- dbptk-modules/dbptk-module-siard/pom.xml | 4 +- dbptk-modules/dbptk-module-solr/pom.xml | 4 +- dbptk-modules/dbptk-module-sql-file/pom.xml | 4 +- dbptk-modules/dbptk-module-sql-server/pom.xml | 4 +- dbptk-modules/pom.xml | 4 +- pom.xml | 60 +++++++++---------- 18 files changed, 63 insertions(+), 63 deletions(-) diff --git a/dbptk-bindings/pom.xml b/dbptk-bindings/pom.xml index 2af6f4f3e..66547bc95 100644 --- a/dbptk-bindings/pom.xml +++ b/dbptk-bindings/pom.xml @@ -9,7 +9,7 @@ com.databasepreservation dbptk - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. pom diff --git a/dbptk-core/pom.xml b/dbptk-core/pom.xml index 0ffc3d441..2e81ed713 100644 --- a/dbptk-core/pom.xml +++ b/dbptk-core/pom.xml @@ -6,11 +6,11 @@ dbptk-core com.databasepreservation dbptk-core - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-model/pom.xml b/dbptk-model/pom.xml index 6f20e698a..678030161 100644 --- a/dbptk-model/pom.xml +++ b/dbptk-model/pom.xml @@ -5,12 +5,12 @@ dbptk-model com.databasepreservation dbptk-model - 2.0.0-beta7.2 + 2.0.0-beta7.3 jar com.databasepreservation dbptk - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-db2/pom.xml b/dbptk-modules/dbptk-module-db2/pom.xml index 0cf62e647..860da970e 100644 --- a/dbptk-modules/dbptk-module-db2/pom.xml +++ b/dbptk-modules/dbptk-module-db2/pom.xml @@ -6,11 +6,11 @@ dbptk-module-db2 com.databasepreservation dbptk-module-db2 - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-dbml/pom.xml b/dbptk-modules/dbptk-module-dbml/pom.xml index 3ef0ea70a..21bbd1989 100644 --- a/dbptk-modules/dbptk-module-dbml/pom.xml +++ b/dbptk-modules/dbptk-module-dbml/pom.xml @@ -6,11 +6,11 @@ dbptk-module-dbml com.databasepreservation dbptk-module-dbml - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-jdbc/pom.xml b/dbptk-modules/dbptk-module-jdbc/pom.xml index 928f4eece..5ca372fff 100644 --- a/dbptk-modules/dbptk-module-jdbc/pom.xml +++ b/dbptk-modules/dbptk-module-jdbc/pom.xml @@ -6,11 +6,11 @@ dbptk-module-jdbc com.databasepreservation dbptk-module-jdbc - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-list-tables/pom.xml b/dbptk-modules/dbptk-module-list-tables/pom.xml index aa4420155..662ead2cf 100644 --- a/dbptk-modules/dbptk-module-list-tables/pom.xml +++ b/dbptk-modules/dbptk-module-list-tables/pom.xml @@ -6,11 +6,11 @@ dbptk-module-list-tables com.databasepreservation dbptk-module-list-tables - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-ms-access/pom.xml b/dbptk-modules/dbptk-module-ms-access/pom.xml index 69d88f898..6555ad4af 100644 --- a/dbptk-modules/dbptk-module-ms-access/pom.xml +++ b/dbptk-modules/dbptk-module-ms-access/pom.xml @@ -6,11 +6,11 @@ dbptk-module-ms-access com.databasepreservation dbptk-module-ms-access - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-mysql/pom.xml b/dbptk-modules/dbptk-module-mysql/pom.xml index d28a1b4d8..d255e9a69 100644 --- a/dbptk-modules/dbptk-module-mysql/pom.xml +++ b/dbptk-modules/dbptk-module-mysql/pom.xml @@ -6,11 +6,11 @@ dbptk-module-mysql com.databasepreservation dbptk-module-mysql - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-odbc/pom.xml b/dbptk-modules/dbptk-module-odbc/pom.xml index bedb4f671..5473b72b3 100644 --- a/dbptk-modules/dbptk-module-odbc/pom.xml +++ b/dbptk-modules/dbptk-module-odbc/pom.xml @@ -6,11 +6,11 @@ dbptk-module-odbc com.databasepreservation dbptk-module-odbc - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-oracle/pom.xml b/dbptk-modules/dbptk-module-oracle/pom.xml index 4fa963123..08f44af09 100644 --- a/dbptk-modules/dbptk-module-oracle/pom.xml +++ b/dbptk-modules/dbptk-module-oracle/pom.xml @@ -6,11 +6,11 @@ dbptk-module-oracle com.databasepreservation dbptk-module-oracle - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-postgresql/pom.xml b/dbptk-modules/dbptk-module-postgresql/pom.xml index 30efa319e..a103f22e8 100644 --- a/dbptk-modules/dbptk-module-postgresql/pom.xml +++ b/dbptk-modules/dbptk-module-postgresql/pom.xml @@ -6,11 +6,11 @@ dbptk-module-postgresql com.databasepreservation dbptk-module-postgresql - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-siard/pom.xml b/dbptk-modules/dbptk-module-siard/pom.xml index 3da88dbae..36a54aa0b 100644 --- a/dbptk-modules/dbptk-module-siard/pom.xml +++ b/dbptk-modules/dbptk-module-siard/pom.xml @@ -6,11 +6,11 @@ dbptk-module-siard com.databasepreservation dbptk-module-siard - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-solr/pom.xml b/dbptk-modules/dbptk-module-solr/pom.xml index 6a3c2e278..c3f7cdde5 100644 --- a/dbptk-modules/dbptk-module-solr/pom.xml +++ b/dbptk-modules/dbptk-module-solr/pom.xml @@ -6,11 +6,11 @@ dbptk-module-solr com.databasepreservation dbptk-module-solr - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-sql-file/pom.xml b/dbptk-modules/dbptk-module-sql-file/pom.xml index 90c6a3458..96c545455 100644 --- a/dbptk-modules/dbptk-module-sql-file/pom.xml +++ b/dbptk-modules/dbptk-module-sql-file/pom.xml @@ -6,11 +6,11 @@ dbptk-module-sql-file com.databasepreservation dbptk-module-sql-file - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-sql-server/pom.xml b/dbptk-modules/dbptk-module-sql-server/pom.xml index baed04f0b..7542da529 100644 --- a/dbptk-modules/dbptk-module-sql-server/pom.xml +++ b/dbptk-modules/dbptk-module-sql-server/pom.xml @@ -6,11 +6,11 @@ dbptk-module-sql-server com.databasepreservation dbptk-module-sql-server - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/pom.xml b/dbptk-modules/pom.xml index e3054ede1..35952c64f 100644 --- a/dbptk-modules/pom.xml +++ b/dbptk-modules/pom.xml @@ -5,11 +5,11 @@ dbptk-modules com.databasepreservation dbptk-modules - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk - 2.0.0-beta7.2 + 2.0.0-beta7.3 .. pom diff --git a/pom.xml b/pom.xml index 1c5615565..f2a52d1a3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ Database Preservation Toolkit com.databasepreservation dbptk - 2.0.0-beta7.2 + 2.0.0-beta7.3 pom A toolkit that allows data migration and conversion between database management systems formats and digital preservation formats. @@ -20,7 +20,7 @@ 1.7 ${project.basedir}/vendor-libs/repository - 0.2.7 + 0.2.8 @@ -185,12 +185,12 @@ com.databasepreservation dbptk-model - 2.0.0-beta7.2 + 2.0.0-beta7.3 com.databasepreservation dbptk-model - 2.0.0-beta7.2 + 2.0.0-beta7.3 sources @@ -207,35 +207,35 @@ - com.databasepreservationdbptk-module-db22.0.0-beta7.2 - com.databasepreservationdbptk-module-db22.0.0-beta7.2sources + com.databasepreservationdbptk-module-db22.0.0-beta7.3 + com.databasepreservationdbptk-module-db22.0.0-beta7.3sources - com.databasepreservationdbptk-module-dbml2.0.0-beta7.2 - com.databasepreservationdbptk-module-dbml2.0.0-beta7.2sources + com.databasepreservationdbptk-module-dbml2.0.0-beta7.3 + com.databasepreservationdbptk-module-dbml2.0.0-beta7.3sources - com.databasepreservationdbptk-module-jdbc2.0.0-beta7.2 - com.databasepreservationdbptk-module-jdbc2.0.0-beta7.2sources + com.databasepreservationdbptk-module-jdbc2.0.0-beta7.3 + com.databasepreservationdbptk-module-jdbc2.0.0-beta7.3sources - com.databasepreservationdbptk-module-list-tables2.0.0-beta7.2 - com.databasepreservationdbptk-module-list-tables2.0.0-beta7.2sources + com.databasepreservationdbptk-module-list-tables2.0.0-beta7.3 + com.databasepreservationdbptk-module-list-tables2.0.0-beta7.3sources - com.databasepreservationdbptk-module-ms-access2.0.0-beta7.2 - com.databasepreservationdbptk-module-ms-access2.0.0-beta7.2sources + com.databasepreservationdbptk-module-ms-access2.0.0-beta7.3 + com.databasepreservationdbptk-module-ms-access2.0.0-beta7.3sources - com.databasepreservationdbptk-module-mysql2.0.0-beta7.2 - com.databasepreservationdbptk-module-mysql2.0.0-beta7.2sources + com.databasepreservationdbptk-module-mysql2.0.0-beta7.3 + com.databasepreservationdbptk-module-mysql2.0.0-beta7.3sources - com.databasepreservationdbptk-module-odbc2.0.0-beta7.2 - com.databasepreservationdbptk-module-odbc2.0.0-beta7.2sources + com.databasepreservationdbptk-module-odbc2.0.0-beta7.3 + com.databasepreservationdbptk-module-odbc2.0.0-beta7.3sources - com.databasepreservationdbptk-module-oracle2.0.0-beta7.2 - com.databasepreservationdbptk-module-oracle2.0.0-beta7.2sources + com.databasepreservationdbptk-module-oracle2.0.0-beta7.3 + com.databasepreservationdbptk-module-oracle2.0.0-beta7.3sources - com.databasepreservationdbptk-module-postgresql2.0.0-beta7.2 - com.databasepreservationdbptk-module-postgresql2.0.0-beta7.2sources + com.databasepreservationdbptk-module-postgresql2.0.0-beta7.3 + com.databasepreservationdbptk-module-postgresql2.0.0-beta7.3sources - com.databasepreservationdbptk-module-siard2.0.0-beta7.2 - com.databasepreservationdbptk-module-siard2.0.0-beta7.2sources + com.databasepreservationdbptk-module-siard2.0.0-beta7.3 + com.databasepreservationdbptk-module-siard2.0.0-beta7.3sources com.databasepreservationdbptk-bindings-siard11.1.1 com.databasepreservationdbptk-bindings-siard11.1.1sources @@ -246,14 +246,14 @@ com.databasepreservationdbptk-bindings-siarddk1.3.0 com.databasepreservationdbptk-bindings-siarddk1.3.0sources - com.databasepreservationdbptk-module-solr2.0.0-beta7.2 - com.databasepreservationdbptk-module-solr2.0.0-beta7.2sources + com.databasepreservationdbptk-module-solr2.0.0-beta7.3 + com.databasepreservationdbptk-module-solr2.0.0-beta7.3sources - com.databasepreservationdbptk-module-sql-file2.0.0-beta7.2 - com.databasepreservationdbptk-module-sql-file2.0.0-beta7.2sources + com.databasepreservationdbptk-module-sql-file2.0.0-beta7.3 + com.databasepreservationdbptk-module-sql-file2.0.0-beta7.3sources - com.databasepreservationdbptk-module-sql-server2.0.0-beta7.2 - com.databasepreservationdbptk-module-sql-server2.0.0-beta7.2sources + com.databasepreservationdbptk-module-sql-server2.0.0-beta7.3 + com.databasepreservationdbptk-module-sql-server2.0.0-beta7.3sources From dd35ea3f56cf9af782629cde69d606e7113dddb7 Mon Sep 17 00:00:00 2001 From: Bruno Ferreira Date: Tue, 14 Mar 2017 15:06:38 +0000 Subject: [PATCH 2/9] related to keeps/db-visualization-toolkit#96: adds a way to observe a conversion and be notified of its progress, SIARD import modules use this system to notify observers --- .../common/ModuleObserver.java | 36 ++++++++ .../common/ObservableModule.java | 91 +++++++++++++++++++ .../model/NoOpReporter.java | 1 - .../databasepreservation/model/Reporter.java | 38 ++++---- .../in/content/ContentImportStrategy.java | 4 +- .../content/SIARD1ContentImportStrategy.java | 18 +++- .../content/SIARD2ContentImportStrategy.java | 18 +++- .../content/SIARDDKContentImportStrategy.java | 18 +++- .../siard/in/input/SIARDImportDefault.java | 8 +- .../modules/solr/SolrExportModule.java | 1 + 10 files changed, 205 insertions(+), 28 deletions(-) create mode 100644 dbptk-model/src/main/java/com/databasepreservation/common/ModuleObserver.java create mode 100644 dbptk-model/src/main/java/com/databasepreservation/common/ObservableModule.java diff --git a/dbptk-model/src/main/java/com/databasepreservation/common/ModuleObserver.java b/dbptk-model/src/main/java/com/databasepreservation/common/ModuleObserver.java new file mode 100644 index 000000000..956765880 --- /dev/null +++ b/dbptk-model/src/main/java/com/databasepreservation/common/ModuleObserver.java @@ -0,0 +1,36 @@ +package com.databasepreservation.common; + +import com.databasepreservation.model.structure.DatabaseStructure; +import com.databasepreservation.model.structure.SchemaStructure; +import com.databasepreservation.model.structure.TableStructure; + +/** + * Receives notifications about changes in modules + * + * @author Bruno Ferreira + */ +public interface ModuleObserver { + void notifyOpenDatabase(); + + void notifyStructureObtained(DatabaseStructure structure); + + void notifyOpenSchema(DatabaseStructure structure, SchemaStructure schema, long completedSchemas, + long completedTablesInSchema); + + void notifyOpenTable(DatabaseStructure structure, TableStructure table, long completedSchemas, + long completedTablesInSchema); + + /** + * Notify about progress in converting a table. Delta between 2 reports may be + * more than a single row. + */ + void notifyTableProgress(DatabaseStructure structure, TableStructure table, long completedRows, long totalRows); + + void notifyCloseTable(DatabaseStructure structure, TableStructure table, long completedSchemas, + long completedTablesInSchema); + + void notifyCloseSchema(DatabaseStructure structure, SchemaStructure schema, long completedSchemas, + long completedTablesInSchema); + + void notifyCloseDatabase(DatabaseStructure structure); +} diff --git a/dbptk-model/src/main/java/com/databasepreservation/common/ObservableModule.java b/dbptk-model/src/main/java/com/databasepreservation/common/ObservableModule.java new file mode 100644 index 000000000..f383b5338 --- /dev/null +++ b/dbptk-model/src/main/java/com/databasepreservation/common/ObservableModule.java @@ -0,0 +1,91 @@ +package com.databasepreservation.common; + +import java.util.ArrayList; +import java.util.List; + +import com.databasepreservation.model.structure.DatabaseStructure; +import com.databasepreservation.model.structure.SchemaStructure; +import com.databasepreservation.model.structure.TableStructure; + +/** + * Updates ModuleObservers about conversion events (e.g. progress) + * + * @author Bruno Ferreira + */ +public abstract class ObservableModule { + private final List observers; + + public ObservableModule() { + super(); + this.observers = new ArrayList<>(); + } + + public void addModuleObserver(ModuleObserver observer) { + observers.add(observer); + } + + public void removeModuleObserver(ModuleObserver observer) { + observers.remove(observer); + } + + /************************************************************************** + * Events notification + */ + + public void notifyOpenDatabase() { + for (ModuleObserver observer : observers) { + observer.notifyOpenDatabase(); + } + } + + public void notifyStructureObtained(DatabaseStructure structure) { + for (ModuleObserver observer : observers) { + observer.notifyStructureObtained(structure); + } + } + + public void notifyOpenSchema(DatabaseStructure structure, SchemaStructure schema, long completedSchemas, + long completedTablesInSchema) { + for (ModuleObserver observer : observers) { + observer.notifyOpenSchema(structure, schema, completedSchemas, completedTablesInSchema); + } + } + + public void notifyOpenTable(DatabaseStructure structure, TableStructure table, long completedSchemas, + long completedTablesInSchema) { + for (ModuleObserver observer : observers) { + observer.notifyOpenTable(structure, table, completedSchemas, completedTablesInSchema); + } + } + + /** + * Notify about progress in converting a table. Delta between 2 reports may be + * more than a single row. + */ + public void notifyTableProgress(DatabaseStructure structure, TableStructure table, long completedRows, long totalRows) { + for (ModuleObserver observer : observers) { + observer.notifyTableProgress(structure, table, completedRows, totalRows); + } + } + + public void notifyCloseTable(DatabaseStructure structure, TableStructure table, long completedSchemas, + long completedTablesInSchema) { + for (ModuleObserver observer : observers) { + observer.notifyCloseTable(structure, table, completedSchemas, completedTablesInSchema); + } + } + + public void notifyCloseSchema(DatabaseStructure structure, SchemaStructure schema, long completedSchemas, + long completedTablesInSchema) { + for (ModuleObserver observer : observers) { + observer.notifyCloseSchema(structure, schema, completedSchemas, completedTablesInSchema); + } + } + + public void notifyCloseDatabase(DatabaseStructure structure) { + for (ModuleObserver observer : observers) { + observer.notifyCloseDatabase(structure); + } + } + +} diff --git a/dbptk-model/src/main/java/com/databasepreservation/model/NoOpReporter.java b/dbptk-model/src/main/java/com/databasepreservation/model/NoOpReporter.java index 0de70c955..8653a777b 100644 --- a/dbptk-model/src/main/java/com/databasepreservation/model/NoOpReporter.java +++ b/dbptk-model/src/main/java/com/databasepreservation/model/NoOpReporter.java @@ -20,7 +20,6 @@ public NoOpReporter() { public NoOpReporter(String directory) { } - @Override protected void initialize(String directory) { } diff --git a/dbptk-model/src/main/java/com/databasepreservation/model/Reporter.java b/dbptk-model/src/main/java/com/databasepreservation/model/Reporter.java index badcf7ca8..fb65c6560 100644 --- a/dbptk-model/src/main/java/com/databasepreservation/model/Reporter.java +++ b/dbptk-model/src/main/java/com/databasepreservation/model/Reporter.java @@ -59,34 +59,30 @@ public class Reporter implements Closeable { private Path outputfile; private BufferedWriter writer; - /** - * Creates a new reporter using the directory specified in - * Reporter.REPORT_FOLDER - */ public Reporter() { - this(null); + this(null, null); } - public Reporter(String directory) { - initialize(directory); - } - - protected void initialize(String directory) { + public Reporter(String directory, String name) { + // set defaults if needed if (directory == null) { directory = "."; } - String filenamePrefix = "dbptk-report-"; - String filenameTimestamp = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()); - String filenameSuffix = ".txt"; - outputfile = Paths.get(directory).toAbsolutePath().resolve(filenamePrefix + filenameTimestamp + filenameSuffix); - try { - outputfile = Files.createFile(outputfile); - } catch (IOException e) { - LOGGER.warn("Could not create report file in current working directory. Attempting to use a temporary file", e); + if (StringUtils.isBlank(name)) { + name = "dbptk-report-" + new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + ".txt"; + } + + outputfile = Paths.get(directory).toAbsolutePath().resolve(name); + if (Files.notExists(outputfile)) { try { - outputfile = Files.createTempFile(filenamePrefix, filenameSuffix); - } catch (IOException e1) { - LOGGER.error("Could not create report temporary file. Reporting will not function.", e1); + outputfile = Files.createFile(outputfile); + } catch (IOException e) { + LOGGER.warn("Could not create report file in current working directory. Attempting to use a temporary file", e); + try { + outputfile = Files.createTempFile("dbptk-report-", ".txt"); + } catch (IOException e1) { + LOGGER.error("Could not create report temporary file. Reporting will not function.", e1); + } } } diff --git a/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/ContentImportStrategy.java b/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/ContentImportStrategy.java index c941d6f6c..4e66730fc 100644 --- a/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/ContentImportStrategy.java +++ b/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/ContentImportStrategy.java @@ -1,5 +1,6 @@ package com.databasepreservation.modules.siard.in.content; +import com.databasepreservation.common.ObservableModule; import com.databasepreservation.model.exception.ModuleException; import com.databasepreservation.model.modules.DatabaseExportModule; import com.databasepreservation.model.modules.ModuleSettings; @@ -11,5 +12,6 @@ */ public interface ContentImportStrategy { void importContent(DatabaseExportModule handler, SIARDArchiveContainer container, - DatabaseStructure databaseStructure, ModuleSettings moduleSettings) throws ModuleException; + DatabaseStructure databaseStructure, ModuleSettings moduleSettings, ObservableModule observer) + throws ModuleException; } diff --git a/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/SIARD1ContentImportStrategy.java b/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/SIARD1ContentImportStrategy.java index 4b7ed8cb2..e83581806 100644 --- a/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/SIARD1ContentImportStrategy.java +++ b/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/SIARD1ContentImportStrategy.java @@ -25,6 +25,7 @@ import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; +import com.databasepreservation.common.ObservableModule; import com.databasepreservation.model.data.BinaryCell; import com.databasepreservation.model.data.Cell; import com.databasepreservation.model.data.NullCell; @@ -78,6 +79,8 @@ public class SIARD1ContentImportStrategy extends DefaultHandler implements Conte private Row row; private long rowIndex; private long currentTableTotalRows; + private ObservableModule observable; + private DatabaseStructure databaseStructure; private long lastProgressTimestamp; @@ -88,10 +91,13 @@ public SIARD1ContentImportStrategy(ReadStrategy readStrategy, ContentPathImportS @Override public void importContent(DatabaseExportModule handler, SIARDArchiveContainer container, - DatabaseStructure databaseStructure, ModuleSettings moduleSettings) throws ModuleException { + DatabaseStructure databaseStructure, ModuleSettings moduleSettings, ObservableModule observable) + throws ModuleException { // set instance state this.databaseExportModule = handler; this.contentContainer = container; + this.observable = observable; + this.databaseStructure = databaseStructure; // pre-setup parser and validation SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); @@ -102,9 +108,13 @@ public void importContent(DatabaseExportModule handler, SIARDArchiveContainer co SAXParser saxParser = null; // process tables + long completedSchemas = 0; + long completedTablesInSchema; for (SchemaStructure schema : databaseStructure.getSchemas()) { boolean schemaHandled = false; currentSchema = schema; + completedTablesInSchema = 0; + observable.notifyOpenSchema(databaseStructure, schema, completedSchemas, completedTablesInSchema); try { databaseExportModule.handleDataOpenSchema(currentSchema.getName()); schemaHandled = true; @@ -124,6 +134,7 @@ public void importContent(DatabaseExportModule handler, SIARDArchiveContainer co } catch (ModuleException e) { LOGGER.error("An error occurred while handling data open table", e); } + observable.notifyOpenTable(databaseStructure, table, completedSchemas, completedTablesInSchema); this.currentTableTotalRows = currentTable.getRows(); lastProgressTimestamp = System.currentTimeMillis(); @@ -190,6 +201,8 @@ public void importContent(DatabaseExportModule handler, SIARDArchiveContainer co LOGGER.info("Total of " + rowIndex + " row(s) processed"); + completedTablesInSchema++; + observable.notifyCloseTable(databaseStructure, table, completedSchemas, completedTablesInSchema); try { databaseExportModule.handleDataCloseTable(currentTable.getId()); } catch (ModuleException e) { @@ -200,6 +213,8 @@ public void importContent(DatabaseExportModule handler, SIARDArchiveContainer co } } + completedSchemas++; + observable.notifyCloseSchema(databaseStructure, schema, completedSchemas, schema.getTables().size()); try { databaseExportModule.handleDataCloseSchema(currentSchema.getName()); } catch (ModuleException e) { @@ -303,6 +318,7 @@ public void endElement(String uri, String localName, String qName) throws SAXExc if (rowIndex % 1000 == 0 && System.currentTimeMillis() - lastProgressTimestamp > 3000) { lastProgressTimestamp = System.currentTimeMillis(); + observable.notifyTableProgress(databaseStructure, currentTable, rowIndex - 2, currentTableTotalRows); if (currentTableTotalRows > 0) { LOGGER.info(String.format("Progress: %d rows of table %s.%s (%d%%)", rowIndex, currentTable.getSchema(), currentTable.getName(), rowIndex * 100 / currentTableTotalRows)); diff --git a/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/SIARD2ContentImportStrategy.java b/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/SIARD2ContentImportStrategy.java index 47f1ecf37..3c7cd726c 100644 --- a/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/SIARD2ContentImportStrategy.java +++ b/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/SIARD2ContentImportStrategy.java @@ -26,6 +26,7 @@ import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; +import com.databasepreservation.common.ObservableModule; import com.databasepreservation.common.PathInputStreamProvider; import com.databasepreservation.model.data.BinaryCell; import com.databasepreservation.model.data.Cell; @@ -81,6 +82,8 @@ public class SIARD2ContentImportStrategy extends DefaultHandler implements Conte private Row row; private long rowIndex; private long currentTableTotalRows; + private ObservableModule observable; + private DatabaseStructure databaseStructure; private long lastProgressTimestamp; @@ -93,10 +96,13 @@ public SIARD2ContentImportStrategy(ReadStrategy readStrategy, ContentPathImportS @Override public void importContent(DatabaseExportModule handler, SIARDArchiveContainer container, - DatabaseStructure databaseStructure, ModuleSettings moduleSettings) throws ModuleException { + DatabaseStructure databaseStructure, ModuleSettings moduleSettings, ObservableModule observable) + throws ModuleException { // set instance state this.databaseExportModule = handler; this.contentContainer = container; + this.observable = observable; + this.databaseStructure = databaseStructure; // pre-setup parser and validation SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); @@ -107,9 +113,13 @@ public void importContent(DatabaseExportModule handler, SIARDArchiveContainer co SAXParser saxParser = null; // process tables + long completedSchemas = 0; + long completedTablesInSchema; for (SchemaStructure schema : databaseStructure.getSchemas()) { boolean schemaHandled = false; currentSchema = schema; + completedTablesInSchema = 0; + observable.notifyOpenSchema(databaseStructure, schema, completedSchemas, completedTablesInSchema); try { databaseExportModule.handleDataOpenSchema(currentSchema.getName()); schemaHandled = true; @@ -129,6 +139,7 @@ public void importContent(DatabaseExportModule handler, SIARDArchiveContainer co } catch (ModuleException e) { LOGGER.error("An error occurred while handling data open table", e); } + observable.notifyOpenTable(databaseStructure, table, completedSchemas, completedTablesInSchema); this.currentTableTotalRows = currentTable.getRows(); lastProgressTimestamp = System.currentTimeMillis(); @@ -192,6 +203,8 @@ public void importContent(DatabaseExportModule handler, SIARDArchiveContainer co LOGGER.info("Total of " + rowIndex + " row(s) processed"); + completedTablesInSchema++; + observable.notifyCloseTable(databaseStructure, table, completedSchemas, completedTablesInSchema); try { databaseExportModule.handleDataCloseTable(currentTable.getId()); } catch (ModuleException e) { @@ -202,6 +215,8 @@ public void importContent(DatabaseExportModule handler, SIARDArchiveContainer co } } + completedSchemas++; + observable.notifyCloseSchema(databaseStructure, schema, completedSchemas, schema.getTables().size()); try { databaseExportModule.handleDataCloseSchema(currentSchema.getName()); } catch (ModuleException e) { @@ -324,6 +339,7 @@ public void endElement(String uri, String localName, String qName) throws SAXExc if (rowIndex % 1000 == 0 && System.currentTimeMillis() - lastProgressTimestamp > 3000) { lastProgressTimestamp = System.currentTimeMillis(); + observable.notifyTableProgress(databaseStructure, currentTable, rowIndex - 2, currentTableTotalRows); if (currentTableTotalRows > 0) { LOGGER.info(String.format("Progress: %d rows of table %s.%s (%d%%)", rowIndex, currentTable.getSchema(), currentTable.getName(), rowIndex * 100 / currentTableTotalRows)); diff --git a/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/SIARDDKContentImportStrategy.java b/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/SIARDDKContentImportStrategy.java index c5d0d5ef8..a1df9049d 100644 --- a/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/SIARDDKContentImportStrategy.java +++ b/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/content/SIARDDKContentImportStrategy.java @@ -31,6 +31,7 @@ import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; +import com.databasepreservation.common.ObservableModule; import com.databasepreservation.model.data.Cell; import com.databasepreservation.model.data.NullCell; import com.databasepreservation.model.data.Row; @@ -76,6 +77,8 @@ public class SIARDDKContentImportStrategy extends DefaultHandler implements Cont private static final String SIARDDK_NIL_LOCAL_ATTR_NAME = "nil"; protected TypeInfoProvider typeInfoProvider; protected TypeInfo xsdCellType; + private ObservableModule observable; + private DatabaseStructure databaseStructure; /** * @author Thomas Kristensen @@ -91,7 +94,10 @@ public SIARDDKContentImportStrategy(FolderReadStrategyMD5Sum readStrategy, SIARD @Override public void importContent(DatabaseExportModule dbExportHandler, SIARDArchiveContainer mainFolder, - DatabaseStructure databaseStructure, ModuleSettings moduleSettings) throws ModuleException { + DatabaseStructure databaseStructure, ModuleSettings moduleSettings, ObservableModule observable) + throws ModuleException { + this.observable = observable; + this.databaseStructure = databaseStructure; pathStrategy.parseFileIndexMetadata(); this.dbExportHandler = dbExportHandler; Map archiveContainerByAbsPath = new HashMap(); @@ -105,11 +111,16 @@ public void importContent(DatabaseExportModule dbExportHandler, SIARDArchiveCont SIARDArchiveContainer currentFolder = null; assert (databaseStructure.getSchemas().size() == 1); this.dbExportHandler.handleDataOpenSchema(importAsSchema); + long completedSchemas = 0; + long completedTablesInSchema; for (SchemaStructure schema : databaseStructure.getSchemas()) { + completedTablesInSchema = 0; + observable.notifyOpenSchema(databaseStructure, schema, completedSchemas, completedTablesInSchema); assert (schema.getName().equals(importAsSchema)); for (TableStructure table : schema.getTables()) { currentTable = table; this.dbExportHandler.handleDataOpenTable(table.getId()); + observable.notifyOpenTable(databaseStructure, table, completedSchemas, completedTablesInSchema); rowIndex = 0; String xsdFileName = pathStrategy.getTableXSDFilePath(schema.getName(), table.getId()); String xmlFileName = pathStrategy.getTableXMLFilePath(schema.getName(), table.getId()); @@ -173,8 +184,12 @@ public void importContent(DatabaseExportModule dbExportHandler, SIARDArchiveCont readStrategy.closeAndVerifyMD5Sum(currentTableInputStream); readStrategy.closeAndVerifyMD5Sum(xsdInputStream); + completedTablesInSchema++; + observable.notifyCloseTable(databaseStructure, table, completedSchemas, completedTablesInSchema); this.dbExportHandler.handleDataCloseTable(table.getId()); } + completedSchemas++; + observable.notifyCloseSchema(databaseStructure, schema, completedSchemas, schema.getTables().size()); this.dbExportHandler.handleDataCloseSchema(importAsSchema); } @@ -231,6 +246,7 @@ public void endElement(String uri, String localName, String qName) throws SAXExc assert !lstCells.contains(null); currentRow.setCells(lstCells); try { + observable.notifyTableProgress(databaseStructure, currentTable, rowIndex - 2, currentTable.getRows()); this.dbExportHandler.handleDataRow(currentRow); } catch (InvalidDataException e) { throw new SAXException(e.getMessage() + " Row index:" + rowIndex, e); diff --git a/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/input/SIARDImportDefault.java b/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/input/SIARDImportDefault.java index e51f4eef1..aac0278db 100644 --- a/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/input/SIARDImportDefault.java +++ b/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/in/input/SIARDImportDefault.java @@ -1,5 +1,6 @@ package com.databasepreservation.modules.siard.in.input; +import com.databasepreservation.common.ObservableModule; import com.databasepreservation.model.Reporter; import com.databasepreservation.model.exception.InvalidDataException; import com.databasepreservation.model.exception.ModuleException; @@ -16,7 +17,7 @@ /** * @author Bruno Ferreira */ -public class SIARDImportDefault implements DatabaseImportModule { +public class SIARDImportDefault extends ObservableModule implements DatabaseImportModule { private final ReadStrategy readStrategy; private final SIARDArchiveContainer mainContainer; private final ContentImportStrategy contentStrategy; @@ -38,6 +39,7 @@ public void getDatabase(DatabaseExportModule handler) throws ModuleException, Un moduleSettings = handler.getModuleSettings(); readStrategy.setup(mainContainer); handler.initDatabase(); + notifyOpenDatabase(); try { metadataStrategy.loadMetadata(readStrategy, mainContainer, moduleSettings); @@ -46,9 +48,11 @@ public void getDatabase(DatabaseExportModule handler) throws ModuleException, Un // handler.setIgnoredSchemas(null); handler.handleStructure(dbStructure); + notifyStructureObtained(dbStructure); - contentStrategy.importContent(handler, mainContainer, dbStructure, moduleSettings); + contentStrategy.importContent(handler, mainContainer, dbStructure, moduleSettings, (ObservableModule) this); + notifyCloseDatabase(dbStructure); handler.finishDatabase(); } finally { readStrategy.finish(mainContainer); diff --git a/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrExportModule.java b/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrExportModule.java index 1d9797fb6..3948a06bc 100644 --- a/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrExportModule.java +++ b/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrExportModule.java @@ -179,6 +179,7 @@ public void handleDataCloseSchema(String schemaName) throws ModuleException { */ @Override public void finishDatabase() throws ModuleException { + solrManager.markDatabaseAsReady(viewerDatabase); solrManager.commitAll(); solrManager.freeResources(); } From e9aad37151a80a2b30d30f5bde91b526ce6f99fe Mon Sep 17 00:00:00 2001 From: Bruno Ferreira Date: Thu, 16 Mar 2017 11:11:52 +0000 Subject: [PATCH 3/9] append -dev to development versions that should not be used --- dbptk-bindings/pom.xml | 2 +- dbptk-core/pom.xml | 4 +- dbptk-model/pom.xml | 4 +- dbptk-modules/dbptk-module-db2/pom.xml | 4 +- dbptk-modules/dbptk-module-dbml/pom.xml | 4 +- dbptk-modules/dbptk-module-jdbc/pom.xml | 4 +- .../dbptk-module-list-tables/pom.xml | 4 +- dbptk-modules/dbptk-module-ms-access/pom.xml | 4 +- dbptk-modules/dbptk-module-mysql/pom.xml | 4 +- dbptk-modules/dbptk-module-odbc/pom.xml | 4 +- dbptk-modules/dbptk-module-oracle/pom.xml | 4 +- dbptk-modules/dbptk-module-postgresql/pom.xml | 4 +- dbptk-modules/dbptk-module-siard/pom.xml | 4 +- dbptk-modules/dbptk-module-solr/pom.xml | 4 +- dbptk-modules/dbptk-module-sql-file/pom.xml | 4 +- dbptk-modules/dbptk-module-sql-server/pom.xml | 4 +- dbptk-modules/pom.xml | 4 +- pom.xml | 58 +++++++++---------- 18 files changed, 62 insertions(+), 62 deletions(-) diff --git a/dbptk-bindings/pom.xml b/dbptk-bindings/pom.xml index 66547bc95..d12ed21ea 100644 --- a/dbptk-bindings/pom.xml +++ b/dbptk-bindings/pom.xml @@ -9,7 +9,7 @@ com.databasepreservation dbptk - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. pom diff --git a/dbptk-core/pom.xml b/dbptk-core/pom.xml index 2e81ed713..070ebe1a3 100644 --- a/dbptk-core/pom.xml +++ b/dbptk-core/pom.xml @@ -6,11 +6,11 @@ dbptk-core com.databasepreservation dbptk-core - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-model/pom.xml b/dbptk-model/pom.xml index 678030161..0fbfd8f78 100644 --- a/dbptk-model/pom.xml +++ b/dbptk-model/pom.xml @@ -5,12 +5,12 @@ dbptk-model com.databasepreservation dbptk-model - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev jar com.databasepreservation dbptk - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-modules/dbptk-module-db2/pom.xml b/dbptk-modules/dbptk-module-db2/pom.xml index 860da970e..7709c2316 100644 --- a/dbptk-modules/dbptk-module-db2/pom.xml +++ b/dbptk-modules/dbptk-module-db2/pom.xml @@ -6,11 +6,11 @@ dbptk-module-db2 com.databasepreservation dbptk-module-db2 - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-modules/dbptk-module-dbml/pom.xml b/dbptk-modules/dbptk-module-dbml/pom.xml index 21bbd1989..0a8abd38a 100644 --- a/dbptk-modules/dbptk-module-dbml/pom.xml +++ b/dbptk-modules/dbptk-module-dbml/pom.xml @@ -6,11 +6,11 @@ dbptk-module-dbml com.databasepreservation dbptk-module-dbml - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-modules/dbptk-module-jdbc/pom.xml b/dbptk-modules/dbptk-module-jdbc/pom.xml index 5ca372fff..db8127a6f 100644 --- a/dbptk-modules/dbptk-module-jdbc/pom.xml +++ b/dbptk-modules/dbptk-module-jdbc/pom.xml @@ -6,11 +6,11 @@ dbptk-module-jdbc com.databasepreservation dbptk-module-jdbc - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-modules/dbptk-module-list-tables/pom.xml b/dbptk-modules/dbptk-module-list-tables/pom.xml index 662ead2cf..84bd76b11 100644 --- a/dbptk-modules/dbptk-module-list-tables/pom.xml +++ b/dbptk-modules/dbptk-module-list-tables/pom.xml @@ -6,11 +6,11 @@ dbptk-module-list-tables com.databasepreservation dbptk-module-list-tables - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-modules/dbptk-module-ms-access/pom.xml b/dbptk-modules/dbptk-module-ms-access/pom.xml index 6555ad4af..3f4cfb051 100644 --- a/dbptk-modules/dbptk-module-ms-access/pom.xml +++ b/dbptk-modules/dbptk-module-ms-access/pom.xml @@ -6,11 +6,11 @@ dbptk-module-ms-access com.databasepreservation dbptk-module-ms-access - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-modules/dbptk-module-mysql/pom.xml b/dbptk-modules/dbptk-module-mysql/pom.xml index d255e9a69..1e56354d5 100644 --- a/dbptk-modules/dbptk-module-mysql/pom.xml +++ b/dbptk-modules/dbptk-module-mysql/pom.xml @@ -6,11 +6,11 @@ dbptk-module-mysql com.databasepreservation dbptk-module-mysql - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-modules/dbptk-module-odbc/pom.xml b/dbptk-modules/dbptk-module-odbc/pom.xml index 5473b72b3..8e28676e8 100644 --- a/dbptk-modules/dbptk-module-odbc/pom.xml +++ b/dbptk-modules/dbptk-module-odbc/pom.xml @@ -6,11 +6,11 @@ dbptk-module-odbc com.databasepreservation dbptk-module-odbc - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-modules/dbptk-module-oracle/pom.xml b/dbptk-modules/dbptk-module-oracle/pom.xml index 08f44af09..dd2ce8522 100644 --- a/dbptk-modules/dbptk-module-oracle/pom.xml +++ b/dbptk-modules/dbptk-module-oracle/pom.xml @@ -6,11 +6,11 @@ dbptk-module-oracle com.databasepreservation dbptk-module-oracle - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-modules/dbptk-module-postgresql/pom.xml b/dbptk-modules/dbptk-module-postgresql/pom.xml index a103f22e8..235381902 100644 --- a/dbptk-modules/dbptk-module-postgresql/pom.xml +++ b/dbptk-modules/dbptk-module-postgresql/pom.xml @@ -6,11 +6,11 @@ dbptk-module-postgresql com.databasepreservation dbptk-module-postgresql - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-modules/dbptk-module-siard/pom.xml b/dbptk-modules/dbptk-module-siard/pom.xml index 36a54aa0b..706c78026 100644 --- a/dbptk-modules/dbptk-module-siard/pom.xml +++ b/dbptk-modules/dbptk-module-siard/pom.xml @@ -6,11 +6,11 @@ dbptk-module-siard com.databasepreservation dbptk-module-siard - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-modules/dbptk-module-solr/pom.xml b/dbptk-modules/dbptk-module-solr/pom.xml index c3f7cdde5..1354ca272 100644 --- a/dbptk-modules/dbptk-module-solr/pom.xml +++ b/dbptk-modules/dbptk-module-solr/pom.xml @@ -6,11 +6,11 @@ dbptk-module-solr com.databasepreservation dbptk-module-solr - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-modules/dbptk-module-sql-file/pom.xml b/dbptk-modules/dbptk-module-sql-file/pom.xml index 96c545455..afbb7df21 100644 --- a/dbptk-modules/dbptk-module-sql-file/pom.xml +++ b/dbptk-modules/dbptk-module-sql-file/pom.xml @@ -6,11 +6,11 @@ dbptk-module-sql-file com.databasepreservation dbptk-module-sql-file - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-modules/dbptk-module-sql-server/pom.xml b/dbptk-modules/dbptk-module-sql-server/pom.xml index 7542da529..d1b4f29fd 100644 --- a/dbptk-modules/dbptk-module-sql-server/pom.xml +++ b/dbptk-modules/dbptk-module-sql-server/pom.xml @@ -6,11 +6,11 @@ dbptk-module-sql-server com.databasepreservation dbptk-module-sql-server - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. diff --git a/dbptk-modules/pom.xml b/dbptk-modules/pom.xml index 35952c64f..af5db1bbe 100644 --- a/dbptk-modules/pom.xml +++ b/dbptk-modules/pom.xml @@ -5,11 +5,11 @@ dbptk-modules com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev .. pom diff --git a/pom.xml b/pom.xml index f2a52d1a3..6f7a83671 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ Database Preservation Toolkit com.databasepreservation dbptk - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev pom A toolkit that allows data migration and conversion between database management systems formats and digital preservation formats. @@ -185,12 +185,12 @@ com.databasepreservation dbptk-model - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev com.databasepreservation dbptk-model - 2.0.0-beta7.3 + 2.0.0-beta7.3-dev sources @@ -207,35 +207,35 @@ - com.databasepreservationdbptk-module-db22.0.0-beta7.3 - com.databasepreservationdbptk-module-db22.0.0-beta7.3sources + com.databasepreservationdbptk-module-db22.0.0-beta7.3-dev + com.databasepreservationdbptk-module-db22.0.0-beta7.3-devsources - com.databasepreservationdbptk-module-dbml2.0.0-beta7.3 - com.databasepreservationdbptk-module-dbml2.0.0-beta7.3sources + com.databasepreservationdbptk-module-dbml2.0.0-beta7.3-dev + com.databasepreservationdbptk-module-dbml2.0.0-beta7.3-devsources - com.databasepreservationdbptk-module-jdbc2.0.0-beta7.3 - com.databasepreservationdbptk-module-jdbc2.0.0-beta7.3sources + com.databasepreservationdbptk-module-jdbc2.0.0-beta7.3-dev + com.databasepreservationdbptk-module-jdbc2.0.0-beta7.3-devsources - com.databasepreservationdbptk-module-list-tables2.0.0-beta7.3 - com.databasepreservationdbptk-module-list-tables2.0.0-beta7.3sources + com.databasepreservationdbptk-module-list-tables2.0.0-beta7.3-dev + com.databasepreservationdbptk-module-list-tables2.0.0-beta7.3-devsources - com.databasepreservationdbptk-module-ms-access2.0.0-beta7.3 - com.databasepreservationdbptk-module-ms-access2.0.0-beta7.3sources + com.databasepreservationdbptk-module-ms-access2.0.0-beta7.3-dev + com.databasepreservationdbptk-module-ms-access2.0.0-beta7.3-devsources - com.databasepreservationdbptk-module-mysql2.0.0-beta7.3 - com.databasepreservationdbptk-module-mysql2.0.0-beta7.3sources + com.databasepreservationdbptk-module-mysql2.0.0-beta7.3-dev + com.databasepreservationdbptk-module-mysql2.0.0-beta7.3-devsources - com.databasepreservationdbptk-module-odbc2.0.0-beta7.3 - com.databasepreservationdbptk-module-odbc2.0.0-beta7.3sources + com.databasepreservationdbptk-module-odbc2.0.0-beta7.3-dev + com.databasepreservationdbptk-module-odbc2.0.0-beta7.3-devsources - com.databasepreservationdbptk-module-oracle2.0.0-beta7.3 - com.databasepreservationdbptk-module-oracle2.0.0-beta7.3sources + com.databasepreservationdbptk-module-oracle2.0.0-beta7.3-dev + com.databasepreservationdbptk-module-oracle2.0.0-beta7.3-devsources - com.databasepreservationdbptk-module-postgresql2.0.0-beta7.3 - com.databasepreservationdbptk-module-postgresql2.0.0-beta7.3sources + com.databasepreservationdbptk-module-postgresql2.0.0-beta7.3-dev + com.databasepreservationdbptk-module-postgresql2.0.0-beta7.3-devsources - com.databasepreservationdbptk-module-siard2.0.0-beta7.3 - com.databasepreservationdbptk-module-siard2.0.0-beta7.3sources + com.databasepreservationdbptk-module-siard2.0.0-beta7.3-dev + com.databasepreservationdbptk-module-siard2.0.0-beta7.3-devsources com.databasepreservationdbptk-bindings-siard11.1.1 com.databasepreservationdbptk-bindings-siard11.1.1sources @@ -246,14 +246,14 @@ com.databasepreservationdbptk-bindings-siarddk1.3.0 com.databasepreservationdbptk-bindings-siarddk1.3.0sources - com.databasepreservationdbptk-module-solr2.0.0-beta7.3 - com.databasepreservationdbptk-module-solr2.0.0-beta7.3sources + com.databasepreservationdbptk-module-solr2.0.0-beta7.3-dev + com.databasepreservationdbptk-module-solr2.0.0-beta7.3-devsources - com.databasepreservationdbptk-module-sql-file2.0.0-beta7.3 - com.databasepreservationdbptk-module-sql-file2.0.0-beta7.3sources + com.databasepreservationdbptk-module-sql-file2.0.0-beta7.3-dev + com.databasepreservationdbptk-module-sql-file2.0.0-beta7.3-devsources - com.databasepreservationdbptk-module-sql-server2.0.0-beta7.3 - com.databasepreservationdbptk-module-sql-server2.0.0-beta7.3sources + com.databasepreservationdbptk-module-sql-server2.0.0-beta7.3-dev + com.databasepreservationdbptk-module-sql-server2.0.0-beta7.3-devsources From 763352937c8c29eeefd17555d21bfbd3edfab34f Mon Sep 17 00:00:00 2001 From: Bruno Ferreira Date: Thu, 16 Mar 2017 11:16:20 +0000 Subject: [PATCH 4/9] now also uses -dev dbvtk version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6f7a83671..108279fd7 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ 1.7 ${project.basedir}/vendor-libs/repository - 0.2.8 + 0.2.8-dev From 777f728b4596136bbe3d3c333fa3cd76c7d44a31 Mon Sep 17 00:00:00 2001 From: Bruno Ferreira Date: Fri, 17 Mar 2017 14:29:13 +0000 Subject: [PATCH 5/9] reverted to using non '-dev' versions --- dbptk-bindings/pom.xml | 2 +- dbptk-core/pom.xml | 4 +- dbptk-model/pom.xml | 4 +- dbptk-modules/dbptk-module-db2/pom.xml | 4 +- dbptk-modules/dbptk-module-dbml/pom.xml | 4 +- dbptk-modules/dbptk-module-jdbc/pom.xml | 4 +- .../dbptk-module-list-tables/pom.xml | 4 +- dbptk-modules/dbptk-module-ms-access/pom.xml | 4 +- dbptk-modules/dbptk-module-mysql/pom.xml | 4 +- dbptk-modules/dbptk-module-odbc/pom.xml | 4 +- dbptk-modules/dbptk-module-oracle/pom.xml | 4 +- dbptk-modules/dbptk-module-postgresql/pom.xml | 4 +- dbptk-modules/dbptk-module-siard/pom.xml | 4 +- dbptk-modules/dbptk-module-solr/pom.xml | 4 +- dbptk-modules/dbptk-module-sql-file/pom.xml | 4 +- dbptk-modules/dbptk-module-sql-server/pom.xml | 4 +- dbptk-modules/pom.xml | 4 +- pom.xml | 60 +++++++++---------- 18 files changed, 63 insertions(+), 63 deletions(-) diff --git a/dbptk-bindings/pom.xml b/dbptk-bindings/pom.xml index d12ed21ea..66547bc95 100644 --- a/dbptk-bindings/pom.xml +++ b/dbptk-bindings/pom.xml @@ -9,7 +9,7 @@ com.databasepreservation dbptk - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. pom diff --git a/dbptk-core/pom.xml b/dbptk-core/pom.xml index 070ebe1a3..2e81ed713 100644 --- a/dbptk-core/pom.xml +++ b/dbptk-core/pom.xml @@ -6,11 +6,11 @@ dbptk-core com.databasepreservation dbptk-core - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-model/pom.xml b/dbptk-model/pom.xml index 0fbfd8f78..678030161 100644 --- a/dbptk-model/pom.xml +++ b/dbptk-model/pom.xml @@ -5,12 +5,12 @@ dbptk-model com.databasepreservation dbptk-model - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 jar com.databasepreservation dbptk - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-db2/pom.xml b/dbptk-modules/dbptk-module-db2/pom.xml index 7709c2316..860da970e 100644 --- a/dbptk-modules/dbptk-module-db2/pom.xml +++ b/dbptk-modules/dbptk-module-db2/pom.xml @@ -6,11 +6,11 @@ dbptk-module-db2 com.databasepreservation dbptk-module-db2 - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-dbml/pom.xml b/dbptk-modules/dbptk-module-dbml/pom.xml index 0a8abd38a..21bbd1989 100644 --- a/dbptk-modules/dbptk-module-dbml/pom.xml +++ b/dbptk-modules/dbptk-module-dbml/pom.xml @@ -6,11 +6,11 @@ dbptk-module-dbml com.databasepreservation dbptk-module-dbml - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-jdbc/pom.xml b/dbptk-modules/dbptk-module-jdbc/pom.xml index db8127a6f..5ca372fff 100644 --- a/dbptk-modules/dbptk-module-jdbc/pom.xml +++ b/dbptk-modules/dbptk-module-jdbc/pom.xml @@ -6,11 +6,11 @@ dbptk-module-jdbc com.databasepreservation dbptk-module-jdbc - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-list-tables/pom.xml b/dbptk-modules/dbptk-module-list-tables/pom.xml index 84bd76b11..662ead2cf 100644 --- a/dbptk-modules/dbptk-module-list-tables/pom.xml +++ b/dbptk-modules/dbptk-module-list-tables/pom.xml @@ -6,11 +6,11 @@ dbptk-module-list-tables com.databasepreservation dbptk-module-list-tables - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-ms-access/pom.xml b/dbptk-modules/dbptk-module-ms-access/pom.xml index 3f4cfb051..6555ad4af 100644 --- a/dbptk-modules/dbptk-module-ms-access/pom.xml +++ b/dbptk-modules/dbptk-module-ms-access/pom.xml @@ -6,11 +6,11 @@ dbptk-module-ms-access com.databasepreservation dbptk-module-ms-access - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-mysql/pom.xml b/dbptk-modules/dbptk-module-mysql/pom.xml index 1e56354d5..d255e9a69 100644 --- a/dbptk-modules/dbptk-module-mysql/pom.xml +++ b/dbptk-modules/dbptk-module-mysql/pom.xml @@ -6,11 +6,11 @@ dbptk-module-mysql com.databasepreservation dbptk-module-mysql - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-odbc/pom.xml b/dbptk-modules/dbptk-module-odbc/pom.xml index 8e28676e8..5473b72b3 100644 --- a/dbptk-modules/dbptk-module-odbc/pom.xml +++ b/dbptk-modules/dbptk-module-odbc/pom.xml @@ -6,11 +6,11 @@ dbptk-module-odbc com.databasepreservation dbptk-module-odbc - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-oracle/pom.xml b/dbptk-modules/dbptk-module-oracle/pom.xml index dd2ce8522..08f44af09 100644 --- a/dbptk-modules/dbptk-module-oracle/pom.xml +++ b/dbptk-modules/dbptk-module-oracle/pom.xml @@ -6,11 +6,11 @@ dbptk-module-oracle com.databasepreservation dbptk-module-oracle - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-postgresql/pom.xml b/dbptk-modules/dbptk-module-postgresql/pom.xml index 235381902..a103f22e8 100644 --- a/dbptk-modules/dbptk-module-postgresql/pom.xml +++ b/dbptk-modules/dbptk-module-postgresql/pom.xml @@ -6,11 +6,11 @@ dbptk-module-postgresql com.databasepreservation dbptk-module-postgresql - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-siard/pom.xml b/dbptk-modules/dbptk-module-siard/pom.xml index 706c78026..36a54aa0b 100644 --- a/dbptk-modules/dbptk-module-siard/pom.xml +++ b/dbptk-modules/dbptk-module-siard/pom.xml @@ -6,11 +6,11 @@ dbptk-module-siard com.databasepreservation dbptk-module-siard - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-solr/pom.xml b/dbptk-modules/dbptk-module-solr/pom.xml index 1354ca272..c3f7cdde5 100644 --- a/dbptk-modules/dbptk-module-solr/pom.xml +++ b/dbptk-modules/dbptk-module-solr/pom.xml @@ -6,11 +6,11 @@ dbptk-module-solr com.databasepreservation dbptk-module-solr - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-sql-file/pom.xml b/dbptk-modules/dbptk-module-sql-file/pom.xml index afbb7df21..96c545455 100644 --- a/dbptk-modules/dbptk-module-sql-file/pom.xml +++ b/dbptk-modules/dbptk-module-sql-file/pom.xml @@ -6,11 +6,11 @@ dbptk-module-sql-file com.databasepreservation dbptk-module-sql-file - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/dbptk-module-sql-server/pom.xml b/dbptk-modules/dbptk-module-sql-server/pom.xml index d1b4f29fd..7542da529 100644 --- a/dbptk-modules/dbptk-module-sql-server/pom.xml +++ b/dbptk-modules/dbptk-module-sql-server/pom.xml @@ -6,11 +6,11 @@ dbptk-module-sql-server com.databasepreservation dbptk-module-sql-server - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk-modules - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. diff --git a/dbptk-modules/pom.xml b/dbptk-modules/pom.xml index af5db1bbe..35952c64f 100644 --- a/dbptk-modules/pom.xml +++ b/dbptk-modules/pom.xml @@ -5,11 +5,11 @@ dbptk-modules com.databasepreservation dbptk-modules - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 .. pom diff --git a/pom.xml b/pom.xml index 108279fd7..f2a52d1a3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ Database Preservation Toolkit com.databasepreservation dbptk - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 pom A toolkit that allows data migration and conversion between database management systems formats and digital preservation formats. @@ -20,7 +20,7 @@ 1.7 ${project.basedir}/vendor-libs/repository - 0.2.8-dev + 0.2.8 @@ -185,12 +185,12 @@ com.databasepreservation dbptk-model - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 com.databasepreservation dbptk-model - 2.0.0-beta7.3-dev + 2.0.0-beta7.3 sources @@ -207,35 +207,35 @@ - com.databasepreservationdbptk-module-db22.0.0-beta7.3-dev - com.databasepreservationdbptk-module-db22.0.0-beta7.3-devsources + com.databasepreservationdbptk-module-db22.0.0-beta7.3 + com.databasepreservationdbptk-module-db22.0.0-beta7.3sources - com.databasepreservationdbptk-module-dbml2.0.0-beta7.3-dev - com.databasepreservationdbptk-module-dbml2.0.0-beta7.3-devsources + com.databasepreservationdbptk-module-dbml2.0.0-beta7.3 + com.databasepreservationdbptk-module-dbml2.0.0-beta7.3sources - com.databasepreservationdbptk-module-jdbc2.0.0-beta7.3-dev - com.databasepreservationdbptk-module-jdbc2.0.0-beta7.3-devsources + com.databasepreservationdbptk-module-jdbc2.0.0-beta7.3 + com.databasepreservationdbptk-module-jdbc2.0.0-beta7.3sources - com.databasepreservationdbptk-module-list-tables2.0.0-beta7.3-dev - com.databasepreservationdbptk-module-list-tables2.0.0-beta7.3-devsources + com.databasepreservationdbptk-module-list-tables2.0.0-beta7.3 + com.databasepreservationdbptk-module-list-tables2.0.0-beta7.3sources - com.databasepreservationdbptk-module-ms-access2.0.0-beta7.3-dev - com.databasepreservationdbptk-module-ms-access2.0.0-beta7.3-devsources + com.databasepreservationdbptk-module-ms-access2.0.0-beta7.3 + com.databasepreservationdbptk-module-ms-access2.0.0-beta7.3sources - com.databasepreservationdbptk-module-mysql2.0.0-beta7.3-dev - com.databasepreservationdbptk-module-mysql2.0.0-beta7.3-devsources + com.databasepreservationdbptk-module-mysql2.0.0-beta7.3 + com.databasepreservationdbptk-module-mysql2.0.0-beta7.3sources - com.databasepreservationdbptk-module-odbc2.0.0-beta7.3-dev - com.databasepreservationdbptk-module-odbc2.0.0-beta7.3-devsources + com.databasepreservationdbptk-module-odbc2.0.0-beta7.3 + com.databasepreservationdbptk-module-odbc2.0.0-beta7.3sources - com.databasepreservationdbptk-module-oracle2.0.0-beta7.3-dev - com.databasepreservationdbptk-module-oracle2.0.0-beta7.3-devsources + com.databasepreservationdbptk-module-oracle2.0.0-beta7.3 + com.databasepreservationdbptk-module-oracle2.0.0-beta7.3sources - com.databasepreservationdbptk-module-postgresql2.0.0-beta7.3-dev - com.databasepreservationdbptk-module-postgresql2.0.0-beta7.3-devsources + com.databasepreservationdbptk-module-postgresql2.0.0-beta7.3 + com.databasepreservationdbptk-module-postgresql2.0.0-beta7.3sources - com.databasepreservationdbptk-module-siard2.0.0-beta7.3-dev - com.databasepreservationdbptk-module-siard2.0.0-beta7.3-devsources + com.databasepreservationdbptk-module-siard2.0.0-beta7.3 + com.databasepreservationdbptk-module-siard2.0.0-beta7.3sources com.databasepreservationdbptk-bindings-siard11.1.1 com.databasepreservationdbptk-bindings-siard11.1.1sources @@ -246,14 +246,14 @@ com.databasepreservationdbptk-bindings-siarddk1.3.0 com.databasepreservationdbptk-bindings-siarddk1.3.0sources - com.databasepreservationdbptk-module-solr2.0.0-beta7.3-dev - com.databasepreservationdbptk-module-solr2.0.0-beta7.3-devsources + com.databasepreservationdbptk-module-solr2.0.0-beta7.3 + com.databasepreservationdbptk-module-solr2.0.0-beta7.3sources - com.databasepreservationdbptk-module-sql-file2.0.0-beta7.3-dev - com.databasepreservationdbptk-module-sql-file2.0.0-beta7.3-devsources + com.databasepreservationdbptk-module-sql-file2.0.0-beta7.3 + com.databasepreservationdbptk-module-sql-file2.0.0-beta7.3sources - com.databasepreservationdbptk-module-sql-server2.0.0-beta7.3-dev - com.databasepreservationdbptk-module-sql-server2.0.0-beta7.3-devsources + com.databasepreservationdbptk-module-sql-server2.0.0-beta7.3 + com.databasepreservationdbptk-module-sql-server2.0.0-beta7.3sources From 444926c0f15ea317b9a9a1231a22651c88c9c795 Mon Sep 17 00:00:00 2001 From: Bruno Ferreira Date: Fri, 7 Apr 2017 18:52:29 +0100 Subject: [PATCH 6/9] SolrExportModule lobs are now created in ./modules/solr/lobs; other modules may have a ./modules/ folder to use as a working directory; the current folder is assumed to be the working directory, but other folders may be selected via java system properties (dbptk.home), environment variables (DBPTK_HOME), and programatically (calling ConfigUtils.initialize(workingDir);) --- .../java/com/databasepreservation/Main.java | 6 + .../{logback.xml => logback_manual.xml} | 2 +- .../com/databasepreservation/Constants.java | 16 ++ .../utils/ConfigUtils.java | 143 ++++++++++++------ .../modules/jdbc/in/JDBCImportModule.java | 11 +- .../modules/solr/SolrExportModule.java | 11 +- .../modules/solr/SolrModuleConfiguration.java | 11 +- .../modules/solr/SolrModuleFactory.java | 9 +- 8 files changed, 142 insertions(+), 67 deletions(-) rename dbptk-core/src/main/resources/{logback.xml => logback_manual.xml} (97%) create mode 100644 dbptk-model/src/main/java/com/databasepreservation/Constants.java diff --git a/dbptk-core/src/main/java/com/databasepreservation/Main.java b/dbptk-core/src/main/java/com/databasepreservation/Main.java index 7df0c5ddc..b87334484 100644 --- a/dbptk-core/src/main/java/com/databasepreservation/Main.java +++ b/dbptk-core/src/main/java/com/databasepreservation/Main.java @@ -29,6 +29,7 @@ import com.databasepreservation.modules.siard.SIARDDKModuleFactory; import com.databasepreservation.modules.solr.SolrModuleFactory; import com.databasepreservation.modules.sqlServer.SQLServerJDBCModuleFactory; +import com.databasepreservation.utils.ConfigUtils; import com.databasepreservation.utils.MiscUtils; /** @@ -36,6 +37,11 @@ * @author Bruno Ferreira */ public class Main { + static { + // initialize logging + ConfigUtils.initialize(); + } + public static final int EXIT_CODE_OK = 0; public static final int EXIT_CODE_GENERIC_ERROR = 1; public static final int EXIT_CODE_COMMAND_PARSE_ERROR = 2; diff --git a/dbptk-core/src/main/resources/logback.xml b/dbptk-core/src/main/resources/logback_manual.xml similarity index 97% rename from dbptk-core/src/main/resources/logback.xml rename to dbptk-core/src/main/resources/logback_manual.xml index 4f140a0c3..47490f40e 100644 --- a/dbptk-core/src/main/resources/logback.xml +++ b/dbptk-core/src/main/resources/logback_manual.xml @@ -25,7 +25,7 @@ DEBUG - dbptk-app.log.txt + ${dbptk.home}/log/dbptk-app.log.txt true %d [%thread] %-5level \(%logger{5}\) %msg%n%exception{full} diff --git a/dbptk-model/src/main/java/com/databasepreservation/Constants.java b/dbptk-model/src/main/java/com/databasepreservation/Constants.java new file mode 100644 index 000000000..9c135f57a --- /dev/null +++ b/dbptk-model/src/main/java/com/databasepreservation/Constants.java @@ -0,0 +1,16 @@ +package com.databasepreservation; + +/** + * @author Bruno Ferreira + */ +public class Constants { + public static final String PROPERTY_KEY_HOME = "dbptk.home"; + + public static final String DEFAULT_HOME_DIRECTORY = "."; + + public static final String SUBDIRECTORY_LOG = "log"; + public static final String LOGBACK_FILE_NAME = "logback_manual.xml"; + + public static final String SUBDIRECTORY_MODULES = "modules"; + +} diff --git a/dbptk-model/src/main/java/com/databasepreservation/utils/ConfigUtils.java b/dbptk-model/src/main/java/com/databasepreservation/utils/ConfigUtils.java index fde330d89..ab017359d 100644 --- a/dbptk-model/src/main/java/com/databasepreservation/utils/ConfigUtils.java +++ b/dbptk-model/src/main/java/com/databasepreservation/utils/ConfigUtils.java @@ -1,10 +1,21 @@ package com.databasepreservation.utils; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; +import java.io.IOException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.databasepreservation.Constants; +import com.databasepreservation.model.modules.DatabaseModuleFactory; + +import ch.qos.logback.classic.LoggerContext; +import ch.qos.logback.classic.joran.JoranConfigurator; +import ch.qos.logback.core.joran.spi.JoranException; /** * Obtain values from system environment variables or properties. @@ -12,65 +23,99 @@ * @author Bruno Ferreira */ public class ConfigUtils { - private static final Map retrievedProperties = new HashMap<>(); + private static final Logger LOGGER = LoggerFactory.getLogger(ConfigUtils.class); + private static boolean initialized = false; - private static String partsToEnvironment(String... parts) { - return StringUtils.join(parts, '_').toUpperCase(Locale.ENGLISH); - } + private static Path homeDirectory, logDirectory, modulesDirectory; - private static String partsToProperty(String... parts) { - return StringUtils.join(parts, '.').toLowerCase(Locale.ENGLISH); + public static void initialize() { + if (!initialized) { + String homeDirectoryAsString = getProperty(Constants.DEFAULT_HOME_DIRECTORY, Constants.PROPERTY_KEY_HOME); + initialize(Paths.get(homeDirectoryAsString).toAbsolutePath()); + } } - /** - * Same as getProperty(String defaultValue, String... parts), but attempts to - * convert the String values to Integers via Integer.parseInt - */ - public static Integer getProperty(Integer defaultValue, String... parts) { - return Integer.parseInt(getProperty(defaultValue.toString(), parts)); - } + public static void initialize(Path dbptkHome) { + if (!initialized) { + homeDirectory = dbptkHome; + System.setProperty(Constants.PROPERTY_KEY_HOME, homeDirectory.toAbsolutePath().toString()); - /** - * Get the value from the java properties (-Dxxx=yyy) or an environment - * variable (in that order), ultimately returning the default value if one was - * not found. - * - * @param defaultValue - * the value to return if no other value is found - * @param parts - * used to build the environment variable and property names. Ex: - * ["dbptk", "test"] becomes the environment variable "DBPTK_TEST" - * and the property "dbptk.test" - * @return the value associated with the java property, OR the value - * associated with the environment variable, OR the default value (in - * this order). - */ - public static String getProperty(String defaultValue, String... parts) { - String propKey = partsToProperty(parts); + logDirectory = homeDirectory.resolve(Constants.SUBDIRECTORY_LOG); + modulesDirectory = homeDirectory.resolve(Constants.SUBDIRECTORY_MODULES); - String value = retrievedProperties.get(propKey); - if (StringUtils.isNotBlank(value)) { - return value; + instantiateEssentialDirectories(homeDirectory, logDirectory, modulesDirectory); + + configureLogback(); + initialized = true; } + } - value = System.getProperty(propKey, null); - if (StringUtils.isNotBlank(value)) { - retrievedProperties.put(propKey, value); - return value; + public static Path getModuleDirectory(DatabaseModuleFactory moduleFactory) { + if (!initialized) { + initialize(); } - String envKey = partsToEnvironment(parts); - if (StringUtils.isNotBlank(value)) { - return value; + Path moduleDirectory = modulesDirectory.resolve(moduleFactory.getModuleName()); + instantiateEssentialDirectories(moduleDirectory); + return moduleDirectory; + } + + private static void instantiateEssentialDirectories(Path... directories) { + for (Path path : directories) { + try { + if (!Files.exists(path)) { + Files.createDirectories(path); + } + } catch (IOException e) { + LOGGER.error("Unable to create " + path, e); + } } + } + + private static void configureLogback() { + // 20170314 hsilva: logback file was named differently from what logback + // usually expects in order to avoid auto-loading by logback as we want to + // place the log file under dbptk home + // 20170407 bferreira: since logback.xml is only available in dbptk-core, we + // should check if it present. If our logback file is not present, just + // leave logback to use whichever defaults are in place (since DBPTK are + // used in a modular way) + URL logbackFileResource = ClassLoader.getSystemResource(Constants.LOGBACK_FILE_NAME); + + try { + LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); + JoranConfigurator configurator = new JoranConfigurator(); + configurator.setContext(context); + context.reset(); - value = System.getenv(envKey); - if (StringUtils.isNotBlank(value)) { - retrievedProperties.put(propKey, value); - return value; + if (logbackFileResource != null) { + configurator.doConfigure(logbackFileResource); + } + } catch (JoranException e) { + LOGGER.error("Error configuring logback", e); } + } + + /** + * Same as getProperty, but attempts to convert the String values to Integers + * via Integer.parseInt + */ + public static Integer getProperty(Integer defaultValue, String propertyKey) { + return Integer.parseInt(getProperty(defaultValue.toString(), propertyKey)); + } - retrievedProperties.put(propKey, defaultValue); - return defaultValue; + /** + * Get the value from the java properties (-Dxxx=yyy) and return the default + * value if the property is not defined. + * + * @param defaultValue + * the value to return if no other value is found + * @param propertyKey + * The java property key + * @return the value associated with the java property, or the default value. + */ + public static String getProperty(String defaultValue, String propertyKey) { + String value = System.getProperty(propertyKey, null); + return StringUtils.isNotBlank(value) ? value : defaultValue; } } diff --git a/dbptk-modules/dbptk-module-jdbc/src/main/java/com/databasepreservation/modules/jdbc/in/JDBCImportModule.java b/dbptk-modules/dbptk-module-jdbc/src/main/java/com/databasepreservation/modules/jdbc/in/JDBCImportModule.java index d51de6579..da4b6ed89 100644 --- a/dbptk-modules/dbptk-module-jdbc/src/main/java/com/databasepreservation/modules/jdbc/in/JDBCImportModule.java +++ b/dbptk-modules/dbptk-module-jdbc/src/main/java/com/databasepreservation/modules/jdbc/in/JDBCImportModule.java @@ -75,12 +75,11 @@ */ public class JDBCImportModule implements DatabaseImportModule { // if fetch size is zero, then the driver decides the best fetch size - protected static final Integer DEFAULT_ROW_FETCH_BLOCK_SIZE = ConfigUtils.getProperty(0, "dbptk", "jdbc", - "fetchsize", "default"); - protected static final Integer SMALL_ROW_FETCH_BLOCK_SIZE = ConfigUtils.getProperty(10, "dbptk", "jdbc", "fetchsize", - "small"); - protected static final Integer MINIMUM_ROW_FETCH_BLOCK_SIZE = ConfigUtils.getProperty(1, "dbptk", "jdbc", - "fetchsize", "minimum"); + protected static final Integer DEFAULT_ROW_FETCH_BLOCK_SIZE = ConfigUtils.getProperty(0, + "dbptk.jdbc.fetchsize.default"); + protected static final Integer SMALL_ROW_FETCH_BLOCK_SIZE = ConfigUtils.getProperty(10, "dbptk.jdbc.fetchsize.small"); + protected static final Integer MINIMUM_ROW_FETCH_BLOCK_SIZE = ConfigUtils.getProperty(1, + "dbptk.jdbc.fetchsize.minimum"); protected static final String DEFAULT_DATA_TIMESPAN = "(...)"; diff --git a/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrExportModule.java b/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrExportModule.java index 3948a06bc..5026a75f5 100644 --- a/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrExportModule.java +++ b/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrExportModule.java @@ -1,5 +1,6 @@ package com.databasepreservation.modules.solr; +import java.nio.file.Path; import java.util.Set; import com.databasepreservation.model.Reporter; @@ -20,7 +21,7 @@ * @author Bruno Ferreira */ public class SolrExportModule implements DatabaseExportModule { - private final SolrModuleConfiguration configuration = SolrModuleConfiguration.getInstance(); + private final SolrModuleConfiguration configuration; private final SolrManager solrManager; @@ -38,16 +39,18 @@ public class SolrExportModule implements DatabaseExportModule { private Reporter reporter; - public SolrExportModule(String hostname, Integer port, String endpoint, String zookeeperHost, Integer zookeeperPort) { - this(hostname, port, endpoint, zookeeperHost, zookeeperPort, null); + public SolrExportModule(String hostname, Integer port, String endpoint, String zookeeperHost, Integer zookeeperPort, + Path moduleDirectory) { + this(hostname, port, endpoint, zookeeperHost, zookeeperPort, null, moduleDirectory); } public SolrExportModule(String hostname, Integer port, String endpoint, String zookeeperHost, Integer zookeeperPort, - String databaseUUID) { + String databaseUUID, Path moduleDirectory) { zookeeperHostAndPort = zookeeperHost + ":" + zookeeperPort; String url = "http://" + hostname + ":" + port + "/" + endpoint; solrManager = new SolrManager(url); preSetDatabaseUUID = databaseUUID; + configuration = SolrModuleConfiguration.getInstance(moduleDirectory); } /** diff --git a/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrModuleConfiguration.java b/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrModuleConfiguration.java index 9ea9e4c2a..afdc5da5e 100644 --- a/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrModuleConfiguration.java +++ b/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrModuleConfiguration.java @@ -15,14 +15,16 @@ * @author Bruno Ferreira */ public class SolrModuleConfiguration extends ViewerAbstractConfiguration { + private final Path moduleDirectory; private Path workspaceDirectory = null; private Path workspaceForLobs = null; /** * Private constructor, use getInstance() instead */ - private SolrModuleConfiguration() { + private SolrModuleConfiguration(Path moduleDirectory) { super(new SystemConfiguration()); + this.moduleDirectory = moduleDirectory; } /* @@ -31,9 +33,9 @@ private SolrModuleConfiguration() { */ private static SolrModuleConfiguration instance = null; - public static SolrModuleConfiguration getInstance() { + public static SolrModuleConfiguration getInstance(Path moduleDirectory) { if (instance == null) { - instance = new SolrModuleConfiguration(); + instance = new SolrModuleConfiguration(moduleDirectory); } return instance; } @@ -70,8 +72,7 @@ private Path getWorkspaceDirectory() { } else if (StringUtils.isNotBlank(env)) { workspaceDirectory = Paths.get(env); } else { - workspaceDirectory = Paths.get(System.getProperty("user.home"), - ViewerConstants.INSTALL_FOLDER_DEFAULT_SUBFOLDER_UNDER_HOME); + workspaceDirectory = moduleDirectory; } } return workspaceDirectory; diff --git a/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrModuleFactory.java b/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrModuleFactory.java index 971e7e7d9..fde4ae141 100644 --- a/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrModuleFactory.java +++ b/dbptk-modules/dbptk-module-solr/src/main/java/com/databasepreservation/modules/solr/SolrModuleFactory.java @@ -1,5 +1,6 @@ package com.databasepreservation.modules.solr; +import java.nio.file.Path; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -14,6 +15,7 @@ import com.databasepreservation.model.modules.DatabaseModuleFactory; import com.databasepreservation.model.parameters.Parameter; import com.databasepreservation.model.parameters.Parameters; +import com.databasepreservation.utils.ConfigUtils; /** * @author Bruno Ferreira @@ -129,11 +131,14 @@ public DatabaseExportModule buildExportModule(Map parameters) reporter.exportModuleParameters(getModuleName(), "hostname", pHostname, "port", pPortNumber.toString(), "endpoint", pEndpoint, "zookeeper-hostname", pZookeperHostname, "zookeeper-port", pZookeeperPortNumber.toString()); + Path moduleDirectory = ConfigUtils.getModuleDirectory(this); + if (StringUtils.isBlank(pDatabaseUUID)) { - return new SolrExportModule(pHostname, pPortNumber, pEndpoint, pZookeperHostname, pZookeeperPortNumber); + return new SolrExportModule(pHostname, pPortNumber, pEndpoint, pZookeperHostname, pZookeeperPortNumber, + moduleDirectory); } else { return new SolrExportModule(pHostname, pPortNumber, pEndpoint, pZookeperHostname, pZookeeperPortNumber, - pDatabaseUUID); + pDatabaseUUID, moduleDirectory); } } } From ea410585f97371b46f84254b60b344e40f910974 Mon Sep 17 00:00:00 2001 From: Bruno Ferreira Date: Tue, 11 Apr 2017 10:29:00 +0100 Subject: [PATCH 7/9] adds a dbptk-version.json file inside the jar that includes some information about the git repository when the .jar was built; dbptk-version.jar info is written to the log before starting the conversion; the dummy reporter that is supposed to do nothing now works as intended; reports are also added to dbptk.home, in a folder named reports; the default dbptk.home if none is configured, is now a folder in the current working directory named dbptk (which will have the folders 'log', 'modules' and 'reports' inside --- .../java/com/databasepreservation/Main.java | 5 ++-- dbptk-model/pom.xml | 12 +++++++++ .../com/databasepreservation/Constants.java | 6 ++++- .../model/NoOpReporter.java | 7 +++-- .../databasepreservation/model/Reporter.java | 15 ++++++++--- .../utils/ConfigUtils.java | 26 +++++++++++++++++-- .../src/main/resources/dbptk-version.json | 1 + pom.xml | 22 ++++++++++++++++ 8 files changed, 81 insertions(+), 13 deletions(-) create mode 100644 dbptk-model/src/main/resources/dbptk-version.json diff --git a/dbptk-core/src/main/java/com/databasepreservation/Main.java b/dbptk-core/src/main/java/com/databasepreservation/Main.java index b87334484..d7c0031bd 100644 --- a/dbptk-core/src/main/java/com/databasepreservation/Main.java +++ b/dbptk-core/src/main/java/com/databasepreservation/Main.java @@ -189,8 +189,9 @@ private static int run(CLI cli) { private static void logProgramStart() { LOGGER.debug("#########################################################"); - LOGGER.debug("# START-ID-" + execID); - LOGGER.debug("# START v" + MiscUtils.APP_VERSION); + LOGGER.debug("# START-ID-{}", execID); + LOGGER.debug("# START v{}", MiscUtils.APP_VERSION); + LOGGER.debug("# version info: {}", ConfigUtils.getVersionInfo()); LOGGER.debug("#########################################################"); } diff --git a/dbptk-model/pom.xml b/dbptk-model/pom.xml index 678030161..8214de2de 100644 --- a/dbptk-model/pom.xml +++ b/dbptk-model/pom.xml @@ -29,6 +29,10 @@ org.apache.commons commons-lang3 + + commons-io + commons-io + joda-time joda-time @@ -38,4 +42,12 @@ logback-classic + + + + pl.project13.maven + git-commit-id-plugin + + + diff --git a/dbptk-model/src/main/java/com/databasepreservation/Constants.java b/dbptk-model/src/main/java/com/databasepreservation/Constants.java index 9c135f57a..9bf25e988 100644 --- a/dbptk-model/src/main/java/com/databasepreservation/Constants.java +++ b/dbptk-model/src/main/java/com/databasepreservation/Constants.java @@ -4,13 +4,17 @@ * @author Bruno Ferreira */ public class Constants { + public static final String VERSION_INFO_FILE = "dbptk-version.json"; + public static final String PROPERTY_KEY_HOME = "dbptk.home"; - public static final String DEFAULT_HOME_DIRECTORY = "."; + public static final String DEFAULT_HOME_DIRECTORY = "./dbptk"; public static final String SUBDIRECTORY_LOG = "log"; public static final String LOGBACK_FILE_NAME = "logback_manual.xml"; public static final String SUBDIRECTORY_MODULES = "modules"; + public static final String SUBDIRECTORY_REPORTS = "reports"; + } diff --git a/dbptk-model/src/main/java/com/databasepreservation/model/NoOpReporter.java b/dbptk-model/src/main/java/com/databasepreservation/model/NoOpReporter.java index 8653a777b..8809e9377 100644 --- a/dbptk-model/src/main/java/com/databasepreservation/model/NoOpReporter.java +++ b/dbptk-model/src/main/java/com/databasepreservation/model/NoOpReporter.java @@ -17,10 +17,9 @@ public class NoOpReporter extends Reporter { public NoOpReporter() { } - public NoOpReporter(String directory) { - } - - protected void initialize(String directory) { + @Override + protected void init(String directory, String name) { + // do nothing } @Override diff --git a/dbptk-model/src/main/java/com/databasepreservation/model/Reporter.java b/dbptk-model/src/main/java/com/databasepreservation/model/Reporter.java index fb65c6560..9f9df31c6 100644 --- a/dbptk-model/src/main/java/com/databasepreservation/model/Reporter.java +++ b/dbptk-model/src/main/java/com/databasepreservation/model/Reporter.java @@ -18,6 +18,7 @@ import com.databasepreservation.model.structure.ColumnStructure; import com.databasepreservation.model.structure.TableStructure; import com.databasepreservation.model.structure.type.Type; +import com.databasepreservation.utils.ConfigUtils; import com.databasepreservation.utils.MiscUtils; /** @@ -64,15 +65,21 @@ public Reporter() { } public Reporter(String directory, String name) { + init(directory, name); + } + + protected void init(String directory, String name) { // set defaults if needed - if (directory == null) { - directory = "."; - } if (StringUtils.isBlank(name)) { name = "dbptk-report-" + new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + ".txt"; } - outputfile = Paths.get(directory).toAbsolutePath().resolve(name); + if (StringUtils.isBlank(directory)) { + outputfile = ConfigUtils.getReportsDirectory().resolve(name); + } else { + outputfile = Paths.get(directory).toAbsolutePath().resolve(name); + } + if (Files.notExists(outputfile)) { try { outputfile = Files.createFile(outputfile); diff --git a/dbptk-model/src/main/java/com/databasepreservation/utils/ConfigUtils.java b/dbptk-model/src/main/java/com/databasepreservation/utils/ConfigUtils.java index ab017359d..4f5c9c4cb 100644 --- a/dbptk-model/src/main/java/com/databasepreservation/utils/ConfigUtils.java +++ b/dbptk-model/src/main/java/com/databasepreservation/utils/ConfigUtils.java @@ -1,11 +1,13 @@ package com.databasepreservation.utils; import java.io.IOException; +import java.io.InputStream; import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,7 +28,7 @@ public class ConfigUtils { private static final Logger LOGGER = LoggerFactory.getLogger(ConfigUtils.class); private static boolean initialized = false; - private static Path homeDirectory, logDirectory, modulesDirectory; + private static Path homeDirectory, logDirectory, modulesDirectory, reportsDirectory; public static void initialize() { if (!initialized) { @@ -42,8 +44,9 @@ public static void initialize(Path dbptkHome) { logDirectory = homeDirectory.resolve(Constants.SUBDIRECTORY_LOG); modulesDirectory = homeDirectory.resolve(Constants.SUBDIRECTORY_MODULES); + reportsDirectory = homeDirectory.resolve(Constants.SUBDIRECTORY_REPORTS); - instantiateEssentialDirectories(homeDirectory, logDirectory, modulesDirectory); + instantiateEssentialDirectories(homeDirectory, logDirectory, modulesDirectory, reportsDirectory); configureLogback(); initialized = true; @@ -60,6 +63,10 @@ public static Path getModuleDirectory(DatabaseModuleFactory moduleFactory) { return moduleDirectory; } + public static Path getReportsDirectory() { + return reportsDirectory; + } + private static void instantiateEssentialDirectories(Path... directories) { for (Path path : directories) { try { @@ -96,6 +103,21 @@ private static void configureLogback() { } } + public static String getVersionInfo() { + InputStream versionInfoAsStream = ConfigUtils.class.getClassLoader().getSystemResourceAsStream( + Constants.VERSION_INFO_FILE); + String ret; + try { + ret = IOUtils.toString(versionInfoAsStream); + } catch (IOException e) { + LOGGER.debug("Could not obtain resource {}" + Constants.VERSION_INFO_FILE); + ret = ""; + } finally { + IOUtils.closeQuietly(versionInfoAsStream); + } + return ret; + } + /** * Same as getProperty, but attempts to convert the String values to Integers * via Integer.parseInt diff --git a/dbptk-model/src/main/resources/dbptk-version.json b/dbptk-model/src/main/resources/dbptk-version.json new file mode 100644 index 000000000..fafa4ccaf --- /dev/null +++ b/dbptk-model/src/main/resources/dbptk-version.json @@ -0,0 +1 @@ +{"git.build.user.email":"chalkos@chalkos.net","git.build.host":"young","git.dirty":"true","git.remote.origin.url":"git@github.com:keeps/db-preservation-toolkit.git","git.closest.tag.name":"2.0.0-beta7.2","git.commit.id.describe-short":"2.0.0-beta7.2-7-dirty","git.commit.user.email":"chalkos@chalkos.net","git.commit.time":"07.04.2017 @ 18:52:29 WEST","git.commit.message.full":"SolrExportModule lobs are now created in ./modules/solr/lobs; other modules may have a ./modules/ folder to use as a working directory; the current folder is assumed to be the working directory, but other folders may be selected via java system properties (dbptk.home), environment variables (DBPTK_HOME), and programatically (calling ConfigUtils.initialize(workingDir);)","git.build.version":"2.0.0-beta7.3","git.commit.message.short":"SolrExportModule lobs are now created in ./modules/solr/lobs; other modules may have a ./modules/ folder to use as a working directory; the current folder is assumed to be the working directory, but other folders may be selected via java system properties (dbptk.home), environment variables (DBPTK_HOME), and programatically (calling ConfigUtils.initialize(workingDir);)","git.commit.id.abbrev":"444926c","git.branch":"bf-beta7.3-dev","git.build.user.name":"Bruno Ferreira","git.closest.tag.commit.count":"7","git.commit.id.describe":"2.0.0-beta7.2-7-g444926c-dirty","git.commit.id":"444926c0f15ea317b9a9a1231a22651c88c9c795","git.tags":"","git.build.time":"10.04.2017 @ 17:33:49 WEST","git.commit.user.name":"Bruno Ferreira"} \ No newline at end of file diff --git a/pom.xml b/pom.xml index f2a52d1a3..c446c2509 100644 --- a/pom.xml +++ b/pom.xml @@ -176,6 +176,28 @@ maven-surefire-plugin 2.18.1 + + pl.project13.maven + git-commit-id-plugin + 2.2.1 + + + + revision + + + + + + true + + + + ${project.basedir}/src/main/resources/dbptk-version.json + + json + + From 3ea1fb94bd2dac7d91f2c2fc257b523fca54e2be Mon Sep 17 00:00:00 2001 From: Bruno Ferreira Date: Tue, 11 Apr 2017 10:54:59 +0100 Subject: [PATCH 8/9] removed dbptk-version.json from the repository and added exclusion in gitignore --- .gitignore | 1 + dbptk-model/src/main/resources/dbptk-version.json | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 dbptk-model/src/main/resources/dbptk-version.json diff --git a/.gitignore b/.gitignore index 762bac2e3..c6becfe8e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ dbptk-report-* dbptk-app.log dbptk-app.log.txt exported-dbs/ +dbptk-model/src/main/resources/dbptk-version.json **/pom.xml.versionsBackup diff --git a/dbptk-model/src/main/resources/dbptk-version.json b/dbptk-model/src/main/resources/dbptk-version.json deleted file mode 100644 index fafa4ccaf..000000000 --- a/dbptk-model/src/main/resources/dbptk-version.json +++ /dev/null @@ -1 +0,0 @@ -{"git.build.user.email":"chalkos@chalkos.net","git.build.host":"young","git.dirty":"true","git.remote.origin.url":"git@github.com:keeps/db-preservation-toolkit.git","git.closest.tag.name":"2.0.0-beta7.2","git.commit.id.describe-short":"2.0.0-beta7.2-7-dirty","git.commit.user.email":"chalkos@chalkos.net","git.commit.time":"07.04.2017 @ 18:52:29 WEST","git.commit.message.full":"SolrExportModule lobs are now created in ./modules/solr/lobs; other modules may have a ./modules/ folder to use as a working directory; the current folder is assumed to be the working directory, but other folders may be selected via java system properties (dbptk.home), environment variables (DBPTK_HOME), and programatically (calling ConfigUtils.initialize(workingDir);)","git.build.version":"2.0.0-beta7.3","git.commit.message.short":"SolrExportModule lobs are now created in ./modules/solr/lobs; other modules may have a ./modules/ folder to use as a working directory; the current folder is assumed to be the working directory, but other folders may be selected via java system properties (dbptk.home), environment variables (DBPTK_HOME), and programatically (calling ConfigUtils.initialize(workingDir);)","git.commit.id.abbrev":"444926c","git.branch":"bf-beta7.3-dev","git.build.user.name":"Bruno Ferreira","git.closest.tag.commit.count":"7","git.commit.id.describe":"2.0.0-beta7.2-7-g444926c-dirty","git.commit.id":"444926c0f15ea317b9a9a1231a22651c88c9c795","git.tags":"","git.build.time":"10.04.2017 @ 17:33:49 WEST","git.commit.user.name":"Bruno Ferreira"} \ No newline at end of file From 7c19deca03a16d224710a28cafff340d1c9318c7 Mon Sep 17 00:00:00 2001 From: Bruno Ferreira Date: Wed, 12 Apr 2017 15:48:32 +0100 Subject: [PATCH 9/9] bumped version to rc1 --- dbptk-bindings/pom.xml | 2 +- dbptk-core/pom.xml | 4 +- dbptk-model/pom.xml | 4 +- dbptk-modules/dbptk-module-db2/pom.xml | 4 +- dbptk-modules/dbptk-module-dbml/pom.xml | 4 +- dbptk-modules/dbptk-module-jdbc/pom.xml | 4 +- .../dbptk-module-list-tables/pom.xml | 4 +- dbptk-modules/dbptk-module-ms-access/pom.xml | 4 +- dbptk-modules/dbptk-module-mysql/pom.xml | 4 +- dbptk-modules/dbptk-module-odbc/pom.xml | 4 +- dbptk-modules/dbptk-module-oracle/pom.xml | 4 +- dbptk-modules/dbptk-module-postgresql/pom.xml | 4 +- dbptk-modules/dbptk-module-siard/pom.xml | 4 +- dbptk-modules/dbptk-module-solr/pom.xml | 4 +- dbptk-modules/dbptk-module-sql-file/pom.xml | 4 +- dbptk-modules/dbptk-module-sql-server/pom.xml | 4 +- dbptk-modules/pom.xml | 4 +- pom.xml | 60 +++++++++---------- 18 files changed, 63 insertions(+), 63 deletions(-) diff --git a/dbptk-bindings/pom.xml b/dbptk-bindings/pom.xml index 66547bc95..399f1ef5b 100644 --- a/dbptk-bindings/pom.xml +++ b/dbptk-bindings/pom.xml @@ -9,7 +9,7 @@ com.databasepreservation dbptk - 2.0.0-beta7.3 + 2.0.0-rc1 .. pom diff --git a/dbptk-core/pom.xml b/dbptk-core/pom.xml index 2e81ed713..2293f17a5 100644 --- a/dbptk-core/pom.xml +++ b/dbptk-core/pom.xml @@ -6,11 +6,11 @@ dbptk-core com.databasepreservation dbptk-core - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-model/pom.xml b/dbptk-model/pom.xml index 8214de2de..a5f973592 100644 --- a/dbptk-model/pom.xml +++ b/dbptk-model/pom.xml @@ -5,12 +5,12 @@ dbptk-model com.databasepreservation dbptk-model - 2.0.0-beta7.3 + 2.0.0-rc1 jar com.databasepreservation dbptk - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-modules/dbptk-module-db2/pom.xml b/dbptk-modules/dbptk-module-db2/pom.xml index 860da970e..f3e282449 100644 --- a/dbptk-modules/dbptk-module-db2/pom.xml +++ b/dbptk-modules/dbptk-module-db2/pom.xml @@ -6,11 +6,11 @@ dbptk-module-db2 com.databasepreservation dbptk-module-db2 - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-modules/dbptk-module-dbml/pom.xml b/dbptk-modules/dbptk-module-dbml/pom.xml index 21bbd1989..757fa1b32 100644 --- a/dbptk-modules/dbptk-module-dbml/pom.xml +++ b/dbptk-modules/dbptk-module-dbml/pom.xml @@ -6,11 +6,11 @@ dbptk-module-dbml com.databasepreservation dbptk-module-dbml - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-modules/dbptk-module-jdbc/pom.xml b/dbptk-modules/dbptk-module-jdbc/pom.xml index 5ca372fff..848503d60 100644 --- a/dbptk-modules/dbptk-module-jdbc/pom.xml +++ b/dbptk-modules/dbptk-module-jdbc/pom.xml @@ -6,11 +6,11 @@ dbptk-module-jdbc com.databasepreservation dbptk-module-jdbc - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-modules/dbptk-module-list-tables/pom.xml b/dbptk-modules/dbptk-module-list-tables/pom.xml index 662ead2cf..a3852a5f8 100644 --- a/dbptk-modules/dbptk-module-list-tables/pom.xml +++ b/dbptk-modules/dbptk-module-list-tables/pom.xml @@ -6,11 +6,11 @@ dbptk-module-list-tables com.databasepreservation dbptk-module-list-tables - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-modules/dbptk-module-ms-access/pom.xml b/dbptk-modules/dbptk-module-ms-access/pom.xml index 6555ad4af..9ae0219b1 100644 --- a/dbptk-modules/dbptk-module-ms-access/pom.xml +++ b/dbptk-modules/dbptk-module-ms-access/pom.xml @@ -6,11 +6,11 @@ dbptk-module-ms-access com.databasepreservation dbptk-module-ms-access - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-modules/dbptk-module-mysql/pom.xml b/dbptk-modules/dbptk-module-mysql/pom.xml index d255e9a69..b6d28baf2 100644 --- a/dbptk-modules/dbptk-module-mysql/pom.xml +++ b/dbptk-modules/dbptk-module-mysql/pom.xml @@ -6,11 +6,11 @@ dbptk-module-mysql com.databasepreservation dbptk-module-mysql - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-modules/dbptk-module-odbc/pom.xml b/dbptk-modules/dbptk-module-odbc/pom.xml index 5473b72b3..0c0745b4a 100644 --- a/dbptk-modules/dbptk-module-odbc/pom.xml +++ b/dbptk-modules/dbptk-module-odbc/pom.xml @@ -6,11 +6,11 @@ dbptk-module-odbc com.databasepreservation dbptk-module-odbc - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-modules/dbptk-module-oracle/pom.xml b/dbptk-modules/dbptk-module-oracle/pom.xml index 08f44af09..d2a7de503 100644 --- a/dbptk-modules/dbptk-module-oracle/pom.xml +++ b/dbptk-modules/dbptk-module-oracle/pom.xml @@ -6,11 +6,11 @@ dbptk-module-oracle com.databasepreservation dbptk-module-oracle - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-modules/dbptk-module-postgresql/pom.xml b/dbptk-modules/dbptk-module-postgresql/pom.xml index a103f22e8..0e1555ffb 100644 --- a/dbptk-modules/dbptk-module-postgresql/pom.xml +++ b/dbptk-modules/dbptk-module-postgresql/pom.xml @@ -6,11 +6,11 @@ dbptk-module-postgresql com.databasepreservation dbptk-module-postgresql - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-modules/dbptk-module-siard/pom.xml b/dbptk-modules/dbptk-module-siard/pom.xml index 36a54aa0b..aae0f5be8 100644 --- a/dbptk-modules/dbptk-module-siard/pom.xml +++ b/dbptk-modules/dbptk-module-siard/pom.xml @@ -6,11 +6,11 @@ dbptk-module-siard com.databasepreservation dbptk-module-siard - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-modules/dbptk-module-solr/pom.xml b/dbptk-modules/dbptk-module-solr/pom.xml index c3f7cdde5..987177e2b 100644 --- a/dbptk-modules/dbptk-module-solr/pom.xml +++ b/dbptk-modules/dbptk-module-solr/pom.xml @@ -6,11 +6,11 @@ dbptk-module-solr com.databasepreservation dbptk-module-solr - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-modules/dbptk-module-sql-file/pom.xml b/dbptk-modules/dbptk-module-sql-file/pom.xml index 96c545455..705999e9d 100644 --- a/dbptk-modules/dbptk-module-sql-file/pom.xml +++ b/dbptk-modules/dbptk-module-sql-file/pom.xml @@ -6,11 +6,11 @@ dbptk-module-sql-file com.databasepreservation dbptk-module-sql-file - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-modules/dbptk-module-sql-server/pom.xml b/dbptk-modules/dbptk-module-sql-server/pom.xml index 7542da529..0c47454dd 100644 --- a/dbptk-modules/dbptk-module-sql-server/pom.xml +++ b/dbptk-modules/dbptk-module-sql-server/pom.xml @@ -6,11 +6,11 @@ dbptk-module-sql-server com.databasepreservation dbptk-module-sql-server - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-rc1 .. diff --git a/dbptk-modules/pom.xml b/dbptk-modules/pom.xml index 35952c64f..93a2618b4 100644 --- a/dbptk-modules/pom.xml +++ b/dbptk-modules/pom.xml @@ -5,11 +5,11 @@ dbptk-modules com.databasepreservation dbptk-modules - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk - 2.0.0-beta7.3 + 2.0.0-rc1 .. pom diff --git a/pom.xml b/pom.xml index c446c2509..80b8194fc 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ Database Preservation Toolkit com.databasepreservation dbptk - 2.0.0-beta7.3 + 2.0.0-rc1 pom A toolkit that allows data migration and conversion between database management systems formats and digital preservation formats. @@ -20,7 +20,7 @@ 1.7 ${project.basedir}/vendor-libs/repository - 0.2.8 + 1.0.0-rc1 @@ -207,12 +207,12 @@ com.databasepreservation dbptk-model - 2.0.0-beta7.3 + 2.0.0-rc1 com.databasepreservation dbptk-model - 2.0.0-beta7.3 + 2.0.0-rc1 sources @@ -229,35 +229,35 @@ - com.databasepreservationdbptk-module-db22.0.0-beta7.3 - com.databasepreservationdbptk-module-db22.0.0-beta7.3sources + com.databasepreservationdbptk-module-db22.0.0-rc1 + com.databasepreservationdbptk-module-db22.0.0-rc1sources - com.databasepreservationdbptk-module-dbml2.0.0-beta7.3 - com.databasepreservationdbptk-module-dbml2.0.0-beta7.3sources + com.databasepreservationdbptk-module-dbml2.0.0-rc1 + com.databasepreservationdbptk-module-dbml2.0.0-rc1sources - com.databasepreservationdbptk-module-jdbc2.0.0-beta7.3 - com.databasepreservationdbptk-module-jdbc2.0.0-beta7.3sources + com.databasepreservationdbptk-module-jdbc2.0.0-rc1 + com.databasepreservationdbptk-module-jdbc2.0.0-rc1sources - com.databasepreservationdbptk-module-list-tables2.0.0-beta7.3 - com.databasepreservationdbptk-module-list-tables2.0.0-beta7.3sources + com.databasepreservationdbptk-module-list-tables2.0.0-rc1 + com.databasepreservationdbptk-module-list-tables2.0.0-rc1sources - com.databasepreservationdbptk-module-ms-access2.0.0-beta7.3 - com.databasepreservationdbptk-module-ms-access2.0.0-beta7.3sources + com.databasepreservationdbptk-module-ms-access2.0.0-rc1 + com.databasepreservationdbptk-module-ms-access2.0.0-rc1sources - com.databasepreservationdbptk-module-mysql2.0.0-beta7.3 - com.databasepreservationdbptk-module-mysql2.0.0-beta7.3sources + com.databasepreservationdbptk-module-mysql2.0.0-rc1 + com.databasepreservationdbptk-module-mysql2.0.0-rc1sources - com.databasepreservationdbptk-module-odbc2.0.0-beta7.3 - com.databasepreservationdbptk-module-odbc2.0.0-beta7.3sources + com.databasepreservationdbptk-module-odbc2.0.0-rc1 + com.databasepreservationdbptk-module-odbc2.0.0-rc1sources - com.databasepreservationdbptk-module-oracle2.0.0-beta7.3 - com.databasepreservationdbptk-module-oracle2.0.0-beta7.3sources + com.databasepreservationdbptk-module-oracle2.0.0-rc1 + com.databasepreservationdbptk-module-oracle2.0.0-rc1sources - com.databasepreservationdbptk-module-postgresql2.0.0-beta7.3 - com.databasepreservationdbptk-module-postgresql2.0.0-beta7.3sources + com.databasepreservationdbptk-module-postgresql2.0.0-rc1 + com.databasepreservationdbptk-module-postgresql2.0.0-rc1sources - com.databasepreservationdbptk-module-siard2.0.0-beta7.3 - com.databasepreservationdbptk-module-siard2.0.0-beta7.3sources + com.databasepreservationdbptk-module-siard2.0.0-rc1 + com.databasepreservationdbptk-module-siard2.0.0-rc1sources com.databasepreservationdbptk-bindings-siard11.1.1 com.databasepreservationdbptk-bindings-siard11.1.1sources @@ -268,14 +268,14 @@ com.databasepreservationdbptk-bindings-siarddk1.3.0 com.databasepreservationdbptk-bindings-siarddk1.3.0sources - com.databasepreservationdbptk-module-solr2.0.0-beta7.3 - com.databasepreservationdbptk-module-solr2.0.0-beta7.3sources + com.databasepreservationdbptk-module-solr2.0.0-rc1 + com.databasepreservationdbptk-module-solr2.0.0-rc1sources - com.databasepreservationdbptk-module-sql-file2.0.0-beta7.3 - com.databasepreservationdbptk-module-sql-file2.0.0-beta7.3sources + com.databasepreservationdbptk-module-sql-file2.0.0-rc1 + com.databasepreservationdbptk-module-sql-file2.0.0-rc1sources - com.databasepreservationdbptk-module-sql-server2.0.0-beta7.3 - com.databasepreservationdbptk-module-sql-server2.0.0-beta7.3sources + com.databasepreservationdbptk-module-sql-server2.0.0-rc1 + com.databasepreservationdbptk-module-sql-server2.0.0-rc1sources