diff --git a/deegree-client/deegree-jsf-console/pom.xml b/deegree-client/deegree-jsf-console/pom.xml index e48296d746..1b077ae1e1 100644 --- a/deegree-client/deegree-jsf-console/pom.xml +++ b/deegree-client/deegree-jsf-console/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-client - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-client/deegree-jsf-console/src/main/java/org/deegree/console/ConfigManager.java b/deegree-client/deegree-jsf-console/src/main/java/org/deegree/console/ConfigManager.java index c7a0c8cf14..0e2779223e 100644 --- a/deegree-client/deegree-jsf-console/src/main/java/org/deegree/console/ConfigManager.java +++ b/deegree-client/deegree-jsf-console/src/main/java/org/deegree/console/ConfigManager.java @@ -159,9 +159,12 @@ public List getProcessManagers() { public List getConnectionManagers() { return getResourceManagers( "connection" ); } - + public List getResourceManagers( String category ) { List rmMetadata = new ArrayList(); + if ( getServiceWorkspace() == null ) { + return rmMetadata; + } for ( ResourceManager mgr : getServiceWorkspace().getResourceManagers() ) { ResourceManagerMetadata2 md = ResourceManagerMetadata2.getMetadata( mgr ); if ( md != null && category.equals( md.getCategory() ) ) { diff --git a/deegree-client/deegree-jsf-console/src/main/java/org/deegree/console/WorkspaceBean.java b/deegree-client/deegree-jsf-console/src/main/java/org/deegree/console/WorkspaceBean.java index 312bb67830..de8e032ef2 100644 --- a/deegree-client/deegree-jsf-console/src/main/java/org/deegree/console/WorkspaceBean.java +++ b/deegree-client/deegree-jsf-console/src/main/java/org/deegree/console/WorkspaceBean.java @@ -93,12 +93,15 @@ public class WorkspaceBean implements Serializable { public static final String WS_UPLOAD_VIEW = "/console/workspace/upload"; - private static final String WS_DOWNLOAD_BASE_URL = "http://download.deegree.org/deegree3/workspaces/workspaces-"; + // private static final String WS_DOWNLOAD_BASE_URL = "http://download.deegree.org/deegree3/workspaces/workspaces-"; private static final String[] WS_DOWNLOAD_URLS = { "http://download.occamlabs.de/workspaces/occamlabs-workspaces" }; // only used when no build (Maven) module version information is available - private static final String DEFAULT_VERSION = "3.2-pre11-SNAPSHOT"; + private static final String DEFAULT_VERSION = "3.2-rc2"; + + private static final String[] WS_LIST = { "deegree-workspace-csw", "deegree-workspace-inspire", + "deegree-workspace-utah", "deegree-workspace-wps" }; private final HashMap workspaceLocations = new HashMap(); @@ -164,9 +167,9 @@ public static String getWsUploadView() { return WS_UPLOAD_VIEW; } - public static String getWsDownloadBaseUrl() { - return WS_DOWNLOAD_BASE_URL; - } + // public static String getWsDownloadBaseUrl() { + // return WS_DOWNLOAD_BASE_URL; + // } public static String[] getWsDownloadUrls() { return WS_DOWNLOAD_URLS; @@ -375,15 +378,20 @@ public List downloadWorkspaceList( String url ) { public List getRemoteWorkspaces() { workspaceLocations.clear(); - List list = downloadWorkspaceList( getDownloadBaseUrl() ); - for ( String url : WS_DOWNLOAD_URLS ) { - list.addAll( downloadWorkspaceList( url ) ); + List list = new ArrayList(); + for ( String wsArtifactName : WS_LIST ) { + addWorkspaceLocation( wsArtifactName, list ); } return list; } - private String getDownloadBaseUrl() { - return WS_DOWNLOAD_BASE_URL + getVersion(); + private void addWorkspaceLocation( String wsArtifactName, List list ) { + String repo = getVersion().endsWith( "SNAPSHOT" ) ? "snapshots" : "releases"; + String version = getVersion().endsWith( "SNAPSHOT" ) ? "LATEST" : getVersion(); + String url = "http://repo.deegree.org/service/local/artifact/maven/redirect?r=" + repo + "&g=org.deegree&a=" + + wsArtifactName + "&v=" + version + "&e=deegree-workspace"; + workspaceLocations.put( wsArtifactName, url ); + list.add( wsArtifactName ); } private String getVersion() { diff --git a/deegree-client/deegree-jsf-core/pom.xml b/deegree-client/deegree-jsf-core/pom.xml index 6839f93493..93ebfcf6e1 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-client/deegree-sos-webclient/pom.xml b/deegree-client/deegree-sos-webclient/pom.xml index 437911e316..b0c9c7a178 100644 --- a/deegree-client/deegree-sos-webclient/pom.xml +++ b/deegree-client/deegree-sos-webclient/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-client - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-client/deegree-wps-webclient/pom.xml b/deegree-client/deegree-wps-webclient/pom.xml index 3cb5cec5d1..dae563aafd 100644 --- a/deegree-client/deegree-wps-webclient/pom.xml +++ b/deegree-client/deegree-wps-webclient/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-client - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-client/deegree-wpsprinter-webclient/pom.xml b/deegree-client/deegree-wpsprinter-webclient/pom.xml index d5a082393b..e6ea9bb3c5 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-client/pom.xml b/deegree-client/pom.xml index 3f5ca04e7f..4ef9126b82 100644 --- a/deegree-client/pom.xml +++ b/deegree-client/pom.xml @@ -9,7 +9,7 @@ org.deegree deegree - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-3d/pom.xml b/deegree-core/deegree-core-3d/pom.xml index 3c45998849..fb91ab6e33 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-annotations/pom.xml b/deegree-core/deegree-core-annotations/pom.xml index a9b7d8ac6b..f1eaa05493 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-base/pom.xml b/deegree-core/deegree-core-base/pom.xml index b2ce2aabdc..c464269ce4 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-base/src/main/java/org/deegree/filter/spatial/Intersects.java b/deegree-core/deegree-core-base/src/main/java/org/deegree/filter/spatial/Intersects.java index fd0eb6c51a..067e0668a7 100644 --- a/deegree-core/deegree-core-base/src/main/java/org/deegree/filter/spatial/Intersects.java +++ b/deegree-core/deegree-core-base/src/main/java/org/deegree/filter/spatial/Intersects.java @@ -41,6 +41,7 @@ import org.deegree.filter.Expression; import org.deegree.filter.FilterEvaluationException; import org.deegree.filter.XPathEvaluator; +import org.deegree.geometry.Envelope; import org.deegree.geometry.Geometry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -86,8 +87,10 @@ public boolean evaluate( T obj, XPathEvaluator xpathEvaluator ) } else if ( obj instanceof Feature ) { // handle the case where the property name is empty Feature f = (Feature) obj; + boolean foundGeom = false; for ( Property prop : f.getProperties() ) { if ( prop.getValue() instanceof Geometry ) { + foundGeom = true; Geometry geom = (Geometry) prop.getValue(); Geometry transformedGeom = getCompatibleGeometry( geometry, geom ); if ( transformedGeom.intersects( geometry ) ) { @@ -95,6 +98,15 @@ public boolean evaluate( T obj, XPathEvaluator xpathEvaluator ) } } } + if ( !foundGeom ) { + Envelope env = f.getEnvelope(); + if ( env != null ) { + Geometry g = getCompatibleGeometry( geometry, env ); + if ( g.intersects( geometry ) ) { + return true; + } + } + } if ( f.getExtraProperties() != null ) { for ( Property prop : f.getExtraProperties().getProperties() ) { if ( prop.getValue() instanceof Geometry ) { diff --git a/deegree-core/deegree-core-commons/pom.xml b/deegree-core/deegree-core-commons/pom.xml index bc427798e9..33bb20cefa 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/jdbc/LayerDatabaseHelper.java b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/jdbc/LayerDatabaseHelper.java deleted file mode 100644 index 60bc7e677d..0000000000 --- a/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/jdbc/LayerDatabaseHelper.java +++ /dev/null @@ -1,178 +0,0 @@ -//$HeadURL$ -/*---------------------------------------------------------------------------- - This file is part of deegree, http://deegree.org/ - Copyright (C) 2001-2010 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.jdbc; - -import static org.deegree.commons.jdbc.ConnectionManager.getConnection; -import static org.slf4j.LoggerFactory.getLogger; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.slf4j.Logger; - -/** - * LayerDatabaseHelper - * - * @author Andreas Schmitz - * @author last edited by: $Author$ - * - * @version $Revision$, $Date$ - */ -public class LayerDatabaseHelper { - - private static final Logger LOG = getLogger( LayerDatabaseHelper.class ); - - /** - * @param layersConnId - * @param name - * @param title - * @param connId - * @param table - * @param crs - * @return true, if actually added - */ - public static boolean addLayer( String layersConnId, String name, String title, String connId, String table, - String crs ) { - Connection otherConn = null; - Connection conn = null; - PreparedStatement stmt = null; - ResultSet rs = null; - try { - otherConn = getConnection( connId ); - conn = getConnection( layersConnId ); - - String tableName = table; - String tableSchema = "public"; - if ( tableName.indexOf( "." ) != -1 ) { - tableSchema = table.substring( 0, table.indexOf( "." ) ); - tableName = table.substring( table.indexOf( "." ) + 1 ); - } - - rs = otherConn.getMetaData().getTables( null, tableSchema, tableName, new String[] { "TABLE" } ); - if ( !rs.next() ) { - LOG.info( "Table with name '{}' could not be found.", table ); - return false; - } - - stmt = conn.prepareStatement( "insert into layers (name, title, connectionid, sourcetable, crs) values (?, ?, ?, ?, ?)" ); - stmt.setString( 1, name ); - stmt.setString( 2, title == null ? name : title ); - stmt.setString( 3, connId ); - stmt.setString( 4, table ); - stmt.setString( 5, crs ); - stmt.executeUpdate(); - return true; - } catch ( SQLException e ) { - LOG.info( "A DB error occurred: '{}'.", e.getLocalizedMessage() ); - LOG.trace( "Stack trace:", e ); - return false; - } finally { - if ( rs != null ) { - try { - rs.close(); - } catch ( SQLException e ) { - LOG.info( "A DB error occurred: '{}'.", e.getLocalizedMessage() ); - LOG.trace( "Stack trace:", e ); - } - } - if ( stmt != null ) { - try { - stmt.close(); - } catch ( SQLException e ) { - LOG.info( "A DB error occurred: '{}'.", e.getLocalizedMessage() ); - LOG.trace( "Stack trace:", e ); - } - } - if ( conn != null ) { - try { - conn.close(); - } catch ( SQLException e ) { - LOG.info( "A DB error occurred: '{}'.", e.getLocalizedMessage() ); - LOG.trace( "Stack trace:", e ); - } - } - if ( otherConn != null ) { - try { - otherConn.close(); - } catch ( SQLException e ) { - LOG.info( "A DB error occurred: '{}'.", e.getLocalizedMessage() ); - LOG.trace( "Stack trace:", e ); - } - } - } - } - - /** - * @param layersConnId - * @param id - * @return true, if a layer was deleted - */ - public static boolean removeLayer( String layersConnId, int id ) { - Connection conn = null; - PreparedStatement stmt = null; - try { - conn = getConnection( layersConnId ); - - stmt = conn.prepareStatement( "delete from layers where id = ?" ); - stmt.setInt( 1, id ); - return stmt.executeUpdate() == 1; - } catch ( SQLException e ) { - LOG.info( "A DB error occurred: '{}'.", e.getLocalizedMessage() ); - LOG.trace( "Stack trace:", e ); - return false; - } finally { - if ( stmt != null ) { - try { - stmt.close(); - } catch ( SQLException e ) { - LOG.info( "A DB error occurred: '{}'.", e.getLocalizedMessage() ); - LOG.trace( "Stack trace:", e ); - } - } - if ( conn != null ) { - try { - conn.close(); - } catch ( SQLException e ) { - LOG.info( "A DB error occurred: '{}'.", e.getLocalizedMessage() ); - LOG.trace( "Stack trace:", e ); - } - } - } - } - -} diff --git a/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/utils/RequestUtils.java b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/utils/RequestUtils.java new file mode 100644 index 0000000000..6e0813adcf --- /dev/null +++ b/deegree-core/deegree-core-commons/src/main/java/org/deegree/commons/utils/RequestUtils.java @@ -0,0 +1,90 @@ +//$HeadURL$ +/*---------------------------------------------------------------------------- + This file is part of deegree, http://deegree.org/ + Copyright (C) 2001-2010 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/ + + Occam Labs UG (haftungsbeschränkt) + Godesberger Allee 139, 53175 Bonn + Germany + http://www.occamlabs.de/ + + e-mail: info@deegree.org + ----------------------------------------------------------------------------*/ + +package org.deegree.commons.utils; + +import java.util.Map; +import java.util.Map.Entry; + +/** + * Utility class to pass request parameters implicitly through the various layers. + * + * @author Andreas Schmitz + * @author last edited by: $Author: mschneider $ + * + * @version $Revision: 31882 $, $Date: 2011-09-15 02:05:04 +0200 (Thu, 15 Sep 2011) $ + */ +public class RequestUtils { + + private static transient final ThreadLocal> PARAMETERS = new ThreadLocal>(); + + /** + * This thread local can be used to store the current thread's request parameters. Use with caution, and clean up! + */ + public static ThreadLocal> getCurrentThreadRequestParameters() { + return PARAMETERS; + } + + /** + * Utility method that uppercases the original parameters, adds the default parameters in the map if missing, and + * replaces the parameters contained in the hards map. + */ + public static void replaceParameters( Map map, Map originals, + Map defaults, Map hards ) { + // handle default params + for ( String def : defaults.keySet() ) { + String key = def.toUpperCase(); + if ( originals.containsKey( key ) ) { + map.put( key, originals.get( key ) ); + } else { + map.put( def, defaults.get( def ) ); + } + } + // handle preset params + for ( Entry e : hards.entrySet() ) { + if ( map.containsKey( e.getKey().toLowerCase() ) ) { + map.put( e.getKey().toLowerCase(), e.getValue() ); + } else + map.put( e.getKey(), e.getValue() ); + } + } + +} diff --git a/deegree-core/deegree-core-coverage/pom.xml b/deegree-core/deegree-core-coverage/pom.xml index ee3cd89868..d6c1981558 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-cs/pom.xml b/deegree-core/deegree-core-cs/pom.xml index 838e358889..fdf3906270 100644 --- a/deegree-core/deegree-core-cs/pom.xml +++ b/deegree-core/deegree-core-cs/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-feature/pom.xml b/deegree-core/deegree-core-feature/pom.xml index fcd7256990..032bc6af99 100644 --- a/deegree-core/deegree-core-feature/pom.xml +++ b/deegree-core/deegree-core-feature/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-featureinfo/pom.xml b/deegree-core/deegree-core-featureinfo/pom.xml index 09e8b487f2..fb94a258af 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g b/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g index 22077eb1fa..059dac9f44 100644 --- a/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g +++ b/deegree-core/deegree-core-featureinfo/src/main/antlr3/org/deegree/featureinfo/templating/Templating2Lexer.g @@ -24,8 +24,12 @@ ExplicitTemplateEnd: ''; fragment Letter: { Character.isLetter( input.LA(1) ) }? .; fragment Digit: { Character.isDigit( input.LA(1) ) }? .; fragment WS: { Character.isWhitespace( input.LA(1) ) }? .; +fragment Point: '.'; +fragment Slash: '/'; -Url: (Letter+ '://' (ID | '/' | '.')+); +//fragment UrlText: ':' ~(Colon | TagClose | '\n')+; +//UrlWithPort: Url Colon Digit+ ~(Colon | TagClose | '\n')+ UrlText?; +Url: (ID Colon Slash Slash ~(TagClose)+); Equals: '='; Star: '*'; @@ -39,6 +43,6 @@ BracketLeft: '('; BracketRight: ')'; Kvp: '\n'* (~('=' | '<' | '>' | '?' | '/' | '\n'))+ '=' (~('\n'))+ '\n'*; -ID: (Letter | Digit | '_')+; +ID: (Letter | Digit | '_' | '-')+; Rest: ~('<')+; 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 490ded724c..b94b8de059 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 @@ -53,6 +53,9 @@ templatebodytext returns [String text]: | t = Kvp { $text = $t.text; } | t = Equals { $text = $t.text; } | t = Comma { $text = $t.text; } + | t = Slash { $text = $t.text; } + | t = Point { $text = $t.text; } + | t = Url { $text = $t.text; } | t = BracketLeft { $text = $t.text; } | t = BracketRight { $text = $t.text; } ; @@ -86,6 +89,7 @@ templateselector[List patterns] returns [Boolean negate]: templatepatterns[List patterns]: Star (WS* p = ID WS*)? (Comma templatepatterns[patterns])? { if($p != null) patterns.add("*" + $p.text); else patterns.add("*"); } + | (WS* p = ID WS*) Star (Comma templatepatterns[patterns])? { patterns.add($p.text + "*"); } | WS* p = ID WS* (Comma templatepatterns[patterns])? { patterns.add($p.text); } ; @@ -104,15 +108,20 @@ even returns [OddEven even]: EvenStart Colon n = ID TagClose { $even = new OddEven($n.text, false); }; link returns [Link link]: - LinkStart Colon pref = url text = (Colon ~(Colon | TagClose)+)? TagClose + LinkStart Colon pref = url TagClose { - if($text == null) $link = new Link(pref); - else $link = new Link(pref, $text.text); + if(pref.text == null) $link = new Link(pref.url); + else $link = new Link(pref.url, pref.text); } ; -url returns [String url]: - val = Url { $url = $val.text; }; +url returns [String url, String text]: + val = Url { + $url = $val.text; + $text = $url.substring($url.lastIndexOf(":") + 1); + $url = $url.substring(0, $url.lastIndexOf(":")); + if($text.trim().isEmpty()) $text = null; + }; index returns [Index index]: Index { $index = new Index(); }; diff --git a/deegree-core/deegree-core-featureinfo/src/test/java/org/deegree/featureinfo/templating/Templating2ParserTest.java b/deegree-core/deegree-core-featureinfo/src/test/java/org/deegree/featureinfo/templating/Templating2ParserTest.java index 2b62c5babc..bf9264a2ec 100644 --- a/deegree-core/deegree-core-featureinfo/src/test/java/org/deegree/featureinfo/templating/Templating2ParserTest.java +++ b/deegree-core/deegree-core-featureinfo/src/test/java/org/deegree/featureinfo/templating/Templating2ParserTest.java @@ -41,6 +41,8 @@ Occam Labs UG (haftungsbeschränkt) ----------------------------------------------------------------------------*/ package org.deegree.featureinfo.templating; +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.IOException; import java.util.Map; diff --git a/deegree-core/deegree-core-featureinfo/src/test/resources/org/deegree/featureinfo/templating/utahdemo.gfi b/deegree-core/deegree-core-featureinfo/src/test/resources/org/deegree/featureinfo/templating/utahdemo.gfi index 9235129bdd..82c9e6dfa8 100644 --- a/deegree-core/deegree-core-featureinfo/src/test/resources/org/deegree/featureinfo/templating/utahdemo.gfi +++ b/deegree-core/deegree-core-featureinfo/src/test/resources/org/deegree/featureinfo/templating/utahdemo.gfi @@ -3,6 +3,12 @@
    + + + + + +
diff --git a/deegree-core/deegree-core-filter/pom.xml b/deegree-core/deegree-core-filter/pom.xml index 27194065d3..87c3e87cd3 100644 --- a/deegree-core/deegree-core-filter/pom.xml +++ b/deegree-core/deegree-core-filter/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-filterfunctions/pom.xml b/deegree-core/deegree-core-filterfunctions/pom.xml index 554279f7cd..792b243f50 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-geometry/pom.xml b/deegree-core/deegree-core-geometry/pom.xml index c73702b414..d858ff9454 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-layer/pom.xml b/deegree-core/deegree-core-layer/pom.xml index 574c4077d1..1f79eb6495 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT 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 4c8f5b2611..a9d8cbbd4a 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 @@ -236,6 +236,9 @@ private void mergeSpatialMetadata( SpatialMetadata smd ) { * @param md */ public void merge( LayerMetadata md ) { + if ( md == null ) { + return; + } if ( description == null ) { description = md.getDescription(); } else { diff --git a/deegree-core/deegree-core-metadata/pom.xml b/deegree-core/deegree-core-metadata/pom.xml index cca3fdd78b..6b1a294e9c 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-observation/pom.xml b/deegree-core/deegree-core-observation/pom.xml index 39ab69014a..92a6d0b7ff 100644 --- a/deegree-core/deegree-core-observation/pom.xml +++ b/deegree-core/deegree-core-observation/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.2-pre16-SNAPSHOT + 3.3-pre1-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 0897323054..460b4903f3 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT 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 a63c8d64a3..7fc32d5248 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-sos/pom.xml b/deegree-core/deegree-core-protocol/deegree-protocol-sos/pom.xml index 334b0451c9..1fd51be144 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-sos/pom.xml +++ b/deegree-core/deegree-core-protocol/deegree-protocol-sos/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core-protocol - 3.2-pre16-SNAPSHOT + 3.3-pre1-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 78fd595f46..6812ec1f6d 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.2-pre16-SNAPSHOT + 3.3-pre1-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 5c7b1d9371..0950af0585 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.2-pre16-SNAPSHOT + 3.3-pre1-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 5e02fa2d7c..48c2cf50f9 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 @@ -901,6 +901,16 @@ public InputStream getMap( GetMap getMap ) } map.put( "format", getMap.getFormat() ); + if ( getMap.getOverriddenParameters() != null ) { + for ( Entry e : getMap.getOverriddenParameters().entrySet() ) { + if ( map.containsKey( e.getKey().toLowerCase() ) ) { + LOG.debug( "Overriding preset parameter {}.", e.getKey() ); + map.put( e.getKey().toLowerCase(), e.getValue() ); + } else + map.put( e.getKey(), e.getValue() ); + } + } + String url = getAddress( GetMap, true ); if ( url == null ) { LOG.warn( get( "WMSCLIENT.SERVER_NO_GETMAP_URL" ), "Capabilities: ", capaDoc ); 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 59c5020bee..0c510ff1f0 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 @@ -251,7 +251,7 @@ private double[] handleCommon( Map map ) this.styles = GetMap.handleKVPStyles( ss, layers.size() ); } else { // TODO think about whether STYLES has to be handled here as well - handleSLD( sld, sldBody, layers ); + handleSLD( sld, sldBody ); } ListIterator lays = this.layers.listIterator(); 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 a37eb5455e..27cb9b882a 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 @@ -130,6 +130,8 @@ public class GetMap extends RequestBase { private Map parameterMap = new HashMap(); + private Map overriddenParameters; + /** * @param map * @param version @@ -201,8 +203,9 @@ public GetMap( List layers, int width, int height, Envelope envelope, IC } public GetMap( List layers, List styles, int width, int height, Envelope envelope, ICRS crs, - String format, boolean transparent ) { + String format, boolean transparent, Map overriddenParameters ) { this( layers, width, height, envelope, crs, format, transparent ); + this.overriddenParameters = overriddenParameters; this.styles = map( styles, StyleRef.FROM_NAMES ); } @@ -330,7 +333,7 @@ private void handleCommon( Map map, MapOptionsMaps exts ) this.styles = handleKVPStyles( ss, layers.size() ); } else { // TODO think about whether STYLES has to be handled here as well - handleSLD( sld, sldBody, layers ); + handleSLD( sld, sldBody ); } String psize = map.get( "PIXELSIZE" ); @@ -739,4 +742,11 @@ public static Envelope getCRSAndEnvelope130( String crs, double[] bbox ) { return new GeometryFactory().createEnvelope( bbox[0], bbox[1], bbox[2], bbox[3], CRSManager.getCRSRef( crs ) ); } + /** + * @return null, or a map with parameters that should be overridden when used as client parameter object. + */ + public Map getOverriddenParameters() { + return overriddenParameters; + } + } diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/RequestBase.java b/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/RequestBase.java index eae2199ff2..5b471ec814 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/RequestBase.java +++ b/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/RequestBase.java @@ -35,7 +35,7 @@ ----------------------------------------------------------------------------*/ package org.deegree.protocol.wms.ops; -import static org.deegree.commons.utils.CollectionUtils.unzipPair; +import static org.deegree.commons.utils.CollectionUtils.unzip; import static org.deegree.protocol.wms.ops.SLDParser.parse; import static org.slf4j.LoggerFactory.getLogger; @@ -51,7 +51,7 @@ import javax.xml.stream.XMLInputFactory; import org.deegree.commons.ows.exception.OWSException; -import org.deegree.commons.utils.Pair; +import org.deegree.commons.utils.Triple; import org.deegree.filter.OperatorFilter; import org.deegree.layer.LayerRef; import org.deegree.style.StyleRef; @@ -69,8 +69,7 @@ public abstract class RequestBase { private static final Logger LOG = getLogger( RequestBase.class ); - // layer names may occur multiple times - private List> sldFilters = new ArrayList>(); + protected LinkedList filters = null; protected LinkedList layers = new LinkedList(); @@ -81,23 +80,19 @@ public abstract class RequestBase { public abstract double getScale(); public abstract List getLayers(); - - public void addSldFilter( String layerName, OperatorFilter filter ) { - sldFilters.add( new Pair( layerName, filter ) ); - } - - public List> getSldFilters() { - return sldFilters; + + public List getFilters() { + return filters; } - protected void handleSLD( String sld, String sldBody, LinkedList layers ) + protected void handleSLD( String sld, String sldBody ) throws OWSException { - layers = new LinkedList( layers ); + XMLInputFactory xmlfac = XMLInputFactory.newInstance(); - Pair, LinkedList> pair = null; + Triple, LinkedList, LinkedList> triple = null; if ( sld != null ) { try { - pair = parse( xmlfac.createXMLStreamReader( sld, new URL( sld ).openStream() ), this ); + triple = parse( xmlfac.createXMLStreamReader( sld, new URL( sld ).openStream() ), this ); } catch ( ParseException e ) { LOG.trace( "Stack trace:", e ); throw new OWSException( "The embedded dimension value in the SLD parameter value was invalid: " @@ -110,7 +105,7 @@ protected void handleSLD( String sld, String sldBody, LinkedList layer } if ( sldBody != null ) { try { - pair = parse( xmlfac.createXMLStreamReader( new StringReader( sldBody ) ), this ); + triple = parse( xmlfac.createXMLStreamReader( new StringReader( sldBody ) ), this ); } catch ( ParseException e ) { LOG.trace( "Stack trace:", e ); throw new OWSException( "The embedded dimension value in the SLD_BODY parameter value was invalid: " @@ -123,23 +118,26 @@ protected void handleSLD( String sld, String sldBody, LinkedList layer } // if layers are referenced, clear the other layers out, else leave all in - if ( pair != null && !layers.isEmpty() ) { + if ( triple != null && !layers.isEmpty() ) { // it might be in SLD that a layer has multiple styles, so we need to map to a list here - HashMap>> lays = new HashMap>>(); + HashMap>> lays = new HashMap>>(); - ListIterator it = pair.first.listIterator(); - ListIterator st = pair.second.listIterator(); + ListIterator it = triple.first.listIterator(); + ListIterator st = triple.second.listIterator(); + ListIterator ft = triple.third.listIterator(); while ( it.hasNext() ) { LayerRef lRef = it.next(); StyleRef sRef = st.next(); + OperatorFilter f = ft.next(); if ( !layers.contains( lRef ) ) { it.remove(); st.remove(); + ft.remove(); } else { String name = lRef.getName(); - LinkedList> list = lays.get( name ); + LinkedList> list = lays.get( name ); if ( list == null ) { - list = new LinkedList>(); + list = new LinkedList>(); lays.put( name, list ); } @@ -147,27 +145,33 @@ protected void handleSLD( String sld, String sldBody, LinkedList layer sRef = new StyleRef( "default" ); } - list.add( new Pair( lRef, sRef ) ); + list.add( new Triple( lRef, sRef, f ) ); } } this.layers.clear(); this.styles.clear(); + + this.filters = new LinkedList(); + // to get the order right, in case it's different from the SLD order for ( LayerRef lRef : layers ) { - LinkedList> l = lays.get( lRef.getName() ); + LinkedList> l = lays.get( lRef.getName() ); if ( l == null ) { throw new OWSException( "The SLD NamedLayer " + lRef.getName() + " is invalid.", "InvalidParameterValue", "layers" ); } - Pair, ArrayList> p = unzipPair( l ); - this.layers.addAll( p.first ); - styles.addAll( p.second ); + + Triple, ArrayList, ArrayList> t = unzip( l ); + this.layers.addAll( t.first ); + this.styles.addAll( t.second ); + this.filters.addAll( t.third ); } } else { - if ( pair != null ) { - this.layers = pair.first; - styles = pair.second; + if ( triple != null ) { + this.layers = triple.first; + this.styles = triple.second; + this.filters = triple.third; } } } diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/SLDParser.java b/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/SLDParser.java index 4f480f5bc8..be84af5731 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/SLDParser.java +++ b/deegree-core/deegree-core-protocol/deegree-protocol-wms/src/main/java/org/deegree/protocol/wms/ops/SLDParser.java @@ -37,6 +37,7 @@ import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; +import static org.deegree.commons.xml.CommonNamespaces.GMLNS; import static org.deegree.commons.xml.stax.XMLStreamUtils.skipElement; import static org.deegree.layer.dims.Dimension.parseTyped; import static org.deegree.protocol.wms.ops.GetMap.parseDimensionValues; @@ -53,9 +54,20 @@ import org.deegree.commons.annotations.LoggingNotes; import org.deegree.commons.ows.exception.OWSException; import org.deegree.commons.utils.Pair; +import org.deegree.commons.utils.Triple; +import org.deegree.commons.xml.NamespaceBindings; import org.deegree.filter.Filter; +import org.deegree.filter.IdFilter; import org.deegree.filter.OperatorFilter; +import org.deegree.filter.ResourceId; +import org.deegree.filter.Operator; +import org.deegree.filter.MatchAction; import org.deegree.filter.xml.Filter110XMLDecoder; +import org.deegree.filter.comparison.PropertyIsEqualTo; +import org.deegree.filter.expression.ValueReference; +import org.deegree.filter.expression.Literal; +import org.deegree.filter.logical.Or; +import org.deegree.commons.tom.primitive.PrimitiveValue; import org.deegree.layer.LayerRef; import org.deegree.style.StyleRef; import org.deegree.style.se.parser.SymbologyParser; @@ -85,7 +97,7 @@ public class SLDParser { * @throws OWSException * @throws ParseException */ - public static Pair, LinkedList> parse( XMLStreamReader in, RequestBase gm ) + public static Triple, LinkedList, LinkedList> parse( XMLStreamReader in, RequestBase gm ) throws XMLStreamException, OWSException, ParseException { while ( !in.isStartElement() || in.getLocalName() == null || !( in.getLocalName().equals( "NamedLayer" ) || in.getLocalName().equals( "UserLayer" ) ) ) { @@ -94,6 +106,7 @@ public static Pair, LinkedList> parse( XMLStreamR LinkedList layers = new LinkedList(); LinkedList styles = new LinkedList(); + LinkedList filters = new LinkedList(); while ( in.getLocalName().equals( "NamedLayer" ) || in.getLocalName().equals( "UserLayer" ) ) { if ( in.getLocalName().equals( "NamedLayer" ) ) { @@ -111,7 +124,7 @@ public static Pair, LinkedList> parse( XMLStreamR skipElement( in ); } - boolean foundFilter = false; + OperatorFilter operatorFilter = null; if ( in.getLocalName().equals( "LayerFeatureConstraints" ) ) { while ( !( in.isEndElement() && in.getLocalName().equals( "LayerFeatureConstraints" ) ) ) { @@ -127,9 +140,29 @@ public static Pair, LinkedList> parse( XMLStreamR } if ( in.getLocalName().equals( "Filter" ) ) { - OperatorFilter filter = (OperatorFilter) Filter110XMLDecoder.parse( in ); - gm.addSldFilter( layerName, filter ); - foundFilter = true; + Filter filter = Filter110XMLDecoder.parse( in ); + if( filter instanceof OperatorFilter ) { + operatorFilter = (OperatorFilter)filter; + } else if( filter instanceof IdFilter ) { + IdFilter idFilter = (IdFilter)filter; + List ids = idFilter.getSelectedIds(); + + NamespaceBindings nsContext = new NamespaceBindings(); + nsContext.addNamespace( "gml", GMLNS ); + ValueReference idReference = new ValueReference( "@gml:id", nsContext ); + + int idCount = ids.size(), i = 0; + Operator[] operators = new Operator[idCount]; + for( ResourceId id : ids ) { + operators[i++] = new PropertyIsEqualTo( idReference, new Literal( id.getRid() ), Boolean.TRUE, MatchAction.ONE ); + } + + if( idCount == 1) { + operatorFilter = new OperatorFilter( operators[0] ); + } else { + operatorFilter = new OperatorFilter( new Or( operators ) ); + } + } } if ( in.getLocalName().equals( "Extent" ) ) { @@ -157,18 +190,14 @@ public static Pair, LinkedList> parse( XMLStreamR } in.nextTag(); - } - - if ( !foundFilter ) { - // else having the same layer multiple times with and without filter won't work properly - gm.addSldFilter( layerName, null ); - } + } if ( in.getLocalName().equals( "NamedStyle" ) ) { in.nextTag(); String name = in.getElementText(); layers.add( new LayerRef( layerName ) ); styles.add( new StyleRef( name ) ); + filters.add( operatorFilter ); in.nextTag(); // out of name in.nextTag(); // out of named style @@ -210,6 +239,7 @@ public static Pair, LinkedList> parse( XMLStreamR Style style = SymbologyParser.INSTANCE.parseFeatureTypeOrCoverageStyle( in ); layers.add( new LayerRef( layerName ) ); styles.add( new StyleRef( style ) ); + filters.add( operatorFilter ); } } @@ -221,7 +251,7 @@ public static Pair, LinkedList> parse( XMLStreamR } } - return new Pair, LinkedList>( layers, styles ); + return new Triple, LinkedList, LinkedList>( layers, styles, filters ); } /** 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 d76a98ab49..707c1fade7 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/main/java/org/deegree/protocol/wmts/client/WMTSClient.java b/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/main/java/org/deegree/protocol/wmts/client/WMTSClient.java index 203b865ef9..77978fe6ec 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/main/java/org/deegree/protocol/wmts/client/WMTSClient.java +++ b/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/main/java/org/deegree/protocol/wmts/client/WMTSClient.java @@ -43,6 +43,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; @@ -181,6 +182,14 @@ private synchronized void initTileMatrixInformation() public GetTileResponse getTile( GetTile request ) throws IOException, OWSExceptionReport, XMLStreamException { Map kvp = buildGetTileKvpMap( request ); + if ( request.getOverriddenParameters() != null ) { + for ( Entry e : request.getOverriddenParameters().entrySet() ) { + if ( kvp.containsKey( e.getKey().toLowerCase() ) ) { + kvp.put( e.getKey().toLowerCase(), e.getValue() ); + } else + kvp.put( e.getKey(), e.getValue() ); + } + } URL endPoint = getGetUrl( WMTSConstants.WMTSRequestType.GetTile.name() ); OwsHttpResponse response = httpClient.doGet( endPoint, kvp, null ); response.assertHttpStatus200(); @@ -196,10 +205,10 @@ private Map buildGetTileKvpMap( GetTile request ) { kvp.put( "layer", request.getLayer() ); kvp.put( "style", request.getStyle() ); kvp.put( "format", request.getFormat() ); - kvp.put( "tileMatrixSet", request.getTileMatrixSet() ); - kvp.put( "tileMatrix", request.getTileMatrix() ); - kvp.put( "tileRow", "" + request.getTileRow() ); - kvp.put( "tileCol", "" + request.getTileCol() ); + kvp.put( "tilematrixset", request.getTileMatrixSet() ); + kvp.put( "tilematrix", request.getTileMatrix() ); + kvp.put( "tilerow", "" + request.getTileRow() ); + kvp.put( "tilecol", "" + request.getTileCol() ); return kvp; } @@ -218,4 +227,5 @@ protected WMTSCapabilitiesAdapter getCapabilitiesAdapter( OMElement root, String capaAdapter.setRootElement( root ); return capaAdapter; } + } diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/main/java/org/deegree/protocol/wmts/ops/GetTile.java b/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/main/java/org/deegree/protocol/wmts/ops/GetTile.java index 97898efc8d..25745a6a12 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/main/java/org/deegree/protocol/wmts/ops/GetTile.java +++ b/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/main/java/org/deegree/protocol/wmts/ops/GetTile.java @@ -72,6 +72,8 @@ public class GetTile { private final long tileCol; + private Map overriddenParameters; + /** * Creates a new {@link GetTile} instance. * @@ -90,7 +92,8 @@ public class GetTile { * @param y * index of the tile column */ - public GetTile( String layer, String style, String format, String tileMatrixSet, String tileMatrix, long x, long y ) { + public GetTile( String layer, String style, String format, String tileMatrixSet, String tileMatrix, long x, long y, + Map overriddenParameters ) { this.layer = layer; this.style = style; this.format = format; @@ -98,6 +101,7 @@ public GetTile( String layer, String style, String format, String tileMatrixSet, this.tileMatrix = tileMatrix; this.tileCol = x; this.tileRow = y; + this.overriddenParameters = overriddenParameters; } /** @@ -183,4 +187,12 @@ public long getTileRow() { public long getTileCol() { return tileCol; } + + /** + * @return null, or parameters to be overridden when used in client requests. + */ + public Map getOverriddenParameters() { + return overriddenParameters; + } + } diff --git a/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/test/java/org/deegree/protocol/wmts/client/WMTSClientTest.java b/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/test/java/org/deegree/protocol/wmts/client/WMTSClientTest.java index b007e5f4e6..e020c02574 100644 --- a/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/test/java/org/deegree/protocol/wmts/client/WMTSClientTest.java +++ b/deegree-core/deegree-core-protocol/deegree-protocol-wmts/src/test/java/org/deegree/protocol/wmts/client/WMTSClientTest.java @@ -149,6 +149,7 @@ public void testGetTileMatrixSetNotExists() } private GetTile buildExampleRequest() { - return new GetTile( "medford:hydro", "_null", "image/png", "EPSG:900913", "EPSG:900913:24", 6203400, 2660870 ); + return new GetTile( "medford:hydro", "_null", "image/png", "EPSG:900913", "EPSG:900913:24", 6203400, 2660870, + null ); } } diff --git a/deegree-core/deegree-core-protocol/pom.xml b/deegree-core/deegree-core-protocol/pom.xml index 28e4d352ca..d4ffd600c0 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.2-pre16-SNAPSHOT + 3.3-pre1-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 9efe7de104..90619597f6 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.2-pre16-SNAPSHOT + 3.3-pre1-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 24578aa97e..51c62571b3 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT 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 c589020568..ced0acc1d0 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT 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 4815fd51ac..e60fdeac0d 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-remoteows/pom.xml b/deegree-core/deegree-core-remoteows/pom.xml index fb9d878177..7a9fd4bfc6 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-rendering-2d/pom.xml b/deegree-core/deegree-core-rendering-2d/pom.xml index 51df07328c..30d01e9c7d 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT 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 56989da7c4..e1a74d2b2d 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/pom.xml b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/pom.xml new file mode 100644 index 0000000000..2d770dcb29 --- /dev/null +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + deegree-sqldialect-mssql + jar + SQL dialect for Microsoft SQL Server + + + rework + + + + org.deegree + deegree-core-sqldialect + 3.3-pre1-SNAPSHOT + + + + + deegree-repo + http://repo.deegree.org/content/groups/public + + never + + + true + + + + + + + mssql + + + deegree-restricted + deegree-restricted + http://repo.deegree.org/content/repositories/private3rdparty + + + + + com.microsoft + sqljdbc4 + 3.0 + + + + + + + + org.deegree + deegree-sqldialect-commons + ${project.version} + + + + + 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 new file mode 100644 index 0000000000..1be43e4986 --- /dev/null +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/src/main/java/org/deegree/sqldialect/mssql/MSSQLDialect.java @@ -0,0 +1,205 @@ +//$HeadURL: svn+ssh://goerke@criador:2222/srv/svn/deegree-intern/trunk/latlon-sqldialect-mssql/src/main/java/de/latlon/deegree/sqldialect/mssql/MSSQLDialect.java $ +/*---------------------------------------------------------------------------- + This file is part of deegree, http://deegree.org/ + Copyright (C) 2001-2013 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.sqldialect.mssql; + +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.List; + +import org.deegree.commons.jdbc.ConnectionManager.Type; +import org.deegree.commons.jdbc.SQLIdentifier; +import org.deegree.commons.jdbc.TableName; +import org.deegree.commons.tom.primitive.PrimitiveType; +import org.deegree.commons.tom.sql.DefaultPrimitiveConverter; +import org.deegree.commons.tom.sql.PrimitiveParticleConverter; +import org.deegree.commons.utils.JDBCUtils; +import org.deegree.cs.CRSUtils; +import org.deegree.cs.coordinatesystems.ICRS; +import org.deegree.filter.FilterEvaluationException; +import org.deegree.filter.OperatorFilter; +import org.deegree.filter.sort.SortProperty; +import org.deegree.geometry.Envelope; +import org.deegree.geometry.GeometryFactory; +import org.deegree.geometry.utils.GeometryParticleConverter; +import org.deegree.sqldialect.SQLDialect; +import org.deegree.sqldialect.filter.AbstractWhereBuilder; +import org.deegree.sqldialect.filter.PropertyNameMapper; +import org.deegree.sqldialect.filter.UnmappableException; +import org.deegree.sqldialect.filter.mssql.MSSQLGeometryConverter; +import org.deegree.sqldialect.filter.mssql.MSSQLWhereBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * {@link SQLDialect} for Microsoft SQL databases. + * + * @author Andreas Schmitz + * @author Markus Schneider + * @author last edited by: $Author: schneider $ + * + * @version $Revision: 417 $, $Date: 2011-11-02 11:09:47 +0100 (Mi, 02 Nov 2011) $ + */ +public class MSSQLDialect implements SQLDialect { + + private static Logger LOG = LoggerFactory.getLogger( MSSQLDialect.class ); + + @Override + public Type getDBType() { + return Type.MSSQL; + } + + @Override + public int getMaxColumnNameLength() { + return 128; + } + + @Override + public int getMaxTableNameLength() { + return 128; + } + + public String getDefaultSchema() { + return "dbo"; + } + + public String stringPlus() { + return "+"; + } + + public String stringIndex( String pattern, String string ) { + return "CHARINDEX(" + pattern + "," + string + ")"; + } + + public String cast( String expr, String type ) { + return "CAST(" + expr + " AS " + type + ")"; + } + + @Override + public String geometryMetadata( TableName qTable, String column, boolean isGeography ) { + // TODO no way to get more out of this "database"? + return "SELECT 2,-1,'GEOMETRY'"; + } + + @Override + public AbstractWhereBuilder getWhereBuilder( PropertyNameMapper mapper, OperatorFilter filter, + SortProperty[] sortCrit, boolean allowPartialMappings ) + throws UnmappableException, FilterEvaluationException { + return new MSSQLWhereBuilder( this, mapper, filter, sortCrit, allowPartialMappings ); + } + + @Override + public String getUndefinedSrid() { + return "0"; + } + + @Override + public String getBBoxAggregateSnippet( String colummn ) { + return "1"; + } + + @Override + public Envelope getBBoxAggregateValue( ResultSet rs, int colIdx, ICRS crs ) { + return new GeometryFactory().createEnvelope( -180, -90, 180, 90, CRSUtils.EPSG_4326 ); + } + + @Override + public GeometryParticleConverter getGeometryConverter( String column, ICRS crs, String srid, boolean is2d ) { + return new MSSQLGeometryConverter( column, crs, srid, is2d ); + } + + @Override + public PrimitiveParticleConverter getPrimitiveConverter( String column, PrimitiveType pt ) { + return new DefaultPrimitiveConverter( pt, column ); + } + + @Override + public void createDB( Connection adminConn, String dbName ) + throws SQLException { + + String sql = "CREATE DATABASE " + dbName; + + Statement stmt = null; + try { + stmt = adminConn.createStatement(); + stmt.executeUpdate( sql ); + } finally { + JDBCUtils.close( null, stmt, null, LOG ); + } + } + + @Override + public void dropDB( Connection adminConn, String dbName ) + throws SQLException { + + String sql = "DROP DATABASE " + dbName; + Statement stmt = null; + try { + stmt = adminConn.createStatement(); + stmt.executeUpdate( sql ); + } finally { + JDBCUtils.close( null, stmt, null, LOG ); + } + } + + @Override + public void createAutoColumn( StringBuffer currentStmt, List additionalSmts, SQLIdentifier column, + SQLIdentifier table ) { + currentStmt.append( column ); + currentStmt.append( " integer IDENTITY(1,1)" ); + } + + @Override + public ResultSet getTableColumnMetadata( DatabaseMetaData md, TableName qTable ) + throws SQLException { + String schema = qTable.getSchema() != null ? qTable.getSchema() : getDefaultSchema(); + String table = qTable.getTable(); + return md.getColumns( null, schema.toLowerCase(), table.toLowerCase(), null ); + } + + @Override + public boolean requiresTransactionForCursorMode() { + return false; + } + + @Override + public String getSelectSequenceNextVal( String sequence ) { + throw new UnsupportedOperationException( + "Using DB sequences for FIDs is currently not supported on Microsoft SQL Server." ); + } +} diff --git a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/WMSIOProvider.java b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/src/main/java/org/deegree/sqldialect/mssql/MSSQLDialectProvider.java similarity index 53% rename from deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/WMSIOProvider.java rename to deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/src/main/java/org/deegree/sqldialect/mssql/MSSQLDialectProvider.java index e0f96d290c..dfcb378d93 100644 --- a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/WMSIOProvider.java +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/src/main/java/org/deegree/sqldialect/mssql/MSSQLDialectProvider.java @@ -1,7 +1,7 @@ -//$HeadURL$ +//$HeadURL: svn+ssh://goerke@criador:2222/srv/svn/deegree-intern/trunk/latlon-sqldialect-mssql/src/main/java/de/latlon/deegree/sqldialect/mssql/MSSQLDialectProvider.java $ /*---------------------------------------------------------------------------- This file is part of deegree, http://deegree.org/ - Copyright (C) 2001-2010 by: + Copyright (C) 2001-2013 by: - Department of Geography, University of Bonn - and - lat/lon GmbH - @@ -33,48 +33,33 @@ e-mail: info@deegree.org ----------------------------------------------------------------------------*/ -package org.deegree.coverage.persistence.remotewms; +package org.deegree.sqldialect.mssql; -import java.util.HashSet; -import java.util.Set; +import static org.deegree.commons.jdbc.ConnectionManager.Type.MSSQL; -import org.deegree.coverage.raster.io.RasterIOProvider; -import org.deegree.coverage.raster.io.RasterReader; -import org.deegree.coverage.raster.io.RasterWriter; +import org.deegree.commons.config.DeegreeWorkspace; +import org.deegree.commons.config.ResourceInitException; +import org.deegree.commons.jdbc.ConnectionManager.Type; +import org.deegree.sqldialect.SQLDialect; +import org.deegree.sqldialect.SQLDialectProvider; /** - * Supplies the information needed to create WMS based coverage + * {@link SQLDialectProvider} for Microsoft SQL databases. * - * @author Rutger Bezema - * @author last edited by: $Author$ + * @author Andreas Schmitz + * @author last edited by: $Author: schneider $ * - * @version $Revision$, $Date$ + * @version $Revision: 295 $, $Date: 2011-06-09 16:48:47 +0200 (Do, 09 Jun 2011) $ */ -public class WMSIOProvider implements RasterIOProvider { +public class MSSQLDialectProvider implements SQLDialectProvider { - @Override - public RasterReader getRasterReader( String type ) { - for ( String s : WMSReader.supportedFormats ) { - if ( s.equalsIgnoreCase( type ) ) { - return new WMSReader(); - } - } - return null; - } - - @Override - public Set getRasterReaderFormats() { - return new HashSet( WMSReader.supportedFormats ); + public Type getSupportedType() { + return MSSQL; } @Override - public RasterWriter getRasterWriter( String type ) { - return null; + public SQLDialect create( String connId, DeegreeWorkspace ws ) + throws ResourceInitException { + return new MSSQLDialect(); } - - @Override - public Set getRasterWriterFormats() { - return null; - } - } diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/src/main/resources/META-INF/services/org.deegree.sqldialect.SQLDialectProvider b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/src/main/resources/META-INF/services/org.deegree.sqldialect.SQLDialectProvider new file mode 100644 index 0000000000..c557dcff30 --- /dev/null +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-mssql/src/main/resources/META-INF/services/org.deegree.sqldialect.SQLDialectProvider @@ -0,0 +1 @@ +org.deegree.sqldialect.mssql.MSSQLDialectProvider \ No newline at end of file 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 a9c19ad0d4..fe6d6800c7 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT @@ -39,7 +39,6 @@ - com.oracle ojdbc6 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 85b2608289..7f08a6e134 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-sqldialect/pom.xml b/deegree-core/deegree-core-sqldialect/pom.xml index adf81f0b92..ddac69d73f 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT @@ -30,13 +30,12 @@ deegree-sqldialect-oracle - - - deegree-restricted - deegree-restricted - http://repo.deegree.org/content/repositories/private3rdparty - - + + + mssql + + deegree-sqldialect-mssql + diff --git a/deegree-core/deegree-core-style/pom.xml b/deegree-core/deegree-core-style/pom.xml index 00abfd67fc..2b4dcdf092 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.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-theme/pom.xml b/deegree-core/deegree-core-theme/pom.xml index 1906728088..92146b3194 100644 --- a/deegree-core/deegree-core-theme/pom.xml +++ b/deegree-core/deegree-core-theme/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-tile/pom.xml b/deegree-core/deegree-core-tile/pom.xml index 5bcb7d2241..26122be193 100644 --- a/deegree-core/deegree-core-tile/pom.xml +++ b/deegree-core/deegree-core-tile/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/deegree-core-time/pom.xml b/deegree-core/deegree-core-time/pom.xml index 5e9a4c377e..7037b6e4c6 100644 --- a/deegree-core/deegree-core-time/pom.xml +++ b/deegree-core/deegree-core-time/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-core - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-core/pom.xml b/deegree-core/pom.xml index 44b3625f0b..aaadae6727 100644 --- a/deegree-core/pom.xml +++ b/deegree-core/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/pom.xml b/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/pom.xml deleted file mode 100644 index e44df730ea..0000000000 --- a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - 4.0.0 - deegree-coveragestore-remotewms - jar - deegree-coveragestore-remotewms - Coverage store implementation that accesses remote Web Map Services - - - check - - - - org.deegree - deegree-coveragestores - 3.2-pre16-SNAPSHOT - - - - - deegree-repo - http://repo.deegree.org/content/groups/public - - never - - - true - - - - - - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - - - - - - - org.deegree - deegree-core-coverage - ${project.version} - - - org.deegree - deegree-protocol-wms - ${project.version} - - - - - diff --git a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/GetFeatureInfo.java b/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/GetFeatureInfo.java deleted file mode 100644 index 61bb488bef..0000000000 --- a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/GetFeatureInfo.java +++ /dev/null @@ -1,48 +0,0 @@ -//$HeadURL$ -/*---------------------------------------------------------------------------- - This file is part of deegree, http://deegree.org/ - Copyright (C) 2001-2010 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.coverage.persistence.remotewms; - -/** - * TODO add class documentation here - * - * @author Rutger Bezema - * @author last edited by: $Author$ - * - * @version $Revision$, $Date$ - */ -public class GetFeatureInfo { - // some information, currently not known. -} diff --git a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/WMSBuilder.java b/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/WMSBuilder.java deleted file mode 100644 index 5bd980a837..0000000000 --- a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/WMSBuilder.java +++ /dev/null @@ -1,257 +0,0 @@ -//$HeadURL$ -/*---------------------------------------------------------------------------- - This file is part of deegree, http://deegree.org/ - Copyright (C) 2001-2010 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.coverage.persistence.remotewms; - -import static org.deegree.coverage.persistence.remotewms.WMSReader.RIO_WMS_DEFAULT_FORMAT; -import static org.deegree.coverage.persistence.remotewms.WMSReader.RIO_WMS_ENABLE_TRANSPARENT; -import static org.deegree.coverage.persistence.remotewms.WMSReader.RIO_WMS_LAYERS; -import static org.deegree.coverage.persistence.remotewms.WMSReader.RIO_WMS_MAX_HEIGHT; -import static org.deegree.coverage.persistence.remotewms.WMSReader.RIO_WMS_MAX_SCALE; -import static org.deegree.coverage.persistence.remotewms.WMSReader.RIO_WMS_MAX_WIDTH; -import static org.deegree.coverage.persistence.remotewms.WMSReader.RIO_WMS_REFRESH_TIME; -import static org.deegree.coverage.persistence.remotewms.WMSReader.RIO_WMS_SYS_ID; -import static org.deegree.coverage.persistence.remotewms.WMSReader.RIO_WMS_TIMEOUT; -import static org.slf4j.LoggerFactory.getLogger; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.net.URLConnection; - -import org.deegree.commons.config.DeegreeWorkspace; -import org.deegree.commons.config.ResourceInitException; -import org.deegree.commons.config.ResourceManager; -import org.deegree.commons.utils.ProxyUtils; -import org.deegree.commons.xml.jaxb.JAXBUtils; -import org.deegree.coverage.Coverage; -import org.deegree.coverage.persistence.CoverageBuilder; -import org.deegree.coverage.raster.AbstractRaster; -import org.deegree.coverage.raster.MultiResolutionRaster; -import org.deegree.coverage.raster.io.RasterIOOptions; -import org.deegree.coverage.raster.utils.RasterFactory; -import org.deegree.cs.coordinatesystems.ICRS; -import org.deegree.cs.persistence.CRSManager; -import org.deegree.protocol.wms.raster.jaxb.MultiResolutionRasterConfig; -import org.deegree.protocol.wms.raster.jaxb.MultiResolutionRasterConfig.Resolution; -import org.deegree.protocol.wms.raster.jaxb.WMSDataSourceType; -import org.deegree.protocol.wms.raster.jaxb.WMSDataSourceType.CapabilitiesDocumentLocation; -import org.deegree.protocol.wms.raster.jaxb.WMSDataSourceType.MaxMapDimensions; -import org.deegree.protocol.wms.raster.jaxb.WMSDataSourceType.RequestedFormat; -import org.slf4j.Logger; - -/** - * Builds a wms backed coverage - * - * @author Rutger Bezema - * @author last edited by: $Author$ - * - * @version $Revision$, $Date$ - */ -public class WMSBuilder implements CoverageBuilder { - - private static final String CONFIG_NS = "http://www.deegree.org/datasource/coverage/wms"; - - private static final String CONFIG_JAXB_PACKAGE = "org.deegree.protocol.wms.raster.jaxb"; - - private static final URL CONFIG_SCHEMA = WMSBuilder.class.getResource( "/META-INF/schemas/datasource/coverage/wms/3.0.0/wms.xsd" ); - - private static final Logger LOG = getLogger( WMSBuilder.class ); - - private DeegreeWorkspace workspace; - - @Override - public String getConfigNamespace() { - return CONFIG_NS; - } - - /** - * @param mrrConfig - * @param adapter - * @return a corresponding raster - */ - private static MultiResolutionRaster fromJAXB( MultiResolutionRasterConfig mrrConfig ) { - if ( mrrConfig != null ) { - String defCRS = mrrConfig.getDefaultSRS(); - // String defCRS = null; - ICRS crs = null; - if ( defCRS != null ) { - crs = CRSManager.getCRSRef( defCRS ); - } - RasterIOOptions options = getOptions( mrrConfig ); - - MultiResolutionRaster mrr = new MultiResolutionRaster(); - mrr.setCoordinateSystem( crs ); - for ( Resolution resolution : mrrConfig.getResolution() ) { - if ( resolution != null ) { - AbstractRaster rasterLevel = null; - try { - options.add( RIO_WMS_MAX_SCALE, resolution.getRes() == null ? null - : resolution.getRes().toString() ); - rasterLevel = fromJAXB( resolution, options ); - } catch ( IOException e ) { - if ( LOG.isDebugEnabled() ) { - LOG.debug( "(Stack) Exception occurred while creating a resolution wms datasource: " - + e.getLocalizedMessage(), e ); - } else { - LOG.error( "Exception occurred while creating a resolution wms datasource: " - + e.getLocalizedMessage() ); - } - } - if ( rasterLevel != null ) { - mrr.addRaster( rasterLevel ); - } - } - } - return mrr; - } - throw new NullPointerException( "The configured multi resolution raster may not be null." ); - } - - private static RasterIOOptions getOptions( MultiResolutionRasterConfig config ) { - RasterIOOptions options = new RasterIOOptions(); - if ( config.getDefaultSRS() != null ) { - options.add( RasterIOOptions.CRS, config.getDefaultSRS() ); - } - return options; - } - - /** - * @param config - * @return a corresponding raster, null if files could not be fund - * @throws IOException - */ - private static AbstractRaster fromJAXB( WMSDataSourceType config, RasterIOOptions opts ) - throws IOException { - if ( config != null ) { - - CapabilitiesDocumentLocation capDoc = config.getCapabilitiesDocumentLocation(); - RasterIOOptions options = new RasterIOOptions(); - options.copyOf( opts ); - - options.add( RIO_WMS_SYS_ID, capDoc.getLocation() ); - // refresh time is not supported - options.add( RIO_WMS_REFRESH_TIME, Integer.toString( capDoc.getRefreshTime() ) ); - - MaxMapDimensions maxMapDimensions = config.getMaxMapDimensions(); - String width = "-1"; - String height = "-1"; - if ( maxMapDimensions != null ) { - width = maxMapDimensions.getWidth() == null ? "-1" : maxMapDimensions.getWidth().toString(); - height = maxMapDimensions.getHeight() == null ? "-1" : maxMapDimensions.getWidth().toString(); - } - /** Defines the maximum width of a GetMap request. */ - options.add( RIO_WMS_MAX_WIDTH, width ); - /** Defines the maximum height of a GetMap request. */ - options.add( RIO_WMS_MAX_HEIGHT, height ); - - /** Defines the maximum height of a GetMap request. */ - options.add( RIO_WMS_LAYERS, config.getRequestedLayers() ); - - /** Defines the maximum scale of a WMS. */ - String maxScale = config.getMaxScale() == null ? "1" : config.getMaxScale().toString(); - if ( options.get( RIO_WMS_MAX_SCALE ) != null ) { - if ( config.getMaxScale() != null ) { - LOG.warn( "Configured WMS raster datasource defines a max scale, but the scale was set (from the multi resolution raster?) to: " - + options.get( RIO_WMS_MAX_SCALE ) ); - } - maxScale = options.get( RIO_WMS_MAX_SCALE ); - } - options.add( RIO_WMS_MAX_SCALE, maxScale ); - - if ( config.getDefaultSRS() != null ) { - options.add( RasterIOOptions.CRS, config.getDefaultSRS() ); - } - - RequestedFormat format = config.getRequestedFormat(); - if ( format != null ) { - /** Defines the default (image) format of a get map request to a WMS. */ - options.add( RIO_WMS_DEFAULT_FORMAT, format.getValue() ); - - /** Defines the key to set the GetMap retrieval to transparent. */ - options.add( RIO_WMS_ENABLE_TRANSPARENT, Boolean.toString( format.isTransparent() ) ); - } - - /** Defines the key to set the GetMap retrieval timeout. */ - String timeout = config.getRequestTimeout() == null ? "60" : config.getRequestTimeout().toString(); - options.add( RIO_WMS_TIMEOUT, timeout ); - - // rb: currently only wms 1.1.1 reader support - options.add( RasterIOOptions.OPT_FORMAT, WMSReader.WMSVersion.WMS_111.name() ); - - URL url = new URL( capDoc.getLocation() ); - - LOG.info( "Opening stream to capabilities:{}", capDoc.getLocation() ); - URLConnection connection = ProxyUtils.openURLConnection( url ); - connection.setConnectTimeout( Integer.parseInt( timeout ) * 1000 ); - InputStream in = connection.getInputStream(); - return RasterFactory.loadRasterFromStream( in, options ); - } - throw new NullPointerException( "The configured raster datasource may not be null." ); - } - - @Override - public URL getConfigSchema() { - return CONFIG_SCHEMA; - } - - @Override - public void init( DeegreeWorkspace workspace ) { - this.workspace = workspace; - } - - @Override - public Coverage create( URL configUrl ) - throws ResourceInitException { - try { - Object config = JAXBUtils.unmarshall( CONFIG_JAXB_PACKAGE, CONFIG_SCHEMA, configUrl, workspace ); - if ( config instanceof MultiResolutionRasterConfig ) { - return fromJAXB( (MultiResolutionRasterConfig) config ); - } - if ( config instanceof WMSDataSourceType ) { - return fromJAXB( (WMSDataSourceType) config, null ); - } - throw new ResourceInitException( "An unknown object came out of JAXB parsing. This is probably a bug." ); - } catch ( Throwable e ) { - throw new ResourceInitException( "IO-Error while constructing WMS coverage store.", e ); - } - } - - @SuppressWarnings("unchecked") - @Override - public Class[] getDependencies() { - return new Class[] {}; - } -} \ No newline at end of file diff --git a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/WMSRaster.java b/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/WMSRaster.java deleted file mode 100644 index 1699fd318d..0000000000 --- a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/WMSRaster.java +++ /dev/null @@ -1,134 +0,0 @@ -//$HeadURL$ -/*---------------------------------------------------------------------------- - This file is part of deegree, http://deegree.org/ - Copyright (C) 2001-2010 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.coverage.persistence.remotewms; - -import org.deegree.coverage.raster.SimpleRaster; -import org.deegree.coverage.raster.data.RasterData; -import org.deegree.coverage.raster.data.info.BandType; -import org.deegree.coverage.raster.geom.RasterGeoReference; -import org.deegree.geometry.Envelope; - -/** - * TODO add class documentation here - * - * @author Rutger Bezema - * @author last edited by: $Author$ - * - * @version $Revision$, $Date$ - */ -public class WMSRaster extends SimpleRaster { - - /** - * @param raster - * @param envelope - * @param rasterReference - */ - public WMSRaster( RasterData raster, Envelope envelope, RasterGeoReference rasterReference ) { - super( raster, envelope, rasterReference ); - } - - /** - * @param createdRaster - * to get the values from. - */ - public WMSRaster( SimpleRaster createdRaster ) { - this( createdRaster.getRasterData(), createdRaster.getEnvelope(), createdRaster.getRasterReference() ); - } - - /** - * Creates a SimpleRaster with same size, DataType and InterleaveType - * - * @param bands - * number of bands - * @return new empty SimpleRaster - */ - @Override - public SimpleRaster createCompatibleSimpleRaster( BandType[] bands ) { - SimpleRaster raster = super.createCompatibleSimpleRaster( bands ); - return new WMSRaster( raster ); - } - - /** - * Creates a new empty writable SimpleRaster with same size, DataType and InterleaveType. - * - * @return new empty SimpleRaster - */ - @Override - public SimpleRaster createCompatibleSimpleRaster() { - SimpleRaster raster = super.createCompatibleSimpleRaster(); - return new WMSRaster( raster ); - } - - /** - * Creates a new empty SimpleRaster with same DataType and InterleaveType. Size is determined by the given envelope. - * - * @param rEnv - * The raster envelope of the new SimpleRaster. - * @param env - * The boundary of the new SimpleRaster. - * @return A new empty SimpleRaster. - */ - @Override - public SimpleRaster createCompatibleSimpleRaster( RasterGeoReference rEnv, Envelope env ) { - SimpleRaster raster = super.createCompatibleSimpleRaster( rEnv, env ); - return new WMSRaster( raster ); - } - - @Override - public SimpleRaster copy() { - SimpleRaster result = this.createCompatibleSimpleRaster(); - result.setSubRaster( getEnvelope(), this ); - return result; - } - - /** - * Do a GetFeature info request on the underlying WMS client. - * - * @param fi - * @param style - * @return the information on the underlying wms. - */ - // public Pair> getFeatures( GetFeatureInfo fi, Style style ) { - // ByteBufferRasterData rasterData = (ByteBufferRasterData) getRasterData(); - // RasterReader reader = rasterData.getReader(); - // if ( reader instanceof WMSReader ) { - // do feature info - // } - // do a normal lookup - // return null; - // } - -} diff --git a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/WMSReader.java b/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/WMSReader.java deleted file mode 100644 index f1ddfb414c..0000000000 --- a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/java/org/deegree/coverage/persistence/remotewms/WMSReader.java +++ /dev/null @@ -1,518 +0,0 @@ -//$HeadURL$ -/*---------------------------------------------------------------------------- - This file is part of deegree, http://deegree.org/ - Copyright (C) 2001-2010 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.coverage.persistence.remotewms; - -import static org.deegree.commons.utils.StringUtils.isSet; -import static org.slf4j.LoggerFactory.getLogger; - -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.nio.ByteBuffer; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - -import org.deegree.commons.utils.Pair; -import org.deegree.commons.utils.StringUtils; -import org.deegree.commons.xml.XMLAdapter; -import org.deegree.coverage.raster.AbstractRaster; -import org.deegree.coverage.raster.SimpleRaster; -import org.deegree.coverage.raster.cache.RasterCache; -import org.deegree.coverage.raster.data.container.BufferResult; -import org.deegree.coverage.raster.data.info.RasterDataInfo; -import org.deegree.coverage.raster.data.nio.ByteBufferRasterData; -import org.deegree.coverage.raster.geom.RasterGeoReference; -import org.deegree.coverage.raster.geom.RasterGeoReference.OriginLocation; -import org.deegree.coverage.raster.geom.RasterRect; -import org.deegree.coverage.raster.io.RasterIOOptions; -import org.deegree.coverage.raster.io.RasterReader; -import org.deegree.coverage.raster.utils.RasterFactory; -import org.deegree.cs.components.Unit; -import org.deegree.cs.coordinatesystems.ICRS; -import org.deegree.cs.persistence.CRSManager; -import org.deegree.geometry.Envelope; -import org.deegree.geometry.Geometry; -import org.deegree.geometry.GeometryTransformer; -import org.deegree.protocol.wms.WMSConstants.WMSRequestType; -import org.deegree.protocol.wms.ops.GetMap; -import org.deegree.protocol.wms.client.WMSClient; -import org.slf4j.Logger; - -/** - * TODO add class documentation here - * - * @author Rutger Bezema - * @author last edited by: $Author$ - * - * @version $Revision$, $Date$ - */ -public class WMSReader implements RasterReader { - - private static final Logger LOG = getLogger( WMSReader.class ); - - /** - * Formats of the reader - */ - final static Set supportedFormats; - - /** Defines the system id to be used as raster io key, for setting the system id or the capabilities url. */ - public static final String RIO_WMS_SYS_ID = "RASTERIO_WMS_SYS_ID"; - - /** The refresh time of the capabilities */ - public static final String RIO_WMS_REFRESH_TIME = "RASTERIO_WMS_REFRESH_TIME"; - - /** Defines the maximum width of a GetMap request. */ - public static final String RIO_WMS_MAX_WIDTH = "RASTERIO_WMS_MAX_WIDTH"; - - /** Defines the maximum height of a GetMap request. */ - public static final String RIO_WMS_MAX_HEIGHT = "RASTERIO_WMS_MAX_HEIGHT"; - - /** Defines the maximum height of a GetMap request. */ - public static final String RIO_WMS_LAYERS = "RASTERIO_WMS_REQUESTED_LAYERS"; - - /** Defines the maximum scale of a WMS. */ - public static final String RIO_WMS_MAX_SCALE = "RASTERIO_WMS_MAX_SCALE"; - - /** Defines the default (image) format of a get map request to a WMS. */ - public static final String RIO_WMS_DEFAULT_FORMAT = "RASTERIO_WMS_DEFAULT_FORMAT"; - - /** Defines the key to set the GetMap retrieval to transparent. */ - public static final String RIO_WMS_ENABLE_TRANSPARENT = "RASTERIO_WMS_ENABLE_TRANSPARENCY"; - - /** Defines the key to set the GetMap retrieval timeout. */ - public static final String RIO_WMS_TIMEOUT = "RASTERIO_WMS_GM_TIMEOUT"; - - static { - supportedFormats = new HashSet(); - supportedFormats.add( WMSVersion.WMS_111.name() ); - } - - enum WMSVersion { - WMS_111; - } - - private WMSClient client; - - private RasterGeoReference geoRef; - - private int width; - - private int height; - - private RasterDataInfo rdi; - - private List layers; - - private Envelope envelope; - - private String dataLocationId; - - private int maxWidth; - - private int maxHeight; - - private String format; - - private boolean transparent; - - private int timeout; - - private ICRS crs; - - @Override - public boolean canLoad( File filename ) { - return false; - } - - @Override - public boolean canReadTiles() { - return false; - } - - @Override - public void dispose() { - // TODO Auto-generated method stub - - } - - @Override - public File file() { - // no file - return null; - } - - @Override - public String getDataLocationId() { - return dataLocationId; - } - - @Override - public RasterGeoReference getGeoReference() { - return this.geoRef; - } - - @Override - public int getHeight() { - return height; - } - - @Override - public RasterDataInfo getRasterDataInfo() { - return rdi; - } - - @Override - public Set getSupportedFormats() { - return new HashSet( supportedFormats ); - } - - @Override - public int getWidth() { - return width; - } - - @Override - public AbstractRaster load( File filename, RasterIOOptions options ) - throws IOException { - throw new UnsupportedOperationException( "The wms reader does not support loading from file." ); - } - - @Override - public AbstractRaster load( InputStream stream, RasterIOOptions options ) - throws IOException { - RasterIOOptions opts = new RasterIOOptions(); - opts.copyOf( options ); - String sysId = opts.get( RIO_WMS_SYS_ID ); - if ( sysId == null ) { - LOG.error( "No system id available, please verify the location of the capabilities url, and set it in the rasterio options with the key: WMSReader.RIO_WMS_SYS_ID." ); - throw new IOException( "No capabilities url found to read from." ); - } - this.dataLocationId = sysId; - LOG.debug( "Creating xml adapter from stream to capabilities:{}", sysId ); - XMLAdapter capabilities = new XMLAdapter( stream ); - capabilities.setSystemId( sysId ); - - try { - this.client = new WMSClient( capabilities ); - } catch ( Exception e ) { - throw new IOException( "The given stream with system id( " + sysId - + ") does not access a WMS Capabilities document." ); - } - - this.maxWidth = getInt( opts.get( RIO_WMS_MAX_WIDTH ), "max request width" ); - this.maxHeight = getInt( opts.get( RIO_WMS_MAX_HEIGHT ), "max request height" ); - - this.client.setMaxMapDimensions( maxWidth, maxHeight ); - this.layers = getLayers( opts ); - crs = opts.getCRS(); - if ( crs == null ) { - this.envelope = client.getLatLonBoundingBox( layers ); - LinkedList coordinateSystems = client.getCoordinateSystems( layers.get( 0 ) ); - for ( int i = 0; i < coordinateSystems.size() && this.crs == null; ++i ) { - String srs = coordinateSystems.get( i ); - if ( srs != null ) { - this.crs = CRSManager.getCRSRef( srs ); - // try { - ICRS cr = crs; - if ( cr.getAxis()[0].getUnits().canConvert( Unit.METRE ) ) { - break; - } - // } catch ( UnknownCRSException e ) { - // LOG.debug( "(Stack) Unknown crs: " + e.getLocalizedMessage(), e ); - // } - - } - } - } - if ( crs == null ) { - throw new IOException( "Could not get the Default coordinate system for layers: " + layers - + " does your WMS support the given layers? Unable to use this WMS ( " - + dataLocationId + " as a raster data source." ); - } - ICRS wCRS = null; - // try { - wCRS = crs; - // } catch ( UnknownCRSException e1 ) { - // throw new IOException( "The Default coordinate system for layers: " + layers - // + " are not supported by your deegree installation. Unable to use this WMS ( " - // + dataLocationId + " as a raster data source." ); - // } - // no bbox defined in the given crs - this.envelope = client.getBoundingBox( crs.getAlias(), layers ); - if ( this.envelope == null ) { - this.envelope = client.getLatLonBoundingBox( layers ); - GeometryTransformer transform = new GeometryTransformer( wCRS ); - - try { - Geometry tEnv = transform.transform( this.envelope ); - if ( tEnv == null ) { - envelope = null; - } else { - envelope = tEnv.getEnvelope(); - } - } catch ( Exception e ) { - LOG.error( e.getLocalizedMessage() ); - envelope = null; - } - - } - if ( this.envelope == null ) { - throw new IOException( "Could not get the BBox for layers: " + layers - + " does your WMS support the given layers, unable to use this WMS ( " - + dataLocationId + " as a raster data source." ); - } - ICRS realCRS = null; - if ( crs != null ) { - // try { - realCRS = crs; - // } catch ( UnknownCRSException e ) { - // if ( LOG.isDebugEnabled() ) { - // LOG.debug( "(Stack) Could not get underlying crs: " + e.getLocalizedMessage(), e ); - // } else { - // LOG.error( "Could not get underlying crs: " + e.getLocalizedMessage() ); - // } - // } - } - double scale = getScale( opts ); - int widthAxis = realCRS == null ? 0 : realCRS.getEasting(); - // double eW = this.envelope.getSpan( widthAxis ); - // double eH = this.envelope.getSpan( 1 - widthAxis ); - // this.width = (int) Math.ceil( eW * scale ); - // this.height = (int) Math.ceil( eH * scale ); - // this.geoRef = RasterGeoReference.create( OriginLocation.OUTER, envelope, width, height ); - this.geoRef = new RasterGeoReference( OriginLocation.OUTER, scale, -scale, - this.envelope.getMin().get( widthAxis ), - this.envelope.getMax().get( 1 - widthAxis ) ); - RasterRect rect = this.geoRef.convertEnvelopeToRasterCRS( this.envelope ); - this.width = rect.width; - this.height = rect.height; - - this.transparent = enableTransparency( opts ); - this.format = getFormat( opts ); - if ( !isSet( format ) ) { - throw new IOException( - "No format set and unable to retrieve a format for a GetMap request to the WMS, unable to use this WMS ( " - + dataLocationId + " as a raster data source." ); - } - - this.timeout = getInt( opts.get( RIO_WMS_TIMEOUT ), "get map time out" ); - - RasterCache cache = RasterCache.getInstance( opts ); - SimpleRaster result = cache.createFromCache( this, this.dataLocationId ); - if ( result == null ) { - Envelope env = this.geoRef.getEnvelope( new RasterRect( 1, 1, 2, 2 ), null ); - GetMap gm = new GetMap( layers, maxWidth < 0 ? 1 : maxWidth, maxHeight < 0 ? 1 : maxHeight, env, crs, - format, transparent ); - Pair imageResponse = this.client.getMap( gm, null, timeout, true ); - if ( imageResponse.first != null ) { - BufferedImage img = imageResponse.first; - try { - ByteBufferRasterData rd = RasterFactory.rasterDataFromImage( img ); - if ( rd != null ) { - this.rdi = rd.getDataInfo(); - } - } catch ( Exception e ) { - if ( LOG.isDebugEnabled() ) { - LOG.debug( "Could not do an initial GetMap request to server: " + dataLocationId + " because: " - + e.getMessage(), e ); - } else { - LOG.error( "Could not do an initial GetMap request to server: " + dataLocationId + " because: " - + e.getMessage() ); - } - } - - } - if ( rdi == null ) { - throw new IOException( - "Could not determine the resulting Raster data information of a GetMap request, unable to use this WMS ( " - + dataLocationId + " as a raster data source." ); - } - result = RasterFactory.createEmptyRaster( rdi, envelope, geoRef, this, false, opts ); - } - - WMSRaster raster = new WMSRaster( result ); - - return raster; - } - - /** - * @param opts - */ - private static boolean enableTransparency( RasterIOOptions opts ) { - return opts.get( RIO_WMS_ENABLE_TRANSPARENT ) != null; - } - - /** - * @param opts - */ - private String getFormat( RasterIOOptions opts ) { - String format = opts.get( RIO_WMS_DEFAULT_FORMAT ); - if ( isSet( format ) ) { - LinkedList formats = this.client.getFormats( WMSRequestType.GetMap ); - String pngFormat = null; - String tiffFormat = null; - String jpgFormat = null; - for ( String f : formats ) { - if ( f != null ) { - if ( pngFormat == null && hasFormat( "png", f ) ) { - pngFormat = f; - } - if ( tiffFormat == null && ( hasFormat( "tiff", f ) || hasFormat( "tif", f ) ) ) { - tiffFormat = f; - } - if ( jpgFormat == null && ( hasFormat( "jpg", f ) || hasFormat( "jpeg", f ) ) ) { - jpgFormat = f; - } - } - } - if ( transparent ) { - if ( pngFormat != null ) { - format = pngFormat; - } else if ( tiffFormat != null ) { - format = tiffFormat; - } - } - if ( format == null ) { - if ( jpgFormat != null ) { - format = jpgFormat; - } else { - // set the default format - format = formats.get( 0 ); - } - } - } - return format; - } - - private static boolean hasFormat( String simpleImage, String defFormat ) { - return simpleImage.equalsIgnoreCase( defFormat ) || ( "image/" + simpleImage ).equalsIgnoreCase( defFormat ); - } - - private static int getInt( String val, String key ) { - if ( isSet( val ) ) { - try { - return Integer.parseInt( val ); - } catch ( NumberFormatException e ) { - LOG.debug( "Could not get integer value for : " + key ); - } - } - return -1; - } - - /** - * @param options - */ - private static double getScale( RasterIOOptions options ) { - String scale = options.get( RIO_WMS_MAX_SCALE ); - if ( !StringUtils.isSet( scale ) ) { - throw new IllegalArgumentException( - "Missing required maximum scale value for wms, please set the RasterIO options with the value WMSReader.RIO_WMS_LAYERS" ); - - } - try { - return Double.parseDouble( scale ); - } catch ( NumberFormatException nfe ) { - throw new IllegalArgumentException( "Required maximum scale value for wms, is not valid, supplied was: " - + scale ); - } - } - - /** - * @param options - */ - private List getLayers( RasterIOOptions options ) { - List configuredLayers = new LinkedList(); - String layers = options.get( RIO_WMS_LAYERS ); - if ( StringUtils.isSet( layers ) ) { - String[] layer = layers.split( "," ); - for ( String l : layer ) { - configuredLayers.add( l ); - } - } - if ( configuredLayers.isEmpty() ) { - List namedLayers = this.client.getNamedLayers(); - if ( namedLayers != null ) { - configuredLayers.addAll( namedLayers ); - } - } - return configuredLayers; - } - - @Override - public BufferResult read( RasterRect rect, ByteBuffer result ) - throws IOException { - Envelope env = this.geoRef.getEnvelope( rect, null ); - GetMap gm = new GetMap( layers, rect.width, rect.height, env, crs, format, transparent ); - Pair imageResponse = this.client.getMap( gm, null, timeout, true ); - BufferResult res = null; - if ( imageResponse.first != null ) { - BufferedImage img = imageResponse.first; - ByteBufferRasterData rd = RasterFactory.rasterDataFromImage( img, null, result ); - res = new BufferResult( rd.getView(), rd.getByteBuffer() ); - } - return res; - } - - @Override - public boolean shouldCreateCacheFile() { - return false; - } - - /** - * @return the wms client - */ - public WMSClient getClient() { - return client; - } - - /** - * @return the layers the reader is requesting - */ - public List getLayers() { - return layers; - } - - /** - * @return the default crs - */ - public ICRS getCRS() { - return crs; - } - -} diff --git a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/resources/META-INF/schemas/datasource/coverage/wms/3.0.0/example.xml b/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/resources/META-INF/schemas/datasource/coverage/wms/3.0.0/example.xml deleted file mode 100644 index b2ee4fe0b4..0000000000 --- a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/resources/META-INF/schemas/datasource/coverage/wms/3.0.0/example.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - cite:BasicPolygons - \ No newline at end of file diff --git a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/resources/META-INF/schemas/datasource/coverage/wms/3.0.0/wms.xsd b/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/resources/META-INF/schemas/datasource/coverage/wms/3.0.0/wms.xsd deleted file mode 100644 index 999d3a5548..0000000000 --- a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/resources/META-INF/schemas/datasource/coverage/wms/3.0.0/wms.xsd +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - A wms raster datasource with a configuration version. - - - - - - - - - - - - - - A WMS datasource defines the access to a 'remote' WMS. For this purpose, it holds information - about - the request type (GetMap, GetFeatureInfo) and the layers. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A multi resolution raster wraps (single) rasters and adds a resolution of each raster. - - - - - - - - - - - - - - - - - - - - - - - - - - Defines the parameters for a single request. The attribute and value parameters can be used to - supply additional information to the request. - - - - - - - - - - The WMS datasource allows the cascading of GetMap and GetFeatureInfo requests. - - - - - - - - \ No newline at end of file diff --git a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/resources/META-INF/services/org.deegree.coverage.persistence.CoverageBuilder b/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/resources/META-INF/services/org.deegree.coverage.persistence.CoverageBuilder deleted file mode 100644 index 2182fcfe5c..0000000000 --- a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/resources/META-INF/services/org.deegree.coverage.persistence.CoverageBuilder +++ /dev/null @@ -1 +0,0 @@ -org.deegree.protocol.wms.raster.WMSBuilder diff --git a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/resources/META-INF/services/org.deegree.coverage.raster.io.RasterIOProvider b/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/resources/META-INF/services/org.deegree.coverage.raster.io.RasterIOProvider deleted file mode 100644 index d232f05a44..0000000000 --- a/deegree-datastores/deegree-coveragestores/deegree-coveragestore-remotewms/src/main/resources/META-INF/services/org.deegree.coverage.raster.io.RasterIOProvider +++ /dev/null @@ -1 +0,0 @@ -org.deegree.protocol.wms.raster.WMSIOProvider \ No newline at end of file diff --git a/deegree-datastores/deegree-coveragestores/pom.xml b/deegree-datastores/deegree-coveragestores/pom.xml deleted file mode 100644 index d135a06d97..0000000000 --- a/deegree-datastores/deegree-coveragestores/pom.xml +++ /dev/null @@ -1,32 +0,0 @@ - - 4.0.0 - deegree-coveragestores - pom - deegree-coveragestores - Abstraction layer for coverage (e.g. raster) persistence and backend implementations - - - org.deegree - deegree-datastores - 3.2-pre16-SNAPSHOT - - - - - deegree-repo - http://repo.deegree.org/content/groups/public - - never - - - true - - - - - - deegree-coveragestore-remotewms - - - - diff --git a/deegree-datastores/deegree-featurestores/deegree-featurestore-commons/pom.xml b/deegree-datastores/deegree-featurestores/deegree-featurestore-commons/pom.xml index 1ba661b665..f7856d0484 100644 --- a/deegree-datastores/deegree-featurestores/deegree-featurestore-commons/pom.xml +++ b/deegree-datastores/deegree-featurestores/deegree-featurestore-commons/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-featurestores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-featurestores/deegree-featurestore-couchbase/pom.xml b/deegree-datastores/deegree-featurestores/deegree-featurestore-couchbase/pom.xml index bd9be8186f..6475d43c19 100644 --- a/deegree-datastores/deegree-featurestores/deegree-featurestore-couchbase/pom.xml +++ b/deegree-datastores/deegree-featurestores/deegree-featurestore-couchbase/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-featurestores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-featurestores/deegree-featurestore-memory/pom.xml b/deegree-datastores/deegree-featurestores/deegree-featurestore-memory/pom.xml index f7c873a5fe..92dd17c2f8 100644 --- a/deegree-datastores/deegree-featurestores/deegree-featurestore-memory/pom.xml +++ b/deegree-datastores/deegree-featurestores/deegree-featurestore-memory/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-featurestores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-featurestores/deegree-featurestore-remotewfs/pom.xml b/deegree-datastores/deegree-featurestores/deegree-featurestore-remotewfs/pom.xml index 542c69ebea..1f941311b5 100644 --- a/deegree-datastores/deegree-featurestores/deegree-featurestore-remotewfs/pom.xml +++ b/deegree-datastores/deegree-featurestores/deegree-featurestore-remotewfs/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-featurestores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-featurestores/deegree-featurestore-shape/pom.xml b/deegree-datastores/deegree-featurestores/deegree-featurestore-shape/pom.xml index 5a2f4b8566..b172fdfbbf 100644 --- a/deegree-datastores/deegree-featurestores/deegree-featurestore-shape/pom.xml +++ b/deegree-datastores/deegree-featurestores/deegree-featurestore-shape/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-featurestores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-featurestores/deegree-featurestore-shape/src/main/java/org/deegree/feature/persistence/shape/DBFReader.java b/deegree-datastores/deegree-featurestores/deegree-featurestore-shape/src/main/java/org/deegree/feature/persistence/shape/DBFReader.java index e3bedb8f20..dd8f1f936c 100644 --- a/deegree-datastores/deegree-featurestores/deegree-featurestore-shape/src/main/java/org/deegree/feature/persistence/shape/DBFReader.java +++ b/deegree-datastores/deegree-featurestores/deegree-featurestore-shape/src/main/java/org/deegree/feature/persistence/shape/DBFReader.java @@ -39,6 +39,7 @@ import static java.util.Calendar.DAY_OF_MONTH; import static java.util.Calendar.MILLISECOND; import static org.deegree.commons.utils.EncodingGuesser.guess; +import static org.deegree.commons.utils.StringUtils.concat; import static org.deegree.feature.types.property.GeometryPropertyType.CoordinateDimension.DIM_2_OR_3; import static org.deegree.feature.types.property.ValueRepresentation.BOTH; import static org.slf4j.LoggerFactory.getLogger; @@ -51,6 +52,7 @@ import java.nio.channels.FileChannel; import java.nio.channels.FileChannel.MapMode; import java.nio.charset.Charset; +import java.util.ArrayList; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.HashMap; @@ -271,15 +273,7 @@ public DBFReader( RandomAccessFile in, Charset encoding, QName ftName, GeometryT } if ( map != null ) { - types.clear(); - for ( Mapping m : mappings ) { - if ( m.fieldname == null ) { - types.add( new GeometryPropertyType( new QName( namespace, m.propname, prefix ), 0, 1, null, null, - geomType, DIM_2_OR_3, BOTH ) ); - } else { - types.add( properties.get( m.fieldname ) ); - } - } + createCustomMappedProperties( geomType, mappings, types, namespace, prefix ); } else { types.add( new GeometryPropertyType( new QName( namespace, "geometry", prefix ), 0, 1, null, null, geomType, DIM_2_OR_3, BOTH ) ); @@ -287,7 +281,26 @@ public DBFReader( RandomAccessFile in, Charset encoding, QName ftName, GeometryT // TODO // properly determine the dimension from SHP type featureType = new GenericFeatureType( ftName, types, false ); + } + private void createCustomMappedProperties( GeometryType geomType, List mappings, + LinkedList types, String namespace, String prefix ) { + types.clear(); + for ( Mapping m : mappings ) { + if ( m.fieldname == null ) { + types.add( new GeometryPropertyType( new QName( namespace, m.propname, prefix ), 0, 1, null, null, + geomType, DIM_2_OR_3, BOTH ) ); + } else { + PropertyType pt = properties.get( m.fieldname ); + if ( pt == null ) { + List fieldNames = new ArrayList( properties.keySet() ); + String msg = "Error in mapping. DBF file does not have a field with name '" + m.fieldname + + "'. Defined fields are: " + concat( fieldNames, ", " ); + throw new IllegalArgumentException( msg ); + } + types.add( pt ); + } + } } private static String getString( byte[] bs, Charset encoding ) diff --git a/deegree-datastores/deegree-featurestores/deegree-featurestore-simplesql/pom.xml b/deegree-datastores/deegree-featurestores/deegree-featurestore-simplesql/pom.xml index 9222028828..6fd8f1ff93 100644 --- a/deegree-datastores/deegree-featurestores/deegree-featurestore-simplesql/pom.xml +++ b/deegree-datastores/deegree-featurestores/deegree-featurestore-simplesql/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-featurestores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-featurestores/deegree-featurestore-sql/pom.xml b/deegree-datastores/deegree-featurestores/deegree-featurestore-sql/pom.xml index ce6c538a26..cdfa626822 100644 --- a/deegree-datastores/deegree-featurestores/deegree-featurestore-sql/pom.xml +++ b/deegree-datastores/deegree-featurestores/deegree-featurestore-sql/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-featurestores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT @@ -81,8 +81,8 @@ - latlon-sqldialect-mssql - de.latlon + deegree-sqldialect-mssql + org.deegree ${project.version} test diff --git a/deegree-datastores/deegree-featurestores/deegree-featurestore-sql/src/main/java/org/deegree/feature/persistence/sql/id/TableDependencies.java b/deegree-datastores/deegree-featurestores/deegree-featurestore-sql/src/main/java/org/deegree/feature/persistence/sql/id/TableDependencies.java index 84325e262a..52deb8c128 100644 --- a/deegree-datastores/deegree-featurestores/deegree-featurestore-sql/src/main/java/org/deegree/feature/persistence/sql/id/TableDependencies.java +++ b/deegree-datastores/deegree-featurestores/deegree-featurestore-sql/src/main/java/org/deegree/feature/persistence/sql/id/TableDependencies.java @@ -36,6 +36,7 @@ package org.deegree.feature.persistence.sql.id; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; @@ -252,27 +253,31 @@ public Set getKeyColumns( TableName table ) { /** * Performs a lookup for the specified key propagation. * - * @param fromTable - * source table, must not be null - * @param fromColumns - * primary key columns (in source table), must not be null and contain at least one entry - * @param toTable - * target table, must not be null - * @param toColumns - * foreign key columns (in target table), must not be null and contain at least one entry + * @param table1 + * first table, must not be null + * @param table1KeyColumns + * key columns (of first table), must not be null and contain at least one entry + * @param table2 + * second table, must not be null + * @param table2KeyColumns + * key columns (of second table), must not be null and contain at least one entry * @return key propagation, can be null (no such propagation defined) */ - public KeyPropagation findKeyPropagation( TableName fromTable, List fromColumns, TableName toTable, - List toColumns ) { - Set candidates = tableToChildren.get( fromTable ); - KeyPropagation fromToTo = new KeyPropagation( fromTable, fromColumns, toTable, toColumns ); - KeyPropagation toToFrom = new KeyPropagation( toTable, toColumns, fromTable, fromColumns ); - - if ( candidates != null ) { - for ( KeyPropagation candidate : candidates ) { - if ( candidate.equals( fromToTo ) || candidate.equals( toToFrom ) ) { - return candidate; - } + public KeyPropagation findKeyPropagation( TableName table1, List table1KeyColumns, TableName table2, + List table2KeyColumns ) { + KeyPropagation fromToTo = new KeyPropagation( table1, table1KeyColumns, table2, table2KeyColumns ); + KeyPropagation toToFrom = new KeyPropagation( table2, table2KeyColumns, table1, table1KeyColumns ); + + Set candidates = new HashSet(); + if ( tableToChildren.get( table1 ) != null ) { + candidates.addAll( tableToChildren.get( table1 ) ); + } + if ( tableToChildren.get( table2 ) != null ) { + candidates.addAll( tableToChildren.get( table2 ) ); + } + for ( KeyPropagation candidate : candidates ) { + if ( candidate.equals( fromToTo ) || candidate.equals( toToFrom ) ) { + return candidate; } } return null; diff --git a/deegree-datastores/deegree-featurestores/pom.xml b/deegree-datastores/deegree-featurestores/pom.xml index b7a6a64253..dfc289120f 100644 --- a/deegree-datastores/deegree-featurestores/pom.xml +++ b/deegree-datastores/deegree-featurestores/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree-datastores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-mdstores/deegree-mdstore-commons/pom.xml b/deegree-datastores/deegree-mdstores/deegree-mdstore-commons/pom.xml index 7569518b72..be310fc92f 100644 --- a/deegree-datastores/deegree-mdstores/deegree-mdstore-commons/pom.xml +++ b/deegree-datastores/deegree-mdstores/deegree-mdstore-commons/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-mdstores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-mdstores/deegree-mdstore-ebrim-eo/pom.xml b/deegree-datastores/deegree-mdstores/deegree-mdstore-ebrim-eo/pom.xml index fc98b2055b..505df7cb6d 100644 --- a/deegree-datastores/deegree-mdstores/deegree-mdstore-ebrim-eo/pom.xml +++ b/deegree-datastores/deegree-mdstores/deegree-mdstore-ebrim-eo/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-mdstores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-mdstores/deegree-mdstore-iso-memory/pom.xml b/deegree-datastores/deegree-mdstores/deegree-mdstore-iso-memory/pom.xml index 1f19d07308..41224721bf 100644 --- a/deegree-datastores/deegree-mdstores/deegree-mdstore-iso-memory/pom.xml +++ b/deegree-datastores/deegree-mdstores/deegree-mdstore-iso-memory/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-mdstores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-mdstores/deegree-mdstore-iso/pom.xml b/deegree-datastores/deegree-mdstores/deegree-mdstore-iso/pom.xml index 3fffddb229..e623747b87 100644 --- a/deegree-datastores/deegree-mdstores/deegree-mdstore-iso/pom.xml +++ b/deegree-datastores/deegree-mdstores/deegree-mdstore-iso/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-mdstores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-mdstores/pom.xml b/deegree-datastores/deegree-mdstores/pom.xml index 5d696395a7..a10ed5918b 100644 --- a/deegree-datastores/deegree-mdstores/pom.xml +++ b/deegree-datastores/deegree-mdstores/pom.xml @@ -9,7 +9,7 @@ org.deegree deegree-datastores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-tilestores/deegree-tilestore-cache/pom.xml b/deegree-datastores/deegree-tilestores/deegree-tilestore-cache/pom.xml index 01cb643949..6ffc3baac9 100644 --- a/deegree-datastores/deegree-tilestores/deegree-tilestore-cache/pom.xml +++ b/deegree-datastores/deegree-tilestores/deegree-tilestore-cache/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-tilestores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-tilestores/deegree-tilestore-commons/pom.xml b/deegree-datastores/deegree-tilestores/deegree-tilestore-commons/pom.xml index cc34d8fe36..156bbc4ea8 100644 --- a/deegree-datastores/deegree-tilestores/deegree-tilestore-commons/pom.xml +++ b/deegree-datastores/deegree-tilestores/deegree-tilestore-commons/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-tilestores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-tilestores/deegree-tilestore-filesystem/pom.xml b/deegree-datastores/deegree-tilestores/deegree-tilestore-filesystem/pom.xml index a74525ef00..d16a8cfda9 100644 --- a/deegree-datastores/deegree-tilestores/deegree-tilestore-filesystem/pom.xml +++ b/deegree-datastores/deegree-tilestores/deegree-tilestore-filesystem/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-tilestores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-tilestores/deegree-tilestore-filesystem/src/main/java/org/deegree/tile/persistence/filesystem/layout/TileCacheDiskLayout.java b/deegree-datastores/deegree-tilestores/deegree-tilestore-filesystem/src/main/java/org/deegree/tile/persistence/filesystem/layout/TileCacheDiskLayout.java index 802e5f71e8..492a1a96fe 100644 --- a/deegree-datastores/deegree-tilestores/deegree-tilestore-filesystem/src/main/java/org/deegree/tile/persistence/filesystem/layout/TileCacheDiskLayout.java +++ b/deegree-datastores/deegree-tilestores/deegree-tilestore-filesystem/src/main/java/org/deegree/tile/persistence/filesystem/layout/TileCacheDiskLayout.java @@ -121,8 +121,7 @@ public File resolve( String matrixId, long x, long y ) { private String getLevelDirectory( TileDataLevel tileMatrix ) { DecimalFormat formatter = new DecimalFormat( "00" ); - int num = set.getTileDataLevels().size(); - int tileMatrixIndex = num - 1 - set.getTileDataLevels().indexOf( tileMatrix ); + int tileMatrixIndex = set.getTileDataLevels().indexOf( tileMatrix ); return formatter.format( tileMatrixIndex ); } diff --git a/deegree-datastores/deegree-tilestores/deegree-tilestore-geotiff/pom.xml b/deegree-datastores/deegree-tilestores/deegree-tilestore-geotiff/pom.xml index 3e806ef21a..4dd21ace56 100644 --- a/deegree-datastores/deegree-tilestores/deegree-tilestore-geotiff/pom.xml +++ b/deegree-datastores/deegree-tilestores/deegree-tilestore-geotiff/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-tilestores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/pom.xml b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/pom.xml index dfb9c9645d..a538707d23 100644 --- a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/pom.xml +++ b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-tilestores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/java/org/deegree/tile/persistence/remotewms/RemoteWMSTile.java b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/java/org/deegree/tile/persistence/remotewms/RemoteWMSTile.java index 645ca1cb21..c67aacd36e 100644 --- a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/java/org/deegree/tile/persistence/remotewms/RemoteWMSTile.java +++ b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/java/org/deegree/tile/persistence/remotewms/RemoteWMSTile.java @@ -49,12 +49,15 @@ Occam Labs UG (haftungsbeschränkt) import java.net.SocketTimeoutException; import java.net.UnknownHostException; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import javax.imageio.ImageIO; import org.apache.commons.io.IOUtils; import org.deegree.commons.ows.exception.OWSException; +import org.deegree.commons.utils.RequestUtils; import org.deegree.cs.coordinatesystems.ICRS; import org.deegree.feature.FeatureCollection; import org.deegree.geometry.Envelope; @@ -81,6 +84,10 @@ class RemoteWMSTile implements Tile { private final String outputFormat; + private Map defaultGetFeatureInfo; + + private Map hardGetFeatureInfo; + /** * Creates a new {@link RemoteWMSTile} instance. * @@ -90,11 +97,18 @@ class RemoteWMSTile implements Tile { * request for retrieving the tile image, never null * @param outputFormat * if not null, images will be recoded into specified output format (use ImageIO like formats, eg. 'png') + * @param defaultGetFeatureInfo + * default parameters for remote GFI requests + * @param hardGetFeatureInfo + * replace parameters for remote GFI requests */ - RemoteWMSTile( WMSClient client, GetMap gm, String outputFormat ) { + RemoteWMSTile( WMSClient client, GetMap gm, String outputFormat, Map defaultGetFeatureInfo, + Map hardGetFeatureInfo ) { this.client = client; this.gm = gm; this.outputFormat = outputFormat; + this.defaultGetFeatureInfo = defaultGetFeatureInfo; + this.hardGetFeatureInfo = hardGetFeatureInfo; } @Override @@ -159,6 +173,9 @@ public FeatureCollection getFeatures( int i, int j, int limit ) { Envelope bbox = gm.getBoundingBox(); ICRS crs = gm.getCoordinateSystem(); GetFeatureInfo request = new GetFeatureInfo( layers, width, height, i, j, bbox, crs, limit ); + Map overriddenParameters = new HashMap(); + RequestUtils.replaceParameters( overriddenParameters, RequestUtils.getCurrentThreadRequestParameters().get(), + defaultGetFeatureInfo, hardGetFeatureInfo ); fc = client.doGetFeatureInfo( request, null ); } catch ( SocketTimeoutException e ) { String msg = "Error performing GetFeatureInfo request, read timed out (timeout configured is " diff --git a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/java/org/deegree/tile/persistence/remotewms/RemoteWMSTileDataLevel.java b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/java/org/deegree/tile/persistence/remotewms/RemoteWMSTileDataLevel.java index fbc8d09da5..eef097d3fc 100644 --- a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/java/org/deegree/tile/persistence/remotewms/RemoteWMSTileDataLevel.java +++ b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/java/org/deegree/tile/persistence/remotewms/RemoteWMSTileDataLevel.java @@ -35,12 +35,16 @@ ----------------------------------------------------------------------------*/ package org.deegree.tile.persistence.remotewms; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import org.deegree.commons.utils.RequestUtils; import org.deegree.cs.coordinatesystems.ICRS; import org.deegree.cs.persistence.CRSManager; import org.deegree.geometry.Envelope; import org.deegree.geometry.GeometryFactory; +import org.deegree.protocol.wms.Utils; import org.deegree.protocol.wms.client.WMSClient; import org.deegree.protocol.wms.ops.GetMap; import org.deegree.tile.Tile; @@ -75,6 +79,14 @@ class RemoteWMSTileDataLevel implements TileDataLevel { private ICRS crs; + private Map defaultGetMap; + + private Map defaultGetFeatureInfo; + + private Map hardGetMap; + + private Map hardGetFeatureInfo; + /** * Creates a new {@link RemoteWMSTileDataLevel} instance. * @@ -92,14 +104,24 @@ class RemoteWMSTileDataLevel implements TileDataLevel { * if not null, images will be recoded into specified output format (use ImageIO like formats, eg. 'png') * @param crs * the crs to request maps with, may be null + * @param hardGetFeatureInfo + * @param hardGetMap + * @param defaultGetFeatureInfo + * @param defaultGetMap */ RemoteWMSTileDataLevel( TileMatrix tileMd, String format, List layers, List styles, - WMSClient client, String recodedOutputFormat, String crs ) { + WMSClient client, String recodedOutputFormat, String crs, + Map defaultGetMap, Map defaultGetFeatureInfo, + Map hardGetMap, Map hardGetFeatureInfo ) { this.metadata = tileMd; this.format = format; this.layers = layers; this.styles = styles; this.recodedOutputFormat = recodedOutputFormat; + this.defaultGetMap = defaultGetMap; + this.defaultGetFeatureInfo = defaultGetFeatureInfo; + this.hardGetMap = hardGetMap; + this.hardGetFeatureInfo = hardGetFeatureInfo; this.tileSizeX = tileMd.getTilePixelsX(); this.tileSizeY = tileMd.getTilePixelsY(); this.client = client; @@ -128,7 +150,11 @@ public Tile getTile( long x, long y ) { if ( crs == null ) { crs = envelope.getCoordinateSystem(); } - GetMap gm = new GetMap( layers, styles, (int) tileSizeX, (int) tileSizeY, envelope, crs, format, true ); - return new RemoteWMSTile( client, gm, recodedOutputFormat ); + Map overriddenParameters = new HashMap(); + RequestUtils.replaceParameters( overriddenParameters, RequestUtils.getCurrentThreadRequestParameters().get(), + defaultGetMap, hardGetMap ); + GetMap gm = new GetMap( layers, styles, (int) tileSizeX, (int) tileSizeY, envelope, crs, format, true, + overriddenParameters ); + return new RemoteWMSTile( client, gm, recodedOutputFormat, defaultGetFeatureInfo, hardGetFeatureInfo ); } } diff --git a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/java/org/deegree/tile/persistence/remotewms/TileDataSetBuilder.java b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/java/org/deegree/tile/persistence/remotewms/TileDataSetBuilder.java index edd085cf22..1fd94a6dbd 100644 --- a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/java/org/deegree/tile/persistence/remotewms/TileDataSetBuilder.java +++ b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/java/org/deegree/tile/persistence/remotewms/TileDataSetBuilder.java @@ -58,8 +58,11 @@ Occam Labs UG (haftungsbeschränkt) import org.deegree.tile.TileDataSet; import org.deegree.tile.TileMatrix; import org.deegree.tile.TileMatrixSet; +import org.deegree.tile.persistence.remotewms.jaxb.ParameterScopeType; +import org.deegree.tile.persistence.remotewms.jaxb.ParameterUseType; import org.deegree.tile.persistence.remotewms.jaxb.RemoteWMSTileStoreJAXB; import org.deegree.tile.persistence.remotewms.jaxb.RemoteWMSTileStoreJAXB.TileDataSet.RequestParams; +import org.deegree.tile.persistence.remotewms.jaxb.RemoteWMSTileStoreJAXB.TileDataSet.RequestParams.Parameter; import org.deegree.tile.tilematrixset.TileMatrixSetManager; /** @@ -107,6 +110,12 @@ private DefaultTileDataSet buildTileDataSet( RequestParams requestParams, TileMa List styles = splitNullSafe( requestParams.getStyles() ); String format = requestParams.getFormat(); String crs = requestParams.getCRS(); + Map defaultGetMap = new HashMap(); + Map defaultGetFeatureInfo = new HashMap(); + Map hardGetMap = new HashMap(); + Map hardGetFeatureInfo = new HashMap(); + extractParameters( requestParams.getParameter(), defaultGetMap, defaultGetFeatureInfo, hardGetMap, + hardGetFeatureInfo ); if ( outputFormat.startsWith( "image/" ) ) { outputFormat = outputFormat.substring( 6 ); @@ -114,7 +123,7 @@ private DefaultTileDataSet buildTileDataSet( RequestParams requestParams, TileMa List dataLevels = new ArrayList(); for ( TileMatrix tm : tms.getTileMatrices() ) { - TileDataLevel m = new RemoteWMSTileDataLevel( tm, format, layers, styles, client, outputFormat, crs ); + TileDataLevel m = new RemoteWMSTileDataLevel( tm, format, layers, styles, client, outputFormat, crs, defaultGetMap, defaultGetFeatureInfo, hardGetMap, hardGetFeatureInfo ); dataLevels.add( 0, m ); } return new DefaultTileDataSet( dataLevels, tms, "image/" + outputFormat ); @@ -128,4 +137,48 @@ private static List splitNullSafe( String csv ) { return asList( tokens ); } + private static void extractParameters( List params, Map defaultParametersGetMap, + Map defaultParametersGetFeatureInfo, + Map hardParametersGetMap, + Map hardParametersGetFeatureInfo ) { + if ( params != null && !params.isEmpty() ) { + for ( Parameter p : params ) { + String name = p.getName(); + String value = p.getValue(); + ParameterUseType use = p.getUse(); + ParameterScopeType scope = p.getScope(); + switch ( use ) { + case ALLOW_OVERRIDE: + switch ( scope ) { + case GET_MAP: + defaultParametersGetMap.put( name, value ); + break; + case GET_FEATURE_INFO: + defaultParametersGetFeatureInfo.put( name, value ); + break; + default: + defaultParametersGetMap.put( name, value ); + defaultParametersGetFeatureInfo.put( name, value ); + break; + } + break; + case FIXED: + switch ( scope ) { + case GET_MAP: + hardParametersGetMap.put( name, value ); + break; + case GET_FEATURE_INFO: + hardParametersGetFeatureInfo.put( name, value ); + break; + default: + hardParametersGetMap.put( name, value ); + hardParametersGetFeatureInfo.put( name, value ); + break; + } + break; + } + } + } + } + } diff --git a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/resources/META-INF/schemas/datasource/tile/remotewms/3.2.0/remotewms.xsd b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/resources/META-INF/schemas/datasource/tile/remotewms/3.2.0/remotewms.xsd index d5377b149f..8a54bc6473 100644 --- a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/resources/META-INF/schemas/datasource/tile/remotewms/3.2.0/remotewms.xsd +++ b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewms/src/main/resources/META-INF/schemas/datasource/tile/remotewms/3.2.0/remotewms.xsd @@ -1,7 +1,7 @@ + xmlns:r="http://www.deegree.org/datasource/tile/remotewms" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1"> @@ -69,6 +69,17 @@ CRS to use for remote requests + + + + + + + + + + + @@ -80,4 +91,19 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/pom.xml b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/pom.xml index 36cc105723..354350550b 100644 --- a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/pom.xml +++ b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/pom.xml @@ -11,7 +11,7 @@ org.deegree deegree-tilestores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/src/main/java/org/deegree/tile/persistence/remotewmts/RemoteWMTSTileDataLevel.java b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/src/main/java/org/deegree/tile/persistence/remotewmts/RemoteWMTSTileDataLevel.java index 85e989ba7c..a9ab669876 100644 --- a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/src/main/java/org/deegree/tile/persistence/remotewmts/RemoteWMTSTileDataLevel.java +++ b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/src/main/java/org/deegree/tile/persistence/remotewmts/RemoteWMTSTileDataLevel.java @@ -37,6 +37,10 @@ import static org.deegree.tile.Tiles.calcTileEnvelope; +import java.util.HashMap; +import java.util.Map; + +import org.deegree.commons.utils.RequestUtils; import org.deegree.geometry.Envelope; import org.deegree.protocol.wmts.client.WMTSClient; import org.deegree.protocol.wmts.ops.GetTile; @@ -70,6 +74,10 @@ class RemoteWMTSTileDataLevel implements TileDataLevel { private final String outputFormat; + private Map defaultGetMap; + + private Map hardGetMap; + /** * Creates a new {@link RemoteWMTSTileDataLevel} instance. * @@ -90,9 +98,12 @@ class RemoteWMTSTileDataLevel implements TileDataLevel { * @param outputFormat * if not null, images will be recoded into specified output format (use ImageIO like * formats, eg. 'png') + * @param hardGetMap + * @param defaultGetMap */ - RemoteWMTSTileDataLevel( TileMatrix matrix, String remoteTileMatrixSetId, String remoteTileMatrixId, String requestFormat, - String layer, String style, WMTSClient client, String outputFormat ) { + RemoteWMTSTileDataLevel( TileMatrix matrix, String remoteTileMatrixSetId, String remoteTileMatrixId, + String requestFormat, String layer, String style, WMTSClient client, String outputFormat, + Map defaultGetMap, Map hardGetMap ) { this.matrix = matrix; this.remoteTileMatrixSetId = remoteTileMatrixSetId; this.remoteTileMatrixId = remoteTileMatrixId; @@ -101,6 +112,8 @@ class RemoteWMTSTileDataLevel implements TileDataLevel { this.style = style; this.outputFormat = outputFormat; this.client = client; + this.defaultGetMap = defaultGetMap; + this.hardGetMap = hardGetMap; } @Override @@ -114,7 +127,11 @@ public Tile getTile( long x, long y ) { return null; } Envelope tileEnvelope = calcTileEnvelope( matrix, x, y ); - GetTile request = new GetTile( layer, style, requestFormat, remoteTileMatrixSetId, remoteTileMatrixId, x, y ); + Map overriddenParameters = new HashMap(); + RequestUtils.replaceParameters( overriddenParameters, RequestUtils.getCurrentThreadRequestParameters().get(), + defaultGetMap, hardGetMap ); + GetTile request = new GetTile( layer, style, requestFormat, remoteTileMatrixSetId, remoteTileMatrixId, x, y, + overriddenParameters ); return new RemoteWMTSTile( client, request, outputFormat, tileEnvelope ); } } diff --git a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/src/main/java/org/deegree/tile/persistence/remotewmts/TileDataSetBuilder.java b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/src/main/java/org/deegree/tile/persistence/remotewmts/TileDataSetBuilder.java index e697833550..de863020bc 100644 --- a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/src/main/java/org/deegree/tile/persistence/remotewmts/TileDataSetBuilder.java +++ b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/src/main/java/org/deegree/tile/persistence/remotewmts/TileDataSetBuilder.java @@ -55,8 +55,10 @@ Occam Labs UG (haftungsbeschränkt) import org.deegree.tile.TileDataSet; import org.deegree.tile.TileMatrix; import org.deegree.tile.TileMatrixSet; +import org.deegree.tile.persistence.remotewmts.jaxb.ParameterUseType; import org.deegree.tile.persistence.remotewmts.jaxb.RemoteWMTSTileStoreJAXB; import org.deegree.tile.persistence.remotewmts.jaxb.RemoteWMTSTileStoreJAXB.TileDataSet.RequestParams; +import org.deegree.tile.persistence.remotewmts.jaxb.RemoteWMTSTileStoreJAXB.TileDataSet.RequestParams.Parameter; import org.deegree.tile.tilematrixset.TileMatrixSetManager; /** @@ -165,6 +167,10 @@ private List buildTileDataLevels( TileMatrixSet localTileMatrixSe String format = requestParams.getFormat(); String remoteTileMatrixSetId = remoteTileMatrixSet.getIdentifier(); + Map defaultGetMap = new HashMap(); + Map hardGetMap = new HashMap(); + extractParameters( requestParams.getParameter(), defaultGetMap, hardGetMap ); + List dataLevels = new ArrayList(); List localTileMatrices = localTileMatrixSet.getTileMatrices(); List remoteTileMatrices = remoteTileMatrixSet.getTileMatrices(); @@ -177,7 +183,7 @@ private List buildTileDataLevels( TileMatrixSet localTileMatrixSe TileMatrix remoteTileMatrix = remoteTileMatrices.get( i ); String remoteTileMatrixId = remoteTileMatrix.getIdentifier(); TileDataLevel level = buildTileDataLevel( localTileMatrix, remoteTileMatrixSetId, remoteTileMatrixId, - layer, style, format, outputFormat ); + layer, style, format, outputFormat, defaultGetMap, hardGetMap ); dataLevels.add( level ); } return dataLevels; @@ -185,9 +191,29 @@ private List buildTileDataLevels( TileMatrixSet localTileMatrixSe private TileDataLevel buildTileDataLevel( TileMatrix tileMatrix, String remoteTileMatrixSetId, String remoteTileMatrixId, String layer, String style, String format, - String outputFormat ) { + String outputFormat, Map defaultGetMap, + Map hardGetMap ) { return new RemoteWMTSTileDataLevel( tileMatrix, remoteTileMatrixSetId, remoteTileMatrixId, format, layer, - style, client, outputFormat ); + style, client, outputFormat, defaultGetMap, hardGetMap ); + } + + private static void extractParameters( List params, Map defaultParametersGetMap, + Map hardParametersGetMap ) { + if ( params != null && !params.isEmpty() ) { + for ( Parameter p : params ) { + String name = p.getName(); + String value = p.getValue(); + ParameterUseType use = p.getUse(); + switch ( use ) { + case ALLOW_OVERRIDE: + defaultParametersGetMap.put( name, value ); + break; + case FIXED: + hardParametersGetMap.put( name, value ); + break; + } + } + } } } diff --git a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/src/main/resources/META-INF/schemas/datasource/tile/remotewmts/3.2.0/remotewmts.xsd b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/src/main/resources/META-INF/schemas/datasource/tile/remotewmts/3.2.0/remotewmts.xsd index 74e8a7287d..81bd5697e5 100644 --- a/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/src/main/resources/META-INF/schemas/datasource/tile/remotewmts/3.2.0/remotewmts.xsd +++ b/deegree-datastores/deegree-tilestores/deegree-tilestore-remotewmts/src/main/resources/META-INF/schemas/datasource/tile/remotewmts/3.2.0/remotewmts.xsd @@ -1,7 +1,7 @@ + xmlns:r="http://www.deegree.org/datasource/tile/remotewmts" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1"> @@ -75,6 +75,16 @@ Identifier of the remote tile matrix set + + + + + + + + + + @@ -86,4 +96,11 @@ - \ No newline at end of file + + + + + + + + diff --git a/deegree-datastores/deegree-tilestores/pom.xml b/deegree-datastores/deegree-tilestores/pom.xml index c74cf11c2e..9f03468bca 100644 --- a/deegree-datastores/deegree-tilestores/pom.xml +++ b/deegree-datastores/deegree-tilestores/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree-datastores - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-datastores/pom.xml b/deegree-datastores/pom.xml index d4bbffc9d3..57bf4a5241 100644 --- a/deegree-datastores/pom.xml +++ b/deegree-datastores/pom.xml @@ -9,7 +9,7 @@ org.deegree deegree - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT @@ -28,7 +28,6 @@ deegree-featurestores deegree-mdstores - deegree-coveragestores deegree-tilestores diff --git a/deegree-layers/deegree-layers-coverage/pom.xml b/deegree-layers/deegree-layers-coverage/pom.xml index 6c719166ca..eb159b942b 100644 --- a/deegree-layers/deegree-layers-coverage/pom.xml +++ b/deegree-layers/deegree-layers-coverage/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-layers - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-layers/deegree-layers-feature/pom.xml b/deegree-layers/deegree-layers-feature/pom.xml index 7b9c92775c..b76d16e615 100644 --- a/deegree-layers/deegree-layers-feature/pom.xml +++ b/deegree-layers/deegree-layers-feature/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-layers - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-layers/deegree-layers-feature/src/main/java/org/deegree/layer/persistence/feature/FeatureLayer.java b/deegree-layers/deegree-layers-feature/src/main/java/org/deegree/layer/persistence/feature/FeatureLayer.java index aee7324ce1..da92299236 100644 --- a/deegree-layers/deegree-layers-feature/src/main/java/org/deegree/layer/persistence/feature/FeatureLayer.java +++ b/deegree-layers/deegree-layers-feature/src/main/java/org/deegree/layer/persistence/feature/FeatureLayer.java @@ -117,6 +117,7 @@ public FeatureLayerData mapQuery( final LayerQuery query, List headers ) throw new OWSException( "The style " + ref.getName() + " is not defined for layer " + getMetadata().getName() + ".", "StyleNotDefined", "styles" ); } + style = style.filter( query.getScale() ); OperatorFilter filter = buildFilterForMap( this.filter, style, query, dimFilterBuilder, headers ); diff --git a/deegree-layers/deegree-layers-remotewms/pom.xml b/deegree-layers/deegree-layers-remotewms/pom.xml index 52fe8a086b..c059868fa4 100644 --- a/deegree-layers/deegree-layers-remotewms/pom.xml +++ b/deegree-layers/deegree-layers-remotewms/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-layers - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-layers/deegree-layers-remotewms/src/main/java/org/deegree/layer/persistence/remotewms/RemoteWMSLayer.java b/deegree-layers/deegree-layers-remotewms/src/main/java/org/deegree/layer/persistence/remotewms/RemoteWMSLayer.java index 93a9cd9f6d..cfaeb309ef 100644 --- a/deegree-layers/deegree-layers-remotewms/src/main/java/org/deegree/layer/persistence/remotewms/RemoteWMSLayer.java +++ b/deegree-layers/deegree-layers-remotewms/src/main/java/org/deegree/layer/persistence/remotewms/RemoteWMSLayer.java @@ -1,6 +1,7 @@ package org.deegree.layer.persistence.remotewms; import static java.util.Collections.singletonList; +import static org.deegree.commons.utils.RequestUtils.replaceParameters; import static org.deegree.protocol.wms.WMSConstants.WMSRequestType.GetMap; import static org.slf4j.LoggerFactory.getLogger; @@ -9,7 +10,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import org.deegree.cs.coordinatesystems.ICRS; import org.deegree.cs.persistence.CRSManager; @@ -130,31 +130,11 @@ private void extractParameters( List params ) { } } - private static void handleParameters( Map map, Map originals, - Map defaults, Map hards ) { - // handle default params - for ( String def : defaults.keySet() ) { - String key = def.toUpperCase(); - if ( originals.containsKey( key ) ) { - map.put( key, originals.get( key ) ); - } else { - map.put( def, defaults.get( def ) ); - } - } - // handle preset params - for ( Entry e : hards.entrySet() ) { - if ( map.containsKey( e.getKey().toLowerCase() ) ) { - map.put( e.getKey().toLowerCase(), e.getValue() ); - } else - map.put( e.getKey(), e.getValue() ); - } - } - @Override public RemoteWMSLayerData mapQuery( LayerQuery query, List headers ) { try { Map extraParams = new HashMap(); - handleParameters( extraParams, query.getParameters(), defaultParametersGetMap, hardParametersGetMap ); + replaceParameters( extraParams, query.getParameters(), defaultParametersGetMap, hardParametersGetMap ); ICRS crs = this.crs; if ( !alwaysUseDefaultCrs ) { ICRS envCrs = query.getEnvelope().getCoordinateSystem(); @@ -176,8 +156,8 @@ public RemoteWMSLayerData mapQuery( LayerQuery query, List headers ) { @Override public RemoteWMSLayerData infoQuery( LayerQuery query, List headers ) { Map extraParams = new HashMap(); - handleParameters( extraParams, query.getParameters(), defaultParametersGetFeatureInfo, - hardParametersGetFeatureInfo ); + replaceParameters( extraParams, query.getParameters(), defaultParametersGetFeatureInfo, + hardParametersGetFeatureInfo ); GetFeatureInfo gfi = new GetFeatureInfo( Collections.singletonList( originalName ), query.getWidth(), query.getHeight(), query.getX(), query.getY(), query.getEnvelope(), diff --git a/deegree-layers/deegree-layers-tile/pom.xml b/deegree-layers/deegree-layers-tile/pom.xml index 6b67e65a74..e9f20d1cd0 100644 --- a/deegree-layers/deegree-layers-tile/pom.xml +++ b/deegree-layers/deegree-layers-tile/pom.xml @@ -13,7 +13,7 @@ org.deegree deegree-layers - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-layers/pom.xml b/deegree-layers/pom.xml index be16ad97b4..49876de46e 100644 --- a/deegree-layers/pom.xml +++ b/deegree-layers/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-misc/deegree-api-examples/pom.xml b/deegree-misc/deegree-api-examples/pom.xml index 0a0fad9d86..4d45cafdd7 100644 --- a/deegree-misc/deegree-api-examples/pom.xml +++ b/deegree-misc/deegree-api-examples/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-misc - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-misc/deegree-javacheck/pom.xml b/deegree-misc/deegree-javacheck/pom.xml index 7df4d27752..7ce715d323 100644 --- a/deegree-misc/deegree-javacheck/pom.xml +++ b/deegree-misc/deegree-javacheck/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-misc - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-misc/deegree-tomcat/pom.xml b/deegree-misc/deegree-tomcat/pom.xml index 00464b1fe6..a43c1ef962 100644 --- a/deegree-misc/deegree-tomcat/pom.xml +++ b/deegree-misc/deegree-tomcat/pom.xml @@ -11,7 +11,7 @@ org.deegree deegree-misc - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-misc/pom.xml b/deegree-misc/pom.xml index 5d4a8fcbe8..8a2d6ebc69 100644 --- a/deegree-misc/pom.xml +++ b/deegree-misc/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-processproviders/deegree-processprovider-example/pom.xml b/deegree-processproviders/deegree-processprovider-example/pom.xml index 8746d74e38..ea20d786a5 100644 --- a/deegree-processproviders/deegree-processprovider-example/pom.xml +++ b/deegree-processproviders/deegree-processprovider-example/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-processproviders - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-processproviders/deegree-processprovider-jrxml/pom.xml b/deegree-processproviders/deegree-processprovider-jrxml/pom.xml index 58281f2f74..7a74267e0f 100644 --- a/deegree-processproviders/deegree-processprovider-jrxml/pom.xml +++ b/deegree-processproviders/deegree-processprovider-jrxml/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-processproviders - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-processproviders/deegree-processprovider-sextante/pom.xml b/deegree-processproviders/deegree-processprovider-sextante/pom.xml index a698b82ee5..ce0407e5ac 100644 --- a/deegree-processproviders/deegree-processprovider-sextante/pom.xml +++ b/deegree-processproviders/deegree-processprovider-sextante/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-processproviders - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-processproviders/deegree-processprovider-style/pom.xml b/deegree-processproviders/deegree-processprovider-style/pom.xml index 1057243cfc..0df426e757 100644 --- a/deegree-processproviders/deegree-processprovider-style/pom.xml +++ b/deegree-processproviders/deegree-processprovider-style/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-processproviders - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-processproviders/pom.xml b/deegree-processproviders/pom.xml index bb5adfd44a..3ca3a57301 100644 --- a/deegree-processproviders/pom.xml +++ b/deegree-processproviders/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-services/deegree-services-commons/pom.xml b/deegree-services/deegree-services-commons/pom.xml index ae3ebdbe98..26d3653bbd 100644 --- a/deegree-services/deegree-services-commons/pom.xml +++ b/deegree-services/deegree-services-commons/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-services - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-services/deegree-services-config/pom.xml b/deegree-services/deegree-services-config/pom.xml index 0479ce5ea4..1f1d411e1c 100644 --- a/deegree-services/deegree-services-config/pom.xml +++ b/deegree-services/deegree-services-config/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-services - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-services/deegree-services-csw/pom.xml b/deegree-services/deegree-services-csw/pom.xml index 296da72778..d01bd6b6b9 100644 --- a/deegree-services/deegree-services-csw/pom.xml +++ b/deegree-services/deegree-services-csw/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-services - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-services/deegree-services-sos/pom.xml b/deegree-services/deegree-services-sos/pom.xml index 1fb2bd64f3..ba0da69375 100644 --- a/deegree-services/deegree-services-sos/pom.xml +++ b/deegree-services/deegree-services-sos/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-services - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-services/deegree-services-wcs/pom.xml b/deegree-services/deegree-services-wcs/pom.xml index c4b37d291e..aa6fc99463 100644 --- a/deegree-services/deegree-services-wcs/pom.xml +++ b/deegree-services/deegree-services-wcs/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-services - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-services/deegree-services-wfs/pom.xml b/deegree-services/deegree-services-wfs/pom.xml index c440d02510..d6a8687b98 100644 --- a/deegree-services/deegree-services-wfs/pom.xml +++ b/deegree-services/deegree-services-wfs/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-services - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-services/deegree-services-wms/pom.xml b/deegree-services/deegree-services-wms/pom.xml index f9cb9219d5..947d468714 100644 --- a/deegree-services/deegree-services-wms/pom.xml +++ b/deegree-services/deegree-services-wms/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-services - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-services/deegree-services-wms/src/main/java/org/deegree/services/wms/MapService.java b/deegree-services/deegree-services-wms/src/main/java/org/deegree/services/wms/MapService.java index e3a8312385..a62f7c9c6f 100644 --- a/deegree-services/deegree-services-wms/src/main/java/org/deegree/services/wms/MapService.java +++ b/deegree-services/deegree-services-wms/src/main/java/org/deegree/services/wms/MapService.java @@ -54,7 +54,6 @@ import java.util.LinkedList; import java.util.List; import java.util.ListIterator; -import java.util.Map; import java.util.Timer; import org.deegree.commons.annotations.LoggingNotes; @@ -180,6 +179,7 @@ public MapService( ServiceConfigurationType conf, XMLAdapter adapter, DeegreeWor LOG.warn( "Theme with id {} was not available.", id ); } else { themes.add( thm ); + themeMap.put( thm.getMetadata().getName(), thm ); for ( org.deegree.layer.Layer l : Themes.getAllLayers( thm ) ) { newLayers.put( l.getMetadata().getName(), l ); @@ -314,7 +314,7 @@ public boolean hasTheme( String name ) { public void getMap( org.deegree.protocol.wms.ops.GetMap gm, List headers, RenderContext ctx ) throws OWSException { - Iterator iter = gm.getStyles().iterator(); + Iterator styleItr = gm.getStyles().iterator(); MapOptionsMaps options = gm.getRenderingOptions(); List mapOptions = new ArrayList(); List list = new ArrayList(); @@ -323,16 +323,15 @@ public void getMap( org.deegree.protocol.wms.ops.GetMap gm, List headers List queries = new ArrayList(); - ListIterator> filterIter = gm.getSldFilters().listIterator(); + Iterator layerItr = gm.getLayers().iterator(); + List filters = gm.getFilters(); + Iterator filterItr = filters == null ? null : filters.iterator(); + while ( layerItr.hasNext() ) { + LayerRef lr = layerItr.next(); + StyleRef sr = styleItr.next(); + OperatorFilter f = filterItr == null ? null : filterItr.next(); - Pair curFilter = null; - - if ( filterIter.hasNext() ) { - curFilter = filterIter.next(); - } - - for ( LayerRef lr : gm.getLayers() ) { - LayerQuery query = buildQuery( iter, lr, options, mapOptions, curFilter, filterIter, gm ); + LayerQuery query = buildQuery( sr, lr, options, mapOptions, f, gm ); queries.add( query ); } @@ -359,29 +358,15 @@ public void getMap( org.deegree.protocol.wms.ops.GetMap gm, List headers ScaleFunction.getCurrentScaleValue().remove(); } - private LayerQuery buildQuery( Iterator iter, LayerRef lr, MapOptionsMaps options, - List mapOptions, Pair curFilter, - ListIterator> filterIter, - org.deegree.protocol.wms.ops.GetMap gm ) { - Map styles = new HashMap(); - StyleRef style = iter.next(); + private LayerQuery buildQuery( StyleRef style, LayerRef lr, MapOptionsMaps options, List mapOptions, + OperatorFilter f, org.deegree.protocol.wms.ops.GetMap gm ) { + for ( org.deegree.layer.Layer l : Themes.getAllLayers( themeMap.get( lr.getName() ) ) ) { insertMissingOptions( l.getMetadata().getName(), options, l.getMetadata().getMapOptions(), defaultLayerOptions ); mapOptions.add( options.get( l.getMetadata().getName() ) ); - StyleRef ref; - if ( style.getStyle() != null ) { - ref = new StyleRef( style.getStyle() ); - } else { - ref = new StyleRef( style.getName() ); - } - styles.put( l.getMetadata().getName(), ref ); - } - OperatorFilter f = null; - if ( curFilter != null && curFilter.first.equals( lr.getName() ) ) { - f = curFilter.second; - curFilter = filterIter.hasNext() ? filterIter.next() : null; } + LayerQuery query = new LayerQuery( gm.getBoundingBox(), gm.getWidth(), gm.getHeight(), style, f, gm.getParameterMap(), gm.getDimensions(), gm.getPixelSize(), options, gm.getQueryBox() ); @@ -427,24 +412,19 @@ public FeatureCollection getFeatures( org.deegree.protocol.wms.ops.GetFeatureInf } private List prepareGetFeatures( org.deegree.protocol.wms.ops.GetFeatureInfo gfi ) { - Map styles = new HashMap(); - Iterator iter = gfi.getStyles().iterator(); List queries = new ArrayList(); - ListIterator> filterIter = gfi.getSldFilters().listIterator(); - Pair curFilter = filterIter.hasNext() ? filterIter.next() : null; - for ( LayerRef lr : gfi.getQueryLayers() ) { - StyleRef style = iter.next(); - for ( org.deegree.layer.Layer l : Themes.getAllLayers( themeMap.get( lr.getName() ) ) ) { - styles.put( l.getMetadata().getName(), style ); - } - OperatorFilter f = null; - if ( curFilter != null && curFilter.first.equals( lr.getName() ) ) { - f = curFilter.second; - curFilter = filterIter.hasNext() ? filterIter.next() : null; - } + Iterator layerItr = gfi.getQueryLayers().iterator(); + Iterator styleItr = gfi.getStyles().iterator(); + List filters = gfi.getFilters(); + Iterator filterItr = filters == null ? null : filters.iterator(); + while ( layerItr.hasNext() ) { + LayerRef lr = layerItr.next(); + StyleRef sr = styleItr.next(); + OperatorFilter f = filterItr == null ? null : filterItr.next(); + LayerQuery query = new LayerQuery( gfi.getEnvelope(), gfi.getWidth(), gfi.getHeight(), gfi.getX(), - gfi.getY(), gfi.getFeatureCount(), f, style, gfi.getParameterMap(), + gfi.getY(), gfi.getFeatureCount(), f, sr, gfi.getParameterMap(), gfi.getDimensions(), new MapOptionsMaps(), gfi.getEnvelope() ); queries.add( query ); } diff --git a/deegree-services/deegree-services-wms/src/main/java/org/deegree/services/wms/controller/capabilities/Capabilities111XMLAdapter.java b/deegree-services/deegree-services-wms/src/main/java/org/deegree/services/wms/controller/capabilities/Capabilities111XMLAdapter.java index 673d6386e6..86e32cdf38 100644 --- a/deegree-services/deegree-services-wms/src/main/java/org/deegree/services/wms/controller/capabilities/Capabilities111XMLAdapter.java +++ b/deegree-services/deegree-services-wms/src/main/java/org/deegree/services/wms/controller/capabilities/Capabilities111XMLAdapter.java @@ -39,6 +39,7 @@ import static org.deegree.commons.xml.CommonNamespaces.XLINK_PREFIX; import static org.deegree.commons.xml.CommonNamespaces.XLNNS; import static org.deegree.layer.dims.Dimension.formatDimensionValueList; +import static org.deegree.services.wms.controller.capabilities.WmsCapabilities111SpatialMetadataWriter.writeSrsAndEnvelope; import java.util.List; import java.util.Map; @@ -52,12 +53,15 @@ import org.deegree.commons.ows.metadata.ServiceProvider; import org.deegree.commons.utils.Pair; import org.deegree.commons.xml.XMLAdapter; +import org.deegree.geometry.metadata.SpatialMetadata; import org.deegree.layer.dims.Dimension; +import org.deegree.layer.metadata.LayerMetadata; import org.deegree.services.metadata.OWSMetadataProvider; import org.deegree.services.wms.MapService; import org.deegree.services.wms.controller.WMSController; import org.deegree.style.se.unevaluated.Style; import org.deegree.theme.Theme; +import org.deegree.theme.Themes; /** * Capabilities111XMLAdapter @@ -157,9 +161,24 @@ private void writeThemes( XMLStreamWriter writer, List themes ) } else { // synthetic root layer needed writer.writeStartElement( "Layer" ); - // TODO - writer.writeAttribute( "queryable", "1" ); writeElement( writer, "Title", "Root" ); + + // TODO think about a push approach instead of a pull approach + LayerMetadata lmd = null; + for ( Theme t : themes ) { + for ( org.deegree.layer.Layer l : Themes.getAllLayers( t ) ) { + if ( lmd == null ) { + lmd = l.getMetadata(); + } else { + lmd.merge( l.getMetadata() ); + } + } + } + if ( lmd != null ) { + SpatialMetadata smd = lmd.getSpatialMetadata(); + writeSrsAndEnvelope( writer, smd.getCoordinateSystems(), smd.getEnvelope() ); + } + for ( Theme t : themes ) { themeWriter.writeTheme( writer, t ); } diff --git a/deegree-services/deegree-services-wms/src/main/java/org/deegree/services/wms/controller/capabilities/Capabilities130XMLAdapter.java b/deegree-services/deegree-services-wms/src/main/java/org/deegree/services/wms/controller/capabilities/Capabilities130XMLAdapter.java index 4a49637cac..5ee5995dc0 100644 --- a/deegree-services/deegree-services-wms/src/main/java/org/deegree/services/wms/controller/capabilities/Capabilities130XMLAdapter.java +++ b/deegree-services/deegree-services-wms/src/main/java/org/deegree/services/wms/controller/capabilities/Capabilities130XMLAdapter.java @@ -42,6 +42,7 @@ import static org.deegree.commons.xml.CommonNamespaces.XSINS; import static org.deegree.commons.xml.XMLAdapter.writeElement; import static org.deegree.layer.dims.Dimension.formatDimensionValueList; +import static org.deegree.services.wms.controller.capabilities.WmsCapabilities130SpatialMetadataWriter.writeSrsAndEnvelope; import static org.slf4j.LoggerFactory.getLogger; import java.util.List; @@ -58,12 +59,15 @@ import org.deegree.commons.ows.metadata.ServiceProvider; import org.deegree.commons.utils.Pair; import org.deegree.commons.xml.stax.XMLStreamUtils; +import org.deegree.geometry.metadata.SpatialMetadata; import org.deegree.layer.dims.Dimension; +import org.deegree.layer.metadata.LayerMetadata; import org.deegree.services.metadata.OWSMetadataProvider; import org.deegree.services.wms.MapService; import org.deegree.services.wms.controller.WMSController; import org.deegree.style.se.unevaluated.Style; import org.deegree.theme.Theme; +import org.deegree.theme.Themes; import org.slf4j.Logger; /** @@ -188,9 +192,24 @@ private void writeThemes( XMLStreamWriter writer, List themes ) } else { // synthetic root layer needed writer.writeStartElement( WMSNS, "Layer" ); - // TODO - writer.writeAttribute( "queryable", "1" ); writeElement( writer, WMSNS, "Title", "Root" ); + + // TODO think about a push approach instead of a pull approach + LayerMetadata lmd = null; + for ( Theme t : themes ) { + for ( org.deegree.layer.Layer l : Themes.getAllLayers( t ) ) { + if ( lmd == null ) { + lmd = l.getMetadata(); + } else { + lmd.merge( l.getMetadata() ); + } + } + } + if ( lmd != null ) { + SpatialMetadata smd = lmd.getSpatialMetadata(); + writeSrsAndEnvelope( writer, smd.getCoordinateSystems(), smd.getEnvelope() ); + } + for ( Theme t : themes ) { themeWriter.writeTheme( writer, t ); } diff --git a/deegree-services/deegree-services-wmts/pom.xml b/deegree-services/deegree-services-wmts/pom.xml index ec0890f5b5..ad0ebcb4c1 100644 --- a/deegree-services/deegree-services-wmts/pom.xml +++ b/deegree-services/deegree-services-wmts/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-services - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-services/deegree-services-wmts/src/main/java/org/deegree/services/wmts/controller/WMTSController.java b/deegree-services/deegree-services-wmts/src/main/java/org/deegree/services/wmts/controller/WMTSController.java index d041e575fd..af874d6401 100644 --- a/deegree-services/deegree-services-wmts/src/main/java/org/deegree/services/wmts/controller/WMTSController.java +++ b/deegree-services/deegree-services-wmts/src/main/java/org/deegree/services/wmts/controller/WMTSController.java @@ -59,6 +59,7 @@ Occam Labs UG (haftungsbeschränkt) import org.deegree.commons.config.ResourceInitException; import org.deegree.commons.ows.exception.OWSException; import org.deegree.commons.tom.ows.Version; +import org.deegree.commons.utils.RequestUtils; import org.deegree.commons.xml.XMLAdapter; import org.deegree.protocol.wmts.WMTSConstants.WMTSRequestType; import org.deegree.services.controller.AbstractOWS; @@ -110,28 +111,35 @@ public void init( DeegreeServicesMetadataType serviceMetadata, DeegreeServiceCon public void doKVP( Map map, HttpServletRequest request, HttpResponseBuffer response, List multiParts ) throws ServletException, IOException { - String v = map.get( "VERSION" ); - Version version = v == null ? serviceInfo.getSupportedConfigVersions().iterator().next() : parseVersion( v ); - - WMTSRequestType req; + RequestUtils.getCurrentThreadRequestParameters().set( map ); try { - req = (WMTSRequestType) ( (ImplementationMetadata) serviceInfo ).getRequestTypeByName( map.get( "REQUEST" ) ); - } catch ( IllegalArgumentException e ) { - sendException( new OWSException( "'" + map.get( "REQUEST" ) + "' is not a supported WMTS operation.", - OPERATION_NOT_SUPPORTED ), response ); - return; - } catch ( NullPointerException e ) { - sendException( new OWSException( "The REQUEST parameter is missing.", OPERATION_NOT_SUPPORTED ), response ); - return; - } - try { - dispatcher.handleRequest( req, response, map, version ); - } catch ( OWSException e ) { - LOG.debug( "The response is an exception with the message '{}'", e.getLocalizedMessage() ); - LOG.trace( "Stack trace of OWSException being sent", e ); - - sendException( e, response ); + String v = map.get( "VERSION" ); + Version version = v == null ? serviceInfo.getSupportedConfigVersions().iterator().next() : parseVersion( v ); + + WMTSRequestType req; + try { + req = (WMTSRequestType) ( (ImplementationMetadata) serviceInfo ).getRequestTypeByName( map.get( "REQUEST" ) ); + } catch ( IllegalArgumentException e ) { + sendException( new OWSException( "'" + map.get( "REQUEST" ) + "' is not a supported WMTS operation.", + OPERATION_NOT_SUPPORTED ), response ); + return; + } catch ( NullPointerException e ) { + sendException( new OWSException( "The REQUEST parameter is missing.", OPERATION_NOT_SUPPORTED ), + response ); + return; + } + + try { + dispatcher.handleRequest( req, response, map, version ); + } catch ( OWSException e ) { + LOG.debug( "The response is an exception with the message '{}'", e.getLocalizedMessage() ); + LOG.trace( "Stack trace of OWSException being sent", e ); + + sendException( e, response ); + } + } finally { + RequestUtils.getCurrentThreadRequestParameters().remove(); } } @@ -160,4 +168,5 @@ private void sendException( OWSException e, HttpResponseBuffer response ) public String getMetadataUrlTemplate() { return metadataUrlTemplate; } + } diff --git a/deegree-services/deegree-services-wps/pom.xml b/deegree-services/deegree-services-wps/pom.xml index 047b032aaf..ab1c602e13 100644 --- a/deegree-services/deegree-services-wps/pom.xml +++ b/deegree-services/deegree-services-wps/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-services - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-services/deegree-services-wpvs/pom.xml b/deegree-services/deegree-services-wpvs/pom.xml index 560022313f..17eed87185 100644 --- a/deegree-services/deegree-services-wpvs/pom.xml +++ b/deegree-services/deegree-services-wpvs/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-services - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-services/deegree-webservices-handbook/pom.xml b/deegree-services/deegree-webservices-handbook/pom.xml index aa50035e75..54e1ca5108 100644 --- a/deegree-services/deegree-webservices-handbook/pom.xml +++ b/deegree-services/deegree-webservices-handbook/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree-services - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT @@ -24,10 +24,8 @@ - - maven-resources-plugin @@ -41,11 +39,17 @@ ${basedir}/target/generated-sources - src/main/sphinx-filtered + src/main/sphinx + + images/*.* + true src/main/sphinx + + images/*.* + false diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx-filtered/conf.py b/deegree-services/deegree-webservices-handbook/src/main/sphinx/conf.py similarity index 99% rename from deegree-services/deegree-webservices-handbook/src/main/sphinx-filtered/conf.py rename to deegree-services/deegree-webservices-handbook/src/main/sphinx/conf.py index f519fae69d..e534ee76d8 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx-filtered/conf.py +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/conf.py @@ -41,7 +41,7 @@ # General information about the project. project = u'deegree webservices' -copyright = u'2012, The deegree project' +copyright = u'2013, The deegree project' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/coveragestores.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/coveragestores.rst index 12cc0d8ee0..bace7c6b7f 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/coveragestores.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/coveragestores.rst @@ -1,15 +1,10 @@ .. _anchor-configuration-coveragestore: -============================ -Coverage store configuration -============================ +=============== +Coverage stores +=============== -Coverage stores are data stores that provide access to raster data. The two most common use cases for coverage stores in a deegree workspace are: - -* Accessing via WCS -* Providing of data for raster layers - -You can access this configuration level by clicking on the **coverage stores** link in the administration console. The configuration files are located in the **datasources/coverage/** subdirectory of the active deegree workspace directory. +Coverage stores are resources that provide access to raster data. The most common use case for coverage stores is to provide data for coverage layers. You can access this configuration level by clicking the **coverage stores** link in the service console. The corresponding resource configuration files are located in subdirectory **datasources/coverage/** of the active deegree workspace directory. .. figure:: images/workspace-overview-coverage.png :figwidth: 80% @@ -18,5 +13,94 @@ You can access this configuration level by clicking on the **coverage stores** l Coverage store resources provide access to raster data +For raster data there are three different possible configurations. One is for and one is for . The third possibility is for . If you are not sure which one to use, you probably want the configuration. + +------ +Raster +------ + +The most common method to provide coverages with deegree, is to use Raster. +With the Raster configuration it is possible to provide single RasterFiles or a complete RasterDirectory directly. + +Here are two examples showing RasterFile and RasterDirectory configuration: + +.. code-block:: xml + + + EPSG:26912 + ../../../data/utah/raster/dem.tiff + + +.. code-block:: xml + + + EPSG:26912 + ../../../data/utah/raster/Satellite_Provo/ + + +A Raster can have several attributes: + +* The originLocation attribute can have the values center or outer to declare the pixel origin of the coverage. +* The nodata attribute can be optionally used to declare a nodata value. +* The readWorldFiles parameter can have the values true or false to indicate if worlfiles will be read. Default value is true. +* The StorageCRS paramter is optional but recommended. It contains the EPSG code of the coverage sources. +* The RasterFile and RasterDirectory parameters contain the path to your coverage sources. The RasterDirectory paramter can additionally have the recursive attribute with true and false as value to declare subdirectories to be included. + +--------------------- +MultiResolutionRaster +--------------------- + +A wraps single raster elements and adds a resolution for each raster. This means, depending on the resolution of the map a different raster source is used. + +Here is an example for a MultiResolutionRaster: + +.. code-block:: xml + + + EPSG:26912 + + + EPSG:26912 + ../../../data/utah/raster/dem.tiff + + + + + EPSG:26912 + ../../../data/utah/raster/Satellite_Provo/ + + + + +* A MultiResolustionRaster contains at least one Resolution +* The Raster parameter has a res attribute. Its value is related to the provided resolution. +* The StorageCRS paramter is optional but recommended. It contains the EPSG code of the coverage sources. +* All elements and attributes from the Raster configuration can be used for the resolutions. + +------- +Pyramid +------- + +A is used for deegree's support for raster pyramids. For this, it is required that the raster pyramid must be a GeoTIFF, containing the extent and coordinate system of the data. Overlays must be multiples of 2. This is best tested with source data being processed with GDAL. + +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Prerequisities for Pyramids +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* Must be a GeoTiff as BigTiff +* Must be RGB or RGBA +* CRS must be contained +* Must be tiled +* Should have overviews where each overview must consist of 1/2 resolution + +The following example shows, how to configure a coverage pyramid: + +.. code-block:: xml + + + data/example.tif + EPSG:4326 + -TBD +* A Pyramid contains a PyramidFile parameter with the path to the pyramid as its value. +* A Pyramid contains a CRS parameter describing the source CRS of the pyramid as EPSG code. diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/crs.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/crs.rst index 4033c65a98..71c9aa689e 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/crs.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/crs.rst @@ -4,11 +4,26 @@ Coordinate reference systems ============================ -Coordinate reference system are used in many places in deegree webservices: +Coordinate reference system identifiers are used in many places in deegree webservices: * In incoming service requests (e.g. ``GetFeature``-requests to the WFS) -* In a lot of configuration files (e.g. in :ref:`anchor-configuration-featurestore`) +* In a lot of resource configuration files (e.g. in :ref:`anchor-configuration-featurestore`) + +deegree has an internal CRS database that contains many commonly used coordinate reference systems. Some examples for valid CRS identifiers: + +* ``EPSG:4258`` +* ``http://www.opengis.net/gml/srs/epsg.xml#4258`` +* ``urn:ogc:def:crs:epsg::4258`` +* ``urn:opengis:def:crs:epsg::4258`` + +.. tip:: + As a rule of thumb, deegree's CRS database uses the ``EPSG:12345`` identifier variant to indicate XY axis order, while the URN variants (such as ``urn:ogc:def:crs:epsg::12345``) always use the official axis order defined by the EPSG. For example ``EPSG:4258`` and ``urn:ogc:def:crs:epsg::4258`` both refer to ETRS89, but ``EPSG:4258`` means ETRS89 in XY-order, while ``urn:ogc:def:crs:epsg::4258`` is YX (the official order defined by the EPSG for this CRS). + +.. note:: + The CRS subsystem is not fully integrated with the deegree workspace yet. Rework and proper documentation are on the roadmap for one of the next releases. If you have trouble finding a specific CRS, please `contact the deegree mailing lists for support `_. + + + -TODO diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/featurestores.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/featurestores.rst index 27f2119728..8cac771589 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/featurestores.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/featurestores.rst @@ -1,15 +1,15 @@ .. _anchor-configuration-featurestore: -=========================== -Feature store configuration -=========================== +============== +Feature stores +============== -Feature stores are data stores that provide access to stored features. The two most common use cases for feature stores are: +Feature stores are workspace resources that provide access to stored features. The two most common use cases for feature stores are: -* Accessing via WFS -* Providing of data for feature layers +* Accessing via :ref:`anchor-configuration-wfs` +* Providing of data for :ref:`anchor-configuration-feature-layers` -The remainder of this chapter describes some relevant terms and the feature store configuration files in detail. You can access this configuration level by clicking on the **feature stores** link in the administration console. The configuration files are located in the **datasources/feature/** subdirectory of the active deegree workspace directory. +The remainder of this chapter describes some relevant terms and the feature store configuration files in detail. You can access this configuration level by clicking **feature stores** in the service console. The corresponding resource configuration files are located in subdirectory ``datasources/feature/`` of the active deegree workspace directory. .. figure:: images/workspace-overview-feature.png :figwidth: 80% @@ -24,18 +24,18 @@ Features, feature types and application schemas Features are abstractions of real-world objects, such as rivers, buildings, streets or state boundaries. They are the geo objects of a particular application domain. -Feature types define classes of features. For example, a feature type ``River`` could define a class of river features that all have the same properties +A feature types defines the data model for a class of features. For example, a feature type ``River`` could define a class of river features that all have the same properties. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Simple vs. rich features and feature types ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Some feature types have a more complex structure than others. Traditionally, GIS software only copes with "simple" feature types: +Some feature types have a more complex structure than others. Traditionally, GIS software copes with "simple" feature types: * Every property is either simple (string, number, date, etc.) or a geometry * Only a single property with one name is allowed -Basically, a simple feature type is everything that can be represented using a single database table or a single shape file. In contrast, rich feature types additionally allow the following: +Basically, a simple feature type is everything that can be represented using a single database table or a single shape file. In contrast, "rich" feature types additionally allow the following: * Multiple properties with the same name * Properties that contain other features @@ -49,21 +49,29 @@ Basically, a simple feature type is everything that can be represented using a s :language: xml .. hint:: - All deegree feature stores support simple feature types, but only the SQL feature store and the memory feature store support complex feature types. + All deegree feature stores support simple feature types, but only the SQL feature store and the memory feature store support rich feature types. ^^^^^^^^^^^^^^^^^^^ Application schemas ^^^^^^^^^^^^^^^^^^^ -An application schema defines a hierarchy of (usually complex) feature types for a particular domain. When referring to an application schema, one usually means a GML application schema that defines a hierarchy of complex feature types. The following diagram shows a part of the INSPIRE Annex I application schema: +An application schema defines a number of feature types for a particular application domain. When referring to an application schema, one usually means a GML application schema that defines a hierarchy of rich feature types. Examples for GML application schemas are: + +* INSPIRE Data Themes (Annex I, II and III) +* GeoSciML +* CityGML +* XPlanung +* AAA + +The following diagram shows a part of the INSPIRE Annex I application schema in UML form: .. figure:: images/address_schema.png :figwidth: 60% :width: 50% :target: _images/address_schema.png -These kinds of application schemas can be served using the SQL feature store or the memory feature store. - +.. hint:: + The SQL feature store or the memory feature store can be used with GML application schemas. ------------------- Shape feature store @@ -202,10 +210,10 @@ The configuration format for the deegree memory feature store is defined by sche Simple SQL feature store ------------------------ -The simple SQL feature store serves simple feature types that are stored in a spatially-enabled database. However, it's not suited for mapping rich GML application schemas and does not support transactions. If you need these capabilities, use the SQL feature store instead. +The simple SQL feature store serves simple feature types that are stored in a spatially-enabled database, such as PostGIS. However, it's not suited for mapping rich GML application schemas and does not support transactions. If you need these capabilities, use the SQL feature store instead. .. tip:: - If you want to use the simple SQL feature store with Oracle, you will need to add Oracle's JDBC driver manually. This is described in :ref:`anchor-oraclejars`. + If you want to use the simple SQL feature store with Oracle or Microsoft SQL Server, you will need to add additional modules first. This is described in :ref:`anchor-db-libraries`. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Minimal configuration example @@ -261,13 +269,14 @@ The configuration format is defined by schema file http://schemas.deegree.org/da SQL feature store ----------------- -The SQL feature store allows to configure highly flexible mappings between feature types and database tables. It can be used for simple mapping tasks (mapping a single database table to a feature type) as well as sophisticated ones (mapping a complete INSPIRE Data Theme to dozens or hundreds of database tables). As an alternative to relational decomposition setups, it additionally offers the so-called BLOB-mode which can store features of arbitrary complexity in a single table with almost zero configuration. In contrast to the simple SQL feature store, the SQL feature store is transaction capable (even for complex mappings) and very well suited for mapping rich GML application schemas. It currently supports the following backends: +The SQL feature store allows to configure highly flexible mappings between feature types and database tables. It can be used for simple mapping tasks (mapping a single database table to a feature type) as well as sophisticated ones (mapping a complete INSPIRE Data Theme to dozens or hundreds of database tables). As an alternative to relational mapping, it additionally offers so-called BLOB mapping which stores any kind of rich feature using a fixed and very simple database schema. In contrast to the simple SQL feature store, the SQL feature store is transaction capable (even for complex mappings) and ideally suited for mapping rich GML application schemas. It currently supports the following databases: * PostgreSQL (8.3, 8.4, 9.0, 9.1, 9.2) with PostGIS extension (1.4, 1.5, 2.0) * Oracle Spatial (10g, 11g) +* Microsoft SQL Server (2008, 2012) .. tip:: - If you want to use the SQL feature store with Oracle, you will need to add Oracle's JDBC driver manually. This is described in :ref:`anchor-oraclejars`. + If you want to use the SQL feature store with Oracle Spatial or Microsoft SQL Server, you will need to add additional modules first. This is described in :ref:`anchor-db-libraries`. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Minimal configuration example @@ -280,7 +289,16 @@ A very minimal valid configuration example looks like this: .. literalinclude:: xml/sqlfeaturestore_tabledriven1.xml :language: xml -This configuration maps a single table as a feature type. See blabla for more details of the behaviour. +This configuration defines a SQL feature store resource with the following properties: + +* JDBC connection resource with identifier ``postgis`` is used to connect to the database +* A single table (``country``) is mapped +* Feature type is named ``app:country`` (app=http://www.deegree.org/app) +* Properties of the feature type are automatically derived from table columns +* Every primitive column (number, string, date) is used as a primitive property +* Every geometry column is used as a geometry property (storage CRS is determined automatically, inserted geometries are transformed by deegree, if necessary) +* Feature id (``gml:id``) is based on primary key column, prefixed by ``COUNTRY_`` +* For insert transactions, it is expected that the database generates new primary keys value automatically (primary key column must have a trigger or a suitable type such as SERIAL in PostgreSQL) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ More complex configuration example @@ -290,425 +308,812 @@ A more complex example: .. topic:: SQL feature store: More complex configuration - .. literalinclude:: xml/sqlfeaturestore_tabledriven4.xml + .. literalinclude:: xml/sqlfeaturestore_complex.xml :language: xml -This configuration maps two feature types from an GML application schema to a relational model with joined tables. See blabla for more details of the behaviour. +This configuration snippet defines a SQL feature store resource with the following properties: -^^^^^^^^^^^^^^^^^^^^^ -Configuration options -^^^^^^^^^^^^^^^^^^^^^ +* JDBC connection resource with identifier ``inspire`` is used to connect to the database +* Storage CRS is ``EPSG:4258``, database srid is ``-1`` (inserted geometries are transformed by deegree to the storage CRS, if necessary) +* Feature types are read from three GML schema files +* A single feature type ``ad:Address`` (ad=urn:x-inspire:specification:gmlas:Addresses:3.0) is mapped +* The root table of the mapping is ``ad_address`` +* Feature type is mapped to several tables +* Feature id (``gml:id``) is based on column ``attr_gml_id``, prefixed by ``AD_ADDRESS__`` +* For insert transactions, new values for column ``attr_gml_id`` in the root table are created using the UUID generator. For the joined tables, the database has to create new primary keys value automatically (primary key columns must have a trigger or a suitable type such as SERIAL in PostgreSQL) -The SQL feature store configuration format is defined by schema file http://schemas.deegree.org/datasource/feature/sql/3.2.0/sql.xsd. The following table lists all available configuration options (the complex ones contain nested options themselves). When specifying them, their order must be respected. +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Overview of configuration options +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. table:: Options for ``SQL feature store`` configuration files +The SQL feature store configuration format is defined by schema file http://schemas.deegree.org/datasource/feature/sql/3.2.0/sql.xsd. The following table lists all available configuration options (the complex ones contain nested options themselves). When specifying them, their order must be respected: -+-----------------------------+-------------+---------+------------------------------------------------------------------------------+ -| Option | Cardinality | Value | Description | -+=============================+=============+=========+==============================================================================+ -| JDBCConnId | 1..1 | String | Identifier of the database connection | -+-----------------------------+-------------+---------+------------------------------------------------------------------------------+ -| DisablePostFiltering | 0..1 | Empty | TBD | -+-----------------------------+-------------+---------+------------------------------------------------------------------------------+ -| JoinTableDeletePropagation | 0..1 | String | TBD | -+-----------------------------+-------------+---------+------------------------------------------------------------------------------+ -| VoidEscalationPolicy | 0..1 | String | TBD | -+-----------------------------+-------------+---------+------------------------------------------------------------------------------+ -| CustomReferenceResolver | 0..n | String | TBD | -+-----------------------------+-------------+---------+------------------------------------------------------------------------------+ -| StorageCRS | 0..1 | Complex | CRS of stored geometries | -+-----------------------------+-------------+---------+------------------------------------------------------------------------------+ -| GMLSchema | 0..n | String | Path/URL to GML application schema files/dirs to read feature types from | -+-----------------------------+-------------+---------+------------------------------------------------------------------------------+ -| BLOBMapping | 0..1 | Complex | Controls special mapping mode that uses BLOBs for storing features | -+-----------------------------+-------------+---------+------------------------------------------------------------------------------+ -| FeatureTypeMapping | 0..n | Complex | Mapping between a feature type and a database table | -+-----------------------------+-------------+---------+------------------------------------------------------------------------------+ -| Inspectors | 0..n | Complex | TBD | -+-----------------------------+-------------+---------+------------------------------------------------------------------------------+ -| FeatureCache | 0..n | Complex | TBD | -+-----------------------------+-------------+---------+------------------------------------------------------------------------------+ +.. table:: Options for ``SQL feature store`` resource configuration files -These options are explained in the remaining sections of this chapter. ++----------------------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++==================================+=============+=========+==============================================================================+ +| ```` | 1 | String | Identifier of the database connection | ++----------------------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..1 | Empty | If present, queries that require in-memory filtering are rejected | ++----------------------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..1 | Complex | CRS of stored geometries | ++----------------------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..n | String | Path/URL to GML application schema files/dirs to read feature types from | ++----------------------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..1 | Complex | Activates a special mapping mode that uses BLOBs for storing features | ++----------------------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..n | Complex | Mapping between a feature type and a database table | ++----------------------------------+-------------+---------+------------------------------------------------------------------------------+ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Mapping tables to feature types -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The usage of these options and their sub-options is explained in the remaining sections. + +.. _anchor-configuration-tabledriven: -This section describes how to define the mapping of database tables to feature types. Each *FeatureTypeMapping* element defines the mapping between one table and one feature type: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Mapping tables to simple feature types +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This section describes how to define the mapping of database tables to simple feature types. Each ```` defines the mapping between one table and one feature type: .. topic:: SQL feature store: Mapping a single table .. literalinclude:: xml/sqlfeaturestore_tabledriven1.xml :language: xml -This example assumes that the database contains a table named ``country``, which is located within the default database schema (for PostgreSQL ``public``). Alternatively you can fully qualify the table name such as ``public.country``. The feature store will try to automatically determine the columns of the table and derive a suitable feature type model: +This example assumes that the database contains a table named ``country`` within the default database schema (for PostgreSQL ``public``). Alternatively, you can qualify the table name with the database schema, such as ``public.country``. The feature store will try to automatically determine the columns of the table and derive a suitable feature type: * Feature type name: ``app:country`` (app=http://www.deegree.org/app) * Feature id (``gml:id``) based on primary key column of table ``country`` * Every primitive column (number, string, date) is used as a primitive property * Every geometry column is used as a geometry property -A single config file may map more than one table. The following example defines two feature types, based on tables ``country`` and ``cities``. +A single configuration file may map more than one table. The following example defines two feature types, based on tables ``country`` and ``cities``. .. topic:: SQL feature store: Mapping two tables .. literalinclude:: xml/sqlfeaturestore_tabledriven2.xml :language: xml -There are several optional attributes and elements that give you more control over the derived feature type definition. The ``name`` attribute allows to set the feature type name explicity. In the following example, it will be ``app:Land`` (Land is German for country). +There are several options for ```` that give you more control over the derived feature type definition. The following table lists all available options (the complex ones contain nested options themselves): + +.. table:: Options for ```` + ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++==================+=============+=========+==============================================================================+ +| ``table`` | 1 | String | Name of the table to be mapped (can be qualified with database schema) | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| ``name`` | 0..1 | QName | Name of the feature type | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..1 | Complex | Defines the mapping of the feature id | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..n | Complex | Defines the mapping of a primitive-valued column | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..n | Complex | Defines the mapping of a geometry-valued column | ++------------------+-------------+---------+------------------------------------------------------------------------------+ + +.. hint:: + The order of child elements ```` and ```` is not restricted. They may appear in any order. + +These options and their sub-options are explained in the following subsections. + +""""""""""""""""""""""""""""""""" +Customizing the feature type name +""""""""""""""""""""""""""""""""" + +By default, the name of a mapped feature type will be derived from the table name. If the table is named ``country``, the feature type name will be ``app:country`` (app=http://www.deegree.org/app). The ``name`` attribute allows to set the feature type name explicity. In the following example, it will be ``app:Land`` (Land is German for country). .. topic:: SQL feature store: Customizing the feature type name .. literalinclude:: xml/sqlfeaturestore_tabledriven3.xml :language: xml -Use standard XML namespace binding mechanisms to control the namespace and prefix of the feature type: +The name of a feature type is always a qualified XML name. You can use standard XML namespace binding mechanisms to control the namespace and prefix of the feature type name: .. topic:: SQL feature store: Customizing the feature type namespace and prefix .. literalinclude:: xml/sqlfeaturestore_tabledriven4.xml :language: xml -^^^^^^^^^^^^^^^^^^^^^^ -Mapping the feature id -^^^^^^^^^^^^^^^^^^^^^^ +"""""""""""""""""""""""""" +Customizing the feature id +"""""""""""""""""""""""""" + +By default, values for the feature id (``gml:id`` attribute in GML) will be based on the primary key column of the mapped table. Values from this column will be prepended with a prefix that is derived from the feature type name. For example, if the feature type name is ``app:Country``, the prefix is ``APP_COUNTRY``. The feature instance that is built from the table row with primary key ``42`` will have feature id ``APP_COUNTRY42``. -In order to customize the mapping of the feature id (gml:id attribute) to a key column of the feature type table, use the *FIDMapping* element. It is the first child option of every *FeatureTypeMapping* element: +If this is not what you want, or automatic detection of the primary key column fails, customize the feature id mapping using the ```` option: -.. topic:: SQL feature store (schema-driven mode): FeatureTypeMapping elements +.. topic:: SQL feature store: Customizing the feature id mapping - .. literalinclude:: xml/sqlfeaturestore_featuretypemapping1.xml + .. literalinclude:: xml/sqlfeaturestore_fidmapping1.xml :language: xml -.. hint:: - After providing a correct FIDMapping, a feature type is already queryable, e.g. you can perform a ``GetFeature`` requests against a WFS that uses this feature store. When creating a configuration manually for an existing database, it is a good idea to do this as a first step. This way you test if everything works so far (although no properties will be returned). +Here are the options for ````: -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Mapping columns to properties -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.. table:: Options for ```` -In order to customize the mapping between table columns and the properties of a feature type, the following mapping elements are available: ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++==================+=============+=========+==============================================================================+ +| ``prefix`` | 0..1 | String | Feature id prefix, default: derived from feature type name | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 1..n | Complex | Column that stores (a part of) the feature id | ++------------------+-------------+---------+------------------------------------------------------------------------------+ -* **Primitive**: Maps a primitive property, a text node or an attribute node. -* **Geometry**: Maps a geometry property. -* **Feature**: Maps a referenced or inlined subfeature property. -* **Complex**: Maps a complex element that is neither a geometry nor a feature. It is a generic container for mapping nested element structures. +As ```` may occur more than once, you can define that the feature id is constructed from multiple columns: -.. hint:: - The *Feature* and *Complex* mappings are only usable if you specify a GML application schema using the *GMLSchema* option. Their usage is described later in section +.. topic:: SQL feature store: Customizing the feature id mapping -^^^^^^^^^^^^ -Transactions -^^^^^^^^^^^^ + .. literalinclude:: xml/sqlfeaturestore_fidmapping2.xml + :language: xml + +Here are the options for ````: -When new features are inserted into a SQL feature store (for example via a WFS transaction), the user can choose between different id generation modes. These modes control whether feature ids (the values in the gml:id attribute) have to be re-generated by the feature store. There are three id generation modes available, which stem from the WFS 1.1.0 specification: +.. table:: Options for ```` -* **UseExisting**: The feature store will store the original gml:id values that have been provided in the input. This may lead to errors if the provided ids are already in use or if the format of the id does not match the configuration. -* **GenerateNew**: The feature store will discard the original gml:id values and use the configured generator to produce new and unique identifiers. References in the input (xlink:href) that point to a feature with an reassigned id are fixed as well, so reference consistency is ensured. -* **ReplaceDuplicate**: The feature store will try to use the original gml:id values that have been provided in the input. If a certain identifier already exists in the database, the configured generator is used to produce a new and unique identifier. NOTE: Support for this mode is not implemented yet. ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++==================+=============+=========+==============================================================================+ +| ``name`` | 1 | String | Name of the database column | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| ``type`` | 0..1 | String | Column type (string, boolean, decimal, double or integer), default: auto | ++------------------+-------------+---------+------------------------------------------------------------------------------+ .. hint:: - In a WFS 1.1.0 insert, the id generation mode is controlled by attribute *idGenMode*. WFS 1.0.0 and WFS 2.0.0 don't support to specify it on a request basis. However, in the deegree WFS configuration you can control it in the option *EnableTransactions*. + Technically, the feature id prefix is important to determine the feature type when performing queries by feature id. Every ```` must have a unique feature id prefix. -In order to generate the required ids for the *GenerateNew*, you can choose between different generators. These can be configured in the *FIDMapping* child element of *FeatureTypeMapping*. +"""""""""""""""""""""""""""""""""""""""""""""""""""""" +Customizing the mapping between columns and properties +"""""""""""""""""""""""""""""""""""""""""""""""""""""" -""""""""""""""""" -Auto id generator -""""""""""""""""" +By default, the SQL feature store will try to automatically determine the columns of the table and derive a suitable feature type: -The auto id generator depends on the database to provide new values for the feature id column(s) on insert. This requires that the used feature id columns are configured appropriately in the database (e.g. that they have a trigger or a suitable column type such as ``SERIAL`` in PostgreSQL). +* Every primitive column (number, string, date) is used as a primitive property +* Every geometry column is used as a geometry property -.. topic:: SQL feature store: Auto id generator example +If this is not what you want, or automatic detection of the column types fails, use ```` and ```` to control the property definitions of the feature type and the column-to-property mapping: - .. literalinclude:: xml/sqlfeaturestore_idgenerator1.xml +.. topic:: SQL feature store: Customizing property definitions and the column-to-property mapping + + .. literalinclude:: xml/sqlfeaturestore_tabledriven5.xml :language: xml -This snippet defines the feature id mapping and the id generation behaviour for a feature type called ``ad:Address`` +This example defines a feature type with three properties: -* When querying, the prefix ``AD_ADDRESS_`` is prepended to column ``attr_gml_id`` to create the exported feature id. If ``attr_gml_id`` contains the value ``42`` in the database, the feature instance that is created from this row will have the value ``AD_ADDRESS_42``. -* On insert (mode=UseExisting), provided gml:id values must have the format ``AD_ADDRESS_$``. The prefix ``AD_ADDRESS_`` is removed and the remaining part of the identifier is stored in column ``attr_gml_id``. -* On insert (mode=GenerateNew), the database must automatically create a new value for column ``attr_gml_id`` which will be the postfix of the newly assigned feature id. +* ``property1``, type: primitive (string), mapped to column ``prop1`` +* ``property2``, type: geometry (point), mapped to column ``the_geom``, storage CRS is ``EPSG:4326``, database srid is ``-1`` +* ``property3``, type: primitive (integer), mapped to column ``prop2`` -"""""""""""""" -UUID generator -"""""""""""""" +The following table lists all available configuration options for ```` and ````: -The UUID generator generator uses Java's UUID implementation to generate new and unique identifiers. This requires that the database column for the id is a character column that can store strings with a length of 36 characters and that the database does not perform any kind of insertion value generation for this column (e.g triggers). +.. table:: Options for ```` and ```` -.. topic:: SQL feature store: UUID generator example ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++=======================+=============+=========+==============================================================================+ +| ``path`` | 1 | QName | Name of the property | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| ``mapping`` | 1 | String | Name of the database column | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| ``type`` | 1 | String | Property/column type | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..1 | Complex | Defines a change in the table context | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..1 | Complex | Plugs-in a specialized DB-to-ObjectModel converter implementation | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..1 | Complex | CRS of stored geometries and database srid (only for ````) | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ - .. literalinclude:: xml/sqlfeaturestore_idgenerator2.xml - :language: xml +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Mapping GML application schemas +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -This snippet defines the feature id mapping and the id generation behaviour for a feature type called ``ad:Address`` +The former section assumed a mapping configuration that didn't use a given GML application schema. If a GML application schema is available and specified using ````, the mapping possibilities and available options are extended. We refer to these two modes as **table-driven mode** (without GML schema) and **schema-driven mode** (with GML schema). -* When querying, the prefix ``AD_ADDRESS_`` is prepended to column ``attr_gml_id`` to create the exported feature id. If ``attr_gml_id`` contains the value ``550e8400-e29b-11d4-a716-446655440000`` in the database, the feature instance that is created from this row will have the value ``AD_ADDRESS_550e8400-e29b-11d4-a716-446655440000``. -* On insert (mode=UseExisting), provided gml:id values must have the format ``AD_ADDRESS_$``. The prefix ``AD_ADDRESS_`` is removed and the remaining part of the identifier is stored in column ``attr_gml_id``. -* On insert (mode=GenerateNew), a new UUID is generated and stored in column ``attr_gml_id``. +Here's a comparison of table-driven and schema-driven mode: -""""""""""""""""""""" -Sequence id generator -""""""""""""""""""""" +.. table:: SQL feature store mapping modes (with and without GML application schema) -The sequence id generator queries a database sequence to generate new and unique identifiers. This requires that the database column for the id is compatible with the values generated by the sequence and that the database does not perform any kind of automatical value insertion for this column (e.g triggers). ++------------------------------+------------------------------+---------------------------------+ +| | Table-driven mode | Schema-driven mode | ++==============================+==============================+=================================+ +| GML application schema | Derived from tables | Must be provided | ++------------------------------+------------------------------+---------------------------------+ +| Data model (feature types) | Derived from tables | Derived from GML app schema | ++------------------------------+------------------------------+---------------------------------+ +| GML version | Any (GML 2, 3.0, 3.1, 3.2) | Fixed to version of app schema | ++------------------------------+------------------------------+---------------------------------+ +| Mapping principle | Property to table column | XPath-based or BLOB-based | ++------------------------------+------------------------------+---------------------------------+ +| Supported mapping complexity | Low | Very high | ++------------------------------+------------------------------+---------------------------------+ -.. topic:: SQL feature store: Database sequence generator example +.. hint:: + If you want to create a relational mapping for an existing GML application schema (e.g. INSPIRE Data Themes, GeoSciML, CityGML, XPlanung, AAA), always copy the schema files into the ``appschemas/`` directory of your workspace and reference the schema in your configuration. - .. literalinclude:: xml/sqlfeaturestore_idgenerator3.xml +In schema-driven mode, the SQL feature store extracts detailed feature type definitions and property declarations from GML application schema files. A basic configuration for schema-driven mode defines the JDBC connection id, the general CRS of the stored geometries and one or more GML application schema files: + +.. topic:: SQL FeatureStore (schema-driven mode): Skeleton config + + .. literalinclude:: xml/sqlfeaturestore_schemadriven1.xml :language: xml -This snippet defines the feature id mapping and the id generation behaviour for a feature type called ``ad:Address`` +"""""""""""""""""""" +Recommended workflow +"""""""""""""""""""" -* When querying, the prefix ``AD_ADDRESS_`` is prepended to column ``attr_gml_id`` to create the exported feature id. If ``attr_gml_id`` contains the value ``42`` in the database, the feature instance that is created from this row will have the value ``AD_ADDRESS_42``. -* On insert (mode=UseExisting), provided gml:id values must have the format ``AD_ADDRESS_$``. The prefix ``AD_ADDRESS_`` is removed and the remaining part of the identifier is stored in column ``attr_gml_id``. -* On insert (mode=GenerateNew), the database sequence ``SEQ_FID`` is queried for new values to be stored in column ``attr_gml_id``. +.. hint:: + This section assumes that you already have an existing database that you want to map to a GML application schema. If you want to derive a database model from a GML application schema, see :ref:`anchor-mapping-wizard`. + +Manually creating a mapping for a rich GML application schema may appear to be a dauting task at first sight. Especially when you are still trying to figure out how the configuration concepts work, you will be using a lot of trial-and-error. Here are some general practices to make this as painless as possible. -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Mapping a GML application schema -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +* Map one property of a feature type at a time. +* Use the **Reload** link in the services console to activate changes. +* After changing the configuration file, make sure that the status of the feature store stays green (in the console). If an exclamation mark occurs, you have an error in your configuration. Check the error message and fix it. +* Check the results of your change (see below) +* Once you're satisfied, move on the next property (or feature type) -The former sections assumed a mapping configuration that didn't specify a GML application schema. If a GML application schema is specified in the SQL feature store configuration, the mapping possibilities are extended further. Although configuration with a GML application schema is similar, there are some differences as described in the following table: +Set up a WFS configuration, so you can use WFS GetFeature-requests to check whether your feature mapping works as expected. You can use your web browser for that. After each configuration change, perform a GetFeature-request to see the effect. Suitable WFS requests depend on the WFS version, the GML version and the name of the feature type. Here are some examples: -.. table:: Blabla +* WFS 1.0.0 (GML 2): http://localhost:8080/services?service=WFS&version=1.0.0&request=GetFeature&typeName=ad:Address&maxFeatures=1 +* WFS 1.1.0 (GML 3.1): http://localhost:8080/services?service=WFS&version=1.1.0&request=GetFeature&typeName=ad:Address&maxFeatures=1 +* WFS 2.0.0 (GML 3.2): http://localhost:8080/services?service=WFS&version=2.0.0&request=GetFeature&typeName=ad:Address&count=1 -+------------------------------+----------------------------+---------------------------------+ -| | Without GML app schema | With GML app schema | -+==============================+============================+=================================+ -| GML application schema | Derived from tables | Must be provided | -+------------------------------+----------------------------+---------------------------------+ -| Feature type definitions | Derived from tables | Derived from GML app schema | -+------------------------------+----------------------------+---------------------------------+ -| GML version | Any (GML 2, 3.0, 3.1, 3.2) | Fixed to version of app schema | -+------------------------------+----------------------------+---------------------------------+ -| Mapping principle | Property to table column | XPath-based or BLOB-based | -+------------------------------+----------------------------+---------------------------------+ -| Supported mapping complexity | Low | Very high | -+------------------------------+----------------------------+---------------------------------+ +In order to successfully create a mapping for a feature type from a GML application schema, you have to know the structure and the data types of the feature type. For example, if you want to map feature type ``ad:Address`` from INSPIRE Annex I, you have to know that it has a required property called ``ad:inspireId`` that has a child element with name ``base:Identifier``. Here's a list of possible options to learn the data model of an application schema: + +* Manually (or with the help of a generic XML tool such as XMLSpy) analyze the GML application schema to determine the feature types and understand their data model +* Use the services console to auto-generate a mapping configuration (see :ref:`anchor-mapping-wizard`). It should reflect the structure and datatypes correctly. Auto-generate the mapping, create a copy of the file and start with a minimal version (``FeatureTypeMapping`` by ``FeatureTypeMapping``, property by property). Adapt it to your own database tables and columns and remove optional elements and attributes that you don't want to map. +* Use the deegree support options (mailing lists, commercial support) to get help. .. hint:: - If you want to create a configuration for an existing GML application schema (e.g. INSPIRE Data Themes, GeoSciML, CityGML, XPlanung, AAA) always provide this schema in the configuration. Otherwise, try if table-driven meets your mapping requirements. If your table structures turn out to be too complex to be usable with table-driven mode, you will need to create a matching GML application schema manually and use schema-driven mode. + The deegree project aims for a user-interface to help with all steps of creating mapping configurations. If you are interested in working on this (or funding it), don't hesitate to contact the project bodies. -In schema-driven mode, the SQL feature store always retrieves feature type definitions and property declarations from a GML application schema (e.g. INSPIRE Addresses, GeoSciML, CityGML, XPlanung, AAA) specified in the configuration. A basic configuration for schema-driven mode defines the JDBC connection id, the CRS of the stored geometries and one or more GML schema files that make up the application schema: +"""""""""""""""""""""""""" +Mapping rich feature types +"""""""""""""""""""""""""" -.. topic:: SQL FeatureStore (Schema-driven mode): Skeleton config +In schema-driven mode, the ```` element basically works as in table-driven mode (see :ref:`anchor-configuration-tabledriven`). It defines a mapping between a table in the database and a feature type. However, there are additional possibilities and it's usually more suitable to focus on feature types and XML nodes instead of tables and table columns. Here's an overview of the ```` options and their meaning in schema-driven mode: + +.. table:: Options for ```` (schema-driven mode) + ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++==================+=============+=========+==============================================================================+ +| ``table`` | 1 | String | Name of the table to be mapped (can be qualified with database schema) | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| ``name`` | 0..1 | QName | Name of the feature type | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 1 | Complex | Defines the mapping of the feature id | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..n | Complex | Defines the mapping of a primitive-valued node | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..n | Complex | Defines the mapping of a geometry-valued node | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..n | Complex | Defines the mapping of a complex-valued node | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..n | Complex | Defines the mapping of a feature-valued node | ++------------------+-------------+---------+------------------------------------------------------------------------------+ - .. literalinclude:: xml/sqlfeaturestore_schemadriven1.xml - :language: xml +.. hint:: + The order of child elements ````, ````, ```` and ```` is not restricted. They may appear in any order. -As in table-driven mode, the mapping of a feature type is defined using a ``FeatureTypeMapping`` element: +We're going to explore the additional options by describing the necessary steps for mapping feature type ``ad:Address`` (from INSPIRE Annex I) to an example database. Start with a single ````. Provide the table name and the mapping for the feature identifier. The example uses a table named ``ad_address`` and a key column named ``fid``: -.. topic:: SQL FeatureStore (Schema-driven mode): Relational skeleton config +.. topic:: SQL feature store (schema-driven mode): Start configuration .. literalinclude:: xml/sqlfeaturestore_schemadriven2.xml :language: xml -The ``FeatureTypeMapping`` element has the following attributes: +.. tip:: + In schema-driven mode, there is no automatic detection of columns, column types or primary keys. You always have to specify ````. -* ``name``: Qualified name of the feature type to map. Use standard XML namespace mechanisms (``xmlns``) for binding namespace prefixes. -* ``table``: Name of the base table that stores the feature type. Properties may be mapped to related tables, but the base table must at least contain the columns that constitute the unique feature id (gml:id). +.. tip:: + If this configuration matches your database and you have a working WFS resource, you should be able to query the feature type (although no properties will be returned): http://localhost:8080/services?service=WFS&version=2.0.0&request=GetFeature&typeName=ad:Address&count=1 -.. hint:: - In schema-driven mode, every mapped feature type must be defined in the referenced GML schema file. It is however not necessary to map all feature types defined in the schema. Unmapped feature types will be known to the feature store (e.g. a WFS will list them in a GetCapabilities response), but not queryable. +Mapping rich feature types works by associating XML nodes of a feature instance with rows and columns in the database. The table context (the current row) is changed when necessary. In the beginning of a ````, the current context node is an ``ad:Address`` element and the current table context is a row of table ``ad_address``. The first (required) property that we're going to map is ``ad:inspireId``. The schema defines that ``ad:inspireId`` has as child element named ``base:Identifier`` which in turn has two child elements named ``base:localId`` and ``base:namespace``. Lets's assume that we have a column ``localid`` in our table, that we want to map to ``base:localId``, but for ``base:namespace``, we don't have a corresponding column. We want this element to have the fixed value ``NL.KAD.BAG`` for all instances of ``ad:Address``. Here's how to do it: -"""""""""""""""""""" -Recommended workflow -"""""""""""""""""""" +.. topic:: SQL feature store (schema-driven mode): Complex elements and constant mappings -Manually tailoring an SQL feature store configuration for a rich GML application schema may appear to be a dauting task at first sight. Especially when you are still trying to figure out how the configuration concepts work, you will be using a trial-and-error strategy. Here are some general practices to make this as painless as possible. + .. literalinclude:: xml/sqlfeaturestore_schemadriven3.xml + :language: xml -* Map one feature type at a time. Only when you're satisfied with the mapping, move on to the next feature type. -* When changing the configuration file, make sure that the status of the feature store stays green. If an exclamation mark occurs, you have an error in your configuration. -* Use the "Reload" link of the services console to activate your changes. +There are several things to observe here. The ``Complex`` element occurs twice. In the ``path`` attribute of the first occurrence, we specified the qualified name of the (complex) property we want to map (``ad:inspireId``). The nested ``Complex`` targets child element ``base:Identifier`` of ``ad:inspireId``. And finally, the ``Primitive`` elements specify that child element ``base:localId`` is mapped to column ``localid`` and element ``base:namespace`` is mapped to constant ``NL.KAD.BAG`` (note the single quotes around ``NL.KAD.BAG``). -Start with a single **FeatureTypeMapping**. Provide the table name and the mapping for the feature identifier. If there's no error, you can already query the feature type! Here's a minimal configuration example: +To summarize: -.. topic:: SQL FeatureStore (schema-driven mode): Start configuration +* ``Complex`` is used to select a (complex) child element to be mapped. It is a container for child mapping elements (``Primitive``, ``Geometry``, ``Complex`` or ``Feature``) +* In the ``mapping`` attribute of ``Primitive``, you can also use constants, not only column names - .. literalinclude:: xml/sqlfeaturestore_schemadriven1.xml +The next property we want to map is ``ad:position``. It contains the geometry of the address, but the actual GML geometry is nested on a deeper level and the property can occur multiple times. In our database, we have a table named ``ad_address_ad_position`` with columns ``fk`` (foreign key to ad_address) and ``value`` (geometry). Here's the extended mapping: + +.. topic:: SQL feature store (schema-driven mode): Join elements and XPath expressions + + .. literalinclude:: xml/sqlfeaturestore_schemadriven4.xml :language: xml -It's very useful to have an active WFS configuration, so you can use WFS GetFeature-requests to check whether your feature mapping works as expected. You can use your web browser for that. After each configuration change, perform a GetFeature-request to see the effect. Suitable WFS requests depend on the WFS version, the GML version and the name of the feature type. +Again, the ``Complex`` element is used to drill into the XML structure of the property and several elements are mapped to constant values. But there are also new things to observe: -* WFS 1.0.0 (GML 2): http://localhost:8080/services?service=WFS&version=1.0.0&request=GetFeature&typeName=ad:Address&maxFeatures=5 -* WFS 1.1.0 (GML 3.1): http://localhost:8080/services?service=WFS&version=1.1.0&request=GetFeature&typeName=ad:Address&maxFeatures=5 -* WFS 2.0.0 (GML 3.2): http://localhost:8080/services?service=WFS&version=2.0.0&request=GetFeature&typeName=ad:Address&count=5 +* The first child element of a ```` (or ````, ```` or ````) can be ````. ```` performs a table change: table rows corresponding to ``ad:position`` are not stored in the root feature type table (``ad_address``), but in a joined table. All siblings of ```` (or their children) refer to this joined table (``ad_address_ad_position``). The join condition that determines the related rows in the joined table is ``ad_address.fid=ad_address_ad_position.fk``. ```` is described in detail in the next section. +* Valid expressions for ``path`` can also be ``.`` (current node) and ``text()`` (primitive value of the current node). -In order to successfully create a mapping of a feature type from a GML application schema, you have to understand the structure and the data types of the feature type. For example, if you want to map the **ad:Address** feature type from INSPIRE Annex I, you have to know that it has a required property called **ad:inspireId** that has a child element with name **base:Identifier**. Ultimately, this structure is given by the corresponding GML application schema files, so you can analyze these files to find that out. Internally, deegree does the same to find out about feature types. Here's a full list of possible options to help with this task: +Let's move on to the mapping of property ``ad:component``. This property can occur multiple times and contains (a reference to) another feature. -* Manually (or with the help of a generic XML tool such as XMLSpy) analyze the the structure of the feature type you want to map -* Use the services console to auto-generate a mapping configuration. It should reflect the structure and datatypes correctly and will be a good starting point to. Adapt it to your own database tables and columns. Auto-generate the mapping, create a copy of the file and again start with a minimal version (feature type by feature type). -* Use the deegree support options (mailing lists, commercial support) to get help. +.. topic:: SQL feature store (schema-driven mode): Feature elements -.. hint:: - The deegree project aims for a full user-interface to help with all steps of creating mapping configurations. If you are interested in working on this (or funding it), don't hesitate to contact the project bodies. + .. literalinclude:: xml/sqlfeaturestore_schemadriven5.xml + :language: xml -"""""""""""""""""" -Mapping properties -"""""""""""""""""" +As in the mapping of ``ad:position``, a ```` is used to change the table context. The table that stores the information for ``ad:component`` properties is ``ad_address_ad_component``. The ```` declares that we want to map a feature-valued node and it's ```` sub-element defines that column ``href`` stores the value for the ``xlink:href``. + +Here is an overview on all options for ```` elements: + +.. table:: Options for ```` + ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++=======================+=============+=========+==============================================================================+ +| ``path`` | 1 | QName | Name/XPath-expression that determines the element to be mapped | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..1 | Complex | Defines a change in the table context | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..1 | Complex | Plugs-in a specialized DB-to-ObjectModel converter implementation | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..n | Complex | Defines the mapping of a primitive-valued node | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..n | Complex | Defines the mapping of a geometry-valued node | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..n | Complex | Defines the mapping of a complex-valued node | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..n | Complex | Defines the mapping of a feature-valued node | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ -In order to add mappings for properties of the feature type, the following mapping elements are available: +.. hint:: + The order of child elements ````, ````, ```` and ```` is not restricted. They may appear in any order. -* **Primitive**: Maps a primitive property, a text node or an attribute node. -* **Geometry**: Maps a geometry property. -* **Feature**: Maps a referenced or inlined subfeature property. -* **Complex**: Maps a complex element that is neither a geometry nor a feature. It is a generic container for mapping nested element structures. +Here is an overview on all options for ```` elements: -Mapping the actual content of a feature works by associating XML nodes with columns in the database. In the beginning of the feature type mapping, the current node is the root element of the feature ``ad:Address`` and the current table is ``ad_address``. +.. table:: Options for ```` + ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++=======================+=============+=========+==============================================================================+ +| ``path`` | 1 | QName | Name/XPath-expression that determines the element to be mapped | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..1 | Complex | Plugs-in a specialized DB-to-ObjectModel converter implementation | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..1 | Complex | Defines the column that stores the value for ``xlink:href`` | ++-----------------------+-------------+---------+------------------------------------------------------------------------------+ """""""""""""""""""""""""" Changing the table context """""""""""""""""""""""""" -When mapping a rich GML application schema to a database, you usually have to map data from multiple tables to a single feature type. The configuration offers the **Join** element to change the current table context, i.e. to move to another table in the relational model. - -At the beginning of a **FeatureTypeMapping**, the current table context is the one specified by the **table** attribute. In the following example snippet, this would be table **ad_address**. +At the beginning of a ````, the current table context is the one specified by the ``table`` attribute. In the following example snippet, this would be table ``ad_address``. -.. topic:: SQL FeatureStore: Initial table context +.. topic:: SQL feature store: Initial table context .. literalinclude:: xml/sqlfeaturestore_tablecontext.xml :language: xml -Note that all mapped columns stem from table **ad_address**. This is fine, as each feature can only have a single **gml:identifier** property. However, when mapping a property that may occur any number of times, we will have to access the values for this property in a separate table. +Note that all mapped columns stem from table ``ad_address``. This is fine, as each feature can only have a single ``gml:identifier`` property. However, when mapping a property that may occur any number of times, we will have to access the values for this property in a separate table. -.. topic:: SQL FeatureStore: Changing the table context +.. topic:: SQL feature store: Changing the table context .. literalinclude:: xml/sqlfeaturestore_join1.xml :language: xml -In this example, property **gml:identifier** is mapped as before (the data values stem from table **ad_address**). In contrast to that, the property **ad:position** can occur any number of times for a single **ad_address** feature instance. In order to reflect that in the relational model, the values for this property have to be taken from/stored in a separate table. The feature type table (ad_address) must have a 1:n relation to this table. +In this example, property ``gml:identifier`` is mapped as before (the data values stem from table ``ad_address``). In contrast to that, property ``ad:position`` can occur any number of times for a single ``ad_address`` feature instance. In order to reflect that in the relational model, the values for this property have to be taken from/stored in a separate table. The feature type table (``ad_address``) must have a 1:n relation to this table. -The **Join** element is used to define such a change in the table context (in other words: a relation/join between two tables). A **Join** element may only occur as the first child element of any of the mapping elements (Primitive, Geometry, Feature or Complex). It changes from the current table context to another one. In the example, the table context in the mapping of property **ad:position** is changed from **ad_address** to **ad_address_ad_position**. All mapping instructions that follow the **Join** element refer to the new table context. For example, the geometry value is taken from **ad_address_ad_position.ad_geographicposition_ad_geometry_value**. +The ```` element is used to define such a change in the table context (in other words: a relation/join between two tables). A ```` element may only occur as first child element of any of the mapping elements (````, ````, ```` or ````). It changes from the current table context to another one. In the example, the table context in the mapping of property ``ad:position`` is changed from ``ad_address`` to ``ad_address_ad_position``. All mapping instructions that follow the ```` element refer to the new table context. For example, the geometry value is taken from ``ad_address_ad_position.ad_geographicposition_ad_geometry_value``. -The following table lists all available options for **Join** elements. +The following table lists all available options for ```` elements: -.. table:: Options for **Join** elements +.. table:: Options for ```` elements -+-----------------------------+-------------+---------+---------------------------------------------------------------------------------------------------+ -| Option | Cardinality | Value | Description | -+=============================+=============+=========+===================================================================================================+ -| @table | 1..1 | String | Name of the target table to change to. | -+-----------------------------+-------------+---------+---------------------------------------------------------------------------------------------------+ -| @fromColumns | 1..1 | String | One or more columns that define the join key in the source table. | -+-----------------------------+-------------+---------+---------------------------------------------------------------------------------------------------+ -| @toColumns | 1..1 | String | One or more columns that define the join key in the target table. | -+-----------------------------+-------------+---------+---------------------------------------------------------------------------------------------------+ -| @orderColumns | 0..1 | String | One or more columns hat define the order of the joined rows. | -+-----------------------------+-------------+---------+---------------------------------------------------------------------------------------------------+ -| @numbered | 0..1 | Boolean | Set to true, if orderColumns refers to a single column that contains natural numbers [1,2,3,...]. | -+-----------------------------+-------------+---------+---------------------------------------------------------------------------------------------------+ -| AutoKeyColumn | 0..n | Complex | Columns in the target table that store autogenerated keys (only required for transactions). | -+-----------------------------+-------------+---------+---------------------------------------------------------------------------------------------------+ ++---------------------+-------------+---------+---------------------------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++=====================+=============+=========+===================================================================================================+ +| ``table`` | 1..1 | String | Name of the target table to change to. | ++---------------------+-------------+---------+---------------------------------------------------------------------------------------------------+ +| ``fromColumns`` | 1..1 | String | One or more columns that define the join key in the source table. | ++---------------------+-------------+---------+---------------------------------------------------------------------------------------------------+ +| ``toColumns`` | 1..1 | String | One or more columns that define the join key in the target table. | ++---------------------+-------------+---------+---------------------------------------------------------------------------------------------------+ +| ``orderColumns`` | 0..1 | String | One or more columns hat define the order of the joined rows. | ++---------------------+-------------+---------+---------------------------------------------------------------------------------------------------+ +| ``numbered`` | 0..1 | Boolean | Set to true, if orderColumns refers to a single column that contains natural numbers [1,2,3,...]. | ++---------------------+-------------+---------+---------------------------------------------------------------------------------------------------+ +| ```` | 0..n | Complex | Columns in the target table that store autogenerated keys (only required for transactions). | ++---------------------+-------------+---------+---------------------------------------------------------------------------------------------------+ -Attributes **fromColumns**, **toColumns** and **orderColumns** may each contain one or more columns. When specifying multiple columns, they must be given as a whitespace-separated list. **orderColumns** is used to force a specific ordering on the joined table rows. If this attribute is omitted, the order of joined rows is not defined and reconstructed feature instances may vary each time they are fetched from the database. In the above example, this would mean that the multiple **ad:position** properties of an **ad:Address** feature may change their order. +Attributes ``fromColumns``, ``toColumns`` and ``orderColumns`` may each contain one or more columns. When specifying multiple columns, they must be given as a whitespace-separated list. ``orderColumns`` is used to force a specific ordering on the joined table rows. If this attribute is omitted, the order of joined rows is not defined and reconstructed feature instances may vary each time they are fetched from the database. In the above example, this would mean that the multiple ``ad:position`` properties of an ``ad:Address`` feature may change their order. -In case that the order column stores the child index of the XML element, the **numbered** attribute should be set to **true**. In this special case, filtering on property names with child indexes will be correctly mapped to SQL WHERE clauses as in the following WFS example request. +In case that the order column stores the child index of the XML element, the ``numbered`` attribute should be set to ``true``. In this special case, filtering on property names with child indexes will be correctly mapped to SQL WHERE clauses as in the following WFS example request. -.. topic:: SQL FeatureStore: WFS query with child index +.. topic:: SQL feature store: WFS query with child index .. literalinclude:: xml/sqlfeaturestore_indexquery.xml :language: xml -In the above example, only those **ad:Address** features will be returned where the geometry in the third **ad:position** property has an intersection with the specified bounding box. If only other **ad:position** properties (e.g. the first one) matches this constraint, they will not be included in the output. +In the above example, only those ``ad:Address`` features will be returned where the geometry in the third ``ad:position`` property has an intersection with the specified bounding box. If only other ``ad:position`` properties (e.g. the first one) matches this constraint, they will not be included in the output. -The **AutoKeyColumn** configuration option is only required when you want to use transactions on your feature store and your relational model is non-canonical. Ideally, the mapping will only change the table context in case the feature type model allows for multiple child elements at that point. In other words: if the XML schema has **maxOccurs** set to **unbounded** for an element, the relational model should have a corresponding 1:n relation. For a 1:n relation, the target table of the context change should have a foreign key column that points to the primary key column of the source table of the context change. This is important, as the SQL feature store has to propagate keys from the source table to the target table and store them there as well. +The ```` configuration option is only required when you want to use transactions on your feature store and your relational model is non-canonical. Ideally, the mapping will only change the table context in case the feature type model allows for multiple child elements at that point. In other words: if the XML schema has ``maxOccurs`` set to ``unbounded`` for an element, the relational model should have a corresponding 1:n relation. For a 1:n relation, the target table of the context change should have a foreign key column that points to the primary key column of the source table of the context change. This is important, as the SQL feature store has to propagate keys from the source table to the target table and store them there as well. -If the joined table is the origin of other joins, than it is important that the SQL feature store can generate primary keys for the join table. If not configured otherwise, it is assumed that column **id** stores the primary key and that the database will auto-generate values on insert using database mechanisms such as sequences or triggers. +If the joined table is the origin of other joins, than it is important that the SQL feature store can generate primary keys for the join table. If not configured otherwise, it is assumed that column ``id`` stores the primary key and that the database will auto-generate values on insert using database mechanisms such as sequences or triggers. -If this is not the case, use the **AutoKeyColumn** options to define the columns that make up the primary key in the join table and how the values for these columns should be generated on insert. Here's an example: +If this is not the case, use the ``AutoKeyColumn`` options to define the columns that make up the primary key in the join table and how the values for these columns should be generated on insert. Here's an example: -.. topic:: SQL FeatureStore: Key propagation for transactions +.. topic:: SQL feature store: Key propagation for transactions .. literalinclude:: xml/sqlfeaturestore_join2.xml :language: xml -In this example snippet, the primary key for table **B** is stored in column **pk1** and values for this column are generated using the UUID generator. There's another change in the table context from B to C. Rows in table C have a key stored in column **parentfk** that corresponds to the **B.pk1**. On insert, values generated for **B.pk1** will be propagated and stored for new rows in this table as well. The following table lists the options for **AutoKeyColumn** elements. +In this example snippet, the primary key for table ``B`` is stored in column ``pk1`` and values for this column are generated using the UUID generator. There's another change in the table context from B to C. Rows in table C have a key stored in column ``parentfk`` that corresponds to the ``B.pk1``. On insert, values generated for ``B.pk1`` will be propagated and stored for new rows in this table as well. The following table lists the options for ```` elements. -Inside a **AutoKeyColumn** element, you may use the same key generators that are available for feature id generation (see above). +Inside a ````, you may use the same key generators that are available for feature id generation (see above). +.. _anchor-blob-mode: """""""""""" BLOB mapping """""""""""" -An alternative approach to schema-driven relational mapping is schema-driven BLOB mapping. +An alternative approach to mapping each feature type from an application schema using ```` is to specify a single ```` element. This activates a different storage strategy based on a fixed database schema. Central to this schema is a table that stores every feature instance (and all of it's properties) as a BLOB (binary large object). + +Here is an overview on all options for ```` elements: + +.. table:: Options for ```` + ++------------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++========================+=============+=========+==============================================================================+ +| ```` | 0..1 | String | Database table that stores features, default: ``gml_objects`` | ++------------------------+-------------+---------+------------------------------------------------------------------------------+ +| ```` | 0..1 | String | Database table that stores feature types, default: ``feature_types`` | ++------------------------+-------------+---------+------------------------------------------------------------------------------+ + +The central table (controlled by ````) uses the following columns: + +.. table:: Columns in blob table + ++--------------------+----------------+-------------------------------------------------------------------------+ +| Column | PostGIS type | Used for | ++====================+================+=========================================================================+ +| ``id`` | serial | Primary key | ++--------------------+----------------+-------------------------------------------------------------------------+ +| ``gml_id`` | text | Feature identifier (used for id queries and resolving xlink references) | ++--------------------+----------------+-------------------------------------------------------------------------+ +| ``gml_bounded_by`` | geometry | Bounding box (used for spatial queries) | ++--------------------+----------------+-------------------------------------------------------------------------+ +| ``ft_type`` | smallint | Feature type identifier (used to narrow the result set) | ++--------------------+----------------+-------------------------------------------------------------------------+ +| ``binary_object`` | bytea | Encoded feature instance | ++--------------------+----------------+-------------------------------------------------------------------------+ + +The other table (controlled by ````) stores a mapping of feature type names to feature type identifiers: + +.. table:: Columns in feature type table + ++-----------+----------------+-------------------------------------------------------------------------+ +| Column | PostGIS type | Used for | ++===========+================+=========================================================================+ +| ``id`` | smallint | Primary key | ++-----------+----------------+-------------------------------------------------------------------------+ +| ``qname`` | text | Name of the feature type | ++-----------+----------------+-------------------------------------------------------------------------+ +| ``bbox`` | geometry | Aggregated bounding box for all features of this type | ++-----------+----------------+-------------------------------------------------------------------------+ + +.. hint:: + In order for ```` to work, you need to have the correct tables in your database and initialize the feature type table with the names of all feature types you want to use. We recommend not to do this manually, see :ref:`anchor-mapping-wizard`. The wizard will also create suitable indexes to speed up queries. + +.. hint:: + You may wonder how to get data into the database in BLOB mode. As for standard mapping, you can do this by executing WFS-T requests or by using the feature store loader. Its usage is described in the last steps of :ref:`anchor-mapping-wizard`. + +.. hint:: + In BLOB mode, only spatial and feature id queries can be mapped to SQL WHERE-constraints. All other kinds of filter conditions are performed in memory. See :ref:`anchor-filtering` for more information. + +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Transactions and feature id generation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The mapping defined by a ```` element generally works in both directions: + +* **Table-to-feature-type (query)**: Feature instances are created from table rows +* **Feature-type-to-table (insert)**: New table rows are created for inserted feature instances + +However, there's a caveat for inserts: The SQL feature store has to know how to obtain new and unique feature ids. + +When features are inserted into a SQL feature store (for example via a WFS transaction), the client can choose between different id generation modes. These modes control whether feature ids (the values in the gml:id attribute) have to be re-generated. There are three id generation modes available, which directly relate to the WFS 1.1.0 specification: + +* ``UseExisting``: The feature store will use the original gml:id values that have been provided in the input. This may lead to errors if the provided ids are already in use or if the format of the id does not match the configuration. +* ``GenerateNew``: The feature store will discard the original gml:id values and use the configured generator to produce new and unique identifiers. References in the input (xlink:href) that point to a feature with an reassigned id are fixed as well, so reference consistency is ensured. +* ``ReplaceDuplicate``: The feature store will try to use the original gml:id values that have been provided in the input. If a certain identifier already exists in the database, the configured generator is used to produce a new and unique identifier. NOTE: Support for this mode is not implemented yet. + +.. hint:: + In a WFS 1.1.0 insert request, the id generation mode is controlled by attribute ``idGenMode``. WFS 1.0.0 and WFS 2.0.0 don't support to specify it on a request basis. However, in the deegree WFS configuration you can control it in the option ``EnableTransactions``. + +In order to generate the required ids for ``GenerateNew``, you can choose between different generators. These are configured in the ```` child element of ````: + +""""""""""""""""" +Auto id generator +""""""""""""""""" + +The auto id generator depends on the database to provide new values for the feature id column(s) on insert. This requires that the used feature id columns are configured appropriately in the database (e.g. that they have a trigger or a suitable column type such as ``SERIAL`` in PostgreSQL). + +.. topic:: SQL feature store: Auto id generator example + + .. literalinclude:: xml/sqlfeaturestore_idgenerator1.xml + :language: xml + +This snippet defines the feature id mapping and the id generation behaviour for a feature type called ``ad:Address`` + +* When querying, the prefix ``AD_ADDRESS_`` is prepended to column ``attr_gml_id`` to create the exported feature id. If ``attr_gml_id`` contains the value ``42`` in the database, the feature instance that is created from this row will have the value ``AD_ADDRESS_42``. +* On insert (mode=UseExisting), provided gml:id values must have the format ``AD_ADDRESS_$``. The prefix ``AD_ADDRESS_`` is removed and the remaining part of the identifier is stored in column ``attr_gml_id``. +* On insert (mode=GenerateNew), the database must automatically create a new value for column ``attr_gml_id`` which will be the postfix of the newly assigned feature id. + +"""""""""""""" +UUID generator +"""""""""""""" + +The UUID generator generator uses Java's UUID implementation to generate new and unique identifiers. This requires that the database column for the id is a character column that can store strings with a length of 36 characters and that the database does not perform any kind of insertion value generation for this column (e.g triggers). + +.. topic:: SQL feature store: UUID generator example + + .. literalinclude:: xml/sqlfeaturestore_idgenerator2.xml + :language: xml + +This snippet defines the feature id mapping and the id generation behaviour for a feature type called ``ad:Address`` + +* When querying, the prefix ``AD_ADDRESS_`` is prepended to column ``attr_gml_id`` to create the exported feature id. If ``attr_gml_id`` contains the value ``550e8400-e29b-11d4-a716-446655440000`` in the database, the feature instance that is created from this row will have the value ``AD_ADDRESS_550e8400-e29b-11d4-a716-446655440000``. +* On insert (mode=UseExisting), provided gml:id values must have the format ``AD_ADDRESS_$``. The prefix ``AD_ADDRESS_`` is removed and the remaining part of the identifier is stored in column ``attr_gml_id``. +* On insert (mode=GenerateNew), a new UUID is generated and stored in column ``attr_gml_id``. + +""""""""""""""""""""" +Sequence id generator +""""""""""""""""""""" + +The sequence id generator queries a database sequence to generate new and unique identifiers. This requires that the database column for the id is compatible with the values generated by the sequence and that the database does not perform any kind of automatical value insertion for this column (e.g triggers). + +.. topic:: SQL feature store: Database sequence generator example + + .. literalinclude:: xml/sqlfeaturestore_idgenerator3.xml + :language: xml + +This snippet defines the feature id mapping and the id generation behaviour for a feature type called ``ad:Address`` + +* When querying, the prefix ``AD_ADDRESS_`` is prepended to column ``attr_gml_id`` to create the exported feature id. If ``attr_gml_id`` contains the value ``42`` in the database, the feature instance that is created from this row will have the value ``AD_ADDRESS_42``. +* On insert (mode=UseExisting), provided gml:id values must have the format ``AD_ADDRESS_$``. The prefix ``AD_ADDRESS_`` is removed and the remaining part of the identifier is stored in column ``attr_gml_id``. +* On insert (mode=GenerateNew), the database sequence ``SEQ_FID`` is queried for new values to be stored in column ``attr_gml_id``. + +.. _anchor-filtering: + +^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Evaluation of query filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The SQL feature store always tries to map filter conditions (e.g. from WFS ``GetFeature`` requests or when accessed by the WMS) to SQL-WHERE conditions. However, this is not always possible. Sometimes a filter uses an expression that just can not be mapped to an equivalent SQL-WHERE clause. For example when using :ref:`anchor-blob-mode` and the filter is not based on a feature id or a spatial constraint. -"""""""""""""""""""""""""""""""""""""""""""""""""" +In such cases, the SQL feature store falls back to in-memory filtering. It will reconstruct feature by feature from the database and evaluate the filter in memory. If the filter matches, it will be included in the result feature stream. If not, it is skipped. + +The downside of this strategy is that it can put a serious load on your server. If you want to turn off in-memory filtering completely, use ````. If this option is specified and a filter requires in-memory filtering, the query will be rejected. + +.. _anchor-mapping-wizard: + +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Auto-generating a mapping configuration and tables -"""""""""""""""""""""""""""""""""""""""""""""""""" +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Although it may not always result in usable configurations, the services console can be used to automatically derive a mapping configuration and set up tables from an existing GML application schema. If you don't have an existing database structure that you want to use, you can try this possibility to create a working set up a very quickly. +Although this functionality is still in beta stage, the services console can be used to automatically derive an SQL feature store configuration and set up tables from an existing GML application schema. If you don't have an existing database structure that you want to use, you can use this option to create a working database set up very quickly. And even if you have an existing database you need to map manually, this functionality can be prove very helpful to generate a valid mapping configuration to start with. .. hint:: As every (optional) attribute and element will be considered in the mapping, you may easily end up with hundreds of tables or columns. -Here's a walkthrough based on the INSPIRE workspace, but you should be able to use these instructions with other GML application schemas as well. Make sure that the INSPIRE workspace has been downloaded and activated as described in :ref:`anchor-workspace-inspire`. As a prerequisite, you will have to create an empty, spatially-enabled PostGIS or Oracle database that you can connect to from your deegree installation. +This walkthrough is based on the INSPIRE Annex I schemas, but you should be able to use these instructions with other GML application schemas as well. Make sure that the INSPIRE workspace has been downloaded and activated as described in :ref:`anchor-workspace-inspire`. As another prerequisite, you will have to create an empty, spatially-enabled PostGIS database that you can connect to from your deegree installation. -As a first step, create a JDBC connection to your database: +.. tip:: + Instead of PostGIS, you can also use an Oracle Spatial or an Microsoft SQL Server database. In order to enable support for these databases, see :ref:`anchor-db-libraries`. -.. figure:: images/browser.png +As a first step, create a JDBC connection to your database. Click **server connections -> jdbc** and enter **inspire** (or an other identifier) as connection id: + +.. figure:: images/console_featurestore_mapping1.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_featurestore_mapping1.jpg Creating a JDBC connection -Click on "server connections -> jdbc", enter "inspire" (or an other identifier) as the connection id and click on "Create new": +Afterwards, click **Create new** and enter the connection details to your database: -.. figure:: images/browser.png +.. figure:: images/console_featurestore_mapping2.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_featurestore_mapping2.jpg Creating a JDBC connection -Ensure that deegree can connect to the database: +By clicking **Test connection**, you can ensure that deegree can connect to your database: + +.. figure:: images/console_featurestore_mapping3.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_featurestore_mapping3.jpg + + Testing the JDBC connection + +If everything works, click **Create** to finish the creation of your JDBC resource: -.. figure:: images/browser.png +.. figure:: images/console_featurestore_mapping4.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_featurestore_mapping4.jpg Testing the JDBC connection -Now, change to "data stores -> feature". We will have to delete the existing (memory-based) feature store. Click on "Delete". +Now, change to **data stores -> feature**. We will have to delete the existing (memory-based) feature store first. Click **Delete**: -.. figure:: images/browser.png +.. figure:: images/console_featurestore_mapping5.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_featurestore_mapping5.jpg Deleting the memory-based feature store -Enter "inspire" as name for the new feature store, select SQL and click on "Create new": +Enter "inspire" as name for the new feature store, select "SQL" from the drop-down box and click **Create new**: -.. figure:: images/browser.png +.. figure:: images/console_featurestore_mapping6.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_featurestore_mapping6.jpg - Creating a new SQL feature store configuration + Creating a new SQL feature store resource -Select "Create tables from GML application schema" and click "Next": +Select "Create tables from GML application schema" and click **Next**: -.. figure:: images/browser.png +.. figure:: images/console_featurestore_mapping7.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_featurestore_mapping7.jpg Mapping a new SQL feature store configuration -You can now select the GML application schema files to be used. For this walkthrough, just tick the Addresses.xsd file, which contains the Addresses Data Theme (if you select all files, hundreds of feature types from INPIRE Annex I will be mapped). Scroll down and click "Next". +You can now select the GML application schema files to be used. For this walkthrough, tick ``Addresses.xsd``, ``AdministrativeUnits.xsd`` and ``CadastralParcels.xsd`` (if you select all schema files, hundreds of feature types from INPIRE Annex I will be mapped): + +.. figure:: images/console_featurestore_mapping8.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_featurestore_mapping8.jpg + + Selecting the GML schema files to be considered .. hint:: - This view presents any .xsd files that are located below the **appschemas** directory of your deegree workspace. If you want to map any other GML application schema (such as GeoSciML or CityGML), place a copy of the application schema files into the **appschemas** directory (using your favorite method, e.g. a file browser) and click on "Rescan". You should now have the option to select the files of this application schema in the services console view. + This view presents any .xsd files that are located below the **appschemas/** directory of your deegree workspace. If you want to map any other GML application schema (such as GeoSciML or CityGML), place a copy of the application schema files into the **appschemas/** directory (using your favorite method, e.g. a file browser) and click **Rescan**. You should now have the option to select the files of this application schema in the services console view. -.. figure:: images/browser.png +.. figure:: images/console_featurestore_mapping9.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_featurestore_mapping9.jpg - Mapping a new SQL feature store configuration + Selecting the GML schema files to be considered + +Scroll down and click **Next**. + +.. figure:: images/console_featurestore_mapping10.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_featurestore_mapping10.jpg + + Selecting mapping type and storage CRS + +You will be presented with a rough analysis of the feature types contained in the selected GML application schema files. Select "Relational" (you may also select BLOB if your prefer this kind of storage) and enter "EPSG:4258" as storage CRS (this is the code for ETRS89, the recommmended CRS for harmonized INSPIRE datasets). After clicking **Next**, an SQL feature store configuration will be automatically derived from the application schema: + +.. figure:: images/console_featurestore_mapping11.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_featurestore_mapping11.jpg + + The auto-generated SQL feature store configuration + +Click **Save** to store this configuration: + +.. figure:: images/console_featurestore_mapping12.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_featurestore_mapping12.jpg + + Auto-generated SQL statements for creating tables + +Now, click **Create DB tables**. You will be presented with an auto-generated SQL script for creating the required tables in the database: + +.. figure:: images/console_featurestore_mapping13.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_featurestore_mapping13.jpg + + Auto-generated SQL statements for creating tables + +Click **Execute**. The SQL statements will now be executed against your database and the tables will be created: + +.. figure:: images/console_featurestore_mapping15.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_featurestore_mapping15.jpg + + Mapping finished + +Click **Start feature store**: + +.. figure:: images/console_featurestore_mapping17.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_featurestore_mapping17.jpg + + Finished -You will be presented with a rough analysis of the feature types contained in the selected GML application schema files. +Click **Reload** to force a reinitialization of the other workspace resources. We're finished. Features access of the WFS and WMS uses your database now. However, as your database is empty, the WMS will not render anything and the WFS will not return any features when queried. In order to insert some harmonized INSPIRE features, click **send requests** and select one of the insert requests: + +Use the third drop-down menu to select an example request. Entries "Insert_200.xml" or "Insert_110.xml" can be used to insert a small number of INSPIRE Address features using WFS-T insert requests: + +.. figure:: images/console_workspace_inspire3.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_workspace_inspire3.jpg + + WFS-T example requests + +Click **Send** to execute the request. After successful insertion, the database contains a few addresses, and you may want to move back to the layer overview (**see layers**). If you activate the AD.Address layer, the newly inserted features will be rendered by the deegree WMS (look for them in the area of Enkhuizen): + +.. figure:: images/console_workspace_inspire4.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_workspace_inspire4.jpg + + Ad.Address layer after insertion of example Address features + +Of course, you can also perform WFS queries against the database backend, such as requesting of INSPIRE Addresses by street name: + +.. figure:: images/console_workspace_inspire5.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_workspace_inspire5.jpg + + More WFS examples + +Besides WFS-T requests, there's another handy option for inserting GML-encoded features. Click **data stores -> feature** to access the feature store view again: + +.. figure:: images/console_featurestore_mapping18.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_featurestore_mapping18.jpg + + Accessing the feature store loader + +After clicking **Loader**, you will be presented with a simple view where you can insert a URL of a valid GML dataset: + +.. figure:: images/console_featurestore_mapping19.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_featurestore_mapping19.jpg + + The feature store loader + +Basically, you can use this view to insert any valid, GML-encoded dataset, as long as it conforms to the application schema. The INSPIRE workspace contains some suitable example datasets, so you may use a file-URL like: + +* file:/home/kelvin/.deegree/deegree-workspace-inspire/data/au-provincies.gml +* file:/home/kelvin/.deegree/deegree-workspace-inspire/data/au-gemeenten.gml +* file:/home/kelvin/.deegree/deegree-workspace-inspire/data/au-land.gml +* file:/home/kelvin/.deegree/deegree-workspace-inspire/data/cadastralparcels-limburg.xml +* file:/home/kelvin/.deegree/deegree-workspace-inspire/data/cadastralparcels-northholland.xml + +.. tip:: + The above URLs are for a UNIX system with a user named "kelvin". You will need to adapt the URLs to match the location of your workspace directory. + +After entering the URL, click **Import**: + +.. figure:: images/console_featurestore_mapping20.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_featurestore_mapping20.jpg + Imported INSPIRE datasets via the Loader diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping1.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping1.jpg new file mode 100644 index 0000000000..348bda5add Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping1.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping10.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping10.jpg new file mode 100644 index 0000000000..c43fdac8c6 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping10.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping11.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping11.jpg new file mode 100644 index 0000000000..dc2313c8e3 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping11.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping12.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping12.jpg new file mode 100644 index 0000000000..eb22948ba4 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping12.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping13.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping13.jpg new file mode 100644 index 0000000000..fb4fd0a820 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping13.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping14.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping14.jpg new file mode 100644 index 0000000000..fb4fd0a820 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping14.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping15.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping15.jpg new file mode 100644 index 0000000000..8a7e34cae6 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping15.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping16.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping16.jpg new file mode 100644 index 0000000000..8a7e34cae6 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping16.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping17.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping17.jpg new file mode 100644 index 0000000000..80386f2f92 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping17.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping18.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping18.jpg new file mode 100644 index 0000000000..7b06816231 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping18.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping19.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping19.jpg new file mode 100644 index 0000000000..13e9499996 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping19.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping2.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping2.jpg new file mode 100644 index 0000000000..34cf9e2cd3 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping2.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping20.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping20.jpg new file mode 100644 index 0000000000..1994ec2965 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping20.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping3.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping3.jpg new file mode 100644 index 0000000000..3660b895a0 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping3.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping4.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping4.jpg new file mode 100644 index 0000000000..09eb328451 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping4.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping5.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping5.jpg new file mode 100644 index 0000000000..1e0e5a8435 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping5.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping6.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping6.jpg new file mode 100644 index 0000000000..d026800447 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping6.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping7.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping7.jpg new file mode 100644 index 0000000000..4eaed0bec4 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping7.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping8.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping8.jpg new file mode 100644 index 0000000000..b257afeeb4 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping8.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping9.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping9.jpg new file mode 100644 index 0000000000..56dbf373f6 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_featurestore_mapping9.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_start.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_start.jpg index f28da5507f..923486050d 100644 Binary files a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_start.jpg and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_start.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw1.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw1.jpg new file mode 100644 index 0000000000..6cfda9ad4c Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw1.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw2.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw2.jpg new file mode 100644 index 0000000000..f28be1aa22 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw2.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw3.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw3.jpg new file mode 100644 index 0000000000..7513d41b92 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw3.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw4.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw4.jpg new file mode 100644 index 0000000000..92a6d4676c Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw4.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw5.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw5.jpg new file mode 100644 index 0000000000..01dd0869e3 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw5.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw6.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw6.jpg new file mode 100644 index 0000000000..015c26f05f Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw6.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw7.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw7.jpg new file mode 100644 index 0000000000..49c2401690 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw7.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw8.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw8.jpg new file mode 100644 index 0000000000..e23a7270df Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw8.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw9.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw9.jpg new file mode 100644 index 0000000000..5600ab1cea Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_csw9.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_imported.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_imported.jpg index eb173596c2..4281d076f5 100644 Binary files a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_imported.jpg and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_imported.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire1.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire1.jpg new file mode 100644 index 0000000000..c5d76a240d Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire1.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire2.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire2.jpg new file mode 100644 index 0000000000..bad6ddfdeb Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire2.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire3.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire3.jpg new file mode 100644 index 0000000000..eeac82a5b6 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire3.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire4.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire4.jpg new file mode 100644 index 0000000000..78c61ae960 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire4.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire5.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire5.jpg new file mode 100644 index 0000000000..6ddb7fbd4c Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_inspire5.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah1.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah1.jpg index dc22fe25f6..ad6e8f782e 100644 Binary files a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah1.jpg and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah1.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah2.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah2.jpg index 8935207b6e..e48c1088cd 100644 Binary files a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah2.jpg and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah2.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah3.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah3.jpg index df09da074d..5fbb5e3de4 100644 Binary files a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah3.jpg and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah3.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah4.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah4.jpg index d41838dd3e..7a5a634c03 100644 Binary files a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah4.jpg and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah4.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah5.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah5.jpg new file mode 100644 index 0000000000..ef84a2bf17 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_utah5.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps1.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps1.jpg new file mode 100644 index 0000000000..90d8f08d0f Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps1.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps2.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps2.jpg new file mode 100644 index 0000000000..23d43632a2 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps2.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps3.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps3.jpg new file mode 100644 index 0000000000..2c4b977de3 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps3.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps4.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps4.jpg new file mode 100644 index 0000000000..a8a52f280c Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps4.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps5.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps5.jpg new file mode 100644 index 0000000000..3733021e57 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspace_wps5.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspaces.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspaces.jpg index 8e4e29fc0f..16618f3632 100644 Binary files a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspaces.jpg and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/console_workspaces.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/java_processprovider_inputtypes.png b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/java_processprovider_inputtypes.png new file mode 100644 index 0000000000..e904ac4a9f Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/java_processprovider_inputtypes.png differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/java_processprovider_outputtypes.png b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/java_processprovider_outputtypes.png new file mode 100644 index 0000000000..12cae98f43 Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/java_processprovider_outputtypes.png differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/module_info.jpg b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/module_info.jpg new file mode 100644 index 0000000000..739f30a72b Binary files /dev/null and b/deegree-services/deegree-webservices-handbook/src/main/sphinx/images/module_info.jpg differ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/installation.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/installation.rst index ea2fdfbfc6..a34e72a60b 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/installation.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/installation.rst @@ -21,7 +21,7 @@ Supported Java versions are `OpenJDK `_ version 7 (curr Downloading ----------- -deegree webservices 3.2 downloads are available on the `deegree home page `_. You have the choice of two flavors: +deegree webservices downloads are available on the `deegree home page `_. You have the choice of two flavors: * *ZIP*: Multi-operating system package bundled with Apache Tomcat * *WAR*: Plain Java Web Archive for deployment in an existing servlet container [#f2]_ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/intro.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/intro.rst index d9795bdf9b..8510977255 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/intro.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/intro.rst @@ -29,10 +29,10 @@ deegree WFS is an implementation of the `OGC Web Feature Service specification < * Backends support flexible mapping of GML application schemas to relational models * ISO 19107-compliant geometry model: Complex geometries (e.g. non-linear curves) * Advanced filter expression support based on XPath 1.0 -* Supports numerous backends, such as PostGIS, Oracle Spatial, Shapefiles or GML instance documents +* Supports numerous backends, such as PostGIS, Oracle Spatial, MS SQL Server, Shapefiles or GML instance documents .. tip:: - In order to learn about configuring a deegree-based WFS, it is recommended to read chapters :ref:`anchor-installation` and :ref:`anchor-lightly` first. Check out :ref:`anchor-workspace-utah` and :ref:`anchor-workspace-inspire` for example deegree WFS configurations. Continue with :ref:`anchor-configuration-basics` and :ref:`anchor-configuration-wfs`. + In order to learn the setup and configuration of a deegree-based WFS, we recommend to read chapters :ref:`anchor-installation` and :ref:`anchor-lightly` first. Check out :ref:`anchor-workspace-inspire` and :ref:`anchor-workspace-utah` for example deegree WFS configurations. Continue with :ref:`anchor-configuration-basics` and :ref:`anchor-configuration-wfs`. ------------------------------ Characteristics of deegree WMS @@ -54,7 +54,7 @@ deegree WMS is an implementation of the `OGC Web Map Service specification + * The typical workflow is: + *
    + *
  1. Get inputs from in parameter
  2. + *
  3. Parse inputs into the required format (e.g. GML)
  4. + *
  5. Do computation.
  6. + *
  7. Transform computational results into required format (e.g. GML)
  8. + *
  9. Write results to out parameter
  10. + *
+ * + * @param in + * input arguments to be processed, never null + * @param out + * used to store the process outputs, never null + * @param info + * can be used to provide execution information, i.e. percentage completed and start/success messages + * that it wants to make known to clients, never null + * @throws ProcessletException + * may be thrown by the processlet to indicate a processing exception + */ + public void process( ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info ) + throws ProcessletException; + + /** + * Called by the {@link ProcessManager} to indicate to a {@link Processlet} that it is being placed into service. + */ + public void init(); + + /** + * Called by the {@link ProcessManager} to indicate to a {@link Processlet} that it is being taken out of service. + *

+ * This method gives the {@link Processlet} an opportunity to clean up any resources that are being held (for + * example, memory, file handles, threads) and make sure that any persistent state is synchronized with the + * {@link Processlet}'s current state in memory. + *

+ */ + public void destroy(); +} + diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/java/java_processprovider_complex.java b/deegree-services/deegree-webservices-handbook/src/main/sphinx/java/java_processprovider_complex.java new file mode 100644 index 0000000000..c1df00fc01 --- /dev/null +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/java/java_processprovider_complex.java @@ -0,0 +1,25 @@ +import org.deegree.services.wps.Processlet; +import org.deegree.services.wps.ProcessletException; +import org.deegree.services.wps.ProcessletExecutionInfo; +import org.deegree.services.wps.ProcessletInputs; +import org.deegree.services.wps.ProcessletOutputs; +import org.deegree.services.wps.input.LiteralInput; +import org.deegree.services.wps.output.LiteralOutput; + +public class AdditionProcesslet implements Processlet { + + public void process( ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info ) + throws ProcessletException { + int summandA = Integer.parseInt( ( (LiteralInput) in.getParameter( "SummandA" ) ).getValue() ); + int summandB = Integer.parseInt( ( (LiteralInput) in.getParameter( "SummandB" ) ).getValue() ); + int sum = summandA + summandB; + + LiteralOutput output = (LiteralOutput) out.getParameter( "Sum" ); + output.setValue( "" + sum ); + } + + public void destroy() {} + + public void init() {} +} + diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/java/java_processprovider_minimal.java b/deegree-services/deegree-webservices-handbook/src/main/sphinx/java/java_processprovider_minimal.java new file mode 100644 index 0000000000..1ec82b0817 --- /dev/null +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/java/java_processprovider_minimal.java @@ -0,0 +1,27 @@ +import org.deegree.services.wps.Processlet; +import org.deegree.services.wps.ProcessletException; +import org.deegree.services.wps.ProcessletExecutionInfo; +import org.deegree.services.wps.ProcessletInputs; +import org.deegree.services.wps.ProcessletOutputs; +import org.deegree.services.wps.output.LiteralOutput; + +public class Processlet42 implements Processlet { + + @Override + public void process( ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info ) + throws ProcessletException { + LiteralOutput output = (LiteralOutput) out.getParameter( "Answer" ); + output.setValue( "42" ); + } + + @Override + public void init() { + // nothing to initialize + } + + @Override + public void destroy() { + // nothing to destroy + } +} + diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/javamodules.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/javamodules.rst index 7c5c1144a5..2259a4d66b 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/javamodules.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/javamodules.rst @@ -4,28 +4,112 @@ Java modules and libraries ========================== -deegree webservices is a Java web application, and therefore the standard means of adding Java libraries to the classpath apply (e.g. you can add JARs to ``WEB-INF/lib`` of the deegree webapp directory). Alternatively, you may add your JARs to the ``modules/`` directory of your deegree workspace. This can be handy, as it allows to ship a self-contained workspace (no fiddling with other directories required) and also has the benefit the you can reload the deegree workspace only after adding your libraries (instead of restarting the deegree webapp or the whole web application container). +deegree webservices is a Java web application and based on code written in the Java programming language. As a user, you usually don't need to care about this, unless you want to extend the default functionality available in a deegree webservices setup. This chapter provides some basic knowledge of JAR (Java archive) files, the Java classpath and describes how deegree webservices finds JARs. Additionally, it provides precise instructions for adding JARs so your deegree webservices instance can connect to Oracle Spatial and Microsoft SQL Server databases. -The remainder of this chapter describes to common use-cases. +.. hint:: + The terms JAR, module and library are used interchangeably in this chapter. -.. _anchor-oraclejars: +.. _anchor-adding-jars: -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Adding Oracle JDBC drivers -^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Java code and the classpath +^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The following deegree modules support connecting to Oracle Spatial databases (10g, 11g): +Java code is usually packaged in JAR files. If you want to extend deegree's codebase, you will have to add one or more JAR files to the so-called classpath [#f1]_. Basically, there are two different types of classpaths that determine which JAR files are available to deegree webservices: + +* The web application classpath +* The workspace classpath + +The full classpath used by deegree webservices consists of the web application classpath and the workspace classpath. If conflicting files exist on both classpaths, the file on the workspace classpath takes precedence. + +.. tip:: + If you're not familiar with classpath concepts and don't have any special requirements, simply add your JAR files to the workspace classpath and ignore the web application classpath. + +""""""""""""""""""""""""" +Web application classpath +""""""""""""""""""""""""" + +As deegree webservices is a Java web application, standard paths apply: + +* Directory ``WEB-INF/lib`` of the deegree web application (for JARs) +* Directory ``WEB-INF/classes`` of the deegree web application (for Java class files) +* Global directories for all web applications running in the container (depends on the actual web container) + +When you add files to the web application claspath, you have to restart the web application or the web application container to make the new code available to deegree webservices. + +.. hint:: + All Java libraries shipped with deegree webservices are located in the ``WEB-INF/lib`` directory of the deegree webservices webapp. If you downloaded the ZIP version, this directory is located in ``webapps/ROOT/WEB-INF/lib``. + +""""""""""""""""""" +Workspace classpath +""""""""""""""""""" + +When deegree webservices initializes the workspace, it scans directory ``modules/`` of the active deegree workspace for files ending with ``.jar`` and adds them to the classpath. This can be very handy, as it allows to create self-contained workspaces (no fiddling with other directories required) and also has the benefit the you can reload the deegree workspace only after adding your libraries (instead of restarting the deegree webapp or the whole web application container). + +.. hint:: + In addition to workspace directory ``modules/``, directory ``classes/`` can be used to add individual Java classes (and other files) to the classpath. This is usually not required. + +^^^^^^^^^^^^^^^^^^^^^^^ +Checking available JARs +^^^^^^^^^^^^^^^^^^^^^^^ + +In order to see which JARs are available to your deegree webservices instance/workspace, use the "module info" link in the general section of the service console: + +.. figure:: images/module_info.jpg + :figwidth: 60% + :width: 50% + :target: _images/module_info.jpg + + Displaying available JARs using the service console + +The list of JARs section displays the JARs found on the web application classpath, while the lower section displays the JARs found on the workspace classpath. + +.. hint: + Actually, not all JARs are displayed in this view. Only deegree modules and JDBC drivers are displayed (see below). + +.. _anchor-db-libraries: + +^^^^^^^^^^^^^^^^^^^^^^^ +Adding database modules +^^^^^^^^^^^^^^^^^^^^^^^ + +By default, deegree webservices includes everything that is needed for connecting to PostgreSQL/PostGIS and Derby databases. If you want to connect to an Oracle Spatial or Microsoft SQL Server instance, you need to add additional Java libraries manually, as the required JDBC libraries are not included in the deegree webservices download (for license reasons). + +""""""""""""""""""""" +Adding Oracle support +""""""""""""""""""""" + +The following deegree resources support Oracle Spatial databases (10g, 11g): + +* SimpleSQLFeatureStore +* SQLFeatureStore +* ISOMetadataStore + +In order to enable Oracle connectivity for these resources, you need to add two JAR files (see :ref:`anchor-adding-jars`): + +* A compatible Oracle JDBC6-type driver (e.g. ``ojdbc6-11.2.0.2.jar``) [#f2]_ +* Module deegree-sqldialect-oracle [#f3]_ + +""""""""""""""""""""""""""""""""""" +Adding Microsoft SQL server support +""""""""""""""""""""""""""""""""""" + +The following deegree resources support Microsoft SQL Server (2008, 2012): * SimpleSQLFeatureStore * SQLFeatureStore * ISOMetadataStore -However, for copyright reasons, deegree webservices cannot ship the required Oracle JDBC driver. In order to enable Oracle connectivity, you need to add a compatible Oracle JDBC6-type driver (e.g. ``ojdbc6-11.2.0.2.jar``) to the classpath as discussed in the introduction of this chapter. Reload your deegree workspace (or the webapp/web application container if you added it by some other means than putting it into the ``modules/`` directory). +In order to enable Microsoft SQL Server connectivity for these resources, you need to add two JAR files (see :ref:`anchor-adding-jars`): -Additionally, you need to add module deegree-sqldialect-oracle, which can be downloaded at: +* A compatible Microsoft JDBC driver (e.g. ``sqljdbc4-3.0.jar``) [#f4]_ +* Module deegree-sqldialect-mssql [#f5]_ -^^^^^^^^^^^^^^^^^^^^^^^^^ -Code for custom processes -^^^^^^^^^^^^^^^^^^^^^^^^^ +.. rubric:: Footnotes +.. [#f1] The term classpath describes the set of files or directories which are used to find the available Java code (JARs and class files). +.. [#f2] http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html (registration required) +.. [#f3] http://repo.deegree.org/content/repositories/public/org/deegree/deegree-sqldialect-oracle/${project.version}/deegree-sqldialect-oracle-${project.version}.jar +.. [#f4] http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx +.. [#f5] http://repo.deegree.org/content/repositories/public/org/deegree/deegree-sqldialect-mssql/${project.version}/deegree-sqldialect-mssql-${project.version}.jar diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/layers.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/layers.rst index bf858da68c..ce5c661eba 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/layers.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/layers.rst @@ -1,10 +1,10 @@ .. _anchor-configuration-layers: -==================================== -Layer configuration -==================================== +========== +Map layers +========== -A layer is the description on how to combine a data store and a style resource into a map. Each layer configuration can be used to define one or more layers. The layers can be used in theme definitions, and depend on various data source and style resources. This chapter assumes you've already configured a data source and a style for your layer (although a style is not strictly needed; some layer types can do without, and others can render in a default style when none is given). +A (map) layer defines how to combine a data store and a style resource into a map. Each layer resource can be used to define one or more layers. The layers can be used in theme definitions, and depend on various data source and style resources. This chapter assumes you've already configured a data source and a style for your layer (although a style is not strictly needed; some layer types can do without, and others can render in a default style when none is given). .. figure:: images/workspace-overview-layer.png :figwidth: 80% @@ -211,6 +211,7 @@ Here is an example snippet: TEXT +.. _anchor-configuration-feature-layers: -------------- Feature layers @@ -268,7 +269,7 @@ The basic structure of a manual configuration looks like this: As you can see, the first thing to do is to bind the configuration to a feature store. After that, you can define one or more feature layers. -A feature layer configuration has two optional elements besides the common elements. The ``FeatureTypeName`` can be used to restrict a layer to a specific feature type (use a qualified name). The ``Filter`` element can be used to specify a filter that applies to the layer globally (use standard OGC filter encoding 1.1.0 ``ogc:Filter`` element within): +A feature layer configuration has three optional elements besides the common elements. The ``FeatureTypeName`` can be used to restrict a layer to a specific feature type (use a qualified name). The ``Filter`` element can be used to specify a filter that applies to the layer globally (use standard OGC filter encoding 1.1.0 ``ogc:Filter`` element within): .. code-block:: xml @@ -285,6 +286,24 @@ A feature layer configuration has two optional elements besides the common eleme ... +The third extra option is the ``SortBy`` element, which can be used to influence the order in which features are drawn: + +.. code-block:: xml + + + ... + + + + app:level + + + + ... + + +The attribute ``reverseFeatureInfo`` is false by default. If set to true, the feature that is drawn first will appear **last** in a ``GetFeatureInfo`` feature collection. + After that the standard options follow, as outlined in the common_ section. ----------- @@ -380,6 +399,8 @@ The remote WMS layer configuration is always based on a single ``RemoteWMS`` res In many cases that's already sufficient, but if you wish to control the way the requests are being sent, you can specify the ``RequestOptions``. If you want to limit/restrict the layers, you can specify any amount of ``Layer`` elements. +.. _anchor-configuration-layer-request-options: + ~~~~~~~~~~~~~~~ Request options ~~~~~~~~~~~~~~~ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/lightly.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/lightly.rst index 57b8eeb01c..a8924e7bc3 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/lightly.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/lightly.rst @@ -4,9 +4,9 @@ Getting started =============== -In the previous chapter, you learned how to install and start deegree webservices. In this chapter, we will introduce the deegree service console and learn how to perform basic tasks such as downloading and activating example configurations. The service console provides a way to configure the different aspects of a deegree installation (active web services, data access, layers, etc). In deegree terminology, a complete configuration for a deegree instance is called a "deegree workspace". +In the previous chapter, you learned how to install and start deegree webservices. In this chapter, we will introduce the deegree service console and learn how to use it to perform basic tasks such as downloading and activating example configurations. In deegree terminology, a complete configuration for a deegree instance is called "deegree workspace". -The following chapters describe the structure and the aspects of the deegree workspace in more detail. For the remainder of this chapter, just think of a deegree workspace as a complete configuration of a deegree webservice instance. You may have multiple deegree workspaces on your machine, but only a single workspace can be active. +The following chapters describe the structure and the aspects of the deegree workspace in detail. For the remainder of this chapter, just think of a deegree workspace as a directory of configuration files that contains a complete configuration for a deegree webservice instance. You may have multiple deegree workspaces on your machine, but only a single workspace can be active. ----------------------------------- Accessing deegree's service console @@ -22,7 +22,7 @@ The service console is a web-based administration interface for configuring your deegree webservices administration console .. tip:: - If you're not running the ZIP version, but deployed the WAR version into a web container, you most probably will have to use a different URL for accessing the console, e.g. http://localhost:8080/deegree-webservices-3.2. The port number and webapp name depend on your installation/deployment details. + If you're not running the ZIP version, but deployed the WAR version into a web container, you most probably will have to use a different URL for accessing the console, e.g. http://localhost:8080/deegree-webservices-${project.version}. The port number and webapp name depend on your installation/deployment details. .. tip:: You can access the service console from other machines on your network by exchanging *localhost* with the name or IP address of the machine that runs deegree webservices. @@ -30,7 +30,7 @@ The service console is a web-based administration interface for configuring your For the remainder of the chapter, only the **general** section is relevant. The menu items in this section: * **workspaces**: Download and activate example configurations -* **proxy**: Configure proxy settings +* **proxy**: Configure network proxy settings * **password**: Set a password for accessing the service console * **module info**: Display loaded deegree modules * **send requests**: Send raw OGC web service requests @@ -42,26 +42,26 @@ For the remainder of the chapter, only the **general** section is relevant. The Downloading and activating example workspaces ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Click on the *workspaces* link: +Click the **workspaces** link on the left: .. figure:: images/console_workspaces.jpg :figwidth: 60% :width: 50% :target: _images/console_workspaces.jpg - Workspace section + Workspaces view -The bottom of the workspace view lists the example workspaces provided by the deegree project. You should see the following list: +The bottom of the workspaces view lists example workspaces provided by the deegree project. You should see the following items: -* **deegree-workspace-utah** -* **deegree-workspace-inspire** -* **deegree-workspace-csw** -* **deegree-workspace-wps** +* **deegree-workspace-inspire**: :ref:`anchor-workspace-inspire` +* **deegree-workspace-utah**: :ref:`anchor-workspace-utah` +* **deegree-workspace-csw**: :ref:`anchor-workspace-csw` +* **deegree-workspace-wps**: :ref:`anchor-workspace-wps` .. tip:: - If the machine running deegree webservices uses a proxy to access the internet and you don't see any available example configurations, you will probably have to configure the proxy settings. Ask your network administrator for details. + If the machine running deegree webservices uses a proxy to access the internet and you don't see any available example configurations, you will probably have to configure the proxy settings. Ask your network administrator for details and use the **proxy** link to setup deegree's proxy settings. -If you click on **Import**, the corresponding example workspace will be fetched from the workspace repository of the deegree project and extracted in your deegree workspaces folder. Depending on the workspace and your internet connection, this may take a few minutes (the Utah demo workspace is about 70 MB in size). +If you click **Import**, the corresponding example workspace will be fetched from the artifact repository of the deegree project and extracted in your deegree workspaces folder. Depending on the workspace and your internet connection, this may take a while (the Utah workspace is the largest one and about 70 MB in size). After downloading has completed, the new workspace will be listed in section "Available workspaces": @@ -72,17 +72,84 @@ After downloading has completed, the new workspace will be listed in section "Av Downloaded, but inactive workspace -You can now activate the downloaded workspace by clicking on "Start". Again, this may take some time, as it may require some initialization (e.g. building of indexes). The workspace will be removed from the list of inactive workspaces, instead, the workspace will be marked as "Active" (at the top of the view). Your deegree instance is now running the service configuration that is contained in the downloaded workspace. +You can now activate the downloaded workspace by clicking **Start**. Again, this may take a bit, as it may require some initialization. The workspace will be removed from the list of inactive workspaces and displayed next to "Active workspace:" (below the deegree logo). Your deegree instance is now running the configuration that is contained in the downloaded workspace. + +.. _anchor-workspace-inspire: + +--------------------------------------------- +Example workspace 1: INSPIRE Network Services +--------------------------------------------- + +This workspace is a basic INSPIRE View and Download Services setup. It contains a transactional WFS (2.0.0 and 1.1.0) configured for all Annex I Data Themes and a WMS (1.3.0 and 1.1.1) that is configured for three layers from three Annex I Data Themes. The workspace contains some harmonized dutch base data for Administrative Units, Cadastral Parcels and Addresses. The WFS is configured to behave as an INSPIRE Download service (Direct Access) that delivers the base data as valid, harmonized INSPIRE GML and supports rich querying facilities. + +.. tip:: + This workspace is pre-configured to load harmonized INSPIRE features from GML files into memory, but can easily be adapted to use PostGIS, Oracle Spatial or Microsoft SQL Server databases as storage backend (see :ref:`anchor-mapping-wizard` and :ref:`anchor-configuration-sqlfeaturestore`). + +After downloading and activating the "deegree-workspace-inspire" workspace, you can click the **see layers** link, which opens a simple map client that displays a base map (not rendered by deegree, but loaded from the OpenStreetMap servers). + +.. figure:: images/console_workspace_inspire1.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_workspace_inspire1.jpg + + Map client showing base map + +Click the **+** on the right to see a list of available layers. You can now tick the INSPIRE layers offered by the deegree WMS. + +.. figure:: images/console_workspace_inspire2.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_workspace_inspire2.jpg + + INSPIRE layers rendered by the deegree WMS + +.. tip:: + The map client is based on `OpenLayers `_. Drag the map by holding the mouse button and moving your mouse. Zoom using the controls on the left or with the mouse wheel. Alternatively, you can open a zoom rectangle by holding the SHIFT key and clicking the mouse button in the map area. + +Note that nothing will be rendered for layer AD.Address, as the configured storage (memory) doesn't contain any Address features yet. However, the workspace ships with example WFS-T requests that can be used to insert a few harmonized INSPIRE Address features. Use the **send requests** link in the service console to access the example requests (you may need to go back in your browser first): + +Use the third drop-down menu to select an example request. Entries **Insert_200.xml** or **Insert_110.xml** can be used to insert a small number of INSPIRE Address features using WFS-T insert requests: + +.. figure:: images/console_workspace_inspire3.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_workspace_inspire3.jpg + + WFS-T example requests + +Click **Send** to execute the request. After successful insertion, the internal storage contains a few addresses, and you may want to move back to the layer overview (**see layers**). If you activate layer AD.Address this time, the newly inserted features will be rendered by the deegree WMS (look for them in the area of Enkhuizen): + +.. figure:: images/console_workspace_inspire4.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_workspace_inspire4.jpg + + Ad.Address layer after insertion of example Address features + +The example requests also contain a lot of query examples, e.g. requesting of INSPIRE Addresses by street name: + +.. figure:: images/console_workspace_inspire5.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_workspace_inspire5.jpg + + WFS query examples + +.. tip:: + This workspace is a good starting point for implementing scalable and compliant INSPIRE View and/or Download Services. It can easily be adapted to use PostGIS, Oracle Spatial or Microsoft SQL Server databases as storage backend (see :ref:`anchor-mapping-wizard` and :ref:`anchor-configuration-sqlfeaturestore`). Other things you may want to adapt is the configuration of :ref:`anchor-configuration-layers`, the :ref:`anchor-configuration-renderstyles` or the reported :ref:`anchor-configuration-service-metadata`. + +.. tip:: + You can also delete features using WFS transactions. After deletion, they will not be rendered anymore as WMS and WFS operate on the same feature store. .. _anchor-workspace-utah: -------------------------------------------------- -Example workspace 1: Webmapping Services for Utah -------------------------------------------------- +--------------------------------------------- +Example workspace 2: Utah Webmapping Services +--------------------------------------------- -The Utah example workspace contains a web mapping setup based on data from Utah. It contains a WMS configuration with some raster and vector layers and some nice render styles. Raster data is read from GeoTIFF files, vector data is backed by shapefiles. Additionally, a WFS is configured that allows to access the raw vector data in GML format. +The Utah example workspace contains a web mapping setup based on data from the state of Utah. It contains a WMS configuration (1.3.0 and 1.1.1) with some raster and vector layers and some nice render styles. Raster data is read from GeoTIFF files, vector data is backed by shapefiles. Additionally, a WFS (2.0.0, 1.1.0 and 1.0.0) is configured that allows to access the raw vector data in GML format. -After downloading and activating the "deegree-workspace-utah" workspace, you can click on the "see layers" link, which opens a simple web map client that displays a base map (not rendered by deegree, but loaded from the OpenStreetMap servers). +After downloading and activating the "deegree-workspace-utah" workspace, you can click on the **see layers** link, which opens a simple map client that displays a base map (not rendered by deegree, but loaded from the OpenStreetMap servers). .. figure:: images/console_workspace_utah1.jpg :figwidth: 60% @@ -91,7 +158,7 @@ After downloading and activating the "deegree-workspace-utah" workspace, you can Map client showing base map -Click on the "+" icon on the right side to see a list of available layers. Tick one (e.g. Municipalities) to enable it in the client. It will be generated by your deegree instance. +Click the **+** on the right to see a list of available layers. Tick the ones you want to see. They will be rendered by your deegree webservices instance. .. figure:: images/console_workspace_utah2.jpg :figwidth: 60% @@ -101,19 +168,16 @@ Click on the "+" icon on the right side to see a list of available layers. Tick Selecting WMS layers to be displayed .. tip:: -You can drag the map by holding the mouse button and moving your mouse. Zooming can be done by the controls on the left or using the mouse wheel. -Alternatively, you can open a rectangle by holding the SHIFT key and clicking the mouse button in the map area. - -In order to send some requests against the WFS, you may use the "send requests" link in the service console (you may need to go back in your browser first). A simple interface for sending XML requests will open up. This interface is meant for testing the behaviour of your web service on the protocol level and contains some reasonable example requests. + The map client is based on `OpenLayers `_. Drag the map by holding the mouse button and moving your mouse. Zoom using the controls on the left or with the mouse wheel. Alternatively, you can open a zoom rectangle by holding the SHIFT key and clicking the mouse button in the map area. .. figure:: images/console_workspace_utah3.jpg :figwidth: 60% :width: 50% :target: _images/console_workspace_utah3.jpg - Sending example requests + Exploring Utah layers -Select one of the example requests from the drop-down menu and click on the "Send" button. The server response will be displayed. +In order to send requests against the WFS, you may use the **send requests** link in the service console (you may need to go back in your browser first). A simple interface for sending XML requests will open up. This interface is meant for accessing OGC web services on the protocol level and contains some reasonable example requests. .. figure:: images/console_workspace_utah4.jpg :figwidth: 60% @@ -122,139 +186,178 @@ Select one of the example requests from the drop-down menu and click on the "Sen Sending example requests +Select one of the example requests from the third drop-down menu and click **Send**. The server response will be displayed in the lower section. + +.. figure:: images/console_workspace_utah5.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_workspace_utah5.jpg + + Sending example requests + .. tip:: WFS request types and their format are specified in the `OGC Web Feature Service specification `_. .. tip:: - Instead of using the built-in layer preview or the generic XML client, you may use any compliant OGC client for accessing the WMS and WFS. Successfully tested desktop clients include Quantum GIS (install WFS plugin for accessing WFS), uDig, OpenJUMP and deegree iGeoDesktop. The service address to enter in your client is: http://localhost:8080/services. + Instead of using the built-in layer preview or the generic OGC client, you may use any compliant OGC client for accessing the WMS and WFS. Successfully tested desktop clients include Quantum GIS (install WFS plugin for accessing WFS), uDig, OpenJUMP and deegree iGeoDesktop. The service address to enter in your client is: http://localhost:8080/services. .. figure:: images/qgis_workspace_utah.jpg :figwidth: 60% :width: 50% :target: _images/qgis_workspace_utah.jpg - Quantum GIS displaying a WMS layer from the utahDemo - + Quantum GIS displaying a WMS layer from the Utah workspace -.. _anchor-workspace-inspire: +.. _anchor-workspace-csw: ---------------------------------------------- -Example workspace 2: INSPIRE Network Services ---------------------------------------------- +--------------------------------------------------- +Example workspace 3: An ISO Catalogue Service setup +--------------------------------------------------- -This workspace is a basic INSPIRE View and Download Services setup. It contains a transactional WFS configured for all Annex I Data Themes and a WMS that is configured to display some of the Data Theme layers. +This workspace contains a catalogue service (CSW) setup that complies to the ISO Application Profile. After downloading and starting it, you will have to setup tables in a PostGIS database first. You will need to have an empty and spatially-enabled PostGIS database handy that can be accessed from the machine that runs deegree webservices. .. tip:: - This workspace is pre-configured to keep INSPIRE features in memory, but can easily be adapted to use PostGIS or Oracle as storage backend (see :ref:`anchor-configuration-sqlfeaturestore`). + Instead of PostGIS, you can also use the workspace with an Oracle Spatial or a Microsoft SQL Server database. In order to enable support for these databases, see :ref:`anchor-db-libraries`. -After downloading and activating the "deegree-workspace-inspire" workspace, you can click on the "see layers" link, which opens a simple web map client that displays a base map (not rendered by deegree, but loaded from the OpenStreetMap servers). +After downloading and starting the workspace, some errors will be indicated (red exclamation marks): -.. figure:: images/browser.png +.. figure:: images/console_workspace_csw1.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_workspace_csw1.jpg - Map client showing base map + Initial startup of deegree-workspace-csw -You can now activate the INSPIRE layers, but nothing will be rendered, as the configured storage (memory) doesn't contain any features yet. +Don't worry, this is just because we're missing the correct connection information to connect to our database. We're going to fix that right away. Click **server connections -> jdbc**: -.. figure:: images/browser.png +.. figure:: images/console_workspace_csw2.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_workspace_csw2.jpg - INSPIRE layers are empty + JDBC connection view -In order to insert some INSPIRE features, use the "send requests" link in the service console: +Click **Edit**: -.. figure:: images/browser.png +.. figure:: images/console_workspace_csw3.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_workspace_csw3.jpg - INSPIRE layers are empty + Editing the JDBC resource configuration file -Use the right-most drop-down menu to select an example request. The last entry "blabla.xml" can be used to insert a small number of INSPIRE Address features using a WFS-T insert request: +Make sure to enter the correct connection parameters and click **Save**. You should now have a working connection to your database, and the exclamation mark for **conn1** should disappear. Click **Reload** to force a full reinitialization of the workspace: -.. figure:: images/browser.png +.. figure:: images/console_workspace_csw4.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png - - Insert request + :target: _images/console_workspace_csw4.jpg -After successful insertion (click "Send"), the internal storage contains some addresses, and you may move back to the layer overview ("see layers"). After activating the Address layer, you should see some addresses painted by the deegree WMS. + Reinitializing the workspace -The example requests also contain a lot of examples for the query possibilities of the deegree WFS, e.g. the requesting of INSPIRE Addresses by street name: +The indicated problems are gone now, but we still need to create the required database tables. Change to the metadata store view (**data stores -> metadata**) and click **Setup tables**: -.. figure:: images/browser.png +.. figure:: images/console_workspace_csw5.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_workspace_csw5.jpg - Query examples + Metadata store view -.. _anchor-workspace-csw: +In the next view, click **Execute**: ---------------------------------------------------- -Example workspace 3: An ISO Catalogue Service setup ---------------------------------------------------- +.. figure:: images/console_workspace_csw6.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_workspace_csw6.jpg + + Creating tables for storing ISO metadata records + +.. figure:: images/console_workspace_csw7.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_workspace_csw7.jpg -This workspace contains a catalogue service (CSW) setup that complies to the ISO Application Profile. After downloading and starting it, you will have to setup tables in a PostGIS database first (TBD describe Oracle). You will need to have an empty and spatially-enabled PostGIS database handy that can be accessed from the machine that runs the deegree webservices. + After table creation -As a first step, you will have to create a JDBC connection to your PostGIS database: +If all went well, you should now have a working, but empty CSW setup. You can connect to the CSW with compliant clients or use the **send requests** link to send raw CSW requests to the service. The workspace comes with some suitable example requests. Use the third drop-down menu to select an example request. Entry **complex_insert.xml** can be used to insert some ISO example records using a CSW transaction request: -.. figure:: images/browser.png +.. figure:: images/console_workspace_csw8.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_workspace_csw8.jpg - Creating a JDBC connection + Choosing example requests -Click on "server connections -> jdbc", enter "iso" as the connection id and click on "Create new": +Click **Send**. After successful insertion, some records have been inserted into the CSW (respectively the database). You may want to explore other example requests as well, e.g. for retrieving records: -.. figure:: images/browser.png +.. figure:: images/console_workspace_csw9.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_workspace_csw9.jpg + + Other example CSW requests - Creating a JDBC connection +.. _anchor-workspace-wps: + +------------------------------------------------ +Example workspace 4: Web Processing Service demo +------------------------------------------------ -You will now be prompted to enter the connection parameters for your database. Make sure to enter the correct connection information (use "Test connection" to check it) and click "OK". You now have a working connection to your database, but we need to create the required database tables as well. Change to the metadata store view ("data stores -> metadata") and click the "Setup tables" link: +This workspace contains a WPS setup with simple example processes and example requests. It's a good starting point for learning the WPS protocol and the development of WPS processes. After downloading and starting it, click **send requests** in order to find example requests that can be sent to the WPS. Use the third drop-down menu to select an example request: -.. figure:: images/browser.png +.. figure:: images/console_workspace_wps1.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_workspace_wps1.jpg + + Choosing a WPS example request - Creating the tables for the ISO catalogue +Click **Send** to fire it against the WPS: + +.. figure:: images/console_workspace_wps2.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_workspace_wps2.jpg -Click "Create". If all went well, you should now have a working CSW setup. You can connect to the CSW with any compliant client (TBD tested?) or use the "send requests" link to send some raw CSW requests to the service. + Sending an example request against the WPS -Use the right-most drop-down menu to select an example request. The last entry "blabla.xml" can be used to insert some ISO records using a CSW transaction request: +The response of the WPS will be displayed in the lower section: -.. figure:: images/browser.png +.. figure:: images/console_workspace_wps3.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_workspace_wps3.jpg - Insert request + WPS response is displayed -After successful insertion (click "Send"), some records will be inserted into the PostGIS database. You may explore the other example requests as well. +Besides the geometry example processes, the parameter example process and example requests may be interesting to developers who want to learn development of WPS processes with deegree webservices: -.. _anchor-workspace-wps: +.. figure:: images/console_workspace_wps4.jpg + :figwidth: 60% + :width: 50% + :target: _images/console_workspace_wps4.jpg ------------------------------------------------- -Example workspace 4: Web Processing Service demo ------------------------------------------------- + Example requests for the parameter demo process -This workspace contains a WPS setup with some simple example processes. After downloading and starting it, you can click on "send requests" in order to fire some example requests to the WPS. Use the right-most drop-down menu to select an example request and click "Send" to send it to the WPS: +The process has four input parameters (literal, bounding box, xml and binary) that are simply piped to four corresponding output parameters. There's practically no process logic, but the included example requests demonstrate many of the possibilities of the WPS protocol: -.. figure:: images/browser.png +* Input parameter passing variants (inline vs. by reference) +* Output parameter handling (inline vs. by reference) +* Response variants (ResponseDocument vs. RawData) +* Storing of response documents +* Asynchronous execution + +.. figure:: images/console_workspace_wps5.jpg :figwidth: 60% :width: 50% - :target: _images/browser.png + :target: _images/console_workspace_wps5.jpg + + Example requests for the ParameterDemo process - WPS example requests +.. tip:: + WPS request types and their format are specified in the `OGC Web Processing Service specification `_. + +.. tip:: + In order to add your own processes, see :ref:`anchor-configuration-wps` and :ref:`anchor-configuration-processproviders`. -TBD pointers to chapters for adding your own processes diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/metadatastores.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/metadatastores.rst index 0ce3920645..4b6ead861f 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/metadatastores.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/metadatastores.rst @@ -1,8 +1,8 @@ .. _anchor-configuration-metadatastore: -============================ -Metadata store configuration -============================ +=============== +Metadata stores +=============== Metadata stores are data stores that provide access to metadata records. The two common use cases for metadata stores are: @@ -45,9 +45,10 @@ The SQL ISO metadata store implementation currently supports the following backe * PostgreSQL (8.3, 8.4, 9.0, 9.1, 9.2) with PostGIS extension (1.4, 1.5, 2.0) * Oracle Spatial (10g, 11g) +* Microsoft SQL Server (2008, 2012) .. tip:: - If you want to use the SQL ISO metadata store with Oracle, you will need to add Oracle's JDBC driver manually. This is described in :ref:`anchor-oraclejars`. + If you want to use the SQL ISO metadata store with Oracle or Microsoft SQL Server, you will need to add additional modules first. This is described in :ref:`anchor-db-libraries`. The SQL metadata store configuration is defined by schema file http://schemas.deegree.org/datasource/metadata/iso19115/3.2.0/iso19115.xsd diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/processproviders.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/processproviders.rst index 1a74fbd0c4..798c794cc6 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/processproviders.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/processproviders.rst @@ -1,12 +1,12 @@ .. _anchor-configuration-processproviders: -============================== -Process provider configuration -============================== +================= +Process providers +================= -Process providers plug geospatial processes into the WPS. +Process provider resources define geospatial processes that can be accessed via the :ref:`anchor-configuration-wps`. -The remainder of this chapter describes some relevant terms and the process provider configuration files in detail. You can access this configuration level by clicking on the **processes** link in the administration console. The configuration files are located in the **processes/** subdirectory of the active deegree workspace directory. +The remainder of this chapter describes some relevant terms and the process provider configuration files in detail. You can access this configuration level by clicking on the **processes** link in the administration console. The corresponding resource files are located in the **processes/** subdirectory of the active deegree workspace directory. .. figure:: images/workspace-overview-process.png :figwidth: 80% @@ -19,10 +19,747 @@ The remainder of this chapter describes some relevant terms and the process prov Java process provider --------------------- -TODO. Some information is available here: http://wiki.deegree.org/deegreeWiki/deegree3/HowToCreateWPSProcesses. It's for deegree 3.0, but basically applies to 3.2 as well. +The Java process provider is a well-defined container for processes written in the Java programming language. In order to set up a working Java process provider resource, two things are required: -------------------------- -Sextante process provider -------------------------- +* A Java process provider configuration file +* A *Processlet*: Java class with the actual process code + +The first item is an XML resource configuration file like any other deegree resource configuration. The second is special to this kind of resource. It provides the byte code with the process logic and has to be accessible by deegree's classloader. There are several options to make custom Java code available to deegree webservices (see :ref:`anchor-adding-jars` for details), but the most common options are: + +* Putting class files into the ``classes/`` directory of the workspace +* Putting JAR files into the ``modules/`` directory of the workspace + +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Minimal configuration example +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A very minimal valid configuration example looks like this: + +.. topic:: Java process provider: Minimal example (resource configuration) + + .. literalinclude:: xml/java_processprovider_minimal.xml + :language: xml + +This example defines a bogus process with the following properties: + +* Identifier: ``Process42`` +* Bound to Java code from class ``Processlet42`` +* Title **Calculates the answer to life, the universe and everything** (returned in WPS responses) +* No input parameters +* Single output parameter with identifier ``Answer`` and title **The universal answer** + +In order to make this configuration work, a matching Processlet class is required: + +.. topic:: Java process provider: Minimal example (Java code) + + .. literalinclude:: java/java_processprovider_minimal.java + :language: java + +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +More complex configuration example +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A more complex configuration example looks like this: + +.. topic:: Java process provider: More complex example (resource configuration) + + .. literalinclude:: xml/java_processprovider_complex.xml + :language: xml + +This example defines a demonstration process with the following properties: + +* Identifier: ``AdditionProcess`` +* Bound to Java code from class ``AdditionProcesslet`` +* Title **Process for adding two integer values.** (returned in WPS responses) +* Two integer input parameters ``SummandA`` and ``SummandB`` with title, abstract and unit of measure +* Single integer output parameter with identifier ``Sum``, title and unit of measure + +In order to make this configuration work, a matching Processlet class is required: + +.. topic:: Java process provider: Minimal example (Java code) + + .. literalinclude:: java/java_processprovider_complex.java + :language: java + +^^^^^^^^^^^^^^^^^^^^^ +Configuration options +^^^^^^^^^^^^^^^^^^^^^ + +The configuration format for the Java process provider is defined by schema file http://schemas.deegree.org/processes/java/3.0.0/java.xsd. The following table lists all available configuration options. When specifiying them, their order must be respected. + +.. table:: Options for ``ProcessDefinition`` configuration files + ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++==================+=============+=========+==============================================================================+ +| @processVersion | 1 | String | Release version of this process (metadata) | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| @storeSupported | 0..1 | Boolean | If set to true, asynchronous execution will become available | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| @statusSupported | 0..1 | Boolean | If set to true, process code provides status information | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Identifier | 1 | String | Identifier of the process | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| JavaClass | 1 | String | Fully qualified name of a Processlet that implements the process logic | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Title | 1 | String | Short and meaningful title (metadata) | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Abstract | 0..1 | String | Short, human readable description (metadata) | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Metadata | 0..n | String | Additional metadata | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Profile | 0..n | String | Profile to which the WPS process complies (metadata) | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| WSDL | 0..1 | String | URL of a WSDL document which describes this process (metadata) | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| InputParameters | 0..1 | Complex | Definition and metadata of the input parameters | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| OutputParameters | 1 | Complex | Definition and metadata of the output parameters | ++------------------+-------------+---------+------------------------------------------------------------------------------+ + +The following sections describe these options and their sub-options in detail, as well as the Processlet API. + +^^^^^^^^^^^^^^^ +General options +^^^^^^^^^^^^^^^ + +All general options just provide metadata that the WPS reports to client. They don't affect the behaviour of the configured process. + +* ``processVersion``: The processVersion attribute has to be managed by the process developer and describes the version of the process implementation. This parameter is usually increased when changes to the implementation of a process apply. +* ``Identifier``: An unambiguous identifier +* ``Title``: Short and meaningful title +* ``Abstract``: Short, human readable description +* ``Metadata``: Additional metadata +* ``Profile``: Profile to which the WPS process complies +* ``WSDL``: URL of a WSDL document which describes this process + +.. hint:: + These options directly relate to metadata defined in the `WPS 1.0.0 specification `_. + +^^^^^^^^^^^^^^^^^^ +The Processlet API +^^^^^^^^^^^^^^^^^^ + +Option ``JavaClass`` specifies the fully qualified name of a Java class that implement deegree's ``Processlet`` Java interface. This interface is part of an API that hides the complexity of the WPS protocol while providing efficient and scalable handling of input and output parameters. By using this API, the process developer can focus on implementing the process logic without having to care of the details of the protocol: + +* Request encoding (KVP, XML, SOAP) +* Input parameter passing variants (inline, by reference) +* Output parameter representation (inline, by reference) +* Storing of response documents +* Synchronous/asynchronous execution + +The interface looks like this: + +.. topic:: Java process provider: Processlet interface + + .. literalinclude:: java/Processlet.java + :language: java + +As you can see, the interface defines three methods: + +* ``init()``: Called once when the workspace initializes the Java process provider resource that references the class. +* ``destroy()``: Called once when the workspace destroys the Java process provider resource that references the class. +* ``process(...)``: Called every time an Execute request is sent to the WPS that targets this Processlet. The method usually reads the input parameters, performs the actual computation and writes the output parameters. + +.. hint:: + The Processlet interface mimics the well-known Java Servlet interface (hence the name). A Servlet developer does not need to care of the details of HTTP. Similarly, a Processlet developer does not need to care of the details of the WPS protocol. + +.. hint:: + The Java process provider instantiates the Processlet class only once. However, multiple simultaneous executions of a Processlet are possible (in case parallel Execute-requests are sent to a WPS), and therefore, the Processlet code must be implemented in a thread-safe manner (just like Servlets). + +"""""""""""""""""""""" +Processlet compilation +"""""""""""""""""""""" + +In order to succesfully compile a ``Processlet`` implementation, you will need to make the Processlet API available to the compiler. Generally, this means that the Java module ``deegree-services-wps`` (and it's dependencies) have to be on the build path. We suggest to use Apache Maven for this. Here's an example POM for your convenience: + +.. topic:: Java process provider: Example Maven POM for compiling processlets + + .. literalinclude:: xml/java_processprovider_pom.xml + :language: xml + +.. tip:: + You can use this POM to compile the example Processlets above. Just create an empty directory somewhere and save the example POM as ``pom.xml``. Place the Processlet Java files into subdirectory ``src/main/java/`` (as files ``Processlet42.java`` / ``AdditionProcesslet.java``). On the command line, change to the project directory and use ``mvn package`` (Apache Maven 3.0 and a compatible Java JDK have to be installed). Subdirectory ``target`` should now contain a JAR file that you can copy into the ``modules/`` directory of the deegree workspace. + +"""""""""""""""""""""""""""""""""""""""""" +Testing Processlets using raw WPS requests +"""""""""""""""""""""""""""""""""""""""""" + +.. hint:: + In order to perform WPS request to access your process provider/Processlet, you need to have an active :ref:`anchor-configuration-wps` resource in your workspace (which handles the WPS protocol and forwards the request to the process provider and the processlet). + +The general idea of the WPS specification is that a client connects to a WPS server and invokes processes offered by the server to perform a computation. However, in some cases, you may just want to send raw WPS requests to a server and check the response yourself (e.g. for testing the behaviour of your processlet). The `WPS 1.0.0 specification `_ defines KVP, XML and SOAP-encoded requests. All encodings are supported by the deegree WPS, so you can choose the most appropriate one for your use-case. For sending KVP-requests, you can simply use your web browser (or a command line tools like wget or curl). XML or SOAP requests can be send using deegree's generic client. + +Some KVP ``GetCapabilities``/``DescribeProcess`` request examples for checking the metadata of processes: + +* ``http://127.0.0.1:8080/services/wps?service=WPS&request=GetCapabilities`` +* ``http://127.0.0.1:8080/services/wps?service=WPS&version=1.0.0&request=DescribeProcess&identifier=Process42`` +* ``http://127.0.0.1:8080/services/wps?service=WPS&version=1.0.0&request=DescribeProcess&identifier=AdditionProcess`` + +Some simple KVP ``Execute`` request examples for invoking processes: + +* ``http://127.0.0.1:8080/services/wps?service=WPS&version=1.0.0&request=Execute&identifier=Process42`` +* ``http://127.0.0.1:8080/services/wps?service=WPS&version=1.0.0&request=Execute&identifier=Addition&datainputs=SummandA=21;SummandB=21`` + +.. tip:: + The `WPS 1.0.0 specification `_ (and the deegree WPS) support many features with regard to process invocation, such as input parameter passing (inline or by reference), return parameters (inline or by reference), response variants and asynchronous execution. :ref:`anchor-workspace-wps` contains XML example requests which demonstrate most of these features. + +^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Input and output parameters +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Besides the process logic, the most crucial topic of WPS process implementation is the standard-compliant definition and handling of input and output parameters. The deegree WPS and the Java process provider support all parameter types that are defined by the `WPS 1.0.0 specification `_: + +* ``LiteralInput``/``LiteralOutput``: Literal values, e.g. "red", "42" or "highway 66" +* ``BoundingBoxInput``/``BoundingBoxOutput``: A geo-referenced bounding box +* ``ComplexInput``/``ComplexOutput``: Either an XML structure (e.g. GML encoded features) or binary data (e.g. coverage data as GeoTIFF) + +In order to create your own process, first find out which input and output parameters you want it to have. During implementation, each parameter has to be considered twice: + +* It has to be defined in the resource configuration file +* It has to be read or written in the Processlet + +The definition in the resource configuration is mostly to specify metadata (identifier, title, abstract, datatype) of the parameter. The WPS will report it in response to ``DescribeProcess`` requests. When performing ``Execute`` requests, the deegree WPS will also perform a basic check of the validity of the input parameters (identifier, number of occurences, type) and respond with an ``ExceptionReport`` if the constraints are not met. + +"""""""""""""""""""""""""""""""""""""""""""""" +Basics of defining input and output parameters +"""""""""""""""""""""""""""""""""""""""""""""" + +In order to define a parameter of a process, create a new child element in your process provider configuration: + +* Input: Add a ``LiteralInput``, ``BoundingBoxInput`` or ``ComplexInput`` element to section ``InputParameters`` +* Output: Add a ``LiteralOutput``, ``BoundingBoxOutput`` or ``ComplexOutput`` element to section ``OutputParameters`` + +Here's an ``InputParameters`` example that defines four parameters: + +.. topic:: Java process provider: Example for ``InputParameters`` section + + .. literalinclude:: xml/java_processprovider_inputs.xml + :language: xml + +Here's an ``OutputParameters`` example that defines four parameters: + +.. topic:: Java process provider: Example for ``OutputParameters`` section + + .. literalinclude:: xml/java_processprovider_outputs.xml + :language: xml + +Each parameter definition element has the following common options: + +.. table:: Common options for defining input and output parameters + ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++==================+=============+=========+==============================================================================+ +| Identifier | 1 | String | Identifier of the parameter | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Title | 1 | String | Short and meaningful title (metadata) | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Abstract | 0..1 | String | Short, human readable description (metadata) | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Metadata | 0..n | String | Additional metadata | ++------------------+-------------+---------+------------------------------------------------------------------------------+ + +Besides the identifier of the parameter, these parameters just define metadata that the WPS reports. Additionally, each input parameter definition element supports the following two attributes: + +.. table:: Additional options for defining input parameters + ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++==================+=============+=========+==============================================================================+ +| @minOccurs | 0..n | Integer | Minimum number of times the input has to be present in a request, default: 1 | ++------------------+-------------+---------+------------------------------------------------------------------------------+ +| @maxOccurs | 0..n | String | Maximum number of times the input has to be present in a request, default: 1 | ++------------------+-------------+---------+------------------------------------------------------------------------------+ + +The differences and special options of the individual parameter types (Literal, Bounding Box, Complex) are described in the following sections. + +""""""""""""""""""""""""""""""""""""""""""""""" +Basics of accessing input and output parameters +""""""""""""""""""""""""""""""""""""""""""""""" + +The first two arguments of ``Processlet#process(..)`` provide access to the input parameter values and output parameter sinks. The first argument is of type ``ProcessletInputs`` and encapsulates the process input parameters. Here's an example snippet that shows how to access the input parameter with identifier ``LiteralInput``: + +.. code-block:: java + + public void process( ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info ) + throws ProcessletException { + + ProcessletInput literalInput = in.getParameter( "LiteralInput" ); + [...] + } + +The ``getParameter(...)`` method of ``ProcessletInputs`` takes the identifier of the process parameter as an argument and returns a ``ProcessletInput`` (without the **s**) object that provides access to the actual value of the process parameter. Here's the ``ProcessletInput`` interface: + +.. code-block:: java + + public interface ProcessletInput { + + /** + * Returns the identifier or name of the input parameter as defined in the process description. + * + * @return the identifier of the input parameter + */ + public CodeType getIdentifier(); + + /** + * Returns the title that has been supplied with the input parameter, normally available for display to a human. + * + * @return the title provided with the input, may be null + */ + public LanguageString getTitle(); + + /** + * Returns the narrative description that has been supplied with the input parameter, normally available for display + * to a human. + * + * @return the abstract provided with the input, may be null + */ + public LanguageString getAbstract(); + } + +This interface does not provide access to the passed value, but ``ProcessletInput`` is the parent of three Java types that directly correspond to three input parameter types of the process provider configuration: + +.. figure:: images/java_processprovider_inputtypes.png + :target: _images/java_processprovider_inputtypes.png + + ProcessletInput interface and sub types for each parameter type + +For example, if your input parameter definition "A" is a ``BoundingBoxInput``, then the Java type for this parameter will be ``BoundingBoxInput`` as well. In your Java code, use a type cast to narrow the return type (and gain access to the passed value): + +.. code-block:: java + + public void process( ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info ) + throws ProcessletException { + + BoundingBoxInput inputA = (BoundingBoxInput) in.getParameter( "A" ); + [...] + } + +.. tip:: + If an input parameter can occur multiple times (``maxOccurs`` > 1 in the definition), use method ``getParameters(...)`` instead of ``getParameter(...)``. The latter method returns a ``List`` of ``ProcessletInput`` objects. + +Output parameters are treated in a similar manner. The second parameter of ``Processlet#process(..)`` provides to output parameter sinks. It is of type ``ProcessletOutputs``. Here's a basic usage example: + +.. code-block:: java + + public void process( ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info ) + throws ProcessletException { + + ProcessletOutput literalOutput = out.getParameter( "LiteralOutput" ); + [...] + } + +Here's the ``ProcessletOutput`` interface: + +.. code-block:: java + + public interface ProcessletOutput { + + /** + * Returns the identifier or name of the output parameter as defined in the process description. + * + * @return the identifier of the output parameter + */ + public CodeType getIdentifier(); + + /** + * Returns the title that has been supplied with the request of the output parameter, normally available for display + * to a human. + * + * @return the title provided with the output, may be null + */ + public LanguageString getSubmittedTitle(); + + /** + * Returns the narrative description that has been supplied with the request of the output parameter, normally + * available for display to a human. + * + * @return the abstract provided with the output, may be null + */ + public LanguageString getSubmittedAbstract(); + + /** + * Returns whether this output parameter has been requested by the client, i.e. if it will be present in the result. + *

+ * NOTE: If the parameter is requested, the {@link Processlet} must set a value for this parameter, if not, it may + * or may not do so. However, for complex output parameters that are not requested, it is advised to omit them for + * more efficient execution of the {@link Processlet}. + *

+ * + * @return true, if the {@link Processlet} must set the value of this parameter (in this execution), false otherwise + */ + public boolean isRequested(); + + /** + * Sets the parameter title in the response sent to the client. + * + * @param title + * the parameter title in the response sent to the client + */ + public void setTitle( LanguageString title ); + + /** + * Sets the parameter abstract in the response sent to the client. + * + * @param summary + * the parameter abstract in the response sent to the client + */ + public void setAbstract( LanguageString summary ); + } + +Again, there are three subtypes. Each subtype of ``ProcessletOutput`` corresponds to one output parameter type: + +.. figure:: images/java_processprovider_outputtypes.png + :target: _images/java_processprovider_outputtypes.png + + ProcessletOutput interface and sub types for each parameter type + +"""""""""""""""""" +Literal parameters +"""""""""""""""""" + +Literal input and output parameter definitions have the following additional options: + +.. table:: Additional options of ``LiteralOutput`` parameters + ++---------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++=====================+=============+=========+==============================================================================+ +| DataType | 0..1 | String | Data Type of this input (or output), default: unspecified (string) | ++---------------------+-------------+---------+------------------------------------------------------------------------------+ +| DefaultUOM | 0..1 | String | Default unit of measure, default: unspecified | ++---------------------+-------------+---------+------------------------------------------------------------------------------+ +| OtherUOM | 0..n | String | Alternative unit of measure | ++---------------------+-------------+---------+------------------------------------------------------------------------------+ +| DefaultValue | 0..1 | String | Default value of this input (only for inputs) | ++---------------------+-------------+---------+------------------------------------------------------------------------------+ +| AllowedValues | 0..1 | Complex | Constraints based on value sets and ranges (only for inputs) | ++---------------------+-------------+---------+------------------------------------------------------------------------------+ +| ValidValueReference | 0..1 | Complex | References to externally defined value sets and ranges (only for inputs) | ++---------------------+-------------+---------+------------------------------------------------------------------------------+ + +These options basically define metadata that the WPS publishes to clients. For the sub-options of the ``AllowedValues`` and ``ValidValueReference`` options, please refer to the `WPS 1.0.0 specification `_ or the XML schema for the Java process provider configuration format (http://schemas.deegree.org/processes/java/3.0.0/java.xsd). + +In order to work with a ``LiteralInput`` parameter in the Processlet code, the corresponding Java type offers the following methods: + +.. code-block:: java + + /** + * Returns the literal value. + * + * @see #getUOM() + * @return the literal value (has to be in the correct UOM) + */ + public String getValue(); + + /** + * Returns the UOM (unit-of-measure) for the literal value, it is guaranteed that the returned UOM is supported for + * this parameter (according to the process description). + * + * @return the requested UOM (unit-of-measure) for the literal value, may be null if no UOM is specified in the + * process description + */ + public String getUOM(); + + /** + * Returns the (human-readable) literal data type from the process definition, e.g. integer, + * real, etc). + * + * @return the data type, or null if not specified in the process definition + */ + public String getDataType(); + +Similarly, the ``LiteralOutput`` type offers the following methods: + +.. code-block:: java + + /** + * Sets the value for this output parameter of the {@link Processlet} execution. + * + * @see #getRequestedUOM() + * @param value + * value to be set (in the requested UOM) + */ + public void setValue( String value ); + + /** + * Returns the requested UOM (unit-of-measure) for the literal value, it is guaranteed that this UOM is supported + * for this parameter (according to the process description). + * + * @return the requested UOM (unit-of-measure) for the literal value, may be null + */ + public String getRequestedUOM(); + + /** + * Returns the announced literal data type from the process definition (e.g. integer, real, etc) as an URI, such as + * http://www.w3.org/TR/xmlschema-2/#integer. + * + * @return the data type, or null if not specified in the process definition + */ + public String getDataType(); + +"""""""""""""""""""""" +BoundingBox parameters +"""""""""""""""""""""" + +BoundingBox input and output parameter definitions have the following additional options: + +.. table:: Additional options for ``BoundingBoxInput`` and ``BoundingBoxOutput`` parameters + ++---------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++=====================+=============+=========+==============================================================================+ +| DefaultCRS | 1 | String | Identifier of the default coordinate reference system | ++---------------------+-------------+---------+------------------------------------------------------------------------------+ +| OtherCRS | 0..n | String | Additionally supported coordinate reference system | ++---------------------+-------------+---------+------------------------------------------------------------------------------+ + +In order to work with a ``BoundingBoxInput`` parameter in the Processlet code, the corresponding Java type offers the following methods: + +.. code-block:: java + + /** + * Returns the lower corner point of the bounding box. + * + * @return the lower corner point + */ + public double[] getLower(); + + /** + * Returns the upper corner point of the bounding box. + * + * @return the upper corner point + */ + public double[] getUpper(); + + /** + * Returns the CRS (coordinate reference system) name of the bounding box. + * + * @return the CRS (coordinate reference system) name or null if unspecified + */ + public String getCRSName(); + + /** + * Returns the bounding box value, it is guaranteed that the CRS (coordinate reference system) of the returned + * {@link Envelope} is supported for this parameter (according to the process description). + * + * @return the value + */ + public Envelope getValue(); + +Similarly, the ``BoundingBoxOutput`` type offers the following methods: + +.. code-block:: java + + /** + * Sets the value for this output parameter of the {@link Processlet} execution. + * + * @param lowerX + * @param lowerY + * @param upperX + * @param upperY + * @param crsName + */ + public void setValue( double lowerX, double lowerY, double upperX, double upperY, String crsName ); + + /** + * Sets the value for this output parameter of the {@link Processlet} execution. + * + * @param lower + * @param upper + * @param crsName + */ + public void setValue( double[] lower, double[] upper, String crsName ); + + /** + * Sets the value for this output parameter of the {@link Processlet} execution. + * + * @param value + * value to be set + */ + public void setValue( Envelope value ); + + +"""""""""""""""""" +Complex parameters +"""""""""""""""""" + +Complex input and output parameter definitions have the following additional options: + +.. table:: Additional options for ``ComplexInput`` and ``ComplexOutput`` parameters + ++---------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++=====================+=============+=========+==============================================================================+ +| @maximumMegabytes | 0..n | Integer | Maximum file size, in megabytes (only for inputs) | ++---------------------+-------------+---------+------------------------------------------------------------------------------+ +| DefaultFormat | 1 | Complex | Definition of the default XML or binary format | ++---------------------+-------------+---------+------------------------------------------------------------------------------+ +| OtherFormats | 0..n | Complex | Definition of an alternative XML or binary format | ++---------------------+-------------+---------+------------------------------------------------------------------------------+ + +A complex format (``DefaultFormat``/``OtherFormat``) is defined via three attributes (compare with the `WPS 1.0.0 specification `_): + +.. table:: Attributes for format definitions + ++---------------------+-------------+---------+------------------------------------------------------------------------------+ +| Option | Cardinality | Value | Description | ++=====================+=============+=========+==============================================================================+ +| @mimeType | 0..1 | String | Mime type of the content, default: unspecified | ++---------------------+-------------+---------+------------------------------------------------------------------------------+ +| @encoding | 0..1 | String | Encoding of the content, default: unspecified | ++---------------------+-------------+---------+------------------------------------------------------------------------------+ +| @schema | 0..1 | String | XML schema of the content, default: unspecified | ++---------------------+-------------+---------+------------------------------------------------------------------------------+ + +In order to work with a ``ComplexInput`` parameter in the Processlet code, the corresponding Java type offers the following methods: + +.. code-block:: java + + /** + * Returns the mime type of the input. + * + * @return the mime type of the input, may be null + */ + public String getMimeType(); + + /** + * Returns the encoding information supplied with the input. + * + * @return the encoding information supplied with the input, may be null + */ + public String getEncoding(); + + /** + * Returns the schema URL supplied with the input. + * + * @return the schema URL supplied with the input, may be null + */ + public String getSchema(); + + /** + * Returns an {@link InputStream} for accessing the complex value as a raw stream of bytes (usually for binary + * input). + *

+ * NOTE: Never use this method if the input parameter is encoded in XML -- use {@link #getValueAsXMLStream()} + * instead. Otherwise erroneous behaviour has to be expected (if the input value is given embedded in the execute + * request document). + *

+ * + * @see #getValueAsXMLStream() + * @return the input value as a raw stream of bytes + * @throws IOException + * if accessing the value fails + */ + public InputStream getValueAsBinaryStream() + throws IOException; + + /** + * Returns an {@link XMLStreamReader} for accessing the complex value as an XML event stream. + *

+ * NOTE: Never use this method if the input parameter is a binary value -- use {@link #getValueAsBinaryStream()} + * instead. + *

+ * The returned stream will point at the first START_ELEMENT event of the data. + * + * @return the input value as an XML event stream, current event is START_ELEMENT (the root element of the data + * object) + * @throws IOException + * if accessing the value fails + * @throws XMLStreamException + */ + public XMLStreamReader getValueAsXMLStream() + throws IOException, XMLStreamException; + +Similarly, the ``ComplexOutput`` type offers the following methods: + +.. code-block:: java + + /** + * Returns a stream for writing binary output. + * + * @return stream for writing binary output, never null + */ + public OutputStream getBinaryOutputStream(); + + /** + * Returns a stream for for writing XML output. The stream is already initialized with a + * {@link XMLStreamWriter#writeStartDocument()}. + * + * @return a stream for writing XML output, never null + * @throws XMLStreamException + */ + public XMLStreamWriter getXMLStreamWriter() + throws XMLStreamException; + + /** + * Returns the requested mime type for the complex value, it is guaranteed that the mime type is supported for this + * parameter (according to the process description). + * + * @return the requested mime type, never null (as each complex output format has a default mime type) + */ + public String getRequestedMimeType(); + + /** + * Returns the requested XML format for the complex value (specified by a schema URL), it is guaranteed that the + * format is supported for this parameter (according to the process description). + * + * @return the requested schema (XML format), may be null (as a complex output format may omit schema + * information) + */ + public String getRequestedSchema(); + + /** + * Returns the requested encoding for the complex value, it is guaranteed that the encoding is supported for this + * parameter (according to the process description). + * + * @return the requested encoding, may be null (as a complex output format may omit encoding + * information) + */ + public String getRequestedEncoding(); + +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Asynchronous execution and status information +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The WPS protocol offers support for asynchronous execution of processes as well as providing status information for long running processes. The following two options of the Java process provider deal with this: + +* ``@storeSupported``: If the storeSupported attribute is set to true, asynchronous execution of the process will be possible. A WPS client can then choose between synchronous execution (default) and asynchronous execution. Note that this doesn't add any requirements to the implementation of the Processlet code, this is taken care of automatically by the deegree WPS. +* ``@statusSupported``: If statusSupported is set to true, the WPS will announce that the process can provide status information, i.e. execution percentage. In order for this to work, the Processlet code has to provide status information. + +""""""""""""""""""""""""""""""""""""""""""""""""""" +Providing status information in the Processlet code +""""""""""""""""""""""""""""""""""""""""""""""""""" + +The third parameter that's passed to the ``execute(...)`` method is of type ``ProcessletExecutionInfo``. This type provides the following methods: + +.. code-block:: java + + /** + * Allows the {@link Processlet} to indicate the percentage of the process that has been completed, where 0 means + * the process has just started, and 99 means the process is almost complete. This value is expected to be accurate + * to within ten percent. + * + * @param percentCompleted + * the percentage value to be set, a number between 0 and 99 + */ + public void setPercentCompleted( int percentCompleted ); + + /** + * Allows the {@link Processlet} to provide a custom started message for the client. + * + * @param message + */ + public void setStartedMessage( String message ); + + /** + * Allows the {@link Processlet} to provide a custom finished message for the client. + * + * @param message + */ + public void setSucceededMessage( String message ); + +.. tip:: + Depending on the type of computation that a Processlet performs, it may or may not be trivial to provide correct progress information via ``setPercentCompleted(...)``. -TODO. Some information is available here: http://wiki.deegree.org/deegreeWiki/deegree3/ProcessingService#Sextante_processes_.28work_in_progress.29. It's for deegree 3.0, but basically applies to 3.2 as well. diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/renderstyles.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/renderstyles.rst index cbf05edfd3..1cf23b8575 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/renderstyles.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/renderstyles.rst @@ -1,8 +1,8 @@ .. _anchor-configuration-renderstyles: -==================================== -Style configuration -==================================== +========== +Map styles +========== Style resources are used to obtain information on how to render geo objects (mostly features, but also coverages) into maps. The most common use case is to reference them from a layer configuration, in order to describe how the layer is to be rendered. This chapter assumes the reader is familiar with basic SLD/SE terms. The style configurations do not depend on any other resource. diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/serverconnections.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/serverconnections.rst index 4b38de0ece..1ecc3e0086 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/serverconnections.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/serverconnections.rst @@ -4,7 +4,15 @@ Server connections ================== -Server connections are used to configure parameters necessary to connect other resources to a server. There are currently two types of server connection resources, JDBC connections (to connect to an SQL database) and remote OWS connections (to connect to other OGC webservices). +Server connections are workspace resources that provide connections to remote services. These connections can then be used by other workspace resources. Some common example use cases: + +* JDBC connection: Used by SQL feature stores to access the database that stores the feature data +* JDBC connection: Used by SQL ISO metadata stores to access the database that stores the metadata records +* WMS connection: Used by remote WMS layers to access remote WMS +* WMS connection: Used by remote WMS tile stores to access remote WMS +* WMTS connection: Used by remote WMTS tile stores to access remote WMTS + +There are currently two categories of server connection resources, JDBC connections (to connect to SQL databases) and remote OWS connections (to connect to other OGC webservices). .. figure:: images/workspace-overview-connection.png :figwidth: 80% @@ -19,9 +27,34 @@ Server connections are used to configure parameters necessary to connect other r JDBC connections ---------------- -TODO +JDBC connections define connections to SQL databases. Here's an example that connects to a PostgreSQL database on localhost, port 5432. The database to connect to is called 'inspire' +, the database user is 'postgres' and password is 'postgres'. + +.. code-block:: xml + + + jdbc:postgresql://localhost:5432/inspire + postgres + postgres + + +The JDBC connection config file format is defined by schema file http://schemas.deegree.org/jdbc/3.0.0/jdbc.xsd. The root element is ``JDBCConnection`` and the config attribute must be ``3.0.0``. The following table lists all available configuration options. When specifiying them, their order must be respected. -By default, deegree webservices ships with PostgreSQL and Derby JDBC drivers. If you want to make a connection to any other SQL database, you will need to add a compatible JDBC driver manually. This is described in :ref:`anchor-oraclejars`. +.. table:: Options for ``JDBCConnection`` + ++----------+-------------+--------+----------------------------------------+ +| Option | Cardinality | Value | Description | ++==========+=============+========+========================================+ +| Url | 1..1 | String | JDBC URL (without username / password) | ++----------+-------------+--------+----------------------------------------+ +| User | 1..n | String | DB username | ++----------+-------------+--------+----------------------------------------+ +| Password | 1..1 | String | DB password | ++----------+-------------+--------+----------------------------------------+ + +.. hint:: + By default, deegree webservices includes JDBC drivers for connecting to PostgreSQL and Derby databases. If you want to make a connection to other SQL databases (e.g. Oracle), you will need to add a compatible JDBC driver manually. This is described in :ref:`anchor-oraclejars`. ---------------------- Remote OWS connections @@ -57,12 +90,6 @@ Let's have a look at an example: The WMS version will be detected from the capabilities document version. When using 1.3.0, there are some limitations (eg. GetFeatureInfo is not supported), and it is tested to a lesser extent compared with the 1.1.1 version. -^^^^^^^^^^^^^^^^^^^^^ -Remote WFS connection -^^^^^^^^^^^^^^^^^^^^^ - -TBD - ^^^^^^^^^^^^^^^^^^^^^^ Remote WMTS connection ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/themes.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/themes.rst index 12d6ccc474..e86f8a7e6f 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/themes.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/themes.rst @@ -1,8 +1,8 @@ .. _anchor-configuration-themes: -==================================== -Theme configuration -==================================== +========== +Map themes +========== A theme defines a tree like hierarchy, which at each node can contain a number of layers. For people familiar with WMS, a theme is basically a layer tree without the actual layer definition. diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/tilestores.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/tilestores.rst index 68c210108d..96d59d85e4 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/tilestores.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/tilestores.rst @@ -1,10 +1,10 @@ .. _anchor-configuration-tilestore: -======================== -Tile store configuration -======================== +=========== +Tile stores +=========== -Tile stores are data stores that provide access to pre-rendered map tiles. The common use case for tile stores is to provide data for tile layers. +Tile stores are resources that provide access to pre-rendered map tiles. The common use case for tile stores is to provide data for tile layers. The remainder of this chapter describes some relevant terms and the tile store configuration files in detail. You can access this configuration level by clicking on the **tile stores** link in the administration console. The configuration files are located in the **datasources/tile/** directory of the deegree workspace. @@ -167,6 +167,8 @@ Let's explain the configuration using an example: * The tile matrix set id references the tile matrix set * Currently only the tile cache disk layout is supported. Just point to the layer directory and specify the file type of the images (png is recommended, but most image formats are supported) +Please note that if you use external tools to seed the tile store, you need to make sure the resulting structure is compatible. The ``00`` directory corresponds to the *first* tile matrix of the referenced tile matrix set, ``01`` to the second tile matrix and so on. + --------------------- Remote WMS tile store --------------------- @@ -207,6 +209,8 @@ Let's have a look at an example: * The format parameter specifies the image format to request from the WMS * The CRS parameter specifies which CRS to use when requesting +Additionally you can specify default and override values for request parameters within the request params block. Just add ``Parameter`` tags as described in the :ref:`anchor-configuration-layer-request-options` layer chapter. The replacing/defaulting currently only works when you configure a WMTS on top of this tile store. ``GetTile`` parameters are then mapped to ``GetMap`` requests to the backend, and ``GetFeatureInfo`` WMTS parameters to ``GetFeatureInfo`` WMS parameters on the backend. + ---------------------- Remote WMTS tile store ---------------------- @@ -249,3 +253,4 @@ Let's have a look at an example: Please note that you need a locally configured tile matrix set that corresponds exactly to the tile matrix set of the remote WMTS. They need not have the same identifier(s) (just configure the TileMatrixSetId option if they differ), but the structure (coordinate system, tile size, number of tiles per matrix etc.) needs to be identical. +Additionally you can specify default and override values for request parameters within the request params block. Just add ``Parameter`` tags as described in the :ref:`anchor-configuration-layer-request-options` layer chapter. The replacing/defaulting currently only works when you configure a WMTS on top of this tile store. Please note that the ``scope`` attribute cannot be configured here, since remote WMTS currently only handles ``GetTile`` requests anyway. diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/webservices.rst b/deegree-services/deegree-webservices-handbook/src/main/sphinx/webservices.rst index 9c4f311b96..129ece4e37 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/webservices.rst +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/webservices.rst @@ -1,10 +1,10 @@ .. _anchor-configuration-service: -======================== -Webservice configuration -======================== +============ +Web services +============ -This chapter describes the deegree webservices configuration files. You can access this configuration level by clicking on the **web services** link in the administration console. The corresponding configuration files are located in the ``services/`` subdirectory of the active deegree workspace directory. +This chapter describes the configuration of web service resources. You can access this configuration level by clicking the **web services** link in the administration console. The corresponding configuration files are located in the ``services/`` subdirectory of the active deegree workspace directory. .. figure:: images/workspace-overview-services.png :figwidth: 80% @@ -14,7 +14,7 @@ This chapter describes the deegree webservices configuration files. You can acce Web services are the top-level resources of the deegree workspace .. tip:: - The identifier of a webservice resource (config file name without suffix) serves a special purpose. If your deegree instance can be reached at ``http://localhost:8080/deegree-webservices``, the common endpoint for connecting to your services is ``http://localhost:8080/deegree-webservices/services``. However, if you define multiple services of the same type in your workspace (e.g. two WMS instances with identifiers ``wms1`` and ``wms2``), you cannot use the common URL, as deegree cannot determine the targeted WMS instance from the request. In this case, simply append the webservice identifier to the common endpoint URL (e.g. ``http://localhost:8080/deegree-webservices/services/wms2``) to choose the service instance that you want to connect to explicitly. + The identifier of a web service resource has a special purpose. If your deegree instance can be reached at ``http://localhost:8080/deegree-webservices``, the common endpoint for connecting to your services is ``http://localhost:8080/deegree-webservices/services``. However, if you define multiple service resources of the same type in your workspace (e.g. two WMS instances with identifiers ``wms1`` and ``wms2``), you cannot use the common URL, as deegree cannot determine the targeted WMS instance from the request. In this case, simply append the resource identifier to the common endpoint URL (e.g. ``http://localhost:8080/deegree-webservices/services/wms2``) to choose the service resource that you want to connect to explicitly. .. _anchor-configuration-wfs: @@ -22,7 +22,7 @@ This chapter describes the deegree webservices configuration files. You can acce Web Feature Service (WFS) ------------------------- -A deegree WFS configuration consists of a WFS configuration file and any number of feature store configuration files. Feature stores provide access to the actual feature data (which may be stored in any of the supported backends, e.g. in shapefiles or spatial databases such as PostGIS or Oracle Spatial). In transactional mode (WFS-T), feature stores are also used for modification of stored features: +A deegree WFS setup consists of a WFS configuration file and any number of feature store configuration files. Feature stores provide access to the actual data (which may be stored in any of the supported backends, e.g. in shapefiles or spatial databases such as PostGIS or Oracle Spatial). In transactional mode (WFS-T), feature stores are also used for modification of stored features: .. figure:: images/workspace-wfs.png :figwidth: 80% @@ -31,8 +31,9 @@ A deegree WFS configuration consists of a WFS configuration file and any number A WFS resource is connected to any number of feature store resources -.. tip:: - In order to fully master deegree WFS configuration, you will have to understand :ref:`anchor-configuration-featurestore` as well. +^^^^^^^^^^^^^^^ +Minimal example +^^^^^^^^^^^^^^^ The only mandatory option is ``QueryCRS``, therefore, a minimal WFS configuration example looks like this: @@ -41,13 +42,23 @@ The only mandatory option is ``QueryCRS``, therefore, a minimal WFS configuratio .. literalinclude:: xml/wfs_basic.xml :language: xml -This will create a deegree WFS with the feature types from all configured feature stores in the workspace and ``urn:ogc:def:crs:EPSG::4258`` as coordinate system for returned GML geometries. A more complex configuration example looks like this: +This will create a deegree WFS with the feature types from all configured feature stores in the workspace and ``urn:ogc:def:crs:EPSG::4258`` as coordinate system for returned GML geometries. + +^^^^^^^^^^^^^^^^^^^^ +More complex example +^^^^^^^^^^^^^^^^^^^^ + +A more complex configuration example looks like this: .. topic:: WFS config example 2: More complex configuration .. literalinclude:: xml/wfs_complex.xml :language: xml +^^^^^^^^^^^^^^^^^^^^^^ +Configuration overview +^^^^^^^^^^^^^^^^^^^^^^ + The deegree WFS config file format is defined by schema file http://schemas.deegree.org/services/wfs/3.2.0/wfs_configuration.xsd. The root element is ``deegreeWFS`` and the config attribute must be ``3.2.0``. The following table lists all available configuration options (complex ones contain nested options themselves). When specifiying them, their order must be respected. .. table:: Options for ``deegreeWFS`` @@ -76,7 +87,7 @@ The deegree WFS config file format is defined by schema file http://schemas.deeg | CustomFormat | 0..n | Complex | Custom format configuration | +-------------------------+-------------+---------+------------------------------------------------------------------+ -The remainder of this section describes these options and their sub-options in detail. +The remainining sections describe these options and their sub-options in detail. ^^^^^^^^^^^^^^^ General options @@ -504,9 +515,7 @@ This section shows all available special constructs. The selectors are explained +-------------------------------+-------------------+-------------------------------------------------------------------------------------------------+ | | property | calls the *name* template if the index of the current property is even | +-------------------------------+-------------------+-------------------------------------------------------------------------------------------------+ -| | property | evaluates to a HTML link with the value of the property as target and text | -+-------------------------------+-------------------+-------------------------------------------------------------------------------------------------+ -| | property | if the value of the property is not an absolute link, the prefix is prepended | +| | property | if the value of the property is not an absolute link, the prefix is prepended | +-------------------------------+-------------------+-------------------------------------------------------------------------------------------------+ | | property | the text of the link will be *text* instead of the link address | +-------------------------------+-------------------+-------------------------------------------------------------------------------------------------+ @@ -571,21 +580,37 @@ In deegree terminology, a deegree WMTS provides access to tiles stored in tile s .. tip:: In order to fully understand deegree WMTS configuration, you will have to learn configuration of other workspace aspects as well. Chapter :ref:`anchor-configuration-tilestore` describes the configuration of tile data access. Chapter :ref:`anchor-configuration-layers` describes the configuration of layers (only tile layers are usable for the WMTS). Chapter :ref:`anchor-configuration-themes` describes how to create a theme from layers. -The deegree WMTS config file format is defined by schema file http://schemas.deegree.org/services/wmts/3.2.0/wmts.xsd. The root element is ``deegreeWMTS`` and the config attribute must be ``3.2.0``. The only mandatory section is ``ServiceConfiguration`` (which can be empty), therefore, a minimal WMTS configuration example looks like this: +^^^^^^^^^^^^^^^ +Minimal example +^^^^^^^^^^^^^^^ + +The only mandatory section is ``ServiceConfiguration`` (which can be empty), therefore a minimal WMTS configuration example looks like this: .. topic:: WMTS config example 1: Minimal configuration .. literalinclude:: xml/wmts_basic.xml :language: xml -This will setup a deegree WMTS with all configured themes in the workspace. A more complex configuration that restricts the offered themes looks like this: +This will create a deegree WMTS resource that connects to all configured themes of the workspace. + +^^^^^^^^^^^^^^^^^^^^ +More complex example +^^^^^^^^^^^^^^^^^^^^ + +A more complex configuration that restricts the offered themes looks like this: .. topic:: WMTS config example 2: More complex configuration .. literalinclude:: xml/wmts_complex.xml :language: xml -The following table lists all available configuration options. When specifiying them, their order must be respected. +^^^^^^^^^^^^^^^^^^^^^^ +Configuration overview +^^^^^^^^^^^^^^^^^^^^^^ + +The deegree WMTS config file format is defined by schema file http://schemas.deegree.org/services/wmts/3.2.0/wmts.xsd. The root element is ``deegreeWMTS`` and the config attribute must be ``3.2.0``. + +The following table lists all available configuration options. When specifying them, their order must be respected. .. table:: Options for ``deegreeWMTS`` @@ -606,7 +631,7 @@ Below the ``ServiceConfiguration`` section you can specify custom featureinfo fo ... -Have a look at section :ref:`anchor-featureinfo-configuration` (in the WMS chapter) to see how custom featureinfo formats are configured. +Have a look at section :ref:`anchor-featureinfo-configuration` (in the WMS chapter) to see how custom featureinfo formats are configured. Take note that the GetFeatureInfo operation is currently only supported for remote WMS tile store backends. .. _anchor-configuration-csw: @@ -626,13 +651,23 @@ In deegree terminology, a deegree CSW provides access to metadata records stored .. tip:: In order to fully understand deegree CSW configuration, you will have to learn configuration of other workspace aspects as well. Chapter :ref:`anchor-configuration-metadatastore` describes the configuration of metadatastores. -The deegree CSW config file format is defined by schema file http://schemas.deegree.org/services/csw/3.2.0/csw_configuration.xsd. The root element is ``deegreeCSW`` and the config attribute must be ``3.2.0``. There is no mandatory element, therefore a minimal CSW configuration example looks like this: +^^^^^^^^^^^^^^^ +Minimal example +^^^^^^^^^^^^^^^ + +There is no mandatory element, therefore a minimal CSW configuration example looks like this: .. topic:: CSW config example 1: Minimal configuration .. literalinclude:: xml/csw_basic.xml :language: xml +^^^^^^^^^^^^^^^^^^^^^^ +Configuration overview +^^^^^^^^^^^^^^^^^^^^^^ + +The deegree CSW config file format is defined by schema file http://schemas.deegree.org/services/csw/3.2.0/csw_configuration.xsd. The root element is ``deegreeCSW`` and the config attribute must be ``3.2.0``. + The following table lists all available configuration options. When specifiying them, their order must be respected. .. table:: Options for ``deegreeCSW`` @@ -670,7 +705,7 @@ Extended Functionality Web Processing Service (WPS) ---------------------------- -In deegree terminology, a deegree WPS allows the execution of geospatial processes from process providers. +A deegree WPS allows the invocation of geospatial processes. The offered processes are determined by the attached process provider resources. .. figure:: images/workspace-wps.png :figwidth: 90% @@ -682,20 +717,36 @@ In deegree terminology, a deegree WPS allows the execution of geospatial process .. tip:: In order to fully master deegree WPS configuration, you will have to understand :ref:`anchor-configuration-processproviders` as well. -There are no mandatory options, therefore, a minimal valid WPS configuration example looks like this: +^^^^^^^^^^^^^^^ +Minimal example +^^^^^^^^^^^^^^^ + +A minimal valid WPS configuration example looks like this: .. code-block:: xml - + +This will create a WPS resource with the following properties: + +* All WPS protocol versions are enabled. Currently, this is only 1.0.0. +* The WPS resource will attach to all process provider resources in the workspace. +* Temporary files (e.g. for process results) are stored in the standard Java temp directory of the deegree webapp. +* The last 100 process executions are tracked. +* Memory buffers (e.g. for inline XML inputs) are limited to 1 MB each. If this limit is exceeded, buffering is switched to use a file in the storage directory. + +^^^^^^^^^^^^^^^ +Complex example +^^^^^^^^^^^^^^^ + A more complex configuration example looks like this: .. code-block:: xml - + 1.0.0 @@ -709,6 +760,18 @@ A more complex configuration example looks like this: +This will create a WPS resource with the following properties: + +* Enabled WPS protocol versions: 1.0.0 +* The WPS resource will attach to all process provider resources in the workspace. +* Storage directory for temporary files (e.g. for process results) is ``/var/wps`` inside the workspace. +* The last 1000 process executions will be tracked. +* Memory buffers (e.g. for inline XML inputs) are limited to 1 MB each. If this limit is exceeded, buffering is switched to use a file in the storage directory. + +^^^^^^^^^^^^^^^^^^^^^^ +Configuration overview +^^^^^^^^^^^^^^^^^^^^^^ + The deegree WPS config file format is defined by schema file http://schemas.deegree.org/services/wps/3.1.0/wps_configuration.xsd. The root element is ``deegreeWPS`` and the config attribute must be ``3.1.0``. The following table lists all available configuration options (complex ones contain nested options themselves). When specifiying them, their order must be respected. .. table:: Options for ``deegreeWPS`` @@ -725,13 +788,11 @@ The remainder of this section describes these options and their sub-options in d * ``SupportedVersions``: By default, all implemented WMS protocol versions are activated. Currently, this is just 1.0.0 anyway. Alternatively you can control offered WPS protocol versions using the element ``SupportedVersions``. This element allows the child element ``1.0.0`` for now. -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Execution manager settings -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -TODO explain execution manager +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +DefaultExecutionManager section +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The ``DefaultExecutionManager`` option has the following sub-options: +This section controls aspects that are related to temporary storage (for input and output parameter values) during the execution of processes. The ``DefaultExecutionManager`` option has the following sub-options: .. table:: Options for ``DefaultExecutionManager`` @@ -745,11 +806,11 @@ The ``DefaultExecutionManager`` option has the following sub-options: | InputDiskSwitchLimit | 0..1 | Integer | Limit in bytes, before a ComplexInputInput is written to disk, default: 1 MiB | +----------------------+-------------+---------+-------------------------------------------------------------------------------+ -TODO explain parameters in detail +.. _anchor-configuration-service-metadata: ----------------------- -Metadata configuration ----------------------- +-------- +Metadata +-------- This section describes the configuration for the different types of metadata that a service reports in the ``GetCapabilities`` response. These options don't affect the data that the service offers or the behaviour of the service. It merely changes the descriptive metadata that the service reports. @@ -897,9 +958,9 @@ Extended capabilities Extended capabilities are generic metadata sections below the ``OperationsMetadata`` element in the ``GetCapabilities`` response. They are not defined by the OGC service specifications, but by additional guidance documents, such as the INSPIRE Network Service TGs. deegree treats this section as a generic XML element and includes it in the output. If your service supports multiple protocol versions (e.g. a WFS that supports 1.1.0 and 2.0.0), you may include multiple ``ExtendedCapabilities`` elements in the metadata configuration and use attribute ``protocolVersions`` to indicate the version that you want to define the extended capabilities for. ------------------------- -Controller configuration ------------------------- +------------------ +Service controller +------------------ The controller configuration is used to configure various global aspects that affect all services. diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_complex.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_complex.xml new file mode 100644 index 0000000000..c36fcec778 --- /dev/null +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_complex.xml @@ -0,0 +1,35 @@ + + Addition + AdditionProcesslet + Process for adding two integer values. + The purpose of this process is to provide new users with a simple example process. + + + SummandA + First summand + This parameter specifies the first summand for a simple addition. + integer + meters + centimeters + + + SummandB + Second summand + This parameter specifies the second summand for a simple addition. + integer + meters + centimeters + + + + + Sum + The result of the addition operation + integer + meters + centimeters + + + diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_inputs.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_inputs.xml new file mode 100644 index 0000000000..5e607cfd42 --- /dev/null +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_inputs.xml @@ -0,0 +1,26 @@ + + + LiteralInput + Example literal input + This parameter specifies how long the execution of the process takes (the process sleeps for this time). + May be specified in seconds or minutes. + integer + seconds + minutes + + + BBOXInput + BBOXInput + EPSG:4326 + + + XMLInput + XMLInput + + + + BinaryInput + BinaryInput + + + diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_minimal.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_minimal.xml new file mode 100644 index 0000000000..9314790979 --- /dev/null +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_minimal.xml @@ -0,0 +1,12 @@ + + Process42 + Processlet42 + Calculates the answer to life, the universe and everything + + + Answer + The universal answer + + + diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_outputs.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_outputs.xml new file mode 100644 index 0000000000..4261bb9820 --- /dev/null +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_outputs.xml @@ -0,0 +1,23 @@ + + + LiteralOutput + A literal output parameter + integer + seconds + + + BBOXOutput + A bounding box output parameter + EPSG:4326 + + + XMLOutput + An XML output parameter + + + + BinaryOutput + A binary output parameter + + + diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_pom.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_pom.xml new file mode 100644 index 0000000000..86220c7aa7 --- /dev/null +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/java_processprovider_pom.xml @@ -0,0 +1,36 @@ + + 4.0.0 + processlet-examples + jar + processlet-examples + Maven project for compiling Processlets + + + org.deegree + deegree + ${project.version} + + + + + deegree-repo + http://repo.deegree.org/content/groups/public + + never + + + true + + + + + + + org.deegree + deegree-services-wps + ${project.version} + + + + diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/service_metadata.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/service_metadata.xml index 85714fce07..834c6bb500 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/service_metadata.xml +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/service_metadata.xml @@ -1,4 +1,4 @@ - @@ -33,7 +33,7 @@ http://www.nationaalgeoregister.nl/geonetwork/srv/nl/csw?service=CSW&request=GetRecordById&version=2.0.2&id=${metadataSetId} - ad:Address + ad:Address ad:Address Harmonized INSPIRE Addresses (Annex I) beefcafe-beef-cafe-beef-cafebeefcaf diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_complex.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_complex.xml new file mode 100644 index 0000000000..a64363f6d6 --- /dev/null +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_complex.xml @@ -0,0 +1,88 @@ + + inspire + EPSG:4258 + ../../appschemas/inspire/annex1/Addresses.xsd + ../../appschemas/inspire/annex1/AdministrativeUnits.xsd + ../../appschemas/inspire/annex1/CadastralParcels.xsd + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_featuretypemapping1.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_featuretypemapping1.xml index cd20af3cea..63cc418bf9 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_featuretypemapping1.xml +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_featuretypemapping1.xml @@ -1,7 +1,7 @@ -[...] - - - +... + + + -[...] +... diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_fidmapping1.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_fidmapping1.xml index f1d241fd6d..63cc418bf9 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_fidmapping1.xml +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_fidmapping1.xml @@ -1,9 +1,7 @@ -[...] - - - - +... + + + - [...] -[...] +... diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_fidmapping2.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_fidmapping2.xml new file mode 100644 index 0000000000..73d3dbb44d --- /dev/null +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_fidmapping2.xml @@ -0,0 +1,8 @@ +... + + + + + + +... diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_fidmapping3.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_fidmapping3.xml new file mode 100644 index 0000000000..f1d241fd6d --- /dev/null +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_fidmapping3.xml @@ -0,0 +1,9 @@ +[...] + + + + + + [...] + +[...] diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven1.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven1.xml index 6e83fc05b6..819e2a1de3 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven1.xml +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven1.xml @@ -1,14 +1,11 @@ - + http://schemas.deegree.org/datasource/feature/sql/3.2.0/sql.xsd"> - postgis - EPSG:4258 - ../../appschemas/inspire/annex1/ad_address.xsd diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven2.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven2.xml index 6e83fc05b6..f1a8cdfbb7 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven2.xml +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven2.xml @@ -1,14 +1,7 @@ - - - - postgis - - EPSG:4258 - - ../../appschemas/inspire/annex1/ad_address.xsd - - +... + + + + + +... diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven3.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven3.xml new file mode 100644 index 0000000000..f824914384 --- /dev/null +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven3.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven4.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven4.xml new file mode 100644 index 0000000000..4b6176ef61 --- /dev/null +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven4.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven5.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven5.xml new file mode 100644 index 0000000000..8875528573 --- /dev/null +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_schemadriven5.xml @@ -0,0 +1,10 @@ + + [...] + + + + + + + + diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_tabledriven5.xml b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_tabledriven5.xml new file mode 100644 index 0000000000..de67602db0 --- /dev/null +++ b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xml/sqlfeaturestore_tabledriven5.xml @@ -0,0 +1,9 @@ +... + + + + EPSG:4326 + + + +... diff --git a/deegree-services/deegree-webservices/pom.xml b/deegree-services/deegree-webservices/pom.xml index c3dbca51fd..93826b33d3 100644 --- a/deegree-services/deegree-webservices/pom.xml +++ b/deegree-services/deegree-webservices/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-services - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-services/pom.xml b/deegree-services/pom.xml index d784bcbe16..5aabc5f936 100644 --- a/deegree-services/pom.xml +++ b/deegree-services/pom.xml @@ -9,7 +9,7 @@ org.deegree deegree - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-tests/deegree-compliance-tests/pom.xml b/deegree-tests/deegree-compliance-tests/pom.xml index 3d7f408186..c9679d573d 100644 --- a/deegree-tests/deegree-compliance-tests/pom.xml +++ b/deegree-tests/deegree-compliance-tests/pom.xml @@ -13,7 +13,7 @@ org.deegree deegree-tests - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-tests/deegree-wms-remoteows-tests/pom.xml b/deegree-tests/deegree-wms-remoteows-tests/pom.xml index 5b1cb10ca5..47a911a39b 100644 --- a/deegree-tests/deegree-wms-remoteows-tests/pom.xml +++ b/deegree-tests/deegree-wms-remoteows-tests/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree-tests - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-tests/deegree-wms-similarity-tests/pom.xml b/deegree-tests/deegree-wms-similarity-tests/pom.xml index 036ee98973..de77a0ceef 100644 --- a/deegree-tests/deegree-wms-similarity-tests/pom.xml +++ b/deegree-tests/deegree-wms-similarity-tests/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree-tests - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-tests/deegree-wms-tiling-tests/pom.xml b/deegree-tests/deegree-wms-tiling-tests/pom.xml index c7f53fc3ab..2d2245d431 100644 --- a/deegree-tests/deegree-wms-tiling-tests/pom.xml +++ b/deegree-tests/deegree-wms-tiling-tests/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree-tests - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-tests/deegree-wmts-tests/pom.xml b/deegree-tests/deegree-wmts-tests/pom.xml index 2d19f2323e..66eadfd4ac 100644 --- a/deegree-tests/deegree-wmts-tests/pom.xml +++ b/deegree-tests/deegree-wmts-tests/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree-tests - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-tests/deegree-workspace-tests/pom.xml b/deegree-tests/deegree-workspace-tests/pom.xml index b85f0c2ff0..869a521199 100644 --- a/deegree-tests/deegree-workspace-tests/pom.xml +++ b/deegree-tests/deegree-workspace-tests/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree-tests - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-tests/pom.xml b/deegree-tests/pom.xml index a6362ce20a..507d1da0df 100644 --- a/deegree-tests/pom.xml +++ b/deegree-tests/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-themes/deegree-themes-remotewms/pom.xml b/deegree-themes/deegree-themes-remotewms/pom.xml index ed03d58cca..ecec416dcc 100644 --- a/deegree-themes/deegree-themes-remotewms/pom.xml +++ b/deegree-themes/deegree-themes-remotewms/pom.xml @@ -2,7 +2,7 @@ 4.0.0 deegree-themes-remotewms jar - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT deegree-themes-remotewms Map layer theme implementation for remote Web Map Services @@ -13,7 +13,7 @@ org.deegree deegree-themes - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-themes/pom.xml b/deegree-themes/pom.xml index 37155f03f8..9e15a23fde 100644 --- a/deegree-themes/pom.xml +++ b/deegree-themes/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-tools/deegree-tools-3d/pom.xml b/deegree-tools/deegree-tools-3d/pom.xml index aa39823a9e..2762d1727e 100644 --- a/deegree-tools/deegree-tools-3d/pom.xml +++ b/deegree-tools/deegree-tools-3d/pom.xml @@ -13,7 +13,7 @@ org.deegree deegree-tools - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-tools/deegree-tools-alkis/pom.xml b/deegree-tools/deegree-tools-alkis/pom.xml index 95552842a8..727a5c087a 100644 --- a/deegree-tools/deegree-tools-alkis/pom.xml +++ b/deegree-tools/deegree-tools-alkis/pom.xml @@ -13,7 +13,7 @@ org.deegree deegree-tools - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-tools/deegree-tools-base/pom.xml b/deegree-tools/deegree-tools-base/pom.xml index 7ddcce3d6e..3bb745d94a 100644 --- a/deegree-tools/deegree-tools-base/pom.xml +++ b/deegree-tools/deegree-tools-base/pom.xml @@ -13,7 +13,7 @@ org.deegree deegree-tools - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-tools/deegree-tools-base/src/main/java/org/deegree/tools/jdbc/DatabaseXMLMapping.java b/deegree-tools/deegree-tools-base/src/main/java/org/deegree/tools/jdbc/DatabaseXMLMapping.java deleted file mode 100644 index 62aafe368f..0000000000 --- a/deegree-tools/deegree-tools-base/src/main/java/org/deegree/tools/jdbc/DatabaseXMLMapping.java +++ /dev/null @@ -1,407 +0,0 @@ -//$HeadURL: svn+ssh://lbuesching@svn.wald.intevation.de/deegree/base/trunk/resources/eclipse/files_template.xml $ -/*---------------------------------------------------------------------------- - This file is part of deegree, http://deegree.org/ - Copyright (C) 2001-2010 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.tools.jdbc; - -import static org.slf4j.LoggerFactory.getLogger; - -import java.io.File; -import java.io.StringWriter; -import java.net.URL; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.ResultSetMetaData; -import java.sql.Statement; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamWriter; -import javax.xml.transform.Source; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; - -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMDocument; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMFactory; -import org.apache.axiom.om.impl.jaxp.OMResult; -import org.apache.axiom.om.impl.jaxp.OMSource; -import org.apache.axiom.om.util.AXIOMUtil; -import org.deegree.commons.jdbc.ConnectionManager; -import org.deegree.commons.utils.Pair; -import org.deegree.commons.utils.StringUtils; -import org.deegree.commons.xml.CommonNamespaces; -import org.deegree.commons.xml.NamespaceBindings; -import org.deegree.commons.xml.XMLAdapter; -import org.deegree.commons.xml.XPath; -import org.deegree.cs.coordinatesystems.ICRS; -import org.deegree.geometry.Geometry; -import org.deegree.geometry.io.WKBReader; -import org.deegree.gml.GMLOutputFactory; -import org.deegree.gml.GMLStreamWriter; -import org.deegree.gml.GMLVersion; -import org.slf4j.Logger; - -import com.vividsolutions.jts.io.ParseException; - -/** - * TODO add class documentation here - * - * @author Lyn Buesching - * @author last edited by: $Author: buesching $ - * - * @version $Revision: 1.2 $, $Date: 2011-03-02 13:37:30 $ - */ -public class DatabaseXMLMapping { - - private static final Logger LOG = getLogger( DatabaseXMLMapping.class ); - - private static String namespace = "http://www.deegree.org/xmlmapping"; - - private static NamespaceBindings nsc = CommonNamespaces.getNamespaceContext(); - - private static final TransformerFactory factory = TransformerFactory.newInstance(); - - private final OMFactory omFactory = OMAbstractFactory.getOMFactory(); - - protected Table mainTable; - - private String jdbcId; - - private Source xslSource; - - static { - nsc.addNamespace( "dxm", namespace ); - } - - /** - * - * @param fileName - * @throws Exception - */ - public DatabaseXMLMapping( File file, String workspaceName ) throws Exception { - readConfig( file ); - } - - private void readConfig( File file ) - throws Exception { - XMLAdapter adapter = new XMLAdapter( file ); - - // parse database connection info - OMElement rootElement = adapter.getRootElement(); - jdbcId = adapter.getRequiredNodeAsString( rootElement, new XPath( "/dxm:XMLMapping/dxm:JDBCID", nsc ) ); - - // xslt file to transform result of xml mapping - - String xsltFileName = adapter.getNodeAsString( rootElement, new XPath( "/dxm:XMLMapping/dxm:XSLT", nsc ), null ); - if ( xsltFileName != null ) { - URL xslt = adapter.resolve( xsltFileName ); - XMLAdapter xsltAdapter = new XMLAdapter( xslt ); - xslSource = new OMSource( xsltAdapter.getRootElement() ); - xslSource.setSystemId( xsltAdapter.getSystemId() ); - } - - // parse table relations - String elementName = adapter.getRequiredNodeAsString( rootElement, - new XPath( "/dxm:XMLMapping/dxm:Table/dxm:ElementName", - nsc ) ); - String select = adapter.getRequiredNodeAsString( rootElement, - new XPath( "/dxm:XMLMapping/dxm:Table/dxm:Select", nsc ) ); - - List> geomFieldList = new ArrayList>(); - List elements = adapter.getElements( rootElement, - new XPath( "/dxm:XMLMapping/dxm:Table/dxm:GeometryColumn", nsc ) ); - for ( OMElement element : elements ) { - String field = adapter.getNodeAsString( element, new XPath( ".", nsc ), null ); - String crs = adapter.getNodeAsString( element, new XPath( "@crs", nsc ), null ); - Pair p = new Pair( field, crs ); - geomFieldList.add( p ); - } - mainTable = new Table( elementName, select, geomFieldList ); - List tables = adapter.getElements( rootElement, new XPath( "/dxm:XMLMapping/dxm:Table/dxm:Table", - nsc ) ); - for ( OMElement element : tables ) { - parseTable( mainTable, element ); - } - } - - /** - * @param table - * @param element - */ - private void parseTable( Table table, OMElement element ) - throws Exception { - XMLAdapter adapter = new XMLAdapter(); - String elementName = adapter.getRequiredNodeAsString( element, new XPath( "dxm:ElementName", nsc ) ); - String select = adapter.getRequiredNodeAsString( element, new XPath( "dxm:Select", nsc ) ); - List> geomFieldList = new ArrayList>(); - List elements = adapter.getElements( element, new XPath( "dxm:GeometryColumn", nsc ) ); - for ( OMElement elem : elements ) { - String field = adapter.getNodeAsString( elem, new XPath( ".", nsc ), null ); - String crs = adapter.getNodeAsString( elem, new XPath( "@crs", nsc ), null ); - Pair p = new Pair( field, crs ); - geomFieldList.add( p ); - } - Table subTable = new Table( elementName, select, geomFieldList ); - table.getTables().add( subTable ); - List tables = adapter.getElements( element, new XPath( "dxm:Table", nsc ) ); - for ( OMElement subEelement : tables ) { - parseTable( subTable, subEelement ); - } - } - - public void run() - throws Exception { - Connection conn = ConnectionManager.getConnection( jdbcId ); - conn.setAutoCommit( false ); - Statement stmt = null; - ResultSet rs = null; - - try { - String sql = mainTable.getSelect(); - stmt = conn.createStatement(); - stmt.setFetchSize( 1000 ); - rs = stmt.executeQuery( sql ); - ResultSetMetaData rsmd = rs.getMetaData(); - int colCount = rsmd.getColumnCount(); - Map row = new LinkedHashMap(); - while ( rs.next() ) { - // create one XML document for each row of the main table - OMDocument result = omFactory.createOMDocument(); - OMElement dbTable = omFactory.createOMElement( new QName( "DatabaseTable" ) ); - result.addChild( dbTable ); - - // result.load( new StringReader( "" ), XMLFragment.DEFAULT_URL ); - // append root table element - // Element tableElement = XMLTools.appendElement( result.getRootElement(), null, mainTable.getName() ); - OMElement tableElement = omFactory.createOMElement( new QName( mainTable.getName() ) ); - dbTable.addChild( tableElement ); - for ( int i = 0; i < colCount; i++ ) { - String cName = rsmd.getColumnName( i + 1 ).toLowerCase(); - Object value = rs.getObject( i + 1 ); - row.put( cName, value ); - - OMElement cNameElement = omFactory.createOMElement( new QName( cName ) ); - tableElement.addChild( cNameElement ); - if ( value != null ) { - Pair p = mainTable.getGeometryColumn( cName ); - if ( p != null ) { - handleGeometry( cNameElement, p, (byte[]) value ); - } else { - cNameElement.addChild( omFactory.createOMText( value.toString() ) ); - } - } - } - // add sub tables if available - List tables = mainTable.getTables(); - for ( Table table : tables ) { - appendTable( tableElement, conn, row, table ); - } - row.clear(); - if ( xslSource != null ) { - result = transform( result ); - } - performAction( result ); - } - } catch ( Exception e ) { - LOG.error( "Could not create a XMLDocument", e ); - throw e; - } finally { - // rs.close(); - stmt.close(); - // CSW? - // ConnectionManager.destroy(); - } - - } - - /** - * - * @param ps - * @param conn - * @param targetRow - * @param targetTable - * @throws Exception - */ - private void appendTable( OMElement tableElement, Connection conn, Map targetRow, Table subTable ) - throws Exception { - Statement stmt = null; - - try { - String sql = subTable.getSelect(); - List variables = subTable.getVariables(); - // replace variables with real values - for ( String variable : variables ) { - Object value = targetRow.get( variable.substring( 1, variable.length() ).toLowerCase() ); - if ( value instanceof String ) { - sql = StringUtils.replaceAll( sql, variable, "'" + value.toString() + "'" ); - } else if ( value != null ) { - sql = StringUtils.replaceAll( sql, variable, value.toString() ); - } else { - sql = StringUtils.replaceAll( sql, variable, "'XXXXXXXdummyXXXXXXX'" ); - } - } - - LOG.debug( sql ); - stmt = conn.createStatement(); - stmt.setFetchSize( 1000 ); - ResultSet rs = stmt.executeQuery( sql ); - ResultSetMetaData rsmd = rs.getMetaData(); - int colCount = rsmd.getColumnCount(); - - Map row = new LinkedHashMap(); - while ( rs.next() ) { - // append sub table element - // Element subTableElement = XMLTools.appendElement( tableElement, null, subTable.getName() ); - OMElement subTableElement = omFactory.createOMElement( new QName( subTable.getName() ) ); - tableElement.addChild( subTableElement ); - for ( int i = 0; i < colCount; i++ ) { - String cName = rsmd.getColumnName( i + 1 ).toLowerCase(); - Object value = rs.getObject( i + 1 ); - row.put( cName, value ); - if ( value != null ) { - Pair p = subTable.getGeometryColumn( cName ); - OMElement cNameElement = omFactory.createOMElement( new QName( cName ) ); - subTableElement.addChild( cNameElement ); - if ( p != null ) { - handleGeometry( cNameElement, p, (byte[]) value ); - } else { - cNameElement.addChild( omFactory.createOMText( value.toString() ) ); - } - } - } - // recursion! - // append sub tables if available - List
tables = subTable.getTables(); - for ( Table table : tables ) { - appendTable( subTableElement, conn, row, table ); - } - row.clear(); - } - } catch ( Exception e ) { - LOG.error( "", e ); - throw e; - } finally { - stmt.close(); - } - } - - /** - * - * @param tableElement - * @param p - * @param wkb - * wkb representation of the geometry - * @throws Exception - */ - private void handleGeometry( OMElement tableElement, Pair p, byte[] wkb ) - throws Exception { - try { - Geometry geom = WKBReader.read( wkb, p.second ); - - StringWriter sw = new StringWriter(); - XMLOutputFactory outFactory = XMLOutputFactory.newInstance(); - // repairng namespace and setting the default namespace should be done by the GMLWriter! - outFactory.setProperty( XMLOutputFactory.IS_REPAIRING_NAMESPACES, true ); - - XMLStreamWriter writer = outFactory.createXMLStreamWriter( sw ); - writer.setDefaultNamespace( CommonNamespaces.GMLNS ); - GMLStreamWriter gmlSw = GMLOutputFactory.createGMLStreamWriter( GMLVersion.GML_31, writer ); - gmlSw.write( geom ); - writer.close(); - - tableElement.addChild( AXIOMUtil.stringToOM( sw.toString() ) ); - } catch ( ParseException e ) { - LOG.info( "WKB from the DB could not be parsed: '{}'.", e.getLocalizedMessage() ); - LOG.info( "For PostGIS users: you have to select the geometry field 'asbinary(geometry)'." ); - LOG.trace( "Stack trace:", e ); - } - } - - /** - * @param xml - * @return - * @throws Exception - */ - protected OMDocument transform( OMDocument xml ) - throws Exception { - return transform( xml, null, null ); - } - - protected OMDocument transform( OMDocument xml, Properties outputProperties, Map params ) - throws Exception { - LOG.debug( "transform: " + xml.getOMDocumentElement() ); - Source xmlSource = new OMSource( xml.getOMDocumentElement() ); - - OMResult sr = new OMResult(); - try { - Transformer transformer = factory.newTransformer( xslSource ); - if ( params != null ) { - for ( String key : params.keySet() ) { - transformer.setParameter( key, params.get( key ) ); - } - } - if ( outputProperties != null ) { - transformer.setOutputProperties( outputProperties ); - } - transformer.transform( xmlSource, sr ); - } catch ( TransformerException e ) { - String transformerClassName = null; - String transformerFactoryClassName = factory.getClass().getName(); - try { - transformerClassName = factory.newTransformer().getClass().getName(); - } catch ( Exception e2 ) { - LOG.error( "Error creating Transformer instance." ); - } - String errorMsg = "XSL transformation using stylesheet with systemId '" + xslSource.getSystemId() - + "' and xml source with systemId '" + xmlSource.getSystemId() - + "' failed. TransformerFactory class: " + transformerFactoryClassName - + "', Transformer class: " + transformerClassName; - LOG.error( errorMsg, e ); - throw new TransformerException( errorMsg, e ); - } - return sr.getDocument(); - } - - protected void performAction( OMDocument xml ) { - } - -} diff --git a/deegree-tools/deegree-tools-base/src/main/java/org/deegree/tools/jdbc/MappingUtils.java b/deegree-tools/deegree-tools-base/src/main/java/org/deegree/tools/jdbc/MappingUtils.java deleted file mode 100644 index e73be59261..0000000000 --- a/deegree-tools/deegree-tools-base/src/main/java/org/deegree/tools/jdbc/MappingUtils.java +++ /dev/null @@ -1,169 +0,0 @@ -//$HeadURL: svn+ssh://developername@svn.wald.intevation.org/deegree/base/trunk/resources/eclipse/files_template.xml $ -/*---------------------------------------------------------------------------- - This file is part of deegree, http://deegree.org/ - Copyright (C) 2001-2009 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.tools.jdbc; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.io.StringWriter; -import java.text.DecimalFormat; -import java.text.DecimalFormatSymbols; -import java.text.NumberFormat; -import java.util.Date; -import java.util.Locale; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamReader; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.deegree.commons.tom.datetime.ISO8601Converter; -import org.deegree.commons.xml.CommonNamespaces; -import org.deegree.geometry.Envelope; -import org.deegree.geometry.GeometryException; -import org.deegree.gml.GMLInputFactory; -import org.deegree.gml.GMLStreamReader; -import org.deegree.gml.GMLVersion; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import com.vividsolutions.jts.io.ParseException; - -/** - * TODO add class documentation here - * - * @author Andreas Poth - * @author last edited by: $Author: buesching $ - * - * @version $Revision: 1.2 $, $Date: 2011-03-07 09:32:57 $ - */ -public class MappingUtils { - - private static final DecimalFormatSymbols dfs = new DecimalFormatSymbols( Locale.ENGLISH ); - - private static final NumberFormat nf = new DecimalFormat( "#.####", dfs ); - - /** - * - * @param node - * @return maximum x coordinate - * @throws ParseException - * @throws GeometryException - */ - public static String getXMax( Node node ) { - if ( node == null ) { - return ""; - } - return nf.format( getAsEnvelope( node ).getMax().get0() ); - } - - /** - * - * @param node - * @return minimum x coordinate - * @throws ParseException - * @throws GeometryException - */ - public static String getXMin( Node node ) { - if ( node == null ) { - return ""; - } - return nf.format( getAsEnvelope( node ).getMin().get0() ); - } - - /** - * - * @param node - * @return maximum y coordinate - * @throws ParseException - * @throws GeometryException - */ - public static String getYMax( Node node ) - throws ParseException { - if ( node == null ) { - return ""; - } - return nf.format( getAsEnvelope( node ).getMax().get1() ); - } - - /** - * - * @param node - * @return minimum y coordinate - * @throws GeometryException - */ - public static String getYMin( Node node ) - throws ParseException { - if ( node == null ) { - return ""; - } - return nf.format( getAsEnvelope( node ).getMin().get1() ); - } - - private static Envelope getAsEnvelope( Node node ) { - try { - - // TODO: this is a really dirty hack!!!! - Transformer t = TransformerFactory.newInstance().newTransformer(); - t.setOutputProperty( OutputKeys.OMIT_XML_DECLARATION, "yes" ); - StringWriter sw = new StringWriter(); - t.transform( new DOMSource( node ), new StreamResult( sw ) ); - - String nodeAsString = sw.toString(); - // where is the namespace binding??? - nodeAsString = nodeAsString.replaceFirst( " ", " xmlns:" + CommonNamespaces.GML_PREFIX + "=\"" - + CommonNamespaces.GMLNS + "\" " ); - InputStream in = new ByteArrayInputStream( nodeAsString.getBytes() ); - XMLStreamReader stream = XMLInputFactory.newInstance().createXMLStreamReader( in ); - GMLStreamReader gmlReader = GMLInputFactory.createGMLStreamReader( GMLVersion.GML_31, stream ); - org.deegree.geometry.Geometry geometry = gmlReader.readGeometry(); - return geometry.getEnvelope(); - // Source source = new DOMSource( node ); - // XMLStreamReader stream = XMLInputFactory.newInstance().createXMLStreamReader( source ); - // System.out.println(StAXParsingHelper.getEventTypeString( stream.getEventType() )); - // if(stream.getEventType() == XMLStreamConstants.START_DOCUMENT) - // stream.nextTag(); - // System.out.println(StAXParsingHelper.getEventTypeString( stream.getEventType() )); - // GMLStreamReader gmlReader = GMLInputFactory.createGMLStreamReader( GMLVersion.GML_32, stream ); - // org.deegree.geometry.Geometry geometry = gmlReader.readGeometry(); - // return geometry.getEnvelope(); - } catch ( Exception e ) { - throw new IllegalArgumentException( "could not read as GMLGeometry: " + node.getNodeName(), e ); - } - } -} diff --git a/deegree-tools/deegree-tools-base/src/main/java/org/deegree/tools/jdbc/Table.java b/deegree-tools/deegree-tools-base/src/main/java/org/deegree/tools/jdbc/Table.java deleted file mode 100644 index 3480537e30..0000000000 --- a/deegree-tools/deegree-tools-base/src/main/java/org/deegree/tools/jdbc/Table.java +++ /dev/null @@ -1,145 +0,0 @@ -//$HeadURL: svn+ssh://lbuesching@svn.wald.intevation.de/deegree/base/trunk/resources/eclipse/files_template.xml $ -/*---------------------------------------------------------------------------- - This file is part of deegree, http://deegree.org/ - Copyright (C) 2001-2010 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.tools.jdbc; - -import java.util.ArrayList; -import java.util.List; - -import org.deegree.commons.utils.Pair; -import org.deegree.commons.utils.StringUtils; -import org.deegree.cs.coordinatesystems.ICRS; -import org.deegree.cs.exceptions.UnknownCRSException; -import org.deegree.cs.persistence.CRSManager; - -/** - * TODO add class documentation here - * - * @author Lyn Buesching - * @author last edited by: $Author: buesching $ - * - * @version $Revision: 1.1 $, $Date: 2011-03-02 12:59:21 $ - */ -public class Table { - - private String select; - - private String name; - - private List
tables = new ArrayList
(); - - private List variables = new ArrayList(); - - private List> geometryColumns = new ArrayList>(); - - /** - * - * @param name - * @param select - * @throws UnknownCRSException - */ - Table( String name, String select, List> geometryColumns ) throws UnknownCRSException { - this.name = name; - this.select = select.trim(); - - String[] tmp = StringUtils.split( select, " " ); - for ( String value : tmp ) { - if ( value.startsWith( "$" ) ) { - variables.add( value ); - } - } - for ( Pair pair : geometryColumns ) { - ICRS crs = CRSManager.getCRSRef( pair.second ); - Pair p = new Pair( pair.first, crs ); - this.geometryColumns.add( p ); - } - } - - /** - * @return the select - */ - public String getSelect() { - return select; - } - - /** - * @param select - * the select to set - */ - public void setSelect( String select ) { - this.select = select; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name - * the name to set - */ - public void setName( String name ) { - this.name = name; - } - - /** - * @return the tables - */ - public List
getTables() { - return tables; - } - - /** - * @return the variables - */ - public List getVariables() { - return variables; - } - - /** - * @return - */ - public Pair getGeometryColumn( String field ) { - for ( Pair p : geometryColumns ) { - if ( p.first.equals( field ) ) { - return p; - } - } - return null; - } -} diff --git a/deegree-tools/deegree-tools-migration/pom.xml b/deegree-tools/deegree-tools-migration/pom.xml index 282d41f7a0..d6104ce396 100644 --- a/deegree-tools/deegree-tools-migration/pom.xml +++ b/deegree-tools/deegree-tools-migration/pom.xml @@ -13,7 +13,7 @@ org.deegree deegree-tools - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-tools/pom.xml b/deegree-tools/pom.xml index 9bc3b61cc6..bcc2822fb8 100644 --- a/deegree-tools/pom.xml +++ b/deegree-tools/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-aixm/pom.xml b/deegree-workspaces/deegree-workspace-aixm/pom.xml index 9cdf133bb2..17d519aa6d 100644 --- a/deegree-workspaces/deegree-workspace-aixm/pom.xml +++ b/deegree-workspaces/deegree-workspace-aixm/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-alkis/pom.xml b/deegree-workspaces/deegree-workspace-alkis/pom.xml index 1afd78ad83..4a1a0874bb 100644 --- a/deegree-workspaces/deegree-workspace-alkis/pom.xml +++ b/deegree-workspaces/deegree-workspace-alkis/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-compliance-tests/pom.xml b/deegree-workspaces/deegree-workspace-compliance-tests/pom.xml index f90223f538..79247efe14 100644 --- a/deegree-workspaces/deegree-workspace-compliance-tests/pom.xml +++ b/deegree-workspaces/deegree-workspace-compliance-tests/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-csw-memory-tests/pom.xml b/deegree-workspaces/deegree-workspace-csw-memory-tests/pom.xml index 820322f4ba..61206bb4a1 100644 --- a/deegree-workspaces/deegree-workspace-csw-memory-tests/pom.xml +++ b/deegree-workspaces/deegree-workspace-csw-memory-tests/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-csw-tests/pom.xml b/deegree-workspaces/deegree-workspace-csw-tests/pom.xml index 75092d82e2..f53a1c80dc 100644 --- a/deegree-workspaces/deegree-workspace-csw-tests/pom.xml +++ b/deegree-workspaces/deegree-workspace-csw-tests/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-csw/pom.xml b/deegree-workspaces/deegree-workspace-csw/pom.xml index 4a19e4e491..3614e3e821 100644 --- a/deegree-workspaces/deegree-workspace-csw/pom.xml +++ b/deegree-workspaces/deegree-workspace-csw/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-geosciml/pom.xml b/deegree-workspaces/deegree-workspace-geosciml/pom.xml index 0883a96a0b..21f9850867 100644 --- a/deegree-workspaces/deegree-workspace-geosciml/pom.xml +++ b/deegree-workspaces/deegree-workspace-geosciml/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-inspire/pom.xml b/deegree-workspaces/deegree-workspace-inspire/pom.xml index 7fe87d83a1..50482973b4 100644 --- a/deegree-workspaces/deegree-workspace-inspire/pom.xml +++ b/deegree-workspaces/deegree-workspace-inspire/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-inspire/src/main/workspace/datasources/feature/inspire.xml b/deegree-workspaces/deegree-workspace-inspire/src/main/workspace/datasources/feature/inspire.xml index 1cc8bc88e7..7884e9fcb8 100644 --- a/deegree-workspaces/deegree-workspace-inspire/src/main/workspace/datasources/feature/inspire.xml +++ b/deegree-workspaces/deegree-workspace-inspire/src/main/workspace/datasources/feature/inspire.xml @@ -3,10 +3,8 @@ xsi:schemaLocation="http://www.deegree.org/datasource/feature/memory http://schemas.deegree.org/datasource/feature/memory/3.0.0/memory.xsd"> EPSG:900913 ../../appschemas/inspire/annex1 - ../../data/addresses.xml ../../data/au-gemeenten.gml ../../data/au-land.gml ../../data/au-provincies.gml ../../data/cp-parcels.gml - ../../data/cp-parcels-de.gml diff --git a/deegree-workspaces/deegree-workspace-osm/pom.xml b/deegree-workspaces/deegree-workspace-osm/pom.xml index a6dba26c3a..58bfdf8aee 100644 --- a/deegree-workspaces/deegree-workspace-osm/pom.xml +++ b/deegree-workspaces/deegree-workspace-osm/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-utah/pom.xml b/deegree-workspaces/deegree-workspace-utah/pom.xml index 4682c4324c..fa72249243 100644 --- a/deegree-workspaces/deegree-workspace-utah/pom.xml +++ b/deegree-workspaces/deegree-workspace-utah/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-utah/src/main/workspace/themes/theme_wms.xml b/deegree-workspaces/deegree-workspace-utah/src/main/workspace/themes/theme_wms.xml index 913c377db1..cb4652a58f 100644 --- a/deegree-workspaces/deegree-workspace-utah/src/main/workspace/themes/theme_wms.xml +++ b/deegree-workspaces/deegree-workspace-utah/src/main/workspace/themes/theme_wms.xml @@ -78,11 +78,6 @@ Orthophoto of Saltlake City orthophoto - - orthophototile - Orthophoto of Saltlake City tile - utah_ortho - Transportation diff --git a/deegree-workspaces/deegree-workspace-wcts/pom.xml b/deegree-workspaces/deegree-workspace-wcts/pom.xml index cef162e085..97cc266f04 100644 --- a/deegree-workspaces/deegree-workspace-wcts/pom.xml +++ b/deegree-workspaces/deegree-workspace-wcts/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-wps-jrxml/pom.xml b/deegree-workspaces/deegree-workspace-wps-jrxml/pom.xml index db3b40a696..36e1eb0df4 100644 --- a/deegree-workspaces/deegree-workspace-wps-jrxml/pom.xml +++ b/deegree-workspaces/deegree-workspace-wps-jrxml/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-wps/pom.xml b/deegree-workspaces/deegree-workspace-wps/pom.xml index 1940b1d8a6..77c91fc2ac 100644 --- a/deegree-workspaces/deegree-workspace-wps/pom.xml +++ b/deegree-workspaces/deegree-workspace-wps/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-wpvs/pom.xml b/deegree-workspaces/deegree-workspace-wpvs/pom.xml index 497681b52a..8f369604e0 100644 --- a/deegree-workspaces/deegree-workspace-wpvs/pom.xml +++ b/deegree-workspaces/deegree-workspace-wpvs/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/deegree-workspace-xplan40/pom.xml b/deegree-workspaces/deegree-workspace-xplan40/pom.xml index 1146df1a06..56a462f5a3 100644 --- a/deegree-workspaces/deegree-workspace-xplan40/pom.xml +++ b/deegree-workspaces/deegree-workspace-xplan40/pom.xml @@ -12,7 +12,7 @@ org.deegree deegree-workspaces - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/deegree-workspaces/pom.xml b/deegree-workspaces/pom.xml index d5898c960f..666f36fc32 100644 --- a/deegree-workspaces/pom.xml +++ b/deegree-workspaces/pom.xml @@ -8,7 +8,7 @@ org.deegree deegree - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT diff --git a/pom.xml b/pom.xml index c41ecc6902..14ed9f8c44 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ org.deegree deegree pom - 3.2-pre16-SNAPSHOT + 3.3-pre1-SNAPSHOT deegree Framework for OGC Web Service implementations and geospatial applications http://www.deegree.org/