[jira] [Updated] (SIS-337) Package EPSG Derby DB in sis-epsg jar, eliminating the need for external SIS_DATA dir
[ https://issues.apache.org/jira/browse/SIS-337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Desruisseaux updated SIS-337: Affects Version/s: 0.7 Description: Since [Derby supports|https://db.apache.org/derby/docs/10.7/devguide/cdevdeploy11201.html] read-only databases in .jar files, is there a reason that the `org.apache.sis.non-free:sis-epsg` package includes SQL source to create an external database, rather than the database itself? It would make deployment much easier if there were no need for a SIS_DATA directory and environment variable, and adding the dependency were the only thing necessary. was: Since [Derby supports](https://db.apache.org/derby/docs/10.7/devguide/cdevdeploy11201.html) read-only databases in .jar files, is there a reason that the `org.apache.sis.non-free:sis-epsg` package includes SQL source to create an external database, rather than the database itself? It would make deployment much easier if there were no need for a SIS_DATA directory and environment variable, and adding the dependency were the only thing necessary. Component/s: Referencing > Package EPSG Derby DB in sis-epsg jar, eliminating the need for external > SIS_DATA dir > -- > > Key: SIS-337 > URL: https://issues.apache.org/jira/browse/SIS-337 > Project: Spatial Information Systems > Issue Type: Wish > Components: Referencing >Affects Versions: 0.7 >Reporter: Kevin Mehall > > Since [Derby > supports|https://db.apache.org/derby/docs/10.7/devguide/cdevdeploy11201.html] > read-only databases in .jar files, is there a reason that the > `org.apache.sis.non-free:sis-epsg` package includes SQL source to create an > external database, rather than the database itself? > It would make deployment much easier if there were no need for a SIS_DATA > directory and environment variable, and adding the dependency were the only > thing necessary. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SIS-337) Package EPSG Derby DB in sis-epsg jar, eliminating the need for external SIS_DATA dir
[ https://issues.apache.org/jira/browse/SIS-337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15687785#comment-15687785 ] Martin Desruisseaux commented on SIS-337: - Right, the EPSG geodetic dataset could be embedded in a JAR file. It was not done yet because the {{SIS_DATA}} directory may contain not only the geodetic dataset, but also the datum grid shift files and custom CRS definitions provided by the users, among others. So {{SIS-DATA}} would be the central point for all those kinds of data. However I agree that a lot of users will want only the EPSG geodetic dataset. > Package EPSG Derby DB in sis-epsg jar, eliminating the need for external > SIS_DATA dir > -- > > Key: SIS-337 > URL: https://issues.apache.org/jira/browse/SIS-337 > Project: Spatial Information Systems > Issue Type: Wish >Reporter: Kevin Mehall > > Since [Derby > supports](https://db.apache.org/derby/docs/10.7/devguide/cdevdeploy11201.html) > read-only databases in .jar files, is there a reason that the > `org.apache.sis.non-free:sis-epsg` package includes SQL source to create an > external database, rather than the database itself? > It would make deployment much easier if there were no need for a SIS_DATA > directory and environment variable, and adding the dependency were the only > thing necessary. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
svn commit: r1770881 - in /sis/branches/JDK8: core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/ core/sis-metadata/src/m
Author: desruisseaux Date: Tue Nov 22 20:08:04 2016 New Revision: 1770881 URL: http://svn.apache.org/viewvc?rev=1770881=rev Log: First draft of a SQL installation script for metadata about file formats. This draft required changes in ScriptRunner and all classes that used it in order to avoid duplicating code. More metadata will be added later. Added: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/Installer.java (with props) sis/branches/JDK8/core/sis-metadata/src/main/resources/org/ sis/branches/JDK8/core/sis-metadata/src/main/resources/org/apache/ sis/branches/JDK8/core/sis-metadata/src/main/resources/org/apache/sis/ sis/branches/JDK8/core/sis-metadata/src/main/resources/org/apache/sis/metadata/ sis/branches/JDK8/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/ sis/branches/JDK8/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Create.sql (with props) sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/sql/ScriptRunnerTest.java (with props) sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/sql/ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/sql/MetadataSourceTest.java (with props) Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/ResultPool.java sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/sql/TestDatabase.java sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGInstaller.java sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGDataFormatter.java sis/branches/JDK8/ide-project/NetBeans/build.xml Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java?rev=1770881=1770880=1770881=diff == --- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java [UTF-8] Tue Nov 22 20:08:04 2016 @@ -19,10 +19,13 @@ package org.apache.sis.internal.metadata import java.util.Map; import java.util.HashMap; import java.util.Locale; +import java.util.regex.Pattern; +import java.util.regex.Matcher; import java.io.EOFException; import java.io.IOException; import java.io.BufferedReader; import java.io.LineNumberReader; +import java.io.InputStreamReader; import java.io.StringReader; import java.sql.Statement; import java.sql.Connection; @@ -50,7 +53,7 @@ import java.util.function.BiFunction; * * @author Martin Desruisseaux (Geomatys) * @since 0.7 - * @version 0.7 + * @version 0.8 * @module */ public class ScriptRunner implements AutoCloseable { @@ -102,9 +105,9 @@ public class ScriptRunner implements Aut /** * A mapping of words to replace. The replacements are performed only for occurrences outside identifiers or texts. - * See {@link #replace(String, String)} for more explanation. + * See {@link #addReplacement(String, String)} for more explanation. * - * @see #replace(String, String) + * @see #addReplacement(String, String) */ private final Mapreplacements = new HashMap<>(); @@ -124,6 +127,12 @@ public class ScriptRunner implements Aut /** * {@code true} if the database supports enums. + * Example: + * + * {@preformat sql + * CREATE TYPE metadata."CI_DateTypeCode" AS ENUM ('creation', 'publication'); + * CREATE CAST (VARCHAR AS metadata."CI_DateTypeCode") WITH INOUT AS ASSIGNMENT; + * } * * Notes per database product: * @@ -131,6 +140,8 @@ public class ScriptRunner implements Aut * we require PostgreSQL 8.4 because we need the {@code CAST … WITH INOUT} feature. * Other databases: assumed not supported. * + * + * @see #statementsToSkip */ protected final boolean isEnumTypeSupported; @@ -147,16 +158,42 @@ public class ScriptRunner implements Aut /** * {@code true} if the database supports {@code "GRANT USAGE ON SCHEMA"} statements. * Read-only permissions are typically granted to {@link #PUBLIC}. + * Example: + * + * {@preformat sql + * GRANT USAGE ON SCHEMA metadata TO PUBLIC; + * } + * + * @see #statementsToSkip */
[jira] [Created] (SIS-337) Package EPSG Derby DB in sis-epsg jar, eliminating the need for external SIS_DATA dir
Kevin Mehall created SIS-337: Summary: Package EPSG Derby DB in sis-epsg jar, eliminating the need for external SIS_DATA dir Key: SIS-337 URL: https://issues.apache.org/jira/browse/SIS-337 Project: Spatial Information Systems Issue Type: Wish Reporter: Kevin Mehall Since [Derby supports](https://db.apache.org/derby/docs/10.7/devguide/cdevdeploy11201.html) read-only databases in .jar files, is there a reason that the `org.apache.sis.non-free:sis-epsg` package includes SQL source to create an external database, rather than the database itself? It would make deployment much easier if there were no need for a SIS_DATA directory and environment variable, and adding the dependency were the only thing necessary. -- This message was sent by Atlassian JIRA (v6.3.4#6332)