Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GSIP-184] Promote MBStyle to extension #4098

Merged
merged 8 commits into from
Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/en/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<isset property="build.directory" />
</condition>

<condition property="project.version" value="${project.version}" else="2.15-SNAPSHOT">
<condition property="project.version" value="${project.version}" else="2.17-SNAPSHOT">
<isset property="project.version" />
</condition>

Expand Down
16 changes: 15 additions & 1 deletion doc/en/user/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,22 @@
#
# The short X.Y version.
version = '2.17'

# The full version, including alpha/beta/rc tags.
release = '2.17-SNAPSHOT'

branch = 'master'

# Users don't need to see the "SNAPSHOT" notation when it's there
if release.find('SNAPSHOT') != -1:
release = '2.17.x'
download_release = 'https://build.geoserver.org/geoserver/'+branch+'/geoserver-'+version+'.x-latest-%s.zip'
download_extension = 'https://build.geoserver.org/geoserver/'+branch+'/ext-latest/geoserver-'+version+'-SNAPSHOT-%s-plugin.zip'
download_community = 'https://build.geoserver.org/geoserver/'+branch+'/community-latest/geoserver-'+version+'-SNAPSHOT-%s-plugin.zip'
else:
download_release = 'http://sourceforge.net/projects/geoserver/files/GeoServer/'+release+'/geoserver-'+release+'-%s.zip'
download_extension = 'http://sourceforge.net/projects/geoserver/files/GeoServer/'+release+'/extensions/geoserver-'+release+'-%s-plugin.zip'
download_community = 'https://build.geoserver.org/geoserver/'+branch+'/community-latest/geoserver-'+version+'.x-SNAPSHOT-%s-plugin.zip'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -100,7 +111,10 @@
'docguide': ('http://docs.geoserver.org/latest/en/docguide/%s',''),
'geos': ('https://osgeo-org.atlassian.net/browse/GEOS-%s','GEOS-'),
'geot': ('https://osgeo-org.atlassian.net/browse/GEOT-%s','GEOT-'),
'api': ('http://docs.geoserver.org/latest/en/api/#/latest/en/api/1.0.0/%s','')
'api': ('http://docs.geoserver.org/latest/en/api/#/latest/en/api/1.0.0/%s',''),
'download_release': (download_release,None),
'download_extension': (download_extension,None),
'download_community': (download_community,None)
}

# Common substitutions
Expand Down
2 changes: 1 addition & 1 deletion doc/en/user/source/extensions/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Extensions

Extensions are modules that add functionality to GeoServer. They are installed as add-ons to the base GeoServer installation.

This section describes most of the extensions available for GeoServer. Other data formats can be found in the :ref:`data_vector`, :ref:`data_raster`, and :ref:`data_database` sections.
This section describes most of the extensions available for GeoServer. Other data formats can be found in the :ref:`data_vector`, :ref:`data_raster`, :ref:`data_database`, and :ref:`styling` sections.

.. toctree::
:maxdepth: 1
Expand Down
11 changes: 7 additions & 4 deletions doc/en/user/source/styling/css/install.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
.. _css_install:

Installation
============
Installing the GeoServer CSS extension
======================================

The CSS extension is listed among the other extension downloads on the GeoServer download page.

The installation process is similar to other GeoServer extensions:

#. Download the appropriate archive from the GeoServer download page. Please verify that the version number in the filename corresponds to the version of GeoServer you are running. The file will be called :file:`geoserver-A.B.C-css-plugin.zip` where ``A.B.C`` is the GeoServer version.
#. Download the :download_extension:`css`

Verify that the version number in the filename corresponds to the version of GeoServer you are running (for example |release| above).

#. Extract the contents of the archive into the :file:`WEB-INF/lib` directory in GeoServer. Make sure you do not create any sub-directories during the extraction process.
#. Extract the contents of the archive into the :file:`WEB-INF/lib` directory in GeoServer.
Make sure you do not create any sub-directories during the extraction process.

#. Restart GeoServer.

Expand Down
15 changes: 12 additions & 3 deletions doc/en/user/source/styling/mbstyle/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
Installing the GeoServer MBStyle extension
==========================================

#. Download the extension from the `nightly GeoServer community module builds <https://build.geoserver.org/geoserver/master/community-latest/>`_.
The MBStyle extension is listed on the GeoServer download page.
jodygarnett marked this conversation as resolved.
Show resolved Hide resolved

.. warning:: Make sure to match the version of the extension to the version of the GeoServer instance!
To install MBStyle extension:

#. Extract the contents of the archive into the ``WEB-INF/lib`` directory of the GeoServer installation.
#. Download the :download_extension:`mbstyle`

Verify that the version number in the filename corresponds to the version of GeoServer you are running (for example |release| above).

#. Extract the contents of the archive into the :file:`WEB-INF/lib` directory in GeoServer.
This extension includes two jars.

#. Restart GeoServer.

#. To confirm successful installation, check for a new ``MBStyle`` format option in the :ref:`styling_webadmin` editor.
12 changes: 9 additions & 3 deletions doc/en/user/source/styling/ysld/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
Installing the GeoServer YSLD extension
=======================================

