diff --git a/Jenkinsfile b/Jenkinsfile index 3d4433ca79..e152278da9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,8 +6,8 @@ pipeline { disableConcurrentBuilds() } tools { - maven 'maven-3.6' - jdk 'adoptopenjdk-jdk8' + maven 'maven-3.8' + jdk 'adoptopenjdk-jdk11' } environment { MAVEN_OPTS='-Djava.awt.headless=true -Xmx4096m' diff --git a/checkstyle.xml b/checkstyle.xml index 1dc2b6c259..7d4320b51e 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -23,9 +23,6 @@ - - - diff --git a/deegree-client/deegree-jsf-core/pom.xml b/deegree-client/deegree-jsf-core/pom.xml index 672f4f829a..152e69fc75 100644 --- a/deegree-client/deegree-jsf-core/pom.xml +++ b/deegree-client/deegree-jsf-core/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-client - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-client/deegree-wps-webclient/pom.xml b/deegree-client/deegree-wps-webclient/pom.xml index fe0cbedef8..9eebabad2b 100644 --- a/deegree-client/deegree-wps-webclient/pom.xml +++ b/deegree-client/deegree-wps-webclient/pom.xml @@ -12,10 +12,14 @@ org.deegree deegree-client - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT + + jakarta.annotation + jakarta.annotation-api + org.deegree deegree-protocol-commons diff --git a/deegree-client/deegree-wpsprinter-webclient/pom.xml b/deegree-client/deegree-wpsprinter-webclient/pom.xml index 64505f2920..41da1d873c 100644 --- a/deegree-client/deegree-wpsprinter-webclient/pom.xml +++ b/deegree-client/deegree-wpsprinter-webclient/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-client - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-client/pom.xml b/deegree-client/pom.xml index 10f7b549c5..bd28972cf6 100644 --- a/deegree-client/pom.xml +++ b/deegree-client/pom.xml @@ -9,7 +9,7 @@ org.deegree deegree - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-connectionprovider-datasource/pom.xml b/deegree-core/deegree-connectionprovider-datasource/pom.xml index 4f083abcf4..b432343544 100644 --- a/deegree-core/deegree-connectionprovider-datasource/pom.xml +++ b/deegree-core/deegree-connectionprovider-datasource/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-connectionprovider-datasource/src/main/java/org/deegree/db/datasource/DataSourceConnectionProviderBuilder.java b/deegree-core/deegree-connectionprovider-datasource/src/main/java/org/deegree/db/datasource/DataSourceConnectionProviderBuilder.java index 7660cf056e..5786bd7504 100644 --- a/deegree-core/deegree-connectionprovider-datasource/src/main/java/org/deegree/db/datasource/DataSourceConnectionProviderBuilder.java +++ b/deegree-core/deegree-connectionprovider-datasource/src/main/java/org/deegree/db/datasource/DataSourceConnectionProviderBuilder.java @@ -1,11 +1,13 @@ /*---------------------------------------------------------------------------- This file is part of deegree, http://deegree.org/ - Copyright (C) 2001-2014 by: + Copyright (C) 2001-2022 by: - Department of Geography, University of Bonn - and - lat/lon GmbH - and - Occam Labs UG (haftungsbeschränkt) - + and + - grit graphische Informationstechnik Beratungsgesellschaft mbH - This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free @@ -35,6 +37,11 @@ Occam Labs UG (haftungsbeschränkt) Godesberger Allee 139, 53175 Bonn Germany + + grit graphische Informationstechnik Beratungsgesellschaft mbH + Landwehrstr. 143, 59368 Werne + Germany + http://www.grit.de/ e-mail: info@deegree.org ----------------------------------------------------------------------------*/ @@ -49,6 +56,7 @@ Occam Labs UG (haftungsbeschränkt) import javax.sql.DataSource; import org.deegree.db.ConnectionProvider; +import org.deegree.db.dialect.SqlDialectProvider; import org.deegree.db.dialect.SqlDialects; import org.deegree.sqldialect.SQLDialect; import org.deegree.workspace.ResourceBuilder; @@ -60,6 +68,7 @@ Occam Labs UG (haftungsbeschränkt) * {@link ResourceBuilder} for the {@link DataSourceConnectionProvider}. * * @author Markus Schneider + * @author Stephan Reichhelm * * @since 3.4 */ @@ -85,7 +94,21 @@ public ConnectionProvider build() { final DataSource ds = initializeDataSourceInstance(); final Method destroyMethod = getDestroyMethod( ds, config.getDataSource().getDestroyMethod() ); final Connection conn = checkConnectivity( ds ); - final SQLDialect dialect = SqlDialects.lookupSqlDialect( conn, workspace.getModuleClassLoader() ); + final SQLDialect dialect; + if ( config.getDialectProvider() != null ) { + String dialectProviderCls = config.getDialectProvider().getJavaClass(); + try { + Class clazz = workspace.getModuleClassLoader().loadClass( dialectProviderCls ); + SqlDialectProvider prov = clazz.asSubclass( SqlDialectProvider.class ).newInstance(); + dialect = prov.createDialect( conn ); + } catch ( Exception ex ) { + final String msg = "Configured SQL dialect provider '" + dialectProviderCls + "' failed to initialize: " + + ex.getLocalizedMessage(); + throw new ResourceException( msg, ex ); + } + } else { + dialect = SqlDialects.lookupSqlDialect( conn, workspace.getModuleClassLoader() ); + } close( conn ); return new DataSourceConnectionProvider( metadata, ds, dialect, destroyMethod ); } diff --git a/deegree-core/deegree-connectionprovider-datasource/src/main/java/org/deegree/db/datasource/DataSourceConnectionProviderProvider.java b/deegree-core/deegree-connectionprovider-datasource/src/main/java/org/deegree/db/datasource/DataSourceConnectionProviderProvider.java index 7d4fab05b6..cdc315de0d 100644 --- a/deegree-core/deegree-connectionprovider-datasource/src/main/java/org/deegree/db/datasource/DataSourceConnectionProviderProvider.java +++ b/deegree-core/deegree-connectionprovider-datasource/src/main/java/org/deegree/db/datasource/DataSourceConnectionProviderProvider.java @@ -59,7 +59,7 @@ public class DataSourceConnectionProviderProvider extends ConnectionProviderProv static final String CONFIG_NAMESPACE = "http://www.deegree.org/connectionprovider/datasource"; - static final URL SCHEMA_URL = DataSourceConnectionProviderProvider.class.getResource( "/META-INF/schemas/connectionprovider/datasource/3.4.0/datasource.xsd" ); + static final URL SCHEMA_URL = DataSourceConnectionProviderProvider.class.getResource( "/META-INF/schemas/connectionprovider/datasource/datasource.xsd" ); @Override public String getNamespace() { diff --git a/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/datasource.xsd b/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/datasource.xsd similarity index 76% rename from deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/datasource.xsd rename to deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/datasource.xsd index 83ff935fd2..ca1034f10f 100644 --- a/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/datasource.xsd +++ b/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/datasource.xsd @@ -18,8 +18,8 @@ - - + + @@ -31,11 +31,16 @@ - + + + + + + - + diff --git a/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_dbcp_mssql.xml b/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_dbcp_mssql.xml similarity index 91% rename from deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_dbcp_mssql.xml rename to deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_dbcp_mssql.xml index 97ec533d22..545387836f 100644 --- a/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_dbcp_mssql.xml +++ b/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_dbcp_mssql.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.deegree.org/connectionprovider/datasource http://schemas.deegree.org/3.5/jdbc/datasource/datasource.xsd"> diff --git a/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_dbcp_oracle.xml b/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_dbcp_oracle.xml similarity index 91% rename from deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_dbcp_oracle.xml rename to deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_dbcp_oracle.xml index 305700e9c7..ac3e3bb57a 100644 --- a/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_dbcp_oracle.xml +++ b/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_dbcp_oracle.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.deegree.org/connectionprovider/datasource http://schemas.deegree.org/3.5/jdbc/datasource/datasource.xsd"> diff --git a/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_dbcp_postgres.xml b/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_dbcp_postgres.xml similarity index 91% rename from deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_dbcp_postgres.xml rename to deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_dbcp_postgres.xml index 18176a7252..30865af1d0 100644 --- a/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_dbcp_postgres.xml +++ b/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_dbcp_postgres.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.deegree.org/connectionprovider/datasource http://schemas.deegree.org/3.5/jdbc/datasource/datasource.xsd"> diff --git a/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_jndi.xml b/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_jndi.xml similarity index 87% rename from deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_jndi.xml rename to deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_jndi.xml index 3d4565da74..660f4b9bde 100644 --- a/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_jndi.xml +++ b/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_jndi.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.deegree.org/connectionprovider/datasource http://schemas.deegree.org/3.5/jdbc/datasource/datasource.xsd"> diff --git a/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_ucp.xml b/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_ucp.xml similarity index 92% rename from deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_ucp.xml rename to deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_ucp.xml index 567ef9c926..f3a0eccea4 100644 --- a/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/3.4.0/example_ucp.xml +++ b/deegree-core/deegree-connectionprovider-datasource/src/main/resources/META-INF/schemas/connectionprovider/datasource/example_ucp.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.deegree.org/connectionprovider/datasource http://schemas.deegree.org/3.5/jdbc/datasource/datasource.xsd"> diff --git a/deegree-core/deegree-core-3d/pom.xml b/deegree-core/deegree-core-3d/pom.xml index d844b0af35..a9a20b9c2a 100644 --- a/deegree-core/deegree-core-3d/pom.xml +++ b/deegree-core/deegree-core-3d/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-3d/src/main/java/org/deegree/rendering/r3d/multiresolution/persistence/BatchedMTFileStoreProvider.java b/deegree-core/deegree-core-3d/src/main/java/org/deegree/rendering/r3d/multiresolution/persistence/BatchedMTFileStoreProvider.java index 93bbced70f..13aa6bd79e 100644 --- a/deegree-core/deegree-core-3d/src/main/java/org/deegree/rendering/r3d/multiresolution/persistence/BatchedMTFileStoreProvider.java +++ b/deegree-core/deegree-core-3d/src/main/java/org/deegree/rendering/r3d/multiresolution/persistence/BatchedMTFileStoreProvider.java @@ -53,7 +53,7 @@ public class BatchedMTFileStoreProvider extends BatchedMTStoreProvider { private static final String CONFIG_NS = "http://www.deegree.org/datasource/3d/batchedmt/file"; - private static final URL CONFIG_SCHEMA = BatchedMTFileStoreProvider.class.getResource( "/META-INF/schemas/datasource/3d/batchedmt/3.4.0/file.xsd" ); + private static final URL CONFIG_SCHEMA = BatchedMTFileStoreProvider.class.getResource( "/META-INF/schemas/datasource/3d/batchedmt/file.xsd" ); public String getNamespace() { return CONFIG_NS; diff --git a/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/batchedmt/3.4.0/example.xml b/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/batchedmt/example.xml similarity index 82% rename from deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/batchedmt/3.4.0/example.xml rename to deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/batchedmt/example.xml index fc2624e39c..3d4501c7c5 100644 --- a/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/batchedmt/3.4.0/example.xml +++ b/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/batchedmt/example.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://www.deegree.org/datasource/3d/batchedmt/file http://schemas.deegree.org/3.5/datasource/3d/batchedmt/file.xsd"> ../../../data/batchedmt 500048576 \ No newline at end of file diff --git a/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/batchedmt/3.4.0/file.xsd b/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/batchedmt/file.xsd similarity index 81% rename from deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/batchedmt/3.4.0/file.xsd rename to deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/batchedmt/file.xsd index 5e92162a53..ce2fc9f50a 100644 --- a/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/batchedmt/3.4.0/file.xsd +++ b/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/batchedmt/file.xsd @@ -24,14 +24,7 @@ - - - - - - - - + diff --git a/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/3.4.0/file.xsd b/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/file.xsd similarity index 83% rename from deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/3.4.0/file.xsd rename to deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/file.xsd index f4281ea991..a9e63ef734 100644 --- a/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/3.4.0/file.xsd +++ b/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/file.xsd @@ -25,14 +25,7 @@ - - - - - - - - + diff --git a/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/3.4.0/file_example.xml b/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/file_example.xml similarity index 84% rename from deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/3.4.0/file_example.xml rename to deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/file_example.xml index dc782ee106..4ca9ded1a8 100644 --- a/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/3.4.0/file_example.xml +++ b/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/file_example.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://www.deegree.org/datasource/3d/renderable/file http://schemas.deegree.org/3.5/datasource/3d/renderable/file.xsd"> ../../../data/renderable/buildings/objects ../../../data/renderable/buildings/prototypes \ No newline at end of file diff --git a/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/3.4.0/sql.xsd b/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/sql.xsd similarity index 83% rename from deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/3.4.0/sql.xsd rename to deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/sql.xsd index 08c6a3f62f..93fbdc82e4 100644 --- a/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/3.4.0/sql.xsd +++ b/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/sql.xsd @@ -26,14 +26,7 @@ - - - - - - - - + diff --git a/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/3.4.0/sql_example.xml b/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/sql_example.xml similarity index 81% rename from deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/3.4.0/sql_example.xml rename to deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/sql_example.xml index a583f5c1ff..07e3433b92 100644 --- a/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/3.4.0/sql_example.xml +++ b/deegree-core/deegree-core-3d/src/main/resources/META-INF/schemas/datasource/3d/renderable/sql_example.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://www.deegree.org/datasource/3d/renderable/sql http://schemas.deegree.org/3.5/datasource/3d/renderable/sql.xsd"> conn1 table \ No newline at end of file diff --git a/deegree-core/deegree-core-annotations/pom.xml b/deegree-core/deegree-core-annotations/pom.xml index 6c35989301..7f6438e2ea 100644 --- a/deegree-core/deegree-core-annotations/pom.xml +++ b/deegree-core/deegree-core-annotations/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-base/pom.xml b/deegree-core/deegree-core-base/pom.xml index 6bca69973b..1a5c34a029 100644 --- a/deegree-core/deegree-core-base/pom.xml +++ b/deegree-core/deegree-core-base/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-commons/pom.xml b/deegree-core/deegree-core-commons/pom.xml index 21b49c1d06..76be221042 100644 --- a/deegree-core/deegree-core-commons/pom.xml +++ b/deegree-core/deegree-core-commons/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT @@ -25,6 +25,14 @@ + + jakarta.xml.bind + jakarta.xml.bind-api + + + com.sun.xml.bind + jaxb-impl + org.deegree deegree-core-workspace @@ -94,10 +102,6 @@ org.deegree deegree-ogcschemas - - javax.mail - mail - org.slf4j slf4j-api diff --git a/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/ows/metadata/DatasetMetadata.java b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/ows/metadata/DatasetMetadata.java index 590c4a70f5..75e8b17171 100644 --- a/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/ows/metadata/DatasetMetadata.java +++ b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/ows/metadata/DatasetMetadata.java @@ -67,6 +67,8 @@ public class DatasetMetadata extends Description { private final Attribution attribution; + private final List extendedDescriptions; + /** * Creates a new {@link DatasetMetadata} instance. * @@ -79,7 +81,7 @@ public class DatasetMetadata extends Description { * @param keywords * keywords, may be null (no keywords) * @param metadataUrls - * urls of metadata records, may be null (no metadata records)) + * urls of metadata records, may be null (no metadata records) * @param externalIds * external identifiers, may be null (no external identifiers) * @param dataUrls @@ -88,12 +90,14 @@ public class DatasetMetadata extends Description { * links to the list of the features (used in a layer), may be null (no links) * @param attribution * indicates the provider of a layer, may be null (no attribution) + * @param extendedDescriptions + * extended descriptions of a layer, may be null (no extendedDescriptions) */ public DatasetMetadata( final QName name, final List titles, final List abstracts, final List, CodeType>> keywords, final List metadataUrls, final List externalIds, final List dataUrls, final List featureListUrls, - final Attribution attribution ) { + final Attribution attribution, final List extendedDescriptions ) { super( name.getLocalPart(), titles, abstracts, keywords ); this.name = name; this.metadataUrls = metadataUrls; @@ -101,6 +105,7 @@ public DatasetMetadata( final QName name, final List titles, fin this.dataUrls = dataUrls; this.featureListUrls = featureListUrls; this.attribution = attribution; + this.extendedDescriptions = extendedDescriptions; } /** @@ -157,4 +162,13 @@ public Attribution getAttribution() { return attribution; } + /** + * Returns the extended descriptions. + * + * @return extended descriptions, may be null (no extended descriptions) + */ + public List getExtendedDescriptions() { + return extendedDescriptions; + } + } diff --git a/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/ows/metadata/ExtendedDescription.java b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/ows/metadata/ExtendedDescription.java new file mode 100644 index 0000000000..bdc25fa66b --- /dev/null +++ b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/ows/metadata/ExtendedDescription.java @@ -0,0 +1,77 @@ +/*---------------------------------------------------------------------------- + This file is part of deegree, http://deegree.org/ + Copyright (C) 2001-2022 by: + - Department of Geography, University of Bonn - + and + - lat/lon GmbH - + + This library is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free + Software Foundation; either version 2.1 of the License, or (at your option) + any later version. + This library is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + details. + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact information: + + lat/lon GmbH + Aennchenstr. 19, 53177 Bonn + Germany + http://lat-lon.de/ + + Department of Geography, University of Bonn + Prof. Dr. Klaus Greve + Postfach 1147, 53001 Bonn + Germany + http://www.geographie.uni-bonn.de/deegree/ + + e-mail: info@deegree.org + ----------------------------------------------------------------------------*/ +package org.deegree.commons.ows.metadata; + +import java.util.List; + +import javax.xml.namespace.QName; + +/** + * @author Lyn Goltz + */ +public class ExtendedDescription { + + private String name; + + private QName type; + + private String metadata; + + private List values; + + public ExtendedDescription(String name, QName type, String metadata, List values) { + this.name = name; + this.type = type; + this.metadata = metadata; + this.values = values; + } + + public String getName() { + return name; + } + + public QName getType() { + return type; + } + + public String getMetadata() { + return metadata; + } + + public List getValues() { + return values; + } + +} diff --git a/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/proxy/ProxySettings.java b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/proxy/ProxySettings.java index c5df6ef72a..e8ad5d104f 100644 --- a/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/proxy/ProxySettings.java +++ b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/proxy/ProxySettings.java @@ -45,6 +45,7 @@ import java.net.PasswordAuthentication; import java.net.URL; import java.net.URLConnection; +import java.security.GeneralSecurityException; import java.util.Properties; import org.apache.commons.codec.binary.Base64; @@ -73,35 +74,45 @@ public final class ProxySettings implements Initializable { private static final String CONFIG_JAXB_PACKAGE = "org.deegree.commons.proxy.jaxb"; - private static final URL CONFIG_SCHEMA = ProxySettings.class.getResource( "/META-INF/schemas/proxy/3.4.0/proxy.xsd" ); + private static final URL CONFIG_SCHEMA = ProxySettings.class.getResource( "/META-INF/schemas/proxy/proxy.xsd" ); private static final String PROXY_HOST = "proxyHost"; private static final String HTTP_PROXY_HOST = "http.proxyHost"; + + private static final String HTTPS_PROXY_HOST = "https.proxyHost"; private static final String FTP_PROXY_HOST = "ftp.proxyHost"; private static final String PROXY_PORT = "proxyPort"; private static final String HTTP_PROXY_PORT = "http.proxyPort"; + + private static final String HTTPS_PROXY_PORT = "https.proxyPort"; private static final String FTP_PROXY_PORT = "ftp.proxyPort"; private static final String PROXY_USER = "proxyUser"; private static final String HTTP_PROXY_USER = "http.proxyUser"; + + private static final String HTTPS_PROXY_USER = "https.proxyUser"; private static final String FTP_PROXY_USER = "ftp.proxyUser"; private static final String PROXY_PASSWORD = "proxyPassword"; private static final String HTTP_PROXY_PASSWORD = "http.proxyPassword"; + + private static final String HTTPS_PROXY_PASSWORD = "https.proxyPassword"; private static final String FTP_PROXY_PASSWORD = "ftp.proxyPassword"; private static final String NON_PROXY_HOSTS = "nonProxyHosts"; private static final String HTTP_NON_PROXY_HOSTS = "http.nonProxyHosts"; + + private static final String HTTPS_NON_PROXY_HOSTS = "https.nonProxyHosts"; private static final String FTP_NON_PROXY_HOSTS = "ftp.nonProxyHosts"; @@ -138,6 +149,8 @@ public void init( Workspace workspace ) { workspace ); if ( proxyConfig != null ) { setupProxyParameters( proxyConfig ); + LOG.info( "Current proxy settings (if present) will be overwritten: {}", + proxyConfig.isOverrideSystemSettings() ? "yes" : "no" ); } } catch ( Exception e ) { String msg = "Could not unmarshall proxy configuration: " + e.getMessage(); @@ -157,52 +170,83 @@ public synchronized static void setupProxyParameters( ProxyConfiguration config String proxyHost = config.getProxyHost(); String httpProxyHost = config.getHttpProxyHost(); + String httpsProxyHost = config.getHttpsProxyHost(); String ftpProxyHost = config.getFtpProxyHost(); int proxyPort = config.getProxyPort() != null ? config.getProxyPort().intValue() : -1; int httpProxyPort = config.getHttpProxyPort() != null ? config.getHttpProxyPort().intValue() : -1; + int httpsProxyPort = config.getHttpsProxyPort() != null ? config.getHttpsProxyPort().intValue() : -1; int ftpProxyPort = config.getFtpProxyPort() != null ? config.getFtpProxyPort().intValue() : -1; String proxyUser = config.getProxyUser(); String httpProxyUser = config.getHttpProxyUser(); + String httpsProxyUser = config.getHttpsProxyUser(); String ftpProxyUser = config.getFtpProxyUser(); String proxyPassword = config.getProxyPassword(); String httpProxyPassword = config.getHttpProxyPassword(); + String httpsProxyPassword = config.getHttpsProxyPassword(); String ftpProxyPassword = config.getFtpProxyPassword(); String nonProxyHosts = config.getNonProxyHosts(); String httpNonProxyHosts = config.getHttpNonProxyHosts(); + String httpsNonProxyHosts = config.getHttpsNonProxyHosts(); String ftpNonProxyHosts = config.getFtpNonProxyHosts(); - setupProxyParameters( proxyHost, httpProxyHost, ftpProxyHost, proxyPort, httpProxyPort, ftpProxyPort, - proxyUser, httpProxyUser, ftpProxyUser, proxyPassword, httpProxyPassword, - ftpProxyPassword, nonProxyHosts, httpNonProxyHosts, ftpNonProxyHosts, + setupProxyParameters( proxyHost, httpProxyHost, httpsProxyHost, ftpProxyHost, proxyPort, httpProxyPort, + httpsProxyPort, ftpProxyPort, proxyUser, httpProxyUser, httpsProxyUser, ftpProxyUser, + proxyPassword, httpProxyPassword, httpsProxyPassword, ftpProxyPassword, nonProxyHosts, + httpNonProxyHosts, httpsNonProxyHosts, ftpNonProxyHosts, config.isOverrideSystemSettings() ); } + + /** + * Sets/augments the VM's proxy configuration. + * + * @see ProxySettings#setupProxyParameters(String, String, String, String, int, int, int, int, String, String, String, String, String, String, String, String, String, String, String, String, boolean) + */ + @Deprecated + public synchronized static void setupProxyParameters( String proxyHost, String httpProxyHost, String ftpProxyHost, + int proxyPort, int httpProxyPort, int ftpProxyPort, + String proxyUser, String httpProxyUser, String ftpProxyUser, + String proxyPassword, String httpProxyPassword, + String ftpProxyPassword, String nonProxyHosts, + String httpNonProxyHosts, String ftpNonProxyHosts, + boolean override ) { + LOG.warn( "Using HTTP proxy settings for HTTPS proxy" ); + setupProxyParameters( proxyHost, httpProxyHost, httpProxyHost, ftpProxyHost, proxyPort, httpProxyPort, + httpProxyPort, ftpProxyPort, proxyUser, httpProxyUser, httpProxyUser, ftpProxyUser, + proxyPassword, httpProxyPassword, httpProxyPassword, ftpProxyPassword, nonProxyHosts, + httpNonProxyHosts, httpNonProxyHosts, ftpNonProxyHosts, override ); + } /** * Sets/augments the VM's proxy configuration. * * @param proxyHost * @param httpProxyHost + * @param httpsProxyHost * @param ftpProxyHost * @param proxyPort * @param httpProxyPort + * @param httpsProxyHost * @param ftpProxyPort * @param proxyUser * @param httpProxyUser + * @param httpsProxyUser * @param ftpProxyUser * @param proxyPassword * @param httpProxyPassword + * @param httpsProxyPassword * @param ftpProxyPassword * @param nonProxyHosts * @param httpNonProxyHosts + * @param httpsNonProxyHosts * @param ftpNonProxyHosts * @param override */ - public synchronized static void setupProxyParameters( String proxyHost, String httpProxyHost, String ftpProxyHost, - int proxyPort, int httpProxyPort, int ftpProxyPort, - String proxyUser, String httpProxyUser, String ftpProxyUser, - String proxyPassword, String httpProxyPassword, + public synchronized static void setupProxyParameters( String proxyHost, String httpProxyHost, String httpsProxyHost, String ftpProxyHost, + int proxyPort, int httpProxyPort, int httpsProxyPort, int ftpProxyPort, + String proxyUser, String httpProxyUser, String httpsProxyUser, String ftpProxyUser, + String proxyPassword, String httpProxyPassword, String httpsProxyPassword, String ftpProxyPassword, String nonProxyHosts, - String httpNonProxyHosts, String ftpNonProxyHosts, + String httpNonProxyHosts, String httpsNonProxyHosts, String ftpNonProxyHosts, boolean override ) { Properties props = System.getProperties(); @@ -212,6 +256,9 @@ public synchronized static void setupProxyParameters( String proxyHost, String h if ( override || props.get( HTTP_PROXY_HOST ) == null ) { setProperty( HTTP_PROXY_HOST, httpProxyHost ); } + if ( override || props.get( HTTPS_PROXY_HOST ) == null ) { + setProperty( HTTPS_PROXY_HOST, httpsProxyHost ); + } if ( override || props.get( FTP_PROXY_HOST ) == null ) { setProperty( FTP_PROXY_HOST, ftpProxyHost ); } @@ -229,6 +276,13 @@ public synchronized static void setupProxyParameters( String proxyHost, String h setProperty( HTTP_PROXY_PORT, null ); } } + if ( override || props.get( HTTPS_PROXY_PORT ) == null ) { + if ( httpProxyPort != -1 ) { + setProperty( HTTPS_PROXY_PORT, "" + httpsProxyPort ); + } else { + setProperty( HTTPS_PROXY_PORT, null ); + } + } if ( override || props.get( FTP_PROXY_PORT ) == null ) { if ( ftpProxyPort != -1 ) { setProperty( FTP_PROXY_PORT, "" + ftpProxyPort ); @@ -243,6 +297,9 @@ public synchronized static void setupProxyParameters( String proxyHost, String h if ( override || props.get( HTTP_PROXY_USER ) == null ) { setProperty( HTTP_PROXY_USER, httpProxyUser ); } + if ( override || props.get( HTTPS_PROXY_USER ) == null ) { + setProperty( HTTPS_PROXY_USER, httpsProxyUser ); + } if ( override || props.get( FTP_PROXY_USER ) == null ) { setProperty( FTP_PROXY_USER, ftpProxyUser ); } @@ -253,6 +310,9 @@ public synchronized static void setupProxyParameters( String proxyHost, String h if ( override || props.get( HTTP_PROXY_PASSWORD ) == null ) { setProperty( HTTP_PROXY_PASSWORD, httpProxyPassword ); } + if ( override || props.get( HTTPS_PROXY_PASSWORD ) == null ) { + setProperty( HTTPS_PROXY_PASSWORD, httpsProxyPassword ); + } if ( override || props.get( FTP_PROXY_PASSWORD ) == null ) { setProperty( FTP_PROXY_PASSWORD, ftpProxyPassword ); } @@ -263,9 +323,13 @@ public synchronized static void setupProxyParameters( String proxyHost, String h if ( override || props.get( HTTP_NON_PROXY_HOSTS ) == null ) { setProperty( HTTP_NON_PROXY_HOSTS, httpNonProxyHosts ); } + if ( override || props.get( HTTPS_NON_PROXY_HOSTS ) == null ) { + setProperty( HTTPS_NON_PROXY_HOSTS, httpsNonProxyHosts ); + } if ( override || props.get( FTP_NON_PROXY_HOSTS ) == null ) { setProperty( FTP_NON_PROXY_HOSTS, ftpNonProxyHosts ); } + if ( override || props.get( PROXY_SET ) == null ) { setProperty( PROXY_SET, "true" ); } @@ -353,6 +417,14 @@ public static String getHttpProxyHost( boolean considerBaseConfig ) { } return result; } + + public static String getHttpsProxyHost( boolean considerBaseConfig ) { + String result = System.getProperty( HTTPS_PROXY_HOST ); + if ( considerBaseConfig && result == null ) { + result = getProxyHost(); + } + return result; + } public static String getFtpProxyHost( boolean considerBaseConfig ) { String result = System.getProperty( FTP_PROXY_HOST ); @@ -373,6 +445,14 @@ public static String getHttpProxyPort( boolean considerBaseConfig ) { } return result; } + + public static String getHttpsProxyPort( boolean considerBaseConfig ) { + String result = System.getProperty( HTTPS_PROXY_PORT ); + if ( considerBaseConfig && result == null ) { + result = getProxyPort(); + } + return result; + } public static String getFtpProxyPort( boolean considerBaseConfig ) { String result = System.getProperty( FTP_PROXY_PORT ); @@ -393,6 +473,14 @@ public static String getHttpProxyUser( boolean considerBaseConfig ) { } return result; } + + public static String getHttpsProxyUser( boolean considerBaseConfig ) { + String result = System.getProperty( HTTPS_PROXY_USER ); + if ( considerBaseConfig && result == null ) { + result = getProxyUser(); + } + return result; + } public static String getFtpProxyUser( boolean considerBaseConfig ) { String result = System.getProperty( FTP_PROXY_USER ); @@ -413,6 +501,14 @@ public static String getHttpProxyPassword( boolean considerBaseConfig ) { } return result; } + + public static String getHttpsProxyPassword( boolean considerBaseConfig ) { + String result = System.getProperty( HTTPS_PROXY_PASSWORD ); + if ( considerBaseConfig && result == null ) { + result = getProxyPassword(); + } + return result; + } public static String getFtpProxyPassword( boolean considerBaseConfig ) { String result = System.getProperty( FTP_PROXY_PASSWORD ); @@ -433,6 +529,14 @@ public static String getHttpNonProxyHosts( boolean considerBaseConfig ) { } return result; } + + public static String getHttpsNonProxyHosts( boolean considerBaseConfig ) { + String result = System.getProperty( HTTPS_NON_PROXY_HOSTS ); + if ( considerBaseConfig && result == null ) { + result = getNonProxyHosts(); + } + return result; + } public static String getFtpNonProxyHosts( boolean considerBaseConfig ) { String result = System.getProperty( FTP_NON_PROXY_HOSTS ); @@ -443,16 +547,19 @@ public static String getFtpNonProxyHosts( boolean considerBaseConfig ) { } public static void logProxyConfiguration( Logger log ) { - log.info( "- proxyHost=" + getProxyHost() + ", http.proxyHost=" + getHttpProxyHost( false ) - + ", ftp.proxyHost=" + getFtpProxyHost( false ) ); - log.info( "- proxyPort=" + getProxyPort() + ", http.proxyPort=" + getHttpProxyPort( false ) - + ", ftp.proxyPort=" + getFtpProxyPort( false ) ); - log.info( "- proxyUser=" + getProxyUser() + ", http.proxyUser=" + getHttpProxyUser( false ) - + ", ftp.proxyUser=" + getFtpProxyUser( false ) ); - log.info( "- proxyPassword=" + getProxyPassword() + ", http.proxyPassword=" + getHttpProxyPassword( false ) - + ", ftp.proxyPassword=" + getFtpProxyPassword( false ) ); - log.info( "- nonProxyHosts=" + getNonProxyHosts() + ", http.nonProxyHosts=" + getHttpNonProxyHosts( false ) - + ", ftp.nonProxyHosts=" + getFtpNonProxyHosts( false ) ); + + log.info( "- proxyHost={}, http.proxyHost={}, https.proxyHost={}, ftp.proxyHost={}", getProxyHost(), + getHttpProxyHost( false ), getHttpsProxyHost( false ), getFtpProxyHost( false ) ); + log.info( "- proxyPort={}, http.proxyPort={}, https.proxyPort={}, ftp.proxyPort={}", getProxyPort(), + getHttpProxyPort( false ), getHttpsProxyPort( false ), getFtpProxyPort( false ) ); + log.info( "- proxyUser={}, http.proxyUser={}, https.proxyUser={}, ftp.proxyUser={}", getProxyUser(), + getHttpProxyUser( false ), getHttpsProxyUser( false ), getFtpProxyUser( false ) ); + log.info( "- proxyPassword={}, http.proxyPassword={}, https.proxyPassword={}, ftp.proxyPassword={}", + getProxyPassword(), getHttpProxyPassword( false ), getHttpsProxyPassword( false ), + getFtpProxyPassword( false ) ); + log.info( "- nonProxyHosts={}, http.nonProxyHosts={}, https.nonProxyHosts={},ftp.nonProxyHosts={}", + getNonProxyHosts(), getHttpNonProxyHosts( false ), getHttpsNonProxyHosts( false ), + getFtpNonProxyHosts( false ) ); } private void setupAuthenticator() { diff --git a/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/utils/TunableParameter.java b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/utils/TunableParameter.java index b154de1934..4bec8d471d 100644 --- a/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/utils/TunableParameter.java +++ b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/utils/TunableParameter.java @@ -67,6 +67,8 @@ public class TunableParameter { private static final Map CONFIG_STR = new HashMap<>(); private static final Map CONFIG_NUM = new HashMap<>(); + + private static final Map CONFIG_BOOL = new HashMap<>(); public static String get( String key, String defaultValue ) { boolean has = CONFIG_STR.containsKey( key ); @@ -88,7 +90,32 @@ public static String get( String key, String defaultValue ) { return val; } } + + public static boolean get( String key, boolean defaultValue ) { + return get( key, Boolean.valueOf( defaultValue ) ).booleanValue(); + } + + public static Boolean get( String key, Boolean defaultValue ) { + boolean has = CONFIG_BOOL.containsKey( key ); + Boolean val = CONFIG_BOOL.get( key ); + if ( !has ) { + val = getFromJndi( key ); + + if ( val == null ) { + val = getBooleanFromSystem( key ); + } + + CONFIG_BOOL.put( key, val ); + } + + if ( val == null ) { + return defaultValue; + } else { + return val; + } + } + public static double get( String key, double defaultValue ) { return get( key, Double.valueOf( defaultValue ) ).doubleValue(); } @@ -112,7 +139,7 @@ public static short get( String key, short defaultValue ) { public static byte get( String key, byte defaultValue ) { return get( key, Byte.valueOf( defaultValue ) ).byteValue(); } - + private static Number get( String key, Number defaultValue ) { boolean has = CONFIG_NUM.containsKey( key ); Number val = CONFIG_NUM.get( key ); @@ -146,6 +173,19 @@ private static Number getFromSystem( String key ) { } return null; } + + private static Boolean getBooleanFromSystem( String key ) { + try { + String str = System.getProperty( key ); + if ( str != null ) { + return Boolean.valueOf( str ); + } + } catch ( Exception ex ) { + LOG.warn( "Could not parse tuneable '{}' as boolean: {}", key, ex.getMessage() ); + LOG.trace( "Exception", ex ); + } + return null; + } private static T getFromJndi( String key ) { try { diff --git a/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/utils/net/HttpUtils.java b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/utils/net/HttpUtils.java index f105e58fdc..cfb40ea0cf 100644 --- a/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/utils/net/HttpUtils.java +++ b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/utils/net/HttpUtils.java @@ -428,7 +428,8 @@ public static T get( Worker worker, String url, Map heade if ( !u.valid() ) { return null; } - if ( !u.getURL().getProtocol().equalsIgnoreCase( "http" ) ) { + final String protocol = u.getURL().getProtocol(); + if ( !( "http".equalsIgnoreCase( protocol ) || "https".equalsIgnoreCase( protocol ) ) ) { return worker.work( u.getURL().openStream() ); } DefaultHttpClient client = enableProxyUsage( new DefaultHttpClient(), u ); diff --git a/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/xml/jaxb/JAXBUtils.java b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/xml/jaxb/JAXBUtils.java index e4acfe812a..af110fa31c 100644 --- a/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/xml/jaxb/JAXBUtils.java +++ b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/xml/jaxb/JAXBUtils.java @@ -146,9 +146,9 @@ private static Schema getSchemaForUrl( URL schemaFile ) { try { StreamSource origSchema = new StreamSource( new DURL( schemaFile.toExternalForm() ).openStream(), schemaFile.toExternalForm() ); - URL descUrl = JAXBUtils.class.getResource( "/META-INF/schemas/commons/description/3.4.0/description.xsd" ); - URL spatUrl = JAXBUtils.class.getResource( "/META-INF/schemas/commons/spatialmetadata/3.4.0/spatialmetadata.xsd" ); - URL layUrl = JAXBUtils.class.getResource( "/META-INF/schemas/layers/base/3.4.0/base.xsd" ); + URL descUrl = JAXBUtils.class.getResource( "/META-INF/schemas/commons/description/description.xsd" ); + URL spatUrl = JAXBUtils.class.getResource( "/META-INF/schemas/commons/spatialmetadata/spatialmetadata.xsd" ); + URL layUrl = JAXBUtils.class.getResource( "/META-INF/schemas/layers/base/base.xsd" ); StreamSource desc = new StreamSource( new DURL( descUrl.toExternalForm() ).openStream(), descUrl.toExternalForm() ); List list = new ArrayList(); diff --git a/deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/commons/description/3.4.0/description.xsd b/deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/commons/description/description.xsd similarity index 100% rename from deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/commons/description/3.4.0/description.xsd rename to deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/commons/description/description.xsd diff --git a/deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/proxy/3.4.0/example.xml b/deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/proxy/example.xml similarity index 92% rename from deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/proxy/3.4.0/example.xml rename to deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/proxy/example.xml index ece690a106..5ff502d2da 100644 --- a/deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/proxy/3.4.0/example.xml +++ b/deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/proxy/example.xml @@ -1,5 +1,5 @@ diff --git a/deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/proxy/3.4.0/proxy.xsd b/deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/proxy/proxy.xsd similarity index 82% rename from deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/proxy/3.4.0/proxy.xsd rename to deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/proxy/proxy.xsd index 4449d9eaa2..d7964942d0 100644 --- a/deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/proxy/3.4.0/proxy.xsd +++ b/deegree-core/deegree-core-commons/src/main/resources/META-INF/schemas/proxy/proxy.xsd @@ -19,29 +19,27 @@ + + + + + - - - - - - - - + \ No newline at end of file diff --git a/deegree-core/deegree-core-coverage/pom.xml b/deegree-core/deegree-core-coverage/pom.xml index 80fcc445e9..33fdaf83f4 100644 --- a/deegree-core/deegree-core-coverage/pom.xml +++ b/deegree-core/deegree-core-coverage/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-coverage/src/main/java/org/deegree/coverage/persistence/DefaultCoverageProvider.java b/deegree-core/deegree-core-coverage/src/main/java/org/deegree/coverage/persistence/DefaultCoverageProvider.java index 9784232a02..0b8f1daebb 100644 --- a/deegree-core/deegree-core-coverage/src/main/java/org/deegree/coverage/persistence/DefaultCoverageProvider.java +++ b/deegree-core/deegree-core-coverage/src/main/java/org/deegree/coverage/persistence/DefaultCoverageProvider.java @@ -58,7 +58,7 @@ Occam Labs UG (haftungsbeschränkt) */ public class DefaultCoverageProvider extends CoverageProvider { - private static final URL CONFIG_SCHEMA = DefaultCoverageProvider.class.getResource( "/META-INF/schemas/datasource/coverage/raster/3.4.0/raster.xsd" ); + private static final URL CONFIG_SCHEMA = DefaultCoverageProvider.class.getResource( "/META-INF/schemas/datasource/coverage/raster/raster.xsd" ); @Override public String getNamespace() { diff --git a/deegree-core/deegree-core-coverage/src/main/java/org/deegree/coverage/persistence/pyramid/PyramidCoverageProvider.java b/deegree-core/deegree-core-coverage/src/main/java/org/deegree/coverage/persistence/pyramid/PyramidCoverageProvider.java index 517678a534..f5007cd6f6 100644 --- a/deegree-core/deegree-core-coverage/src/main/java/org/deegree/coverage/persistence/pyramid/PyramidCoverageProvider.java +++ b/deegree-core/deegree-core-coverage/src/main/java/org/deegree/coverage/persistence/pyramid/PyramidCoverageProvider.java @@ -59,7 +59,7 @@ Occam Labs UG (haftungsbeschränkt) */ public class PyramidCoverageProvider extends CoverageProvider { - private static final URL CONFIG_SCHEMA = PyramidCoverageProvider.class.getResource( "/META-INF/schemas/datasource/coverage/raster/3.4.0/pyramid.xsd" ); + private static final URL CONFIG_SCHEMA = PyramidCoverageProvider.class.getResource( "/META-INF/schemas/datasource/coverage/raster/pyramid.xsd" ); @Override public String getNamespace() { diff --git a/deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/3.4.0/directory.xml b/deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/directory.xml similarity index 93% rename from deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/3.4.0/directory.xml rename to deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/directory.xml index 34ee9942f6..061c2a66e4 100644 --- a/deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/3.4.0/directory.xml +++ b/deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/directory.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://www.deegree.org/datasource/coverage/raster http://schemas.deegree.org/3.5/datasource/coverage/raster/raster.xsd"> EPSG:26912 - - - - - - - - + diff --git a/deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/3.4.0/raster.xsd b/deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/raster.xsd similarity index 84% rename from deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/3.4.0/raster.xsd rename to deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/raster.xsd index 8d7ebf1431..c621d4b6a2 100644 --- a/deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/3.4.0/raster.xsd +++ b/deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/raster.xsd @@ -19,14 +19,7 @@ - - - - - - - - + @@ -56,14 +49,7 @@ - - - - - - - - + diff --git a/deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/3.4.0/single.xml b/deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/single.xml similarity index 88% rename from deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/3.4.0/single.xml rename to deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/single.xml index 0fbdbc688a..82e27abe9b 100644 --- a/deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/3.4.0/single.xml +++ b/deegree-core/deegree-core-coverage/src/main/resources/META-INF/schemas/datasource/coverage/raster/single.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://www.deegree.org/datasource/coverage/raster http://schemas.deegree.org/3.5/datasource/coverage/raster/raster.xsd"> EPSG:26912 ... \ No newline at end of file diff --git a/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/deegree2/3.4.0/deegree2.xsd b/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/deegree2/deegree2.xsd similarity index 96% rename from deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/deegree2/3.4.0/deegree2.xsd rename to deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/deegree2/deegree2.xsd index 7101dfd9e5..1b49fa1817 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/deegree2/3.4.0/deegree2.xsd +++ b/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/deegree2/deegree2.xsd @@ -5,7 +5,7 @@ elementFormDefault="qualified" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1"> + schemaLocation="../store.xsd" /> diff --git a/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/deegree2/3.4.0/example.xml b/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/deegree2/example.xml similarity index 84% rename from deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/deegree2/3.4.0/example.xml rename to deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/deegree2/example.xml index 39fe0f402b..4bdb88b20a 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/deegree2/3.4.0/example.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/deegree2/example.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.deegree.org/crs http://schemas.deegree.org/3.5/crs/stores/deegree2/deegree2.xsd"> ... \ No newline at end of file diff --git a/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/gml/3.4.0/example.xml b/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/gml/example.xml similarity index 92% rename from deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/gml/3.4.0/example.xml rename to deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/gml/example.xml index cc414ccdab..a5505d10be 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/gml/3.4.0/example.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/gml/example.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.deegree.org/crs http://schemas.deegree.org/3.5/crs/stores/gml/gml.xsd"> ... diff --git a/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/gml/3.4.0/gml.xsd b/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/gml/gml.xsd similarity index 97% rename from deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/gml/3.4.0/gml.xsd rename to deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/gml/gml.xsd index 9958a692f0..29c4da8936 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/gml/3.4.0/gml.xsd +++ b/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/gml/gml.xsd @@ -5,7 +5,7 @@ elementFormDefault="qualified" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1"> + schemaLocation="../store.xsd" /> diff --git a/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/proj4/3.4.0/example.xml b/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/proj4/example.xml similarity index 85% rename from deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/proj4/3.4.0/example.xml rename to deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/proj4/example.xml index 684c9f32b0..a4c3a15101 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/proj4/3.4.0/example.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/proj4/example.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.deegree.org/crs http://schemas.deegree.org/3.5/crs/stores/proj4/proj4.xsd"> ... \ No newline at end of file diff --git a/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/proj4/3.4.0/proj4.xsd b/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/proj4/proj4.xsd similarity index 96% rename from deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/proj4/3.4.0/proj4.xsd rename to deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/proj4/proj4.xsd index b3624f9b26..8f0f749443 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/proj4/3.4.0/proj4.xsd +++ b/deegree-core/deegree-core-cs/src/main/resources/META-INF/schemas/crs/stores/proj4/proj4.xsd @@ -5,7 +5,7 @@ elementFormDefault="qualified" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1"> + schemaLocation="../store.xsd" /> diff --git a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/crs-definitions.xml b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/crs-definitions.xml index 250c9d92b2..9c44cf0899 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/crs-definitions.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/crs-definitions.xml @@ -2,7 +2,7 @@ + xsi:schemaLocation="http://www.deegree.org/crs http://schemas.deegree.org/3.5/crs/crsdefinition.xsd"> epsg:4002 http://www.opengis.net/gml/srs/epsg.xml#4002 diff --git a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/datum-definitions.xml b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/datum-definitions.xml index 8597e4dbcf..66700c64ba 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/datum-definitions.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/datum-definitions.xml @@ -1,5 +1,5 @@ - + epsg:6005 Not specified (based on Bessel Modified ellipsoid) diff --git a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/ellipsoid-definitions.xml b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/ellipsoid-definitions.xml index 930d3239c8..5375f0e8b3 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/ellipsoid-definitions.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/ellipsoid-definitions.xml @@ -1,5 +1,5 @@ - + ellipsoid_81 Proj4 defined ellipsoid diff --git a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/pm-definitions.xml b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/pm-definitions.xml index 079829691f..6fa3c16c01 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/pm-definitions.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/pm-definitions.xml @@ -1,5 +1,5 @@ - + epsg:8908 urn:ogc:def:crs:epsg::8908 diff --git a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml index b4cbc742f0..c82f2e857f 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml @@ -1,5 +1,5 @@ - + epsg:19986 Europe Equal Area 2001 diff --git a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/transformation-definitions.xml b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/transformation-definitions.xml index 8f9e3cb414..825bda1793 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/transformation-definitions.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/config/transformation-definitions.xml @@ -1,5 +1,5 @@ - + epsg:1173 urn:opengis:def:crs:epsg::1173 diff --git a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/parser-files.xml b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/parser-files.xml index 940914ad4d..dd9f5f105f 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/parser-files.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/deegree/d3/parser-files.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.deegree.org/crs http://schemas.deegree.org/3.5/crs/crsdefinition.xsd"> config/projection-definitions.xml config/transformation-definitions.xml config/pm-definitions.xml diff --git a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/default.xml b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/default.xml index 6be9a8eacb..ffd8929ff6 100644 --- a/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/default.xml +++ b/deegree-core/deegree-core-cs/src/main/resources/org/deegree/cs/persistence/default.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.deegree.org/crs http://schemas.deegree.org/3.5/crs/stores/deegree/deegree.xsd"> deegree/d3/parser-files.xml \ No newline at end of file diff --git a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/deegree.xml b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/deegree.xml index b54dffe3bb..ab0a87af01 100644 --- a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/deegree.xml +++ b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/deegree.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.deegree.org/crs http://schemas.deegree.org/3.5/crs/stores/deegree/deegree.xsd"> files/parser-files.xml \ No newline at end of file diff --git a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/crs-definitions.xml b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/crs-definitions.xml index 6912e76e4c..50dd60aba7 100644 --- a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/crs-definitions.xml +++ b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/crs-definitions.xml @@ -1,5 +1,5 @@ - + epsg:4002 http://www.opengis.net/gml/srs/epsg.xml#4002 diff --git a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/datum-definitions.xml b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/datum-definitions.xml index 34f90b47f0..66bc824814 100644 --- a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/datum-definitions.xml +++ b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/datum-definitions.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.deegree.org/crs http://schemas.deegree.org/3.5/crs/crsdefinition.xsd"> epsg:6200 Pulkovo 1995 diff --git a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/ellipsoid-definitions.xml b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/ellipsoid-definitions.xml index d0849235bd..e07e481999 100644 --- a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/ellipsoid-definitions.xml +++ b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/ellipsoid-definitions.xml @@ -1,5 +1,5 @@ - + epsg:7002 Airy Modified 1849 diff --git a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/pm-definitions.xml b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/pm-definitions.xml index be85f41cbe..6c37256ba7 100644 --- a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/pm-definitions.xml +++ b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/pm-definitions.xml @@ -1,5 +1,5 @@ - + epsg:8901 Greenwich diff --git a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/projection-definitions.xml b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/projection-definitions.xml index febc7c3157..0ce6bcfdc7 100644 --- a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/projection-definitions.xml +++ b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/projection-definitions.xml @@ -1,5 +1,5 @@ - + epsg:16210 6-degree Gauss-Kruger zone 10 diff --git a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/transformation-definitions.xml b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/transformation-definitions.xml index 8f9e3cb414..825bda1793 100644 --- a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/transformation-definitions.xml +++ b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/deegree/transformation-definitions.xml @@ -1,5 +1,5 @@ - + epsg:1173 urn:opengis:def:crs:epsg::1173 diff --git a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/parser-files.xml b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/parser-files.xml index a3772d477b..1a15e5639e 100644 --- a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/parser-files.xml +++ b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/files/parser-files.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.deegree.org/crs http://schemas.deegree.org/3.5/crs/crsdefinition.xsd"> deegree/projection-definitions.xml deegree/transformation-definitions.xml deegree/pm-definitions.xml diff --git a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/gml-store1.xml b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/gml-store1.xml index 4b0afdb120..c533bd3d99 100644 --- a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/gml-store1.xml +++ b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/crs/gml-store1.xml @@ -1,7 +1,7 @@ files/gmlDictionary1.xml \ No newline at end of file diff --git a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/deegree/d2/deegree2-store.xml b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/deegree/d2/deegree2-store.xml index 2d8bc0dcfd..c77a064e07 100644 --- a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/deegree/d2/deegree2-store.xml +++ b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/deegree/d2/deegree2-store.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://www.deegree.org/crs http://schemas.deegree.org/3.5/crs/stores/deegree/deegree2.xsd"> deegree-crs-configuration.xml \ No newline at end of file diff --git a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/gml/gml-store.xml b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/gml/gml-store.xml index 09631d0ee0..8d21f7e548 100644 --- a/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/gml/gml-store.xml +++ b/deegree-core/deegree-core-cs/src/test/resources/org/deegree/cs/persistence/gml/gml-store.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://www.deegree.org/crs http://schemas.deegree.org/3.5/crs/stores/gml/gml.xsd"> gmlDictionary.xml \ No newline at end of file diff --git a/deegree-core/deegree-core-db/pom.xml b/deegree-core/deegree-core-db/pom.xml index eb4f22805f..185732f3cf 100644 --- a/deegree-core/deegree-core-db/pom.xml +++ b/deegree-core/deegree-core-db/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-db/src/main/java/org/deegree/db/legacy/LegacyConnectionProviderProvider.java b/deegree-core/deegree-core-db/src/main/java/org/deegree/db/legacy/LegacyConnectionProviderProvider.java index 2833f75909..a2062e7ca4 100644 --- a/deegree-core/deegree-core-db/src/main/java/org/deegree/db/legacy/LegacyConnectionProviderProvider.java +++ b/deegree-core/deegree-core-db/src/main/java/org/deegree/db/legacy/LegacyConnectionProviderProvider.java @@ -59,7 +59,7 @@ Occam Labs UG (haftungsbeschränkt) */ public class LegacyConnectionProviderProvider extends ConnectionProviderProvider { - static final URL SCHEMA_URL = LegacyConnectionProviderProvider.class.getResource( "/META-INF/schemas/jdbc/3.4.0/jdbc.xsd" ); + static final URL SCHEMA_URL = LegacyConnectionProviderProvider.class.getResource( "/META-INF/schemas/jdbc/jdbc.xsd" ); @Override public String getNamespace() { diff --git a/deegree-core/deegree-core-db/src/main/resources/META-INF/schemas/jdbc/3.4.0/example.xml b/deegree-core/deegree-core-db/src/main/resources/META-INF/schemas/jdbc/example.xml similarity index 92% rename from deegree-core/deegree-core-db/src/main/resources/META-INF/schemas/jdbc/3.4.0/example.xml rename to deegree-core/deegree-core-db/src/main/resources/META-INF/schemas/jdbc/example.xml index 942a1ab141..7270e0c62d 100644 --- a/deegree-core/deegree-core-db/src/main/resources/META-INF/schemas/jdbc/3.4.0/example.xml +++ b/deegree-core/deegree-core-db/src/main/resources/META-INF/schemas/jdbc/example.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://www.deegree.org/jdbc http://schemas.deegree.org/3.5/jdbc/jdbc.xsd"> jdbc:postgresql://localhost:5432/${DB_NAME} diff --git a/deegree-core/deegree-core-db/src/main/resources/META-INF/schemas/jdbc/3.4.0/jdbc.xsd b/deegree-core/deegree-core-db/src/main/resources/META-INF/schemas/jdbc/jdbc.xsd similarity index 81% rename from deegree-core/deegree-core-db/src/main/resources/META-INF/schemas/jdbc/3.4.0/jdbc.xsd rename to deegree-core/deegree-core-db/src/main/resources/META-INF/schemas/jdbc/jdbc.xsd index dc58ada913..3d44a29781 100644 --- a/deegree-core/deegree-core-db/src/main/resources/META-INF/schemas/jdbc/3.4.0/jdbc.xsd +++ b/deegree-core/deegree-core-db/src/main/resources/META-INF/schemas/jdbc/jdbc.xsd @@ -22,14 +22,7 @@ - - - - - - - - + diff --git a/deegree-core/deegree-core-feature/pom.xml b/deegree-core/deegree-core-feature/pom.xml deleted file mode 100644 index 9d2f57fb1c..0000000000 --- a/deegree-core/deegree-core-feature/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - 4.0.0 - deegree-core-feature - deegree-core-feature - jar - Data model for features, feature types and application schemas - - - rework - - - - org.deegree - deegree-core - 3.4.32-SNAPSHOT - - - - - org.deegree - deegree-core-base - ${project.version} - - - junit - junit - - - - diff --git a/deegree-core/deegree-core-featureinfo/pom.xml b/deegree-core/deegree-core-featureinfo/pom.xml index c910cf29e8..09fee99336 100644 --- a/deegree-core/deegree-core-featureinfo/pom.xml +++ b/deegree-core/deegree-core-featureinfo/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Parser.g b/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Parser.g index b94b8de059..a24bc20926 100644 --- a/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Parser.g +++ b/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Parser.g @@ -110,8 +110,8 @@ even returns [OddEven even]: link returns [Link link]: LinkStart Colon pref = url TagClose { - if(pref.text == null) $link = new Link(pref.url); - else $link = new Link(pref.url, pref.text); + if($pref.text == null) $link = new Link($pref.url); + else $link = new Link($pref.url, $pref.text); } ; diff --git a/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/output/Templating2Lexer.java b/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/output/Templating2Lexer.java deleted file mode 100644 index 06717edf58..0000000000 --- a/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/output/Templating2Lexer.java +++ /dev/null @@ -1,2414 +0,0 @@ -// $ANTLR 3.5 /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g 2013-03-07 14:11:14 - -package org.deegree.featureinfo.templating; - - -import org.antlr.runtime.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; - -@SuppressWarnings("all") -public class Templating2Lexer extends Lexer { - public static final int EOF=-1; - public static final int BracketLeft=4; - public static final int BracketRight=5; - public static final int Colon=6; - public static final int Comma=7; - public static final int Digit=8; - public static final int Equals=9; - public static final int EvenStart=10; - public static final int ExplicitTemplateEnd=11; - public static final int FeatureCallStart=12; - public static final int GmlId=13; - public static final int ID=14; - public static final int Index=15; - public static final int Kvp=16; - public static final int Letter=17; - public static final int LinkStart=18; - public static final int MapDefinitionStart=19; - public static final int MapSpace=20; - public static final int NameStart=21; - public static final int Not=22; - public static final int OddStart=23; - public static final int Point=24; - public static final int PropertyCallStart=25; - public static final int Rest=26; - public static final int Slash=27; - public static final int Star=28; - public static final int TagClose=29; - public static final int TagOpen=30; - public static final int TemplateDefinitionStart=31; - public static final int Url=32; - public static final int UrlWithPort=33; - public static final int ValueStart=34; - public static final int WS=35; - - // delegates - // delegators - public Lexer[] getDelegates() { - return new Lexer[] {}; - } - - public Templating2Lexer() {} - public Templating2Lexer(CharStream input) { - this(input, new RecognizerSharedState()); - } - public Templating2Lexer(CharStream input, RecognizerSharedState state) { - super(input,state); - } - @Override public String getGrammarFileName() { return "/home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g"; } - - @Override - public Token nextToken() { - while (true) { - if ( input.LA(1)==CharStream.EOF ) { - Token eof = new CommonToken(input,Token.EOF, - Token.DEFAULT_CHANNEL, - input.index(),input.index()); - eof.setLine(getLine()); - eof.setCharPositionInLine(getCharPositionInLine()); - return eof; - } - state.token = null; - state.channel = Token.DEFAULT_CHANNEL; - state.tokenStartCharIndex = input.index(); - state.tokenStartCharPositionInLine = input.getCharPositionInLine(); - state.tokenStartLine = input.getLine(); - state.text = null; - try { - int m = input.mark(); - state.backtracking=1; - state.failed=false; - mTokens(); - state.backtracking=0; - if ( state.failed ) { - input.rewind(m); - input.consume(); - } - else { - emit(); - return state.token; - } - } - catch (RecognitionException re) { - // shouldn't happen in backtracking mode, but... - reportError(re); - recover(re); - } - } - } - - @Override - public void memoize(IntStream input, - int ruleIndex, - int ruleStartIndex) - { - if ( state.backtracking>1 ) super.memoize(input, ruleIndex, ruleStartIndex); - } - - @Override - public boolean alreadyParsedRule(IntStream input, int ruleIndex) { - if ( state.backtracking>1 ) return super.alreadyParsedRule(input, ruleIndex); - return false; - } - // $ANTLR start "TemplateDefinitionStart" - public final void mTemplateDefinitionStart() throws RecognitionException { - try { - int _type = TemplateDefinitionStart; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:11:24: ( '' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:20:8: '' - { - match(""); if (state.failed) return; - - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "Index" - - // $ANTLR start "GmlId" - public final void mGmlId() throws RecognitionException { - try { - int _type = GmlId; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:21:6: ( '' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:21:8: '' - { - match(""); if (state.failed) return; - - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "GmlId" - - // $ANTLR start "ExplicitTemplateEnd" - public final void mExplicitTemplateEnd() throws RecognitionException { - try { - int _type = ExplicitTemplateEnd; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:22:20: ( '' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:22:22: '' - { - match(""); if (state.failed) return; - - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "ExplicitTemplateEnd" - - // $ANTLR start "Letter" - public final void mLetter() throws RecognitionException { - try { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:24:16: ({...}? . ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:24:18: {...}? . - { - if ( !(( Character.isLetter( input.LA(1) ) )) ) { - if (state.backtracking>0) {state.failed=true; return;} - throw new FailedPredicateException(input, "Letter", " Character.isLetter( input.LA(1) ) "); - } - matchAny(); if (state.failed) return; - } - - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "Letter" - - // $ANTLR start "Digit" - public final void mDigit() throws RecognitionException { - try { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:25:15: ({...}? . ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:25:17: {...}? . - { - if ( !(( Character.isDigit( input.LA(1) ) )) ) { - if (state.backtracking>0) {state.failed=true; return;} - throw new FailedPredicateException(input, "Digit", " Character.isDigit( input.LA(1) ) "); - } - matchAny(); if (state.failed) return; - } - - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "Digit" - - // $ANTLR start "WS" - public final void mWS() throws RecognitionException { - try { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:26:12: ({...}? . ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:26:14: {...}? . - { - if ( !(( Character.isWhitespace( input.LA(1) ) )) ) { - if (state.backtracking>0) {state.failed=true; return;} - throw new FailedPredicateException(input, "WS", " Character.isWhitespace( input.LA(1) ) "); - } - matchAny(); if (state.failed) return; - } - - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "WS" - - // $ANTLR start "Point" - public final void mPoint() throws RecognitionException { - try { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:27:15: ( '.' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:27:17: '.' - { - match('.'); if (state.failed) return; - } - - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "Point" - - // $ANTLR start "Slash" - public final void mSlash() throws RecognitionException { - try { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:28:15: ( '/' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:28:17: '/' - { - match('/'); if (state.failed) return; - } - - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "Slash" - - // $ANTLR start "UrlWithPort" - public final void mUrlWithPort() throws RecognitionException { - try { - int _type = UrlWithPort; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:30:12: ( Url Colon ( Digit )+ (~ ( Colon | TagClose ) )+ ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:30:14: Url Colon ( Digit )+ (~ ( Colon | TagClose ) )+ - { - mUrl(); if (state.failed) return; - - mColon(); if (state.failed) return; - - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:30:24: ( Digit )+ - int cnt1=0; - loop1: - while (true) { - int alt1=2; - int LA1_0 = input.LA(1); - if ( ((LA1_0 >= '\u0000' && LA1_0 <= '9')||(LA1_0 >= ';' && LA1_0 <= '=')||(LA1_0 >= '?' && LA1_0 <= '\uFFFF')) ) { - int LA1_1 = input.LA(2); - if ( (( Character.isDigit( input.LA(1) ) )) ) { - alt1=1; - } - - } - else if ( (LA1_0==':'||LA1_0=='>') ) { - alt1=1; - } - - switch (alt1) { - case 1 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:30:24: Digit - { - mDigit(); if (state.failed) return; - - } - break; - - default : - if ( cnt1 >= 1 ) break loop1; - if (state.backtracking>0) {state.failed=true; return;} - EarlyExitException eee = new EarlyExitException(1, input); - throw eee; - } - cnt1++; - } - - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:30:31: (~ ( Colon | TagClose ) )+ - int cnt2=0; - loop2: - while (true) { - int alt2=2; - int LA2_0 = input.LA(1); - if ( ((LA2_0 >= '\u0000' && LA2_0 <= '9')||(LA2_0 >= ';' && LA2_0 <= '=')||(LA2_0 >= '?' && LA2_0 <= '\uFFFF')) ) { - alt2=1; - } - - switch (alt2) { - case 1 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g: - { - if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '9')||(input.LA(1) >= ';' && input.LA(1) <= '=')||(input.LA(1) >= '?' && input.LA(1) <= '\uFFFF') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - } - break; - - default : - if ( cnt2 >= 1 ) break loop2; - if (state.backtracking>0) {state.failed=true; return;} - EarlyExitException eee = new EarlyExitException(2, input); - throw eee; - } - cnt2++; - } - - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "UrlWithPort" - - // $ANTLR start "Url" - public final void mUrl() throws RecognitionException { - try { - int _type = Url; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:31:4: ( ( ID Colon Slash Slash (~ Colon )+ ) ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:31:6: ( ID Colon Slash Slash (~ Colon )+ ) - { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:31:6: ( ID Colon Slash Slash (~ Colon )+ ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:31:7: ID Colon Slash Slash (~ Colon )+ - { - mID(); if (state.failed) return; - - mColon(); if (state.failed) return; - - mSlash(); if (state.failed) return; - - mSlash(); if (state.failed) return; - - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:31:28: (~ Colon )+ - int cnt3=0; - loop3: - while (true) { - int alt3=2; - int LA3_0 = input.LA(1); - if ( ((LA3_0 >= '\u0000' && LA3_0 <= '9')||(LA3_0 >= ';' && LA3_0 <= '\uFFFF')) ) { - alt3=1; - } - - switch (alt3) { - case 1 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g: - { - if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '9')||(input.LA(1) >= ';' && input.LA(1) <= '\uFFFF') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - } - break; - - default : - if ( cnt3 >= 1 ) break loop3; - if (state.backtracking>0) {state.failed=true; return;} - EarlyExitException eee = new EarlyExitException(3, input); - throw eee; - } - cnt3++; - } - - } - - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "Url" - - // $ANTLR start "Equals" - public final void mEquals() throws RecognitionException { - try { - int _type = Equals; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:33:7: ( '=' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:33:9: '=' - { - match('='); if (state.failed) return; - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "Equals" - - // $ANTLR start "Star" - public final void mStar() throws RecognitionException { - try { - int _type = Star; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:34:5: ( '*' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:34:7: '*' - { - match('*'); if (state.failed) return; - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "Star" - - // $ANTLR start "Comma" - public final void mComma() throws RecognitionException { - try { - int _type = Comma; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:35:6: ( ',' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:35:8: ',' - { - match(','); if (state.failed) return; - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "Comma" - - // $ANTLR start "Colon" - public final void mColon() throws RecognitionException { - try { - int _type = Colon; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:36:6: ( ':' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:36:8: ':' - { - match(':'); if (state.failed) return; - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "Colon" - - // $ANTLR start "TagOpen" - public final void mTagOpen() throws RecognitionException { - try { - int _type = TagOpen; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:37:8: ( '<' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:37:10: '<' - { - match('<'); if (state.failed) return; - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "TagOpen" - - // $ANTLR start "TagClose" - public final void mTagClose() throws RecognitionException { - try { - int _type = TagClose; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:38:9: ( '>' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:38:11: '>' - { - match('>'); if (state.failed) return; - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "TagClose" - - // $ANTLR start "MapSpace" - public final void mMapSpace() throws RecognitionException { - try { - int _type = MapSpace; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:39:9: ( 'map ' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:39:11: 'map ' - { - match("map "); if (state.failed) return; - - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "MapSpace" - - // $ANTLR start "Not" - public final void mNot() throws RecognitionException { - try { - int _type = Not; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:40:4: ( 'not' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:40:6: 'not' - { - match("not"); if (state.failed) return; - - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "Not" - - // $ANTLR start "BracketLeft" - public final void mBracketLeft() throws RecognitionException { - try { - int _type = BracketLeft; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:41:12: ( '(' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:41:14: '(' - { - match('('); if (state.failed) return; - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "BracketLeft" - - // $ANTLR start "BracketRight" - public final void mBracketRight() throws RecognitionException { - try { - int _type = BracketRight; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:42:13: ( ')' ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:42:15: ')' - { - match(')'); if (state.failed) return; - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "BracketRight" - - // $ANTLR start "Kvp" - public final void mKvp() throws RecognitionException { - try { - int _type = Kvp; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:44:4: ( ( '\\n' )* (~ ( '=' | '<' | '>' | '?' | '/' | '\\n' ) )+ '=' (~ ( '\\n' ) )+ ( '\\n' )* ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:44:6: ( '\\n' )* (~ ( '=' | '<' | '>' | '?' | '/' | '\\n' ) )+ '=' (~ ( '\\n' ) )+ ( '\\n' )* - { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:44:6: ( '\\n' )* - loop4: - while (true) { - int alt4=2; - int LA4_0 = input.LA(1); - if ( (LA4_0=='\n') ) { - alt4=1; - } - - switch (alt4) { - case 1 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:44:6: '\\n' - { - match('\n'); if (state.failed) return; - } - break; - - default : - break loop4; - } - } - - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:44:12: (~ ( '=' | '<' | '>' | '?' | '/' | '\\n' ) )+ - int cnt5=0; - loop5: - while (true) { - int alt5=2; - int LA5_0 = input.LA(1); - if ( ((LA5_0 >= '\u0000' && LA5_0 <= '\t')||(LA5_0 >= '\u000B' && LA5_0 <= '.')||(LA5_0 >= '0' && LA5_0 <= ';')||(LA5_0 >= '@' && LA5_0 <= '\uFFFF')) ) { - alt5=1; - } - - switch (alt5) { - case 1 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g: - { - if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '\t')||(input.LA(1) >= '\u000B' && input.LA(1) <= '.')||(input.LA(1) >= '0' && input.LA(1) <= ';')||(input.LA(1) >= '@' && input.LA(1) <= '\uFFFF') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - } - break; - - default : - if ( cnt5 >= 1 ) break loop5; - if (state.backtracking>0) {state.failed=true; return;} - EarlyExitException eee = new EarlyExitException(5, input); - throw eee; - } - cnt5++; - } - - match('='); if (state.failed) return; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:44:57: (~ ( '\\n' ) )+ - int cnt6=0; - loop6: - while (true) { - int alt6=2; - int LA6_0 = input.LA(1); - if ( ((LA6_0 >= '\u0000' && LA6_0 <= '\t')||(LA6_0 >= '\u000B' && LA6_0 <= '\uFFFF')) ) { - alt6=1; - } - - switch (alt6) { - case 1 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g: - { - if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '\t')||(input.LA(1) >= '\u000B' && input.LA(1) <= '\uFFFF') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - } - break; - - default : - if ( cnt6 >= 1 ) break loop6; - if (state.backtracking>0) {state.failed=true; return;} - EarlyExitException eee = new EarlyExitException(6, input); - throw eee; - } - cnt6++; - } - - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:44:68: ( '\\n' )* - loop7: - while (true) { - int alt7=2; - int LA7_0 = input.LA(1); - if ( (LA7_0=='\n') ) { - alt7=1; - } - - switch (alt7) { - case 1 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:44:68: '\\n' - { - match('\n'); if (state.failed) return; - } - break; - - default : - break loop7; - } - } - - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "Kvp" - - // $ANTLR start "ID" - public final void mID() throws RecognitionException { - try { - int _type = ID; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:45:3: ( ( Letter | Digit | '_' | '-' )+ ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:45:5: ( Letter | Digit | '_' | '-' )+ - { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:45:5: ( Letter | Digit | '_' | '-' )+ - int cnt8=0; - loop8: - while (true) { - int alt8=5; - int LA8_0 = input.LA(1); - if ( (LA8_0=='_') ) { - int LA8_2 = input.LA(2); - if ( (( Character.isLetter( input.LA(1) ) )) ) { - alt8=1; - } - else if ( (( Character.isDigit( input.LA(1) ) )) ) { - alt8=2; - } - else if ( (true) ) { - alt8=3; - } - - } - else if ( (LA8_0=='-') ) { - int LA8_3 = input.LA(2); - if ( (( Character.isLetter( input.LA(1) ) )) ) { - alt8=1; - } - else if ( (( Character.isDigit( input.LA(1) ) )) ) { - alt8=2; - } - else if ( (true) ) { - alt8=4; - } - - } - else if ( ((LA8_0 >= '\u0000' && LA8_0 <= ',')||(LA8_0 >= '.' && LA8_0 <= '^')||(LA8_0 >= '`' && LA8_0 <= '\uFFFF')) ) { - int LA8_4 = input.LA(2); - if ( (( Character.isLetter( input.LA(1) ) )) ) { - alt8=1; - } - else if ( (( Character.isDigit( input.LA(1) ) )) ) { - alt8=2; - } - - } - - switch (alt8) { - case 1 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:45:6: Letter - { - mLetter(); if (state.failed) return; - - } - break; - case 2 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:45:15: Digit - { - mDigit(); if (state.failed) return; - - } - break; - case 3 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:45:23: '_' - { - match('_'); if (state.failed) return; - } - break; - case 4 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:45:29: '-' - { - match('-'); if (state.failed) return; - } - break; - - default : - if ( cnt8 >= 1 ) break loop8; - if (state.backtracking>0) {state.failed=true; return;} - EarlyExitException eee = new EarlyExitException(8, input); - throw eee; - } - cnt8++; - } - - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "ID" - - // $ANTLR start "Rest" - public final void mRest() throws RecognitionException { - try { - int _type = Rest; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:47:5: ( (~ ( '<' ) )+ ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:47:7: (~ ( '<' ) )+ - { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:47:7: (~ ( '<' ) )+ - int cnt9=0; - loop9: - while (true) { - int alt9=2; - int LA9_0 = input.LA(1); - if ( ((LA9_0 >= '\u0000' && LA9_0 <= ';')||(LA9_0 >= '=' && LA9_0 <= '\uFFFF')) ) { - alt9=1; - } - - switch (alt9) { - case 1 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g: - { - if ( (input.LA(1) >= '\u0000' && input.LA(1) <= ';')||(input.LA(1) >= '=' && input.LA(1) <= '\uFFFF') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - } - break; - - default : - if ( cnt9 >= 1 ) break loop9; - if (state.backtracking>0) {state.failed=true; return;} - EarlyExitException eee = new EarlyExitException(9, input); - throw eee; - } - cnt9++; - } - - } - - state.type = _type; - state.channel = _channel; - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "Rest" - - @Override - public void mTokens() throws RecognitionException { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:39: ( TemplateDefinitionStart | MapDefinitionStart | FeatureCallStart | PropertyCallStart | NameStart | ValueStart | OddStart | EvenStart | LinkStart | Index | GmlId | ExplicitTemplateEnd | UrlWithPort | Url | Equals | Star | Comma | Colon | TagOpen | TagClose | MapSpace | Not | BracketLeft | BracketRight | Kvp | ID | Rest ) - int alt10=27; - int LA10_0 = input.LA(1); - if ( (LA10_0=='<') ) { - int LA10_1 = input.LA(2); - if ( (synpred1_Templating2Lexer()) ) { - alt10=1; - } - else if ( (synpred2_Templating2Lexer()) ) { - alt10=2; - } - else if ( (synpred3_Templating2Lexer()) ) { - alt10=3; - } - else if ( (synpred4_Templating2Lexer()) ) { - alt10=4; - } - else if ( (synpred5_Templating2Lexer()) ) { - alt10=5; - } - else if ( (synpred6_Templating2Lexer()) ) { - alt10=6; - } - else if ( (synpred7_Templating2Lexer()) ) { - alt10=7; - } - else if ( (synpred8_Templating2Lexer()) ) { - alt10=8; - } - else if ( (synpred9_Templating2Lexer()) ) { - alt10=9; - } - else if ( (synpred10_Templating2Lexer()) ) { - alt10=10; - } - else if ( (synpred11_Templating2Lexer()) ) { - alt10=11; - } - else if ( (synpred12_Templating2Lexer()) ) { - alt10=12; - } - else if ( ((synpred13_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=13; - } - else if ( ((synpred14_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=14; - } - else if ( (synpred19_Templating2Lexer()) ) { - alt10=19; - } - else if ( ((synpred26_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=26; - } - - else { - if (state.backtracking>0) {state.failed=true; return;} - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 10, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - else if ( (LA10_0=='_') ) { - int LA10_2 = input.LA(2); - if ( (synpred13_Templating2Lexer()) ) { - alt10=13; - } - else if ( (synpred14_Templating2Lexer()) ) { - alt10=14; - } - else if ( (synpred25_Templating2Lexer()) ) { - alt10=25; - } - else if ( (synpred26_Templating2Lexer()) ) { - alt10=26; - } - else if ( (true) ) { - alt10=27; - } - - } - else if ( (LA10_0=='-') ) { - int LA10_3 = input.LA(2); - if ( (synpred13_Templating2Lexer()) ) { - alt10=13; - } - else if ( (synpred14_Templating2Lexer()) ) { - alt10=14; - } - else if ( (synpred25_Templating2Lexer()) ) { - alt10=25; - } - else if ( (synpred26_Templating2Lexer()) ) { - alt10=26; - } - else if ( (true) ) { - alt10=27; - } - - } - else if ( (LA10_0=='=') ) { - int LA10_4 = input.LA(2); - if ( ((synpred13_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=13; - } - else if ( ((synpred14_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=14; - } - else if ( (synpred15_Templating2Lexer()) ) { - alt10=15; - } - else if ( ((synpred26_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=26; - } - else if ( (true) ) { - alt10=27; - } - - } - else if ( (LA10_0=='*') ) { - int LA10_5 = input.LA(2); - if ( ((synpred13_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=13; - } - else if ( ((synpred14_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=14; - } - else if ( (synpred16_Templating2Lexer()) ) { - alt10=16; - } - else if ( (synpred25_Templating2Lexer()) ) { - alt10=25; - } - else if ( ((synpred26_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=26; - } - else if ( (true) ) { - alt10=27; - } - - } - else if ( (LA10_0==',') ) { - int LA10_6 = input.LA(2); - if ( ((synpred13_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=13; - } - else if ( ((synpred14_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=14; - } - else if ( (synpred17_Templating2Lexer()) ) { - alt10=17; - } - else if ( (synpred25_Templating2Lexer()) ) { - alt10=25; - } - else if ( ((synpred26_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=26; - } - else if ( (true) ) { - alt10=27; - } - - } - else if ( (LA10_0==':') ) { - int LA10_7 = input.LA(2); - if ( ((synpred13_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=13; - } - else if ( ((synpred14_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=14; - } - else if ( (synpred18_Templating2Lexer()) ) { - alt10=18; - } - else if ( (synpred25_Templating2Lexer()) ) { - alt10=25; - } - else if ( ((synpred26_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=26; - } - else if ( (true) ) { - alt10=27; - } - - } - else if ( (LA10_0=='>') ) { - int LA10_8 = input.LA(2); - if ( ((synpred13_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=13; - } - else if ( ((synpred14_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=14; - } - else if ( (synpred20_Templating2Lexer()) ) { - alt10=20; - } - else if ( ((synpred26_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=26; - } - else if ( (true) ) { - alt10=27; - } - - } - else if ( (LA10_0=='m') ) { - int LA10_9 = input.LA(2); - if ( ((synpred13_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=13; - } - else if ( ((synpred14_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=14; - } - else if ( (synpred21_Templating2Lexer()) ) { - alt10=21; - } - else if ( (synpred25_Templating2Lexer()) ) { - alt10=25; - } - else if ( ((synpred26_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=26; - } - else if ( (true) ) { - alt10=27; - } - - } - else if ( (LA10_0=='n') ) { - int LA10_10 = input.LA(2); - if ( ((synpred13_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=13; - } - else if ( ((synpred14_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=14; - } - else if ( (synpred22_Templating2Lexer()) ) { - alt10=22; - } - else if ( (synpred25_Templating2Lexer()) ) { - alt10=25; - } - else if ( ((synpred26_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=26; - } - else if ( (true) ) { - alt10=27; - } - - } - else if ( (LA10_0=='(') ) { - int LA10_11 = input.LA(2); - if ( ((synpred13_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=13; - } - else if ( ((synpred14_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=14; - } - else if ( (synpred23_Templating2Lexer()) ) { - alt10=23; - } - else if ( (synpred25_Templating2Lexer()) ) { - alt10=25; - } - else if ( ((synpred26_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=26; - } - else if ( (true) ) { - alt10=27; - } - - } - else if ( (LA10_0==')') ) { - int LA10_12 = input.LA(2); - if ( ((synpred13_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=13; - } - else if ( ((synpred14_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=14; - } - else if ( (synpred24_Templating2Lexer()) ) { - alt10=24; - } - else if ( (synpred25_Templating2Lexer()) ) { - alt10=25; - } - else if ( ((synpred26_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=26; - } - else if ( (true) ) { - alt10=27; - } - - } - else if ( (LA10_0=='\n') ) { - int LA10_13 = input.LA(2); - if ( ((synpred13_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=13; - } - else if ( ((synpred14_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=14; - } - else if ( (synpred25_Templating2Lexer()) ) { - alt10=25; - } - else if ( ((synpred26_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=26; - } - else if ( (true) ) { - alt10=27; - } - - } - else if ( ((LA10_0 >= '\u0000' && LA10_0 <= '\t')||(LA10_0 >= '\u000B' && LA10_0 <= '\'')||LA10_0=='+'||LA10_0=='.'||(LA10_0 >= '0' && LA10_0 <= '9')||LA10_0==';'||(LA10_0 >= '@' && LA10_0 <= '^')||(LA10_0 >= '`' && LA10_0 <= 'l')||(LA10_0 >= 'o' && LA10_0 <= '\uFFFF')) ) { - int LA10_14 = input.LA(2); - if ( ((synpred13_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=13; - } - else if ( ((synpred14_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=14; - } - else if ( (synpred25_Templating2Lexer()) ) { - alt10=25; - } - else if ( ((synpred26_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=26; - } - else if ( (true) ) { - alt10=27; - } - - } - else if ( (LA10_0=='/'||LA10_0=='?') ) { - int LA10_15 = input.LA(2); - if ( ((synpred13_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=13; - } - else if ( ((synpred14_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=14; - } - else if ( ((synpred26_Templating2Lexer()&&(( Character.isLetter( input.LA(1) ) )||( Character.isDigit( input.LA(1) ) )))) ) { - alt10=26; - } - else if ( (true) ) { - alt10=27; - } - - } - - else { - if (state.backtracking>0) {state.failed=true; return;} - NoViableAltException nvae = - new NoViableAltException("", 10, 0, input); - throw nvae; - } - - switch (alt10) { - case 1 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:41: TemplateDefinitionStart - { - mTemplateDefinitionStart(); if (state.failed) return; - - } - break; - case 2 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:65: MapDefinitionStart - { - mMapDefinitionStart(); if (state.failed) return; - - } - break; - case 3 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:84: FeatureCallStart - { - mFeatureCallStart(); if (state.failed) return; - - } - break; - case 4 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:101: PropertyCallStart - { - mPropertyCallStart(); if (state.failed) return; - - } - break; - case 5 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:119: NameStart - { - mNameStart(); if (state.failed) return; - - } - break; - case 6 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:129: ValueStart - { - mValueStart(); if (state.failed) return; - - } - break; - case 7 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:140: OddStart - { - mOddStart(); if (state.failed) return; - - } - break; - case 8 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:149: EvenStart - { - mEvenStart(); if (state.failed) return; - - } - break; - case 9 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:159: LinkStart - { - mLinkStart(); if (state.failed) return; - - } - break; - case 10 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:169: Index - { - mIndex(); if (state.failed) return; - - } - break; - case 11 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:175: GmlId - { - mGmlId(); if (state.failed) return; - - } - break; - case 12 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:181: ExplicitTemplateEnd - { - mExplicitTemplateEnd(); if (state.failed) return; - - } - break; - case 13 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:201: UrlWithPort - { - mUrlWithPort(); if (state.failed) return; - - } - break; - case 14 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:213: Url - { - mUrl(); if (state.failed) return; - - } - break; - case 15 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:217: Equals - { - mEquals(); if (state.failed) return; - - } - break; - case 16 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:224: Star - { - mStar(); if (state.failed) return; - - } - break; - case 17 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:229: Comma - { - mComma(); if (state.failed) return; - - } - break; - case 18 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:235: Colon - { - mColon(); if (state.failed) return; - - } - break; - case 19 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:241: TagOpen - { - mTagOpen(); if (state.failed) return; - - } - break; - case 20 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:249: TagClose - { - mTagClose(); if (state.failed) return; - - } - break; - case 21 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:258: MapSpace - { - mMapSpace(); if (state.failed) return; - - } - break; - case 22 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:267: Not - { - mNot(); if (state.failed) return; - - } - break; - case 23 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:271: BracketLeft - { - mBracketLeft(); if (state.failed) return; - - } - break; - case 24 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:283: BracketRight - { - mBracketRight(); if (state.failed) return; - - } - break; - case 25 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:296: Kvp - { - mKvp(); if (state.failed) return; - - } - break; - case 26 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:300: ID - { - mID(); if (state.failed) return; - - } - break; - case 27 : - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:303: Rest - { - mRest(); if (state.failed) return; - - } - break; - - } - } - - // $ANTLR start synpred1_Templating2Lexer - public final void synpred1_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:41: ( TemplateDefinitionStart ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:41: TemplateDefinitionStart - { - mTemplateDefinitionStart(); if (state.failed) return; - - } - - } - // $ANTLR end synpred1_Templating2Lexer - - // $ANTLR start synpred2_Templating2Lexer - public final void synpred2_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:65: ( MapDefinitionStart ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:65: MapDefinitionStart - { - mMapDefinitionStart(); if (state.failed) return; - - } - - } - // $ANTLR end synpred2_Templating2Lexer - - // $ANTLR start synpred3_Templating2Lexer - public final void synpred3_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:84: ( FeatureCallStart ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:84: FeatureCallStart - { - mFeatureCallStart(); if (state.failed) return; - - } - - } - // $ANTLR end synpred3_Templating2Lexer - - // $ANTLR start synpred4_Templating2Lexer - public final void synpred4_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:101: ( PropertyCallStart ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:101: PropertyCallStart - { - mPropertyCallStart(); if (state.failed) return; - - } - - } - // $ANTLR end synpred4_Templating2Lexer - - // $ANTLR start synpred5_Templating2Lexer - public final void synpred5_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:119: ( NameStart ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:119: NameStart - { - mNameStart(); if (state.failed) return; - - } - - } - // $ANTLR end synpred5_Templating2Lexer - - // $ANTLR start synpred6_Templating2Lexer - public final void synpred6_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:129: ( ValueStart ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:129: ValueStart - { - mValueStart(); if (state.failed) return; - - } - - } - // $ANTLR end synpred6_Templating2Lexer - - // $ANTLR start synpred7_Templating2Lexer - public final void synpred7_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:140: ( OddStart ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:140: OddStart - { - mOddStart(); if (state.failed) return; - - } - - } - // $ANTLR end synpred7_Templating2Lexer - - // $ANTLR start synpred8_Templating2Lexer - public final void synpred8_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:149: ( EvenStart ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:149: EvenStart - { - mEvenStart(); if (state.failed) return; - - } - - } - // $ANTLR end synpred8_Templating2Lexer - - // $ANTLR start synpred9_Templating2Lexer - public final void synpred9_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:159: ( LinkStart ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:159: LinkStart - { - mLinkStart(); if (state.failed) return; - - } - - } - // $ANTLR end synpred9_Templating2Lexer - - // $ANTLR start synpred10_Templating2Lexer - public final void synpred10_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:169: ( Index ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:169: Index - { - mIndex(); if (state.failed) return; - - } - - } - // $ANTLR end synpred10_Templating2Lexer - - // $ANTLR start synpred11_Templating2Lexer - public final void synpred11_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:175: ( GmlId ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:175: GmlId - { - mGmlId(); if (state.failed) return; - - } - - } - // $ANTLR end synpred11_Templating2Lexer - - // $ANTLR start synpred12_Templating2Lexer - public final void synpred12_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:181: ( ExplicitTemplateEnd ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:181: ExplicitTemplateEnd - { - mExplicitTemplateEnd(); if (state.failed) return; - - } - - } - // $ANTLR end synpred12_Templating2Lexer - - // $ANTLR start synpred13_Templating2Lexer - public final void synpred13_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:201: ( UrlWithPort ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:201: UrlWithPort - { - mUrlWithPort(); if (state.failed) return; - - } - - } - // $ANTLR end synpred13_Templating2Lexer - - // $ANTLR start synpred14_Templating2Lexer - public final void synpred14_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:213: ( Url ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:213: Url - { - mUrl(); if (state.failed) return; - - } - - } - // $ANTLR end synpred14_Templating2Lexer - - // $ANTLR start synpred15_Templating2Lexer - public final void synpred15_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:217: ( Equals ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g: - { - if ( input.LA(1)=='=' ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - } - - } - // $ANTLR end synpred15_Templating2Lexer - - // $ANTLR start synpred16_Templating2Lexer - public final void synpred16_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:224: ( Star ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g: - { - if ( input.LA(1)=='*' ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - } - - } - // $ANTLR end synpred16_Templating2Lexer - - // $ANTLR start synpred17_Templating2Lexer - public final void synpred17_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:229: ( Comma ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g: - { - if ( input.LA(1)==',' ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - } - - } - // $ANTLR end synpred17_Templating2Lexer - - // $ANTLR start synpred18_Templating2Lexer - public final void synpred18_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:235: ( Colon ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g: - { - if ( input.LA(1)==':' ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - } - - } - // $ANTLR end synpred18_Templating2Lexer - - // $ANTLR start synpred19_Templating2Lexer - public final void synpred19_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:241: ( TagOpen ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g: - { - if ( input.LA(1)=='<' ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - } - - } - // $ANTLR end synpred19_Templating2Lexer - - // $ANTLR start synpred20_Templating2Lexer - public final void synpred20_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:249: ( TagClose ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g: - { - if ( input.LA(1)=='>' ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - } - - } - // $ANTLR end synpred20_Templating2Lexer - - // $ANTLR start synpred21_Templating2Lexer - public final void synpred21_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:258: ( MapSpace ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:258: MapSpace - { - mMapSpace(); if (state.failed) return; - - } - - } - // $ANTLR end synpred21_Templating2Lexer - - // $ANTLR start synpred22_Templating2Lexer - public final void synpred22_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:267: ( Not ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:267: Not - { - mNot(); if (state.failed) return; - - } - - } - // $ANTLR end synpred22_Templating2Lexer - - // $ANTLR start synpred23_Templating2Lexer - public final void synpred23_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:271: ( BracketLeft ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g: - { - if ( input.LA(1)=='(' ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - } - - } - // $ANTLR end synpred23_Templating2Lexer - - // $ANTLR start synpred24_Templating2Lexer - public final void synpred24_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:283: ( BracketRight ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g: - { - if ( input.LA(1)==')' ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - } - - } - // $ANTLR end synpred24_Templating2Lexer - - // $ANTLR start synpred25_Templating2Lexer - public final void synpred25_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:296: ( Kvp ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:296: Kvp - { - mKvp(); if (state.failed) return; - - } - - } - // $ANTLR end synpred25_Templating2Lexer - - // $ANTLR start synpred26_Templating2Lexer - public final void synpred26_Templating2Lexer_fragment() throws { - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:300: ( ID ) - // /home/stranger/checkouts/deegree3/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g:1:300: ID - { - mID(); if (state.failed) return; - - } - - } - // $ANTLR end synpred26_Templating2Lexer - - public final boolean synpred6_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred6_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred23_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred23_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred24_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred24_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred3_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred3_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred9_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred9_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred14_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred14_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred5_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred5_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred4_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred4_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred22_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred22_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred1_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred1_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred18_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred18_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred25_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred25_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred10_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred10_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred17_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred17_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred15_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred15_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred12_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred12_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred21_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred21_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred16_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred16_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred26_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred26_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred11_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred11_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred13_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred13_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred2_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred2_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred8_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred8_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred19_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred19_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred20_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred20_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred7_Templating2Lexer() { - state.backtracking++; - int start = input.mark(); - try { - synpred7_Templating2Lexer_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - - - -} diff --git a/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/output/Templating2Lexer.tokens b/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/output/Templating2Lexer.tokens deleted file mode 100644 index eb785da786..0000000000 --- a/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/output/Templating2Lexer.tokens +++ /dev/null @@ -1,32 +0,0 @@ -BracketLeft=4 -BracketRight=5 -Colon=6 -Comma=7 -Digit=8 -Equals=9 -EvenStart=10 -ExplicitTemplateEnd=11 -FeatureCallStart=12 -GmlId=13 -ID=14 -Index=15 -Kvp=16 -Letter=17 -LinkStart=18 -MapDefinitionStart=19 -MapSpace=20 -NameStart=21 -Not=22 -OddStart=23 -Point=24 -PropertyCallStart=25 -Rest=26 -Slash=27 -Star=28 -TagClose=29 -TagOpen=30 -TemplateDefinitionStart=31 -Url=32 -UrlWithPort=33 -ValueStart=34 -WS=35 diff --git a/deegree-core/deegree-core-featureinfo/src/main/java/org/deegree/featureinfo/parsing/DefaultFeatureInfoParser.java b/deegree-core/deegree-core-featureinfo/src/main/java/org/deegree/featureinfo/parsing/DefaultFeatureInfoParser.java new file mode 100644 index 0000000000..c649f868b9 --- /dev/null +++ b/deegree-core/deegree-core-featureinfo/src/main/java/org/deegree/featureinfo/parsing/DefaultFeatureInfoParser.java @@ -0,0 +1,239 @@ +//$HeadURL$ +/*---------------------------------------------------------------------------- + This file is part of deegree, http://deegree.org/ + Copyright (C) 2001-2012 by: + - Department of Geography, University of Bonn - + and + - lat/lon GmbH - + and + - Occam Labs UG (haftungsbeschränkt) - + + This library is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free + Software Foundation; either version 2.1 of the License, or (at your option) + any later version. + This library is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + details. + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact information: + + lat/lon GmbH + Aennchenstr. 19, 53177 Bonn + Germany + http://lat-lon.de/ + + Department of Geography, University of Bonn + Prof. Dr. Klaus Greve + Postfach 1147, 53001 Bonn + Germany + http://www.geographie.uni-bonn.de/deegree/ + + Occam Labs UG (haftungsbeschränkt) + Godesberger Allee 139, 53175 Bonn + Germany + + e-mail: info@deegree.org + ----------------------------------------------------------------------------*/ +package org.deegree.featureinfo.parsing; + +import static org.deegree.commons.tom.primitive.BaseType.STRING; +import static org.deegree.commons.xml.stax.XMLStreamUtils.nextElement; +import static org.deegree.commons.xml.stax.XMLStreamUtils.skipElement; +import static org.deegree.gml.GMLInputFactory.createGMLStreamReader; +import static org.deegree.gml.GMLVersion.GML_2; +import static org.slf4j.LoggerFactory.getLogger; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.namespace.QName; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; + +import org.deegree.commons.tom.gml.property.Property; +import org.deegree.commons.tom.gml.property.PropertyType; +import org.deegree.commons.xml.XMLParsingException; +import org.deegree.commons.xml.stax.XMLStreamUtils; +import org.deegree.cs.exceptions.UnknownCRSException; +import org.deegree.feature.FeatureCollection; +import org.deegree.feature.GenericFeature; +import org.deegree.feature.GenericFeatureCollection; +import org.deegree.feature.property.SimpleProperty; +import org.deegree.feature.types.DynamicAppSchema; +import org.deegree.feature.types.GenericFeatureType; +import org.deegree.feature.types.property.SimplePropertyType; +import org.deegree.gml.GMLStreamReader; +import org.slf4j.Logger; + +/** + * Responsible for parsing 'feature collections', even if they are broken (eg. ESRI or UMN mapserver feature info + * responses). Used by the WMS and WMTS clients. Currently, ESRI, UMN mapserver, mywms and normal GML2 feature + * collections are supported. + * + * @author Andreas Schmitz + * @author last edited by: $Author: stranger $ + * + * @version $Revision: $, $Date: $ + */ +public class DefaultFeatureInfoParser implements FeatureInfoParser { + + private static final Logger LOG = getLogger( DefaultFeatureInfoParser.class ); + + private static final XMLInputFactory XML_FACTORY = XMLInputFactory.newInstance(); + + @Override + public FeatureCollection parseAsFeatureCollection( InputStream inputStream, String csvLayerNames ) + throws XMLStreamException { + XMLStreamReader xmlReader = XML_FACTORY.createXMLStreamReader( inputStream ); + XMLStreamUtils.skipStartDocument( xmlReader ); + try { + // yes, some versions use a namespace, some do not + if ( ( xmlReader.getNamespaceURI() == null || xmlReader.getNamespaceURI().isEmpty() || xmlReader.getNamespaceURI().equals( "http://www.esri.com/wms" ) ) + && xmlReader.getLocalName().equals( "FeatureInfoResponse" ) ) { + return readESRICollection( xmlReader, csvLayerNames ); + } + if ( ( xmlReader.getNamespaceURI() == null || xmlReader.getNamespaceURI().isEmpty() ) + && xmlReader.getLocalName().equals( "featureInfo" ) ) { + return readMyWMSCollection( xmlReader ); + } + if ( ( xmlReader.getNamespaceURI() == null || xmlReader.getNamespaceURI().isEmpty() ) + && xmlReader.getLocalName().equals( "msGMLOutput" ) ) { + return readUMNCollection( xmlReader ); + } + return readGml2FeatureCollection( xmlReader ); + } catch ( Exception e ) { + String msg = "Unable to parse WMS GetFeatureInfo response as feature collection: " + e.getMessage(); + throw new XMLStreamException( msg, e ); + } + } + + private FeatureCollection readGml2FeatureCollection( XMLStreamReader xmlReader ) + throws XMLStreamException, XMLParsingException, UnknownCRSException { + GMLStreamReader reader = createGMLStreamReader( GML_2, xmlReader ); + reader.setApplicationSchema( new DynamicAppSchema() ); + return reader.readFeatureCollection(); + } + + private FeatureCollection readESRICollection( XMLStreamReader reader, String idPrefix ) + throws XMLStreamException { + GenericFeatureCollection col = new GenericFeatureCollection(); + + int count = 0; + nextElement( reader ); + while ( reader.isStartElement() && reader.getLocalName().equals( "FIELDS" ) ) { + List props = new ArrayList( reader.getAttributeCount() ); + List propValues = new ArrayList( reader.getAttributeCount() ); + for ( int i = 0; i < reader.getAttributeCount(); ++i ) { + String name = reader.getAttributeLocalName( i ); + name = name.substring( name.lastIndexOf( "." ) + 1 ); + String value = reader.getAttributeValue( i ); + SimplePropertyType tp = new SimplePropertyType( new QName( name ), 0, 1, STRING, null, null ); + propValues.add( new SimpleProperty( tp, value ) ); + props.add( tp ); + } + GenericFeatureType ft = new GenericFeatureType( new QName( "feature" ), props, false ); + col.add( new GenericFeature( ft, idPrefix + "_esri_" + ++count, propValues, null ) ); + skipElement( reader ); + nextElement( reader ); + } + LOG.debug( "Found {} features.", col.size() ); + return col; + } + + private FeatureCollection readMyWMSCollection( XMLStreamReader reader ) + throws XMLStreamException { + GenericFeatureCollection col = new GenericFeatureCollection(); + + nextElement( reader ); + while ( reader.isStartElement() && reader.getLocalName().equals( "query_layer" ) ) { + + String ftName = reader.getAttributeValue( null, "name" ); + int count = 0; + + nextElement( reader ); + while ( reader.isStartElement() && reader.getLocalName().equals( "object" ) ) { + + List props = new ArrayList(); + List propValues = new ArrayList(); + + nextElement( reader ); + while ( !( reader.isEndElement() && reader.getLocalName().equals( "object" ) ) ) { + String name = reader.getLocalName(); + String value = reader.getElementText(); + SimplePropertyType tp = new SimplePropertyType( new QName( name ), 0, 1, STRING, null, null ); + propValues.add( new SimpleProperty( tp, value ) ); + props.add( tp ); + nextElement( reader ); + } + + GenericFeatureType ft = new GenericFeatureType( new QName( ftName ), props, false ); + col.add( new GenericFeature( ft, "ftName_" + ++count, propValues, null ) ); + nextElement( reader ); + } + nextElement( reader ); + } + return col; + } + + private FeatureCollection readUMNCollection( XMLStreamReader reader ) + throws XMLStreamException { + GenericFeatureCollection col = new GenericFeatureCollection(); + nextElement( reader ); + + String ftName = reader.getLocalName(); + String singleFeatureTagName = ftName.split( "_" )[0] + "_feature"; + + while ( reader.isStartElement() && reader.getLocalName().equals( ftName ) ) { + + int count = 0; + nextElement( reader ); + + // gml:name seems to be an optional element + if ( reader.getLocalName().equals( "name" ) ) { + skipElement( reader ); + reader.nextTag(); + } + + while ( reader.isStartElement() && reader.getLocalName().equals( singleFeatureTagName ) ) { + List props = new ArrayList(); + List propValues = new ArrayList(); + + nextElement( reader ); + while ( !( reader.isEndElement() && reader.getLocalName().equals( singleFeatureTagName ) ) ) { + + // Skip boundedBy + if ( reader.isStartElement() && reader.getLocalName().equals( "boundedBy" ) ) { + XMLStreamUtils.skipElement( reader ); + nextElement( reader ); + } + + // skip geometry + if ( reader.isStartElement() && reader.getLocalName().equals( "geometry" ) ) { + XMLStreamUtils.skipElement( reader ); + nextElement( reader ); + } + + String name = reader.getLocalName(); + String value = reader.getElementText(); + SimplePropertyType tp = new SimplePropertyType( new QName( name ), 0, 1, STRING, null, null ); + propValues.add( new SimpleProperty( tp, value ) ); + props.add( tp ); + nextElement( reader ); + } + GenericFeatureType ft = new GenericFeatureType( new QName( ftName ), props, false ); + col.add( new GenericFeature( ft, "ftName_" + ++count, propValues, null ) ); + nextElement( reader ); + } + nextElement( reader ); + } + return col; + } + +} diff --git a/deegree-core/deegree-core-featureinfo/src/main/java/org/deegree/featureinfo/parsing/FeatureInfoParser.java b/deegree-core/deegree-core-featureinfo/src/main/java/org/deegree/featureinfo/parsing/FeatureInfoParser.java index 4c71292cf5..60775cc1fd 100644 --- a/deegree-core/deegree-core-featureinfo/src/main/java/org/deegree/featureinfo/parsing/FeatureInfoParser.java +++ b/deegree-core/deegree-core-featureinfo/src/main/java/org/deegree/featureinfo/parsing/FeatureInfoParser.java @@ -1,12 +1,10 @@ //$HeadURL$ /*---------------------------------------------------------------------------- This file is part of deegree, http://deegree.org/ - Copyright (C) 2001-2012 by: + Copyright (C) 2001-2015 by: - Department of Geography, University of Bonn - and - lat/lon GmbH - - and - - Occam Labs UG (haftungsbeschränkt) - This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free @@ -33,209 +31,34 @@ Germany http://www.geographie.uni-bonn.de/deegree/ - Occam Labs UG (haftungsbeschränkt) - Godesberger Allee 139, 53175 Bonn - Germany - e-mail: info@deegree.org - ----------------------------------------------------------------------------*/ +----------------------------------------------------------------------------*/ package org.deegree.featureinfo.parsing; -import static org.deegree.commons.tom.primitive.BaseType.STRING; -import static org.deegree.commons.xml.stax.XMLStreamUtils.nextElement; -import static org.deegree.commons.xml.stax.XMLStreamUtils.skipElement; -import static org.deegree.gml.GMLInputFactory.createGMLStreamReader; -import static org.deegree.gml.GMLVersion.GML_2; -import static org.slf4j.LoggerFactory.getLogger; - -import java.util.ArrayList; -import java.util.List; +import java.io.InputStream; -import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import org.deegree.commons.tom.gml.property.Property; -import org.deegree.commons.tom.gml.property.PropertyType; -import org.deegree.commons.xml.XMLParsingException; -import org.deegree.commons.xml.stax.XMLStreamUtils; -import org.deegree.cs.exceptions.UnknownCRSException; import org.deegree.feature.FeatureCollection; -import org.deegree.feature.GenericFeature; -import org.deegree.feature.GenericFeatureCollection; -import org.deegree.feature.property.SimpleProperty; -import org.deegree.feature.types.DynamicAppSchema; -import org.deegree.feature.types.GenericFeatureType; -import org.deegree.feature.types.property.SimplePropertyType; -import org.deegree.gml.GMLStreamReader; -import org.slf4j.Logger; /** - * Responsible for parsing 'feature collections', even if they are broken (eg. ESRI or UMN mapserver feature info - * responses). Used by the WMS and WMTS clients. Currently, ESRI, UMN mapserver, mywms and normal GML2 feature - * collections are supported. + * Responsible for parsing 'feature collections'. * - * @author Andreas Schmitz - * @author last edited by: $Author: stranger $ - * - * @version $Revision: $, $Date: $ + * @author Lyn Goltz */ -public class FeatureInfoParser { - - private static final Logger LOG = getLogger( FeatureInfoParser.class ); +public interface FeatureInfoParser { /** - * @param xmlReader - * input XML stream + * @param featureInfoToParse + * the feature info to parse, never null * @param csvLayerNames - * a comma separated list of layer names - * @return all features that could be reconstructed or synthesized + * a comma separated list of layer names, should not be null + * @return a feature collection containingall features that could be reconstructed or synthesized, never + * null * @throws XMLStreamException * if the content could not be parsed as feature collection */ - public static FeatureCollection parseAsFeatureCollection( XMLStreamReader xmlReader, String csvLayerNames ) - throws XMLStreamException { - try { - // yes, some versions use a namespace, some do not - if ( ( xmlReader.getNamespaceURI() == null || xmlReader.getNamespaceURI().isEmpty() || xmlReader.getNamespaceURI().equals( "http://www.esri.com/wms" ) ) - && xmlReader.getLocalName().equals( "FeatureInfoResponse" ) ) { - return readESRICollection( xmlReader, csvLayerNames ); - } - if ( ( xmlReader.getNamespaceURI() == null || xmlReader.getNamespaceURI().isEmpty() ) - && xmlReader.getLocalName().equals( "featureInfo" ) ) { - return readMyWMSCollection( xmlReader ); - } - if ( ( xmlReader.getNamespaceURI() == null || xmlReader.getNamespaceURI().isEmpty() ) - && xmlReader.getLocalName().equals( "msGMLOutput" ) ) { - return readUMNCollection( xmlReader ); - } - return readGml2FeatureCollection( xmlReader ); - } catch ( Exception e ) { - String msg = "Unable to parse WMS GetFeatureInfo response as feature collection: " + e.getMessage(); - throw new XMLStreamException( msg, e ); - } - } - - private static FeatureCollection readGml2FeatureCollection( XMLStreamReader xmlReader ) - throws XMLStreamException, XMLParsingException, UnknownCRSException { - GMLStreamReader reader = createGMLStreamReader( GML_2, xmlReader ); - reader.setApplicationSchema( new DynamicAppSchema() ); - return reader.readFeatureCollection(); - } - - private static FeatureCollection readESRICollection( XMLStreamReader reader, String idPrefix ) - throws XMLStreamException { - GenericFeatureCollection col = new GenericFeatureCollection(); - - int count = 0; - nextElement( reader ); - while ( reader.isStartElement() && reader.getLocalName().equals( "FIELDS" ) ) { - List props = new ArrayList( reader.getAttributeCount() ); - List propValues = new ArrayList( reader.getAttributeCount() ); - for ( int i = 0; i < reader.getAttributeCount(); ++i ) { - String name = reader.getAttributeLocalName( i ); - name = name.substring( name.lastIndexOf( "." ) + 1 ); - String value = reader.getAttributeValue( i ); - SimplePropertyType tp = new SimplePropertyType( new QName( name ), 0, 1, STRING, null, null ); - propValues.add( new SimpleProperty( tp, value ) ); - props.add( tp ); - } - GenericFeatureType ft = new GenericFeatureType( new QName( "feature" ), props, false ); - col.add( new GenericFeature( ft, idPrefix + "_esri_" + ++count, propValues, null ) ); - skipElement( reader ); - nextElement( reader ); - } - LOG.debug( "Found {} features.", col.size() ); - return col; - } - - private static FeatureCollection readMyWMSCollection( XMLStreamReader reader ) - throws XMLStreamException { - GenericFeatureCollection col = new GenericFeatureCollection(); - - nextElement( reader ); - while ( reader.isStartElement() && reader.getLocalName().equals( "query_layer" ) ) { - - String ftName = reader.getAttributeValue( null, "name" ); - int count = 0; - - nextElement( reader ); - while ( reader.isStartElement() && reader.getLocalName().equals( "object" ) ) { - - List props = new ArrayList(); - List propValues = new ArrayList(); - - nextElement( reader ); - while ( !( reader.isEndElement() && reader.getLocalName().equals( "object" ) ) ) { - String name = reader.getLocalName(); - String value = reader.getElementText(); - SimplePropertyType tp = new SimplePropertyType( new QName( name ), 0, 1, STRING, null, null ); - propValues.add( new SimpleProperty( tp, value ) ); - props.add( tp ); - nextElement( reader ); - } - - GenericFeatureType ft = new GenericFeatureType( new QName( ftName ), props, false ); - col.add( new GenericFeature( ft, "ftName_" + ++count, propValues, null ) ); - nextElement( reader ); - } - nextElement( reader ); - } - return col; - } - - private static FeatureCollection readUMNCollection( XMLStreamReader reader ) - throws XMLStreamException { - GenericFeatureCollection col = new GenericFeatureCollection(); - nextElement( reader ); - - String ftName = reader.getLocalName(); - String singleFeatureTagName = ftName.split( "_" )[0] + "_feature"; - - while ( reader.isStartElement() && reader.getLocalName().equals( ftName ) ) { - - int count = 0; - nextElement( reader ); - - // gml:name seems to be an optional element - if ( reader.getLocalName().equals( "name" ) ) { - skipElement( reader ); - reader.nextTag(); - } - - while ( reader.isStartElement() && reader.getLocalName().equals( singleFeatureTagName ) ) { - List props = new ArrayList(); - List propValues = new ArrayList(); - - nextElement( reader ); - while ( !( reader.isEndElement() && reader.getLocalName().equals( singleFeatureTagName ) ) ) { - - // Skip boundedBy - if ( reader.isStartElement() && reader.getLocalName().equals( "boundedBy" ) ) { - XMLStreamUtils.skipElement( reader ); - nextElement( reader ); - } - - // skip geometry - if ( reader.isStartElement() && reader.getLocalName().equals( "geometry" ) ) { - XMLStreamUtils.skipElement( reader ); - nextElement( reader ); - } - - String name = reader.getLocalName(); - String value = reader.getElementText(); - SimplePropertyType tp = new SimplePropertyType( new QName( name ), 0, 1, STRING, null, null ); - propValues.add( new SimpleProperty( tp, value ) ); - props.add( tp ); - nextElement( reader ); - } - GenericFeatureType ft = new GenericFeatureType( new QName( ftName ), props, false ); - col.add( new GenericFeature( ft, "ftName_" + ++count, propValues, null ) ); - nextElement( reader ); - } - nextElement( reader ); - } - return col; - } + FeatureCollection parseAsFeatureCollection( InputStream featureInfoToParse, String csvLayerNames ) + throws XMLStreamException; -} +} \ No newline at end of file diff --git a/deegree-core/deegree-core-featureinfo/src/main/java/org/deegree/featureinfo/parsing/XsltFeatureInfoParser.java b/deegree-core/deegree-core-featureinfo/src/main/java/org/deegree/featureinfo/parsing/XsltFeatureInfoParser.java new file mode 100644 index 0000000000..b3afc6b824 --- /dev/null +++ b/deegree-core/deegree-core-featureinfo/src/main/java/org/deegree/featureinfo/parsing/XsltFeatureInfoParser.java @@ -0,0 +1,124 @@ +//$HeadURL$ +/*---------------------------------------------------------------------------- + This file is part of deegree, http://deegree.org/ + Copyright (C) 2001-2015 by: + - Department of Geography, University of Bonn - + and + - lat/lon GmbH - + + This library is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free + Software Foundation; either version 2.1 of the License, or (at your option) + any later version. + This library is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + details. + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact information: + + lat/lon GmbH + Aennchenstr. 19, 53177 Bonn + Germany + http://lat-lon.de/ + + Department of Geography, University of Bonn + Prof. Dr. Klaus Greve + Postfach 1147, 53001 Bonn + Germany + http://www.geographie.uni-bonn.de/deegree/ + + e-mail: info@deegree.org +----------------------------------------------------------------------------*/ +package org.deegree.featureinfo.parsing; + +import static org.slf4j.LoggerFactory.getLogger; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.net.URL; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; + +import org.deegree.commons.xml.XMLParsingException; +import org.deegree.commons.xml.XsltUtils; +import org.deegree.cs.exceptions.UnknownCRSException; +import org.deegree.feature.FeatureCollection; +import org.deegree.feature.types.DynamicAppSchema; +import org.deegree.gml.GMLInputFactory; +import org.deegree.gml.GMLStreamReader; +import org.deegree.gml.GMLVersion; +import org.slf4j.Logger; + +/** + * Responsible for parsing 'feature collections' with a xslt file. + * + * @author Lyn Goltz + */ +public class XsltFeatureInfoParser implements FeatureInfoParser { + + private static final Logger LOG = getLogger( XsltFeatureInfoParser.class ); + + private static final XMLInputFactory XML_FACTORY = XMLInputFactory.newInstance(); + + private final URL xsltFile; + + private final GMLVersion targetGmlVersion; + + /** + * @param xsltFile + * the xslt file used to transform the feature info xml, never null + * @param targetGmlVersion + * the gml version the xslt is transforming to, never null + **/ + public XsltFeatureInfoParser( URL xsltFile, GMLVersion targetGmlVersion ) { + this.xsltFile = xsltFile; + this.targetGmlVersion = targetGmlVersion; + } + + @Override + public FeatureCollection parseAsFeatureCollection( InputStream featureInfoToParse, String csvLayerNames ) + throws XMLStreamException { + XMLStreamReader transformedReader = transform( featureInfoToParse ); + return readAsGmlFeatureCollection( transformedReader ); + } + + private XMLStreamReader transform( InputStream featureInfoToParse ) + throws XMLStreamException { + LOG.debug( "Apply xslt transformation {}.", xsltFile ); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try { + XsltUtils.transform( featureInfoToParse, xsltFile, outputStream ); + ByteArrayInputStream inputStream = new ByteArrayInputStream( outputStream.toByteArray() ); + return XML_FACTORY.createXMLStreamReader( inputStream ); + } catch ( Exception e ) { + LOG.warn( "Unable to transform remote feature info xml stream: {}.", e.getLocalizedMessage() ); + LOG.trace( "Stack trace:", e ); + throw new XMLStreamException( "Unable to transform remote feature info xml stream." ); + } + } + + private FeatureCollection readAsGmlFeatureCollection( XMLStreamReader transformedReader ) + throws XMLStreamException { + try { + GMLStreamReader reader = GMLInputFactory.createGMLStreamReader( targetGmlVersion, transformedReader ); + reader.setApplicationSchema( new DynamicAppSchema() ); + return reader.readFeatureCollection(); + } catch ( XMLParsingException e ) { + LOG.warn( "Unable to read transfomed feature info xml stream: {}.", e.getLocalizedMessage() ); + LOG.trace( "Stack trace:", e ); + throw new XMLStreamException( "Unable to read transfomed feature info xml stream." ); + } catch ( UnknownCRSException e ) { + LOG.warn( "Unable to read transfomed feature info xml stream: {}.", e.getLocalizedMessage() ); + LOG.trace( "Stack trace:", e ); + throw new XMLStreamException( "Unable to read transfomed feature info xml stream." ); + } + } + +} \ No newline at end of file diff --git a/deegree-core/deegree-core-featureinfo/src/test/java/org/deegree/featureinfo/parsing/FeatureInfoParserTest.java b/deegree-core/deegree-core-featureinfo/src/test/java/org/deegree/featureinfo/parsing/DefaultFeatureInfoParserTest.java similarity index 67% rename from deegree-core/deegree-core-featureinfo/src/test/java/org/deegree/featureinfo/parsing/FeatureInfoParserTest.java rename to deegree-core/deegree-core-featureinfo/src/test/java/org/deegree/featureinfo/parsing/DefaultFeatureInfoParserTest.java index 940ea87f04..e964557c42 100644 --- a/deegree-core/deegree-core-featureinfo/src/test/java/org/deegree/featureinfo/parsing/FeatureInfoParserTest.java +++ b/deegree-core/deegree-core-featureinfo/src/test/java/org/deegree/featureinfo/parsing/DefaultFeatureInfoParserTest.java @@ -43,13 +43,10 @@ Occam Labs UG (haftungsbeschränkt) import java.io.InputStream; -import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.Assert; import org.deegree.feature.FeatureCollection; +import org.junit.Assert; import org.junit.Test; /** @@ -60,38 +57,31 @@ Occam Labs UG (haftungsbeschränkt) * * @version $Revision: $, $Date: $ */ -public class FeatureInfoParserTest { +public class DefaultFeatureInfoParserTest { + + private final DefaultFeatureInfoParser featureInfoParser = new DefaultFeatureInfoParser(); @Test public void testEsriCollection() throws XMLStreamException { - InputStream in = FeatureInfoParserTest.class.getResourceAsStream( "esri1.xml" ); - XMLInputFactory fac = XMLInputFactory.newInstance(); - XMLStreamReader xin = fac.createXMLStreamReader( in ); - xin.next(); - FeatureCollection fc = FeatureInfoParser.parseAsFeatureCollection( xin, "test" ); + InputStream in = DefaultFeatureInfoParserTest.class.getResourceAsStream( "esri1.xml" ); + FeatureCollection fc = featureInfoParser.parseAsFeatureCollection( in, "test" ); Assert.assertEquals( 1, fc.size() ); } @Test public void testEmptyEsriCollection() throws XMLStreamException { - InputStream in = FeatureInfoParserTest.class.getResourceAsStream( "esri2.xml" ); - XMLInputFactory fac = XMLInputFactory.newInstance(); - XMLStreamReader xin = fac.createXMLStreamReader( in ); - xin.next(); - FeatureCollection fc = FeatureInfoParser.parseAsFeatureCollection( xin, "test" ); + InputStream in = DefaultFeatureInfoParserTest.class.getResourceAsStream( "esri2.xml" ); + FeatureCollection fc = featureInfoParser.parseAsFeatureCollection( in, "test" ); Assert.assertEquals( 0, fc.size() ); } @Test public void testNamespacedEsriCollection() throws XMLStreamException { - InputStream in = FeatureInfoParserTest.class.getResourceAsStream( "esriwithnamespace.xml" ); - XMLInputFactory fac = XMLInputFactory.newInstance(); - XMLStreamReader xin = fac.createXMLStreamReader( in ); - xin.next(); - FeatureCollection fc = FeatureInfoParser.parseAsFeatureCollection( xin, "test" ); + InputStream in = DefaultFeatureInfoParserTest.class.getResourceAsStream( "esriwithnamespace.xml" ); + FeatureCollection fc = featureInfoParser.parseAsFeatureCollection( in, "test" ); Assert.assertEquals( 8, fc.size() ); } diff --git a/deegree-core/deegree-core-featureinfo/src/test/java/org/deegree/featureinfo/parsing/XsltFeatureInfoParserTest.java b/deegree-core/deegree-core-featureinfo/src/test/java/org/deegree/featureinfo/parsing/XsltFeatureInfoParserTest.java new file mode 100644 index 0000000000..be6425fa70 --- /dev/null +++ b/deegree-core/deegree-core-featureinfo/src/test/java/org/deegree/featureinfo/parsing/XsltFeatureInfoParserTest.java @@ -0,0 +1,70 @@ +//$HeadURL$ +/*---------------------------------------------------------------------------- + This file is part of deegree, http://deegree.org/ + Copyright (C) 2001-2015 by: + - Department of Geography, University of Bonn - + and + - lat/lon GmbH - + + This library is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free + Software Foundation; either version 2.1 of the License, or (at your option) + any later version. + This library is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + details. + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact information: + + lat/lon GmbH + Aennchenstr. 19, 53177 Bonn + Germany + http://lat-lon.de/ + + Department of Geography, University of Bonn + Prof. Dr. Klaus Greve + Postfach 1147, 53001 Bonn + Germany + http://www.geographie.uni-bonn.de/deegree/ + + e-mail: info@deegree.org +----------------------------------------------------------------------------*/ +package org.deegree.featureinfo.parsing; + +import java.io.InputStream; +import java.net.URL; + +import javax.xml.stream.XMLStreamException; + +import org.deegree.feature.FeatureCollection; +import org.deegree.gml.GMLVersion; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * @author Lyn Goltz + */ +public class XsltFeatureInfoParserTest { + + private static XsltFeatureInfoParser featureInfoParser; + + @BeforeClass + public static void initParser() { + URL xsltFile = XsltFeatureInfoParserTest.class.getResource( "esriwithnamespaceTo2gml2.xsl" ); + featureInfoParser = new XsltFeatureInfoParser( xsltFile, GMLVersion.GML_2 ); + } + + @Test + public void testEsriCollection() + throws XMLStreamException { + InputStream in = XsltFeatureInfoParser.class.getResourceAsStream( "esriwithnamespace.xml" ); + FeatureCollection fc = featureInfoParser.parseAsFeatureCollection( in, "test" ); + Assert.assertEquals( 8, fc.size() ); + } + +} \ No newline at end of file diff --git a/deegree-core/deegree-core-featureinfo/src/test/resources/org/deegree/featureinfo/parsing/esriwithnamespaceTo2gml2.xsl b/deegree-core/deegree-core-featureinfo/src/test/resources/org/deegree/featureinfo/parsing/esriwithnamespaceTo2gml2.xsl new file mode 100644 index 0000000000..6c294a2acd --- /dev/null +++ b/deegree-core/deegree-core-featureinfo/src/test/resources/org/deegree/featureinfo/parsing/esriwithnamespaceTo2gml2.xsl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/deegree-core/deegree-core-filter/pom.xml b/deegree-core/deegree-core-filter/pom.xml deleted file mode 100644 index d47ed8a07c..0000000000 --- a/deegree-core/deegree-core-filter/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - 4.0.0 - deegree-core-filter - deegree-core-filter - jar - Data model and XML readers and writers for filter expressions - - - rework - - - - org.deegree - deegree-core - 3.4.32-SNAPSHOT - - - - - org.deegree - deegree-core-base - ${project.version} - - - junit - junit - - - - diff --git a/deegree-core/deegree-core-filterfunctions/pom.xml b/deegree-core/deegree-core-filterfunctions/pom.xml index 971a35cafa..f6285663e0 100644 --- a/deegree-core/deegree-core-filterfunctions/pom.xml +++ b/deegree-core/deegree-core-filterfunctions/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-gdal/pom.xml b/deegree-core/deegree-core-gdal/pom.xml index 5a8d1dab82..7b794311c2 100644 --- a/deegree-core/deegree-core-gdal/pom.xml +++ b/deegree-core/deegree-core-gdal/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-gdal/src/main/java/org/deegree/commons/gdal/GdalSettings.java b/deegree-core/deegree-core-gdal/src/main/java/org/deegree/commons/gdal/GdalSettings.java index fd17870f11..3e3cb590fa 100644 --- a/deegree-core/deegree-core-gdal/src/main/java/org/deegree/commons/gdal/GdalSettings.java +++ b/deegree-core/deegree-core-gdal/src/main/java/org/deegree/commons/gdal/GdalSettings.java @@ -63,7 +63,7 @@ public class GdalSettings implements Initializable, Destroyable { private static final Logger LOG = getLogger( GdalSettings.class ); - private static final URL CONFIG_SCHEMA = GdalSettings.class.getResource( "/META-INF/schemas/commons/gdal/3.4.0/gdal.xsd" ); + private static final URL CONFIG_SCHEMA = GdalSettings.class.getResource( "/META-INF/schemas/commons/gdal/gdal.xsd" ); private static final String CONFIG_JAXB_PACKAGE = "org.deegree.commons.gdal.jaxb"; diff --git a/deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/3.4.0/example_complex.xml b/deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/example_complex.xml similarity index 88% rename from deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/3.4.0/example_complex.xml rename to deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/example_complex.xml index 15d1fb8441..c8e1b67af9 100644 --- a/deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/3.4.0/example_complex.xml +++ b/deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/example_complex.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://www.deegree.org/gdal http://schemas.deegree.org/3.5/commons/gdal/gdal.xsd" /> 10 1000 419430400 diff --git a/deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/3.4.0/example_minimal.xml b/deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/example_minimal.xml similarity index 84% rename from deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/3.4.0/example_minimal.xml rename to deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/example_minimal.xml index 3b2459b82d..0abca24339 100644 --- a/deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/3.4.0/example_minimal.xml +++ b/deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/example_minimal.xml @@ -1,4 +1,4 @@ + xsi:schemaLocation="http://www.deegree.org/gdal http://schemas.deegree.org/3.5/commons/gdal/gdal.xsd"> 5 diff --git a/deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/3.4.0/gdal.xsd b/deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/gdal.xsd similarity index 80% rename from deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/3.4.0/gdal.xsd rename to deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/gdal.xsd index b2e2ecf706..f5ddcce2ba 100644 --- a/deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/3.4.0/gdal.xsd +++ b/deegree-core/deegree-core-gdal/src/main/resources/META-INF/schemas/commons/gdal/gdal.xsd @@ -24,14 +24,7 @@ - + - - - - - - - diff --git a/deegree-core/deegree-core-geometry/pom.xml b/deegree-core/deegree-core-geometry/pom.xml index 7b9c6b5880..105cf594ef 100644 --- a/deegree-core/deegree-core-geometry/pom.xml +++ b/deegree-core/deegree-core-geometry/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-geometry/src/main/resources/META-INF/schemas/commons/spatialmetadata/3.4.0/spatialmetadata.xsd b/deegree-core/deegree-core-geometry/src/main/resources/META-INF/schemas/commons/spatialmetadata/spatialmetadata.xsd similarity index 79% rename from deegree-core/deegree-core-geometry/src/main/resources/META-INF/schemas/commons/spatialmetadata/3.4.0/spatialmetadata.xsd rename to deegree-core/deegree-core-geometry/src/main/resources/META-INF/schemas/commons/spatialmetadata/spatialmetadata.xsd index 1fdf27fbd1..7b7c0a46f1 100644 --- a/deegree-core/deegree-core-geometry/src/main/resources/META-INF/schemas/commons/spatialmetadata/3.4.0/spatialmetadata.xsd +++ b/deegree-core/deegree-core-geometry/src/main/resources/META-INF/schemas/commons/spatialmetadata/spatialmetadata.xsd @@ -16,15 +16,20 @@ - - + + + + + + + + + + - - - diff --git a/deegree-core/deegree-core-geometry/src/test/java/org/deegree/geometry/linearization/CurveLinearizerTest.java b/deegree-core/deegree-core-geometry/src/test/java/org/deegree/geometry/linearization/CurveLinearizerTest.java index 52037ecb1e..63ff4c53f2 100644 --- a/deegree-core/deegree-core-geometry/src/test/java/org/deegree/geometry/linearization/CurveLinearizerTest.java +++ b/deegree-core/deegree-core-geometry/src/test/java/org/deegree/geometry/linearization/CurveLinearizerTest.java @@ -547,14 +547,14 @@ public void visualizeCircle() { double[] p1 = new double[] { -3, 0.5 }; double[] p2 = new double[] { -2.3, -2.5 }; Points positions = createLinearArc( p0, p1, p2, true ); - Assert.assertEquals( exportToWKT( positions ).trim(), - "LINESTRING (-1.7 2.5, -2.7016581805723767 1.3123248162113277, -3.088808067948505 -0.1923367462669825, -2.7847698788517685 -1.715968011523047, -1.8497621054164624 -2.95679512136171, -0.4689745042892608 -3.6690570489335883, 1.0841110058779768 -3.711681584163785, 2.50188679245283 -3.0762264150943404, 3.5035449730252055 -1.8885512313056685, 3.8906948604013345 -0.3838896688273583, 3.5866566713045978 1.1397415964287063, 2.651648897869292 2.3805687062673697, 1.2708612967420905 3.092830633839248, -0.2822242134251467 3.1354551690694445, -1.7 2.5)" ); + Assert.assertEquals( "LINESTRING (-1.7 2.5, -2.7016581805723767 1.3123248162113277, -3.088808067948505 -0.1923367462669825, -2.7847698788517685 -1.715968011523047, -1.8497621054164624 -2.9567951213617105, -0.4689745042892608 -3.6690570489335883, 1.0841110058779768 -3.711681584163785, 2.50188679245283 -3.0762264150943404, 3.5035449730252055 -1.8885512313056685, 3.8906948604013345 -0.3838896688273583, 3.5866566713045978 1.1397415964287063, 2.651648897869292 2.3805687062673697, 1.2708612967420905 3.092830633839248, -0.2822242134251467 3.1354551690694445, -1.7 2.5)", + exportToWKT( positions ).trim() ); // inverse positions = createLinearArc( p2, p1, p0, true ); LOG.debug( exportToWKT( positions ).trim() ); - Assert.assertEquals( exportToWKT( positions ).trim(), - "LINESTRING (-2.3 -2.5, -2.992224229754389 -1.109058926972116, -3.0123899967132983 0.4444805140263982, -2.3565032234136143 1.8529207837948918, -1.1544703292307315 2.8373030135193718, 0.3556313291764255 3.2026582299471267, 1.8747075981788668 2.8766233516769613, 3.1018867924528286 1.9237735849056588, 3.794111022207218 0.5328325118777754, 3.814276789166127 -1.0207069291207391, 3.1583900158664444 -2.4291471988892326, 1.9563571216835611 -3.413529428613713, 0.4462554632764042 -3.778884645041468, -1.0728208057260369 -3.452849766771303, -2.3 -2.5)" ); + Assert.assertEquals( "LINESTRING (-2.3 -2.5, -2.992224229754389 -1.109058926972116, -3.0123899967132983 0.4444805140263982, -2.3565032234136143 1.8529207837948918, -1.1544703292307315 2.8373030135193718, 0.3556313291764255 3.2026582299471267, 1.8747075981788668 2.8766233516769617, 3.1018867924528286 1.9237735849056588, 3.794111022207218 0.5328325118777754, 3.814276789166127 -1.0207069291207391, 3.1583900158664444 -2.4291471988892326, 1.9563571216835611 -3.413529428613713, 0.4462554632764042 -3.778884645041468, -1.0728208057260369 -3.452849766771303, -2.3 -2.5)", + exportToWKT( positions ).trim() ); } /** diff --git a/deegree-core/deegree-core-geometry/src/test/java/org/deegree/geometry/metadata/SpatialMetadataConverterTest.java b/deegree-core/deegree-core-geometry/src/test/java/org/deegree/geometry/metadata/SpatialMetadataConverterTest.java new file mode 100644 index 0000000000..9773555d8f --- /dev/null +++ b/deegree-core/deegree-core-geometry/src/test/java/org/deegree/geometry/metadata/SpatialMetadataConverterTest.java @@ -0,0 +1,73 @@ +/*---------------------------------------------------------------------------- + This file is part of deegree, http://deegree.org/ + Copyright (C) 2001-2022 by: + Department of Geography, University of Bonn + and + lat/lon GmbH + + This library is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free + Software Foundation; either version 2.1 of the License, or (at your option) + any later version. + This library is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + details. + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact information: + + lat/lon GmbH + Aennchenstr. 19, 53177 Bonn + Germany + http://lat-lon.de/ + + Department of Geography, University of Bonn + Prof. Dr. Klaus Greve + Postfach 1147, 53001 Bonn + Germany + http://www.geographie.uni-bonn.de/deegree/ + + e-mail: info@deegree.org + ----------------------------------------------------------------------------*/ +package org.deegree.geometry.metadata; + +import org.deegree.geometry.Envelope; +import org.deegree.geometry.metadata.jaxb.EnvelopeType; +import org.junit.Test; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.stream.StreamSource; +import java.io.InputStream; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + +/** + * @author Lyn Goltz + */ +public class SpatialMetadataConverterTest { + + @Test + public void testConvertEnvelopeFromJaxb() throws JAXBException { + EnvelopeType env = createEnvelopeType(); + Envelope envelope = SpatialMetadataConverter.fromJaxb(env); + assertThat(envelope.getMin().get(0), is(8.3)); + assertThat(envelope.getMin().get(1), is(53.2)); + assertThat(envelope.getMax().get(0), is(10.4)); + assertThat(envelope.getMax().get(1), is(54.0)); + + } + + private EnvelopeType createEnvelopeType() throws JAXBException { + JAXBContext jc = JAXBContext.newInstance(EnvelopeType.class); + Unmarshaller unmarshaller = jc.createUnmarshaller(); + InputStream resourceAsStream = getClass().getResourceAsStream("envelope.xml"); + return unmarshaller.unmarshal(new StreamSource(resourceAsStream), EnvelopeType.class).getValue(); + } + +} diff --git a/deegree-core/deegree-core-geometry/src/test/resources/org/deegree/geometry/metadata/envelope.xml b/deegree-core/deegree-core-geometry/src/test/resources/org/deegree/geometry/metadata/envelope.xml new file mode 100644 index 0000000000..845f2a4312 --- /dev/null +++ b/deegree-core/deegree-core-geometry/src/test/resources/org/deegree/geometry/metadata/envelope.xml @@ -0,0 +1,4 @@ + + 8.3 53.2 + 10.4 54.0 + \ No newline at end of file diff --git a/deegree-core/deegree-core-layer/pom.xml b/deegree-core/deegree-core-layer/pom.xml index 007ffa86d1..1448894875 100644 --- a/deegree-core/deegree-core-layer/pom.xml +++ b/deegree-core/deegree-core-layer/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT @@ -43,15 +43,53 @@ + + org.deegree + deegree-core-base + ${project.version} + + + org.deegree + deegree-core-commons + ${project.version} + + + org.deegree + deegree-core-cs + ${project.version} + + + org.deegree + deegree-core-geometry + ${project.version} + org.deegree deegree-core-rendering-2d ${project.version} + + org.deegree + deegree-core-style + ${project.version} + + + org.deegree + deegree-core-workspace + ${project.version} + + + jakarta.xml.bind + jakarta.xml.bind-api + + + org.slf4j + slf4j-api + junit junit - + org.mockito mockito-core diff --git a/deegree-core/deegree-core-layer/src/main/java/org/deegree/layer/config/ConfigUtils.java b/deegree-core/deegree-core-layer/src/main/java/org/deegree/layer/config/ConfigUtils.java index 1d5dd8f654..bb40b97b82 100644 --- a/deegree-core/deegree-core-layer/src/main/java/org/deegree/layer/config/ConfigUtils.java +++ b/deegree-core/deegree-core-layer/src/main/java/org/deegree/layer/config/ConfigUtils.java @@ -127,6 +127,7 @@ private static Pair useSelectedStyles( Workspace workspace, StyleS for ( org.deegree.layer.persistence.base.jaxb.StyleRefType.Style s : srt.getStyle() ) { boolean isDefault = false; String name = s.getStyleName(); + String title = s.getStyleTitle(); String nameRef = s.getStyleNameRef(); String layerRef = s.getLayerNameRef(); Style st = store.getStyle( layerRef, nameRef ); @@ -141,6 +142,7 @@ private static Pair useSelectedStyles( Workspace workspace, StyleS } st = st.copy(); st.setName( name ); + st.setTitle( title ); styleMap.put( name, st ); if ( isDefault && !styleMap.containsKey( "default" ) ) { styleMap.put( "default", st ); @@ -247,7 +249,12 @@ public static MapOptions parseLayerOptions( LayerOptionsType cfg ) { if ( cfg.isOpaque() != null ) { opaque = cfg.isOpaque(); } - return new MapOptions( quali, interpol, alias, maxFeats, rad, opaque ); + return new MapOptions.Builder(). + quality( quali ). + interpolation( interpol ). + antialias( alias ). + maxFeatures( maxFeats ). + featureInfoRadius( rad ).build(); } public static Map> parseDimensions( String layerName, List dimensions ) { diff --git a/deegree-core/deegree-core-layer/src/main/java/org/deegree/layer/metadata/LayerMetadata.java b/deegree-core/deegree-core-layer/src/main/java/org/deegree/layer/metadata/LayerMetadata.java index a17aeee247..15d193fbe8 100644 --- a/deegree-core/deegree-core-layer/src/main/java/org/deegree/layer/metadata/LayerMetadata.java +++ b/deegree-core/deegree-core-layer/src/main/java/org/deegree/layer/metadata/LayerMetadata.java @@ -38,6 +38,7 @@ import static java.lang.Double.NEGATIVE_INFINITY; import static java.lang.Double.POSITIVE_INFINITY; +import java.net.URL; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -89,6 +90,8 @@ public class LayerMetadata { private List> authorities = new ArrayList>(); private boolean requestable = true; + + private XsltFile xsltFile; public LayerMetadata( String name, Description description, SpatialMetadata spatialMetadata ) { this.name = name; @@ -192,10 +195,9 @@ public void setQueryable( boolean queryable ) { mapOptions.setFeatureInfoRadius( 0 ); } } - } else if ( queryable ) { - mapOptions = new MapOptions( null, null, null, -1, 1 ); } else { - mapOptions = new MapOptions( null, null, null, -1, 0 ); + int featureInfoRadius = queryable ? 1 : 0; + mapOptions = new MapOptions.Builder().featureInfoRadius( featureInfoRadius ).build(); } } @@ -372,6 +374,21 @@ public void setAuthorities( List> authorities ) { this.authorities = authorities; } + /** + * @return the xslt file used to transform a feature info response from remote layer, may be null + */ + public XsltFile getXsltFile() { + return xsltFile; + } + + /** + * @param xsltFile + * the xslt file used to transform a feature info response from remote layer, may be null + */ + public void setXsltFile( XsltFile xsltFile ) { + this.xsltFile = xsltFile; + } + private void mergeDescription( Description desc ) { if ( desc != null ) { if ( description.getTitles() == null || description.getTitles().isEmpty() ) { diff --git a/deegree-core/deegree-core-layer/src/main/java/org/deegree/layer/metadata/XsltFile.java b/deegree-core/deegree-core-layer/src/main/java/org/deegree/layer/metadata/XsltFile.java new file mode 100644 index 0000000000..b3d50c607f --- /dev/null +++ b/deegree-core/deegree-core-layer/src/main/java/org/deegree/layer/metadata/XsltFile.java @@ -0,0 +1,78 @@ +//$HeadURL$ +/*---------------------------------------------------------------------------- + This file is part of deegree, http://deegree.org/ + Copyright (C) 2001-2015 by: + - Department of Geography, University of Bonn - + and + - lat/lon GmbH - + + This library is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free + Software Foundation; either version 2.1 of the License, or (at your option) + any later version. + This library is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + details. + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact information: + + lat/lon GmbH + Aennchenstr. 19, 53177 Bonn + Germany + http://lat-lon.de/ + + Department of Geography, University of Bonn + Prof. Dr. Klaus Greve + Postfach 1147, 53001 Bonn + Germany + http://www.geographie.uni-bonn.de/deegree/ + + e-mail: info@deegree.org +----------------------------------------------------------------------------*/ +package org.deegree.layer.metadata; + +import java.net.URL; + +import org.deegree.gml.GMLVersion; + +/** + * Encapsulates the xslt file as well as the gml version the xslt file transfoms to. + * + * @author Lyn Goltz + */ +public class XsltFile { + + private final URL xsltFile; + + private final GMLVersion targetGmlVersion; + + /** + * @param xsltFile + * the xslt file used to transform, never null + * @param gmlVersion + * the gml version the xsltFile transforms to, never null + */ + public XsltFile( URL xsltFile, GMLVersion targetGmlVersion ) { + this.xsltFile = xsltFile; + this.targetGmlVersion = targetGmlVersion; + } + + /** + * @return the xslt file used to transform, never null + */ + public URL getXsltFile() { + return xsltFile; + } + + /** + * @return the gml version the xsltFile transforms to, never null + */ + public GMLVersion getTargetGmlVersion() { + return targetGmlVersion; + } + +} diff --git a/deegree-core/deegree-core-layer/src/main/resources/META-INF/schemas/layers/base/3.4.0/base.xsd b/deegree-core/deegree-core-layer/src/main/resources/META-INF/schemas/layers/base/base.xsd similarity index 96% rename from deegree-core/deegree-core-layer/src/main/resources/META-INF/schemas/layers/base/3.4.0/base.xsd rename to deegree-core/deegree-core-layer/src/main/resources/META-INF/schemas/layers/base/base.xsd index 0a8d6b9770..af450006c5 100644 --- a/deegree-core/deegree-core-layer/src/main/resources/META-INF/schemas/layers/base/3.4.0/base.xsd +++ b/deegree-core/deegree-core-layer/src/main/resources/META-INF/schemas/layers/base/base.xsd @@ -12,8 +12,8 @@ - - + + @@ -36,6 +36,7 @@ + diff --git a/deegree-core/deegree-core-metadata/pom.xml b/deegree-core/deegree-core-metadata/pom.xml index aab4e742ce..240ba8c57a 100644 --- a/deegree-core/deegree-core-metadata/pom.xml +++ b/deegree-core/deegree-core-metadata/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-commons/pom.xml b/deegree-core/deegree-core-protocol/deegree-protocol-commons/pom.xml index 747f99894e..26b3ea4706 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-commons/pom.xml +++ b/deegree-core/deegree-core-protocol/deegree-protocol-commons/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core-protocol - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-commons/src/main/java/org/deegree/protocol/ows/http/OwsHttpResponseImpl.java b/deegree-core/deegree-core-protocol/deegree-protocol-commons/src/main/java/org/deegree/protocol/ows/http/OwsHttpResponseImpl.java index d50a90b085..66eb8fc8ed 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-commons/src/main/java/org/deegree/protocol/ows/http/OwsHttpResponseImpl.java +++ b/deegree-core/deegree-core-protocol/deegree-protocol-commons/src/main/java/org/deegree/protocol/ows/http/OwsHttpResponseImpl.java @@ -54,6 +54,7 @@ import org.apache.http.StatusLine; import org.apache.http.conn.ClientConnectionManager; import org.deegree.commons.ows.exception.OWSException; +import org.deegree.commons.xml.stax.XMLInputFactoryUtils; import org.deegree.protocol.ows.exception.OWSExceptionReport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -70,7 +71,7 @@ public class OwsHttpResponseImpl implements OwsHttpResponse { private static Logger LOG = LoggerFactory.getLogger( OwsHttpResponseImpl.class ); - private static final XMLInputFactory xmlFac = XMLInputFactory.newInstance(); + private static final XMLInputFactory xmlFac = XMLInputFactoryUtils.newSafeInstance(); private final HttpResponse httpResponse; diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-csw/pom.xml b/deegree-core/deegree-core-protocol/deegree-protocol-csw/pom.xml index 229ac9ee9e..01e983d694 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-csw/pom.xml +++ b/deegree-core/deegree-core-protocol/deegree-protocol-csw/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core-protocol - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-wfs/pom.xml b/deegree-core/deegree-core-protocol/deegree-protocol-wfs/pom.xml index a49600e479..dc57cd1526 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-wfs/pom.xml +++ b/deegree-core/deegree-core-protocol/deegree-protocol-wfs/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core-protocol - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-wms/pom.xml b/deegree-core/deegree-core-protocol/deegree-protocol-wms/pom.xml index 0da739a83a..842cc7a858 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-wms/pom.xml +++ b/deegree-core/deegree-core-protocol/deegree-protocol-wms/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core-protocol - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/client/WMSClient.java b/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/client/WMSClient.java index 13016c700d..3a8b19e532 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/client/WMSClient.java +++ b/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/client/WMSClient.java @@ -76,15 +76,17 @@ import javax.imageio.ImageIO; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; import org.apache.axiom.om.OMElement; +import org.apache.commons.io.IOUtils; +import org.apache.http.entity.ContentType; import org.deegree.commons.concurrent.Executor; import org.deegree.commons.ows.exception.OWSException; import org.deegree.commons.proxy.ProxySettings; import org.deegree.commons.struct.Tree; import org.deegree.commons.tom.ows.Version; import org.deegree.commons.utils.Pair; +import org.deegree.commons.utils.TunableParameter; import org.deegree.commons.xml.XMLAdapter; import org.deegree.commons.xml.XmlHttpUtils; import org.deegree.coverage.raster.RasterTransformer; @@ -96,6 +98,7 @@ import org.deegree.cs.coordinatesystems.ICRS; import org.deegree.cs.persistence.CRSManager; import org.deegree.feature.FeatureCollection; +import org.deegree.featureinfo.parsing.DefaultFeatureInfoParser; import org.deegree.featureinfo.parsing.FeatureInfoParser; import org.deegree.geometry.Envelope; import org.deegree.geometry.GeometryFactory; @@ -118,12 +121,7 @@ * API-level client for accessing servers that implement the OpenGIS Web Map Service (WMS) 1.1.1/1.3.0 protocol. * - * TODO refactor to use {@link AbstractOWSClient#httpClient} - * * @author Andreas Schmitz - * @author last edited by: $Author: aschmitz $ - * - * @version $Revision: 31298 $, $Date: 2011-07-17 15:33:07 +0200 (Sun, 17 Jul 2011) $ */ public class WMSClient extends AbstractOWSClient { @@ -338,19 +336,42 @@ public Pair getMap( GetMap getMap, Map ha */ public FeatureCollection doGetFeatureInfo( GetFeatureInfo request, Map hardParams ) throws IOException, OWSExceptionReport, XMLStreamException { + return doGetFeatureInfo( request, hardParams, new DefaultFeatureInfoParser() ); + } + + /** + * Performs a GetFeatureInfo request and returns the response as a {@link FeatureCollection}. + * + * @param request + * request parameter, must not be null + * @param hardParams + * raw parameters for augmenting overriding KVPs, must not be null + * @param featureInfoParser + * used to parse the feature info response as feature collection, never null + * @return response parsed as feature collection, never null + * @throws IOException + * @throws OWSExceptionReport + * @throws XMLStreamException + */ + public FeatureCollection doGetFeatureInfo( GetFeatureInfo request, Map hardParams, + FeatureInfoParser featureInfoParser ) + throws IOException, OWSExceptionReport, + XMLStreamException { Map params = buildGetFeatureInfoParamMap( request, hardParams ); overrideHardParams( params, hardParams ); OwsHttpResponse response = null; + InputStream responseStream = null; try { URL url = getGetUrl( GetFeatureInfo.name() ); response = httpClient.doGet( url, params, null ); response.assertHttpStatus200(); - XMLStreamReader reader = response.getAsXMLStream(); + responseStream = response.getAsBinaryStream(); String csvLayerNames = join( ",", request.getQueryLayers() ); - return FeatureInfoParser.parseAsFeatureCollection( reader, csvLayerNames ); + return featureInfoParser.parseAsFeatureCollection( responseStream, csvLayerNames ); } finally { + IOUtils.closeQuietly( responseStream ); closeQuietly( response ); } } @@ -559,33 +580,10 @@ private Pair getMap( List layers, List getMap( List layers, List map, Pair res ) + throws Exception { + OwsHttpResponse response = null; + try { + LOG.trace( "Requesting from {}", url ); + response = httpClient.doGet( new URL( url ), map, null ); + response.assertHttpStatus200(); + ContentType responseContentType = ContentType.getLenient( response.getAsHttpResponse().getEntity() ); + String responseMimeType = responseContentType != null ? responseContentType.getMimeType() : null; + LOG.trace( "Content type is {}", responseMimeType ); + + if ( responseMimeType != null && responseMimeType.startsWith( format ) ) { + try (InputStream is = response.getAsBinaryStream()) { + res.first = IMAGE.work( is ); + } + } else if ( responseMimeType != null && responseMimeType.startsWith( "application/vnd.ogc.se_xml" ) ) { + try (InputStream is = response.getAsBinaryStream()) { + res.second = XmlHttpUtils.XML.work( is ).toString(); + } + } else { // try and find out the hard way + try (InputStream is = response.getAsBinaryStream()) { + res.first = IMAGE.work( is ); + } + if ( res.first == null ) { + closeQuietly( response ); + response = httpClient.doGet( new URL( url ), map, null ); + response.assertHttpStatus200(); + try (InputStream is = response.getAsBinaryStream()) { + res.second = XmlHttpUtils.XML.work( is ).toString(); + } + } + } + } finally { + closeQuietly( response ); + } + } + + private void doGetMapUrlConnection( String url, Map map, Pair res ) + throws Exception { + url += toQueryString( map ); + URL theUrl = new URL( url ); + LOG.debug( "Connecting to URL " + theUrl ); + URLConnection conn = ProxySettings.openURLConnection( theUrl, ProxySettings.getHttpProxyUser( true ), + ProxySettings.getHttpProxyPassword( true ), + httpBasicUser, httpBasicPass ); + conn.setConnectTimeout( connectionTimeout * 1000 ); + conn.setReadTimeout( requestTimeout * 1000 ); + conn.connect(); + LOG.debug( "Connected." ); + if ( LOG.isTraceEnabled() ) { + LOG.trace( "Requesting from " + theUrl ); + LOG.trace( "Content type is " + conn.getContentType() ); + LOG.trace( "Content encoding is " + conn.getContentEncoding() ); + } + if ( conn.getContentType() != null && conn.getContentType().startsWith( format ) ) { + res.first = IMAGE.work( conn.getInputStream() ); + } else if ( conn.getContentType() != null + && conn.getContentType().startsWith( "application/vnd.ogc.se_xml" ) ) { + res.second = XmlHttpUtils.XML.work( conn.getInputStream() ).toString(); + } else { // try and find out the hard way + res.first = IMAGE.work( conn.getInputStream() ); + if ( res.first == null ) { + conn = theUrl.openConnection(); + res.second = XmlHttpUtils.XML.work( conn.getInputStream() ).toString(); + } + } + } private BufferedImage createErrorImage( String error, int width, int height, int type ) { diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/GetFeatureInfo.java b/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/GetFeatureInfo.java index 278ab8e4ab..5926549266 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/GetFeatureInfo.java +++ b/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/GetFeatureInfo.java @@ -82,6 +82,8 @@ public class GetFeatureInfo extends RequestBase { private static final GeometryFactory fac = new GeometryFactory(); + private ICRS requestCrs; + private ICRS crs; private Envelope bbox; @@ -130,6 +132,7 @@ public GetFeatureInfo( List layers, int width, int height, int x, int y, this.x = x; this.y = y; this.bbox = envelope; + this.requestCrs = crs; this.crs = crs; this.featureCount = featureCount; scale = RenderHelper.calcScaleWMS130( width, height, bbox, crs, DEFAULT_PIXEL_SIZE ); @@ -146,6 +149,7 @@ public GetFeatureInfo( List layers, List styles, List map ) if ( c == null || c.trim().isEmpty() ) { throw new OWSException( "The SRS parameter is missing.", OWSException.MISSING_PARAMETER_VALUE ); } + requestCrs = CRSManager.getCRSRef( c ); crs = GetMap.getCRS111( c ); - bbox = fac.createEnvelope( new double[] { vals[0], vals[1] }, new double[] { vals[2], vals[3] }, crs ); String xs = map.get( "X" ); @@ -196,6 +200,7 @@ private void parse130( Map map ) throw new OWSException( "The CRS parameter is missing.", MISSING_PARAMETER_VALUE ); } + requestCrs = CRSManager.getCRSRef( requestedCrs ); bbox = GetMap.getCRSAndEnvelope130( requestedCrs, vals ); crs = bbox.getCoordinateSystem(); @@ -375,6 +380,13 @@ public ICRS getCoordinateSystem() { return crs; } + /** + * @return the requested coordinate system + */ + public ICRS getRequestCoordinateSystem() { + return requestCrs; + } + /** * @param crs */ diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/GetMap.java b/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/GetMap.java index b1f36c2b3d..7124a96320 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/GetMap.java +++ b/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/GetMap.java @@ -115,6 +115,8 @@ public class GetMap extends RequestBase { private ICRS crs; + private ICRS requestCrs; + private Envelope bbox; private String format; @@ -181,6 +183,7 @@ public GetMap( Collection layers, Collection styles, int wid this.width = width; this.height = height; this.bbox = boundingBox; + this.requestCrs = boundingBox.getCoordinateSystem(); this.crs = boundingBox.getCoordinateSystem(); this.bgcolor = white; format = "image/png"; @@ -204,6 +207,7 @@ public GetMap( List layers, int width, int height, Envelope envelope, IC this.width = width; this.height = height; this.bbox = envelope; + this.requestCrs = crs; this.crs = crs; this.format = format; this.transparent = transparent; @@ -217,6 +221,7 @@ public GetMap( List layers, List styles, int width, int heig this.width = width; this.height = height; this.bbox = envelope; + this.requestCrs = crs; this.crs = crs; this.format = format; this.transparent = transparent; @@ -248,6 +253,7 @@ public GetMap( List> layers, int width, int height, Envelop this.width = width; this.height = height; this.bbox = boundingBox; + this.requestCrs = boundingBox.getCoordinateSystem(); this.crs = boundingBox.getCoordinateSystem(); this.bgcolor = white; this.format = format; @@ -270,6 +276,7 @@ private void parse111( Map map, MapOptionsMaps exts ) if ( c == null || c.trim().isEmpty() ) { throw new OWSException( "The SRS parameter is missing.", OWSException.MISSING_PARAMETER_VALUE ); } + requestCrs = CRSManager.getCRSRef( c ); crs = getCRS111( c ); String box = map.get( "BBOX" ); @@ -644,7 +651,7 @@ private void parse130( Map map, MapOptionsMaps exts, boolean par throw new OWSException( "The maxy component of the BBOX was smaller that the miny component.", OWSException.INVALID_PARAMETER_VALUE ); } - + requestCrs = CRSManager.getCRSRef( c ); bbox = getCRSAndEnvelope130( c, vals ); crs = bbox.getCoordinateSystem(); @@ -658,6 +665,13 @@ public ICRS getCoordinateSystem() { return crs; } + /** + * @return the requested coordinate system + */ + public ICRS getRequestCoordinateSystem() { + return requestCrs; + } + /** * @return the bbox */ diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-wmts/pom.xml b/deegree-core/deegree-core-protocol/deegree-protocol-wmts/pom.xml index c1adf21fee..de2b0fa900 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-wmts/pom.xml +++ b/deegree-core/deegree-core-protocol/deegree-protocol-wmts/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core-protocol - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/main/java/org/deegree/protocol/wmts/client/GetFeatureInfoResponse.java b/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/main/java/org/deegree/protocol/wmts/client/GetFeatureInfoResponse.java index 2a13c73db1..3ba2431a4c 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/main/java/org/deegree/protocol/wmts/client/GetFeatureInfoResponse.java +++ b/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/main/java/org/deegree/protocol/wmts/client/GetFeatureInfoResponse.java @@ -41,13 +41,16 @@ Occam Labs UG (haftungsbeschränkt) ----------------------------------------------------------------------------*/ package org.deegree.protocol.wmts.client; +import static org.apache.commons.io.IOUtils.closeQuietly; + import java.io.IOException; +import java.io.InputStream; import javax.xml.stream.XMLStreamException; import org.deegree.commons.ows.exception.OWSException; import org.deegree.feature.FeatureCollection; -import org.deegree.featureinfo.parsing.FeatureInfoParser; +import org.deegree.featureinfo.parsing.DefaultFeatureInfoParser; import org.deegree.protocol.ows.exception.OWSExceptionReport; import org.deegree.protocol.ows.http.OwsHttpResponse; import org.deegree.protocol.wmts.ops.GetFeatureInfo; @@ -64,8 +67,10 @@ public class GetFeatureInfoResponse { private final OwsHttpResponse rawResponse; + private final DefaultFeatureInfoParser featureInfoParser = new DefaultFeatureInfoParser(); + private GetFeatureInfo request; - + GetFeatureInfoResponse( OwsHttpResponse rawResponse, GetFeatureInfo request ) { this.rawResponse = rawResponse; this.request = request; @@ -73,11 +78,14 @@ public class GetFeatureInfoResponse { public FeatureCollection getFeatures() throws OWSException, OWSExceptionReport { + InputStream featureInfo = rawResponse.getAsBinaryStream(); try { - return FeatureInfoParser.parseAsFeatureCollection( rawResponse.getAsXMLStream(), request.getLayer() ); + return featureInfoParser.parseAsFeatureCollection( featureInfo, request.getLayer() ); } catch ( XMLStreamException e ) { throw new OWSException( "Remote WMTS response was not recognized as feature collection: " + e.getLocalizedMessage(), e, OWSException.NO_APPLICABLE_CODE ); + } finally { + closeQuietly( featureInfo ); } } diff --git a/deegree-core/deegree-core-protocol/pom.xml b/deegree-core/deegree-core-protocol/pom.xml index 874085a290..702fb1e1d6 100644 --- a/deegree-core/deegree-core-protocol/pom.xml +++ b/deegree-core/deegree-core-protocol/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-commons/pom.xml b/deegree-core/deegree-core-remoteows/deegree-remoteows-commons/pom.xml index 7c4a4648e6..b4b50a428d 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-commons/pom.xml +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-commons/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core-remoteows - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/pom.xml b/deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/pom.xml index 66b75bacf1..3294c555a3 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/pom.xml +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core-remoteows - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/src/main/resources/META-INF/schemas/datasource/remoteows/wfs/3.4.0/example.xml b/deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/src/main/resources/META-INF/schemas/datasource/remoteows/wfs/example.xml similarity index 80% rename from deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/src/main/resources/META-INF/schemas/datasource/remoteows/wfs/3.4.0/example.xml rename to deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/src/main/resources/META-INF/schemas/datasource/remoteows/wfs/example.xml index 0736498e69..4f2c68edd8 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/src/main/resources/META-INF/schemas/datasource/remoteows/wfs/3.4.0/example.xml +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/src/main/resources/META-INF/schemas/datasource/remoteows/wfs/example.xml @@ -1,6 +1,6 @@ diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/src/main/resources/META-INF/schemas/datasource/remoteows/wfs/3.4.0/remotewfs.xsd b/deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/src/main/resources/META-INF/schemas/datasource/remoteows/wfs/remotewfs.xsd similarity index 79% rename from deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/src/main/resources/META-INF/schemas/datasource/remoteows/wfs/3.4.0/remotewfs.xsd rename to deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/src/main/resources/META-INF/schemas/datasource/remoteows/wfs/remotewfs.xsd index 66ea1b7d2d..a898ff85db 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/src/main/resources/META-INF/schemas/datasource/remoteows/wfs/3.4.0/remotewfs.xsd +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-wfs/src/main/resources/META-INF/schemas/datasource/remoteows/wfs/remotewfs.xsd @@ -23,14 +23,7 @@ - - - - - - - - + diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/pom.xml b/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/pom.xml index 97be8f9302..f5d3b101a8 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/pom.xml +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core-remoteows - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/java/org/deegree/remoteows/wms/RemoteWMSProvider.java b/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/java/org/deegree/remoteows/wms/RemoteWMSProvider.java index 669c52adbe..d85e90fc20 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/java/org/deegree/remoteows/wms/RemoteWMSProvider.java +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/java/org/deegree/remoteows/wms/RemoteWMSProvider.java @@ -54,7 +54,7 @@ */ public class RemoteWMSProvider extends RemoteOWSProvider { - private static final URL CONFIG_SCHEMA = RemoteWMSProvider.class.getResource( "/META-INF/schemas/remoteows/wms/3.4.0/remotewms.xsd" ); + private static final URL CONFIG_SCHEMA = RemoteWMSProvider.class.getResource( "/META-INF/schemas/remoteows/wms/remotewms.xsd" ); @Override public String getNamespace() { diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/datasource/remoteows/wms/3.4.0/example.xml b/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/datasource/remoteows/wms/example.xml similarity index 84% rename from deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/datasource/remoteows/wms/3.4.0/example.xml rename to deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/datasource/remoteows/wms/example.xml index 700d15c94c..6252d953a1 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/datasource/remoteows/wms/3.4.0/example.xml +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/datasource/remoteows/wms/example.xml @@ -1,5 +1,5 @@ - + image/png diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/datasource/remoteows/wms/3.4.0/remotewms.xsd b/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/datasource/remoteows/wms/remotewms.xsd similarity index 93% rename from deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/datasource/remoteows/wms/3.4.0/remotewms.xsd rename to deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/datasource/remoteows/wms/remotewms.xsd index de17373e52..d8ad556e56 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/datasource/remoteows/wms/3.4.0/remotewms.xsd +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/datasource/remoteows/wms/remotewms.xsd @@ -28,14 +28,7 @@ - - - - - - - - + diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/remoteows/wms/3.4.0/example.xml b/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/remoteows/wms/example.xml similarity index 82% rename from deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/remoteows/wms/3.4.0/example.xml rename to deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/remoteows/wms/example.xml index 9fa3434ddd..f7fe45c84b 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/remoteows/wms/3.4.0/example.xml +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/remoteows/wms/example.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.deegree.org/remoteows/wms http://schemas.deegree.org/3.5/remoteows/wms/remotewms.xsd" configVersion="3.4.0"> diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/remoteows/wms/3.4.0/remotewms.xsd b/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/remoteows/wms/remotewms.xsd similarity index 85% rename from deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/remoteows/wms/3.4.0/remotewms.xsd rename to deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/remoteows/wms/remotewms.xsd index 4a1ab9f691..8782b532a7 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/remoteows/wms/3.4.0/remotewms.xsd +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-wms/src/main/resources/META-INF/schemas/remoteows/wms/remotewms.xsd @@ -26,14 +26,7 @@ - - - - - - - - + diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/pom.xml b/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/pom.xml index 4fcc4f57fa..0fc53a01a8 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/pom.xml +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core-remoteows - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/java/org/deegree/remoteows/wmts/RemoteWMTSProvider.java b/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/java/org/deegree/remoteows/wmts/RemoteWMTSProvider.java index 6619fd4f02..4e93108208 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/java/org/deegree/remoteows/wmts/RemoteWMTSProvider.java +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/java/org/deegree/remoteows/wmts/RemoteWMTSProvider.java @@ -53,7 +53,7 @@ */ public class RemoteWMTSProvider extends RemoteOWSProvider { - private static final URL CONFIG_SCHEMA = RemoteWMTSProvider.class.getResource( "/META-INF/schemas/remoteows/wmts/3.4.0/remotewmts.xsd" ); + private static final URL CONFIG_SCHEMA = RemoteWMTSProvider.class.getResource( "/META-INF/schemas/remoteows/wmts/remotewmts.xsd" ); private static final String CONFIG_NAMESPACE = "http://www.deegree.org/remoteows/wmts"; diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/resources/META-INF/schemas/remoteows/wmts/3.4.0/example.xml b/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/resources/META-INF/schemas/remoteows/wmts/example.xml similarity index 86% rename from deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/resources/META-INF/schemas/remoteows/wmts/3.4.0/example.xml rename to deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/resources/META-INF/schemas/remoteows/wmts/example.xml index ba1f5eca94..4536d2a48f 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/resources/META-INF/schemas/remoteows/wmts/3.4.0/example.xml +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/resources/META-INF/schemas/remoteows/wmts/example.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://www.deegree.org/remoteows/wmts http://schemas.deegree.org/3.5/remoteows/wmts/remotewmts.xsd"> diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/resources/META-INF/schemas/remoteows/wmts/3.4.0/remotewmts.xsd b/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/resources/META-INF/schemas/remoteows/wmts/remotewmts.xsd similarity index 86% rename from deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/resources/META-INF/schemas/remoteows/wmts/3.4.0/remotewmts.xsd rename to deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/resources/META-INF/schemas/remoteows/wmts/remotewmts.xsd index 71b3663510..ac26d409a4 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/resources/META-INF/schemas/remoteows/wmts/3.4.0/remotewmts.xsd +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/main/resources/META-INF/schemas/remoteows/wmts/remotewmts.xsd @@ -26,14 +26,7 @@ - - - - - - - - + diff --git a/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/test/resources/org/deegree/remoteows/wmts/example.xml b/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/test/resources/org/deegree/remoteows/wmts/example.xml index 16adb97473..fd668e8e7f 100644 --- a/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/test/resources/org/deegree/remoteows/wmts/example.xml +++ b/deegree-core/deegree-core-remoteows/deegree-remoteows-wmts/src/test/resources/org/deegree/remoteows/wmts/example.xml @@ -1,4 +1,4 @@ + xsi:schemaLocation="http://www.deegree.org/remoteows/wmts http://schemas.deegree.org/3.5/remoteows/wmts/remotewmts.xsd"> diff --git a/deegree-core/deegree-core-remoteows/pom.xml b/deegree-core/deegree-core-remoteows/pom.xml index b0dc0a2011..6607d1b241 100644 --- a/deegree-core/deegree-core-remoteows/pom.xml +++ b/deegree-core/deegree-core-remoteows/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-rendering-2d/pom.xml b/deegree-core/deegree-core-rendering-2d/pom.xml index 15f99000ba..c1c8a4360e 100644 --- a/deegree-core/deegree-core-rendering-2d/pom.xml +++ b/deegree-core/deegree-core-rendering-2d/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/Copyright.java b/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/Copyright.java new file mode 100644 index 0000000000..cec7e64e1d --- /dev/null +++ b/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/Copyright.java @@ -0,0 +1,100 @@ +//$HeadURL$ +/*---------------------------------------------------------------------------- + This file is part of deegree, http://deegree.org/ + Copyright (C) 2001-2015 by: + - Department of Geography, University of Bonn - + and + - lat/lon GmbH - + + This library is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free + Software Foundation; either version 2.1 of the License, or (at your option) + any later version. + This library is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + details. + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact information: + + lat/lon GmbH + Aennchenstr. 19, 53177 Bonn + Germany + http://lat-lon.de/ + + Department of Geography, University of Bonn + Prof. Dr. Klaus Greve + Postfach 1147, 53001 Bonn + Germany + http://www.geographie.uni-bonn.de/deegree/ + + e-mail: info@deegree.org +----------------------------------------------------------------------------*/ +package org.deegree.rendering.r2d; + +import java.awt.image.BufferedImage; + +/** + * Encapsulates a copyright image or text. + * + * @author Lyn Goltz + */ +public class Copyright { + + private final String copyrightText; + + private final BufferedImage copyrightImage; + + private final int offsetX; + + private final int offsetY; + + /** + * @param copyrightText + * the text of the copyright, may be null if an copyrightImage is not + * @param copyrightImage + * the text of the copyright, may be null if an copyrightImage is not + * @param offsetX + * the offset to draw the copyright from the left of the image to the left of the copyright + * @param offsetY + * the offset to draw the copyright from the bottom of the image to the bottom of the copyright + */ + public Copyright( String copyrightText, BufferedImage copyrightImage, int offsetX, int offsetY ) { + this.copyrightText = copyrightText; + this.copyrightImage = copyrightImage; + this.offsetX = offsetX; + this.offsetY = offsetY; + } + + /** + * @return the text of the copyright, may be null if an copyrightImage is not + */ + public String getCopyrightText() { + return copyrightText; + } + + /** + * @return the text of the copyright, may be null if an copyrightImage is not + */ + public BufferedImage getCopyrightImage() { + return copyrightImage; + } + + /** + * @return the offset to draw the copyright from the left of the image to the left of the copyright + */ + public int getOffsetX() { + return offsetX; + } + + /** + * @return the offset to draw the copyright from the bottom of the image to the bottom of the copyright + */ + public int getOffsetY() { + return offsetY; + } + +} \ No newline at end of file diff --git a/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/Java2DRenderContext.java b/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/Java2DRenderContext.java index 294598f55f..07eb7f88ef 100644 --- a/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/Java2DRenderContext.java +++ b/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/Java2DRenderContext.java @@ -1,10 +1,14 @@ package org.deegree.rendering.r2d.context; +import java.awt.Color; +import java.awt.Font; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.IOException; import java.io.OutputStream; +import java.net.URL; +import org.deegree.rendering.r2d.Copyright; import org.deegree.rendering.r2d.Java2DLabelRenderer; import org.deegree.rendering.r2d.Java2DRasterRenderer; import org.deegree.rendering.r2d.Java2DRenderer; @@ -13,25 +17,25 @@ import org.deegree.rendering.r2d.labelplacement.AutoLabelPlacement; public abstract class Java2DRenderContext implements RenderContext { - + protected final Graphics2D graphics; - + protected final OutputStream outputStream; - + protected final Java2DRenderer renderer; protected final Java2DTextRenderer textRenderer; - + protected final Java2DLabelRenderer labelRenderer; protected final Java2DRasterRenderer rasterRenderer; protected final Java2DTileRenderer tileRenderer; - public Java2DRenderContext( RenderingInfo info, Graphics2D graphics, OutputStream outputStream ) { + public Java2DRenderContext( RenderingInfo info, Graphics2D graphics, OutputStream outputStream ) { this.graphics = graphics; this.outputStream = outputStream; - + renderer = new Java2DRenderer( graphics, info.getWidth(), info.getHeight(), info.getEnvelope(), info.getPixelSize() * 1000 ); textRenderer = new Java2DTextRenderer( renderer ); @@ -39,7 +43,7 @@ public Java2DRenderContext( RenderingInfo info, Graphics2D graphics, OutputStrea rasterRenderer = new Java2DRasterRenderer( graphics ); tileRenderer = new Java2DTileRenderer( graphics, info.getWidth(), info.getHeight(), info.getEnvelope() ); } - + @Override public Java2DRenderer getVectorRenderer() { return renderer; @@ -64,27 +68,59 @@ public Java2DRasterRenderer getRasterRenderer() { public Java2DTileRenderer getTileRenderer() { return tileRenderer; } - + @Override public void optimizeAndDrawLabels() { - //Optimize Label Placement here, if pointplacement set to auto=true - try{ - new AutoLabelPlacement(labelRenderer.getLabels(), renderer ); + // Optimize Label Placement here, if pointplacement set to auto=true + try { + new AutoLabelPlacement( labelRenderer.getLabels(), renderer ); } catch ( Throwable e ) { e.printStackTrace(); } - labelRenderer.render( ); + labelRenderer.render(); } - + @Override public void paintImage( BufferedImage img ) { graphics.drawImage( img, 0, 0, null ); } - + @Override - public boolean close() + public void paintCopyright( Copyright copyright, int mapHeight ) { + if ( copyright != null ) { + String copyrightText = copyright.getCopyrightText(); + BufferedImage copyrightImage = copyright.getCopyrightImage(); + int offsetX = copyright.getOffsetX(); + int offsetY = copyright.getOffsetY(); + if ( copyrightText != null ) { + drawCopyrightText( copyrightText, offsetX, offsetY, mapHeight ); + } else if ( copyrightImage != null ) { + drawCopyrightImage( copyrightImage, offsetX, offsetY, mapHeight ); + } + } + } + + @Override + public boolean close() throws IOException { graphics.dispose(); return true; } + + private void drawCopyrightText( String copyright, int offsetX, int offsetY, int mapHeight ) { + graphics.setFont( new Font( "SANSSERIF", Font.PLAIN, 14 ) ); + graphics.setColor( Color.BLACK ); + graphics.drawString( copyright, offsetX, mapHeight - offsetY + 2 ); + graphics.drawString( copyright, offsetX + 2, mapHeight - offsetY + 2 ); + graphics.drawString( copyright, offsetX, mapHeight - offsetY ); + graphics.drawString( copyright, offsetX + 2, mapHeight - offsetY ); + graphics.setColor( Color.WHITE ); + graphics.setFont( new Font( "SANSSERIF", Font.PLAIN, 14 ) ); + graphics.drawString( copyright, offsetX + 1, mapHeight - offsetY + 1 ); + } + + private void drawCopyrightImage( BufferedImage copyrightImage, int offsetX, int offsetY, int mapHeight ) { + int y = mapHeight - copyrightImage.getHeight() - offsetY; + graphics.drawImage( copyrightImage, offsetX, y, null ); + } } diff --git a/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/LazyImageRenderContext.java b/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/LazyImageRenderContext.java index 43ae1fdba9..3032619e9a 100644 --- a/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/LazyImageRenderContext.java +++ b/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/LazyImageRenderContext.java @@ -6,6 +6,7 @@ import java.io.IOException; import java.io.OutputStream; +import org.deegree.rendering.r2d.Copyright; import org.deegree.rendering.r2d.LabelRenderer; import org.deegree.rendering.r2d.RasterRenderer; import org.deegree.rendering.r2d.Renderer; @@ -98,6 +99,13 @@ public void paintImage( BufferedImage img ) { } } + @Override + public void paintCopyright( Copyright copyright, int mapHeight ) { + LOG.trace( "Paint copyright" ); + + getRenderContext().paintCopyright( copyright, mapHeight ); + } + @Override public boolean close() throws IOException { diff --git a/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/MapOptions.java b/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/MapOptions.java index e29d783a84..64e35386dc 100644 --- a/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/MapOptions.java +++ b/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/MapOptions.java @@ -54,6 +54,15 @@ public class MapOptions { private boolean opaque; + /** + * Instantiates {@link MapOptions} with default values (quality = null, interpol = null, antialias = null, + * maxFeatures = -1, featureInfoRadius = -1) + * + */ + public MapOptions() { + this( null, null, null, -1, -1 ); + } + public MapOptions( Quality quality, Interpolation interpol, Antialias antialias, int maxFeatures, int featureInfoRadius ) { this( quality, interpol, antialias, maxFeatures, featureInfoRadius, false ); @@ -169,8 +178,10 @@ public void setOpaque( boolean opaque ) { */ public static enum Quality { /***/ - LOW, /***/ - NORMAL, /***/ + LOW, + /***/ + NORMAL, + /***/ HIGH } @@ -184,9 +195,12 @@ public static enum Quality { */ public static enum Interpolation { /***/ - NEARESTNEIGHBOR, /***/ - NEARESTNEIGHBOUR, /***/ - BILINEAR, /***/ + NEARESTNEIGHBOR, + /***/ + NEARESTNEIGHBOUR, + /***/ + BILINEAR, + /***/ BICUBIC } @@ -200,9 +214,12 @@ public static enum Interpolation { */ public static enum Antialias { /***/ - IMAGE, /***/ - TEXT, /***/ - BOTH, /***/ + IMAGE, + /***/ + TEXT, + /***/ + BOTH, + /***/ NONE } @@ -267,4 +284,68 @@ public Interpolation getOption( String layer ) { } }; } + + public static class Builder { + + private Quality quality; + + private Interpolation interpolation; + + private Antialias antialias; + + private int maxFeatures; + + private int featureInfoRadius; + + /** + * @param quality + * the quality to set + */ + public Builder quality( Quality quality ) { + this.quality = quality; + return this; + } + + /** + * @param interpolation + * the interpolation to set + */ + public Builder interpolation( Interpolation interpolation ) { + this.interpolation = interpolation; + return this; + } + + /** + * @param antialias + * the antialias to set + */ + public Builder antialias( Antialias antialias ) { + this.antialias = antialias; + return this; + } + + /** + * @param maxFeatures + * the maxFeatures to set + */ + public Builder maxFeatures( int maxFeatures ) { + this.maxFeatures = maxFeatures; + return this; + } + + /** + * @param featureInfoRadius + * the featureInfoRadius to set, a value < 1 means default, 0 means disabled and > 0 for the radius + */ + public Builder featureInfoRadius( int featureInfoRadius ) { + this.featureInfoRadius = featureInfoRadius; + return this; + } + + public MapOptions build() { + return new MapOptions( quality, interpolation, antialias, maxFeatures, featureInfoRadius ); + } + + } + } diff --git a/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/MapOptionsMaps.java b/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/MapOptionsMaps.java index b60f3ddd89..89fc564e69 100644 --- a/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/MapOptionsMaps.java +++ b/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/MapOptionsMaps.java @@ -52,30 +52,28 @@ */ public class MapOptionsMaps { - private Map options; + private final Map options = new HashMap(); public MapOptionsMaps() { - options = new HashMap(); } public MapOptionsMaps( Map qualities, Map interpolations, Map antialiases, Map maxFeatures ) { - options = new HashMap(); for ( Entry e : qualities.entrySet() ) { - options.put( e.getKey(), new MapOptions( e.getValue(), null, null, -1, -1 ) ); + options.put( e.getKey(), new MapOptions.Builder().quality( e.getValue() ).build() ); } for ( Entry e : interpolations.entrySet() ) { if ( options.get( e.getKey() ) != null ) { options.get( e.getKey() ).setInterpolation( e.getValue() ); } else { - options.put( e.getKey(), new MapOptions( null, e.getValue(), null, -1, -1 ) ); + options.put( e.getKey(), new MapOptions.Builder().interpolation( e.getValue() ).build() ); } } for ( Entry e : antialiases.entrySet() ) { if ( options.get( e.getKey() ) != null ) { options.get( e.getKey() ).setAntialias( e.getValue() ); } else { - options.put( e.getKey(), new MapOptions( null, null, e.getValue(), -1, -1 ) ); + options.put( e.getKey(), new MapOptions.Builder().antialias( e.getValue() ).build() ); } } for ( Entry e : maxFeatures.entrySet() ) { @@ -110,7 +108,7 @@ public Interpolation getInterpolation( String layer ) { public void setMaxFeatures( String layer, int maxFeatures ) { if ( options.get( layer ) == null ) { - options.put( layer, new MapOptions( null, null, null, maxFeatures, -1 ) ); + options.put( layer, new MapOptions.Builder().maxFeatures( maxFeatures ).build() ); } else { options.get( layer ).setMaxFeatures( maxFeatures ); } @@ -118,7 +116,7 @@ public void setMaxFeatures( String layer, int maxFeatures ) { public void setFeatureInfoRadius( String layer, int radius ) { if ( options.get( layer ) == null ) { - options.put( layer, new MapOptions( null, null, null, -1, radius ) ); + options.put( layer, new MapOptions.Builder().featureInfoRadius( radius ).build() ); } else { options.get( layer ).setFeatureInfoRadius( radius ); } @@ -126,7 +124,7 @@ public void setFeatureInfoRadius( String layer, int radius ) { public void setQuality( String layer, Quality q ) { if ( options.get( layer ) == null ) { - options.put( layer, new MapOptions( q, null, null, -1, -1 ) ); + options.put( layer, new MapOptions.Builder().quality( q ).build() ); } else { options.get( layer ).setQuality( q ); } @@ -134,7 +132,7 @@ public void setQuality( String layer, Quality q ) { public void setInterpolation( String layer, Interpolation interpol ) { if ( options.get( layer ) == null ) { - options.put( layer, new MapOptions( null, interpol, null, -1, -1 ) ); + options.put( layer, new MapOptions.Builder().interpolation( interpol ).build() ); } else { options.get( layer ).setInterpolation( interpol ); } @@ -142,15 +140,19 @@ public void setInterpolation( String layer, Interpolation interpol ) { public void setAntialias( String layer, Antialias alias ) { if ( options.get( layer ) == null ) { - options.put( layer, new MapOptions( null, null, alias, -1, -1 ) ); + options.put( layer, new MapOptions.Builder().antialias( alias ).build() ); } else { options.get( layer ).setAntialias( alias ); } } public MapOptions get( String layer ) { - return new MapOptions( getQuality( layer ), getInterpolation( layer ), getAntialias( layer ), - getMaxFeatures( layer ), getFeatureInfoRadius( layer ) ); + return new MapOptions.Builder(). + quality( getQuality( layer ) ). + interpolation( getInterpolation( layer ) ). + antialias( getAntialias( layer ) ). + maxFeatures( getMaxFeatures( layer ) ). + featureInfoRadius( getFeatureInfoRadius( layer ) ).build(); } -} +} \ No newline at end of file diff --git a/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/RenderContext.java b/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/RenderContext.java index d3f9a36dad..1ee5fc53cc 100644 --- a/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/RenderContext.java +++ b/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/context/RenderContext.java @@ -41,6 +41,7 @@ import org.deegree.rendering.r2d.RasterRenderer; import org.deegree.rendering.r2d.Renderer; import org.deegree.rendering.r2d.TextRenderer; +import org.deegree.rendering.r2d.Copyright; import org.deegree.rendering.r2d.LabelRenderer; import org.deegree.rendering.r2d.TileRenderer; @@ -70,9 +71,11 @@ public interface RenderContext { void paintImage( BufferedImage img ); + void paintCopyright( Copyright copyright, int mapHeight ); + boolean close() throws IOException; void applyOptions( MapOptions options ); -} +} \ No newline at end of file diff --git a/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/legends/LegendBuilder.java b/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/legends/LegendBuilder.java index 6030084801..a6af4e3fe7 100644 --- a/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/legends/LegendBuilder.java +++ b/deegree-core/deegree-core-rendering-2d/src/main/java/org/deegree/rendering/r2d/legends/LegendBuilder.java @@ -42,6 +42,8 @@ Occam Labs UG (haftungsbeschränkt) package org.deegree.rendering.r2d.legends; import static java.lang.Math.max; +import static org.deegree.commons.utils.net.HttpUtils.IMAGE; +import static org.deegree.commons.utils.net.HttpUtils.get; import static org.slf4j.LoggerFactory.getLogger; import java.awt.Graphics2D; @@ -55,6 +57,7 @@ Occam Labs UG (haftungsbeschränkt) import javax.imageio.ImageIO; import org.deegree.commons.utils.Pair; +import org.deegree.commons.utils.net.HttpUtils; import org.deegree.geometry.Envelope; import org.deegree.geometry.GeometryFactory; import org.deegree.rendering.r2d.Java2DRasterRenderer; @@ -106,7 +109,7 @@ Pair getLegendSize( Style style ) { } if ( url != null ) { try { - BufferedImage legend = ImageIO.read( url ); + BufferedImage legend = get( IMAGE, url.toExternalForm(), null ); if ( legend != null ) { return new Pair( legend.getWidth(), legend.getHeight() ); } else { diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/pom.xml b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/pom.xml index c82a3571fd..b658b82694 100644 --- a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/pom.xml +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core-sqldialect - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/SQLDialect.java b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/SQLDialect.java index e5a43edeb5..68beb5927c 100644 --- a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/SQLDialect.java +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/SQLDialect.java @@ -125,13 +125,14 @@ public interface SQLDialect { * @param allowPartialMappings * if false, any unmappable expression will cause an {@link UnmappableException} to be * thrown + * @param defaultSortCriteria + * criteria to use for generating the ORDER-BY clause if the sort order is not specified by the query, may be null * @return where builder, never null * @throws UnmappableException * if allowPartialMappings is false and an expression could not be mapped to the db * @throws FilterEvaluationException */ - AbstractWhereBuilder getWhereBuilder( PropertyNameMapper mapper, OperatorFilter filter, SortProperty[] sortCrit, - boolean allowPartialMappings ) + AbstractWhereBuilder getWhereBuilder( PropertyNameMapper mapper, OperatorFilter filter, SortProperty[] sortCrit, List defaultSortCriteria, boolean allowPartialMappings ) throws UnmappableException, FilterEvaluationException; /** diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/SortCriterion.java b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/SortCriterion.java new file mode 100644 index 0000000000..a094acfa86 --- /dev/null +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/SortCriterion.java @@ -0,0 +1,25 @@ +package org.deegree.sqldialect; + +/** + * @author Lyn Goltz + */ +public class SortCriterion { + + private final String columneName; + + private final boolean sortAscending; + + public SortCriterion( String columneName, boolean sortAscending ) { + this.columneName = columneName; + this.sortAscending = sortAscending; + } + + public String getColumneName() { + return columneName; + } + + public boolean isSortAscending() { + return sortAscending; + } + +} \ No newline at end of file diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/filter/AbstractWhereBuilder.java b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/filter/AbstractWhereBuilder.java index 1f3e86384a..02ac319f80 100644 --- a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/filter/AbstractWhereBuilder.java +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/filter/AbstractWhereBuilder.java @@ -80,6 +80,7 @@ import org.deegree.filter.temporal.TemporalOperator; import org.deegree.geometry.Geometry; import org.deegree.sqldialect.SQLDialect; +import org.deegree.sqldialect.SortCriterion; import org.deegree.sqldialect.filter.expression.SQLArgument; import org.deegree.sqldialect.filter.expression.SQLColumn; import org.deegree.sqldialect.filter.expression.SQLExpression; @@ -140,6 +141,8 @@ public abstract class AbstractWhereBuilder { protected SortProperty[] postSortCrit; + private List defaultSortCriteria; + /** * Creates a new {@link AbstractWhereBuilder} instance. * @@ -151,15 +154,18 @@ public abstract class AbstractWhereBuilder { * Filter to use for generating the WHERE clause, can be null * @param sortCrit * criteria to use for generating the ORDER-BY clause, can be null + * @param defaultSortCriteria + * criteria to use for generating the ORDER-BY clause if the sort order is not specified by the query, may be null * @throws FilterEvaluationException * if the filter contains invalid {@link ValueReference}s */ protected AbstractWhereBuilder( SQLDialect dialect, PropertyNameMapper mapper, OperatorFilter filter, - SortProperty[] sortCrit ) throws FilterEvaluationException { + SortProperty[] sortCrit, List defaultSortCriteria ) throws FilterEvaluationException { this.dialect = dialect; this.mapper = mapper; this.filter = filter; this.sortCrit = sortCrit; + this.defaultSortCriteria = defaultSortCriteria; } /** @@ -220,6 +226,8 @@ protected void build( boolean allowPartialMappings ) LOG.error( e.getMessage(), e ); throw e; } + } else if ( defaultSortCriteria != null && !defaultSortCriteria.isEmpty() ) { + orderByClause = toProtoSQL( defaultSortCriteria ); } } @@ -870,7 +878,7 @@ protected SQLExpression toProtoSQL( Literal literal ) /** * Translates the given {@link ValueReference} into an {@link SQLExpression}. * - * @param expr + * @param propName * expression to be translated, must not be null * @return corresponding SQL expression, never null * @throws UnmappableException @@ -904,7 +912,7 @@ protected SQLExpression toProtoSQL( ValueReference propName ) /** * Translates the given spatial {@link ValueReference} into an {@link SQLExpression}. * - * @param expr + * @param propName * expression to be translated, must not be null * @return corresponding SQL expression, never null * @throws UnmappableException @@ -965,6 +973,26 @@ protected SQLExpression toProtoSQL( SortProperty[] sortCrits ) return builder.toOperation(); } + protected SQLExpression toProtoSQL( List sortCriteria ) + throws UnmappableException, FilterEvaluationException { + + SQLOperationBuilder builder = new SQLOperationBuilder(); + for ( SortCriterion sortCriterion : sortCriteria ) { + if ( sortCriteria.indexOf( sortCriterion ) > 0 ) { + builder.add( "," ); + } + String rootTableAlias = aliasManager.getRootTableAlias(); + String columnName = sortCriterion.getColumneName(); + builder.add( rootTableAlias == null ? columnName : ( rootTableAlias + "." + columnName ) ); + if ( sortCriterion.isSortAscending() ) { + builder.add( " ASC" ); + } else { + builder.add( " DESC" ); + } + } + return builder.toOperation(); + } + /** * Ensures that the given {@link SQLExpression} is not an {@link SQLExpression} that is multi-valued. * diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/filter/mssql/MSSQLWhereBuilder.java b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/filter/mssql/MSSQLWhereBuilder.java index 069cf502b0..bc56671a07 100644 --- a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/filter/mssql/MSSQLWhereBuilder.java +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/main/java/org/deegree/sqldialect/filter/mssql/MSSQLWhereBuilder.java @@ -63,6 +63,7 @@ import org.deegree.filter.spatial.Within; import org.deegree.geometry.Geometry; import org.deegree.sqldialect.SQLDialect; +import org.deegree.sqldialect.SortCriterion; import org.deegree.sqldialect.filter.AbstractWhereBuilder; import org.deegree.sqldialect.filter.PropertyNameMapper; import org.deegree.sqldialect.filter.UnmappableException; @@ -72,6 +73,8 @@ import org.deegree.sqldialect.filter.expression.SQLOperationBuilder; import org.deegree.sqldialect.filter.islike.IsLikeString; +import java.util.List; + /** * {@link AbstractWhereBuilder} implementation for Microsoft SQL Server databases. * @@ -93,6 +96,8 @@ public class MSSQLWhereBuilder extends AbstractWhereBuilder { * filter to use for generating the WHERE clause, can be null * @param sortCrit * criteria to use for generating the ORDER BY clause, can be null + * @param defaultSortCriteria + * criteria to use for generating the ORDER-BY clause if the sort order is not specified by the query, may be null * @param allowPartialMappings * if false, any unmappable expression will cause an {@link UnmappableException} to be thrown * @throws FilterEvaluationException @@ -101,9 +106,9 @@ public class MSSQLWhereBuilder extends AbstractWhereBuilder { * if allowPartialMappings is false and an expression could not be mapped to the db */ public MSSQLWhereBuilder( SQLDialect dialect, PropertyNameMapper mapper, OperatorFilter filter, - SortProperty[] sortCrit, boolean allowPartialMappings ) throws FilterEvaluationException, + SortProperty[] sortCrit, List defaultSortCriteria, boolean allowPartialMappings ) throws FilterEvaluationException, UnmappableException { - super( dialect, mapper, filter, sortCrit ); + super( dialect, mapper, filter, sortCrit, defaultSortCriteria ); build( allowPartialMappings ); } diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/test/java/org/deegree/sqldialect/filter/mssql/MSSQLWhereBuilderTest.java b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/test/java/org/deegree/sqldialect/filter/mssql/MSSQLWhereBuilderTest.java index b4d7f279a7..c423ffa069 100644 --- a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/test/java/org/deegree/sqldialect/filter/mssql/MSSQLWhereBuilderTest.java +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-commons/src/test/java/org/deegree/sqldialect/filter/mssql/MSSQLWhereBuilderTest.java @@ -89,7 +89,7 @@ public PropertyNameMapping getMapping( ValueReference propName, TableAliasManage OperatorFilter filter = null; SortProperty[] sortCrit = null; boolean allowPartialMappings = false; - whereBuilder = new MSSQLWhereBuilder( sqldialect, mapper, filter, sortCrit, allowPartialMappings ); + whereBuilder = new MSSQLWhereBuilder( sqldialect, mapper, filter, sortCrit, null, allowPartialMappings ); } @Test diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/pom.xml b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/pom.xml index e3825124cc..ae36ff4b3a 100644 --- a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/pom.xml +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core-sqldialect - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/src/main/java/org/deegree/sqldialect/mssql/MSSQLDialect.java b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/src/main/java/org/deegree/sqldialect/mssql/MSSQLDialect.java index fe1f29606a..4d28b42eb5 100644 --- a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/src/main/java/org/deegree/sqldialect/mssql/MSSQLDialect.java +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/src/main/java/org/deegree/sqldialect/mssql/MSSQLDialect.java @@ -57,6 +57,7 @@ import org.deegree.geometry.GeometryFactory; import org.deegree.geometry.utils.GeometryParticleConverter; import org.deegree.sqldialect.SQLDialect; +import org.deegree.sqldialect.SortCriterion; import org.deegree.sqldialect.filter.AbstractWhereBuilder; import org.deegree.sqldialect.filter.PropertyNameMapper; import org.deegree.sqldialect.filter.UnmappableException; @@ -115,9 +116,10 @@ public String geometryMetadata( TableName qTable, String column, boolean isGeogr @Override public AbstractWhereBuilder getWhereBuilder( PropertyNameMapper mapper, OperatorFilter filter, - SortProperty[] sortCrit, boolean allowPartialMappings ) + SortProperty[] sortCrit, List defaultSortCriteria, + boolean allowPartialMappings ) throws UnmappableException, FilterEvaluationException { - return new MSSQLWhereBuilder( this, mapper, filter, sortCrit, allowPartialMappings ); + return new MSSQLWhereBuilder( this, mapper, filter, sortCrit, defaultSortCriteria, allowPartialMappings ); } @Override diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-oracle/pom.xml b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-oracle/pom.xml index 1ddb0e0433..12123b67cb 100644 --- a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-oracle/pom.xml +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-oracle/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core-sqldialect - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-oracle/src/main/java/org/deegree/sqldialect/oracle/OracleDialect.java b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-oracle/src/main/java/org/deegree/sqldialect/oracle/OracleDialect.java index 4edbbbe820..0b74b5cd5c 100644 --- a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-oracle/src/main/java/org/deegree/sqldialect/oracle/OracleDialect.java +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-oracle/src/main/java/org/deegree/sqldialect/oracle/OracleDialect.java @@ -66,6 +66,7 @@ import org.deegree.geometry.GeometryFactory; import org.deegree.geometry.utils.GeometryParticleConverter; import org.deegree.sqldialect.SQLDialect; +import org.deegree.sqldialect.SortCriterion; import org.deegree.sqldialect.filter.AbstractWhereBuilder; import org.deegree.sqldialect.filter.PropertyNameMapper; import org.deegree.sqldialect.filter.UnmappableException; @@ -162,9 +163,9 @@ public String geometryMetadata( TableName qTable, String column, boolean isGeogr @Override public AbstractWhereBuilder getWhereBuilder( PropertyNameMapper mapper, OperatorFilter filter, - SortProperty[] sortCrit, boolean allowPartialMappings ) + SortProperty[] sortCrit, List defaultSortCriteria, boolean allowPartialMappings ) throws UnmappableException, FilterEvaluationException { - return new OracleWhereBuilder( this, mapper, filter, sortCrit, allowPartialMappings, versionMajor ); + return new OracleWhereBuilder( this, mapper, filter, sortCrit, defaultSortCriteria, allowPartialMappings, versionMajor ); } @Override diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-oracle/src/main/java/org/deegree/sqldialect/oracle/OracleWhereBuilder.java b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-oracle/src/main/java/org/deegree/sqldialect/oracle/OracleWhereBuilder.java index 89cbc3757d..97125ab8db 100644 --- a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-oracle/src/main/java/org/deegree/sqldialect/oracle/OracleWhereBuilder.java +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-oracle/src/main/java/org/deegree/sqldialect/oracle/OracleWhereBuilder.java @@ -68,6 +68,7 @@ import org.deegree.filter.spatial.Touches; import org.deegree.filter.spatial.Within; import org.deegree.geometry.Geometry; +import org.deegree.sqldialect.SortCriterion; import org.deegree.sqldialect.filter.AbstractWhereBuilder; import org.deegree.sqldialect.filter.PropertyNameMapper; import org.deegree.sqldialect.filter.UnmappableException; @@ -76,6 +77,8 @@ import org.deegree.sqldialect.filter.expression.SQLOperation; import org.deegree.sqldialect.filter.expression.SQLOperationBuilder; +import java.util.List; + /** * {@link AbstractWhereBuilder} implementation for Oracle Spatial databases. * @@ -96,12 +99,14 @@ class OracleWhereBuilder extends AbstractWhereBuilder { * * @param dialect * SQL dialect, must not be null - * @param mapping + * @param mapper * provides the mapping from {@link ValueReference}s to DB columns, must not be null * @param filter * Filter to use for generating the WHERE clause, can be null * @param sortCrit * criteria to use generating the ORDER BY clause, can be null + * @param defaultSortCriteria + * criteria to use for generating the ORDER-BY clause if the sort order is not specified by the query, may be null * @param allowPartialMappings * if false, any unmappable expression will cause an {@link UnmappableException} to be thrown * @throws FilterEvaluationException @@ -109,9 +114,9 @@ class OracleWhereBuilder extends AbstractWhereBuilder { * if allowPartialMappings is false and an expression could not be mapped to the db */ OracleWhereBuilder( OracleDialect dialect, PropertyNameMapper mapper, OperatorFilter filter, - SortProperty[] sortCrit, boolean allowPartialMappings, int databaseMajorVersion ) + SortProperty[] sortCrit, List defaultSortCriteria, boolean allowPartialMappings, int databaseMajorVersion ) throws FilterEvaluationException, UnmappableException { - super( dialect, mapper, filter, sortCrit ); + super( dialect, mapper, filter, sortCrit, defaultSortCriteria ); this.databaseMajorVersion = databaseMajorVersion; build( allowPartialMappings ); } diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/pom.xml b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/pom.xml index 74316b48b4..07f7c1823f 100644 --- a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/pom.xml +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core-sqldialect - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/src/main/java/org/deegree/sqldialect/postgis/PostGISDialect.java b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/src/main/java/org/deegree/sqldialect/postgis/PostGISDialect.java index bb58ef8d5e..9b5cd8c24c 100644 --- a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/src/main/java/org/deegree/sqldialect/postgis/PostGISDialect.java +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/src/main/java/org/deegree/sqldialect/postgis/PostGISDialect.java @@ -58,6 +58,7 @@ import org.deegree.geometry.utils.GeometryParticleConverter; import org.deegree.sqldialect.AbstractSQLDialect; import org.deegree.sqldialect.SQLDialect; +import org.deegree.sqldialect.SortCriterion; import org.deegree.sqldialect.filter.AbstractWhereBuilder; import org.deegree.sqldialect.filter.PropertyNameMapper; import org.deegree.sqldialect.filter.UnmappableException; @@ -173,9 +174,9 @@ public String geometryMetadata( TableName qTable, String column, boolean isGeogr @Override public AbstractWhereBuilder getWhereBuilder( PropertyNameMapper mapper, OperatorFilter filter, - SortProperty[] sortCrit, boolean allowPartialMappings ) + SortProperty[] sortCrit, List defaultSortCriteria, boolean allowPartialMappings ) throws UnmappableException, FilterEvaluationException { - return new PostGISWhereBuilder( this, mapper, filter, sortCrit, allowPartialMappings, useLegacyPredicates ); + return new PostGISWhereBuilder( this, mapper, filter, sortCrit, defaultSortCriteria, allowPartialMappings, useLegacyPredicates ); } @Override diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/src/main/java/org/deegree/sqldialect/postgis/PostGISWhereBuilder.java b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/src/main/java/org/deegree/sqldialect/postgis/PostGISWhereBuilder.java index dc99b8301d..f2efda5943 100644 --- a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/src/main/java/org/deegree/sqldialect/postgis/PostGISWhereBuilder.java +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/src/main/java/org/deegree/sqldialect/postgis/PostGISWhereBuilder.java @@ -73,6 +73,7 @@ import org.deegree.filter.spatial.Within; import org.deegree.filter.temporal.TemporalOperator; import org.deegree.geometry.Geometry; +import org.deegree.sqldialect.SortCriterion; import org.deegree.sqldialect.filter.AbstractWhereBuilder; import org.deegree.sqldialect.filter.PropertyNameMapper; import org.deegree.sqldialect.filter.UnmappableException; @@ -114,15 +115,18 @@ public class PostGISWhereBuilder extends AbstractWhereBuilder { * @param useLegacyPredicates * if true, legacy-style PostGIS spatial predicates are used (e.g. Intersects instead of * ST_Intersects) + * @param defaultSortCriterion + * criteria to use for generating the ORDER-BY clause if the sort order is not specified by the query, may be null * @throws FilterEvaluationException * if the expression contains invalid {@link ValueReference}s * @throws UnmappableException * if allowPartialMappings is false and an expression could not be mapped to the db */ public PostGISWhereBuilder( PostGISDialect dialect, PropertyNameMapper mapper, OperatorFilter filter, - SortProperty[] sortCrit, boolean allowPartialMappings, boolean useLegacyPredicates ) - throws FilterEvaluationException, UnmappableException { - super( dialect, mapper, filter, sortCrit ); + SortProperty[] sortCrit, List defaultSortCriterion, + boolean allowPartialMappings, boolean useLegacyPredicates ) + throws FilterEvaluationException, UnmappableException { + super( dialect, mapper, filter, sortCrit, defaultSortCriterion ); this.useLegacyPredicates = useLegacyPredicates; build( allowPartialMappings ); } @@ -133,7 +137,7 @@ public PostGISWhereBuilder( PostGISDialect dialect, PropertyNameMapper mapper, O * NOTE: This method appends the generated argument inline, i.e. not using a ?. This is because of a * problem that has been observed with PostgreSQL 8.0; the execution of the inline version is *much* faster. *

- * + * * @param op * comparison operator to be translated, must not be null * @return corresponding SQL expression, never null diff --git a/deegree-core/deegree-core-sqldialect/pom.xml b/deegree-core/deegree-core-sqldialect/pom.xml index 3c3ebf61da..9ba76ec1d4 100644 --- a/deegree-core/deegree-core-sqldialect/pom.xml +++ b/deegree-core/deegree-core-sqldialect/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT diff --git a/deegree-core/deegree-core-style/pom.xml b/deegree-core/deegree-core-style/pom.xml index 7350e95fa5..278471a8b5 100644 --- a/deegree-core/deegree-core-style/pom.xml +++ b/deegree-core/deegree-core-style/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.4.32-SNAPSHOT + 3.5.0-SNAPSHOT @@ -29,6 +29,12 @@ org.apache.xmlgraphics batik-bridge + + + commons-logging + commons-logging + + org.apache.xmlgraphics diff --git a/deegree-core/deegree-core-style/src/main/java/org/deegree/style/persistence/se/SEStyleStoreProvider.java b/deegree-core/deegree-core-style/src/main/java/org/deegree/style/persistence/se/SEStyleStoreProvider.java index 8d6c2d2950..541f042077 100644 --- a/deegree-core/deegree-core-style/src/main/java/org/deegree/style/persistence/se/SEStyleStoreProvider.java +++ b/deegree-core/deegree-core-style/src/main/java/org/deegree/style/persistence/se/SEStyleStoreProvider.java @@ -57,7 +57,7 @@ */ public class SEStyleStoreProvider extends StyleStoreProvider { - private static final URL CONFIG_SCHEMA = SEStyleStoreProvider.class.getResource( "/META-INF/schemas/se/3.4.0/symbology-1.1.0.xsd" ); + private static final URL CONFIG_SCHEMA = SEStyleStoreProvider.class.getResource( "/META-INF/schemas/se/symbology-1.1.0.xsd" ); @Override public String getNamespace() { diff --git a/deegree-core/deegree-core-style/src/main/java/org/deegree/style/se/unevaluated/Style.java b/deegree-core/deegree-core-style/src/main/java/org/deegree/style/se/unevaluated/Style.java index fa041c6c3e..2284f454ee 100644 --- a/deegree-core/deegree-core-style/src/main/java/org/deegree/style/se/unevaluated/Style.java +++ b/deegree-core/deegree-core-style/src/main/java/org/deegree/style/se/unevaluated/Style.java @@ -106,6 +106,8 @@ public class Style implements Copyable