Skip to content

Commit

Permalink
GetStyle/PutStyle extension for WFS3, dataset level resources
Browse files Browse the repository at this point in the history
  • Loading branch information
aaime committed Jan 24, 2019
1 parent ed5490f commit 37351f6
Show file tree
Hide file tree
Showing 40 changed files with 1,648 additions and 146 deletions.
4 changes: 3 additions & 1 deletion src/community/wfs3/README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ WFS 3.0 hackaton first, and then further developed to match Draft 1 spec and con
Implementation wise: Implementation wise:
* The module basically acts as an internal proxy around WFS 2.0, using a servlet filter to adapt protocols. The long term approach would likely be to have a new MVCDispatcher that allows usage of Spring annotations instead (TBD). * The module basically acts as an internal proxy around WFS 2.0, using a servlet filter to adapt protocols. The long term approach would likely be to have a new MVCDispatcher that allows usage of Spring annotations instead (TBD).



This implementation contains the following prototype WFS3 extensions:
* Tiles extension, returning MapBOX/JSON/TopoJSON tiles
* Styles extension, with the ability to get/put/delete styles (must be secured using service security)
12 changes: 12 additions & 0 deletions src/community/wfs3/pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@
<classifier>tests</classifier> <classifier>tests</classifier>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.geoserver.extension</groupId>
<artifactId>gs-css</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.geoserver.community</groupId>
<artifactId>gs-mbstyle</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,38 @@
/* (c) 2019 Open Source Geospatial Foundation - all rights reserved
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
package org.geoserver.wfs3;

import io.swagger.v3.core.util.Yaml;
import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.parameters.Parameter;
import java.util.Map;
import org.geoserver.platform.ServiceException;

public abstract class AbstractWFS3Extension implements WFS3Extension {

protected void addSchemasAndParameters(OpenAPI api, OpenAPI template) {
// and add all schemas and parameters
Components apiComponents = api.getComponents();
Components tileComponents = template.getComponents();
Map<String, Schema> tileSchemas = tileComponents.getSchemas();
apiComponents.getSchemas().putAll(tileSchemas);
Map<String, Parameter> tileParameters = tileComponents.getParameters();
apiComponents.getParameters().putAll(tileParameters);
}

/**
* Reads the template to customize (each time, as the object tree is not thread safe nor
* cloneable not serializable)
*/
protected OpenAPI readTemplate(String source) {
try {
return Yaml.mapper().readValue(source, OpenAPI.class);
} catch (Exception e) {
throw new ServiceException(e);
}
}
}

0 comments on commit 37351f6

Please sign in to comment.