#. Download the extension from the `nightly GeoServer extension builds <https://build.geoserver.org/geoserver/master/ext-latest/>`_.
The YSLD extension is listed on the GeoServer download page.

.. warning:: Make sure to match the version of the extension to the version of the GeoServer instance!
To install:

#. Extract the contents of the archive into the ``WEB-INF/lib`` directory of the GeoServer installation.
#. Download the appropriate archive from the GeoServer download page. Please verify that the version number in the filename corresponds to the version of GeoServer you are running. The file will be called :file:`geoserver-A.B.C-ysld-plugin.zip` where ``A.B.C`` is the GeoServer version.

#. Extract the contents of the archive into the :file:`WEB-INF/lib` directory in GeoServer. Make sure you do not create any sub-directories during the extraction process.

#. Restart GeoServer.

#. To confirm successful installation, check for a new YSLD entry in the :ref:`styling_webadmin` editor.
2 changes: 1 addition & 1 deletion src/community/ogcapi/ogcapi-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.geoserver.community</groupId>
<groupId>org.geoserver.extension</groupId>
<artifactId>gs-mbstyle</artifactId>
<version>${project.version}</version>
<scope>test</scope>
Expand Down
2 changes: 1 addition & 1 deletion src/community/ogcapi/ogcapi-styles/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.geoserver.community</groupId>
<groupId>org.geoserver.extension</groupId>
<artifactId>gs-mbstyle</artifactId>
<version>${project.version}</version>
<scope>test</scope>
Expand Down
2 changes: 1 addition & 1 deletion src/community/ogcapi/ogcapi-tiles/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.geoserver.community</groupId>
<groupId>org.geoserver.extension</groupId>
<artifactId>gs-mbstyle</artifactId>
<version>${project.version}</version>
<scope>test</scope>
Expand Down
4 changes: 1 addition & 3 deletions src/community/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,11 @@
<descriptor>release/ext-keycloak.xml</descriptor>
<descriptor>release/ext-backup-restore.xml</descriptor>
<descriptor>release/ext-wmts-multi-dimensional.xml</descriptor>
<descriptor>release/ext-saml.xml</descriptor>
<descriptor>release/ext-saml.xml</descriptor>
<descriptor>release/ext-notification.xml</descriptor>
<descriptor>release/ext-ows-simulate.xml</descriptor>
<descriptor>release/ext-jdbc-metrics.xml</descriptor>
<descriptor>release/ext-opensearch-eo.xml</descriptor>
<descriptor>release/ext-mbstyle.xml</descriptor>
<descriptor>release/ext-nsg-wmts-profile.xml</descriptor>
<descriptor>release/ext-nsg-wfs-profile.xml</descriptor>
<descriptor>release/ext-taskmanager-core.xml</descriptor>
Expand Down Expand Up @@ -279,7 +278,6 @@
<module>ows-simulate</module>
<module>jdbc-metrics</module>
<module>oseo</module>
<module>mbstyle</module>
<module>s3-geotiff</module>
<module>nsg-profiles</module>
<module>netcdf-ghrsst</module>
Expand Down
17 changes: 0 additions & 17 deletions src/community/release/ext-mbstyle.xml

This file was deleted.

5 changes: 0 additions & 5 deletions src/community/release/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,6 @@
<artifactId>gs-oseo-rest</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.geoserver.community</groupId>
<artifactId>gs-mbstyle</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.geoserver.community</groupId>
<artifactId>gs-nsg-wmts-profile</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion src/community/wfs3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.geoserver.community</groupId>
<groupId>org.geoserver.extension</groupId>
<artifactId>gs-mbstyle</artifactId>
<version>${project.version}</version>
<scope>test</scope>
Expand Down
2 changes: 1 addition & 1 deletion src/community/wmts-styles/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.geoserver.community</groupId>
<groupId>org.geoserver.extension</groupId>
<artifactId>gs-mbstyle</artifactId>
<version>${project.version}</version>
<scope>test</scope>
Expand Down
26 changes: 26 additions & 0 deletions src/extension/mbstyle/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
MBStyle Extension
=================

This extension adds support for the MapBox Style specification to the GeoServer style editor.

For more information:

* https://docs.geoserver.org/latest/en/user/styling/mbstyle/index.html
* https://docs.geotools.org/latest/userguide/extension/mbstyle/spec/index.html
* https://www.mapbox.com/mapbox-gl-js/style-spec/

Installation
-------------

1. Stop GeoServer
2. Copy the jar files contained in this zip into WEB-INF/lib
3. Restart GeoServer

Usage
-----

Check for a new MBStyle entry in the Styles editor:

1. Create a new Style
2. Select Format MBStyle
4. Use Generate a default style
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>community</artifactId>
<groupId>org.geoserver</groupId>
<artifactId>extension</artifactId>
<version>2.17-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>org.geoserver.community</groupId>
<groupId>org.geoserver.extension</groupId>
<artifactId>gs-mbstyle</artifactId>
<packaging>jar</packaging>
<version>2.17-SNAPSHOT</version>
<name>GeoServer Mapbox Styling</name>
<name>MBStyle Extension</name>
<description>
Support for MapBox Style definition.
</description>

<dependencies>
<!-- Runtime/compile-time dependencies -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
import org.geoserver.wms.web.data.OpenLayersPreviewPanel;
import org.geoserver.wms.web.data.StyleEditPage;
import org.geotools.styling.ExternalGraphic;
import org.geotools.styling.PointSymbolizer;
import org.geotools.styling.Style;
import org.geotools.styling.TextSymbolizer2;
import org.junit.Before;
import org.junit.Test;
import org.opengis.style.Symbolizer;

public class MBStyleEditPageTest extends GeoServerWicketTestSupport {

Expand Down Expand Up @@ -81,18 +83,10 @@ public void testMbstyleChange() throws Exception {
tester.executeAjaxEvent("apply", "click");
tester.assertModelValue("styleForm:context:panel:previewStyleGroup", true);
assertNotNull(getCatalog().getStyleByName("mbstyle").getSLD());
PointSymbolizer ps =
(PointSymbolizer)
getCatalog()
.getStyleByName("mbstyle")
.getStyle()
.featureTypeStyles()
.get(0)
.rules()
.get(0)
.symbolizers()
.get(0);
ExternalGraphic eg = (ExternalGraphic) ps.getGraphic().graphicalSymbols().get(0);
Style style = getCatalog().getStyleByName("mbstyle").getStyle();
Symbolizer sym = style.featureTypeStyles().get(0).rules().get(0).symbolizers().get(0);
TextSymbolizer2 label = (TextSymbolizer2) sym;
ExternalGraphic eg = (ExternalGraphic) label.getGraphic().graphicalSymbols().get(0);
assertEquals(
eg.getURI(),
"http://localhost:8080/geoserver/styles/mbsprites#icon=${strURLEncode('circle')}&size=${strURLEncode(Interpolate(POP_MAX,0,0.7,40000000,3.7,'numeric'))}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void testRoundTripMBStyleGroup() throws IOException {
Styles.handler(MBStyleHandler.FORMAT)
.parse(getClass().getResourceAsStream("citeGroup.json"), null, null, null);

assertEquals(4, sld.getStyledLayers().length);
assertEquals(3, sld.getStyledLayers().length);

StyleHandler sldHandler = Styles.handler(SLDHandler.FORMAT);
File sldFile = Files.createTempFile("citeGroup", "sld").toFile();
Expand All @@ -63,6 +63,6 @@ public void testRoundTripMBStyleGroup() throws IOException {

StyledLayerDescriptor sld2 =
sldHandler.parse(new FileInputStream(sldFile), SLDHandler.VERSION_10, null, null);
assertEquals(4, sld2.getStyledLayers().length);
assertEquals(3, sld2.getStyledLayers().length);
}
}
9 changes: 9 additions & 0 deletions src/extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@
</modules>
</profile>

<profile>
<id>mbstyle</id>
<modules>
<module>mbstyle</module>
</modules>
</profile>

<profile>
<id>csw</id>
<modules>
Expand Down Expand Up @@ -394,6 +401,7 @@
<module>netcdf-out</module>
<module>vectortiles</module>
<module>ysld</module>
<module>mbstyle</module>
<module>mongodb</module>
<module>sldService</module>
<module>geofence</module>
Expand Down Expand Up @@ -440,6 +448,7 @@
<module>netcdf-out</module>
<module>vectortiles</module>
<module>ysld</module>
<module>mbstyle</module>
<module>mongodb</module>
<module>sldService</module>
<module>geofence</module>
Expand Down
1 change: 1 addition & 0 deletions src/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,7 @@
<descriptor>release/ext-netcdf-out.xml</descriptor>
<descriptor>release/ext-vectortiles.xml</descriptor>
<descriptor>release/ext-ysld.xml</descriptor>
<descriptor>release/ext-mbstyle.xml</descriptor>
<descriptor>release/ext-sldservice.xml</descriptor>
<descriptor>release/ext-geofence.xml</descriptor>
<descriptor>release/ext-geofence-server.xml</descriptor>
Expand Down
34 changes: 34 additions & 0 deletions src/release/ext-mbstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<assembly>
<id>mbstyle-plugin</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>release/target/dependency</directory>
<outputDirectory></outputDirectory>
<includes>
<include>gs-mbstyle-*.jar</include>
<include>gt-mbstyle-*.jar</include>
</includes>
</fileSet>
</fileSets>
<files>
<file>
<source>release/extensions/LICENSE.txt</source>
<outputDirectory></outputDirectory>
<destName>LICENSE-LGPL.txt</destName>
</file>
<file>
<source>../LICENSE.txt</source>
<outputDirectory></outputDirectory>
<destName>LICENSE-GeoServer.txt</destName>
</file>
<file>
<source>extension/mbstyle/README.md</source>
<outputDirectory></outputDirectory>
<destName>README.txt</destName>
</file>
</files>
</assembly>
Loading