Created
February 12, 2015 14:24
-
-
Save fvanderbiest/7cd9bcb7ef5e1c9fbaff to your computer and use it in GitHub Desktop.
geoserver diff between 2.6 beta and rc1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/doc/en/developer/source/conf.py b/doc/en/developer/source/conf.py | |
| index 095165c..41f567e 100644 | |
| --- a/doc/en/developer/source/conf.py | |
| +++ b/doc/en/developer/source/conf.py | |
| @@ -47,7 +47,7 @@ copyright = u'2014, OpenPlans' | |
| # The short X.Y version. | |
| version = '2.6' | |
| # The full version, including alpha/beta/rc tags. | |
| -release = '2.6-beta' | |
| +release = '2.6-RC1' | |
| # Users don't need to see the "SNAPSHOT" notation when it's there | |
| if release.find('SNAPSHOT') != -1: | |
| release = '2.6.x' | |
| diff --git a/doc/en/docguide/source/conf.py b/doc/en/docguide/source/conf.py | |
| index ddaad2c..d0ecb2b 100644 | |
| --- a/doc/en/docguide/source/conf.py | |
| +++ b/doc/en/docguide/source/conf.py | |
| @@ -47,7 +47,7 @@ copyright = u'2014, OpenPlans' | |
| # The short X.Y version. | |
| version = '2.6' | |
| # The full version, including alpha/beta/rc tags. | |
| -release = '2.6-beta' | |
| +release = '2.6-RC1' | |
| # Users don't need to see the "SNAPSHOT" notation when it's there | |
| if release.find('SNAPSHOT') != -1: | |
| release = '2.6.x' | |
| diff --git a/doc/en/themes/geoserver/layout.html b/doc/en/themes/geoserver/layout.html | |
| index bff32ba..f6b7d9b 100644 | |
| --- a/doc/en/themes/geoserver/layout.html | |
| +++ b/doc/en/themes/geoserver/layout.html | |
| @@ -161,9 +161,9 @@ | |
| <div class="wrap selfclear"> | |
| <div id="logo"><a href="{{ pathto('index') }}">{{ shorttitle }}</a></div> | |
| <ul id="top-nav"> | |
| - <li class="first"><a href="http://geoserver.org/display/GEOS/What+is+Geoserver">About</a></li> | |
| + <li class="first"><a href="http://geoserver.org/about">About</a></li> | |
| <li><a href="http://blog.geoserver.org/">Blog</a></li> | |
| - <li><a href="http://geoserver.org/display/GEOS/Download">Download</a></li> | |
| + <li><a href="http://geoserver.org/download">Download</a></li> | |
| <li><a href="{{ pathto('index') }}">Documentation</a></li> | |
| </ul> | |
| @@ -220,4 +220,4 @@ | |
| </div><!-- /#footer --> | |
| {%- endblock %} | |
| </body> | |
| -</html> | |
| \ No newline at end of file | |
| +</html> | |
| diff --git a/doc/en/user/source/conf.py b/doc/en/user/source/conf.py | |
| index 04553f7..6297110 100644 | |
| --- a/doc/en/user/source/conf.py | |
| +++ b/doc/en/user/source/conf.py | |
| @@ -47,7 +47,7 @@ copyright = u'2014, OpenPlans' | |
| # The short X.Y version. | |
| version = '2.6' | |
| # The full version, including alpha/beta/rc tags. | |
| -release = '2.6-beta' | |
| +release = '2.6-RC1' | |
| # Users don't need to see the "SNAPSHOT" notation when it's there | |
| if release.find('SNAPSHOT') != -1: | |
| release = '2.6.x' | |
| diff --git a/doc/en/user/source/installation/upgrade.rst b/doc/en/user/source/installation/upgrade.rst | |
| index af0a6c2..04d878c 100644 | |
| --- a/doc/en/user/source/installation/upgrade.rst | |
| +++ b/doc/en/user/source/installation/upgrade.rst | |
| @@ -9,8 +9,8 @@ previous version. See :ref:`migrating_data_directory` for more details. | |
| This section contains details about upgrading to specific GeoServer versions. | |
| -Upgrade to 2.2 | |
| --------------- | |
| +Upgrade to 2.2+ | |
| +--------------- | |
| Security configuration | |
| ^^^^^^^^^^^^^^^^^^^^^^ | |
| @@ -84,3 +84,7 @@ The solution to this problem is to reduce the administrative access role to that | |
| +Upgrade to 2.6+ | |
| +--------------- | |
| + | |
| +Before 2.6, the GeoJSON produced by the WFS service used a non-standard encoding for the CRS. Setting ``GEOSERVER_GEOJSON_LEGACY_CRS=true`` as a system property, context parameter, or environment variable will enable the old behaviour. | |
| diff --git a/doc/en/user/source/webadmin/data/layers.rst b/doc/en/user/source/webadmin/data/layers.rst | |
| index 5a1a47a..bb07074 100644 | |
| --- a/doc/en/user/source/webadmin/data/layers.rst | |
| +++ b/doc/en/user/source/webadmin/data/layers.rst | |
| @@ -85,6 +85,32 @@ Coverage Parameters (Raster) | |
| Optional coverage parameters are possible for certain types of raster data. WorldImage formats request a valid range of grid coordinates in two dimensions known as a :guilabel:`ReadGridGeometry2D.` For ImageMosaic, you can use :guilabel:`InputImageThresholdValue`, :guilabel:`InputTransparentColor`, and :guilabel:`OutputTransparentColor` to control the rendering of the mosaic in terms of thresholding and transparency. | |
| +Curves support (Vector) | |
| +``````````````````````` | |
| + | |
| +Starting GeoServer 2.6.0 GeoServer can handle geometries containing circular arcs (initially only from Oracle spatial and the "property data store", | |
| +hopefully more data sources will follow). | |
| + | |
| +These geometries are kept in memory in their circular representation for as long as possible, | |
| +are properly visually depicted in WMS, and encoded in GML 3.x as curved. | |
| + | |
| +Configuration wise there are two options pertaining the circular arcs: | |
| + | |
| +* *"Linear geometries can contain circular arcs"* should be checked to inform the GML encoder | |
| + that the layer can contain circular arcs among other linear segments in the geometries, and thus | |
| + use "gml:Curve" in place of "gml:LineString" in GML 3.1 output format. This is required because | |
| + there is no quick way to know from the data sources if the linear geometries do contain circular arcs, | |
| + and the choice of top level GML elements influences whether it is possible, or not, to represent | |
| + circular arcs in their natural form | |
| +* *"Linearization tolerance"* instead controls how accurately the linearized version of geometries | |
| + matches the original circular version of them. The tolerance can be expressed as an absolute | |
| + number in the native unit of measure of the data, or it can be expressed in meters or feet | |
| + using the "m" and "ft" suffixes, e.g. "10m" or "15ft" | |
| + | |
| +.. figure:: ../images/curved.png | |
| + :align: center | |
| + | |
| + *Curved geometry control* | |
| Feature Type Details (Vector) | |
| ```````````````````````````````` | |
| diff --git a/doc/en/user/source/webadmin/images/curved.png b/doc/en/user/source/webadmin/images/curved.png | |
| new file mode 100644 | |
| index 0000000..a305fb1 | |
| Binary files /dev/null and b/doc/en/user/source/webadmin/images/curved.png differ | |
| diff --git a/doc/es/user/source/conf.py b/doc/es/user/source/conf.py | |
| index 35f2751..096bda7 100644 | |
| --- a/doc/es/user/source/conf.py | |
| +++ b/doc/es/user/source/conf.py | |
| @@ -47,7 +47,7 @@ copyright = u'2014, OpenPlans' | |
| # The short X.Y version. | |
| version = '2.6' | |
| # The full version, including alpha/beta/rc tags. | |
| -release = '2.6-beta' | |
| +release = '2.6-RC1' | |
| # The language for content autogenerated by Sphinx. Refer to documentation | |
| # for a list of supported languages. | |
| diff --git a/doc/fr/user/source/conf.py b/doc/fr/user/source/conf.py | |
| index dfc5b54..425dd9f 100644 | |
| --- a/doc/fr/user/source/conf.py | |
| +++ b/doc/fr/user/source/conf.py | |
| @@ -47,7 +47,7 @@ copyright = u'2014 OpenPlans' | |
| # The short X.Y version. | |
| version = '2.6' | |
| # The full version, including alpha/beta/rc tags. | |
| -release = '2.6-beta' | |
| +release = '2.6-RC1' | |
| # Users don't need to see the "SNAPSHOT" notation when it's there | |
| if release.find('SNAPSHOT') != -1: | |
| release = '2.6.x' | |
| diff --git a/src/community/app-schema/pom.xml b/src/community/app-schema/pom.xml | |
| index 8de89f0..3045227 100644 | |
| --- a/src/community/app-schema/pom.xml | |
| +++ b/src/community/app-schema/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/community/app-schema/webservice-test/pom.xml b/src/community/app-schema/webservice-test/pom.xml | |
| index 390751a..2c45b94 100644 | |
| --- a/src/community/app-schema/webservice-test/pom.xml | |
| +++ b/src/community/app-schema/webservice-test/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-app-schema-community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/community/authkey/pom.xml b/src/community/authkey/pom.xml | |
| index 12a41f7..e7735a9 100644 | |
| --- a/src/community/authkey/pom.xml | |
| +++ b/src/community/authkey/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| diff --git a/src/community/colormap/pom.xml b/src/community/colormap/pom.xml | |
| index 0fa6506..466d405 100644 | |
| --- a/src/community/colormap/pom.xml | |
| +++ b/src/community/colormap/pom.xml | |
| @@ -6,7 +6,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| diff --git a/src/community/dbconfig/pom.xml b/src/community/dbconfig/pom.xml | |
| index 7b0ed3c..4232804 100644 | |
| --- a/src/community/dbconfig/pom.xml | |
| +++ b/src/community/dbconfig/pom.xml | |
| @@ -5,13 +5,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-dbconfig</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>Hibernate Catalog/Configuration Module</name> | |
| <dependencies> | |
| diff --git a/src/community/dds/pom.xml b/src/community/dds/pom.xml | |
| index 4069829..7f29834 100755 | |
| --- a/src/community/dds/pom.xml | |
| +++ b/src/community/dds/pom.xml | |
| @@ -14,13 +14,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-dds</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>WorldWind Format Module</name> | |
| diff --git a/src/community/dyndimension/pom.xml b/src/community/dyndimension/pom.xml | |
| index 872ae26..3e3d012 100644 | |
| --- a/src/community/dyndimension/pom.xml | |
| +++ b/src/community/dyndimension/pom.xml | |
| @@ -6,7 +6,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| diff --git a/src/community/feature-aggregate/pom.xml b/src/community/feature-aggregate/pom.xml | |
| index ec08c22..fc68d05 100644 | |
| --- a/src/community/feature-aggregate/pom.xml | |
| +++ b/src/community/feature-aggregate/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| diff --git a/src/community/ftp/pom.xml b/src/community/ftp/pom.xml | |
| index a782f57..0a87c21 100644 | |
| --- a/src/community/ftp/pom.xml | |
| +++ b/src/community/ftp/pom.xml | |
| @@ -3,12 +3,12 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-ftp</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer Embedded FTP server</name> | |
| <dependencies> | |
| diff --git a/src/community/geopkg/pom.xml b/src/community/geopkg/pom.xml | |
| index 7faa3bf..5b64f78 100644 | |
| --- a/src/community/geopkg/pom.xml | |
| +++ b/src/community/geopkg/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-geopkg</artifactId> | |
| diff --git a/src/community/geoserver-sync/geoserver-sync-core/pom.xml b/src/community/geoserver-sync/geoserver-sync-core/pom.xml | |
| index 75c2fc5..1078f26 100644 | |
| --- a/src/community/geoserver-sync/geoserver-sync-core/pom.xml | |
| +++ b/src/community/geoserver-sync/geoserver-sync-core/pom.xml | |
| @@ -37,7 +37,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>geoserver-sync</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <artifactId>geoserver-sync-core</artifactId> | |
| diff --git a/src/community/geoserver-sync/geoserver-sync-server/pom.xml b/src/community/geoserver-sync/geoserver-sync-server/pom.xml | |
| index 4a7ce40..a9d5538 100644 | |
| --- a/src/community/geoserver-sync/geoserver-sync-server/pom.xml | |
| +++ b/src/community/geoserver-sync/geoserver-sync-server/pom.xml | |
| @@ -37,7 +37,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>geoserver-sync</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <artifactId>geoserver-sync-server</artifactId> | |
| diff --git a/src/community/geoserver-sync/geotools-sync-client/pom.xml b/src/community/geoserver-sync/geotools-sync-client/pom.xml | |
| index 2e607d2..d3d00d2 100644 | |
| --- a/src/community/geoserver-sync/geotools-sync-client/pom.xml | |
| +++ b/src/community/geoserver-sync/geotools-sync-client/pom.xml | |
| @@ -37,7 +37,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>geoserver-sync</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <artifactId>geotools-sync-client</artifactId> | |
| diff --git a/src/community/geoserver-sync/pom.xml b/src/community/geoserver-sync/pom.xml | |
| index 9757395..96601be 100644 | |
| --- a/src/community/geoserver-sync/pom.xml | |
| +++ b/src/community/geoserver-sync/pom.xml | |
| @@ -37,7 +37,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>geoserver-sync</artifactId> | |
| diff --git a/src/community/geoserver-sync/sync-test-client/pom.xml b/src/community/geoserver-sync/sync-test-client/pom.xml | |
| index e520ec4..c1ea903 100644 | |
| --- a/src/community/geoserver-sync/sync-test-client/pom.xml | |
| +++ b/src/community/geoserver-sync/sync-test-client/pom.xml | |
| @@ -37,7 +37,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>geoserver-sync</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <artifactId>sync-test-client</artifactId> | |
| diff --git a/src/community/geoxacml/pom.xml b/src/community/geoxacml/pom.xml | |
| index 5b63a3d..1967b6c 100644 | |
| --- a/src/community/geoxacml/pom.xml | |
| +++ b/src/community/geoxacml/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/community/grib/pom.xml b/src/community/grib/pom.xml | |
| index c7f996a..41e84ef 100644 | |
| --- a/src/community/grib/pom.xml | |
| +++ b/src/community/grib/pom.xml | |
| @@ -4,7 +4,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-grib</artifactId> | |
| diff --git a/src/community/gss/pom.xml b/src/community/gss/pom.xml | |
| index 4a2dba7..166e228 100644 | |
| --- a/src/community/gss/pom.xml | |
| +++ b/src/community/gss/pom.xml | |
| @@ -3,12 +3,12 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-gss</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer Synchronization Service</name> | |
| <dependencies> | |
| diff --git a/src/community/hello/pom.xml b/src/community/hello/pom.xml | |
| index a8af6c1..4714e8c 100644 | |
| --- a/src/community/hello/pom.xml | |
| +++ b/src/community/hello/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| @@ -25,7 +25,7 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| </dependencies> | |
| diff --git a/src/community/hello_web/pom.xml b/src/community/hello_web/pom.xml | |
| index f7b1c88..eef8826 100644 | |
| --- a/src/community/hello_web/pom.xml | |
| +++ b/src/community/hello_web/pom.xml | |
| @@ -6,7 +6,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-web2</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| @@ -19,7 +19,7 @@ | |
| <dependency> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-core</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| </dependencies> | |
| diff --git a/src/community/istyler/pom.xml b/src/community/istyler/pom.xml | |
| index 36d27f9..05b1076 100644 | |
| --- a/src/community/istyler/pom.xml | |
| +++ b/src/community/istyler/pom.xml | |
| @@ -10,22 +10,22 @@ | |
| <parent> | |
| <artifactId>community</artifactId> | |
| <groupId>org.geoserver</groupId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-istyler</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>Interactive Styler Web Plugin</name> | |
| <dependencies> | |
| <dependency> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-core</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-core</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <classifier>tests</classifier> | |
| <scope>test</scope> | |
| </dependency> | |
| @@ -38,7 +38,7 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <classifier>tests</classifier> | |
| <scope>test</scope> | |
| </dependency> | |
| diff --git a/src/community/jdbcconfig/pom.xml b/src/community/jdbcconfig/pom.xml | |
| index ce8c4e7..e0d5153 100644 | |
| --- a/src/community/jdbcconfig/pom.xml | |
| +++ b/src/community/jdbcconfig/pom.xml | |
| @@ -3,12 +3,12 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-jdbcconfig</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer JDBC KV Catalog</name> | |
| <properties> | |
| <jdbcconfig.postgres.skip>true</jdbcconfig.postgres.skip> | |
| diff --git a/src/community/kml-old/pom.xml b/src/community/kml-old/pom.xml | |
| index 4ee683b..52ff304 100644 | |
| --- a/src/community/kml-old/pom.xml | |
| +++ b/src/community/kml-old/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| diff --git a/src/community/mbtiles/pom.xml b/src/community/mbtiles/pom.xml | |
| index 0124edc..0d5f704 100644 | |
| --- a/src/community/mbtiles/pom.xml | |
| +++ b/src/community/mbtiles/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-mbtiles</artifactId> | |
| diff --git a/src/community/netcdf-out/pom.xml b/src/community/netcdf-out/pom.xml | |
| index ec377c6..4b6e883 100644 | |
| --- a/src/community/netcdf-out/pom.xml | |
| +++ b/src/community/netcdf-out/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| diff --git a/src/community/netcdf/pom.xml b/src/community/netcdf/pom.xml | |
| index f904d65..a858c66 100644 | |
| --- a/src/community/netcdf/pom.xml | |
| +++ b/src/community/netcdf/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| diff --git a/src/community/pom.xml b/src/community/pom.xml | |
| index ebcc96b..5f202b6 100644 | |
| --- a/src/community/pom.xml | |
| +++ b/src/community/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| @@ -315,5 +315,11 @@ | |
| <module>rest-ext</module> | |
| </modules> | |
| </profile> | |
| + <profile> | |
| + <id>validation</id> | |
| + <modules> | |
| + <module>validation</module> | |
| + </modules> | |
| + </profile> | |
| </profiles> | |
| </project> | |
| diff --git a/src/community/proxy/pom.xml b/src/community/proxy/pom.xml | |
| index d7a2824..04152d1 100644 | |
| --- a/src/community/proxy/pom.xml | |
| +++ b/src/community/proxy/pom.xml | |
| @@ -10,12 +10,12 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-proxy</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>HTTP Proxy Extension</name> | |
| <repositories> | |
| diff --git a/src/community/python/pom.xml b/src/community/python/pom.xml | |
| index 1513bf9..a41d9e5 100644 | |
| --- a/src/community/python/pom.xml | |
| +++ b/src/community/python/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-python</artifactId> | |
| @@ -30,7 +30,7 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-rest</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.restlet</groupId> | |
| @@ -39,27 +39,27 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-wfs</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-wms</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-wfs</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-core</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geotools</groupId> | |
| @@ -84,14 +84,14 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <scope>test</scope> | |
| <classifier>tests</classifier> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-wms</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <scope>test</scope> | |
| <classifier>tests</classifier> | |
| </dependency> | |
| diff --git a/src/community/release/ext-jdbcconfig.xml b/src/community/release/ext-jdbcconfig.xml | |
| index e29f7a2..0fab199 100644 | |
| --- a/src/community/release/ext-jdbcconfig.xml | |
| +++ b/src/community/release/ext-jdbcconfig.xml | |
| @@ -10,6 +10,7 @@ | |
| <outputDirectory></outputDirectory> | |
| <includes> | |
| <include>gs-jdbcconfig-*.jar</include> | |
| + <include>compress-lzf-*.jar</include> | |
| </includes> | |
| </fileSet> | |
| </fileSets> | |
| diff --git a/src/community/release/pom.xml b/src/community/release/pom.xml | |
| index 83b2a0e..7ce9b1e 100644 | |
| --- a/src/community/release/pom.xml | |
| +++ b/src/community/release/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-release</artifactId> | |
| diff --git a/src/community/rest-ext/pom.xml b/src/community/rest-ext/pom.xml | |
| index db22195..815fd7f 100644 | |
| --- a/src/community/rest-ext/pom.xml | |
| +++ b/src/community/rest-ext/pom.xml | |
| @@ -6,11 +6,11 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-rest-ext</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>REST plugin community module</name> | |
| <url>http://maven.apache.org</url> | |
| <properties> | |
| diff --git a/src/community/script/bsh/pom.xml b/src/community/script/bsh/pom.xml | |
| index b91a666..949c611 100644 | |
| --- a/src/community/script/bsh/pom.xml | |
| +++ b/src/community/script/bsh/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-script</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.script</groupId> | |
| <artifactId>gs-script-bsh</artifactId> | |
| diff --git a/src/community/script/core/pom.xml b/src/community/script/core/pom.xml | |
| index 7edb3f9..c5af2c8 100644 | |
| --- a/src/community/script/core/pom.xml | |
| +++ b/src/community/script/core/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-script</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.script</groupId> | |
| <artifactId>gs-script-core</artifactId> | |
| diff --git a/src/community/script/groovy/pom.xml b/src/community/script/groovy/pom.xml | |
| index d58c973..c4d1bd6 100644 | |
| --- a/src/community/script/groovy/pom.xml | |
| +++ b/src/community/script/groovy/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-script</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.script</groupId> | |
| <artifactId>gs-script-groovy</artifactId> | |
| diff --git a/src/community/script/js/pom.xml b/src/community/script/js/pom.xml | |
| index bf37e43..c6b211a 100644 | |
| --- a/src/community/script/js/pom.xml | |
| +++ b/src/community/script/js/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-script</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.script</groupId> | |
| <artifactId>gs-script-js</artifactId> | |
| diff --git a/src/community/script/pom.xml b/src/community/script/pom.xml | |
| index 8b2bc50..47b3251 100644 | |
| --- a/src/community/script/pom.xml | |
| +++ b/src/community/script/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-script</artifactId> | |
| diff --git a/src/community/script/py/pom.xml b/src/community/script/py/pom.xml | |
| index 5ccb263..8823de7 100644 | |
| --- a/src/community/script/py/pom.xml | |
| +++ b/src/community/script/py/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-script</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.script</groupId> | |
| <artifactId>gs-script-py</artifactId> | |
| diff --git a/src/community/script/rb/pom.xml b/src/community/script/rb/pom.xml | |
| index c916a3c..dbe1157 100644 | |
| --- a/src/community/script/rb/pom.xml | |
| +++ b/src/community/script/rb/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-script</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.script</groupId> | |
| <artifactId>gs-script-rb</artifactId> | |
| diff --git a/src/community/script/web/pom.xml b/src/community/script/web/pom.xml | |
| index e3a9ab7..33adfe6 100644 | |
| --- a/src/community/script/web/pom.xml | |
| +++ b/src/community/script/web/pom.xml | |
| @@ -10,7 +10,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-script</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.script</groupId> | |
| <artifactId>gs-script-web</artifactId> | |
| @@ -20,7 +20,7 @@ | |
| <dependency> | |
| <groupId>org.geoserver.script</groupId> | |
| <artifactId>gs-script-core</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver.web</groupId> | |
| @@ -29,7 +29,7 @@ | |
| <dependency> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-core</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <classifier>tests</classifier> | |
| <scope>test</scope> | |
| </dependency> | |
| diff --git a/src/community/scriptlet/pom.xml b/src/community/scriptlet/pom.xml | |
| index ee43b0c..637a500 100644 | |
| --- a/src/community/scriptlet/pom.xml | |
| +++ b/src/community/scriptlet/pom.xml | |
| @@ -10,12 +10,12 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-scriptlet</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>JavaScript REST Extension Support</name> | |
| <repositories> | |
| @@ -31,22 +31,22 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-rest</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-core</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <classifier>tests</classifier> | |
| <scope>test</scope> | |
| </dependency> | |
| diff --git a/src/community/sfs/pom.xml b/src/community/sfs/pom.xml | |
| index da6b91c..dfb610c 100644 | |
| --- a/src/community/sfs/pom.xml | |
| +++ b/src/community/sfs/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| diff --git a/src/community/sldService/pom.xml b/src/community/sldService/pom.xml | |
| index b353340..f907bcc 100644 | |
| --- a/src/community/sldService/pom.xml | |
| +++ b/src/community/sldService/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| @@ -23,22 +23,22 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-rest</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-restconfig</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-wms</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>jdom</groupId> | |
| diff --git a/src/community/spatialite/pom.xml b/src/community/spatialite/pom.xml | |
| index 0948b4c..da5b8fe 100644 | |
| --- a/src/community/spatialite/pom.xml | |
| +++ b/src/community/spatialite/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| @@ -43,7 +43,7 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-wfs</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>junit</groupId> | |
| @@ -53,14 +53,14 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-wfs</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <classifier>tests</classifier> | |
| <scope>test</scope> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <classifier>tests</classifier> | |
| <scope>test</scope> | |
| </dependency> | |
| diff --git a/src/community/validation/pom.xml b/src/community/validation/pom.xml | |
| new file mode 100644 | |
| index 0000000..93d7f9b | |
| --- /dev/null | |
| +++ b/src/community/validation/pom.xml | |
| @@ -0,0 +1,36 @@ | |
| +<?xml version="1.0" encoding="ISO-8859-1"?> | |
| +<!-- | |
| + Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| + This code is licensed under the GPL 2.0 license, available at the root | |
| + application directory. | |
| + --> | |
| +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
| + <modelVersion>4.0.0</modelVersion> | |
| + | |
| + <parent> | |
| + <groupId>org.geoserver</groupId> | |
| + <artifactId>community</artifactId> | |
| + <version>2.6-RC1</version> | |
| + </parent> | |
| + | |
| + <groupId>org.geoserver.community</groupId> | |
| + <artifactId>gs-validation</artifactId> | |
| + <packaging>jar</packaging> | |
| + <name>Validation Module</name> | |
| + | |
| + <dependencies> | |
| + <dependency> | |
| + <groupId>org.geoserver</groupId> | |
| + <artifactId>gs-main</artifactId> | |
| + <version>2.6-RC1</version> | |
| + </dependency> | |
| + <dependency> | |
| + <groupId>org.geotools</groupId> | |
| + <artifactId>gt-validation</artifactId> | |
| + <version>${gt.version}</version> | |
| + </dependency> | |
| + | |
| + </dependencies> | |
| + | |
| +</project> | |
| diff --git a/src/community/validation/src/main/java/applicationContext.xml b/src/community/validation/src/main/java/applicationContext.xml | |
| new file mode 100644 | |
| index 0000000..324244c | |
| --- /dev/null | |
| +++ b/src/community/validation/src/main/java/applicationContext.xml | |
| @@ -0,0 +1,36 @@ | |
| +<?xml version="1.0" encoding="UTF-8"?> | |
| +<!-- | |
| + Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| + This code is licensed under the GPL 2.0 license, available at the root | |
| + application directory. | |
| + --> | |
| +<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> | |
| +<beans> | |
| + | |
| + <!-- validation module --> | |
| + <bean id="validation" | |
| + class="org.vfny.geoserver.global.GeoValidator"> | |
| + <constructor-arg ref="resourceLoader"/> | |
| + </bean> | |
| + <bean id="validationConfig" | |
| + class="org.vfny.geoserver.config.validation.ValidationConfig"> | |
| + <constructor-arg ref="validation"/> | |
| + </bean> | |
| + | |
| + <!-- this registers the above beans with the servlet context | |
| + it is around to keep the struts app happy as we move away from | |
| + servlets --> | |
| + <bean id="validationRegisterar" | |
| + class="org.vfny.geoserver.global.GeoServerServletContextInitializer"> | |
| + | |
| + <constructor-arg type="java.lang.String" value="GeoValidator"/> | |
| + <constructor-arg ref="validation"/> | |
| + </bean> | |
| + <bean id="validationConfigRegisterar" | |
| + class="org.vfny.geoserver.global.GeoServerServletContextInitializer"> | |
| + | |
| + <constructor-arg type="java.lang.String" value="Validation.Config"/> | |
| + <constructor-arg ref="validationConfig"/> | |
| + </bean> | |
| + | |
| +</beans> | |
| diff --git a/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/ArgumentConfig.java b/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/ArgumentConfig.java | |
| new file mode 100644 | |
| index 0000000..6269549 | |
| --- /dev/null | |
| +++ b/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/ArgumentConfig.java | |
| @@ -0,0 +1,230 @@ | |
| +/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| + * This code is licensed under the GPL 2.0 license, available at the root | |
| + * application directory. | |
| + */ | |
| +package org.vfny.geoserver.config.validation; | |
| + | |
| +import java.beans.Introspector; | |
| +import java.beans.PropertyDescriptor; | |
| +import java.util.List; | |
| +import java.util.Locale; | |
| + | |
| +import org.geotools.validation.dto.ArgumentDTO; | |
| + | |
| + | |
| +/** | |
| + * ArgumentConfig purpose. | |
| + * <p> | |
| + * Description of ArgumentConfig ... | |
| + * </p> | |
| + * | |
| + * @author dzwiers, Refractions Research, Inc. | |
| + * @author $Author: dmzwiers $ (last modification) | |
| + * @version $Id$ | |
| + */ | |
| +public class ArgumentConfig { | |
| + private String name; | |
| + private boolean _final; | |
| + private Object value; | |
| + | |
| + /** | |
| + * ArgumentConfig constructor. | |
| + * <p> | |
| + * Description | |
| + * </p> | |
| + * | |
| + */ | |
| + public ArgumentConfig() { | |
| + } | |
| + | |
| + public ArgumentConfig(ArgumentConfig dto) { | |
| + name = dto.getName(); | |
| + _final = isFinal(); | |
| + value = dto.getValue(); | |
| + } | |
| + | |
| + public ArgumentConfig(ArgumentDTO dto) { | |
| + name = dto.getName(); | |
| + _final = isFinal(); | |
| + value = dto.getValue(); | |
| + } | |
| + | |
| + public Object clone() { | |
| + return new ArgumentConfig(this); | |
| + } | |
| + | |
| + public boolean equals(Object obj) { | |
| + boolean r = true; | |
| + | |
| + if ((obj == null) || !(obj instanceof ArgumentConfig)) { | |
| + return false; | |
| + } | |
| + | |
| + ArgumentConfig dto = (ArgumentConfig) obj; | |
| + r = r && (dto.isFinal() == _final); | |
| + | |
| + if (name != null) { | |
| + r = r && (name.equals(dto.getName())); | |
| + } else if (dto.getName() != null) { | |
| + return false; | |
| + } | |
| + | |
| + if (value != null) { | |
| + r = r && (value.equals(dto.getValue())); | |
| + } else if (dto.getValue() != null) { | |
| + return false; | |
| + } | |
| + | |
| + return r; | |
| + } | |
| + | |
| + public int hashCode() { | |
| + int r = 1; | |
| + | |
| + if (name != null) { | |
| + r *= name.hashCode(); | |
| + } | |
| + | |
| + if (value != null) { | |
| + r *= value.hashCode(); | |
| + } | |
| + | |
| + return r; | |
| + } | |
| + | |
| + public ArgumentDTO toDTO() { | |
| + ArgumentDTO dto = new ArgumentDTO(); | |
| + dto.setFinal(_final); | |
| + dto.setName(name); | |
| + dto.setValue(value); | |
| + | |
| + return dto; | |
| + } | |
| + | |
| + /** | |
| + * Access _final property. | |
| + * | |
| + * @return Returns the _final. | |
| + */ | |
| + public boolean isFinal() { | |
| + return _final; | |
| + } | |
| + | |
| + /** | |
| + * Set _final to _final. | |
| + * | |
| + * @param _final The _final to set. | |
| + */ | |
| + public void setFinal(boolean _final) { | |
| + this._final = _final; | |
| + } | |
| + | |
| + /** | |
| + * Access name property. | |
| + * | |
| + * @return Returns the name. | |
| + */ | |
| + public String getName() { | |
| + return name; | |
| + } | |
| + | |
| + /** | |
| + * Set name to name. | |
| + * | |
| + * @param name The name to set. | |
| + */ | |
| + public void setName(String name) { | |
| + this.name = name; | |
| + } | |
| + | |
| + /** | |
| + * Access value property. | |
| + * | |
| + * @return Returns the value. | |
| + */ | |
| + public Object getValue() { | |
| + return value; | |
| + } | |
| + | |
| + /** | |
| + * Set value to value. | |
| + * | |
| + * @param value The value to set. | |
| + */ | |
| + public void setValue(Object value) { | |
| + if (value == null) { | |
| + throw new NullPointerException("value should only be set when it has a value"); | |
| + } | |
| + | |
| + this.value = value; | |
| + } | |
| + | |
| + /** | |
| + * | |
| + * getDisplayName purpose. | |
| + * <p> | |
| + * This is used to provide the locale to the property descriptor if it is required. This method is thread safe. | |
| + * </p> | |
| + * <p> | |
| + * This method must be both synchornized and static. The global locale is maintained from start to completion of execution, even when an unexpected exception occurs. | |
| + * </p> | |
| + * @param pd PropertyDescriptor to get the display name from | |
| + * @param locale Locale to use if required. | |
| + * @return String the Display Name | |
| + */ | |
| + public static synchronized String getDisplayName(PropertyDescriptor pd) { | |
| + String r = ""; | |
| + | |
| + try { // to safely reset the locale. | |
| + r = pd.getDisplayName(); | |
| + } finally { | |
| + } | |
| + | |
| + return r; | |
| + } | |
| + | |
| + public static synchronized void loadPropertyLists(TestConfig testConfig, Locale lc, | |
| + List attributeKeys, List attributeHelps, List attributeValues) { | |
| + if (!lc.equals(Locale.getDefault())) { | |
| + Locale.setDefault(lc); | |
| + Introspector.flushCaches(); | |
| + } | |
| + | |
| + PropertyDescriptor[] pd = testConfig.getPropertyDescriptors(); | |
| + | |
| + for (int i = 0; i < pd.length; i++) { | |
| + PropertyDescriptor property = pd[i]; | |
| + String propertyName = property.getName(); | |
| + String displayName = ArgumentConfig.getDisplayName(property); | |
| + String description = ArgumentConfig.getDescription(property); | |
| + | |
| + attributeKeys.add(propertyName); | |
| + attributeHelps.add(description); | |
| + attributeValues.add(testConfig.getArgStringValue(propertyName)); | |
| + } | |
| + } | |
| + | |
| + /** | |
| + * | |
| + * getDescription purpose. | |
| + * <p> | |
| + * This is used to provide the locale to the property descriptor if it is required. This method is thread safe. | |
| + * </p> | |
| + * <p> | |
| + * This method must be both synchornized and static. | |
| + * </p> | |
| + * @param pd PropertyDescriptor to get the display description from | |
| + * @param locale Locale to use if required. | |
| + * @return String the display description | |
| + */ | |
| + public static synchronized String getDescription(PropertyDescriptor pd) { | |
| + String r = ""; | |
| + | |
| + try { // to safely reset the locale. | |
| + r = pd.getShortDescription(); | |
| + } finally { | |
| + } | |
| + | |
| + return r; | |
| + } | |
| +} | |
| diff --git a/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/PlugInConfig.java b/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/PlugInConfig.java | |
| new file mode 100644 | |
| index 0000000..cde28d7 | |
| --- /dev/null | |
| +++ b/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/PlugInConfig.java | |
| @@ -0,0 +1,511 @@ | |
| +/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| + * This code is licensed under the GPL 2.0 license, available at the root | |
| + * application directory. | |
| + */ | |
| +package org.vfny.geoserver.config.validation; | |
| + | |
| +import java.beans.BeanInfo; | |
| +import java.beans.Introspector; | |
| +import java.beans.PropertyDescriptor; | |
| +import java.io.StringReader; | |
| +import java.util.HashMap; | |
| +import java.util.Iterator; | |
| +import java.util.Map; | |
| + | |
| +import org.geotools.validation.dto.ArgumentDTO; | |
| +import org.geotools.validation.dto.PlugInDTO; | |
| +import org.geotools.validation.xml.ArgHelper; | |
| +import org.geotools.validation.xml.ValidationException; | |
| + | |
| + | |
| +/** | |
| + * PlugInConfig purpose. | |
| + * | |
| + * <p> | |
| + * Used to represent a copy of the config information required for the UI. | |
| + * </p> | |
| + * | |
| + * @author dzwiers, Refractions Research, Inc. | |
| + * @author $Author: dmzwiers $ (last modification) | |
| + * @version $Id$ | |
| + */ | |
| +public class PlugInConfig { | |
| + public static final String CONFIG_KEY = "Validation.PlugIn"; | |
| + | |
| + /** the plug-in name */ | |
| + private String name; | |
| + | |
| + /** the plug-in description */ | |
| + private String description; | |
| + | |
| + /** the class name this plug-in represents */ | |
| + private String className; | |
| + | |
| + /** the default arguments */ | |
| + private Map args; | |
| + | |
| + /** | |
| + * PlugInConfig constructor. | |
| + * | |
| + * <p> | |
| + * Does nothing. | |
| + * </p> | |
| + */ | |
| + public PlugInConfig() { | |
| + args = new HashMap(); | |
| + } | |
| + | |
| + /** | |
| + * PlugInConfig constructor. | |
| + * | |
| + * <p> | |
| + * Creates a copy of the PlugInConfig passed in in this object. | |
| + * </p> | |
| + * | |
| + * @param pi | |
| + */ | |
| + public PlugInConfig(PlugInConfig pi) { | |
| + name = pi.getName(); | |
| + description = pi.getDescription(); | |
| + className = pi.getClassName(); | |
| + args = new HashMap(); | |
| + | |
| + if (pi.getArgs() != null) { | |
| + Iterator i = pi.getArgs().keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + String key = (String) i.next(); | |
| + | |
| + //TODO clone value. | |
| + args.put(key, new ArgumentConfig((ArgumentConfig) pi.getArgs().get(key))); | |
| + } | |
| + } | |
| + } | |
| + | |
| + /** | |
| + * PlugInConfig constructor. | |
| + * | |
| + * <p> | |
| + * Creates a copy of the PlugInDTO passed in in this object. | |
| + * </p> | |
| + * | |
| + * @param pi | |
| + */ | |
| + public PlugInConfig(PlugInDTO pi) { | |
| + name = pi.getName(); | |
| + description = pi.getDescription(); | |
| + className = pi.getClassName(); | |
| + args = new HashMap(); | |
| + | |
| + if (pi.getArgs() != null) { | |
| + Iterator i = pi.getArgs().keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + String key = (String) i.next(); | |
| + | |
| + //TODO clone value. | |
| + args.put(key, new ArgumentConfig((ArgumentDTO) pi.getArgs().get(key))); | |
| + } | |
| + } | |
| + } | |
| + | |
| + /** | |
| + * Implementation of clone. | |
| + * | |
| + * @return a copy of this class. | |
| + * | |
| + * @see java.lang.Object#clone() | |
| + */ | |
| + public Object clone() { | |
| + return new PlugInConfig(this); | |
| + } | |
| + | |
| + /** | |
| + * Implementation of equals. | |
| + * | |
| + * @param obj | |
| + * | |
| + * @return true when the two objects are equal. | |
| + * | |
| + * @see java.lang.Object#equals(java.lang.Object) | |
| + */ | |
| + public boolean equals(Object obj) { | |
| + if ((obj == null) || !(obj instanceof PlugInDTO)) { | |
| + return false; | |
| + } | |
| + | |
| + PlugInDTO pi = (PlugInDTO) obj; | |
| + boolean r = true; | |
| + | |
| + if (name != null) { | |
| + r = r && (name.equals(pi.getName())); | |
| + } | |
| + | |
| + if (description != null) { | |
| + r = r && (description.equals(pi.getDescription())); | |
| + } | |
| + | |
| + if (className != null) { | |
| + r = r && (className.equals(pi.getClassName())); | |
| + } | |
| + | |
| + if (args == null) { | |
| + if (pi.getArgs() != null) { | |
| + return false; | |
| + } | |
| + } else { | |
| + if (pi.getArgs() != null) { | |
| + r = r && args.equals(pi.getArgs()); | |
| + } else { | |
| + return false; | |
| + } | |
| + } | |
| + | |
| + return r; | |
| + } | |
| + | |
| + /** | |
| + * Implementation of hashCode. | |
| + * | |
| + * @return the hashcode. | |
| + * | |
| + * @see java.lang.Object#hashCode() | |
| + */ | |
| + public int hashCode() { | |
| + int i = 1; | |
| + | |
| + if (name != null) { | |
| + i *= name.hashCode(); | |
| + } | |
| + | |
| + if (description != null) { | |
| + i *= description.hashCode(); | |
| + } | |
| + | |
| + if (className != null) { | |
| + i *= className.hashCode(); | |
| + } | |
| + | |
| + if (args != null) { | |
| + i *= args.hashCode(); | |
| + } | |
| + | |
| + return i; | |
| + } | |
| + | |
| + /** | |
| + * toDTO purpose. | |
| + * <p> | |
| + * Clones this config as a DTO. | |
| + * </p> | |
| + * @see java.lang.Object#clone() | |
| + * @return PlugInDTO | |
| + */ | |
| + public PlugInDTO toDTO() { | |
| + PlugInDTO dto = new PlugInDTO(); | |
| + | |
| + dto.setName(name); | |
| + dto.setDescription(description); | |
| + dto.setClassName(className); | |
| + | |
| + Map myArgs = new HashMap(); | |
| + | |
| + if (this.args != null) { | |
| + Iterator i = this.args.keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + String key = (String) i.next(); | |
| + | |
| + myArgs.put(key, ((ArgumentConfig) this.args.get(key)).toDTO()); | |
| + } | |
| + } | |
| + | |
| + dto.setArgs(myArgs); | |
| + | |
| + return dto; | |
| + } | |
| + | |
| + /** | |
| + * Access args property. | |
| + * | |
| + * @return Returns the args. | |
| + */ | |
| + public Map getArgs() { | |
| + return args; | |
| + } | |
| + | |
| + /** | |
| + * Set args to args. | |
| + * | |
| + * @param args The args to set. | |
| + */ | |
| + public void setArgs(Map args) { | |
| + this.args = args; | |
| + } | |
| + | |
| + /** | |
| + * getArgStringValue purpose. | |
| + * <p> | |
| + * Returns a human friendly version | |
| + * </p> | |
| + * @param name | |
| + * @return | |
| + */ | |
| + public String getArgStringValue(String name) { | |
| + ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| + | |
| + if (ac == null) { | |
| + return null; | |
| + } | |
| + | |
| + return ArgHelper.getArgumentStringEncoding(ac.getValue()); | |
| + } | |
| + | |
| + /** | |
| + * getArgValue purpose. | |
| + * <p> | |
| + * Returns an Object version | |
| + * </p> | |
| + * @param name | |
| + * @return | |
| + */ | |
| + public Object getArgValue(String name) { | |
| + ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| + | |
| + if (ac == null) { | |
| + return null; | |
| + } | |
| + | |
| + return ac.getValue(); | |
| + } | |
| + | |
| + /** | |
| + * setArgStringValue purpose. | |
| + * <p> | |
| + * Stores a human friendly version | |
| + * </p> | |
| + * @param name | |
| + * @param value | |
| + * @return | |
| + */ | |
| + public boolean setArgStringValue(String name, String value) { | |
| + if ((value == null) || value.equals("")) { | |
| + args.remove(name); | |
| + | |
| + return true; | |
| + } | |
| + | |
| + ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| + | |
| + if (ac == null) { | |
| + return addArgStringValue(name, value); | |
| + } else { | |
| + if (ac.isFinal()) { | |
| + throw new IllegalArgumentException( | |
| + "Cannot include final arguments as part of a test."); | |
| + } | |
| + | |
| + StringReader sr = new StringReader(value); | |
| + | |
| + try { | |
| + ac.setValue(ArgHelper.getArgumentInstance(ArgHelper.getArgumentType(ac.getValue()), | |
| + value)); | |
| + | |
| + return true; | |
| + } catch (Exception e) { | |
| + e.printStackTrace(); | |
| + | |
| + // error, log it | |
| + return false; | |
| + } | |
| + } | |
| + } | |
| + | |
| + /** | |
| + * setArgStringValue purpose. | |
| + * <p> | |
| + * Stores a human friendly version. | |
| + * </p> | |
| + * @param name | |
| + * @param value | |
| + * @return | |
| + */ | |
| + public boolean addArgStringValue(String name, String value) { | |
| + if ((value == null) || value.equals("")) { | |
| + args.remove(name); | |
| + | |
| + return false; | |
| + } | |
| + | |
| + PropertyDescriptor pd = getPropertyDescriptor(name); | |
| + | |
| + if (pd == null) { | |
| + return false; | |
| + } | |
| + | |
| + Class cl = pd.getPropertyType(); | |
| + ArgumentConfig ac = new ArgumentConfig(); | |
| + ac.setName(name); | |
| + | |
| + try { | |
| + ac.setValue(ArgHelper.getArgumentInstance(ArgHelper.getArgumentType(cl), value)); | |
| + } catch (ValidationException e) { | |
| + // TODO Auto-generated catch block | |
| + e.printStackTrace(); | |
| + | |
| + return false; | |
| + } | |
| + | |
| + args.put(name, ac); | |
| + | |
| + return true; | |
| + } | |
| + | |
| + public Object createArg(String name, String value) | |
| + throws Exception { | |
| + PropertyDescriptor pd = getPropertyDescriptor(name); | |
| + | |
| + if (pd == null) { | |
| + return null; | |
| + } | |
| + | |
| + if ((value == null) || value.equals("")) { | |
| + return null; | |
| + } | |
| + | |
| + Class cl = pd.getPropertyType(); | |
| + | |
| + return ArgHelper.getArgumentInstance(ArgHelper.getArgumentType(cl), value); | |
| + } | |
| + | |
| + /** | |
| + * setArgStringValue purpose. | |
| + * <p> | |
| + * Stores a human friendly version | |
| + * </p> | |
| + * @param name | |
| + * @param value | |
| + * @return | |
| + */ | |
| + public boolean setArgValue(String name, Object value) { | |
| + if ((value == null) || value.equals("")) { | |
| + args.remove(name); | |
| + | |
| + return true; | |
| + } | |
| + | |
| + ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| + | |
| + if (ac == null) { | |
| + ac = new ArgumentConfig(); | |
| + ac.setName(name); | |
| + args.put(name, ac); | |
| + } | |
| + | |
| + if (ac.isFinal()) { | |
| + throw new IllegalArgumentException("Cannot include final arguments as part of a test."); | |
| + } | |
| + | |
| + ac.setValue(value); | |
| + | |
| + return true; | |
| + } | |
| + | |
| + /** | |
| + * getPropertyDescriptors purpose. | |
| + * <p> | |
| + * Get the descriptors for this plugin's map of attributes | |
| + * </p> | |
| + * @return | |
| + */ | |
| + public PropertyDescriptor[] getPropertyDescriptors() { | |
| + try { | |
| + Class plugIn = this.getClass().getClassLoader().loadClass(className); | |
| + BeanInfo bi = Introspector.getBeanInfo(plugIn); | |
| + | |
| + return bi.getPropertyDescriptors(); | |
| + } catch (Exception e) { | |
| + e.printStackTrace(); | |
| + | |
| + return null; | |
| + } | |
| + } | |
| + | |
| + /** | |
| + * PropertyDescriptor purpose. | |
| + * <p> | |
| + * Get the descriptor for this plugin's attribute named | |
| + * </p> | |
| + * @param name | |
| + * @return | |
| + */ | |
| + public PropertyDescriptor getPropertyDescriptor(String name) { | |
| + if (name == null) { | |
| + throw new NullPointerException("name must be defined to get a PropertyDescriptor."); | |
| + } | |
| + | |
| + PropertyDescriptor[] pds = getPropertyDescriptors(); | |
| + | |
| + for (int i = 0; i < pds.length; i++) { | |
| + if (name.equals(pds[i].getName())) { | |
| + return pds[i]; | |
| + } | |
| + } | |
| + | |
| + return null; | |
| + } | |
| + | |
| + /** | |
| + * Access className property. | |
| + * | |
| + * @return Returns the className. | |
| + */ | |
| + public String getClassName() { | |
| + return className; | |
| + } | |
| + | |
| + /** | |
| + * Set className to className. | |
| + * | |
| + * @param className The className to set. | |
| + */ | |
| + public void setClassName(String className) { | |
| + this.className = className; | |
| + } | |
| + | |
| + /** | |
| + * Access description property. | |
| + * | |
| + * @return Returns the description. | |
| + */ | |
| + public String getDescription() { | |
| + return description; | |
| + } | |
| + | |
| + /** | |
| + * Set description to description. | |
| + * | |
| + * @param description The description to set. | |
| + */ | |
| + public void setDescription(String description) { | |
| + this.description = description; | |
| + } | |
| + | |
| + /** | |
| + * Access name property. | |
| + * | |
| + * @return Returns the name. | |
| + */ | |
| + public String getName() { | |
| + return name; | |
| + } | |
| + | |
| + /** | |
| + * Set name to name. | |
| + * | |
| + * @param name The name to set. | |
| + */ | |
| + public void setName(String name) { | |
| + this.name = name; | |
| + } | |
| +} | |
| diff --git a/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/TestConfig.java b/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/TestConfig.java | |
| new file mode 100644 | |
| index 0000000..39d60fb | |
| --- /dev/null | |
| +++ b/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/TestConfig.java | |
| @@ -0,0 +1,569 @@ | |
| +/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| + * This code is licensed under the GPL 2.0 license, available at the root | |
| + * application directory. | |
| + */ | |
| +package org.vfny.geoserver.config.validation; | |
| + | |
| +import java.beans.PropertyDescriptor; | |
| +import java.io.StringReader; | |
| +import java.util.HashMap; | |
| +import java.util.HashSet; | |
| +import java.util.Iterator; | |
| +import java.util.Map; | |
| +import java.util.Set; | |
| + | |
| +import org.geotools.validation.dto.ArgumentDTO; | |
| +import org.geotools.validation.dto.PlugInDTO; | |
| +import org.geotools.validation.dto.TestDTO; | |
| +import org.geotools.validation.xml.ArgHelper; | |
| +import org.geotools.validation.xml.ValidationException; | |
| + | |
| + | |
| +/** | |
| + * TestConfig purpose. | |
| + * | |
| + * <p> | |
| + * Used to represent a copy of the config information required for the UI. | |
| + * </p> | |
| + * | |
| + * @author dzwiers, Refractions Research, Inc. | |
| + * @author $Author: dmzwiers $ (last modification) | |
| + * @version $Id$ | |
| + */ | |
| +public class TestConfig { | |
| + public final static String CURRENTLY_SELECTED_KEY = "selectedTest"; | |
| + | |
| + /** the test name */ | |
| + private String name; | |
| + | |
| + /** the test description */ | |
| + private String description; | |
| + | |
| + /** | |
| + * The plug-in which contains the class definition and default runtime | |
| + * values | |
| + */ | |
| + private PlugInConfig plugIn; | |
| + | |
| + /** lazily loaded */ | |
| + private PropertyDescriptor[] pds; | |
| + | |
| + /** | |
| + * The set of runtime args for this particular test to override the | |
| + * defaults in the plug-in | |
| + */ | |
| + private Map args; | |
| + | |
| + /** | |
| + * TestConfig constructor. | |
| + * | |
| + * <p> | |
| + * Does nothing | |
| + * </p> | |
| + */ | |
| + public TestConfig() { | |
| + args = new HashMap(); | |
| + } | |
| + | |
| + /** | |
| + * TestConfig constructor. | |
| + * | |
| + * <p> | |
| + * Creates a copy from the TestConfig specified. | |
| + * </p> | |
| + * | |
| + * @param t the data to copy | |
| + */ | |
| + public TestConfig(TestConfig t) { | |
| + name = t.getName(); | |
| + description = t.getDescription(); | |
| + plugIn = new PlugInConfig(t.getPlugIn()); | |
| + args = new HashMap(); | |
| + | |
| + if (t.getArgs() != null) { | |
| + Iterator i = t.getArgs().keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + String key = (String) i.next(); | |
| + | |
| + //TODO clone value. | |
| + args.put(key, new ArgumentConfig((ArgumentConfig) t.getArgs().get(key))); | |
| + } | |
| + } | |
| + } | |
| + | |
| + /** | |
| + * TestConfig constructor. | |
| + * | |
| + * <p> | |
| + * Creates a copy from the TestDTO specified. | |
| + * </p> | |
| + * | |
| + * @param t the data to copy | |
| + */ | |
| + public TestConfig(TestDTO t, Map plugInConfigs) { | |
| + name = t.getName(); | |
| + description = t.getDescription(); | |
| + plugIn = (PlugInConfig) plugInConfigs.get(t.getPlugIn().getName()); | |
| + args = new HashMap(); | |
| + | |
| + if (t.getArgs() != null) { | |
| + Iterator i = t.getArgs().keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + String key = (String) i.next(); | |
| + | |
| + //TODO clone value. | |
| + args.put(key, new ArgumentConfig((ArgumentDTO) t.getArgs().get(key))); | |
| + } | |
| + } | |
| + } | |
| + | |
| + /** | |
| + * Implementation of clone. | |
| + * | |
| + * @return A copy of this TestConfig | |
| + * | |
| + * @see java.lang.Object#clone() | |
| + */ | |
| + public Object clone() { | |
| + return new TestConfig(this); | |
| + } | |
| + | |
| + /** | |
| + * Implementation of equals. | |
| + * | |
| + * @param obj | |
| + * | |
| + * @return true when they have the same data. | |
| + * | |
| + * @see java.lang.Object#equals(java.lang.Object) | |
| + */ | |
| + public boolean equals(Object obj) { | |
| + if ((obj == null) || !(obj instanceof TestDTO)) { | |
| + return false; | |
| + } | |
| + | |
| + TestDTO t = (TestDTO) obj; | |
| + boolean r = true; | |
| + | |
| + if (name != null) { | |
| + r = r && (name.equals(t.getName())); | |
| + } | |
| + | |
| + if (description != null) { | |
| + r = r && (description.equals(t.getDescription())); | |
| + } | |
| + | |
| + if (plugIn == null) { | |
| + if (t.getPlugIn() != null) { | |
| + return false; | |
| + } | |
| + } else { | |
| + if (t.getPlugIn() != null) { | |
| + r = r && plugIn.equals(t.getPlugIn()); | |
| + } else { | |
| + return false; | |
| + } | |
| + } | |
| + | |
| + if (args == null) { | |
| + if (t.getArgs() != null) { | |
| + return false; | |
| + } | |
| + } else { | |
| + if (t.getArgs() != null) { | |
| + r = r && args.equals(t.getArgs()); | |
| + } else { | |
| + return false; | |
| + } | |
| + } | |
| + | |
| + return r; | |
| + } | |
| + | |
| + /** | |
| + * Implementation of hashCode. | |
| + * | |
| + * @return int hashcode | |
| + * | |
| + * @see java.lang.Object#hashCode() | |
| + */ | |
| + public int hashCode() { | |
| + int r = 1; | |
| + | |
| + if (name != null) { | |
| + r *= name.hashCode(); | |
| + } | |
| + | |
| + if (description != null) { | |
| + r *= description.hashCode(); | |
| + } | |
| + | |
| + if (plugIn != null) { | |
| + r *= plugIn.hashCode(); | |
| + } | |
| + | |
| + if (args != null) { | |
| + r *= args.hashCode(); | |
| + } | |
| + | |
| + return r; | |
| + } | |
| + | |
| + /** | |
| + * toDTO purpose. | |
| + * <p> | |
| + * Clones this config as a DTO. | |
| + * </p> | |
| + * @see java.lang.Object#clone() | |
| + * @param plugIns Map of PlugInDTO objects | |
| + * @return TestDTO | |
| + */ | |
| + public TestDTO toDTO(Map plugIns) { | |
| + TestDTO dto = new TestDTO(); | |
| + | |
| + dto.setName(name); | |
| + dto.setDescription(description); | |
| + dto.setPlugIn((PlugInDTO) plugIns.get(plugIn.getName())); | |
| + | |
| + Map myArgs = new HashMap(); | |
| + | |
| + if (this.args != null) { | |
| + Iterator i = this.args.keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + String key = (String) i.next(); | |
| + myArgs.put(key, ((ArgumentConfig) this.args.get(key)).toDTO()); | |
| + } | |
| + } | |
| + | |
| + dto.setArgs(myArgs); | |
| + | |
| + return dto; | |
| + } | |
| + | |
| + /** | |
| + * Access args property. | |
| + * | |
| + * @return Returns the args. | |
| + */ | |
| + public Map getArgs() { | |
| + return args; | |
| + } | |
| + | |
| + /** | |
| + * Set args to args. | |
| + * | |
| + * @param args The args to set. | |
| + */ | |
| + public void setArgs(Map args) { | |
| + Iterator i = args.keySet().iterator(); | |
| + | |
| + while (i.hasNext()) | |
| + | |
| + if (((ArgumentConfig) args.get(i.next())).isFinal()) { | |
| + throw new IllegalArgumentException( | |
| + "Cannot include final arguments as part of a test."); | |
| + } | |
| + | |
| + this.args = args; | |
| + } | |
| + | |
| + /** | |
| + * getArgStringValue purpose. | |
| + * <p> | |
| + * Returns a human friendly version | |
| + * </p> | |
| + * @param name | |
| + * @return | |
| + */ | |
| + public String getArgStringValue(String name) { | |
| + ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| + | |
| + if (ac == null) { | |
| + return null; | |
| + } | |
| + | |
| + return ArgHelper.getArgumentStringEncoding(ac.getValue()); | |
| + } | |
| + | |
| + /** | |
| + * getArgValue purpose. | |
| + * <p> | |
| + * Returns an Object version | |
| + * </p> | |
| + * @param name | |
| + * @return | |
| + */ | |
| + public Object getArgValue(String name) { | |
| + ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| + | |
| + if (ac == null) { | |
| + return null; | |
| + } | |
| + | |
| + return ac.getValue(); | |
| + } | |
| + | |
| + /** | |
| + * setArgStringValue purpose. | |
| + * <p> | |
| + * Stores a human friendly version. If this is a new Argument, then the type is String. | |
| + * </p> | |
| + * @param name | |
| + * @param value | |
| + * @return | |
| + */ | |
| + public boolean setArgStringValue(String name, String value) { | |
| + ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| + | |
| + if ((value == null) || value.equals("")) { | |
| + args.remove(name); | |
| + | |
| + return true; | |
| + } | |
| + | |
| + if (ac == null) { | |
| + return addArgStringValue(name, value); | |
| + } else { | |
| + if (ac.isFinal()) { | |
| + throw new IllegalArgumentException( | |
| + "Cannot include final arguments as part of a test."); | |
| + } | |
| + | |
| + StringReader sr = new StringReader(value); | |
| + | |
| + try { | |
| + ac.setValue(ArgHelper.getArgumentInstance(ArgHelper.getArgumentType(ac.getValue()), | |
| + value)); | |
| + | |
| + return true; | |
| + } catch (Exception e) { | |
| + e.printStackTrace(); | |
| + | |
| + // error, log it | |
| + return false; | |
| + } | |
| + } | |
| + } | |
| + | |
| + /** | |
| + * setArgStringValue purpose. | |
| + * <p> | |
| + * Stores a human friendly version. | |
| + * </p> | |
| + * @param name | |
| + * @param value | |
| + * @return | |
| + */ | |
| + public boolean addArgStringValue(String name, String value) { | |
| + PropertyDescriptor pd = getPropertyDescriptor(name); | |
| + | |
| + if (pd == null) { | |
| + return false; | |
| + } | |
| + | |
| + if ((value == null) || value.equals("")) { | |
| + args.remove(name); | |
| + | |
| + return false; | |
| + } | |
| + | |
| + Class cl = pd.getPropertyType(); | |
| + ArgumentConfig ac = new ArgumentConfig(); | |
| + ac.setName(name); | |
| + | |
| + try { | |
| + String argType = ArgHelper.getArgumentType(cl); | |
| + ac.setValue(ArgHelper.getArgumentInstance(argType, value)); | |
| + } catch (ValidationException e) { | |
| + // TODO Auto-generated catch block | |
| + e.printStackTrace(); | |
| + | |
| + return false; | |
| + } | |
| + | |
| + args.put(name, ac); | |
| + | |
| + return true; | |
| + } | |
| + | |
| + public Object createArg(String name, String value) | |
| + throws Exception { | |
| + PropertyDescriptor pd = getPropertyDescriptor(name); | |
| + | |
| + if (pd == null) { | |
| + return null; | |
| + } | |
| + | |
| + if ((value == null) || value.equals("")) { | |
| + return null; | |
| + } | |
| + | |
| + Class cl = pd.getPropertyType(); | |
| + | |
| + return ArgHelper.getArgumentInstance(ArgHelper.getArgumentType(cl), value); | |
| + } | |
| + | |
| + /** | |
| + * setArgStringValue purpose. | |
| + * <p> | |
| + * Stores a human friendly version | |
| + * </p> | |
| + * @param name | |
| + * @param value | |
| + * @return | |
| + */ | |
| + public boolean setArgValue(String name, Object value) { | |
| + if ((value == null) || value.equals("")) { | |
| + args.remove(name); | |
| + | |
| + return true; | |
| + } | |
| + | |
| + ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| + | |
| + if (ac == null) { | |
| + ac = new ArgumentConfig(); | |
| + ac.setName(name); | |
| + args.put(name, ac); | |
| + } | |
| + | |
| + if (ac.isFinal()) { | |
| + throw new IllegalArgumentException("Cannot include final arguments as part of a test."); | |
| + } | |
| + | |
| + ac.setValue(value); | |
| + | |
| + return true; | |
| + } | |
| + | |
| + /** | |
| + * getPropertyDescriptors purpose. | |
| + * <p> | |
| + * Get the descriptors for this plugin's map of attributes | |
| + * </p> | |
| + * @return | |
| + */ | |
| + public PropertyDescriptor[] getPropertyDescriptors() { | |
| + if (pds == null) { | |
| + PropertyDescriptor[] completeList = plugIn.getPropertyDescriptors(); | |
| + Set these = new HashSet(); | |
| + | |
| + for (int i = 0; i < completeList.length; i++) { | |
| + PropertyDescriptor property = completeList[i]; | |
| + | |
| + if (property.isHidden()) { | |
| + continue; // only for tool use | |
| + } | |
| + | |
| + if (property.isExpert()) { | |
| + continue; // limited to plugin definition | |
| + } | |
| + | |
| + if (property.getWriteMethod() == null) { | |
| + continue; // skip read-only properties | |
| + } | |
| + | |
| + if ("name".equals(property.getName())) { | |
| + continue; // not handled dynamically | |
| + } | |
| + | |
| + if ("description".equals(property.getName())) { | |
| + continue; // not handled dynamically | |
| + } | |
| + | |
| + these.add(property); | |
| + } | |
| + | |
| + Object[] ob = these.toArray(); | |
| + pds = new PropertyDescriptor[ob.length]; | |
| + | |
| + for (int i = 0; i < ob.length; i++) | |
| + pds[i] = (PropertyDescriptor) ob[i]; | |
| + } | |
| + | |
| + return pds; | |
| + } | |
| + | |
| + /** | |
| + * PropertyDescriptor purpose. | |
| + * <p> | |
| + * Get the descriptor for this plugin's attribute named | |
| + * </p> | |
| + * @param name | |
| + * @return | |
| + */ | |
| + public PropertyDescriptor getPropertyDescriptor(String name) { | |
| + if (name == null) { | |
| + throw new NullPointerException("name must be defined to get a PropertyDescriptor."); | |
| + } | |
| + | |
| + if (pds == null) { | |
| + pds = getPropertyDescriptors(); | |
| + } | |
| + | |
| + for (int i = 0; i < pds.length; i++) { | |
| + if (name.equals(pds[i].getName())) { | |
| + return pds[i]; | |
| + } | |
| + } | |
| + | |
| + return null; | |
| + } | |
| + | |
| + /** | |
| + * Access description property. | |
| + * | |
| + * @return Returns the description. | |
| + */ | |
| + public String getDescription() { | |
| + return description; | |
| + } | |
| + | |
| + /** | |
| + * Set description to description. | |
| + * | |
| + * @param description The description to set. | |
| + */ | |
| + public void setDescription(String description) { | |
| + this.description = description; | |
| + } | |
| + | |
| + /** | |
| + * Access name property. | |
| + * | |
| + * @return Returns the name. | |
| + */ | |
| + public String getName() { | |
| + return name; | |
| + } | |
| + | |
| + /** | |
| + * Set name to name. | |
| + * | |
| + * @param name The name to set. | |
| + */ | |
| + public void setName(String name) { | |
| + this.name = name; | |
| + } | |
| + | |
| + /** | |
| + * Access plugIn property. | |
| + * | |
| + * @return Returns the plugIn. | |
| + */ | |
| + public PlugInConfig getPlugIn() { | |
| + return plugIn; | |
| + } | |
| + | |
| + /** | |
| + * Set plugIn to plugIn. | |
| + * | |
| + * @param plugIn The plugIn to set. | |
| + */ | |
| + public void setPlugIn(PlugInConfig plugIn) { | |
| + this.plugIn = plugIn; | |
| + } | |
| +} | |
| diff --git a/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/TestSuiteConfig.java b/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/TestSuiteConfig.java | |
| new file mode 100644 | |
| index 0000000..c006462 | |
| --- /dev/null | |
| +++ b/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/TestSuiteConfig.java | |
| @@ -0,0 +1,252 @@ | |
| +/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| + * This code is licensed under the GPL 2.0 license, available at the root | |
| + * application directory. | |
| + */ | |
| +package org.vfny.geoserver.config.validation; | |
| + | |
| +import java.util.HashMap; | |
| +import java.util.Iterator; | |
| +import java.util.Map; | |
| + | |
| +import org.geotools.validation.dto.TestDTO; | |
| +import org.geotools.validation.dto.TestSuiteDTO; | |
| + | |
| + | |
| +/** | |
| + * TestSuiteConfig purpose. | |
| + * | |
| + * <p> | |
| + * Used to represent a copy of the config information required for the UI. | |
| + * </p> | |
| + * | |
| + * @author dzwiers, Refractions Research, Inc. | |
| + * @author $Author: dmzwiers $ (last modification) | |
| + * @version $Id$ | |
| + */ | |
| +public class TestSuiteConfig { | |
| + public static final String CONFIG_KEY = "Validation.TestSuite"; | |
| + public static final String CURRENTLY_SELECTED_KEY = "selectedTestSuite"; | |
| + | |
| + /** the test suite name */ | |
| + private String name; | |
| + | |
| + /** the test suite description */ | |
| + private String description; | |
| + | |
| + /** the list of tests - should never be null */ | |
| + private Map tests; | |
| + | |
| + /** | |
| + * TestSuiteConfig constructor. | |
| + * <p> | |
| + * Creates a blank HashMap for tests | |
| + * </p> | |
| + * | |
| + */ | |
| + public TestSuiteConfig() { | |
| + tests = new HashMap(); | |
| + } | |
| + | |
| + /** | |
| + * TestSuiteConfig constructor. | |
| + * | |
| + * <p> | |
| + * Creates a copy of the TestSuiteConfig passed in. | |
| + * </p> | |
| + * | |
| + * @param ts The Test Suite to copy | |
| + */ | |
| + public TestSuiteConfig(TestSuiteConfig ts) { | |
| + name = ts.getName(); | |
| + description = ts.getDescription(); | |
| + tests = new HashMap(); | |
| + | |
| + Iterator i = ts.getTests().keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + TestConfig t = (TestConfig) ts.getTests().get(i.next()); | |
| + tests.put(t.getName(), new TestConfig(t)); | |
| + } | |
| + } | |
| + | |
| + /** | |
| + * TestSuiteConfig constructor. | |
| + * | |
| + * <p> | |
| + * Creates a copy of the TestSuiteConfig passed in. | |
| + * </p> | |
| + * | |
| + * @param ts The Test Suite to copy | |
| + */ | |
| + public TestSuiteConfig(TestSuiteDTO ts, Map plugInConfigs) { | |
| + name = ts.getName(); | |
| + description = ts.getDescription(); | |
| + tests = new HashMap(); | |
| + | |
| + Iterator i = ts.getTests().keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + TestDTO t = (TestDTO) ts.getTests().get(i.next()); | |
| + tests.put(t.getName(), new TestConfig(t, plugInConfigs)); | |
| + } | |
| + } | |
| + | |
| + /** | |
| + * Implementation of clone. | |
| + * | |
| + * @return An instance of TestSuiteConfig. | |
| + * | |
| + * @see java.lang.Object#clone() | |
| + */ | |
| + public Object clone() { | |
| + return new TestSuiteConfig(this); | |
| + } | |
| + | |
| + public int hashCode() { | |
| + int r = 1; | |
| + | |
| + if (tests != null) { | |
| + r *= tests.hashCode(); | |
| + } | |
| + | |
| + if (name != null) { | |
| + r *= name.hashCode(); | |
| + } | |
| + | |
| + if (description != null) { | |
| + r *= description.hashCode(); | |
| + } | |
| + | |
| + return r; | |
| + } | |
| + | |
| + /** | |
| + * Implementation of equals. | |
| + * | |
| + * @param obj An object to compare for equality. | |
| + * | |
| + * @return true when the objects have the same data in the same order. | |
| + * | |
| + * @see java.lang.Object#equals(java.lang.Object) | |
| + */ | |
| + public boolean equals(Object obj) { | |
| + if ((obj == null) || !(obj instanceof TestSuiteDTO)) { | |
| + return false; | |
| + } | |
| + | |
| + boolean r = true; | |
| + TestSuiteDTO ts = (TestSuiteDTO) obj; | |
| + | |
| + if (name != null) { | |
| + r = r && (name.equals(ts.getName())); | |
| + } | |
| + | |
| + if (description != null) { | |
| + r = r && (description.equals(ts.getDescription())); | |
| + } | |
| + | |
| + if (tests == null) { | |
| + if (ts.getTests() != null) { | |
| + return false; | |
| + } | |
| + } else { | |
| + if (ts.getTests() != null) { | |
| + r = r && tests.equals(ts.getTests()); | |
| + } else { | |
| + return false; | |
| + } | |
| + } | |
| + | |
| + return r; | |
| + } | |
| + | |
| + /** | |
| + * toDTO purpose. | |
| + * <p> | |
| + * Clones this config as a DTO. | |
| + * </p> | |
| + * @see java.lang.Object#clone() | |
| + * @param plugIns Map of PlugInDTO objects | |
| + * @return TestSuiteDTO | |
| + */ | |
| + public TestSuiteDTO toDTO(Map plugIns) { | |
| + TestSuiteDTO ts = new TestSuiteDTO(); | |
| + ts.setName(name); | |
| + ts.setDescription(description); | |
| + | |
| + Map myTests = new HashMap(); | |
| + | |
| + Iterator i = this.tests.keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + TestConfig t = (TestConfig) this.tests.get(i.next()); | |
| + myTests.put(t.getName(), t.toDTO(plugIns)); | |
| + } | |
| + | |
| + ts.setTests(myTests); | |
| + | |
| + return ts; | |
| + } | |
| + | |
| + /** | |
| + * Access description property. | |
| + * | |
| + * @return Returns the description. | |
| + */ | |
| + public String getDescription() { | |
| + return description; | |
| + } | |
| + | |
| + /** | |
| + * Set description to description. | |
| + * | |
| + * @param description The description to set. | |
| + */ | |
| + public void setDescription(String description) { | |
| + this.description = description; | |
| + } | |
| + | |
| + /** | |
| + * Access name property. | |
| + * | |
| + * @return Returns the name. | |
| + */ | |
| + public String getName() { | |
| + return name; | |
| + } | |
| + | |
| + /** | |
| + * Set name to name. | |
| + * | |
| + * @param name The name to set. | |
| + */ | |
| + public void setName(String name) { | |
| + this.name = name; | |
| + } | |
| + | |
| + /** | |
| + * Access tests property. | |
| + * | |
| + * @return Returns the tests. | |
| + */ | |
| + public Map getTests() { | |
| + return tests; | |
| + } | |
| + | |
| + public Object removeTest(String name) { | |
| + return tests.remove(name); | |
| + } | |
| + | |
| + public void addTest(TestConfig test) { | |
| + tests.put(test.getName(), test); | |
| + } | |
| + | |
| + /** | |
| + * Set tests to tests. | |
| + * | |
| + * @param tests The tests to set. | |
| + */ | |
| + public void setTests(Map tests) { | |
| + this.tests = tests; | |
| + } | |
| +} | |
| diff --git a/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/ValidationConfig.java b/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/ValidationConfig.java | |
| new file mode 100644 | |
| index 0000000..2175c95 | |
| --- /dev/null | |
| +++ b/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/ValidationConfig.java | |
| @@ -0,0 +1,300 @@ | |
| +/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| + * This code is licensed under the GPL 2.0 license, available at the root | |
| + * application directory. | |
| + */ | |
| +package org.vfny.geoserver.config.validation; | |
| + | |
| +import java.util.HashMap; | |
| +import java.util.Iterator; | |
| +import java.util.Map; | |
| +import java.util.Set; | |
| + | |
| +import org.geotools.validation.dto.PlugInDTO; | |
| +import org.geotools.validation.dto.TestSuiteDTO; | |
| +import org.vfny.geoserver.global.GeoValidator; | |
| + | |
| + | |
| +/** | |
| + * ValidationConfig purpose. | |
| + * <p> | |
| + * Description of ValidationConfig ... | |
| + * </p> | |
| + * | |
| + * @author dzwiers, Refractions Research, Inc. | |
| + * @author $Author: dmzwiers $ (last modification) | |
| + * @version $Id$ | |
| + */ | |
| +public class ValidationConfig { | |
| + public static final String CONFIG_KEY = "Validation.Config"; | |
| + private Map plugIns; | |
| + private Map testSuites; | |
| + | |
| + /** | |
| + * ValidationConfig constructor. | |
| + * <p> | |
| + * Description | |
| + * </p> | |
| + * | |
| + */ | |
| + public ValidationConfig() { | |
| + super(); | |
| + plugIns = new HashMap(); | |
| + testSuites = new HashMap(); | |
| + } | |
| + | |
| + /** | |
| + * ValidationConfig constructor. | |
| + * <p> | |
| + * Description | |
| + * </p> | |
| + * @param validator GeoValidator | |
| + */ | |
| + public ValidationConfig(GeoValidator validator) { | |
| + this(validator.getPlugIns(), validator.getTestSuites()); | |
| + } | |
| + | |
| + /** | |
| + * ValidationConfig constructor. | |
| + * <p> | |
| + * Description | |
| + * </p> | |
| + * @param plugIns a List of PlugInDTO objects | |
| + * @param testSuites a List of TestSuiteDTO objects | |
| + */ | |
| + public ValidationConfig(Map plugIns, Map testSuites) { | |
| + this.plugIns = new HashMap(); | |
| + this.testSuites = new HashMap(); | |
| + | |
| + Iterator i = null; | |
| + i = plugIns.keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + PlugInDTO dto = (PlugInDTO) plugIns.get(i.next()); | |
| + PlugInConfig config = new PlugInConfig(dto); | |
| + this.plugIns.put(config.getName(), config); | |
| + } | |
| + | |
| + i = testSuites.keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + TestSuiteDTO dto = (TestSuiteDTO) testSuites.get(i.next()); | |
| + TestSuiteConfig config = new TestSuiteConfig(dto, this.plugIns); | |
| + this.testSuites.put(config.getName(), config); | |
| + } | |
| + } | |
| + | |
| + /** | |
| + * | |
| + * getPlugIn purpose. | |
| + * <p> | |
| + * Gets a PlugInConfig | |
| + * </p> | |
| + * @param name | |
| + * @return PlugInConfig or null if one does not exist | |
| + */ | |
| + public PlugInConfig getPlugIn(String name) { | |
| + if (name == null) { | |
| + return null; | |
| + } | |
| + | |
| + return (PlugInConfig) plugIns.get(name); | |
| + } | |
| + | |
| + /** | |
| + * | |
| + * getTestSuite purpose. | |
| + * <p> | |
| + * Gets a TestSuiteConfig | |
| + * </p> | |
| + * @param name | |
| + * @return TestSuiteConfig or null if one does not exist | |
| + */ | |
| + public TestSuiteConfig getTestSuite(String name) { | |
| + if (name == null) { | |
| + return null; | |
| + } | |
| + | |
| + return (TestSuiteConfig) testSuites.get(name); | |
| + } | |
| + | |
| + /** | |
| + * | |
| + * getTest purpose. | |
| + * <p> | |
| + * Gets a TestConfig | |
| + * </p> | |
| + * @param name | |
| + * @param testSuite | |
| + * @return TestSuiteConfig or null if one does not exist | |
| + */ | |
| + public TestConfig getTest(String name, String testSuite) { | |
| + if ((name == null) || (testSuite == null)) { | |
| + return null; | |
| + } | |
| + | |
| + TestSuiteConfig tcn = getTestSuite(testSuite); | |
| + | |
| + if (tcn == null) { | |
| + return null; | |
| + } | |
| + | |
| + return (TestConfig) tcn.getTests().get(name); | |
| + } | |
| + | |
| + /** | |
| + * | |
| + * addPlugIn purpose. | |
| + * <p> | |
| + * Adds the plugin. | |
| + * </p> | |
| + * @param plugIn | |
| + * @return true | |
| + */ | |
| + public boolean addPlugIn(PlugInConfig plugIn) { | |
| + plugIns.put(plugIn.getName(), plugIn); | |
| + | |
| + return true; | |
| + } | |
| + | |
| + /** | |
| + * | |
| + * addTest purpose. | |
| + * <p> | |
| + * Adds the test to the specified testSuite. | |
| + * </p> | |
| + * @param test | |
| + * @param testSuite | |
| + * @return true on sucess (requires specified plugin to exist), false otherwise. | |
| + */ | |
| + public boolean addTest(TestConfig test, String testSuite) { | |
| + TestSuiteConfig tsc = (TestSuiteConfig) testSuites.get(testSuite); | |
| + | |
| + if ((tsc != null) && plugIns.containsKey(test.getPlugIn().getName())) { | |
| + tsc.getTests().put(test.getName(), test); | |
| + | |
| + return true; | |
| + } | |
| + | |
| + return false; | |
| + } | |
| + | |
| + public boolean addTestSuite(TestSuiteConfig testSuite) { | |
| + Iterator i = testSuite.getTests().keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + TestConfig test = (TestConfig) testSuite.getTests().get(i.next()); | |
| + | |
| + if (!plugIns.containsKey(test.getPlugIn().getName())) { | |
| + return false; | |
| + } | |
| + } | |
| + | |
| + // plug ins all exist | |
| + testSuites.put(testSuite.getName(), testSuite); | |
| + | |
| + return true; | |
| + } | |
| + | |
| + public Object removeTestSuite(String name) { | |
| + return testSuites.remove(name); | |
| + } | |
| + | |
| + public Object removePlugIn(String name) { | |
| + return plugIns.remove(name); | |
| + } | |
| + | |
| + public Object removeTest(String testSuite, String name) { | |
| + return ((TestSuiteConfig) testSuites.get(testSuite)).getTests().remove(name); | |
| + } | |
| + | |
| + /** | |
| + * toDTO purpose. | |
| + * <p> | |
| + * Creates a representation as DTOs | |
| + * </p> | |
| + * @param plugIns List an empty list to store the resulting plugInDTOs | |
| + * @param testSuites List an empty list to store the resulting TestSuiteDTOs | |
| + * @return true if the lists contain the data, false otherwise. | |
| + */ | |
| + public boolean toDTO(Map plugIns, Map testSuites) { | |
| + if ((plugIns == null) || (testSuites == null)) { | |
| + return false; | |
| + } | |
| + | |
| + if ((plugIns.size() != 0) || (testSuites.size() != 0)) { | |
| + return false; | |
| + } | |
| + | |
| + // list are empty, and exist. | |
| + Iterator i = null; | |
| + i = this.plugIns.keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + PlugInDTO dto = ((PlugInConfig) this.plugIns.get(i.next())).toDTO(); | |
| + plugIns.put(dto.getName(), dto); | |
| + } | |
| + | |
| + i = this.testSuites.keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + TestSuiteDTO dto = ((TestSuiteConfig) this.testSuites.get(i.next())).toDTO(plugIns); | |
| + testSuites.put(dto.getName(), dto); | |
| + } | |
| + | |
| + return true; | |
| + } | |
| + | |
| + /** | |
| + * Access plugIns property. | |
| + * | |
| + * @return Returns the plugIns. | |
| + */ | |
| + public Map getPlugIns() { | |
| + return plugIns; | |
| + } | |
| + | |
| + /** | |
| + * Access plugIns property. | |
| + * | |
| + * @return Returns the plugIns. | |
| + */ | |
| + public Set getPlugInNames() { | |
| + return plugIns.keySet(); | |
| + } | |
| + | |
| + /** | |
| + * Set plugIns to plugIns. | |
| + * | |
| + * @param plugIns The plugIns to set. | |
| + */ | |
| + public void setPlugIns(Map plugIns) { | |
| + this.plugIns = plugIns; | |
| + } | |
| + | |
| + /** | |
| + * Access testSuites property. | |
| + * | |
| + * @return Returns the testSuites. | |
| + */ | |
| + public Map getTestSuites() { | |
| + return testSuites; | |
| + } | |
| + | |
| + /** | |
| + * Access testSuites property. | |
| + * | |
| + * @return Returns the testSuites. | |
| + */ | |
| + public Set getTestSuiteNames() { | |
| + return testSuites.keySet(); | |
| + } | |
| + | |
| + /** | |
| + * Set testSuites to testSuites. | |
| + * | |
| + * @param testSuites The testSuites to set. | |
| + */ | |
| + public void setTestSuites(Map testSuites) { | |
| + this.testSuites = testSuites; | |
| + } | |
| +} | |
| diff --git a/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/package.html b/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/package.html | |
| new file mode 100644 | |
| index 0000000..933e363 | |
| --- /dev/null | |
| +++ b/src/community/validation/src/main/java/org/vfny/geoserver/config/validation/package.html | |
| @@ -0,0 +1,47 @@ | |
| +<html> | |
| + | |
| +<head> | |
| +<title>Validation Config package</title> | |
| +</head> | |
| + | |
| +<body> | |
| +Validation Model being edited. | |
| + | |
| +<p> | |
| +This class opperates as the Validation Model and is stored in Web Container. | |
| +</p> | |
| +Details: | |
| +<ul> | |
| +<li> | |
| +Represents the Model of the STRUTS based Model-View-Controller Design | |
| +</li> | |
| +<li> | |
| +Will support additional user-interface state, beyond requirements of the | |
| +GeoServer Validation application. | |
| +</li> | |
| +<li> | |
| +Makes use of GeoTools2 and Vivid. | |
| +</li> | |
| +</ul> | |
| +<p> | |
| +Of the course of sorting this stuff out we have had a couple of bad ideas: | |
| +</p> | |
| +<ul> | |
| +<li> | |
| +It is tempting to replace a lot of these classes by changing the scope of the | |
| +FormBeans to session, rather than request. I cannot convince my self that this | |
| +would be a good idea, as storing the configuration model (and associated | |
| +resources in the Web Container) is sure to prevent duplication in the face | |
| +of multiple users configuring differnt subsystems. If the state was limited | |
| +to session - they would manage to overwrite each other with no prior warning. | |
| +</li> | |
| +<li> | |
| +It is tempting to make the Actions use the DTO objects directly (or forgo the | |
| +config classes entierly). Having the config classes allows us to make | |
| +whatever methods we need for easy, quick ui developement without breaking | |
| +the rest of the application. | |
| +</li> | |
| +</ul> | |
| +</body> | |
| + | |
| +</html> | |
| diff --git a/src/community/validation/src/main/java/org/vfny/geoserver/global/GeoValidator.java b/src/community/validation/src/main/java/org/vfny/geoserver/global/GeoValidator.java | |
| new file mode 100644 | |
| index 0000000..5cf6564 | |
| --- /dev/null | |
| +++ b/src/community/validation/src/main/java/org/vfny/geoserver/global/GeoValidator.java | |
| @@ -0,0 +1,275 @@ | |
| +/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| + * This code is licensed under the GPL 2.0 license, available at the root | |
| + * application directory. | |
| + */ | |
| +package org.vfny.geoserver.global; | |
| + | |
| +import java.io.File; | |
| +import java.util.HashMap; | |
| +import java.util.HashSet; | |
| +import java.util.Iterator; | |
| +import java.util.Map; | |
| +import java.util.Set; | |
| +import java.util.logging.Level; | |
| + | |
| +import org.geoserver.platform.GeoServerResourceLoader; | |
| +import org.geotools.validation.FeatureValidation; | |
| +import org.geotools.validation.IntegrityValidation; | |
| +import org.geotools.validation.PlugIn; | |
| +import org.geotools.validation.Validation; | |
| +import org.geotools.validation.ValidationProcessor; | |
| +import org.geotools.validation.dto.ArgumentDTO; | |
| +import org.geotools.validation.dto.PlugInDTO; | |
| +import org.geotools.validation.dto.TestDTO; | |
| +import org.geotools.validation.dto.TestSuiteDTO; | |
| +import org.geotools.validation.xml.ValidationException; | |
| +import org.geotools.validation.xml.XMLReader; | |
| + | |
| + | |
| +/** | |
| + * GeoValidator purpose. | |
| + * <p> | |
| + * Description of GeoValidator ... | |
| + * </p> | |
| + * | |
| + * @author dzwiers, Refractions Research, Inc. | |
| + * @author $Author: jive $ (last modification) | |
| + * @version $Id$ | |
| + */ | |
| +public class GeoValidator extends ValidationProcessor { | |
| + public static final String WEB_CONTAINER_KEY = "GeoValidator"; | |
| + | |
| + /** | |
| + * GeoValidator constructor. | |
| + * <p> | |
| + * super(); | |
| + * </p> | |
| + * | |
| + */ | |
| + public GeoValidator() { | |
| + super(); | |
| + } | |
| + | |
| + /** | |
| + * Creates a new geo validator. | |
| + * | |
| + * @param config The configuration module. | |
| + */ | |
| + public GeoValidator(GeoServerResourceLoader resourceLoader) { | |
| + loadPlugins(resourceLoader); | |
| + } | |
| + | |
| + /** | |
| + * Loads validations plugins. | |
| + * | |
| + * @param dataDir The data directory. | |
| + */ | |
| + protected void loadPlugins(GeoServerResourceLoader loader) { | |
| + Map plugIns = null; | |
| + Map testSuites = null; | |
| + | |
| + try { | |
| + File plugInDir = loader.get("plugIns").dir(); | |
| + File validationDir = loader.get("validation").dir(); | |
| + if (plugInDir != null && plugInDir.exists()) { | |
| + plugIns = XMLReader.loadPlugIns(plugInDir); | |
| + | |
| + if (validationDir != null && validationDir.exists()) { | |
| + testSuites = XMLReader.loadValidations(validationDir, plugIns); | |
| + } | |
| + } | |
| + } catch (Exception e) { | |
| + org.geotools.util.logging.Logging.getLogger("org.vfny.geoserver.global").log(Level.WARNING, "loading plugins", e); | |
| + } | |
| + | |
| + if(testSuites == null) | |
| + testSuites = new HashMap(); | |
| + if(plugIns == null) | |
| + plugIns = new HashMap(); | |
| + | |
| + load(testSuites, plugIns); | |
| + } | |
| + | |
| + /** | |
| + * ValidationProcessor constructor. | |
| + * | |
| + * <p> | |
| + * Builds a ValidationProcessor with the DTO provided. | |
| + * </p> | |
| + * | |
| + * @see load(Map,Map) | |
| + * @param testSuites Map a map of names -> TestSuiteDTO objects | |
| + * @param plugIns Map a map of names -> PlugInDTO objects | |
| + */ | |
| + public GeoValidator(Map testSuites, Map plugIns) { | |
| + super(); | |
| + load(testSuites, plugIns); | |
| + } | |
| + | |
| + private Map testSuites; | |
| + private Map plugIns; | |
| + private Map errors; | |
| + | |
| + /** | |
| + * Map of errors encountered during loading process | |
| + * <p> | |
| + * Map of true (loaded), false (never used), or exception (error) keyed | |
| + * by PlugIn and Test DataTransferObjects. | |
| + * </p> | |
| + * @return Map of status by PlugInDTO and TestDTO | |
| + */ | |
| + public Map getErrors() { | |
| + return errors; | |
| + } | |
| + | |
| + /** | |
| + * load purpose. | |
| + * <p> | |
| + * loads this instance data into this instance. | |
| + * </p> | |
| + * @param testSuites | |
| + * @param plugIns | |
| + */ | |
| + public void load(Map testSuites, Map plugIns) { | |
| + this.plugIns = plugIns; | |
| + this.testSuites = testSuites; | |
| + errors = new HashMap(); | |
| + | |
| + // step 1 make a list required plug-ins | |
| + Set plugInNames = new HashSet(); | |
| + Iterator i = testSuites.keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + TestSuiteDTO dto = (TestSuiteDTO) testSuites.get(i.next()); | |
| + Iterator j = dto.getTests().keySet().iterator(); | |
| + | |
| + while (j.hasNext()) { | |
| + TestDTO tdto = (TestDTO) dto.getTests().get(j.next()); | |
| + plugInNames.add(tdto.getPlugIn().getName()); | |
| + } | |
| + } | |
| + | |
| + // Mark all plug-ins as not loaded | |
| + // | |
| + i = plugIns.values().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + PlugInDTO dto = (PlugInDTO) i.next(); | |
| + errors.put(dto, Boolean.FALSE); | |
| + } | |
| + | |
| + // step 2 configure plug-ins with defaults | |
| + Map defaultPlugIns = new HashMap(plugInNames.size()); | |
| + i = plugInNames.iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + String plugInName = (String) i.next(); | |
| + PlugInDTO dto = (PlugInDTO) plugIns.get(plugInName); | |
| + Class plugInClass = null; | |
| + | |
| + try { | |
| + plugInClass = Class.forName(dto.getClassName()); | |
| + } catch (ClassNotFoundException e) { | |
| + //Error, using default. | |
| + errors.put(dto, e); | |
| + e.printStackTrace(); | |
| + } | |
| + | |
| + if (plugInClass == null) { | |
| + plugInClass = Validation.class; | |
| + } | |
| + | |
| + Map plugInArgs = dto.getArgs(); | |
| + | |
| + if (plugInArgs == null) { | |
| + plugInArgs = new HashMap(); | |
| + } | |
| + | |
| + try { | |
| + PlugIn plugIn = new org.geotools.validation.PlugIn(plugInName, plugInClass, | |
| + dto.getDescription(), plugInArgs); | |
| + defaultPlugIns.put(plugInName, plugIn); | |
| + } catch (ValidationException e) { | |
| + e.printStackTrace(); | |
| + // Update dto entry w/ an error? | |
| + errors.put(dto, e); | |
| + | |
| + continue; | |
| + } | |
| + | |
| + // mark dto entry as a success | |
| + errors.put(dto, Boolean.TRUE); | |
| + } | |
| + | |
| + // step 3 configure plug-ins with tests + add to processor | |
| + i = testSuites.keySet().iterator(); | |
| + | |
| + while (i.hasNext()) { | |
| + TestSuiteDTO tdto = (TestSuiteDTO) testSuites.get(i.next()); | |
| + Iterator j = tdto.getTests().keySet().iterator(); | |
| + | |
| + while (j.hasNext()) { | |
| + TestDTO dto = (TestDTO) tdto.getTests().get(j.next()); | |
| + | |
| + // deal with test | |
| + Map testArgs = dto.getArgs(); | |
| + | |
| + if (testArgs == null) { | |
| + testArgs = new HashMap(); | |
| + } else { | |
| + Map m = new HashMap(); | |
| + Iterator k = testArgs.keySet().iterator(); | |
| + | |
| + while (k.hasNext()) { | |
| + ArgumentDTO adto = (ArgumentDTO) testArgs.get(k.next()); | |
| + m.put(adto.getName(), adto.getValue()); | |
| + } | |
| + | |
| + testArgs = m; | |
| + } | |
| + | |
| + try { | |
| + PlugIn plugIn = (org.geotools.validation.PlugIn) defaultPlugIns.get(dto.getPlugIn() | |
| + .getName()); | |
| + Validation validation = plugIn.createValidation(dto.getName(), | |
| + dto.getDescription(), testArgs); | |
| + | |
| + if (validation instanceof FeatureValidation) { | |
| + addValidation((FeatureValidation) validation); | |
| + } | |
| + | |
| + if (validation instanceof IntegrityValidation) { | |
| + addValidation((IntegrityValidation) validation); | |
| + } | |
| + } catch (ValidationException e) { | |
| + e.printStackTrace(); | |
| + // place test error under the plugIn DTO that spawned it | |
| + errors.put(dto, e); | |
| + | |
| + //error should log here | |
| + continue; | |
| + } | |
| + | |
| + errors.put(dto, Boolean.TRUE); | |
| + } | |
| + | |
| + errors.put(tdto, Boolean.TRUE); | |
| + } | |
| + } | |
| + | |
| + public Object toPlugInDTO() { | |
| + return plugIns; | |
| + } | |
| + | |
| + public Object toTestSuiteDTO() { | |
| + return testSuites; | |
| + } | |
| + | |
| + public Map getPlugIns() { | |
| + return plugIns; | |
| + } | |
| + | |
| + public Map getTestSuites() { | |
| + return testSuites; | |
| + } | |
| +} | |
| diff --git a/src/community/w3ds/pom.xml b/src/community/w3ds/pom.xml | |
| index 4c2ba90..3be7c3e 100644 | |
| --- a/src/community/w3ds/pom.xml | |
| +++ b/src/community/w3ds/pom.xml | |
| @@ -5,7 +5,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-w3ds</artifactId> | |
| diff --git a/src/community/wfs-notification/pom.xml b/src/community/wfs-notification/pom.xml | |
| index ee6de6a..c9df7dd 100755 | |
| --- a/src/community/wfs-notification/pom.xml | |
| +++ b/src/community/wfs-notification/pom.xml | |
| @@ -10,7 +10,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| diff --git a/src/community/wms-eo/pom.xml b/src/community/wms-eo/pom.xml | |
| index 303e4da..a5c663e 100644 | |
| --- a/src/community/wms-eo/pom.xml | |
| +++ b/src/community/wms-eo/pom.xml | |
| @@ -6,7 +6,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>community</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| diff --git a/src/community/wps-sextante/pom.xml b/src/community/wps-sextante/pom.xml | |
| index 8067fb3..b140cd2 100644 | |
| --- a/src/community/wps-sextante/pom.xml | |
| +++ b/src/community/wps-sextante/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-wps</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.community</groupId> | |
| diff --git a/src/extension/app-schema/app-schema-oracle-test/pom.xml b/src/extension/app-schema/app-schema-oracle-test/pom.xml | |
| index 3160a47..fb4d14e 100644 | |
| --- a/src/extension/app-schema/app-schema-oracle-test/pom.xml | |
| +++ b/src/extension/app-schema/app-schema-oracle-test/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-app-schema</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/app-schema/app-schema-postgis-test/pom.xml b/src/extension/app-schema/app-schema-postgis-test/pom.xml | |
| index 94cc03c..9a9596c 100644 | |
| --- a/src/extension/app-schema/app-schema-postgis-test/pom.xml | |
| +++ b/src/extension/app-schema/app-schema-postgis-test/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-app-schema</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/app-schema/app-schema-test/pom.xml b/src/extension/app-schema/app-schema-test/pom.xml | |
| index 651249a..97fda43 100644 | |
| --- a/src/extension/app-schema/app-schema-test/pom.xml | |
| +++ b/src/extension/app-schema/app-schema-test/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-app-schema</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/app-schema/pom.xml b/src/extension/app-schema/pom.xml | |
| index 48c289d..3cf49ae 100644 | |
| --- a/src/extension/app-schema/pom.xml | |
| +++ b/src/extension/app-schema/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/app-schema/sample-data-access-test/pom.xml b/src/extension/app-schema/sample-data-access-test/pom.xml | |
| index 4f3bc42..54f8e3b 100644 | |
| --- a/src/extension/app-schema/sample-data-access-test/pom.xml | |
| +++ b/src/extension/app-schema/sample-data-access-test/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-app-schema</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/arcsde/pom.xml b/src/extension/arcsde/pom.xml | |
| index 1a7ed20..138c863 100644 | |
| --- a/src/extension/arcsde/pom.xml | |
| +++ b/src/extension/arcsde/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/charts/pom.xml b/src/extension/charts/pom.xml | |
| index c943437..042db45 100644 | |
| --- a/src/extension/charts/pom.xml | |
| +++ b/src/extension/charts/pom.xml | |
| @@ -3,7 +3,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <modelVersion>4.0.0</modelVersion> | |
| diff --git a/src/extension/control-flow/pom.xml b/src/extension/control-flow/pom.xml | |
| index 4d8857c..0e29bce 100644 | |
| --- a/src/extension/control-flow/pom.xml | |
| +++ b/src/extension/control-flow/pom.xml | |
| @@ -10,11 +10,11 @@ | |
| <parent> | |
| <artifactId>extension</artifactId> | |
| <groupId>org.geoserver</groupId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-control-flow</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>OWS request flow controller</name> | |
| <dependencies> | |
| <dependency> | |
| diff --git a/src/extension/css/pom.xml b/src/extension/css/pom.xml | |
| index f7a0d40..104ac31 100644 | |
| --- a/src/extension/css/pom.xml | |
| +++ b/src/extension/css/pom.xml | |
| @@ -3,12 +3,12 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-css</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer CSS Styling</name> | |
| <repositories> | |
| diff --git a/src/extension/csw/api/pom.xml b/src/extension/csw/api/pom.xml | |
| index a91aa34..a785ed2 100644 | |
| --- a/src/extension/csw/api/pom.xml | |
| +++ b/src/extension/csw/api/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-csw</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.csw</groupId> | |
| diff --git a/src/extension/csw/core/pom.xml b/src/extension/csw/core/pom.xml | |
| index ff1d455..e41a40f 100644 | |
| --- a/src/extension/csw/core/pom.xml | |
| +++ b/src/extension/csw/core/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-csw</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.csw</groupId> | |
| diff --git a/src/extension/csw/pom.xml b/src/extension/csw/pom.xml | |
| index 008df8e..384362d 100644 | |
| --- a/src/extension/csw/pom.xml | |
| +++ b/src/extension/csw/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| @@ -24,7 +24,7 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| </dependencies> | |
| diff --git a/src/extension/csw/simple-store/pom.xml b/src/extension/csw/simple-store/pom.xml | |
| index 4b14146..bd27be3 100644 | |
| --- a/src/extension/csw/simple-store/pom.xml | |
| +++ b/src/extension/csw/simple-store/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-csw</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.csw</groupId> | |
| diff --git a/src/extension/csw/web-csw/pom.xml b/src/extension/csw/web-csw/pom.xml | |
| index e963697..af98c56 100644 | |
| --- a/src/extension/csw/web-csw/pom.xml | |
| +++ b/src/extension/csw/web-csw/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-csw</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.csw</groupId> | |
| <artifactId>gs-web-csw</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>CSW UI Module</name> | |
| <dependencies> | |
| diff --git a/src/extension/db2/pom.xml b/src/extension/db2/pom.xml | |
| index ef1a8ff..38fee08 100644 | |
| --- a/src/extension/db2/pom.xml | |
| +++ b/src/extension/db2/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/dxf/core/pom.xml b/src/extension/dxf/core/pom.xml | |
| index ab1479d..1a5a92c 100644 | |
| --- a/src/extension/dxf/core/pom.xml | |
| +++ b/src/extension/dxf/core/pom.xml | |
| @@ -13,13 +13,13 @@ | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-dxf</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-dxf-core</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>DXF WFS output format</name> | |
| <dependencies> | |
| diff --git a/src/extension/dxf/pom.xml b/src/extension/dxf/pom.xml | |
| index 7a13cd9..dad2762 100644 | |
| --- a/src/extension/dxf/pom.xml | |
| +++ b/src/extension/dxf/pom.xml | |
| @@ -13,13 +13,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-dxf</artifactId> | |
| <packaging>pom</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>DXF WFS output format and WPS PPIO</name> | |
| <modules> | |
| diff --git a/src/extension/dxf/wps/pom.xml b/src/extension/dxf/wps/pom.xml | |
| index 64d468c..baaff70 100644 | |
| --- a/src/extension/dxf/wps/pom.xml | |
| +++ b/src/extension/dxf/wps/pom.xml | |
| @@ -13,13 +13,13 @@ | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-dxf</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-dxf-wps</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>DXF WPS PPIO</name> | |
| <dependencies> | |
| diff --git a/src/extension/excel/pom.xml b/src/extension/excel/pom.xml | |
| index d1ff4a2..54dff7a 100644 | |
| --- a/src/extension/excel/pom.xml | |
| +++ b/src/extension/excel/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <modelVersion>4.0.0</modelVersion> | |
| diff --git a/src/extension/feature-pregeneralized/pom.xml b/src/extension/feature-pregeneralized/pom.xml | |
| index 9af9782..e58b032 100644 | |
| --- a/src/extension/feature-pregeneralized/pom.xml | |
| +++ b/src/extension/feature-pregeneralized/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-feature-pregeneralized</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>Feature Generalization Extension</name> | |
| <dependencies> | |
| diff --git a/src/extension/gdal/pom.xml b/src/extension/gdal/pom.xml | |
| index db44053..d5f4b3d 100644 | |
| --- a/src/extension/gdal/pom.xml | |
| +++ b/src/extension/gdal/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/geosearch/pom.xml b/src/extension/geosearch/pom.xml | |
| index 3200157..87273ba 100644 | |
| --- a/src/extension/geosearch/pom.xml | |
| +++ b/src/extension/geosearch/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| @@ -23,27 +23,27 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-rest</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-core</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-kml</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <classifier>tests</classifier> | |
| <scope>test</scope> | |
| </dependency> | |
| diff --git a/src/extension/h2/pom.xml b/src/extension/h2/pom.xml | |
| index 360c481..53691c6 100644 | |
| --- a/src/extension/h2/pom.xml | |
| +++ b/src/extension/h2/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/imagemap/pom.xml b/src/extension/imagemap/pom.xml | |
| index 80f1db1..cad08dd 100644 | |
| --- a/src/extension/imagemap/pom.xml | |
| +++ b/src/extension/imagemap/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/imagemosaic-jdbc/pom.xml b/src/extension/imagemosaic-jdbc/pom.xml | |
| index c798a60..aa89e66 100644 | |
| --- a/src/extension/imagemosaic-jdbc/pom.xml | |
| +++ b/src/extension/imagemosaic-jdbc/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/importer/bdb/pom.xml b/src/extension/importer/bdb/pom.xml | |
| index b946ee6..8d2910a 100644 | |
| --- a/src/extension/importer/bdb/pom.xml | |
| +++ b/src/extension/importer/bdb/pom.xml | |
| @@ -7,7 +7,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-importer</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.importer</groupId> | |
| diff --git a/src/extension/importer/core/pom.xml b/src/extension/importer/core/pom.xml | |
| index 3523fec..f7a8c0f 100644 | |
| --- a/src/extension/importer/core/pom.xml | |
| +++ b/src/extension/importer/core/pom.xml | |
| @@ -7,7 +7,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-importer</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.importer</groupId> | |
| diff --git a/src/extension/importer/pom.xml b/src/extension/importer/pom.xml | |
| index c91e0ef..cb204e7 100644 | |
| --- a/src/extension/importer/pom.xml | |
| +++ b/src/extension/importer/pom.xml | |
| @@ -7,7 +7,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/extension/importer/rest/pom.xml b/src/extension/importer/rest/pom.xml | |
| index 9f6b497..fa9b0c7 100644 | |
| --- a/src/extension/importer/rest/pom.xml | |
| +++ b/src/extension/importer/rest/pom.xml | |
| @@ -7,7 +7,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-importer</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.importer</groupId> | |
| diff --git a/src/extension/importer/web/pom.xml b/src/extension/importer/web/pom.xml | |
| index a887f7a..2a71b45 100644 | |
| --- a/src/extension/importer/web/pom.xml | |
| +++ b/src/extension/importer/web/pom.xml | |
| @@ -7,7 +7,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-importer</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.importer</groupId> | |
| diff --git a/src/extension/inspire/pom.xml b/src/extension/inspire/pom.xml | |
| index c5ff95a..e27feca 100644 | |
| --- a/src/extension/inspire/pom.xml | |
| +++ b/src/extension/inspire/pom.xml | |
| @@ -5,13 +5,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-inspire</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer INSPIRE Extensions</name> | |
| <dependencies> | |
| diff --git a/src/extension/jp2k/pom.xml b/src/extension/jp2k/pom.xml | |
| index f2538f3..b9e8aed 100644 | |
| --- a/src/extension/jp2k/pom.xml | |
| +++ b/src/extension/jp2k/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/libjpeg-turbo/pom.xml b/src/extension/libjpeg-turbo/pom.xml | |
| index dcf4452..969c626 100644 | |
| --- a/src/extension/libjpeg-turbo/pom.xml | |
| +++ b/src/extension/libjpeg-turbo/pom.xml | |
| @@ -7,13 +7,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-libjpeg-turbo</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer libjpeg-turbo Module</name> | |
| <properties> | |
| diff --git a/src/extension/monitor/core/pom.xml b/src/extension/monitor/core/pom.xml | |
| index f687121..10f7f06 100644 | |
| --- a/src/extension/monitor/core/pom.xml | |
| +++ b/src/extension/monitor/core/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-monitor</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-monitor-core</artifactId> | |
| @@ -20,22 +20,22 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-rest</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-core</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-wms</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>com.maxmind</groupId> | |
| diff --git a/src/extension/monitor/hibernate/pom.xml b/src/extension/monitor/hibernate/pom.xml | |
| index 66338b1..816e76d 100644 | |
| --- a/src/extension/monitor/hibernate/pom.xml | |
| +++ b/src/extension/monitor/hibernate/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-monitor</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/monitor/pom.xml b/src/extension/monitor/pom.xml | |
| index 3428ed6..9354f75 100644 | |
| --- a/src/extension/monitor/pom.xml | |
| +++ b/src/extension/monitor/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-monitor</artifactId> | |
| @@ -26,26 +26,26 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <scope>test</scope> | |
| <classifier>tests</classifier> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-wfs</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <scope>test</scope> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-wcs1_0</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <scope>test</scope> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-wcs1_1</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <scope>test</scope> | |
| </dependency> | |
| <dependency> | |
| diff --git a/src/extension/mysql/pom.xml b/src/extension/mysql/pom.xml | |
| index 9e0ac80..ff7e1d7 100644 | |
| --- a/src/extension/mysql/pom.xml | |
| +++ b/src/extension/mysql/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/ogr/pom.xml b/src/extension/ogr/pom.xml | |
| index 6280a93..848206a 100644 | |
| --- a/src/extension/ogr/pom.xml | |
| +++ b/src/extension/ogr/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/oracle/pom.xml b/src/extension/oracle/pom.xml | |
| index 74aefa8..bf2adc2 100644 | |
| --- a/src/extension/oracle/pom.xml | |
| +++ b/src/extension/oracle/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/pom.xml b/src/extension/pom.xml | |
| index 8803b05..9a100d9 100644 | |
| --- a/src/extension/pom.xml | |
| +++ b/src/extension/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| @@ -163,13 +163,6 @@ | |
| </profile> | |
| <profile> | |
| - <id>validation</id> | |
| - <modules> | |
| - <module>validation</module> | |
| - </modules> | |
| - </profile> | |
| - | |
| - <profile> | |
| <id>charts</id> | |
| <modules> | |
| <module>charts</module> | |
| @@ -310,7 +303,6 @@ | |
| <module>jp2k</module> | |
| <module>ogr</module> | |
| <module>excel</module> | |
| - <module>validation</module> | |
| <module>charts</module> | |
| <module>feature-pregeneralized</module> | |
| <module>imagemosaic-jdbc</module> | |
| @@ -349,7 +341,6 @@ | |
| <module>jp2k</module> | |
| <module>ogr</module> | |
| <module>excel</module> | |
| - <module>validation</module> | |
| <module>charts</module> | |
| <module>feature-pregeneralized</module> | |
| <module>imagemosaic-jdbc</module> | |
| diff --git a/src/extension/printing/pom.xml b/src/extension/printing/pom.xml | |
| index a2a9f47..d310b0f 100644 | |
| --- a/src/extension/printing/pom.xml | |
| +++ b/src/extension/printing/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-printing</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>Printing Module</name> | |
| <dependencies> | |
| diff --git a/src/extension/querylayer/pom.xml b/src/extension/querylayer/pom.xml | |
| index d6cb763..23b3fa3 100644 | |
| --- a/src/extension/querylayer/pom.xml | |
| +++ b/src/extension/querylayer/pom.xml | |
| @@ -10,7 +10,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-querylayer</artifactId> | |
| diff --git a/src/extension/security/cas/pom.xml b/src/extension/security/cas/pom.xml | |
| index 827c527..662db0c 100644 | |
| --- a/src/extension/security/cas/pom.xml | |
| +++ b/src/extension/security/cas/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-security</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.security</groupId> | |
| <artifactId>gs-sec-cas</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer CAS Security Module</name> | |
| <dependencies> | |
| diff --git a/src/extension/security/pom.xml b/src/extension/security/pom.xml | |
| index 7a393eb..2c974c8 100644 | |
| --- a/src/extension/security/pom.xml | |
| +++ b/src/extension/security/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-security</artifactId> | |
| <packaging>pom</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer Security Extension Modules</name> | |
| <dependencies> | |
| diff --git a/src/extension/security/web/pom.xml b/src/extension/security/web/pom.xml | |
| index 9191296..490cf75 100644 | |
| --- a/src/extension/security/web/pom.xml | |
| +++ b/src/extension/security/web/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-security</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-web-sec</artifactId> | |
| <packaging>pom</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer Security Extension Web Modules</name> | |
| <profiles> | |
| diff --git a/src/extension/security/web/web-cas/pom.xml b/src/extension/security/web/web-cas/pom.xml | |
| index c6cbd35..142739b 100644 | |
| --- a/src/extension/security/web/web-cas/pom.xml | |
| +++ b/src/extension/security/web/web-cas/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-web-sec</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.security</groupId> | |
| <artifactId>gs-web-sec-cas</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer CAS Security Web Module</name> | |
| <dependencies> | |
| diff --git a/src/extension/sqlserver/pom.xml b/src/extension/sqlserver/pom.xml | |
| index 5cc1e0f..91973e4 100644 | |
| --- a/src/extension/sqlserver/pom.xml | |
| +++ b/src/extension/sqlserver/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/teradata/pom.xml b/src/extension/teradata/pom.xml | |
| index 45089be..cd70bb8 100644 | |
| --- a/src/extension/teradata/pom.xml | |
| +++ b/src/extension/teradata/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/validation/pom.xml b/src/extension/validation/pom.xml | |
| deleted file mode 100644 | |
| index 619e775..0000000 | |
| --- a/src/extension/validation/pom.xml | |
| +++ /dev/null | |
| @@ -1,30 +0,0 @@ | |
| -<?xml version="1.0" encoding="ISO-8859-1"?> | |
| -<!-- | |
| - Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| - This code is licensed under the GPL 2.0 license, available at the root | |
| - application directory. | |
| - --> | |
| -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
| - <modelVersion>4.0.0</modelVersion> | |
| - | |
| - <parent> | |
| - <groupId>org.geoserver</groupId> | |
| - <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| - </parent> | |
| - | |
| - <groupId>org.geoserver.extension</groupId> | |
| - <artifactId>gs-validation</artifactId> | |
| - <packaging>jar</packaging> | |
| - <name>Validation Module</name> | |
| - | |
| - <dependencies> | |
| - <dependency> | |
| - <groupId>org.geoserver</groupId> | |
| - <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| - </dependency> | |
| - </dependencies> | |
| - | |
| -</project> | |
| diff --git a/src/extension/validation/src/main/java/applicationContext.xml b/src/extension/validation/src/main/java/applicationContext.xml | |
| deleted file mode 100644 | |
| index 324244c..0000000 | |
| --- a/src/extension/validation/src/main/java/applicationContext.xml | |
| +++ /dev/null | |
| @@ -1,36 +0,0 @@ | |
| -<?xml version="1.0" encoding="UTF-8"?> | |
| -<!-- | |
| - Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| - This code is licensed under the GPL 2.0 license, available at the root | |
| - application directory. | |
| - --> | |
| -<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> | |
| -<beans> | |
| - | |
| - <!-- validation module --> | |
| - <bean id="validation" | |
| - class="org.vfny.geoserver.global.GeoValidator"> | |
| - <constructor-arg ref="resourceLoader"/> | |
| - </bean> | |
| - <bean id="validationConfig" | |
| - class="org.vfny.geoserver.config.validation.ValidationConfig"> | |
| - <constructor-arg ref="validation"/> | |
| - </bean> | |
| - | |
| - <!-- this registers the above beans with the servlet context | |
| - it is around to keep the struts app happy as we move away from | |
| - servlets --> | |
| - <bean id="validationRegisterar" | |
| - class="org.vfny.geoserver.global.GeoServerServletContextInitializer"> | |
| - | |
| - <constructor-arg type="java.lang.String" value="GeoValidator"/> | |
| - <constructor-arg ref="validation"/> | |
| - </bean> | |
| - <bean id="validationConfigRegisterar" | |
| - class="org.vfny.geoserver.global.GeoServerServletContextInitializer"> | |
| - | |
| - <constructor-arg type="java.lang.String" value="Validation.Config"/> | |
| - <constructor-arg ref="validationConfig"/> | |
| - </bean> | |
| - | |
| -</beans> | |
| diff --git a/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/ArgumentConfig.java b/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/ArgumentConfig.java | |
| deleted file mode 100644 | |
| index 6269549..0000000 | |
| --- a/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/ArgumentConfig.java | |
| +++ /dev/null | |
| @@ -1,230 +0,0 @@ | |
| -/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| - * This code is licensed under the GPL 2.0 license, available at the root | |
| - * application directory. | |
| - */ | |
| -package org.vfny.geoserver.config.validation; | |
| - | |
| -import java.beans.Introspector; | |
| -import java.beans.PropertyDescriptor; | |
| -import java.util.List; | |
| -import java.util.Locale; | |
| - | |
| -import org.geotools.validation.dto.ArgumentDTO; | |
| - | |
| - | |
| -/** | |
| - * ArgumentConfig purpose. | |
| - * <p> | |
| - * Description of ArgumentConfig ... | |
| - * </p> | |
| - * | |
| - * @author dzwiers, Refractions Research, Inc. | |
| - * @author $Author: dmzwiers $ (last modification) | |
| - * @version $Id$ | |
| - */ | |
| -public class ArgumentConfig { | |
| - private String name; | |
| - private boolean _final; | |
| - private Object value; | |
| - | |
| - /** | |
| - * ArgumentConfig constructor. | |
| - * <p> | |
| - * Description | |
| - * </p> | |
| - * | |
| - */ | |
| - public ArgumentConfig() { | |
| - } | |
| - | |
| - public ArgumentConfig(ArgumentConfig dto) { | |
| - name = dto.getName(); | |
| - _final = isFinal(); | |
| - value = dto.getValue(); | |
| - } | |
| - | |
| - public ArgumentConfig(ArgumentDTO dto) { | |
| - name = dto.getName(); | |
| - _final = isFinal(); | |
| - value = dto.getValue(); | |
| - } | |
| - | |
| - public Object clone() { | |
| - return new ArgumentConfig(this); | |
| - } | |
| - | |
| - public boolean equals(Object obj) { | |
| - boolean r = true; | |
| - | |
| - if ((obj == null) || !(obj instanceof ArgumentConfig)) { | |
| - return false; | |
| - } | |
| - | |
| - ArgumentConfig dto = (ArgumentConfig) obj; | |
| - r = r && (dto.isFinal() == _final); | |
| - | |
| - if (name != null) { | |
| - r = r && (name.equals(dto.getName())); | |
| - } else if (dto.getName() != null) { | |
| - return false; | |
| - } | |
| - | |
| - if (value != null) { | |
| - r = r && (value.equals(dto.getValue())); | |
| - } else if (dto.getValue() != null) { | |
| - return false; | |
| - } | |
| - | |
| - return r; | |
| - } | |
| - | |
| - public int hashCode() { | |
| - int r = 1; | |
| - | |
| - if (name != null) { | |
| - r *= name.hashCode(); | |
| - } | |
| - | |
| - if (value != null) { | |
| - r *= value.hashCode(); | |
| - } | |
| - | |
| - return r; | |
| - } | |
| - | |
| - public ArgumentDTO toDTO() { | |
| - ArgumentDTO dto = new ArgumentDTO(); | |
| - dto.setFinal(_final); | |
| - dto.setName(name); | |
| - dto.setValue(value); | |
| - | |
| - return dto; | |
| - } | |
| - | |
| - /** | |
| - * Access _final property. | |
| - * | |
| - * @return Returns the _final. | |
| - */ | |
| - public boolean isFinal() { | |
| - return _final; | |
| - } | |
| - | |
| - /** | |
| - * Set _final to _final. | |
| - * | |
| - * @param _final The _final to set. | |
| - */ | |
| - public void setFinal(boolean _final) { | |
| - this._final = _final; | |
| - } | |
| - | |
| - /** | |
| - * Access name property. | |
| - * | |
| - * @return Returns the name. | |
| - */ | |
| - public String getName() { | |
| - return name; | |
| - } | |
| - | |
| - /** | |
| - * Set name to name. | |
| - * | |
| - * @param name The name to set. | |
| - */ | |
| - public void setName(String name) { | |
| - this.name = name; | |
| - } | |
| - | |
| - /** | |
| - * Access value property. | |
| - * | |
| - * @return Returns the value. | |
| - */ | |
| - public Object getValue() { | |
| - return value; | |
| - } | |
| - | |
| - /** | |
| - * Set value to value. | |
| - * | |
| - * @param value The value to set. | |
| - */ | |
| - public void setValue(Object value) { | |
| - if (value == null) { | |
| - throw new NullPointerException("value should only be set when it has a value"); | |
| - } | |
| - | |
| - this.value = value; | |
| - } | |
| - | |
| - /** | |
| - * | |
| - * getDisplayName purpose. | |
| - * <p> | |
| - * This is used to provide the locale to the property descriptor if it is required. This method is thread safe. | |
| - * </p> | |
| - * <p> | |
| - * This method must be both synchornized and static. The global locale is maintained from start to completion of execution, even when an unexpected exception occurs. | |
| - * </p> | |
| - * @param pd PropertyDescriptor to get the display name from | |
| - * @param locale Locale to use if required. | |
| - * @return String the Display Name | |
| - */ | |
| - public static synchronized String getDisplayName(PropertyDescriptor pd) { | |
| - String r = ""; | |
| - | |
| - try { // to safely reset the locale. | |
| - r = pd.getDisplayName(); | |
| - } finally { | |
| - } | |
| - | |
| - return r; | |
| - } | |
| - | |
| - public static synchronized void loadPropertyLists(TestConfig testConfig, Locale lc, | |
| - List attributeKeys, List attributeHelps, List attributeValues) { | |
| - if (!lc.equals(Locale.getDefault())) { | |
| - Locale.setDefault(lc); | |
| - Introspector.flushCaches(); | |
| - } | |
| - | |
| - PropertyDescriptor[] pd = testConfig.getPropertyDescriptors(); | |
| - | |
| - for (int i = 0; i < pd.length; i++) { | |
| - PropertyDescriptor property = pd[i]; | |
| - String propertyName = property.getName(); | |
| - String displayName = ArgumentConfig.getDisplayName(property); | |
| - String description = ArgumentConfig.getDescription(property); | |
| - | |
| - attributeKeys.add(propertyName); | |
| - attributeHelps.add(description); | |
| - attributeValues.add(testConfig.getArgStringValue(propertyName)); | |
| - } | |
| - } | |
| - | |
| - /** | |
| - * | |
| - * getDescription purpose. | |
| - * <p> | |
| - * This is used to provide the locale to the property descriptor if it is required. This method is thread safe. | |
| - * </p> | |
| - * <p> | |
| - * This method must be both synchornized and static. | |
| - * </p> | |
| - * @param pd PropertyDescriptor to get the display description from | |
| - * @param locale Locale to use if required. | |
| - * @return String the display description | |
| - */ | |
| - public static synchronized String getDescription(PropertyDescriptor pd) { | |
| - String r = ""; | |
| - | |
| - try { // to safely reset the locale. | |
| - r = pd.getShortDescription(); | |
| - } finally { | |
| - } | |
| - | |
| - return r; | |
| - } | |
| -} | |
| diff --git a/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/PlugInConfig.java b/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/PlugInConfig.java | |
| deleted file mode 100644 | |
| index cde28d7..0000000 | |
| --- a/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/PlugInConfig.java | |
| +++ /dev/null | |
| @@ -1,511 +0,0 @@ | |
| -/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| - * This code is licensed under the GPL 2.0 license, available at the root | |
| - * application directory. | |
| - */ | |
| -package org.vfny.geoserver.config.validation; | |
| - | |
| -import java.beans.BeanInfo; | |
| -import java.beans.Introspector; | |
| -import java.beans.PropertyDescriptor; | |
| -import java.io.StringReader; | |
| -import java.util.HashMap; | |
| -import java.util.Iterator; | |
| -import java.util.Map; | |
| - | |
| -import org.geotools.validation.dto.ArgumentDTO; | |
| -import org.geotools.validation.dto.PlugInDTO; | |
| -import org.geotools.validation.xml.ArgHelper; | |
| -import org.geotools.validation.xml.ValidationException; | |
| - | |
| - | |
| -/** | |
| - * PlugInConfig purpose. | |
| - * | |
| - * <p> | |
| - * Used to represent a copy of the config information required for the UI. | |
| - * </p> | |
| - * | |
| - * @author dzwiers, Refractions Research, Inc. | |
| - * @author $Author: dmzwiers $ (last modification) | |
| - * @version $Id$ | |
| - */ | |
| -public class PlugInConfig { | |
| - public static final String CONFIG_KEY = "Validation.PlugIn"; | |
| - | |
| - /** the plug-in name */ | |
| - private String name; | |
| - | |
| - /** the plug-in description */ | |
| - private String description; | |
| - | |
| - /** the class name this plug-in represents */ | |
| - private String className; | |
| - | |
| - /** the default arguments */ | |
| - private Map args; | |
| - | |
| - /** | |
| - * PlugInConfig constructor. | |
| - * | |
| - * <p> | |
| - * Does nothing. | |
| - * </p> | |
| - */ | |
| - public PlugInConfig() { | |
| - args = new HashMap(); | |
| - } | |
| - | |
| - /** | |
| - * PlugInConfig constructor. | |
| - * | |
| - * <p> | |
| - * Creates a copy of the PlugInConfig passed in in this object. | |
| - * </p> | |
| - * | |
| - * @param pi | |
| - */ | |
| - public PlugInConfig(PlugInConfig pi) { | |
| - name = pi.getName(); | |
| - description = pi.getDescription(); | |
| - className = pi.getClassName(); | |
| - args = new HashMap(); | |
| - | |
| - if (pi.getArgs() != null) { | |
| - Iterator i = pi.getArgs().keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - String key = (String) i.next(); | |
| - | |
| - //TODO clone value. | |
| - args.put(key, new ArgumentConfig((ArgumentConfig) pi.getArgs().get(key))); | |
| - } | |
| - } | |
| - } | |
| - | |
| - /** | |
| - * PlugInConfig constructor. | |
| - * | |
| - * <p> | |
| - * Creates a copy of the PlugInDTO passed in in this object. | |
| - * </p> | |
| - * | |
| - * @param pi | |
| - */ | |
| - public PlugInConfig(PlugInDTO pi) { | |
| - name = pi.getName(); | |
| - description = pi.getDescription(); | |
| - className = pi.getClassName(); | |
| - args = new HashMap(); | |
| - | |
| - if (pi.getArgs() != null) { | |
| - Iterator i = pi.getArgs().keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - String key = (String) i.next(); | |
| - | |
| - //TODO clone value. | |
| - args.put(key, new ArgumentConfig((ArgumentDTO) pi.getArgs().get(key))); | |
| - } | |
| - } | |
| - } | |
| - | |
| - /** | |
| - * Implementation of clone. | |
| - * | |
| - * @return a copy of this class. | |
| - * | |
| - * @see java.lang.Object#clone() | |
| - */ | |
| - public Object clone() { | |
| - return new PlugInConfig(this); | |
| - } | |
| - | |
| - /** | |
| - * Implementation of equals. | |
| - * | |
| - * @param obj | |
| - * | |
| - * @return true when the two objects are equal. | |
| - * | |
| - * @see java.lang.Object#equals(java.lang.Object) | |
| - */ | |
| - public boolean equals(Object obj) { | |
| - if ((obj == null) || !(obj instanceof PlugInDTO)) { | |
| - return false; | |
| - } | |
| - | |
| - PlugInDTO pi = (PlugInDTO) obj; | |
| - boolean r = true; | |
| - | |
| - if (name != null) { | |
| - r = r && (name.equals(pi.getName())); | |
| - } | |
| - | |
| - if (description != null) { | |
| - r = r && (description.equals(pi.getDescription())); | |
| - } | |
| - | |
| - if (className != null) { | |
| - r = r && (className.equals(pi.getClassName())); | |
| - } | |
| - | |
| - if (args == null) { | |
| - if (pi.getArgs() != null) { | |
| - return false; | |
| - } | |
| - } else { | |
| - if (pi.getArgs() != null) { | |
| - r = r && args.equals(pi.getArgs()); | |
| - } else { | |
| - return false; | |
| - } | |
| - } | |
| - | |
| - return r; | |
| - } | |
| - | |
| - /** | |
| - * Implementation of hashCode. | |
| - * | |
| - * @return the hashcode. | |
| - * | |
| - * @see java.lang.Object#hashCode() | |
| - */ | |
| - public int hashCode() { | |
| - int i = 1; | |
| - | |
| - if (name != null) { | |
| - i *= name.hashCode(); | |
| - } | |
| - | |
| - if (description != null) { | |
| - i *= description.hashCode(); | |
| - } | |
| - | |
| - if (className != null) { | |
| - i *= className.hashCode(); | |
| - } | |
| - | |
| - if (args != null) { | |
| - i *= args.hashCode(); | |
| - } | |
| - | |
| - return i; | |
| - } | |
| - | |
| - /** | |
| - * toDTO purpose. | |
| - * <p> | |
| - * Clones this config as a DTO. | |
| - * </p> | |
| - * @see java.lang.Object#clone() | |
| - * @return PlugInDTO | |
| - */ | |
| - public PlugInDTO toDTO() { | |
| - PlugInDTO dto = new PlugInDTO(); | |
| - | |
| - dto.setName(name); | |
| - dto.setDescription(description); | |
| - dto.setClassName(className); | |
| - | |
| - Map myArgs = new HashMap(); | |
| - | |
| - if (this.args != null) { | |
| - Iterator i = this.args.keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - String key = (String) i.next(); | |
| - | |
| - myArgs.put(key, ((ArgumentConfig) this.args.get(key)).toDTO()); | |
| - } | |
| - } | |
| - | |
| - dto.setArgs(myArgs); | |
| - | |
| - return dto; | |
| - } | |
| - | |
| - /** | |
| - * Access args property. | |
| - * | |
| - * @return Returns the args. | |
| - */ | |
| - public Map getArgs() { | |
| - return args; | |
| - } | |
| - | |
| - /** | |
| - * Set args to args. | |
| - * | |
| - * @param args The args to set. | |
| - */ | |
| - public void setArgs(Map args) { | |
| - this.args = args; | |
| - } | |
| - | |
| - /** | |
| - * getArgStringValue purpose. | |
| - * <p> | |
| - * Returns a human friendly version | |
| - * </p> | |
| - * @param name | |
| - * @return | |
| - */ | |
| - public String getArgStringValue(String name) { | |
| - ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| - | |
| - if (ac == null) { | |
| - return null; | |
| - } | |
| - | |
| - return ArgHelper.getArgumentStringEncoding(ac.getValue()); | |
| - } | |
| - | |
| - /** | |
| - * getArgValue purpose. | |
| - * <p> | |
| - * Returns an Object version | |
| - * </p> | |
| - * @param name | |
| - * @return | |
| - */ | |
| - public Object getArgValue(String name) { | |
| - ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| - | |
| - if (ac == null) { | |
| - return null; | |
| - } | |
| - | |
| - return ac.getValue(); | |
| - } | |
| - | |
| - /** | |
| - * setArgStringValue purpose. | |
| - * <p> | |
| - * Stores a human friendly version | |
| - * </p> | |
| - * @param name | |
| - * @param value | |
| - * @return | |
| - */ | |
| - public boolean setArgStringValue(String name, String value) { | |
| - if ((value == null) || value.equals("")) { | |
| - args.remove(name); | |
| - | |
| - return true; | |
| - } | |
| - | |
| - ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| - | |
| - if (ac == null) { | |
| - return addArgStringValue(name, value); | |
| - } else { | |
| - if (ac.isFinal()) { | |
| - throw new IllegalArgumentException( | |
| - "Cannot include final arguments as part of a test."); | |
| - } | |
| - | |
| - StringReader sr = new StringReader(value); | |
| - | |
| - try { | |
| - ac.setValue(ArgHelper.getArgumentInstance(ArgHelper.getArgumentType(ac.getValue()), | |
| - value)); | |
| - | |
| - return true; | |
| - } catch (Exception e) { | |
| - e.printStackTrace(); | |
| - | |
| - // error, log it | |
| - return false; | |
| - } | |
| - } | |
| - } | |
| - | |
| - /** | |
| - * setArgStringValue purpose. | |
| - * <p> | |
| - * Stores a human friendly version. | |
| - * </p> | |
| - * @param name | |
| - * @param value | |
| - * @return | |
| - */ | |
| - public boolean addArgStringValue(String name, String value) { | |
| - if ((value == null) || value.equals("")) { | |
| - args.remove(name); | |
| - | |
| - return false; | |
| - } | |
| - | |
| - PropertyDescriptor pd = getPropertyDescriptor(name); | |
| - | |
| - if (pd == null) { | |
| - return false; | |
| - } | |
| - | |
| - Class cl = pd.getPropertyType(); | |
| - ArgumentConfig ac = new ArgumentConfig(); | |
| - ac.setName(name); | |
| - | |
| - try { | |
| - ac.setValue(ArgHelper.getArgumentInstance(ArgHelper.getArgumentType(cl), value)); | |
| - } catch (ValidationException e) { | |
| - // TODO Auto-generated catch block | |
| - e.printStackTrace(); | |
| - | |
| - return false; | |
| - } | |
| - | |
| - args.put(name, ac); | |
| - | |
| - return true; | |
| - } | |
| - | |
| - public Object createArg(String name, String value) | |
| - throws Exception { | |
| - PropertyDescriptor pd = getPropertyDescriptor(name); | |
| - | |
| - if (pd == null) { | |
| - return null; | |
| - } | |
| - | |
| - if ((value == null) || value.equals("")) { | |
| - return null; | |
| - } | |
| - | |
| - Class cl = pd.getPropertyType(); | |
| - | |
| - return ArgHelper.getArgumentInstance(ArgHelper.getArgumentType(cl), value); | |
| - } | |
| - | |
| - /** | |
| - * setArgStringValue purpose. | |
| - * <p> | |
| - * Stores a human friendly version | |
| - * </p> | |
| - * @param name | |
| - * @param value | |
| - * @return | |
| - */ | |
| - public boolean setArgValue(String name, Object value) { | |
| - if ((value == null) || value.equals("")) { | |
| - args.remove(name); | |
| - | |
| - return true; | |
| - } | |
| - | |
| - ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| - | |
| - if (ac == null) { | |
| - ac = new ArgumentConfig(); | |
| - ac.setName(name); | |
| - args.put(name, ac); | |
| - } | |
| - | |
| - if (ac.isFinal()) { | |
| - throw new IllegalArgumentException("Cannot include final arguments as part of a test."); | |
| - } | |
| - | |
| - ac.setValue(value); | |
| - | |
| - return true; | |
| - } | |
| - | |
| - /** | |
| - * getPropertyDescriptors purpose. | |
| - * <p> | |
| - * Get the descriptors for this plugin's map of attributes | |
| - * </p> | |
| - * @return | |
| - */ | |
| - public PropertyDescriptor[] getPropertyDescriptors() { | |
| - try { | |
| - Class plugIn = this.getClass().getClassLoader().loadClass(className); | |
| - BeanInfo bi = Introspector.getBeanInfo(plugIn); | |
| - | |
| - return bi.getPropertyDescriptors(); | |
| - } catch (Exception e) { | |
| - e.printStackTrace(); | |
| - | |
| - return null; | |
| - } | |
| - } | |
| - | |
| - /** | |
| - * PropertyDescriptor purpose. | |
| - * <p> | |
| - * Get the descriptor for this plugin's attribute named | |
| - * </p> | |
| - * @param name | |
| - * @return | |
| - */ | |
| - public PropertyDescriptor getPropertyDescriptor(String name) { | |
| - if (name == null) { | |
| - throw new NullPointerException("name must be defined to get a PropertyDescriptor."); | |
| - } | |
| - | |
| - PropertyDescriptor[] pds = getPropertyDescriptors(); | |
| - | |
| - for (int i = 0; i < pds.length; i++) { | |
| - if (name.equals(pds[i].getName())) { | |
| - return pds[i]; | |
| - } | |
| - } | |
| - | |
| - return null; | |
| - } | |
| - | |
| - /** | |
| - * Access className property. | |
| - * | |
| - * @return Returns the className. | |
| - */ | |
| - public String getClassName() { | |
| - return className; | |
| - } | |
| - | |
| - /** | |
| - * Set className to className. | |
| - * | |
| - * @param className The className to set. | |
| - */ | |
| - public void setClassName(String className) { | |
| - this.className = className; | |
| - } | |
| - | |
| - /** | |
| - * Access description property. | |
| - * | |
| - * @return Returns the description. | |
| - */ | |
| - public String getDescription() { | |
| - return description; | |
| - } | |
| - | |
| - /** | |
| - * Set description to description. | |
| - * | |
| - * @param description The description to set. | |
| - */ | |
| - public void setDescription(String description) { | |
| - this.description = description; | |
| - } | |
| - | |
| - /** | |
| - * Access name property. | |
| - * | |
| - * @return Returns the name. | |
| - */ | |
| - public String getName() { | |
| - return name; | |
| - } | |
| - | |
| - /** | |
| - * Set name to name. | |
| - * | |
| - * @param name The name to set. | |
| - */ | |
| - public void setName(String name) { | |
| - this.name = name; | |
| - } | |
| -} | |
| diff --git a/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/TestConfig.java b/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/TestConfig.java | |
| deleted file mode 100644 | |
| index 39d60fb..0000000 | |
| --- a/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/TestConfig.java | |
| +++ /dev/null | |
| @@ -1,569 +0,0 @@ | |
| -/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| - * This code is licensed under the GPL 2.0 license, available at the root | |
| - * application directory. | |
| - */ | |
| -package org.vfny.geoserver.config.validation; | |
| - | |
| -import java.beans.PropertyDescriptor; | |
| -import java.io.StringReader; | |
| -import java.util.HashMap; | |
| -import java.util.HashSet; | |
| -import java.util.Iterator; | |
| -import java.util.Map; | |
| -import java.util.Set; | |
| - | |
| -import org.geotools.validation.dto.ArgumentDTO; | |
| -import org.geotools.validation.dto.PlugInDTO; | |
| -import org.geotools.validation.dto.TestDTO; | |
| -import org.geotools.validation.xml.ArgHelper; | |
| -import org.geotools.validation.xml.ValidationException; | |
| - | |
| - | |
| -/** | |
| - * TestConfig purpose. | |
| - * | |
| - * <p> | |
| - * Used to represent a copy of the config information required for the UI. | |
| - * </p> | |
| - * | |
| - * @author dzwiers, Refractions Research, Inc. | |
| - * @author $Author: dmzwiers $ (last modification) | |
| - * @version $Id$ | |
| - */ | |
| -public class TestConfig { | |
| - public final static String CURRENTLY_SELECTED_KEY = "selectedTest"; | |
| - | |
| - /** the test name */ | |
| - private String name; | |
| - | |
| - /** the test description */ | |
| - private String description; | |
| - | |
| - /** | |
| - * The plug-in which contains the class definition and default runtime | |
| - * values | |
| - */ | |
| - private PlugInConfig plugIn; | |
| - | |
| - /** lazily loaded */ | |
| - private PropertyDescriptor[] pds; | |
| - | |
| - /** | |
| - * The set of runtime args for this particular test to override the | |
| - * defaults in the plug-in | |
| - */ | |
| - private Map args; | |
| - | |
| - /** | |
| - * TestConfig constructor. | |
| - * | |
| - * <p> | |
| - * Does nothing | |
| - * </p> | |
| - */ | |
| - public TestConfig() { | |
| - args = new HashMap(); | |
| - } | |
| - | |
| - /** | |
| - * TestConfig constructor. | |
| - * | |
| - * <p> | |
| - * Creates a copy from the TestConfig specified. | |
| - * </p> | |
| - * | |
| - * @param t the data to copy | |
| - */ | |
| - public TestConfig(TestConfig t) { | |
| - name = t.getName(); | |
| - description = t.getDescription(); | |
| - plugIn = new PlugInConfig(t.getPlugIn()); | |
| - args = new HashMap(); | |
| - | |
| - if (t.getArgs() != null) { | |
| - Iterator i = t.getArgs().keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - String key = (String) i.next(); | |
| - | |
| - //TODO clone value. | |
| - args.put(key, new ArgumentConfig((ArgumentConfig) t.getArgs().get(key))); | |
| - } | |
| - } | |
| - } | |
| - | |
| - /** | |
| - * TestConfig constructor. | |
| - * | |
| - * <p> | |
| - * Creates a copy from the TestDTO specified. | |
| - * </p> | |
| - * | |
| - * @param t the data to copy | |
| - */ | |
| - public TestConfig(TestDTO t, Map plugInConfigs) { | |
| - name = t.getName(); | |
| - description = t.getDescription(); | |
| - plugIn = (PlugInConfig) plugInConfigs.get(t.getPlugIn().getName()); | |
| - args = new HashMap(); | |
| - | |
| - if (t.getArgs() != null) { | |
| - Iterator i = t.getArgs().keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - String key = (String) i.next(); | |
| - | |
| - //TODO clone value. | |
| - args.put(key, new ArgumentConfig((ArgumentDTO) t.getArgs().get(key))); | |
| - } | |
| - } | |
| - } | |
| - | |
| - /** | |
| - * Implementation of clone. | |
| - * | |
| - * @return A copy of this TestConfig | |
| - * | |
| - * @see java.lang.Object#clone() | |
| - */ | |
| - public Object clone() { | |
| - return new TestConfig(this); | |
| - } | |
| - | |
| - /** | |
| - * Implementation of equals. | |
| - * | |
| - * @param obj | |
| - * | |
| - * @return true when they have the same data. | |
| - * | |
| - * @see java.lang.Object#equals(java.lang.Object) | |
| - */ | |
| - public boolean equals(Object obj) { | |
| - if ((obj == null) || !(obj instanceof TestDTO)) { | |
| - return false; | |
| - } | |
| - | |
| - TestDTO t = (TestDTO) obj; | |
| - boolean r = true; | |
| - | |
| - if (name != null) { | |
| - r = r && (name.equals(t.getName())); | |
| - } | |
| - | |
| - if (description != null) { | |
| - r = r && (description.equals(t.getDescription())); | |
| - } | |
| - | |
| - if (plugIn == null) { | |
| - if (t.getPlugIn() != null) { | |
| - return false; | |
| - } | |
| - } else { | |
| - if (t.getPlugIn() != null) { | |
| - r = r && plugIn.equals(t.getPlugIn()); | |
| - } else { | |
| - return false; | |
| - } | |
| - } | |
| - | |
| - if (args == null) { | |
| - if (t.getArgs() != null) { | |
| - return false; | |
| - } | |
| - } else { | |
| - if (t.getArgs() != null) { | |
| - r = r && args.equals(t.getArgs()); | |
| - } else { | |
| - return false; | |
| - } | |
| - } | |
| - | |
| - return r; | |
| - } | |
| - | |
| - /** | |
| - * Implementation of hashCode. | |
| - * | |
| - * @return int hashcode | |
| - * | |
| - * @see java.lang.Object#hashCode() | |
| - */ | |
| - public int hashCode() { | |
| - int r = 1; | |
| - | |
| - if (name != null) { | |
| - r *= name.hashCode(); | |
| - } | |
| - | |
| - if (description != null) { | |
| - r *= description.hashCode(); | |
| - } | |
| - | |
| - if (plugIn != null) { | |
| - r *= plugIn.hashCode(); | |
| - } | |
| - | |
| - if (args != null) { | |
| - r *= args.hashCode(); | |
| - } | |
| - | |
| - return r; | |
| - } | |
| - | |
| - /** | |
| - * toDTO purpose. | |
| - * <p> | |
| - * Clones this config as a DTO. | |
| - * </p> | |
| - * @see java.lang.Object#clone() | |
| - * @param plugIns Map of PlugInDTO objects | |
| - * @return TestDTO | |
| - */ | |
| - public TestDTO toDTO(Map plugIns) { | |
| - TestDTO dto = new TestDTO(); | |
| - | |
| - dto.setName(name); | |
| - dto.setDescription(description); | |
| - dto.setPlugIn((PlugInDTO) plugIns.get(plugIn.getName())); | |
| - | |
| - Map myArgs = new HashMap(); | |
| - | |
| - if (this.args != null) { | |
| - Iterator i = this.args.keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - String key = (String) i.next(); | |
| - myArgs.put(key, ((ArgumentConfig) this.args.get(key)).toDTO()); | |
| - } | |
| - } | |
| - | |
| - dto.setArgs(myArgs); | |
| - | |
| - return dto; | |
| - } | |
| - | |
| - /** | |
| - * Access args property. | |
| - * | |
| - * @return Returns the args. | |
| - */ | |
| - public Map getArgs() { | |
| - return args; | |
| - } | |
| - | |
| - /** | |
| - * Set args to args. | |
| - * | |
| - * @param args The args to set. | |
| - */ | |
| - public void setArgs(Map args) { | |
| - Iterator i = args.keySet().iterator(); | |
| - | |
| - while (i.hasNext()) | |
| - | |
| - if (((ArgumentConfig) args.get(i.next())).isFinal()) { | |
| - throw new IllegalArgumentException( | |
| - "Cannot include final arguments as part of a test."); | |
| - } | |
| - | |
| - this.args = args; | |
| - } | |
| - | |
| - /** | |
| - * getArgStringValue purpose. | |
| - * <p> | |
| - * Returns a human friendly version | |
| - * </p> | |
| - * @param name | |
| - * @return | |
| - */ | |
| - public String getArgStringValue(String name) { | |
| - ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| - | |
| - if (ac == null) { | |
| - return null; | |
| - } | |
| - | |
| - return ArgHelper.getArgumentStringEncoding(ac.getValue()); | |
| - } | |
| - | |
| - /** | |
| - * getArgValue purpose. | |
| - * <p> | |
| - * Returns an Object version | |
| - * </p> | |
| - * @param name | |
| - * @return | |
| - */ | |
| - public Object getArgValue(String name) { | |
| - ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| - | |
| - if (ac == null) { | |
| - return null; | |
| - } | |
| - | |
| - return ac.getValue(); | |
| - } | |
| - | |
| - /** | |
| - * setArgStringValue purpose. | |
| - * <p> | |
| - * Stores a human friendly version. If this is a new Argument, then the type is String. | |
| - * </p> | |
| - * @param name | |
| - * @param value | |
| - * @return | |
| - */ | |
| - public boolean setArgStringValue(String name, String value) { | |
| - ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| - | |
| - if ((value == null) || value.equals("")) { | |
| - args.remove(name); | |
| - | |
| - return true; | |
| - } | |
| - | |
| - if (ac == null) { | |
| - return addArgStringValue(name, value); | |
| - } else { | |
| - if (ac.isFinal()) { | |
| - throw new IllegalArgumentException( | |
| - "Cannot include final arguments as part of a test."); | |
| - } | |
| - | |
| - StringReader sr = new StringReader(value); | |
| - | |
| - try { | |
| - ac.setValue(ArgHelper.getArgumentInstance(ArgHelper.getArgumentType(ac.getValue()), | |
| - value)); | |
| - | |
| - return true; | |
| - } catch (Exception e) { | |
| - e.printStackTrace(); | |
| - | |
| - // error, log it | |
| - return false; | |
| - } | |
| - } | |
| - } | |
| - | |
| - /** | |
| - * setArgStringValue purpose. | |
| - * <p> | |
| - * Stores a human friendly version. | |
| - * </p> | |
| - * @param name | |
| - * @param value | |
| - * @return | |
| - */ | |
| - public boolean addArgStringValue(String name, String value) { | |
| - PropertyDescriptor pd = getPropertyDescriptor(name); | |
| - | |
| - if (pd == null) { | |
| - return false; | |
| - } | |
| - | |
| - if ((value == null) || value.equals("")) { | |
| - args.remove(name); | |
| - | |
| - return false; | |
| - } | |
| - | |
| - Class cl = pd.getPropertyType(); | |
| - ArgumentConfig ac = new ArgumentConfig(); | |
| - ac.setName(name); | |
| - | |
| - try { | |
| - String argType = ArgHelper.getArgumentType(cl); | |
| - ac.setValue(ArgHelper.getArgumentInstance(argType, value)); | |
| - } catch (ValidationException e) { | |
| - // TODO Auto-generated catch block | |
| - e.printStackTrace(); | |
| - | |
| - return false; | |
| - } | |
| - | |
| - args.put(name, ac); | |
| - | |
| - return true; | |
| - } | |
| - | |
| - public Object createArg(String name, String value) | |
| - throws Exception { | |
| - PropertyDescriptor pd = getPropertyDescriptor(name); | |
| - | |
| - if (pd == null) { | |
| - return null; | |
| - } | |
| - | |
| - if ((value == null) || value.equals("")) { | |
| - return null; | |
| - } | |
| - | |
| - Class cl = pd.getPropertyType(); | |
| - | |
| - return ArgHelper.getArgumentInstance(ArgHelper.getArgumentType(cl), value); | |
| - } | |
| - | |
| - /** | |
| - * setArgStringValue purpose. | |
| - * <p> | |
| - * Stores a human friendly version | |
| - * </p> | |
| - * @param name | |
| - * @param value | |
| - * @return | |
| - */ | |
| - public boolean setArgValue(String name, Object value) { | |
| - if ((value == null) || value.equals("")) { | |
| - args.remove(name); | |
| - | |
| - return true; | |
| - } | |
| - | |
| - ArgumentConfig ac = (ArgumentConfig) args.get(name); | |
| - | |
| - if (ac == null) { | |
| - ac = new ArgumentConfig(); | |
| - ac.setName(name); | |
| - args.put(name, ac); | |
| - } | |
| - | |
| - if (ac.isFinal()) { | |
| - throw new IllegalArgumentException("Cannot include final arguments as part of a test."); | |
| - } | |
| - | |
| - ac.setValue(value); | |
| - | |
| - return true; | |
| - } | |
| - | |
| - /** | |
| - * getPropertyDescriptors purpose. | |
| - * <p> | |
| - * Get the descriptors for this plugin's map of attributes | |
| - * </p> | |
| - * @return | |
| - */ | |
| - public PropertyDescriptor[] getPropertyDescriptors() { | |
| - if (pds == null) { | |
| - PropertyDescriptor[] completeList = plugIn.getPropertyDescriptors(); | |
| - Set these = new HashSet(); | |
| - | |
| - for (int i = 0; i < completeList.length; i++) { | |
| - PropertyDescriptor property = completeList[i]; | |
| - | |
| - if (property.isHidden()) { | |
| - continue; // only for tool use | |
| - } | |
| - | |
| - if (property.isExpert()) { | |
| - continue; // limited to plugin definition | |
| - } | |
| - | |
| - if (property.getWriteMethod() == null) { | |
| - continue; // skip read-only properties | |
| - } | |
| - | |
| - if ("name".equals(property.getName())) { | |
| - continue; // not handled dynamically | |
| - } | |
| - | |
| - if ("description".equals(property.getName())) { | |
| - continue; // not handled dynamically | |
| - } | |
| - | |
| - these.add(property); | |
| - } | |
| - | |
| - Object[] ob = these.toArray(); | |
| - pds = new PropertyDescriptor[ob.length]; | |
| - | |
| - for (int i = 0; i < ob.length; i++) | |
| - pds[i] = (PropertyDescriptor) ob[i]; | |
| - } | |
| - | |
| - return pds; | |
| - } | |
| - | |
| - /** | |
| - * PropertyDescriptor purpose. | |
| - * <p> | |
| - * Get the descriptor for this plugin's attribute named | |
| - * </p> | |
| - * @param name | |
| - * @return | |
| - */ | |
| - public PropertyDescriptor getPropertyDescriptor(String name) { | |
| - if (name == null) { | |
| - throw new NullPointerException("name must be defined to get a PropertyDescriptor."); | |
| - } | |
| - | |
| - if (pds == null) { | |
| - pds = getPropertyDescriptors(); | |
| - } | |
| - | |
| - for (int i = 0; i < pds.length; i++) { | |
| - if (name.equals(pds[i].getName())) { | |
| - return pds[i]; | |
| - } | |
| - } | |
| - | |
| - return null; | |
| - } | |
| - | |
| - /** | |
| - * Access description property. | |
| - * | |
| - * @return Returns the description. | |
| - */ | |
| - public String getDescription() { | |
| - return description; | |
| - } | |
| - | |
| - /** | |
| - * Set description to description. | |
| - * | |
| - * @param description The description to set. | |
| - */ | |
| - public void setDescription(String description) { | |
| - this.description = description; | |
| - } | |
| - | |
| - /** | |
| - * Access name property. | |
| - * | |
| - * @return Returns the name. | |
| - */ | |
| - public String getName() { | |
| - return name; | |
| - } | |
| - | |
| - /** | |
| - * Set name to name. | |
| - * | |
| - * @param name The name to set. | |
| - */ | |
| - public void setName(String name) { | |
| - this.name = name; | |
| - } | |
| - | |
| - /** | |
| - * Access plugIn property. | |
| - * | |
| - * @return Returns the plugIn. | |
| - */ | |
| - public PlugInConfig getPlugIn() { | |
| - return plugIn; | |
| - } | |
| - | |
| - /** | |
| - * Set plugIn to plugIn. | |
| - * | |
| - * @param plugIn The plugIn to set. | |
| - */ | |
| - public void setPlugIn(PlugInConfig plugIn) { | |
| - this.plugIn = plugIn; | |
| - } | |
| -} | |
| diff --git a/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/TestSuiteConfig.java b/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/TestSuiteConfig.java | |
| deleted file mode 100644 | |
| index c006462..0000000 | |
| --- a/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/TestSuiteConfig.java | |
| +++ /dev/null | |
| @@ -1,252 +0,0 @@ | |
| -/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| - * This code is licensed under the GPL 2.0 license, available at the root | |
| - * application directory. | |
| - */ | |
| -package org.vfny.geoserver.config.validation; | |
| - | |
| -import java.util.HashMap; | |
| -import java.util.Iterator; | |
| -import java.util.Map; | |
| - | |
| -import org.geotools.validation.dto.TestDTO; | |
| -import org.geotools.validation.dto.TestSuiteDTO; | |
| - | |
| - | |
| -/** | |
| - * TestSuiteConfig purpose. | |
| - * | |
| - * <p> | |
| - * Used to represent a copy of the config information required for the UI. | |
| - * </p> | |
| - * | |
| - * @author dzwiers, Refractions Research, Inc. | |
| - * @author $Author: dmzwiers $ (last modification) | |
| - * @version $Id$ | |
| - */ | |
| -public class TestSuiteConfig { | |
| - public static final String CONFIG_KEY = "Validation.TestSuite"; | |
| - public static final String CURRENTLY_SELECTED_KEY = "selectedTestSuite"; | |
| - | |
| - /** the test suite name */ | |
| - private String name; | |
| - | |
| - /** the test suite description */ | |
| - private String description; | |
| - | |
| - /** the list of tests - should never be null */ | |
| - private Map tests; | |
| - | |
| - /** | |
| - * TestSuiteConfig constructor. | |
| - * <p> | |
| - * Creates a blank HashMap for tests | |
| - * </p> | |
| - * | |
| - */ | |
| - public TestSuiteConfig() { | |
| - tests = new HashMap(); | |
| - } | |
| - | |
| - /** | |
| - * TestSuiteConfig constructor. | |
| - * | |
| - * <p> | |
| - * Creates a copy of the TestSuiteConfig passed in. | |
| - * </p> | |
| - * | |
| - * @param ts The Test Suite to copy | |
| - */ | |
| - public TestSuiteConfig(TestSuiteConfig ts) { | |
| - name = ts.getName(); | |
| - description = ts.getDescription(); | |
| - tests = new HashMap(); | |
| - | |
| - Iterator i = ts.getTests().keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - TestConfig t = (TestConfig) ts.getTests().get(i.next()); | |
| - tests.put(t.getName(), new TestConfig(t)); | |
| - } | |
| - } | |
| - | |
| - /** | |
| - * TestSuiteConfig constructor. | |
| - * | |
| - * <p> | |
| - * Creates a copy of the TestSuiteConfig passed in. | |
| - * </p> | |
| - * | |
| - * @param ts The Test Suite to copy | |
| - */ | |
| - public TestSuiteConfig(TestSuiteDTO ts, Map plugInConfigs) { | |
| - name = ts.getName(); | |
| - description = ts.getDescription(); | |
| - tests = new HashMap(); | |
| - | |
| - Iterator i = ts.getTests().keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - TestDTO t = (TestDTO) ts.getTests().get(i.next()); | |
| - tests.put(t.getName(), new TestConfig(t, plugInConfigs)); | |
| - } | |
| - } | |
| - | |
| - /** | |
| - * Implementation of clone. | |
| - * | |
| - * @return An instance of TestSuiteConfig. | |
| - * | |
| - * @see java.lang.Object#clone() | |
| - */ | |
| - public Object clone() { | |
| - return new TestSuiteConfig(this); | |
| - } | |
| - | |
| - public int hashCode() { | |
| - int r = 1; | |
| - | |
| - if (tests != null) { | |
| - r *= tests.hashCode(); | |
| - } | |
| - | |
| - if (name != null) { | |
| - r *= name.hashCode(); | |
| - } | |
| - | |
| - if (description != null) { | |
| - r *= description.hashCode(); | |
| - } | |
| - | |
| - return r; | |
| - } | |
| - | |
| - /** | |
| - * Implementation of equals. | |
| - * | |
| - * @param obj An object to compare for equality. | |
| - * | |
| - * @return true when the objects have the same data in the same order. | |
| - * | |
| - * @see java.lang.Object#equals(java.lang.Object) | |
| - */ | |
| - public boolean equals(Object obj) { | |
| - if ((obj == null) || !(obj instanceof TestSuiteDTO)) { | |
| - return false; | |
| - } | |
| - | |
| - boolean r = true; | |
| - TestSuiteDTO ts = (TestSuiteDTO) obj; | |
| - | |
| - if (name != null) { | |
| - r = r && (name.equals(ts.getName())); | |
| - } | |
| - | |
| - if (description != null) { | |
| - r = r && (description.equals(ts.getDescription())); | |
| - } | |
| - | |
| - if (tests == null) { | |
| - if (ts.getTests() != null) { | |
| - return false; | |
| - } | |
| - } else { | |
| - if (ts.getTests() != null) { | |
| - r = r && tests.equals(ts.getTests()); | |
| - } else { | |
| - return false; | |
| - } | |
| - } | |
| - | |
| - return r; | |
| - } | |
| - | |
| - /** | |
| - * toDTO purpose. | |
| - * <p> | |
| - * Clones this config as a DTO. | |
| - * </p> | |
| - * @see java.lang.Object#clone() | |
| - * @param plugIns Map of PlugInDTO objects | |
| - * @return TestSuiteDTO | |
| - */ | |
| - public TestSuiteDTO toDTO(Map plugIns) { | |
| - TestSuiteDTO ts = new TestSuiteDTO(); | |
| - ts.setName(name); | |
| - ts.setDescription(description); | |
| - | |
| - Map myTests = new HashMap(); | |
| - | |
| - Iterator i = this.tests.keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - TestConfig t = (TestConfig) this.tests.get(i.next()); | |
| - myTests.put(t.getName(), t.toDTO(plugIns)); | |
| - } | |
| - | |
| - ts.setTests(myTests); | |
| - | |
| - return ts; | |
| - } | |
| - | |
| - /** | |
| - * Access description property. | |
| - * | |
| - * @return Returns the description. | |
| - */ | |
| - public String getDescription() { | |
| - return description; | |
| - } | |
| - | |
| - /** | |
| - * Set description to description. | |
| - * | |
| - * @param description The description to set. | |
| - */ | |
| - public void setDescription(String description) { | |
| - this.description = description; | |
| - } | |
| - | |
| - /** | |
| - * Access name property. | |
| - * | |
| - * @return Returns the name. | |
| - */ | |
| - public String getName() { | |
| - return name; | |
| - } | |
| - | |
| - /** | |
| - * Set name to name. | |
| - * | |
| - * @param name The name to set. | |
| - */ | |
| - public void setName(String name) { | |
| - this.name = name; | |
| - } | |
| - | |
| - /** | |
| - * Access tests property. | |
| - * | |
| - * @return Returns the tests. | |
| - */ | |
| - public Map getTests() { | |
| - return tests; | |
| - } | |
| - | |
| - public Object removeTest(String name) { | |
| - return tests.remove(name); | |
| - } | |
| - | |
| - public void addTest(TestConfig test) { | |
| - tests.put(test.getName(), test); | |
| - } | |
| - | |
| - /** | |
| - * Set tests to tests. | |
| - * | |
| - * @param tests The tests to set. | |
| - */ | |
| - public void setTests(Map tests) { | |
| - this.tests = tests; | |
| - } | |
| -} | |
| diff --git a/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/ValidationConfig.java b/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/ValidationConfig.java | |
| deleted file mode 100644 | |
| index 2175c95..0000000 | |
| --- a/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/ValidationConfig.java | |
| +++ /dev/null | |
| @@ -1,300 +0,0 @@ | |
| -/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| - * This code is licensed under the GPL 2.0 license, available at the root | |
| - * application directory. | |
| - */ | |
| -package org.vfny.geoserver.config.validation; | |
| - | |
| -import java.util.HashMap; | |
| -import java.util.Iterator; | |
| -import java.util.Map; | |
| -import java.util.Set; | |
| - | |
| -import org.geotools.validation.dto.PlugInDTO; | |
| -import org.geotools.validation.dto.TestSuiteDTO; | |
| -import org.vfny.geoserver.global.GeoValidator; | |
| - | |
| - | |
| -/** | |
| - * ValidationConfig purpose. | |
| - * <p> | |
| - * Description of ValidationConfig ... | |
| - * </p> | |
| - * | |
| - * @author dzwiers, Refractions Research, Inc. | |
| - * @author $Author: dmzwiers $ (last modification) | |
| - * @version $Id$ | |
| - */ | |
| -public class ValidationConfig { | |
| - public static final String CONFIG_KEY = "Validation.Config"; | |
| - private Map plugIns; | |
| - private Map testSuites; | |
| - | |
| - /** | |
| - * ValidationConfig constructor. | |
| - * <p> | |
| - * Description | |
| - * </p> | |
| - * | |
| - */ | |
| - public ValidationConfig() { | |
| - super(); | |
| - plugIns = new HashMap(); | |
| - testSuites = new HashMap(); | |
| - } | |
| - | |
| - /** | |
| - * ValidationConfig constructor. | |
| - * <p> | |
| - * Description | |
| - * </p> | |
| - * @param validator GeoValidator | |
| - */ | |
| - public ValidationConfig(GeoValidator validator) { | |
| - this(validator.getPlugIns(), validator.getTestSuites()); | |
| - } | |
| - | |
| - /** | |
| - * ValidationConfig constructor. | |
| - * <p> | |
| - * Description | |
| - * </p> | |
| - * @param plugIns a List of PlugInDTO objects | |
| - * @param testSuites a List of TestSuiteDTO objects | |
| - */ | |
| - public ValidationConfig(Map plugIns, Map testSuites) { | |
| - this.plugIns = new HashMap(); | |
| - this.testSuites = new HashMap(); | |
| - | |
| - Iterator i = null; | |
| - i = plugIns.keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - PlugInDTO dto = (PlugInDTO) plugIns.get(i.next()); | |
| - PlugInConfig config = new PlugInConfig(dto); | |
| - this.plugIns.put(config.getName(), config); | |
| - } | |
| - | |
| - i = testSuites.keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - TestSuiteDTO dto = (TestSuiteDTO) testSuites.get(i.next()); | |
| - TestSuiteConfig config = new TestSuiteConfig(dto, this.plugIns); | |
| - this.testSuites.put(config.getName(), config); | |
| - } | |
| - } | |
| - | |
| - /** | |
| - * | |
| - * getPlugIn purpose. | |
| - * <p> | |
| - * Gets a PlugInConfig | |
| - * </p> | |
| - * @param name | |
| - * @return PlugInConfig or null if one does not exist | |
| - */ | |
| - public PlugInConfig getPlugIn(String name) { | |
| - if (name == null) { | |
| - return null; | |
| - } | |
| - | |
| - return (PlugInConfig) plugIns.get(name); | |
| - } | |
| - | |
| - /** | |
| - * | |
| - * getTestSuite purpose. | |
| - * <p> | |
| - * Gets a TestSuiteConfig | |
| - * </p> | |
| - * @param name | |
| - * @return TestSuiteConfig or null if one does not exist | |
| - */ | |
| - public TestSuiteConfig getTestSuite(String name) { | |
| - if (name == null) { | |
| - return null; | |
| - } | |
| - | |
| - return (TestSuiteConfig) testSuites.get(name); | |
| - } | |
| - | |
| - /** | |
| - * | |
| - * getTest purpose. | |
| - * <p> | |
| - * Gets a TestConfig | |
| - * </p> | |
| - * @param name | |
| - * @param testSuite | |
| - * @return TestSuiteConfig or null if one does not exist | |
| - */ | |
| - public TestConfig getTest(String name, String testSuite) { | |
| - if ((name == null) || (testSuite == null)) { | |
| - return null; | |
| - } | |
| - | |
| - TestSuiteConfig tcn = getTestSuite(testSuite); | |
| - | |
| - if (tcn == null) { | |
| - return null; | |
| - } | |
| - | |
| - return (TestConfig) tcn.getTests().get(name); | |
| - } | |
| - | |
| - /** | |
| - * | |
| - * addPlugIn purpose. | |
| - * <p> | |
| - * Adds the plugin. | |
| - * </p> | |
| - * @param plugIn | |
| - * @return true | |
| - */ | |
| - public boolean addPlugIn(PlugInConfig plugIn) { | |
| - plugIns.put(plugIn.getName(), plugIn); | |
| - | |
| - return true; | |
| - } | |
| - | |
| - /** | |
| - * | |
| - * addTest purpose. | |
| - * <p> | |
| - * Adds the test to the specified testSuite. | |
| - * </p> | |
| - * @param test | |
| - * @param testSuite | |
| - * @return true on sucess (requires specified plugin to exist), false otherwise. | |
| - */ | |
| - public boolean addTest(TestConfig test, String testSuite) { | |
| - TestSuiteConfig tsc = (TestSuiteConfig) testSuites.get(testSuite); | |
| - | |
| - if ((tsc != null) && plugIns.containsKey(test.getPlugIn().getName())) { | |
| - tsc.getTests().put(test.getName(), test); | |
| - | |
| - return true; | |
| - } | |
| - | |
| - return false; | |
| - } | |
| - | |
| - public boolean addTestSuite(TestSuiteConfig testSuite) { | |
| - Iterator i = testSuite.getTests().keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - TestConfig test = (TestConfig) testSuite.getTests().get(i.next()); | |
| - | |
| - if (!plugIns.containsKey(test.getPlugIn().getName())) { | |
| - return false; | |
| - } | |
| - } | |
| - | |
| - // plug ins all exist | |
| - testSuites.put(testSuite.getName(), testSuite); | |
| - | |
| - return true; | |
| - } | |
| - | |
| - public Object removeTestSuite(String name) { | |
| - return testSuites.remove(name); | |
| - } | |
| - | |
| - public Object removePlugIn(String name) { | |
| - return plugIns.remove(name); | |
| - } | |
| - | |
| - public Object removeTest(String testSuite, String name) { | |
| - return ((TestSuiteConfig) testSuites.get(testSuite)).getTests().remove(name); | |
| - } | |
| - | |
| - /** | |
| - * toDTO purpose. | |
| - * <p> | |
| - * Creates a representation as DTOs | |
| - * </p> | |
| - * @param plugIns List an empty list to store the resulting plugInDTOs | |
| - * @param testSuites List an empty list to store the resulting TestSuiteDTOs | |
| - * @return true if the lists contain the data, false otherwise. | |
| - */ | |
| - public boolean toDTO(Map plugIns, Map testSuites) { | |
| - if ((plugIns == null) || (testSuites == null)) { | |
| - return false; | |
| - } | |
| - | |
| - if ((plugIns.size() != 0) || (testSuites.size() != 0)) { | |
| - return false; | |
| - } | |
| - | |
| - // list are empty, and exist. | |
| - Iterator i = null; | |
| - i = this.plugIns.keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - PlugInDTO dto = ((PlugInConfig) this.plugIns.get(i.next())).toDTO(); | |
| - plugIns.put(dto.getName(), dto); | |
| - } | |
| - | |
| - i = this.testSuites.keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - TestSuiteDTO dto = ((TestSuiteConfig) this.testSuites.get(i.next())).toDTO(plugIns); | |
| - testSuites.put(dto.getName(), dto); | |
| - } | |
| - | |
| - return true; | |
| - } | |
| - | |
| - /** | |
| - * Access plugIns property. | |
| - * | |
| - * @return Returns the plugIns. | |
| - */ | |
| - public Map getPlugIns() { | |
| - return plugIns; | |
| - } | |
| - | |
| - /** | |
| - * Access plugIns property. | |
| - * | |
| - * @return Returns the plugIns. | |
| - */ | |
| - public Set getPlugInNames() { | |
| - return plugIns.keySet(); | |
| - } | |
| - | |
| - /** | |
| - * Set plugIns to plugIns. | |
| - * | |
| - * @param plugIns The plugIns to set. | |
| - */ | |
| - public void setPlugIns(Map plugIns) { | |
| - this.plugIns = plugIns; | |
| - } | |
| - | |
| - /** | |
| - * Access testSuites property. | |
| - * | |
| - * @return Returns the testSuites. | |
| - */ | |
| - public Map getTestSuites() { | |
| - return testSuites; | |
| - } | |
| - | |
| - /** | |
| - * Access testSuites property. | |
| - * | |
| - * @return Returns the testSuites. | |
| - */ | |
| - public Set getTestSuiteNames() { | |
| - return testSuites.keySet(); | |
| - } | |
| - | |
| - /** | |
| - * Set testSuites to testSuites. | |
| - * | |
| - * @param testSuites The testSuites to set. | |
| - */ | |
| - public void setTestSuites(Map testSuites) { | |
| - this.testSuites = testSuites; | |
| - } | |
| -} | |
| diff --git a/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/package.html b/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/package.html | |
| deleted file mode 100644 | |
| index 933e363..0000000 | |
| --- a/src/extension/validation/src/main/java/org/vfny/geoserver/config/validation/package.html | |
| +++ /dev/null | |
| @@ -1,47 +0,0 @@ | |
| -<html> | |
| - | |
| -<head> | |
| -<title>Validation Config package</title> | |
| -</head> | |
| - | |
| -<body> | |
| -Validation Model being edited. | |
| - | |
| -<p> | |
| -This class opperates as the Validation Model and is stored in Web Container. | |
| -</p> | |
| -Details: | |
| -<ul> | |
| -<li> | |
| -Represents the Model of the STRUTS based Model-View-Controller Design | |
| -</li> | |
| -<li> | |
| -Will support additional user-interface state, beyond requirements of the | |
| -GeoServer Validation application. | |
| -</li> | |
| -<li> | |
| -Makes use of GeoTools2 and Vivid. | |
| -</li> | |
| -</ul> | |
| -<p> | |
| -Of the course of sorting this stuff out we have had a couple of bad ideas: | |
| -</p> | |
| -<ul> | |
| -<li> | |
| -It is tempting to replace a lot of these classes by changing the scope of the | |
| -FormBeans to session, rather than request. I cannot convince my self that this | |
| -would be a good idea, as storing the configuration model (and associated | |
| -resources in the Web Container) is sure to prevent duplication in the face | |
| -of multiple users configuring differnt subsystems. If the state was limited | |
| -to session - they would manage to overwrite each other with no prior warning. | |
| -</li> | |
| -<li> | |
| -It is tempting to make the Actions use the DTO objects directly (or forgo the | |
| -config classes entierly). Having the config classes allows us to make | |
| -whatever methods we need for easy, quick ui developement without breaking | |
| -the rest of the application. | |
| -</li> | |
| -</ul> | |
| -</body> | |
| - | |
| -</html> | |
| diff --git a/src/extension/validation/src/main/java/org/vfny/geoserver/global/GeoValidator.java b/src/extension/validation/src/main/java/org/vfny/geoserver/global/GeoValidator.java | |
| deleted file mode 100644 | |
| index 5cf6564..0000000 | |
| --- a/src/extension/validation/src/main/java/org/vfny/geoserver/global/GeoValidator.java | |
| +++ /dev/null | |
| @@ -1,275 +0,0 @@ | |
| -/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| - * This code is licensed under the GPL 2.0 license, available at the root | |
| - * application directory. | |
| - */ | |
| -package org.vfny.geoserver.global; | |
| - | |
| -import java.io.File; | |
| -import java.util.HashMap; | |
| -import java.util.HashSet; | |
| -import java.util.Iterator; | |
| -import java.util.Map; | |
| -import java.util.Set; | |
| -import java.util.logging.Level; | |
| - | |
| -import org.geoserver.platform.GeoServerResourceLoader; | |
| -import org.geotools.validation.FeatureValidation; | |
| -import org.geotools.validation.IntegrityValidation; | |
| -import org.geotools.validation.PlugIn; | |
| -import org.geotools.validation.Validation; | |
| -import org.geotools.validation.ValidationProcessor; | |
| -import org.geotools.validation.dto.ArgumentDTO; | |
| -import org.geotools.validation.dto.PlugInDTO; | |
| -import org.geotools.validation.dto.TestDTO; | |
| -import org.geotools.validation.dto.TestSuiteDTO; | |
| -import org.geotools.validation.xml.ValidationException; | |
| -import org.geotools.validation.xml.XMLReader; | |
| - | |
| - | |
| -/** | |
| - * GeoValidator purpose. | |
| - * <p> | |
| - * Description of GeoValidator ... | |
| - * </p> | |
| - * | |
| - * @author dzwiers, Refractions Research, Inc. | |
| - * @author $Author: jive $ (last modification) | |
| - * @version $Id$ | |
| - */ | |
| -public class GeoValidator extends ValidationProcessor { | |
| - public static final String WEB_CONTAINER_KEY = "GeoValidator"; | |
| - | |
| - /** | |
| - * GeoValidator constructor. | |
| - * <p> | |
| - * super(); | |
| - * </p> | |
| - * | |
| - */ | |
| - public GeoValidator() { | |
| - super(); | |
| - } | |
| - | |
| - /** | |
| - * Creates a new geo validator. | |
| - * | |
| - * @param config The configuration module. | |
| - */ | |
| - public GeoValidator(GeoServerResourceLoader resourceLoader) { | |
| - loadPlugins(resourceLoader); | |
| - } | |
| - | |
| - /** | |
| - * Loads validations plugins. | |
| - * | |
| - * @param dataDir The data directory. | |
| - */ | |
| - protected void loadPlugins(GeoServerResourceLoader loader) { | |
| - Map plugIns = null; | |
| - Map testSuites = null; | |
| - | |
| - try { | |
| - File plugInDir = loader.get("plugIns").dir(); | |
| - File validationDir = loader.get("validation").dir(); | |
| - if (plugInDir != null && plugInDir.exists()) { | |
| - plugIns = XMLReader.loadPlugIns(plugInDir); | |
| - | |
| - if (validationDir != null && validationDir.exists()) { | |
| - testSuites = XMLReader.loadValidations(validationDir, plugIns); | |
| - } | |
| - } | |
| - } catch (Exception e) { | |
| - org.geotools.util.logging.Logging.getLogger("org.vfny.geoserver.global").log(Level.WARNING, "loading plugins", e); | |
| - } | |
| - | |
| - if(testSuites == null) | |
| - testSuites = new HashMap(); | |
| - if(plugIns == null) | |
| - plugIns = new HashMap(); | |
| - | |
| - load(testSuites, plugIns); | |
| - } | |
| - | |
| - /** | |
| - * ValidationProcessor constructor. | |
| - * | |
| - * <p> | |
| - * Builds a ValidationProcessor with the DTO provided. | |
| - * </p> | |
| - * | |
| - * @see load(Map,Map) | |
| - * @param testSuites Map a map of names -> TestSuiteDTO objects | |
| - * @param plugIns Map a map of names -> PlugInDTO objects | |
| - */ | |
| - public GeoValidator(Map testSuites, Map plugIns) { | |
| - super(); | |
| - load(testSuites, plugIns); | |
| - } | |
| - | |
| - private Map testSuites; | |
| - private Map plugIns; | |
| - private Map errors; | |
| - | |
| - /** | |
| - * Map of errors encountered during loading process | |
| - * <p> | |
| - * Map of true (loaded), false (never used), or exception (error) keyed | |
| - * by PlugIn and Test DataTransferObjects. | |
| - * </p> | |
| - * @return Map of status by PlugInDTO and TestDTO | |
| - */ | |
| - public Map getErrors() { | |
| - return errors; | |
| - } | |
| - | |
| - /** | |
| - * load purpose. | |
| - * <p> | |
| - * loads this instance data into this instance. | |
| - * </p> | |
| - * @param testSuites | |
| - * @param plugIns | |
| - */ | |
| - public void load(Map testSuites, Map plugIns) { | |
| - this.plugIns = plugIns; | |
| - this.testSuites = testSuites; | |
| - errors = new HashMap(); | |
| - | |
| - // step 1 make a list required plug-ins | |
| - Set plugInNames = new HashSet(); | |
| - Iterator i = testSuites.keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - TestSuiteDTO dto = (TestSuiteDTO) testSuites.get(i.next()); | |
| - Iterator j = dto.getTests().keySet().iterator(); | |
| - | |
| - while (j.hasNext()) { | |
| - TestDTO tdto = (TestDTO) dto.getTests().get(j.next()); | |
| - plugInNames.add(tdto.getPlugIn().getName()); | |
| - } | |
| - } | |
| - | |
| - // Mark all plug-ins as not loaded | |
| - // | |
| - i = plugIns.values().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - PlugInDTO dto = (PlugInDTO) i.next(); | |
| - errors.put(dto, Boolean.FALSE); | |
| - } | |
| - | |
| - // step 2 configure plug-ins with defaults | |
| - Map defaultPlugIns = new HashMap(plugInNames.size()); | |
| - i = plugInNames.iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - String plugInName = (String) i.next(); | |
| - PlugInDTO dto = (PlugInDTO) plugIns.get(plugInName); | |
| - Class plugInClass = null; | |
| - | |
| - try { | |
| - plugInClass = Class.forName(dto.getClassName()); | |
| - } catch (ClassNotFoundException e) { | |
| - //Error, using default. | |
| - errors.put(dto, e); | |
| - e.printStackTrace(); | |
| - } | |
| - | |
| - if (plugInClass == null) { | |
| - plugInClass = Validation.class; | |
| - } | |
| - | |
| - Map plugInArgs = dto.getArgs(); | |
| - | |
| - if (plugInArgs == null) { | |
| - plugInArgs = new HashMap(); | |
| - } | |
| - | |
| - try { | |
| - PlugIn plugIn = new org.geotools.validation.PlugIn(plugInName, plugInClass, | |
| - dto.getDescription(), plugInArgs); | |
| - defaultPlugIns.put(plugInName, plugIn); | |
| - } catch (ValidationException e) { | |
| - e.printStackTrace(); | |
| - // Update dto entry w/ an error? | |
| - errors.put(dto, e); | |
| - | |
| - continue; | |
| - } | |
| - | |
| - // mark dto entry as a success | |
| - errors.put(dto, Boolean.TRUE); | |
| - } | |
| - | |
| - // step 3 configure plug-ins with tests + add to processor | |
| - i = testSuites.keySet().iterator(); | |
| - | |
| - while (i.hasNext()) { | |
| - TestSuiteDTO tdto = (TestSuiteDTO) testSuites.get(i.next()); | |
| - Iterator j = tdto.getTests().keySet().iterator(); | |
| - | |
| - while (j.hasNext()) { | |
| - TestDTO dto = (TestDTO) tdto.getTests().get(j.next()); | |
| - | |
| - // deal with test | |
| - Map testArgs = dto.getArgs(); | |
| - | |
| - if (testArgs == null) { | |
| - testArgs = new HashMap(); | |
| - } else { | |
| - Map m = new HashMap(); | |
| - Iterator k = testArgs.keySet().iterator(); | |
| - | |
| - while (k.hasNext()) { | |
| - ArgumentDTO adto = (ArgumentDTO) testArgs.get(k.next()); | |
| - m.put(adto.getName(), adto.getValue()); | |
| - } | |
| - | |
| - testArgs = m; | |
| - } | |
| - | |
| - try { | |
| - PlugIn plugIn = (org.geotools.validation.PlugIn) defaultPlugIns.get(dto.getPlugIn() | |
| - .getName()); | |
| - Validation validation = plugIn.createValidation(dto.getName(), | |
| - dto.getDescription(), testArgs); | |
| - | |
| - if (validation instanceof FeatureValidation) { | |
| - addValidation((FeatureValidation) validation); | |
| - } | |
| - | |
| - if (validation instanceof IntegrityValidation) { | |
| - addValidation((IntegrityValidation) validation); | |
| - } | |
| - } catch (ValidationException e) { | |
| - e.printStackTrace(); | |
| - // place test error under the plugIn DTO that spawned it | |
| - errors.put(dto, e); | |
| - | |
| - //error should log here | |
| - continue; | |
| - } | |
| - | |
| - errors.put(dto, Boolean.TRUE); | |
| - } | |
| - | |
| - errors.put(tdto, Boolean.TRUE); | |
| - } | |
| - } | |
| - | |
| - public Object toPlugInDTO() { | |
| - return plugIns; | |
| - } | |
| - | |
| - public Object toTestSuiteDTO() { | |
| - return testSuites; | |
| - } | |
| - | |
| - public Map getPlugIns() { | |
| - return plugIns; | |
| - } | |
| - | |
| - public Map getTestSuites() { | |
| - return testSuites; | |
| - } | |
| -} | |
| diff --git a/src/extension/wcs2_0-eo/core/pom.xml b/src/extension/wcs2_0-eo/core/pom.xml | |
| index e81e167..4fe97d4 100644 | |
| --- a/src/extension/wcs2_0-eo/core/pom.xml | |
| +++ b/src/extension/wcs2_0-eo/core/pom.xml | |
| @@ -12,7 +12,7 @@ application directory. | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-wcs2_0-eo</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/wcs2_0-eo/pom.xml b/src/extension/wcs2_0-eo/pom.xml | |
| index 99e75fc..544405e 100644 | |
| --- a/src/extension/wcs2_0-eo/pom.xml | |
| +++ b/src/extension/wcs2_0-eo/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-wcs2_0-eo</artifactId> | |
| diff --git a/src/extension/wcs2_0-eo/web/pom.xml b/src/extension/wcs2_0-eo/web/pom.xml | |
| index 6a160c1..7e07935 100644 | |
| --- a/src/extension/wcs2_0-eo/web/pom.xml | |
| +++ b/src/extension/wcs2_0-eo/web/pom.xml | |
| @@ -12,7 +12,7 @@ application directory. | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-wcs2_0-eo</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/wps/pom.xml b/src/extension/wps/pom.xml | |
| index fe58f1a..810c953 100644 | |
| --- a/src/extension/wps/pom.xml | |
| +++ b/src/extension/wps/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/wps/web-wps/pom.xml b/src/extension/wps/web-wps/pom.xml | |
| index 0e23ff2..c0b20c2 100644 | |
| --- a/src/extension/wps/web-wps/pom.xml | |
| +++ b/src/extension/wps/web-wps/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-wps</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/wps/web-wps/src/main/java/org/geoserver/wps/web/WPSAdminPage.java b/src/extension/wps/web-wps/src/main/java/org/geoserver/wps/web/WPSAdminPage.java | |
| index acb12dd..62ca83e 100644 | |
| --- a/src/extension/wps/web-wps/src/main/java/org/geoserver/wps/web/WPSAdminPage.java | |
| +++ b/src/extension/wps/web-wps/src/main/java/org/geoserver/wps/web/WPSAdminPage.java | |
| @@ -8,6 +8,7 @@ import java.util.ArrayList; | |
| import java.util.List; | |
| import org.apache.wicket.Component; | |
| +import org.apache.wicket.PageParameters; | |
| import org.apache.wicket.markup.html.basic.Label; | |
| import org.apache.wicket.markup.html.form.CheckBox; | |
| import org.apache.wicket.markup.html.form.Form; | |
| @@ -40,6 +41,10 @@ public class WPSAdminPage extends BaseServiceAdminPage<WPSInfo> { | |
| super(service); | |
| } | |
| + public WPSAdminPage(PageParameters pageParams) { | |
| + super(pageParams); | |
| + } | |
| + | |
| protected Class<WPSInfo> getServiceClass() { | |
| return WPSInfo.class; | |
| } | |
| diff --git a/src/extension/wps/web-wps/src/test/java/org/geoserver/wps/web/WPSAdminPageTest.java b/src/extension/wps/web-wps/src/test/java/org/geoserver/wps/web/WPSAdminPageTest.java | |
| index 8dddd57..c61a86a 100644 | |
| --- a/src/extension/wps/web-wps/src/test/java/org/geoserver/wps/web/WPSAdminPageTest.java | |
| +++ b/src/extension/wps/web-wps/src/test/java/org/geoserver/wps/web/WPSAdminPageTest.java | |
| @@ -4,6 +4,13 @@ | |
| */ | |
| package org.geoserver.wps.web; | |
| +import java.util.Collections; | |
| + | |
| +import org.apache.wicket.PageParameters; | |
| +import org.geoserver.catalog.WorkspaceInfo; | |
| +import org.geoserver.config.GeoServer; | |
| +import org.geoserver.config.impl.ServiceInfoImpl; | |
| +import org.geoserver.ows.util.OwsUtils; | |
| import org.geoserver.web.GeoServerWicketTestSupport; | |
| import org.geoserver.web.wicket.KeywordsEditor; | |
| import org.geoserver.wps.WPSInfo; | |
| @@ -23,4 +30,27 @@ public class WPSAdminPageTest extends GeoServerWicketTestSupport { | |
| tester.assertComponent("form:keywords", KeywordsEditor.class); | |
| tester.assertModelValue("form:keywords", wps.getKeywords()); | |
| } | |
| + | |
| + @Test | |
| + public void testWorkspace() throws Exception { | |
| + GeoServer geoServer = getGeoServerApplication().getGeoServer(); | |
| + WPSInfo wps = geoServer.getService(WPSInfo.class); | |
| + WorkspaceInfo defaultWs = getCatalog().getDefaultWorkspace(); | |
| + WPSInfo wps2 = geoServer.getFactory().create(WPSInfo.class); | |
| + OwsUtils.copy(wps, wps2, WPSInfo.class); | |
| + ((ServiceInfoImpl) wps2).setId(null); | |
| + wps2.setWorkspace(defaultWs); | |
| + wps2.setMaintainer("TestMaintainer"); | |
| + geoServer.add(wps2); | |
| + | |
| + // start the page with the custom workspace | |
| + login(); | |
| + tester.startPage(WPSAdminPage.class, | |
| + new PageParameters(Collections.singletonMap("workspace", defaultWs.getName()))); | |
| + // print(tester.getLastRenderedPage(), true, true, true); | |
| + | |
| + // test that components have been filled as expected | |
| + tester.assertModelValue("form:maintainer", "TestMaintainer"); | |
| + | |
| + } | |
| } | |
| diff --git a/src/extension/wps/wps-core/pom.xml b/src/extension/wps/wps-core/pom.xml | |
| index 35bf9cd..66e2c88 100644 | |
| --- a/src/extension/wps/wps-core/pom.xml | |
| +++ b/src/extension/wps/wps-core/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-wps</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.extension</groupId> | |
| diff --git a/src/extension/xslt/pom.xml b/src/extension/xslt/pom.xml | |
| index fe55316..62b7913 100644 | |
| --- a/src/extension/xslt/pom.xml | |
| +++ b/src/extension/xslt/pom.xml | |
| @@ -6,7 +6,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>extension</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/gwc/pom.xml b/src/gwc/pom.xml | |
| index 92229e3..8e22b3d 100644 | |
| --- a/src/gwc/pom.xml | |
| +++ b/src/gwc/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/kml/pom.xml b/src/kml/pom.xml | |
| index 928de8e..79b94a2 100644 | |
| --- a/src/kml/pom.xml | |
| +++ b/src/kml/pom.xml | |
| @@ -9,7 +9,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/main/pom.xml b/src/main/pom.xml | |
| index 6f4449c..266240b 100644 | |
| --- a/src/main/pom.xml | |
| +++ b/src/main/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| @@ -44,10 +44,6 @@ | |
| <artifactId>commons-beanutils</artifactId> | |
| </dependency> | |
| <dependency> | |
| - <groupId>commons-digester</groupId> | |
| - <artifactId>commons-digester</artifactId> | |
| - </dependency> | |
| - <dependency> | |
| <groupId>commons-fileupload</groupId> | |
| <artifactId>commons-fileupload</artifactId> | |
| </dependency> | |
| @@ -60,18 +56,10 @@ | |
| <artifactId>commons-httpclient</artifactId> | |
| </dependency> | |
| <dependency> | |
| - <groupId>commons-validator</groupId> | |
| - <artifactId>commons-validator</artifactId> | |
| - </dependency> | |
| - <dependency> | |
| <groupId>org.freemarker</groupId> | |
| <artifactId>freemarker</artifactId> | |
| </dependency> | |
| <dependency> | |
| - <groupId>oro</groupId> | |
| - <artifactId>oro</artifactId> | |
| - </dependency> | |
| - <dependency> | |
| <groupId>org.geotools</groupId> | |
| <artifactId>gt-cql</artifactId> | |
| </dependency> | |
| @@ -85,10 +73,6 @@ | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geotools</groupId> | |
| - <artifactId>gt-validation</artifactId> | |
| - </dependency> | |
| - <dependency> | |
| - <groupId>org.geotools</groupId> | |
| <artifactId>gt-data</artifactId> | |
| </dependency> | |
| <dependency> | |
| diff --git a/src/main/src/main/java/org/geoserver/GeoserverInitStartupListener.java b/src/main/src/main/java/org/geoserver/GeoserverInitStartupListener.java | |
| index 0168cc0..3cd0584 100644 | |
| --- a/src/main/src/main/java/org/geoserver/GeoserverInitStartupListener.java | |
| +++ b/src/main/src/main/java/org/geoserver/GeoserverInitStartupListener.java | |
| @@ -29,6 +29,7 @@ import javax.media.jai.JAI; | |
| import javax.media.jai.OperationRegistry; | |
| import javax.media.jai.RegistryElementDescriptor; | |
| import javax.media.jai.RegistryMode; | |
| +import javax.media.jai.remote.SerializableRenderedImage; | |
| import javax.media.jai.util.ImagingListener; | |
| import javax.servlet.ServletContextEvent; | |
| import javax.servlet.ServletContextListener; | |
| @@ -81,13 +82,31 @@ public class GeoserverInitStartupListener implements ServletContextListener { | |
| @Override | |
| public boolean errorOccurred(String message, Throwable thrown, Object where, | |
| boolean isRetryable) throws RuntimeException { | |
| - if (message.contains("Continuing in pure Java mode")) { | |
| + if (isSerializableRenderedImageFinalization(where, thrown)) { | |
| + LOGGER.log(Level.FINEST, message, thrown); | |
| + } else if (message.contains("Continuing in pure Java mode")) { | |
| LOGGER.log(Level.FINE, message, thrown); | |
| } else { | |
| LOGGER.log(Level.INFO, message, thrown); | |
| } | |
| return false; // we are not trying to recover | |
| } | |
| + | |
| + private boolean isSerializableRenderedImageFinalization(Object where, Throwable t) { | |
| + if (!(where instanceof SerializableRenderedImage)) { | |
| + return false; | |
| + } | |
| + | |
| + // check if it's the finalizer | |
| + StackTraceElement[] elements = t.getStackTrace(); | |
| + for (StackTraceElement element : elements) { | |
| + if (element.getMethodName().equals("finalize") | |
| + && element.getClassName().endsWith("SerializableRenderedImage")) | |
| + return true; | |
| + } | |
| + | |
| + return false; | |
| + } | |
| }); | |
| // setup concurrent operation registry | |
| diff --git a/src/main/src/main/java/org/geoserver/catalog/ResourcePool.java b/src/main/src/main/java/org/geoserver/catalog/ResourcePool.java | |
| index 39903fc..99e3b9b 100644 | |
| --- a/src/main/src/main/java/org/geoserver/catalog/ResourcePool.java | |
| +++ b/src/main/src/main/java/org/geoserver/catalog/ResourcePool.java | |
| @@ -120,11 +120,20 @@ import org.vfny.geoserver.util.DataStoreUtils; | |
| * Provides access to resources such as datastores, coverage readers, and | |
| * feature types. | |
| * <p> | |
| - * | |
| + * Provides caches for: | |
| + * <ul> | |
| + * <li>{@link #crsCache} - quick lookup of CoorrdinateReferenceSystem by srs name</li> | |
| + * <li>{@link #dataStoreCache} - live {@link DataAccess} connections. Responsible for maintaining lifecycle with an | |
| + * appropriate call to {@link DataAccess#dispose()} when no longer in use.</li> | |
| + * <li>{@link #featureTypeCache} </li> | |
| + * <li>{@link #featureTypeAttributeCache} </li> | |
| + * <li>{@link #wmsCache} </li> | |
| + * <li>{@link #coverageReaderCache} </li> | |
| + * <li>{@link #hintCoverageReaderCache} </li> | |
| + * <li>{@link #styleCache} </li> | |
| * </p> | |
| * | |
| - * @author Justin Deoliveira, The Open Planning Project | |
| - * | |
| + * @author Justin Deoliveira, Boundless | |
| */ | |
| public class ResourcePool { | |
| @@ -150,8 +159,8 @@ public class ResourcePool { | |
| /** logging */ | |
| static Logger LOGGER = Logging.getLogger( "org.geoserver.catalog"); | |
| - static Class VERSIONING_FS = null; | |
| - static Class GS_VERSIONING_FS = null; | |
| + static Class<?> VERSIONING_FS = null; | |
| + static Class<?> GS_VERSIONING_FS = null; | |
| static { | |
| try { | |
| @@ -173,7 +182,7 @@ public class ResourcePool { | |
| Catalog catalog; | |
| Map<String, CoordinateReferenceSystem> crsCache; | |
| - Map<String, DataAccess> dataStoreCache; | |
| + DataStoreCache dataStoreCache; | |
| Map<String, FeatureType> featureTypeCache; | |
| Map<String, List<AttributeTypeInfo>> featureTypeAttributeCache; | |
| Map<String, WebMapServer> wmsCache; | |
| @@ -274,8 +283,14 @@ public class ResourcePool { | |
| public Map<String, DataAccess> getDataStoreCache() { | |
| return dataStoreCache; | |
| } | |
| - | |
| - protected Map<String,DataAccess> createDataStoreCache() { | |
| + /** | |
| + * DataStoreCache implementation responsible for freeing DataAccess resources | |
| + * when they are no longer in use. | |
| + * | |
| + * @return Cache used to look up DataAccess via id | |
| + * @see #getDataStoreCache() | |
| + */ | |
| + protected DataStoreCache createDataStoreCache() { | |
| return new DataStoreCache(); | |
| } | |
| @@ -491,15 +506,15 @@ public class ResourcePool { | |
| } | |
| /** | |
| - * Returns the underlying resource for a datastore, caching the result. | |
| + * Returns the underlying resource for a DataAccess, caching the result. | |
| * <p> | |
| * In the result of the resource not being in the cache {@link DataStoreInfo#getConnectionParameters()} | |
| - * is used to connect to it. | |
| + * is used to create the connection. | |
| * </p> | |
| - * @param info the data store metadata. | |
| - * | |
| + * @param info DataStoreMeta providing id used for cache lookup (and connection paraemters if a connection is needed) | |
| * @throws IOException Any errors that occur connecting to the resource. | |
| */ | |
| + @SuppressWarnings({ "rawtypes", "unchecked" }) | |
| public DataAccess<? extends FeatureType, ? extends Feature> getDataStore( DataStoreInfo info ) throws IOException { | |
| DataAccess<? extends FeatureType, ? extends Feature> dataStore = null; | |
| try { | |
| @@ -512,7 +527,7 @@ public class ResourcePool { | |
| //create data store | |
| Map<String, Serializable> connectionParameters = info.getConnectionParameters(); | |
| - //call this methdo to execute the hack which recognizes | |
| + // call this method to execute the hack which recognizes | |
| // urls which are relative to the data directory | |
| // TODO: find a better way to do this | |
| connectionParameters = ResourcePool.getParams(connectionParameters, catalog.getResourceLoader() ); | |
| @@ -1933,27 +1948,48 @@ public class ResourcePool { | |
| protected void dispose(String key, FeatureType featureType) { | |
| String id = key.substring(0, key.indexOf(PROJECTION_POLICY_SEPARATOR)); | |
| FeatureTypeInfo info = catalog.getFeatureType(id); | |
| - LOGGER.info( "Disposing feature type '" + info.getName() + "'"); | |
| - fireDisposed(info, featureType); | |
| + if(info != null){ | |
| + LOGGER.info( "Disposing feature type '" + info.getName() + "'"); | |
| + fireDisposed(info, featureType); | |
| + } | |
| } | |
| } | |
| - | |
| + /** | |
| + * Custom CatalogResourceCache responsible for disposing | |
| + * of DataAccess instances (allowing the recovery of operating | |
| + * system resources). | |
| + * | |
| + * @see ResourcePool#dataStoreCache | |
| + */ | |
| + @SuppressWarnings("rawtypes") | |
| class DataStoreCache extends CatalogResourceCache<String, DataAccess> { | |
| - | |
| - protected void dispose(String id, DataAccess da) { | |
| - DataStoreInfo info = catalog.getDataStore(id); | |
| - String name = null; | |
| - if(info != null) { | |
| - name = info.getName(); | |
| - LOGGER.info( "Disposing datastore '" + name + "'" ); | |
| - | |
| - fireDisposed(info, da); | |
| - } | |
| - | |
| + /** | |
| + * Ensure data access entry is removed from catalog, and | |
| + * ensure DataAccess dispose is called to return system resources. | |
| + * <p> | |
| + * This method is used when cleaning up a weak reference and | |
| + * will immediately dispose of the indicated dataAccess. | |
| + * | |
| + * @param id DataStore id, or null if not known | |
| + * @param dataAccess DataAccess to dispose | |
| + */ | |
| + protected void dispose(String id, final DataAccess dataAccess) { | |
| + DataStoreInfo info = catalog.getDataStore(id); | |
| + final String name; | |
| + if (info != null) { | |
| + name = info.getName(); | |
| + LOGGER.info("Disposing datastore '" + name + "'"); | |
| + fireDisposed(info, dataAccess); | |
| + } | |
| + else { | |
| + name = "Untracked"; | |
| + } | |
| + final String implementation = dataAccess.getClass().getSimpleName(); | |
| try { | |
| - da.dispose(); | |
| + LOGGER.info("Dispose data access '" + name + "' "+implementation); | |
| + dataAccess.dispose(); | |
| } catch( Exception e ) { | |
| - LOGGER.warning( "Error occured disposing datastore '" + name + "'"); | |
| + LOGGER.warning( "Error occured disposing data access '" + name + "' "+implementation ); | |
| LOGGER.log(Level.FINE, "", e ); | |
| } | |
| } | |
| @@ -2115,7 +2151,15 @@ public class ResourcePool { | |
| clear(style); | |
| } | |
| } | |
| - | |
| + /** | |
| + * Used to clean up any outstanding data store listeners. | |
| + * <p> | |
| + * The DataStore is still active as the listeners are called allowing | |
| + * any required clean up to occur. | |
| + * | |
| + * @param dataStoreInfo | |
| + * @param da Data access | |
| + */ | |
| void fireDisposed(DataStoreInfo dataStore, DataAccess da) { | |
| for (Listener l : listeners) { | |
| try { | |
| diff --git a/src/main/src/main/java/org/geoserver/data/jdbc/GenericUnWrapper.java b/src/main/src/main/java/org/geoserver/data/jdbc/GenericUnWrapper.java | |
| new file mode 100644 | |
| index 0000000..de5634b | |
| --- /dev/null | |
| +++ b/src/main/src/main/java/org/geoserver/data/jdbc/GenericUnWrapper.java | |
| @@ -0,0 +1,240 @@ | |
| +/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| + * This code is licensed under the GPL 2.0 license, available at the root | |
| + * application directory. | |
| + */ | |
| +package org.geoserver.data.jdbc; | |
| + | |
| +import java.lang.reflect.InvocationTargetException; | |
| +import java.lang.reflect.Method; | |
| +import java.sql.Connection; | |
| +import java.sql.Statement; | |
| +import java.util.Map; | |
| +import java.util.Map.Entry; | |
| +import java.util.concurrent.ConcurrentHashMap; | |
| +import java.util.logging.Level; | |
| +import java.util.logging.Logger; | |
| + | |
| +import org.geotools.data.jdbc.datasource.UnWrapper; | |
| +import org.geotools.util.logging.Logging; | |
| + | |
| +//import org.springframework.jdbc.support.nativejdbc.XAPoolNativeJdbcExtractor; | |
| + | |
| +/** | |
| + * Generic UnWrapper using reflection to access original JDBC connection. | |
| + * <p> | |
| + * This implementation is a stand-in for SpringUnWrapper which is not currently able to unwrap JBoss | |
| + * WrappedConnectionJDK6 connections. While a list of well-known Connection implementations is | |
| + * catered for (with both the class name and unwrap method recorded) the GenericUnWrapper is willing | |
| + * to search through the available fields looking for an implementation of Connection to return. | |
| + * | |
| + * @author Jody Garnett - OpenGeo | |
| + */ | |
| +public class GenericUnWrapper implements UnWrapper { | |
| + private final static Logger LOGGER = Logging | |
| + .getLogger("org.geoserver.data.jdbc.GenericUnWrapper"); | |
| + | |
| + private static final Method IGNORE; | |
| + static { | |
| + try { | |
| + IGNORE = GenericUnWrapper.class.getMethod("ignore",new Class[0]); | |
| + } catch (Exception inconsistent) { | |
| + throw new IllegalStateException("Expected static GenericUnWrapper ignore() method",inconsistent); | |
| + } | |
| + } | |
| + | |
| + /** | |
| + * Primary record of known access methods used to unwrap conenctions in exotic deployment | |
| + * environments such as JBoss. | |
| + * <p> | |
| + * This field is package visible to allow local testing. | |
| + */ | |
| + static final Map<Class<?>, Method> CONNECTION_METHODS; | |
| + static { | |
| + CONNECTION_METHODS = new ConcurrentHashMap<Class<?>, Method>(); | |
| + | |
| + // if the environment does not contain the classes ... skip | |
| + methodSearch("JBoss EAP 6.0", CONNECTION_METHODS, | |
| + "org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6", "getUnderlyingConnection"); | |
| + methodSearch("JBoss JCA", CONNECTION_METHODS, | |
| + "org.jboss.jca.adapters.jdbc.WrappedConnection", "getUnderlyingConnection"); | |
| + methodSearch("JBoss Resource Adapter", CONNECTION_METHODS, | |
| + "org.jboss.resource.adapter.jdbc.WrappedConnection", "getUnderlyingConnection"); | |
| + } | |
| + | |
| + /** | |
| + * Primary record of known access methods used to unwrap statements. | |
| + * <p> | |
| + * This field is package visible to allow local testing. | |
| + */ | |
| + static final Map<Class<?>, Method> STATEMENT_METHODS; | |
| + static { | |
| + STATEMENT_METHODS = new ConcurrentHashMap<Class<?>, Method>(); | |
| + methodSearch("JBoss Resource Adapter", STATEMENT_METHODS, | |
| + "org.jboss.resource.adapter.jdbc.WrappedCallableStatement", | |
| + "getUnderlyingStatement"); | |
| + } | |
| + | |
| + /** | |
| + * Look up method used for unwrapping (if supported in the application container). | |
| + * | |
| + * @param env | |
| + * @param methods | |
| + * @param className | |
| + * @param methodName | |
| + */ | |
| + private static void methodSearch(String env, Map<Class<?>, Method> methods, String className, | |
| + String methodName) { | |
| + try { | |
| + Class<?> wrappedConnection = Class.forName(className); | |
| + Method unwrap = wrappedConnection.getMethod(methodName, (Class[]) null); | |
| + LOGGER.info(env + " " + className + " supported"); | |
| + methods.put(wrappedConnection, unwrap); | |
| + } catch (ClassNotFoundException ignore) { | |
| + LOGGER.finer(env + " " + className + " not found"); | |
| + } catch (Throwable e) { | |
| + LOGGER.fine(env + " " + className + " not available:" + e); | |
| + } | |
| + } | |
| + | |
| + /** | |
| + * Used as reflection target of {@link #IGNORE} placeholder. | |
| + */ | |
| + public static void ignore(){ | |
| + // this space is intentionally left blank | |
| + } | |
| + | |
| + public boolean canUnwrap(Connection conn) { | |
| + Connection unwrapped = unwrapInternal(Connection.class, conn, CONNECTION_METHODS); | |
| + return unwrapped != null; | |
| + } | |
| + | |
| + public Connection unwrap(Connection conn) { | |
| + Connection unwrapped = unwrapInternal(Connection.class, conn, CONNECTION_METHODS); | |
| + if (unwrapped != null) { | |
| + return unwrapped; | |
| + } else { | |
| + throw new IllegalArgumentException("This connection is not unwrappable, " | |
| + + "check canUnwrap before calling unwrap"); | |
| + } | |
| + } | |
| + | |
| + public boolean canUnwrap(Statement statement) { | |
| + Statement unwrapped = unwrapInternal(Statement.class, statement, STATEMENT_METHODS); | |
| + return unwrapped != null; | |
| + } | |
| + | |
| + public Statement unwrap(Statement statement) { | |
| + Statement unwrapped = unwrapInternal(Statement.class, statement, STATEMENT_METHODS); | |
| + if (unwrapped != null) { | |
| + return unwrapped; | |
| + } else { | |
| + throw new IllegalArgumentException("This statement is not unwrappable, " | |
| + + "check canUnwrap before calling unwrap"); | |
| + } | |
| + } | |
| + | |
| + /** | |
| + * Using provided map of methods to unwrap. For each implementation class an unwrapper method is | |
| + * is provided, or null is sentinel (indicating no method is available). For classes that do not | |
| + * provide an unwrapping method reflection is tried once (resulting in either a cached method to | |
| + * next time, or null for use as a sentinel | |
| + * | |
| + * @param target | |
| + * @param conn | |
| + * @param methods | |
| + * @return | |
| + */ | |
| + private <T> T unwrapInternal(Class<T> target, T conn, Map<Class<?>, Method> methods) { | |
| + Class<?> implementation = conn.getClass(); | |
| + // Check if we have a known method to use | |
| + if (methods.containsKey(implementation)) { | |
| + Method accessMethod = methods.get(implementation); | |
| + if (accessMethod == IGNORE) { | |
| + return null; // reflection has already been tried and come up empty | |
| + } | |
| + T unwrapped = unwrapInternal(target, conn, implementation, accessMethod); | |
| + return unwrapped; | |
| + } | |
| + else { | |
| + // Scan for superclass/interface method | |
| + for (Entry<Class<?>, Method> entry : methods.entrySet()) { | |
| + Class<?> wrapper = entry.getKey(); | |
| + Method accessMethod = entry.getValue(); | |
| + if (wrapper.isInstance(conn)) { | |
| + T unwrapped = unwrapInternal(target, conn, wrapper, accessMethod); | |
| + if (unwrapped != null) { | |
| + methods.put(implementation, accessMethod); | |
| + return unwrapped; | |
| + } | |
| + } | |
| + } | |
| + // Use reflection to scan for an accessMethod | |
| + for (Method method : implementation.getMethods()) { | |
| + if (target.isAssignableFrom(method.getReturnType()) | |
| + && method.getParameterTypes().length == 0 && method.isAccessible()) { | |
| + // possible accessor method | |
| + T unwrapped = unwrapInternal(target, conn, implementation, method); | |
| + if (unwrapped != null) { | |
| + methods.put(implementation, method); | |
| + return unwrapped; | |
| + } | |
| + } | |
| + } | |
| + // Give up - mark this one as not possible so we can exit early next time | |
| + methods.put(implementation, IGNORE); | |
| + } | |
| + return null; // not found | |
| + } | |
| + | |
| + /** | |
| + * Safe unwrap method using invoke on the provided accessMethod. | |
| + * | |
| + * All errors are logged at finest detail, and null is returned. | |
| + * | |
| + * @param target | |
| + * @param conn | |
| + * @param wrapper | |
| + * @param accessMethod | |
| + * @return unwrapped instance of target class, or null if not available | |
| + */ | |
| + private <T> T unwrapInternal(Class<T> target, T conn, Class<?> wrapper, Method accessMethod) { | |
| + if (accessMethod == null ) { | |
| + LOGGER.finest("Using " + wrapper.getName() + " does not have accessMethod to unwrap " + target.getSimpleName() ); | |
| + return null; // skip inaccessible method | |
| + } | |
| + try { | |
| + Object result = accessMethod.invoke(conn, (Object[]) null); | |
| + if (result == null) { | |
| + LOGGER.finest("Using " + wrapper.getName() + "." + accessMethod.getName() | |
| + + "() to unwrap " + target.getSimpleName() + " produced a null"); | |
| + return null; | |
| + } | |
| + if (result == conn) { | |
| + LOGGER.finest("Using " + wrapper.getName() + "." + accessMethod.getName() | |
| + + "() to unwrap did not result in native " + target.getSimpleName() + ": " | |
| + + result.getClass().getSimpleName()); | |
| + return null; | |
| + } | |
| + if (!target.isInstance(result)) { | |
| + LOGGER.finest("Using " + wrapper.getName() + "." + accessMethod.getName() | |
| + + "() to unwrap did not result in native " + target.getSimpleName() + ": " | |
| + + result.getClass().getSimpleName()); | |
| + return null; | |
| + } | |
| + return target.cast(result); | |
| + } catch (IllegalArgumentException e) { | |
| + LOGGER.log(Level.FINEST, "Using " + wrapper.getName() + "." + accessMethod.getName() | |
| + + "() to unwrap " + target.getSimpleName() + " failed: " + e); | |
| + return null; // unexpected with no arguments | |
| + } catch (IllegalAccessException e) { | |
| + LOGGER.log(Level.FINEST, "Using " + wrapper.getName() + "." + accessMethod.getName() | |
| + + "() to unwrap " + target.getSimpleName() + " failed: " + e); | |
| + return null; // could be a visibility issue | |
| + } catch (InvocationTargetException e) { | |
| + LOGGER.log(Level.FINEST, "Using " + wrapper.getName() + "." + accessMethod.getName() | |
| + + "() to unwrap " + target.getSimpleName() + " failed: " + e); | |
| + return null; // abort abort | |
| + } | |
| + } | |
| + | |
| +} | |
| diff --git a/src/main/src/main/java/org/geoserver/security/password/GeoServerMultiplexingPasswordEncoder.java b/src/main/src/main/java/org/geoserver/security/password/GeoServerMultiplexingPasswordEncoder.java | |
| index 6b14b05..d80833b 100644 | |
| --- a/src/main/src/main/java/org/geoserver/security/password/GeoServerMultiplexingPasswordEncoder.java | |
| +++ b/src/main/src/main/java/org/geoserver/security/password/GeoServerMultiplexingPasswordEncoder.java | |
| @@ -8,27 +8,34 @@ package org.geoserver.security.password; | |
| import java.io.IOException; | |
| import java.util.HashSet; | |
| import java.util.Set; | |
| +import java.util.logging.Logger; | |
| import org.geoserver.security.GeoServerSecurityManager; | |
| import org.geoserver.security.GeoServerUserGroupService; | |
| +import org.geotools.util.logging.Logging; | |
| import org.springframework.security.authentication.encoding.PasswordEncoder; | |
| import org.springframework.util.StringUtils; | |
| /** | |
| * Multiplexing password encoder. | |
| * <p> | |
| - * This password encoder actually only decodes password, it does not encode them. The purpose of | |
| - * which is to decode a previously encoded password without knowing before hand which password | |
| + * The purpose of this class is to decode a previously encoded password without knowing before hand which password | |
| * encoder was used. The prefix contained in the encoded password is used to route to the appropriate | |
| * delegate encoder. Therefore only {@link GeoserverPasswordEncoder} implementations that use a | |
| * prefix in the encoded password are valid for this encoder. | |
| * </p> | |
| + * <p> | |
| + * This class can also encode (although not typically used to do so). Encoding simply returns the first | |
| + * avaialble and successful encoder. | |
| + * </p> | |
| * | |
| * @author christian | |
| * | |
| */ | |
| public class GeoServerMultiplexingPasswordEncoder implements PasswordEncoder { | |
| - | |
| + | |
| + static Logger LOG = Logging.getLogger(GeoServerMultiplexingPasswordEncoder.class); | |
| + | |
| protected Set<GeoServerPasswordEncoder> encoders; | |
| public GeoServerMultiplexingPasswordEncoder(GeoServerSecurityManager secMgr) { | |
| @@ -66,6 +73,14 @@ public class GeoServerMultiplexingPasswordEncoder implements PasswordEncoder { | |
| @Override | |
| public String encodePassword(String rawPass, Object salt) throws UnsupportedOperationException{ | |
| + for (GeoServerPasswordEncoder enc : encoders) { | |
| + try { | |
| + return enc.encodePassword(rawPass, salt); | |
| + } | |
| + catch(Exception e) { | |
| + LOG.fine("Password encode failed with " + enc.getName()); | |
| + } | |
| + } | |
| throw new UnsupportedOperationException(); | |
| } | |
| diff --git a/src/main/src/main/resources/META-INF/services/org.geotools.data.jdbc.datasource.UnWrapper b/src/main/src/main/resources/META-INF/services/org.geotools.data.jdbc.datasource.UnWrapper | |
| index 01c3e98..68a3c26 100644 | |
| --- a/src/main/src/main/resources/META-INF/services/org.geotools.data.jdbc.datasource.UnWrapper | |
| +++ b/src/main/src/main/resources/META-INF/services/org.geotools.data.jdbc.datasource.UnWrapper | |
| @@ -1 +1,2 @@ | |
| +org.geoserver.data.jdbc.GenericUnWrapper | |
| org.geoserver.data.jdbc.SpringUnWrapper | |
| \ No newline at end of file | |
| diff --git a/src/main/src/test/java/org/geoserver/data/jdbc/GenericUnWrapperTest.java b/src/main/src/test/java/org/geoserver/data/jdbc/GenericUnWrapperTest.java | |
| new file mode 100644 | |
| index 0000000..36ad752 | |
| --- /dev/null | |
| +++ b/src/main/src/test/java/org/geoserver/data/jdbc/GenericUnWrapperTest.java | |
| @@ -0,0 +1,78 @@ | |
| +/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| + * This code is licensed under the GPL 2.0 license, available at the root | |
| + * application directory. | |
| + */ | |
| +package org.geoserver.data.jdbc; | |
| + | |
| +import static org.junit.Assert.*; | |
| + | |
| +import java.io.IOException; | |
| +import java.sql.Connection; | |
| +import java.sql.SQLException; | |
| + | |
| +import org.geotools.data.jdbc.datasource.DataSourceFinder; | |
| +import org.geotools.data.jdbc.datasource.UnWrapper; | |
| +import org.junit.Before; | |
| +import org.junit.Test; | |
| + | |
| +/** | |
| + * Uses the known target org.apache.commons.dbcp.DelegatingStatement to test out GenericUnWrapper in | |
| + * isolation. | |
| + * | |
| + * @author Jody Garnett (Boundless) | |
| + */ | |
| +public class GenericUnWrapperTest { | |
| + GenericUnWrapper unwrapper = new GenericUnWrapper(); | |
| + | |
| + @Before | |
| + public void reset(){ | |
| + // reset generic wrapper state | |
| + GenericUnWrapper.CONNECTION_METHODS.remove(WrapperConnection.class); | |
| + } | |
| + | |
| + @Test | |
| + public void testUnwrapConnection() throws SQLException, NoSuchMethodException, SecurityException { | |
| + Connection connection = new TestConnection(); | |
| + Connection wrapper = new WrapperConnection( connection ); | |
| + assertTrue( wrapper.isWrapperFor( Connection.class ) ); | |
| + Connection unwrap = wrapper.unwrap( Connection.class ); | |
| + | |
| + assertSame( connection, unwrap ); | |
| + | |
| + UnWrapper unwrapper = new GenericUnWrapper(); | |
| + | |
| + assertFalse( unwrapper.canUnwrap( wrapper ) ); | |
| + try { | |
| + assertNull( unwrapper.unwrap( wrapper )); | |
| + fail("Cannot unwrap yet"); | |
| + } | |
| + catch (Exception expected){ | |
| + } | |
| + GenericUnWrapper.CONNECTION_METHODS.put(WrapperConnection.class, | |
| + WrapperConnection.class.getMethod("getUnderlyingConnection", null)); | |
| + | |
| + assertTrue( unwrapper.canUnwrap( wrapper ) ); | |
| + assertSame( connection, unwrapper.unwrap( wrapper ) ); | |
| + } | |
| + | |
| + @Test | |
| + public void testSPIRegistration() throws Exception { | |
| + Connection connection = new TestConnection(); | |
| + Connection wrapper = new WrapperConnection( connection ); | |
| + | |
| + UnWrapper uw = DataSourceFinder.getUnWrapper( wrapper ); | |
| + if( uw != null ){ | |
| + assertTrue("picked up by jdbc4 extractor", uw instanceof SpringUnWrapper ); | |
| + } | |
| + | |
| + GenericUnWrapper.CONNECTION_METHODS.put(WrapperConnection.class, | |
| + WrapperConnection.class.getMethod("getUnderlyingConnection", null)); | |
| + | |
| + uw = DataSourceFinder.getUnWrapper( wrapper ); | |
| + assertNotNull("registed and canUnwrap",uw); | |
| + if( uw instanceof GenericUnWrapper ){ | |
| + assertSame( "Generic unwrapper is working", connection, uw.unwrap( wrapper )); | |
| + } | |
| + } | |
| + | |
| +} | |
| diff --git a/src/main/src/test/java/org/geoserver/data/jdbc/TestConnection.java b/src/main/src/test/java/org/geoserver/data/jdbc/TestConnection.java | |
| new file mode 100644 | |
| index 0000000..8e76c32 | |
| --- /dev/null | |
| +++ b/src/main/src/test/java/org/geoserver/data/jdbc/TestConnection.java | |
| @@ -0,0 +1,328 @@ | |
| +package org.geoserver.data.jdbc; | |
| + | |
| +import java.sql.Array; | |
| +import java.sql.Blob; | |
| +import java.sql.CallableStatement; | |
| +import java.sql.Clob; | |
| +import java.sql.Connection; | |
| +import java.sql.DatabaseMetaData; | |
| +import java.sql.NClob; | |
| +import java.sql.PreparedStatement; | |
| +import java.sql.SQLClientInfoException; | |
| +import java.sql.SQLException; | |
| +import java.sql.SQLWarning; | |
| +import java.sql.SQLXML; | |
| +import java.sql.Savepoint; | |
| +import java.sql.Statement; | |
| +import java.sql.Struct; | |
| +import java.util.Map; | |
| +import java.util.Properties; | |
| +import java.util.concurrent.Executor; | |
| + | |
| +/** Placeholder connection for testing */ | |
| +class TestConnection implements Connection { | |
| + private int timeout; | |
| + | |
| + private String schema; | |
| + | |
| + private Properties clientInfo; | |
| + | |
| + private int holdability; | |
| + | |
| + private Map<String, Class<?>> typeMap; | |
| + | |
| + private int transactionIsolation; | |
| + | |
| + private String catalog; | |
| + | |
| + private boolean readOnly = false; | |
| + | |
| + private boolean closed = false; | |
| + | |
| + private boolean autoCommit = true; | |
| + | |
| + @Override | |
| + public <T> T unwrap(Class<T> iface) throws SQLException { | |
| + throw new SQLException("Not a wrapper for " + iface.getSimpleName()); | |
| + } | |
| + | |
| + @Override | |
| + public boolean isWrapperFor(Class<?> iface) throws SQLException { | |
| + return false; | |
| + } | |
| + | |
| + @Override | |
| + public Statement createStatement() throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public PreparedStatement prepareStatement(String sql) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public CallableStatement prepareCall(String sql) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public String nativeSQL(String sql) throws SQLException { | |
| + return sql; | |
| + } | |
| + | |
| + @Override | |
| + public void setAutoCommit(boolean autoCommit) throws SQLException { | |
| + this.autoCommit = autoCommit; | |
| + } | |
| + | |
| + @Override | |
| + public boolean getAutoCommit() throws SQLException { | |
| + return autoCommit; | |
| + } | |
| + | |
| + @Override | |
| + public void commit() throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public void rollback() throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public void close() throws SQLException { | |
| + this.closed = true; | |
| + } | |
| + | |
| + @Override | |
| + public boolean isClosed() throws SQLException { | |
| + return closed; | |
| + } | |
| + | |
| + @Override | |
| + public DatabaseMetaData getMetaData() throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public void setReadOnly(boolean readOnly) throws SQLException { | |
| + this.readOnly = readOnly; | |
| + } | |
| + | |
| + @Override | |
| + public boolean isReadOnly() throws SQLException { | |
| + return readOnly; | |
| + } | |
| + | |
| + @Override | |
| + public void setCatalog(String catalog) throws SQLException { | |
| + this.catalog = catalog; | |
| + } | |
| + | |
| + @Override | |
| + public String getCatalog() throws SQLException { | |
| + return catalog; | |
| + } | |
| + | |
| + @Override | |
| + public void setTransactionIsolation(int level) throws SQLException { | |
| + this.transactionIsolation = level; | |
| + } | |
| + | |
| + @Override | |
| + public int getTransactionIsolation() throws SQLException { | |
| + return transactionIsolation; | |
| + } | |
| + | |
| + @Override | |
| + public SQLWarning getWarnings() throws SQLException { | |
| + return null; | |
| + } | |
| + | |
| + @Override | |
| + public void clearWarnings() throws SQLException { | |
| + } | |
| + | |
| + @Override | |
| + public Statement createStatement(int resultSetType, int resultSetConcurrency) | |
| + throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public PreparedStatement prepareStatement(String sql, int resultSetType, | |
| + int resultSetConcurrency) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) | |
| + throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public Map<String, Class<?>> getTypeMap() throws SQLException { | |
| + return typeMap; | |
| + } | |
| + | |
| + @Override | |
| + public void setTypeMap(Map<String, Class<?>> map) throws SQLException { | |
| + this.typeMap = map; | |
| + } | |
| + | |
| + @Override | |
| + public void setHoldability(int holdability) throws SQLException { | |
| + this.holdability = holdability; | |
| + } | |
| + | |
| + @Override | |
| + public int getHoldability() throws SQLException { | |
| + return holdability; | |
| + } | |
| + | |
| + @Override | |
| + public Savepoint setSavepoint() throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public Savepoint setSavepoint(String name) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public void rollback(Savepoint savepoint) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public void releaseSavepoint(Savepoint savepoint) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public Statement createStatement(int resultSetType, int resultSetConcurrency, | |
| + int resultSetHoldability) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public PreparedStatement prepareStatement(String sql, int resultSetType, | |
| + int resultSetConcurrency, int resultSetHoldability) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, | |
| + int resultSetHoldability) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) | |
| + throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public Clob createClob() throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public Blob createBlob() throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public NClob createNClob() throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public SQLXML createSQLXML() throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public boolean isValid(int timeout) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public void setClientInfo(String name, String value) throws SQLClientInfoException { | |
| + if (clientInfo == null) { | |
| + clientInfo = new Properties(); | |
| + } | |
| + this.clientInfo.put(name, value); | |
| + } | |
| + | |
| + @Override | |
| + public void setClientInfo(Properties properties) throws SQLClientInfoException { | |
| + this.clientInfo = properties; | |
| + } | |
| + | |
| + @Override | |
| + public String getClientInfo(String name) throws SQLException { | |
| + return clientInfo != null ? clientInfo.getProperty(name) : null; | |
| + } | |
| + | |
| + @Override | |
| + public Properties getClientInfo() throws SQLException { | |
| + return clientInfo; | |
| + } | |
| + | |
| + @Override | |
| + public Array createArrayOf(String typeName, Object[] elements) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public Struct createStruct(String typeName, Object[] attributes) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public void setSchema(String schema) throws SQLException { | |
| + this.schema = schema; | |
| + } | |
| + | |
| + @Override | |
| + public String getSchema() throws SQLException { | |
| + return schema; | |
| + } | |
| + | |
| + @Override | |
| + public void abort(Executor executor) throws SQLException { | |
| + throw new SQLException("Not implemented"); | |
| + } | |
| + | |
| + @Override | |
| + public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { | |
| + this.timeout = milliseconds; | |
| + } | |
| + | |
| + @Override | |
| + public int getNetworkTimeout() throws SQLException { | |
| + return timeout; | |
| + } | |
| + | |
| + @Override | |
| + public String toString() { | |
| + return getClass().getSimpleName(); | |
| + } | |
| + | |
| +} | |
| \ No newline at end of file | |
| diff --git a/src/main/src/test/java/org/geoserver/data/jdbc/WrapperConnection.java b/src/main/src/test/java/org/geoserver/data/jdbc/WrapperConnection.java | |
| new file mode 100644 | |
| index 0000000..368158a | |
| --- /dev/null | |
| +++ b/src/main/src/test/java/org/geoserver/data/jdbc/WrapperConnection.java | |
| @@ -0,0 +1,263 @@ | |
| +package org.geoserver.data.jdbc; | |
| + | |
| +import java.sql.Array; | |
| +import java.sql.Blob; | |
| +import java.sql.CallableStatement; | |
| +import java.sql.Clob; | |
| +import java.sql.Connection; | |
| +import java.sql.DatabaseMetaData; | |
| +import java.sql.NClob; | |
| +import java.sql.PreparedStatement; | |
| +import java.sql.SQLClientInfoException; | |
| +import java.sql.SQLException; | |
| +import java.sql.SQLWarning; | |
| +import java.sql.SQLXML; | |
| +import java.sql.Savepoint; | |
| +import java.sql.Statement; | |
| +import java.sql.Struct; | |
| +import java.util.Map; | |
| +import java.util.Properties; | |
| +import java.util.concurrent.Executor; | |
| + | |
| +/** Sample wrapper for testing */ | |
| +class WrapperConnection implements Connection { | |
| + | |
| + private WrapperConnectionData data = new WrapperConnectionData(); | |
| + | |
| + WrapperConnection(Connection conn) { | |
| + this.data.conn = conn; | |
| + } | |
| + public Connection getUnderlyingConnection(){ | |
| + return data.conn; | |
| + } | |
| + public <T> T unwrap(Class<T> iface) throws SQLException { | |
| + if (iface.isInstance(data.conn)) { | |
| + return iface.cast(data.conn); | |
| + } | |
| + return null; | |
| + } | |
| + | |
| + public boolean isWrapperFor(Class<?> iface) throws SQLException { | |
| + if (iface.isInstance(data.conn)) { | |
| + return true; | |
| + } | |
| + return false; | |
| + } | |
| + | |
| + public Statement createStatement() throws SQLException { | |
| + return data.conn.createStatement(); | |
| + } | |
| + | |
| + public PreparedStatement prepareStatement(String sql) throws SQLException { | |
| + return data.conn.prepareStatement(sql); | |
| + } | |
| + | |
| + public CallableStatement prepareCall(String sql) throws SQLException { | |
| + return data.conn.prepareCall(sql); | |
| + } | |
| + | |
| + public String nativeSQL(String sql) throws SQLException { | |
| + return data.conn.nativeSQL(sql); | |
| + } | |
| + | |
| + public void setAutoCommit(boolean autoCommit) throws SQLException { | |
| + data.conn.setAutoCommit(autoCommit); | |
| + } | |
| + | |
| + public boolean getAutoCommit() throws SQLException { | |
| + return data.conn.getAutoCommit(); | |
| + } | |
| + | |
| + public void commit() throws SQLException { | |
| + data.conn.commit(); | |
| + } | |
| + | |
| + public void rollback() throws SQLException { | |
| + data.conn.rollback(); | |
| + } | |
| + | |
| + public void close() throws SQLException { | |
| + data.conn.close(); | |
| + } | |
| + | |
| + public boolean isClosed() throws SQLException { | |
| + return data.conn.isClosed(); | |
| + } | |
| + | |
| + public DatabaseMetaData getMetaData() throws SQLException { | |
| + return data.conn.getMetaData(); | |
| + } | |
| + | |
| + public void setReadOnly(boolean readOnly) throws SQLException { | |
| + data.conn.setReadOnly(readOnly); | |
| + } | |
| + | |
| + public boolean isReadOnly() throws SQLException { | |
| + return data.conn.isReadOnly(); | |
| + } | |
| + | |
| + public void setCatalog(String catalog) throws SQLException { | |
| + data.conn.setCatalog(catalog); | |
| + } | |
| + | |
| + public String getCatalog() throws SQLException { | |
| + return data.conn.getCatalog(); | |
| + } | |
| + | |
| + public void setTransactionIsolation(int level) throws SQLException { | |
| + data.conn.setTransactionIsolation(level); | |
| + } | |
| + | |
| + public int getTransactionIsolation() throws SQLException { | |
| + return data.conn.getTransactionIsolation(); | |
| + } | |
| + | |
| + public SQLWarning getWarnings() throws SQLException { | |
| + return data.conn.getWarnings(); | |
| + } | |
| + | |
| + public void clearWarnings() throws SQLException { | |
| + data.conn.clearWarnings(); | |
| + } | |
| + | |
| + public Statement createStatement(int resultSetType, int resultSetConcurrency) | |
| + throws SQLException { | |
| + return data.conn.createStatement(resultSetType, resultSetConcurrency); | |
| + } | |
| + | |
| + public PreparedStatement prepareStatement(String sql, int resultSetType, | |
| + int resultSetConcurrency) throws SQLException { | |
| + return data.conn.prepareStatement(sql, resultSetType, resultSetConcurrency); | |
| + } | |
| + | |
| + public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) | |
| + throws SQLException { | |
| + return data.conn.prepareCall(sql, resultSetType, resultSetConcurrency); | |
| + } | |
| + | |
| + public Map<String, Class<?>> getTypeMap() throws SQLException { | |
| + return data.conn.getTypeMap(); | |
| + } | |
| + | |
| + public void setTypeMap(Map<String, Class<?>> map) throws SQLException { | |
| + data.conn.setTypeMap(map); | |
| + } | |
| + | |
| + public void setHoldability(int holdability) throws SQLException { | |
| + data.conn.setHoldability(holdability); | |
| + } | |
| + | |
| + public int getHoldability() throws SQLException { | |
| + return data.conn.getHoldability(); | |
| + } | |
| + | |
| + public Savepoint setSavepoint() throws SQLException { | |
| + return data.conn.setSavepoint(); | |
| + } | |
| + | |
| + public Savepoint setSavepoint(String name) throws SQLException { | |
| + return data.conn.setSavepoint(name); | |
| + } | |
| + | |
| + public void rollback(Savepoint savepoint) throws SQLException { | |
| + data.conn.rollback(savepoint); | |
| + } | |
| + | |
| + public void releaseSavepoint(Savepoint savepoint) throws SQLException { | |
| + data.conn.releaseSavepoint(savepoint); | |
| + } | |
| + | |
| + public Statement createStatement(int resultSetType, int resultSetConcurrency, | |
| + int resultSetHoldability) throws SQLException { | |
| + return data.conn.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability); | |
| + } | |
| + | |
| + public PreparedStatement prepareStatement(String sql, int resultSetType, | |
| + int resultSetConcurrency, int resultSetHoldability) throws SQLException { | |
| + return data.conn | |
| + .prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability); | |
| + } | |
| + | |
| + public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, | |
| + int resultSetHoldability) throws SQLException { | |
| + return data.conn.prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability); | |
| + } | |
| + | |
| + public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) | |
| + throws SQLException { | |
| + return data.conn.prepareStatement(sql, autoGeneratedKeys); | |
| + } | |
| + | |
| + public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { | |
| + return data.conn.prepareStatement(sql, columnIndexes); | |
| + } | |
| + | |
| + public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { | |
| + return data.conn.prepareStatement(sql, columnNames); | |
| + } | |
| + | |
| + public Clob createClob() throws SQLException { | |
| + return data.conn.createClob(); | |
| + } | |
| + | |
| + public Blob createBlob() throws SQLException { | |
| + return data.conn.createBlob(); | |
| + } | |
| + | |
| + public NClob createNClob() throws SQLException { | |
| + return data.conn.createNClob(); | |
| + } | |
| + | |
| + public SQLXML createSQLXML() throws SQLException { | |
| + return data.conn.createSQLXML(); | |
| + } | |
| + | |
| + public boolean isValid(int timeout) throws SQLException { | |
| + return data.conn.isValid(timeout); | |
| + } | |
| + | |
| + public void setClientInfo(String name, String value) throws SQLClientInfoException { | |
| + data.conn.setClientInfo(name, value); | |
| + } | |
| + | |
| + public void setClientInfo(Properties properties) throws SQLClientInfoException { | |
| + data.conn.setClientInfo(properties); | |
| + } | |
| + | |
| + public String getClientInfo(String name) throws SQLException { | |
| + return data.conn.getClientInfo(name); | |
| + } | |
| + | |
| + public Properties getClientInfo() throws SQLException { | |
| + return data.conn.getClientInfo(); | |
| + } | |
| + | |
| + public Array createArrayOf(String typeName, Object[] elements) throws SQLException { | |
| + return data.conn.createArrayOf(typeName, elements); | |
| + } | |
| + | |
| + public Struct createStruct(String typeName, Object[] attributes) throws SQLException { | |
| + return data.conn.createStruct(typeName, attributes); | |
| + } | |
| + | |
| + public void setSchema(String schema) throws SQLException { | |
| + data.conn.setSchema(schema); | |
| + } | |
| + | |
| + public String getSchema() throws SQLException { | |
| + return data.conn.getSchema(); | |
| + } | |
| + | |
| + public void abort(Executor executor) throws SQLException { | |
| + data.conn.abort(executor); | |
| + } | |
| + | |
| + public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { | |
| + data.conn.setNetworkTimeout(executor, milliseconds); | |
| + } | |
| + | |
| + public int getNetworkTimeout() throws SQLException { | |
| + return data.conn.getNetworkTimeout(); | |
| + } | |
| + | |
| +} | |
| \ No newline at end of file | |
| diff --git a/src/main/src/test/java/org/geoserver/data/jdbc/WrapperConnectionData.java b/src/main/src/test/java/org/geoserver/data/jdbc/WrapperConnectionData.java | |
| new file mode 100644 | |
| index 0000000..3fff9db | |
| --- /dev/null | |
| +++ b/src/main/src/test/java/org/geoserver/data/jdbc/WrapperConnectionData.java | |
| @@ -0,0 +1,10 @@ | |
| +package org.geoserver.data.jdbc; | |
| + | |
| +import java.sql.Connection; | |
| + | |
| +public class WrapperConnectionData { | |
| + public Connection conn; | |
| + | |
| + public WrapperConnectionData() { | |
| + } | |
| +} | |
| \ No newline at end of file | |
| diff --git a/src/main/src/test/java/org/geoserver/security/password/GeoServerMultiplexingPasswordEncoderTest.java b/src/main/src/test/java/org/geoserver/security/password/GeoServerMultiplexingPasswordEncoderTest.java | |
| new file mode 100644 | |
| index 0000000..37b3576 | |
| --- /dev/null | |
| +++ b/src/main/src/test/java/org/geoserver/security/password/GeoServerMultiplexingPasswordEncoderTest.java | |
| @@ -0,0 +1,22 @@ | |
| +package org.geoserver.security.password; | |
| + | |
| +import org.geoserver.test.GeoServerMockTestSupport; | |
| +import org.junit.Test; | |
| + | |
| +import static org.junit.Assert.fail; | |
| + | |
| +public class GeoServerMultiplexingPasswordEncoderTest | |
| + extends GeoServerMockTestSupport { | |
| + | |
| + @Test | |
| + public void testEncode() { | |
| + GeoServerMultiplexingPasswordEncoder pwe = | |
| + new GeoServerMultiplexingPasswordEncoder(getSecurityManager()); | |
| + try { | |
| + pwe.encodePassword("foo", null); | |
| + } | |
| + catch(Exception e) { | |
| + fail("Multiplexing encoder should be capabile of encoding"); | |
| + } | |
| + } | |
| +} | |
| diff --git a/src/main/src/test/java/org/geoserver/test/GeoServerSystemTestSupport.java b/src/main/src/test/java/org/geoserver/test/GeoServerSystemTestSupport.java | |
| index b0b2081..7aeef4d 100644 | |
| --- a/src/main/src/test/java/org/geoserver/test/GeoServerSystemTestSupport.java | |
| +++ b/src/main/src/test/java/org/geoserver/test/GeoServerSystemTestSupport.java | |
| @@ -4,9 +4,7 @@ | |
| */ | |
| package org.geoserver.test; | |
| -import static junit.framework.Assert.assertEquals; | |
| -import static junit.framework.Assert.fail; | |
| -import static org.junit.Assert.assertEquals; | |
| +import static junit.framework.Assert.*; | |
| import java.awt.image.BufferedImage; | |
| import java.io.BufferedReader; | |
| @@ -42,11 +40,10 @@ import javax.xml.parsers.DocumentBuilder; | |
| import javax.xml.parsers.DocumentBuilderFactory; | |
| import javax.xml.parsers.ParserConfigurationException; | |
| import javax.xml.transform.OutputKeys; | |
| -import javax.xml.transform.TransformerFactory; | |
| import javax.xml.transform.Transformer; | |
| +import javax.xml.transform.TransformerFactory; | |
| import javax.xml.transform.dom.DOMSource; | |
| import javax.xml.transform.stream.StreamResult; | |
| -import javax.xml.transform.stream.StreamSource; | |
| import javax.xml.validation.Schema; | |
| import javax.xml.validation.SchemaFactory; | |
| import javax.xml.validation.Validator; | |
| @@ -60,18 +57,17 @@ import org.geoserver.catalog.Catalog; | |
| import org.geoserver.catalog.FeatureTypeInfo; | |
| import org.geoserver.catalog.LayerGroupInfo; | |
| import org.geoserver.catalog.LayerInfo; | |
| -import org.geoserver.catalog.TestHttpClientProvider; | |
| import org.geoserver.catalog.NamespaceInfo; | |
| import org.geoserver.catalog.ResourceInfo; | |
| import org.geoserver.catalog.StoreInfo; | |
| import org.geoserver.catalog.StyleInfo; | |
| +import org.geoserver.catalog.TestHttpClientProvider; | |
| import org.geoserver.catalog.WorkspaceInfo; | |
| import org.geoserver.config.GeoServer; | |
| import org.geoserver.config.GeoServerDataDirectory; | |
| import org.geoserver.config.GeoServerLoaderProxy; | |
| import org.geoserver.config.ServiceInfo; | |
| import org.geoserver.data.test.SystemTestData; | |
| -import org.geoserver.data.test.TestData; | |
| import org.geoserver.logging.LoggingUtils; | |
| import org.geoserver.ows.util.CaseInsensitiveMap; | |
| import org.geoserver.ows.util.KvpUtils; | |
| @@ -95,14 +91,11 @@ import org.geoserver.security.password.GeoServerDigestPasswordEncoder; | |
| import org.geoserver.security.password.GeoServerPBEPasswordEncoder; | |
| import org.geoserver.security.password.GeoServerPlainTextPasswordEncoder; | |
| import org.geotools.data.DataUtilities; | |
| -import org.geotools.data.FeatureSource; | |
| -import org.geotools.data.ows.HTTPClient; | |
| import org.geotools.data.simple.SimpleFeatureSource; | |
| import org.geotools.util.logging.Log4JLoggerFactory; | |
| import org.geotools.util.logging.Logging; | |
| import org.geotools.xml.XSD; | |
| import org.junit.After; | |
| -import org.junit.AfterClass; | |
| import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; | |
| import org.springframework.security.core.GrantedAuthority; | |
| import org.springframework.security.core.authority.GrantedAuthorityImpl; | |
| @@ -445,7 +438,7 @@ public class GeoServerSystemTestSupport extends GeoServerBaseTestSupport<SystemT | |
| throws IOException { | |
| // TODO: expand test support to DataAccess FeatureSource | |
| FeatureTypeInfo ft = getFeatureTypeInfo(typeName); | |
| - return DataUtilities.simple((FeatureSource) ft.getFeatureSource(null, null)); | |
| + return DataUtilities.simple(ft.getFeatureSource(null, null)); | |
| } | |
| /** | |
| @@ -1749,6 +1742,7 @@ public class GeoServerSystemTestSupport extends GeoServerBaseTestSupport<SystemT | |
| try { | |
| Transformer tx = TransformerFactory.newInstance().newTransformer(); | |
| tx.setOutputProperty(OutputKeys.INDENT, "yes"); | |
| + tx.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); | |
| tx.transform(new DOMSource(document), new StreamResult(output)); | |
| } catch (Exception e) { | |
| throw new RuntimeException(e); | |
| diff --git a/src/maven/archetype/pom.xml b/src/maven/archetype/pom.xml | |
| index e75734b..4c33fed 100644 | |
| --- a/src/maven/archetype/pom.xml | |
| +++ b/src/maven/archetype/pom.xml | |
| @@ -11,7 +11,7 @@ txsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/m | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-maven</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.maven</groupId> | |
| diff --git a/src/maven/archetype/webPlugin/pom.xml b/src/maven/archetype/webPlugin/pom.xml | |
| index d9fe2fc..8b75273 100644 | |
| --- a/src/maven/archetype/webPlugin/pom.xml | |
| +++ b/src/maven/archetype/webPlugin/pom.xml | |
| @@ -5,7 +5,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.maven</groupId> | |
| <artifactId>gs-archetype</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.maven</groupId> | |
| diff --git a/src/maven/archetype/webPlugin/src/main/resources/archetype-resources/pom.xml b/src/maven/archetype/webPlugin/src/main/resources/archetype-resources/pom.xml | |
| index 7a41330..508a402 100644 | |
| --- a/src/maven/archetype/webPlugin/src/main/resources/archetype-resources/pom.xml | |
| +++ b/src/maven/archetype/webPlugin/src/main/resources/archetype-resources/pom.xml | |
| @@ -19,12 +19,12 @@ | |
| <dependency> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>web-core</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>web-core</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <classifier>tests</classifier> | |
| <scope>test</scope> | |
| </dependency> | |
| @@ -37,7 +37,7 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <classifier>tests</classifier> | |
| <scope>test</scope> | |
| </dependency> | |
| diff --git a/src/maven/archetype/wfsOutputFormat/pom.xml b/src/maven/archetype/wfsOutputFormat/pom.xml | |
| index f069010..961fdaa 100644 | |
| --- a/src/maven/archetype/wfsOutputFormat/pom.xml | |
| +++ b/src/maven/archetype/wfsOutputFormat/pom.xml | |
| @@ -5,7 +5,7 @@ | |
| <parent> | |
| <groupId>org.geoserver.maven</groupId> | |
| <artifactId>gs-archetype</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.maven</groupId> | |
| diff --git a/src/maven/archetype/wfsOutputFormat/src/main/resources/archetype-resources/pom.xml b/src/maven/archetype/wfsOutputFormat/src/main/resources/archetype-resources/pom.xml | |
| index e34daac..64c59c9 100644 | |
| --- a/src/maven/archetype/wfsOutputFormat/src/main/resources/archetype-resources/pom.xml | |
| +++ b/src/maven/archetype/wfsOutputFormat/src/main/resources/archetype-resources/pom.xml | |
| @@ -29,7 +29,7 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>wfs</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>junit</groupId> | |
| @@ -40,14 +40,14 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>wfs</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <classifier>tests</classifier> | |
| <scope>test</scope> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <classifier>tests</classifier> | |
| <scope>test</scope> | |
| </dependency> | |
| diff --git a/src/maven/config/pom.xml b/src/maven/config/pom.xml | |
| index a1b0b1c..6a85ec0 100644 | |
| --- a/src/maven/config/pom.xml | |
| +++ b/src/maven/config/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-maven</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.maven</groupId> | |
| diff --git a/src/maven/pom.xml b/src/maven/pom.xml | |
| index 0c714aa..ee65e6f 100644 | |
| --- a/src/maven/pom.xml | |
| +++ b/src/maven/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/ows/pom.xml b/src/ows/pom.xml | |
| index 473adf0..d5c5b37 100644 | |
| --- a/src/ows/pom.xml | |
| +++ b/src/ows/pom.xml | |
| @@ -10,7 +10,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/platform/pom.xml b/src/platform/pom.xml | |
| index a44791d..469a892 100644 | |
| --- a/src/platform/pom.xml | |
| +++ b/src/platform/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/platform/src/main/java/org/geoserver/platform/AdvancedDispatchFilter.java b/src/platform/src/main/java/org/geoserver/platform/AdvancedDispatchFilter.java | |
| index 5e142f8..39cad02 100644 | |
| --- a/src/platform/src/main/java/org/geoserver/platform/AdvancedDispatchFilter.java | |
| +++ b/src/platform/src/main/java/org/geoserver/platform/AdvancedDispatchFilter.java | |
| @@ -86,7 +86,9 @@ public class AdvancedDispatchFilter implements Filter { | |
| public String getPathInfo() { | |
| HttpServletRequest delegate = (HttpServletRequest) getRequest(); | |
| - if(delegate.getPathInfo().startsWith(servletPath)) | |
| + if (servletPath != null && | |
| + delegate.getPathInfo() != null && | |
| + delegate.getPathInfo().startsWith(servletPath)) | |
| return delegate.getPathInfo().substring(servletPath.length()); | |
| else | |
| return delegate.getPathInfo(); | |
| diff --git a/src/platform/src/test/java/org/geoserver/platform/AdvancedDispatchFilterTest.java b/src/platform/src/test/java/org/geoserver/platform/AdvancedDispatchFilterTest.java | |
| index f8f15dc..3c6315b 100644 | |
| --- a/src/platform/src/test/java/org/geoserver/platform/AdvancedDispatchFilterTest.java | |
| +++ b/src/platform/src/test/java/org/geoserver/platform/AdvancedDispatchFilterTest.java | |
| @@ -35,6 +35,32 @@ public class AdvancedDispatchFilterTest { | |
| } | |
| /** | |
| + * Need to handle a null result from getPathInfo. | |
| + */ | |
| + @Test | |
| + public void testHandlePathInfoNull() { | |
| + // Ensure null request succeeds | |
| + MockHttpServletRequest mockRequest = new MyMockRequest(); | |
| + mockRequest.setPathInfo(null); | |
| + assertNull(mockRequest.getPathInfo()); | |
| + | |
| + AdvancedDispatchFilter.AdvancedDispatchHttpRequest advRequest | |
| + = new AdvancedDispatchFilter.AdvancedDispatchHttpRequest(mockRequest); | |
| + assertNull(advRequest.getPathInfo()); | |
| + | |
| + // Ensure non-null servlet path is handled | |
| + advRequest.servletPath = "/bar"; | |
| + mockRequest.setPathInfo("/bar/foo"); | |
| + assertEquals("/bar/foo", mockRequest.getPathInfo()); | |
| + assertEquals("/foo", advRequest.getPathInfo()); | |
| + | |
| + // Ensure non-null request succeeds | |
| + mockRequest.setPathInfo("/foo"); | |
| + assertEquals("/foo", mockRequest.getPathInfo()); | |
| + assertEquals("/foo", advRequest.getPathInfo()); | |
| + } | |
| + | |
| + /** | |
| * Necessary due to special filtering out delegates with | |
| * name MockHttpServletRequest. | |
| */ | |
| diff --git a/src/pom.xml b/src/pom.xml | |
| index 162a8f1..f202614 100644 | |
| --- a/src/pom.xml | |
| +++ b/src/pom.xml | |
| @@ -13,7 +13,7 @@ | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| <packaging>pom</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer</name> | |
| <scm> | |
| @@ -52,9 +52,9 @@ | |
| <repositories> | |
| <repository> | |
| - <id>opengeo</id> | |
| - <name>OpenGeo Maven Repository</name> | |
| - <url>http://repo.opengeo.org/</url> | |
| + <id>boundless</id> | |
| + <name>Boundless Maven Repository</name> | |
| + <url>http://repo.boundlessgeo.com/main</url> | |
| <snapshots> | |
| <enabled>true</enabled> | |
| </snapshots> | |
| @@ -1199,8 +1199,8 @@ | |
| <version>2.12.3</version> | |
| <configuration> | |
| <runOrder>alphabetical</runOrder> | |
| - <source>1.5</source> | |
| - <target>1.5</target> | |
| + <source>1.7</source> | |
| + <target>1.7</target> | |
| <includes> | |
| <include>**/*Test.java</include> | |
| </includes> | |
| @@ -1261,7 +1261,7 @@ | |
| <descriptor>release/ext-importer.xml</descriptor> | |
| <descriptor>release/ext-importer-bdb.xml</descriptor> | |
| </descriptors> | |
| - <finalName>geoserver-2.6-beta</finalName> | |
| + <finalName>geoserver-2.6-RC1</finalName> | |
| <outputDirectory>${project.build.directory}/release</outputDirectory> | |
| </configuration> | |
| </plugin> | |
| @@ -1497,15 +1497,15 @@ | |
| <distributionManagement> | |
| <repository> | |
| - <id>opengeo</id> | |
| - <name>OpenGeo Maven Repository</name> | |
| - <url>dav:http://repo.opengeo.org</url> | |
| + <id>boundless</id> | |
| + <name>Boundless Maven Repository</name> | |
| + <url>http://repo.boundlessgeo.com/main</url> | |
| <uniqueVersion>false</uniqueVersion> | |
| </repository> | |
| <snapshotRepository> | |
| - <id>opengeo</id> | |
| - <name>OpenGeo Maven Repository</name> | |
| - <url>dav:http://repo.opengeo.org</url> | |
| + <id>boundless</id> | |
| + <name>Boundless Maven Repository</name> | |
| + <url>http://repo.boundlessgeo.com/main</url> | |
| <uniqueVersion>false</uniqueVersion> | |
| </snapshotRepository> | |
| </distributionManagement> | |
| @@ -1531,9 +1531,9 @@ | |
| </modules> | |
| <properties> | |
| - <gs.version>2.6-beta</gs.version> | |
| - <gt.version>12-beta</gt.version> | |
| - <gwc.version>1.6.0-beta</gwc.version> | |
| + <gs.version>2.6-RC1</gs.version> | |
| + <gt.version>12-RC1</gt.version> | |
| + <gwc.version>1.6.0-RC1</gwc.version> | |
| <spring.version>3.1.4.RELEASE</spring.version> | |
| <spring.security.version>3.1.0.RELEASE</spring.security.version> | |
| <poi.version>3.8</poi.version> | |
| diff --git a/src/release/RELEASE_NOTES.txt b/src/release/RELEASE_NOTES.txt | |
| index ffe58a1..9d35bab 100644 | |
| --- a/src/release/RELEASE_NOTES.txt | |
| +++ b/src/release/RELEASE_NOTES.txt | |
| @@ -1,11 +1,11 @@ | |
| -GeoServer 2.6-beta | |
| +GeoServer 2.6-RC1 | |
| ------------------- | |
| -This release was built on Jul 23, 2014. The changelog for this release can be found: | |
| +This release was built on Aug 18, 2014. The changelog for this release can be found: | |
| - http://jira.codehaus.org/browse/GEOS/fixforversion/20172 | |
| + http://jira.codehaus.org/browse/GEOS/fixforversion/20536 | |
| This release is based on: | |
| - GeoTools 12-beta | |
| - GeoWebCache 1.6.0-beta | |
| + GeoTools 12-RC1 | |
| + GeoWebCache 1.6.0-RC1 | |
| diff --git a/src/release/bin.xml b/src/release/bin.xml | |
| index 0727b0d..6dfd36c 100644 | |
| --- a/src/release/bin.xml | |
| +++ b/src/release/bin.xml | |
| @@ -8,7 +8,7 @@ | |
| <fileSet> | |
| <!-- the main webapp --> | |
| <directory>web/app/target/geoserver</directory> | |
| - <outputDirectory>geoserver-2.6-beta/webapps/geoserver</outputDirectory> | |
| + <outputDirectory>geoserver-2.6-RC1/webapps/geoserver</outputDirectory> | |
| <includes> | |
| <include>**/*</include> | |
| </includes> | |
| @@ -22,7 +22,7 @@ | |
| <fileSet> | |
| <!-- the data directory --> | |
| <directory>web/app/target/geoserver/data</directory> | |
| - <outputDirectory>geoserver-2.6-beta/data_dir</outputDirectory> | |
| + <outputDirectory>geoserver-2.6-RC1/data_dir</outputDirectory> | |
| <includes> | |
| <include>**/*</include> | |
| </includes> | |
| @@ -30,7 +30,7 @@ | |
| <fileSet> | |
| <!-- the libs needed to run jetty --> | |
| <directory>release/target/dependency</directory> | |
| - <outputDirectory>geoserver-2.6-beta/lib</outputDirectory> | |
| + <outputDirectory>geoserver-2.6-RC1/lib</outputDirectory> | |
| <includes> | |
| <include>ant-*.jar</include> | |
| <include>commons-el-*.jar</include> | |
| @@ -50,7 +50,7 @@ | |
| <!-- windows batch files --> | |
| <directory>release/bin</directory> | |
| <lineEnding>keep</lineEnding> | |
| - <outputDirectory>geoserver-2.6-beta/bin</outputDirectory> | |
| + <outputDirectory>geoserver-2.6-RC1/bin</outputDirectory> | |
| <includes> | |
| <include>*.bat</include> | |
| </includes> | |
| @@ -59,7 +59,7 @@ | |
| <!-- unix shell scripts --> | |
| <directory>release/bin</directory> | |
| <lineEnding>unix</lineEnding> | |
| - <outputDirectory>geoserver-2.6-beta/bin</outputDirectory> | |
| + <outputDirectory>geoserver-2.6-RC1/bin</outputDirectory> | |
| <fileMode>0755</fileMode> | |
| <directoryMode>0755</directoryMode> | |
| <includes> | |
| @@ -69,7 +69,7 @@ | |
| <fileSet> | |
| <!-- the README and other text files --> | |
| <directory>release</directory> | |
| - <outputDirectory>geoserver-2.6-beta</outputDirectory> | |
| + <outputDirectory>geoserver-2.6-RC1</outputDirectory> | |
| <includes> | |
| <include>LICENSE.txt</include> | |
| <include>GPL.txt</include> | |
| @@ -80,7 +80,7 @@ | |
| </fileSet> | |
| <fileSet> | |
| <directory>target</directory> | |
| - <outputDirectory>geoserver-2.6-beta</outputDirectory> | |
| + <outputDirectory>geoserver-2.6-RC1</outputDirectory> | |
| <includes> | |
| <include>VERSION.txt</include> | |
| </includes> | |
| @@ -88,7 +88,7 @@ | |
| <fileSet> | |
| <!-- jetty configuration --> | |
| <directory>release/jetty</directory> | |
| - <outputDirectory>geoserver-2.6-beta</outputDirectory> | |
| + <outputDirectory>geoserver-2.6-RC1</outputDirectory> | |
| <includes> | |
| <include>**/*</include> | |
| </includes> | |
| @@ -96,7 +96,7 @@ | |
| <fileSet> | |
| <!-- empty log directory --> | |
| <directory>release/logs</directory> | |
| - <outputDirectory>geoserver-2.6-beta</outputDirectory> | |
| + <outputDirectory>geoserver-2.6-RC1</outputDirectory> | |
| </fileSet> | |
| </fileSets> | |
| </assembly> | |
| diff --git a/src/release/bin/startup.bat b/src/release/bin/startup.bat | |
| index 0469a2d..aa83627 100755 | |
| --- a/src/release/bin/startup.bat | |
| +++ b/src/release/bin/startup.bat | |
| @@ -9,14 +9,17 @@ echo. | |
| set error=0 | |
| rem JAVA_HOME not defined | |
| -if "%JAVA_HOME%" == "" goto noJava | |
| +if "%JAVA_HOME%" == "" goto trySystemJava | |
| rem JAVA_HOME defined incorrectly | |
| if not exist "%JAVA_HOME%\bin\java.exe" goto badJava | |
| +rem Setup the java command and move on | |
| +set RUN_JAVA=%JAVA_HOME%\bin\java | |
| echo JAVA_HOME: %JAVA_HOME% | |
| echo. | |
| +:checkGeoServerHome | |
| rem GEOSERVER_HOME not defined | |
| if "%GEOSERVER_HOME%" == "" goto noHome | |
| @@ -25,8 +28,21 @@ if not exist "%GEOSERVER_HOME%\bin\startup.bat" goto badHome | |
| goto checkDataDir | |
| +:trySystemJava | |
| +for /f %%i in ('where java') do set RUN_JAVA=%%i | |
| +rem --- we might be on amd64 having only x86 jre installed --- | |
| +if "%RUN_JAVA%"=="" if DEFINED ProgramFiles(x86) if NOT "%PROCESSOR_ARCHITECTURE%"=="x86" ( | |
| + rem --- restart the batch in x86 mode--- | |
| + echo Warning: No java interpreter found in path. | |
| + echo Retry using Wow64 filesystem [32bit environment] redirection. | |
| + %SystemRoot%\SysWOW64\cmd.exe /c %0 %* | |
| + exit /b %ERRORLEVEL% | |
| + ) | |
| +if "RUN_JAVA%"=="" goto noJava | |
| +goto checkGeoServerHome | |
| + | |
| :noJava | |
| - echo The JAVA_HOME environment variable is not defined. | |
| + echo The JAVA_HOME environment variable is not defined, and no Java executable could be found. | |
| goto JavaFail | |
| :badJava | |
| @@ -34,9 +50,7 @@ goto JavaFail | |
| goto JavaFail | |
| :JavaFail | |
| - echo This environment variable is needed to run this program. | |
| - echo. | |
| - echo Set this environment variable via the following command: | |
| + echo Please install Java or, if present but not in the path, set this environment variable via the following command: | |
| echo set JAVA_HOME=[path to Java] | |
| echo Example: | |
| echo set JAVA_HOME=C:\Program Files\Java\jdk6 | |
| @@ -44,7 +58,6 @@ goto JavaFail | |
| set error=1 | |
| goto end | |
| - | |
| :noHome | |
| if exist ..\start.jar goto noHomeOK | |
| echo The GEOSERVER_HOME environment variable is not defined. | |
| @@ -114,7 +127,6 @@ goto run | |
| :run | |
| if "%JAVA_OPTS%" == "" (set JAVA_OPTS=-XX:MaxPermSize=128m) | |
| - set RUN_JAVA=%JAVA_HOME%\bin\java | |
| cd %GEOSERVER_HOME% | |
| echo Please wait while loading GeoServer... | |
| echo. | |
| diff --git a/src/release/installer/mac/.gitignore b/src/release/installer/mac/.gitignore | |
| new file mode 100644 | |
| index 0000000..a834b26 | |
| --- /dev/null | |
| +++ b/src/release/installer/mac/.gitignore | |
| @@ -0,0 +1,3 @@ | |
| +lib/ | |
| +*.zip | |
| +*.dmg | |
| diff --git a/src/release/installer/mac/GeoServer.app/Contents/Info.plist b/src/release/installer/mac/GeoServer.app/Contents/Info.plist | |
| deleted file mode 100644 | |
| index 7cd127b..0000000 | |
| --- a/src/release/installer/mac/GeoServer.app/Contents/Info.plist | |
| +++ /dev/null | |
| @@ -1,53 +0,0 @@ | |
| -<?xml version="1.0" encoding="UTF-8"?> | |
| -<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"> | |
| -<plist version="0.9"> | |
| -<dict> | |
| - <key>CFBundleName</key> | |
| - <string>GeoServer</string> | |
| - <key>CFBundleExecutable</key> | |
| - <string>geoserver</string> | |
| - <key>CFBundleIdentifier</key> | |
| - <string>org.geoserver</string> | |
| - <key>CFBundleVersion</key> | |
| - <string>2.5-SNAPSHOT</string> | |
| - <key>CFBundleAllowMixedLocalizations</key> | |
| - <string>true</string> | |
| - <key>CFBundleDevelopmentRegion</key> | |
| - <string>English</string> | |
| - <key>CFBundlePackageType</key> | |
| - <string>APPL</string> | |
| - <key>CFBundleShortVersionString</key> | |
| - <string>2.5-SNAPSHOT</string> | |
| - <key>CFBundleSignature</key> | |
| - <string>????</string> | |
| - <key>CFBundleGetInfoString</key> | |
| - <string>Open Source Server for Geospatial Data</string> | |
| - <key>CFBundleInfoDictionaryVersion</key> | |
| - <string>6.0</string> | |
| - <key>CFBundleIconFile</key> | |
| - <string>GeoServer.icns</string> | |
| - <key>Java</key> | |
| - <dict> | |
| - <key>WorkingDirectory</key> | |
| - <string>$APP_PACKAGE/Contents/Resources/Java</string> | |
| - <key>VMOptions</key> | |
| - <string>-DGEOSERVER_DATA_DIR=data_dir -DSTOP.PORT=8079 -DSTOP.KEY=geoserver -Xms128m -Xmx512m -XX:MaxPermSize=128m</string> | |
| - <key>MainClass</key> | |
| - <string>org.geoserver.console.Main</string> | |
| - <key>JVMVersion</key> | |
| - <string>1.5*</string> | |
| - <key>ClassPath</key> | |
| - <array> | |
| - <string>$JAVAROOT/console.jar</string> | |
| - <string>$JAVAROOT/start.jar</string> | |
| - <string>$JAVAROOT/lib/log4j-1.2.14.jar</string> | |
| - <string>$JAVAROOT/resources</string> | |
| - </array> | |
| - <key>Properties</key> | |
| - <dict> | |
| - <key>apple.laf.useScreenMenuBar</key> | |
| - <string>true</string> | |
| - </dict> | |
| - </dict> | |
| -</dict> | |
| -</plist> | |
| diff --git a/src/release/installer/mac/GeoServer.app/Contents/MacOS/geoserver b/src/release/installer/mac/GeoServer.app/Contents/MacOS/geoserver | |
| deleted file mode 100755 | |
| index 32c9831..0000000 | |
| Binary files a/src/release/installer/mac/GeoServer.app/Contents/MacOS/geoserver and /dev/null differ | |
| diff --git a/src/release/installer/mac/GeoServer.app/Contents/PkgInfo b/src/release/installer/mac/GeoServer.app/Contents/PkgInfo | |
| deleted file mode 100644 | |
| index bd04210..0000000 | |
| --- a/src/release/installer/mac/GeoServer.app/Contents/PkgInfo | |
| +++ /dev/null | |
| @@ -1 +0,0 @@ | |
| -APPL???? | |
| \ No newline at end of file | |
| diff --git a/src/release/installer/mac/GeoServer.app/Contents/Resources/GeoServer.icns b/src/release/installer/mac/GeoServer.app/Contents/Resources/GeoServer.icns | |
| deleted file mode 100644 | |
| index c05e1ea..0000000 | |
| Binary files a/src/release/installer/mac/GeoServer.app/Contents/Resources/GeoServer.icns and /dev/null differ | |
| diff --git a/src/release/installer/mac/GeoServer.app/Contents/Resources/Java/keepme.txt b/src/release/installer/mac/GeoServer.app/Contents/Resources/Java/keepme.txt | |
| deleted file mode 100644 | |
| index ec5a3c2..0000000 | |
| --- a/src/release/installer/mac/GeoServer.app/Contents/Resources/Java/keepme.txt | |
| +++ /dev/null | |
| @@ -1 +0,0 @@ | |
| -dummy file since git doesn't version empty directories | |
| diff --git a/src/release/installer/mac/GeoServer.icns b/src/release/installer/mac/GeoServer.icns | |
| new file mode 100644 | |
| index 0000000..c05e1ea | |
| Binary files /dev/null and b/src/release/installer/mac/GeoServer.icns differ | |
| diff --git a/src/release/installer/mac/README.md b/src/release/installer/mac/README.md | |
| new file mode 100644 | |
| index 0000000..3763db0 | |
| --- /dev/null | |
| +++ b/src/release/installer/mac/README.md | |
| @@ -0,0 +1,20 @@ | |
| +# GeoServer Mac Installer Build Instructions | |
| + | |
| +## Pre-requisites | |
| + | |
| +* OSX 10.8+ | |
| +* JDK 1.7+ | |
| +* Apache Ant | |
| +* Adobe [64-bit unit types](http://helpx.adobe.com/photoshop/kb/unit-type-conversion-error-applescript.html) | |
| + | |
| +## Building | |
| + | |
| +1. Copy the `-bin.zip` into this directory. | |
| +2. Run the `build.sh` script. | |
| + | |
| +Upon success a `.dmg` file should be created in the this directory. | |
| + | |
| +## Notes | |
| + | |
| +A [fork](https://bitbucket.org/infinitekind/appbundler) of the Oracle | |
| +appbundler is required to build out the installer. | |
| diff --git a/src/release/installer/mac/README.txt b/src/release/installer/mac/README.txt | |
| deleted file mode 100644 | |
| index 434fe36..0000000 | |
| --- a/src/release/installer/mac/README.txt | |
| +++ /dev/null | |
| @@ -1,10 +0,0 @@ | |
| -GeoServer Mac Installer Build Instructions | |
| ------------------------------------------- | |
| - | |
| -To generate the installer just run the `build.sh` script in this directory. It | |
| -requires that the -bin.zip artifact exists under `target/release` under the | |
| -root of the source tree. | |
| - | |
| -If using this with bin and mac bundles (from the build service). You will need to edit | |
| -GeoServer.app/Contents/Info.plish with the matching version number (see CFBundleVersion and | |
| -CFBundleShortVersionString). | |
| \ No newline at end of file | |
| diff --git a/src/release/installer/mac/build.sh b/src/release/installer/mac/build.sh | |
| index ce75520..d6cc4d1 100755 | |
| --- a/src/release/installer/mac/build.sh | |
| +++ b/src/release/installer/mac/build.sh | |
| @@ -9,28 +9,13 @@ function check_rc() { | |
| fi | |
| } | |
| -APP=GeoServer.app | |
| -VER=$( cat ${APP}/Contents/Info.plist | grep -A 1 CFBundleVersion | tail -n 1 | sed 's/.*<string>//g' | sed 's/<\/string>//g' ) | |
| -BIN=../../../target/release/geoserver-$VER-bin.zip | |
| -if [ ! -e $BIN ]; then | |
| - echo "$BIN does not exist" | |
| - exit 1 | |
| -fi | |
| +# build the app | |
| +ant | |
| +check_rc $? "build app" | |
| -# unpack the bin archive | |
| -RES=${APP}/Contents/Resources/Java | |
| -rm -rf $RES/* | |
| -unzip $BIN -d $RES | |
| -mv $RES/geoserver-$VER/* $RES | |
| -rmdir $RES/geoserver-$VER | |
| -check_rc $? "unpack bin archive" | |
| - | |
| -# build the console app | |
| -pushd console > /dev/null | |
| -mvn clean install | |
| -check_rc $? "console build" | |
| -cp target/console*.jar ../$RES/console.jar | |
| -popd > /dev/null | |
| +APP_NAME=GeoServer.app | |
| +APP=target/$APP_NAME | |
| +VER=$( cat ${APP}/Contents/Info.plist | grep -A 1 CFBundleVersion | tail -n 1 | sed 's/.*<string>//g' | sed 's/<\/string>//g' ) | |
| VOL=geoserver-$VER | |
| @@ -91,7 +76,7 @@ echo ' | |
| set arrangement of theViewOptions to not arranged | |
| set icon size of theViewOptions to 104 | |
| set background picture of theViewOptions to file ".background:'${DMG_BACK}'" | |
| - set position of item "'${APP}'" of container window to {120, 180} | |
| + set position of item "'${APP_NAME}'" of container window to {120, 180} | |
| set position of item "'Applications'" of container window to {400, 180} | |
| close | |
| open | |
| diff --git a/src/release/installer/mac/build.xml b/src/release/installer/mac/build.xml | |
| new file mode 100644 | |
| index 0000000..d26b3aa | |
| --- /dev/null | |
| +++ b/src/release/installer/mac/build.xml | |
| @@ -0,0 +1,120 @@ | |
| +<project name="osx-installer" default="build" basedir="."> | |
| + | |
| + <property name="work.dir" value="target"/> | |
| + | |
| + <target name="bootstrap"> | |
| + <mkdir dir="lib"/> | |
| + <get dest="lib" usetimestamp="true" | |
| + src="http://repo.boundlessgeo.com/main/com/oracle/appbundler/1.0ea/appbundler-1.0ea.jar"/> | |
| + <get dest="lib" usetimestamp="true" | |
| + src="http://central.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar"/> | |
| + </target> | |
| + | |
| + <target name="clean"> | |
| + <delete dir="${work.dir}"/> | |
| + </target> | |
| + | |
| + <target name="init" depends="clean,bootstrap"> | |
| + <!-- task definitions we need --> | |
| + <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" | |
| + classpath="lib/appbundler-1.0ea.jar" /> | |
| + | |
| + <taskdef resource="net/sf/antcontrib/antlib.xml"> | |
| + <classpath> | |
| + <pathelement location="lib/ant-contrib-1.0b3.jar"/> | |
| + </classpath> | |
| + </taskdef> | |
| + | |
| + <!-- check for build file --> | |
| + <pathconvert property="gs.bin" setonempty="false"> | |
| + <path id="gs.bin.path"> | |
| + <fileset dir="${basedir}" includes="geoserver-*-bin.zip"/> | |
| + </path> | |
| + </pathconvert> | |
| + <fail unless="gs.bin" | |
| + message="GeoServer build not found. Copy -bin.zip into this directory."/> | |
| + | |
| + <!-- extract version number --> | |
| + <property name="gs.bin.file" refid="gs.bin.path"/> | |
| + <propertyregex property="gs.version" input="${gs.bin.file}" | |
| + regexp="geoserver-(.*)-bin.zip" select="\1"/> | |
| + | |
| + <fail unless="gs.version" | |
| + message="Unable to determine GeoServer version number from bin file."/> | |
| + </target> | |
| + | |
| + <target name="build" depends="init"> | |
| + <mkdir dir="${work.dir}"/> | |
| + | |
| + <unzip src="${gs.bin.file}" dest="${work.dir}"/> | |
| + <property name="gs.dir" value="${work.dir}/geoserver-${gs.version}"/> | |
| + | |
| + <antcall target="build-console"/> | |
| + <antcall target="assemble"/> | |
| + </target> | |
| + | |
| + <target name="build-console"> | |
| + <property name="console.dir" value="${work.dir}/console"/> | |
| + <mkdir dir="${console.dir}"/> | |
| + <javac srcdir="console/src/main/java" destdir="${console.dir}" debug="true"> | |
| + <classpath> | |
| + <fileset dir="${gs.dir}"> | |
| + <include name="start.jar"/> | |
| + </fileset> | |
| + <fileset dir="${gs.dir}/lib"> | |
| + <include name="jetty-*.jar"/> | |
| + <include name="log4j-*.jar"/> | |
| + </fileset> | |
| + </classpath> | |
| + </javac> | |
| + <copy todir="${console.dir}"> | |
| + <fileset dir="console/src/main/resources" includes="**/*"/> | |
| + </copy> | |
| + <jar destfile="${gs.dir}/gs-console-${gs.version}.jar" | |
| + basedir="${console.dir}"/> | |
| + <jar destfile="${gs.dir}/log4j-config.jar" basedir="${gs.dir}/resources"/> | |
| + </target> | |
| + | |
| + <target name="assemble"> | |
| + <property name="app.dir" value="${work.dir}"/> | |
| + <property environment="env"/> | |
| + | |
| + <path id="gs.app.classpath"> | |
| + <fileset dir="${gs.dir}" includes="*.jar"/> | |
| + <fileset dir="${gs.dir}/lib" includes="log4j*.jar"/> | |
| + <pathelement path="${gs.dir}/resources"/> | |
| + </path> | |
| + | |
| + <bundleapp | |
| + classpathref="gs.app.classpath" | |
| + outputdirectory="${app.dir}" | |
| + name="GeoServer" | |
| + displayname="GeoServer" | |
| + identifier="org.geoserver" | |
| + executableName="GeoServer" | |
| + version="${gs.version}" | |
| + shortversion="${gs.version}" | |
| + icon="GeoServer.icns" | |
| + mainclassname="org.geoserver.console.GeoServer" | |
| + workingDirectory="$APP_ROOT/Contents/Java"> | |
| + | |
| + <runtime dir="${env.JAVA_HOME}"/> | |
| + | |
| + <option value="-DGEOSERVER_DATA_DIR=data_dir"/> | |
| + <option value="-DSTOP.PORT=8079"/> | |
| + <option value="-DSTOP.KEY=geoserver"/> | |
| + <option value="-Xms128m"/> | |
| + <option value="-Xmx512m"/> | |
| + <option value="-XX:MaxPermSize=128m"/> | |
| + <option value="-Dapple.laf.useScreenMenuBar=true"/> | |
| + | |
| + <!-- Workaround since the icon parameter for bundleapp doesn't work --> | |
| + <option value="-Xdock:icon=Contents/Resources/GeoServer.icns"/> | |
| + | |
| + </bundleapp> | |
| + <copy todir="${app.dir}/GeoServer.app/Contents/Java"> | |
| + <fileset dir="${gs.dir}" includes="**/*"/> | |
| + </copy> | |
| + </target> | |
| + | |
| +</project> | |
| \ No newline at end of file | |
| diff --git a/src/release/installer/mac/console/pom.xml b/src/release/installer/mac/console/pom.xml | |
| index 4fc83ab..2b915bd 100644 | |
| --- a/src/release/installer/mac/console/pom.xml | |
| +++ b/src/release/installer/mac/console/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>console</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <description>GeoServer Console Monitor</description> | |
| <name>GeoServer Console</name> | |
| diff --git a/src/release/installer/mac/console/src/main/java/org/geoserver/console/Browser.java b/src/release/installer/mac/console/src/main/java/org/geoserver/console/Browser.java | |
| index d3d29fa..dab9412 100644 | |
| --- a/src/release/installer/mac/console/src/main/java/org/geoserver/console/Browser.java | |
| +++ b/src/release/installer/mac/console/src/main/java/org/geoserver/console/Browser.java | |
| @@ -242,35 +242,38 @@ import java.lang.reflect.Method; | |
| loadedWithoutErrors = true; | |
| String osName = System.getProperty ("os.name"); | |
| if (osName.startsWith ("Mac OS")) { | |
| - String mrjVersion = System.getProperty("mrj.version"); | |
| - String majorMRJVersion = mrjVersion.substring(0, 3); | |
| - try { | |
| - double version = Double.valueOf(majorMRJVersion).doubleValue(); | |
| - if (version == 2) { | |
| - jvm = MRJ_2_0; | |
| - } | |
| - else if (version >= 2.1 && version < 3) { | |
| - // Assume that all 2.x versions of MRJ work the same. | |
| - // MRJ 2.1 actually works via Runtime.exec() and 2.2 supports that | |
| - // but has an openURL() method as well that we currently ignore. | |
| - jvm = MRJ_2_1; | |
| - } | |
| - else if (version == 3.0) { | |
| - jvm = MRJ_3_0; | |
| - } | |
| - else if (version >= 3.1) { | |
| - // Assume that all 3.1 and later versions of MRJ work the same. | |
| - jvm = MRJ_3_1; | |
| - } | |
| - else { | |
| - loadedWithoutErrors = false; | |
| - errorMessage = "Unsupported MRJ version: " + version; | |
| - } | |
| - } | |
| - catch (NumberFormatException nfe) { | |
| - loadedWithoutErrors = false; | |
| - errorMessage = "Invalid MRJ version: " + mrjVersion; | |
| - } | |
| + //JD: Oracle JDK's >= 7 don't seem to set mrj.version anymore, just | |
| + // assuming latest | |
| + jvm = MRJ_3_1; | |
| + // String mrjVersion = System.getProperty("mrj.version"); | |
| + // String majorMRJVersion = mrjVersion.substring(0, 3); | |
| + // try { | |
| + // double version = Double.valueOf(majorMRJVersion).doubleValue(); | |
| + // if (version == 2) { | |
| + // jvm = MRJ_2_0; | |
| + // } | |
| + // else if (version >= 2.1 && version < 3) { | |
| + // // Assume that all 2.x versions of MRJ work the same. | |
| + // // MRJ 2.1 actually works via Runtime.exec() and 2.2 supports that | |
| + // // but has an openURL() method as well that we currently ignore. | |
| + // jvm = MRJ_2_1; | |
| + // } | |
| + // else if (version == 3.0) { | |
| + // jvm = MRJ_3_0; | |
| + // } | |
| + // else if (version >= 3.1) { | |
| + // // Assume that all 3.1 and later versions of MRJ work the same. | |
| + // jvm = MRJ_3_1; | |
| + // } | |
| + // else { | |
| + // loadedWithoutErrors = false; | |
| + // errorMessage = "Unsupported MRJ version: " + version; | |
| + // } | |
| + // } | |
| + // catch (NumberFormatException nfe) { | |
| + // loadedWithoutErrors = false; | |
| + // errorMessage = "Invalid MRJ version: " + mrjVersion; | |
| + // } | |
| } | |
| else if (osName.startsWith("Windows")) { | |
| if (osName.indexOf("9") != -1) { | |
| diff --git a/src/release/installer/mac/console/src/main/java/org/geoserver/console/GeoServer.java b/src/release/installer/mac/console/src/main/java/org/geoserver/console/GeoServer.java | |
| new file mode 100644 | |
| index 0000000..5424ba1 | |
| --- /dev/null | |
| +++ b/src/release/installer/mac/console/src/main/java/org/geoserver/console/GeoServer.java | |
| @@ -0,0 +1,32 @@ | |
| +/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| + * This code is licensed under the GPL 2.0 license, available at the root | |
| + * application directory. | |
| + */ | |
| +package org.geoserver.console; | |
| + | |
| +import org.geoserver.console.GeoServerConsole.DebugHandler; | |
| +import org.geoserver.console.GeoServerConsole.Handler; | |
| +import org.geoserver.console.GeoServerConsole.ProductionHandler; | |
| + | |
| +/** | |
| + * Entrance point to {@link GeoServerConsole} application. | |
| + * | |
| + * @author Justin Deoliveira, OpenGEO | |
| + */ | |
| +public class GeoServer { | |
| + | |
| + public static void main(String[] args) throws Exception { | |
| + // System.out.println(System.getProperty("user.dir")); | |
| + System.out.println(System.getProperty("java.class.path")); | |
| + Handler h = null; | |
| + for ( int i = 0; args != null && i < args.length; i++) { | |
| + if ( "--debug".equalsIgnoreCase( args[i] ) ) { | |
| + h = new DebugHandler(); | |
| + } | |
| + } | |
| + if ( h == null ) { | |
| + h = new ProductionHandler(); | |
| + } | |
| + GeoServerConsole console = new GeoServerConsole( h ); | |
| + } | |
| +} | |
| diff --git a/src/release/installer/mac/console/src/main/java/org/geoserver/console/Main.java b/src/release/installer/mac/console/src/main/java/org/geoserver/console/Main.java | |
| deleted file mode 100644 | |
| index b5562ce..0000000 | |
| --- a/src/release/installer/mac/console/src/main/java/org/geoserver/console/Main.java | |
| +++ /dev/null | |
| @@ -1,30 +0,0 @@ | |
| -/* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved. | |
| - * This code is licensed under the GPL 2.0 license, available at the root | |
| - * application directory. | |
| - */ | |
| -package org.geoserver.console; | |
| - | |
| -import org.geoserver.console.GeoServerConsole.DebugHandler; | |
| -import org.geoserver.console.GeoServerConsole.Handler; | |
| -import org.geoserver.console.GeoServerConsole.ProductionHandler; | |
| - | |
| -/** | |
| - * Entrance point to {@link GeoServerConsole} application. | |
| - * | |
| - * @author Justin Deoliveira, OpenGEO | |
| - */ | |
| -public class Main { | |
| - | |
| - public static void main(String[] args) throws Exception { | |
| - Handler h = null; | |
| - for ( int i = 0; args != null && i < args.length; i++) { | |
| - if ( "--debug".equalsIgnoreCase( args[i] ) ) { | |
| - h = new DebugHandler(); | |
| - } | |
| - } | |
| - if ( h == null ) { | |
| - h = new ProductionHandler(); | |
| - } | |
| - GeoServerConsole console = new GeoServerConsole( h ); | |
| - } | |
| -} | |
| diff --git a/src/release/installer/win/GeoServerEXE.nsi b/src/release/installer/win/GeoServerEXE.nsi | |
| index c55828d..fa5809f 100644 | |
| --- a/src/release/installer/win/GeoServerEXE.nsi | |
| +++ b/src/release/installer/win/GeoServerEXE.nsi | |
| @@ -2,7 +2,7 @@ | |
| ; Define your application name | |
| !define APPNAME "GeoServer" | |
| -!define VERSION "2.6-beta" | |
| +!define VERSION "2.6-RC1" | |
| ;!define LONGVERSION "2.0.0.0" | |
| !define APPNAMEANDVERSION "${APPNAME} ${VERSION}" | |
| @@ -802,7 +802,8 @@ Section "Main" SectionMain | |
| ; Security (of sorts) | |
| ${If} $IsManual == 1 ; manual | |
| - AccessControl::GrantOnFile "$INSTDIR\" "(BU)" "FullAccess" | |
| + AccessControl::GrantOnFile "$INSTDIR\logs" "(S-1-5-32-545)" "FullAccess" | |
| + AccessControl::GrantOnFile "$INSTDIR\data_dir" "(S-1-5-32-545)" "FullAccess" | |
| ${ElseIf} $IsManual == 0 ; service | |
| AccessControl::GrantOnFile "$INSTDIR\logs" "NT AUTHORITY\Network Service" "FullAccess" | |
| AccessControl::GrantOnFile "$DataDir" "NT AUTHORITY\Network Service" "FullAccess" | |
| diff --git a/src/release/installer/win/wrapper.conf b/src/release/installer/win/wrapper.conf | |
| index 0269318..3fac856 100644 | |
| --- a/src/release/installer/win/wrapper.conf | |
| +++ b/src/release/installer/win/wrapper.conf | |
| @@ -74,10 +74,10 @@ wrapper.syslog.loglevel=NONE | |
| # service can then be reinstalled. | |
| # Name of the service | |
| -wrapper.ntservice.name=GeoServer 2.6-beta | |
| +wrapper.ntservice.name=GeoServer 2.6-RC1 | |
| # Display name of the service | |
| -wrapper.ntservice.displayname=GeoServer 2.6-beta | |
| +wrapper.ntservice.displayname=GeoServer 2.6-RC1 | |
| # Description of the service | |
| wrapper.ntservice.description=GeoServer is an open source software server written in Java that allows users to share and edit geospatial data. | |
| diff --git a/src/release/pom.xml b/src/release/pom.xml | |
| index 290efb8..2830555 100644 | |
| --- a/src/release/pom.xml | |
| +++ b/src/release/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-release</artifactId> | |
| diff --git a/src/release/src.xml b/src/release/src.xml | |
| index c97be92..b4ad6ed 100644 | |
| --- a/src/release/src.xml | |
| +++ b/src/release/src.xml | |
| @@ -28,7 +28,7 @@ | |
| <include>org.geoserver:gs-release</include> | |
| </includes> | |
| <sources> | |
| - <outputDirectory>geoserver-2.6-beta/${artifactId}/</outputDirectory> | |
| + <outputDirectory>geoserver-2.6-RC1/${artifactId}/</outputDirectory> | |
| <excludes> | |
| <exclude>target</exclude> | |
| <exclude>**/target</exclude> | |
| @@ -39,7 +39,7 @@ | |
| <fileSets> | |
| <fileSet> | |
| <directory>.</directory> | |
| - <outputDirectory>geoserver-2.6-beta/</outputDirectory> | |
| + <outputDirectory>geoserver-2.6-RC1/</outputDirectory> | |
| <includes> | |
| <include>pom.xml</include> | |
| </includes> | |
| @@ -55,7 +55,7 @@ | |
| </fileSet> | |
| <fileSet> | |
| <directory>target</directory> | |
| - <outputDirectory>geoserver-2.6-beta</outputDirectory> | |
| + <outputDirectory>geoserver-2.6-RC1</outputDirectory> | |
| <includes> | |
| <include>VERSION.txt</include> | |
| </includes> | |
| diff --git a/src/rest/pom.xml b/src/rest/pom.xml | |
| index e3b9e43..e27370f 100644 | |
| --- a/src/rest/pom.xml | |
| +++ b/src/rest/pom.xml | |
| @@ -13,7 +13,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/restconfig/pom.xml b/src/restconfig/pom.xml | |
| index d8fac44..06a8a22 100644 | |
| --- a/src/restconfig/pom.xml | |
| +++ b/src/restconfig/pom.xml | |
| @@ -11,7 +11,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| @@ -23,17 +23,22 @@ | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-rest</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-wms</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| + </dependency> | |
| + <dependency> | |
| + <groupId>org.geoserver</groupId> | |
| + <artifactId>gs-wcs</artifactId> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geotools</groupId> | |
| @@ -41,17 +46,6 @@ | |
| <version>${gt.version}</version> | |
| </dependency> | |
| <dependency> | |
| - <groupId>jdom</groupId> | |
| - <artifactId>jdom</artifactId> | |
| - <version>1.0</version> | |
| - <exclusions> | |
| - <exclusion> | |
| - <groupId>xerces</groupId> | |
| - <artifactId>xerces</artifactId> | |
| - </exclusion> | |
| - </exclusions> | |
| - </dependency> | |
| - <dependency> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-main</artifactId> | |
| <version>${project.version}</version> | |
| diff --git a/src/restconfig/src/main/java/org/geoserver/catalog/rest/CatalogResourceBase.java b/src/restconfig/src/main/java/org/geoserver/catalog/rest/CatalogResourceBase.java | |
| index bf56462..baac9c8 100644 | |
| --- a/src/restconfig/src/main/java/org/geoserver/catalog/rest/CatalogResourceBase.java | |
| +++ b/src/restconfig/src/main/java/org/geoserver/catalog/rest/CatalogResourceBase.java | |
| @@ -161,6 +161,11 @@ public abstract class CatalogResourceBase extends ReflectiveResource { | |
| checkAuthenticationForAdminRole(); | |
| } | |
| + /** | |
| + * Uses messages as a template to update resource. | |
| + * @param message Possibly incomplete ResourceInfo used to update resource | |
| + * @param resource Original resource (to be saved in catalog after modification) | |
| + */ | |
| protected void calculateOptionalFields(ResourceInfo message, ResourceInfo resource) { | |
| Form form = getRequest().getResourceRef().getQueryAsForm(); | |
| String calculate = form.getFirstValue("recalculate", true); | |
| diff --git a/src/restconfig/src/main/java/org/geoserver/catalog/rest/FeatureTypeResource.java b/src/restconfig/src/main/java/org/geoserver/catalog/rest/FeatureTypeResource.java | |
| index cc2ab05..a5d6ea2 100644 | |
| --- a/src/restconfig/src/main/java/org/geoserver/catalog/rest/FeatureTypeResource.java | |
| +++ b/src/restconfig/src/main/java/org/geoserver/catalog/rest/FeatureTypeResource.java | |
| @@ -5,8 +5,10 @@ | |
| package org.geoserver.catalog.rest; | |
| import java.io.IOException; | |
| +import java.io.Serializable; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| +import java.util.Map; | |
| import java.util.logging.Level; | |
| import org.geoserver.catalog.AttributeTypeInfo; | |
| @@ -23,9 +25,18 @@ import org.geoserver.rest.format.DataFormat; | |
| import org.geotools.data.DataAccess; | |
| import org.geotools.data.DataStore; | |
| import org.geotools.data.FeatureSource; | |
| +import org.geotools.data.Transaction; | |
| +import org.geotools.data.simple.SimpleFeatureSource; | |
| +import org.geotools.data.store.ContentDataStore; | |
| +import org.geotools.data.store.ContentEntry; | |
| +import org.geotools.data.store.ContentFeatureSource; | |
| +import org.geotools.data.store.ContentState; | |
| import org.geotools.feature.NameImpl; | |
| import org.geotools.feature.simple.SimpleFeatureTypeBuilder; | |
| +import org.opengis.feature.Feature; | |
| import org.opengis.feature.simple.SimpleFeatureType; | |
| +import org.opengis.feature.type.FeatureType; | |
| +import org.opengis.feature.type.Name; | |
| import org.restlet.Context; | |
| import org.restlet.data.Method; | |
| import org.restlet.data.Request; | |
| @@ -229,20 +240,33 @@ public class FeatureTypeResource extends AbstractCatalogResource { | |
| @Override | |
| protected void handleObjectPut(Object object) throws Exception { | |
| - FeatureTypeInfo ft = (FeatureTypeInfo) object; | |
| + FeatureTypeInfo featureTypeUpdate = (FeatureTypeInfo) object; | |
| String workspace = getAttribute("workspace"); | |
| String datastore = getAttribute("datastore"); | |
| String featuretype = getAttribute("featuretype"); | |
| DataStoreInfo ds = catalog.getDataStoreByName(workspace, datastore); | |
| - FeatureTypeInfo original = catalog.getFeatureTypeByDataStore( ds, featuretype ); | |
| - new CatalogBuilder(catalog).updateFeatureType(original,ft); | |
| - calculateOptionalFields(ft, original); | |
| - catalog.save( original ); | |
| + FeatureTypeInfo featureTypeInfo = catalog.getFeatureTypeByDataStore( ds, featuretype ); | |
| + Map<String, Serializable> parametersCheck = featureTypeInfo.getStore().getConnectionParameters(); | |
| - clear(original); | |
| - LOGGER.info( "PUT feature type" + datastore + "," + featuretype ); | |
| + CatalogBuilder helper = new CatalogBuilder(catalog); | |
| + helper.updateFeatureType(featureTypeInfo,featureTypeUpdate); | |
| + calculateOptionalFields(featureTypeUpdate, featureTypeInfo); | |
| + catalog.save( featureTypeInfo ); | |
| + catalog.getResourcePool().clear(featureTypeInfo); | |
| + | |
| + Map<String, Serializable> parameters = featureTypeInfo.getStore().getConnectionParameters(); | |
| + MetadataMap mdm = featureTypeInfo.getMetadata(); | |
| + boolean virtual = mdm != null && mdm.containsKey(FeatureTypeInfo.JDBC_VIRTUAL_TABLE); | |
| + | |
| + if( !virtual && parameters.equals(parametersCheck)){ | |
| + LOGGER.info( "PUT FeatureType" + datastore + "," + featuretype + " updated metadata only"); | |
| + } | |
| + else { | |
| + LOGGER.info( "PUT featureType" + datastore + "," + featuretype + " updated metadata and data access" ); | |
| + catalog.getResourcePool().clear(featureTypeInfo.getStore()); | |
| + } | |
| } | |
| @Override | |
| @@ -275,15 +299,37 @@ public class FeatureTypeResource extends AbstractCatalogResource { | |
| } | |
| catalog.remove( ft ); | |
| - clear(ft); | |
| + // clear from resource pool | |
| + catalog.getResourcePool().clear(ft); | |
| + List<FeatureTypeInfo> siblings = catalog.getFeatureTypesByDataStore(ds); | |
| + if( siblings.size() == 0 ){ | |
| + // clean up cached DataAccess if no longer in use | |
| + catalog.getResourcePool().clear(ds); | |
| + } | |
| + else { | |
| + boolean flush = false; | |
| + try { | |
| + DataAccess<?,?> dataStore = catalog.getResourcePool().getDataStore( ds ); | |
| + if( dataStore instanceof ContentDataStore ){ | |
| + // ask JDBC DataStore to forget cached column information | |
| + Name name = ft.getQualifiedNativeName(); | |
| + ContentDataStore contentDataStore = (ContentDataStore) dataStore; | |
| + ContentFeatureSource featureSource = contentDataStore.getFeatureSource(name,Transaction.AUTO_COMMIT); | |
| + featureSource.getState().flush(); | |
| + flush = true; | |
| + } | |
| + } catch( Exception e ) { | |
| + LOGGER.warning( "Unable to flush '" + ft.getQualifiedNativeName() ); | |
| + LOGGER.log(Level.FINE, "", e ); | |
| + } | |
| + if( !flush ){ | |
| + // Original heavy handed way to force "flush"? seems a bad idea | |
| + catalog.getResourcePool().clear(ds); | |
| + } | |
| + } | |
| LOGGER.info( "DELETE feature type" + datastore + "," + featuretype ); | |
| } | |
| - | |
| - void clear(FeatureTypeInfo info) { | |
| - catalog.getResourcePool().clear(info); | |
| - catalog.getResourcePool().clear(info.getStore()); | |
| - } | |
| @Override | |
| protected void configurePersister(XStreamPersister persister, DataFormat format) { | |
| diff --git a/src/restconfig/src/test/java/org/geoserver/catalog/rest/FeatureTypeTest.java b/src/restconfig/src/test/java/org/geoserver/catalog/rest/FeatureTypeTest.java | |
| index 62da17d..e506716 100644 | |
| --- a/src/restconfig/src/test/java/org/geoserver/catalog/rest/FeatureTypeTest.java | |
| +++ b/src/restconfig/src/test/java/org/geoserver/catalog/rest/FeatureTypeTest.java | |
| @@ -10,20 +10,25 @@ import java.io.BufferedWriter; | |
| import java.io.ByteArrayOutputStream; | |
| import java.io.IOException; | |
| import java.io.OutputStreamWriter; | |
| +import java.util.List; | |
| import java.util.zip.ZipEntry; | |
| import java.util.zip.ZipOutputStream; | |
| import net.sf.json.JSON; | |
| import net.sf.json.JSONObject; | |
| +import org.geoserver.catalog.AttributeTypeInfo; | |
| +import org.geoserver.catalog.DataStoreInfo; | |
| import org.geoserver.catalog.FeatureTypeInfo; | |
| import org.geoserver.catalog.Keyword; | |
| import org.geoserver.catalog.LayerInfo; | |
| import org.geoserver.data.test.SystemTestData; | |
| +import org.geotools.data.DataAccess; | |
| import org.geotools.geometry.jts.ReferencedEnvelope; | |
| import org.geotools.referencing.CRS; | |
| import org.junit.Before; | |
| import org.junit.Test; | |
| +import org.opengis.feature.Feature; | |
| import org.opengis.feature.type.FeatureType; | |
| import org.w3c.dom.Document; | |
| import org.w3c.dom.Element; | |
| @@ -291,8 +296,19 @@ public class FeatureTypeTest extends CatalogRESTTestSupport { | |
| assertEquals( "new title", ft.getTitle() ); | |
| } | |
| + /** | |
| + * Check feature type modification involving calculation of bounds. | |
| + * | |
| + * Update: Ensure feature type modification does not reset ResourcePool DataStoreCache | |
| + */ | |
| + @SuppressWarnings("rawtypes") | |
| @Test | |
| public void testPutWithCalculation() throws Exception { | |
| + DataStoreInfo dataStoreInfo = getCatalog().getDataStoreByName("sf","sf"); | |
| + String dataStoreId = dataStoreInfo.getId(); | |
| + DataAccess dataAccessBefore = dataStoreInfo.getDataStore(null); | |
| + assertSame("ResourcePool DataStoreCache", dataAccessBefore, getCatalog().getResourcePool().getDataStoreCache().get( dataStoreId )); | |
| + | |
| String clearLatLonBoundingBox = | |
| "<featureType>" | |
| + "<nativeBoundingBox>" | |
| @@ -312,6 +328,11 @@ public class FeatureTypeTest extends CatalogRESTTestSupport { | |
| Document dom = getAsDOM(path + ".xml"); | |
| assertXpathEvaluatesTo("0.0", "/featureType/latLonBoundingBox/minx", dom); | |
| + // confirm ResourcePoool cache of DataStore is unchanged | |
| + DataAccess dataAccessAfter = getCatalog().getDataStoreByName("sf","sf").getDataStore(null); | |
| + assertSame( "ResourcePool DataStoreCache check 1", dataAccessBefore, dataAccessAfter ); | |
| + assertSame("ResourcePool DataStoreCache", dataAccessBefore, getCatalog().getResourcePool().getDataStoreCache().get( dataStoreId )); | |
| + | |
| String updateNativeBounds = | |
| "<featureType>" | |
| + "<srs>EPSG:3785</srs>" | |
| @@ -330,6 +351,10 @@ public class FeatureTypeTest extends CatalogRESTTestSupport { | |
| dom = getAsDOM(path + ".xml"); | |
| print(dom); | |
| assertXpathExists("/featureType/latLonBoundingBox/minx[text()!='0.0']", dom); | |
| + | |
| + dataAccessAfter = getCatalog().getDataStoreByName("sf","sf").getDataStore(null); | |
| + assertSame( "ResourcePool DataStoreCache check 2", dataAccessBefore, dataAccessAfter ); | |
| + assertSame("ResourcePool DataStoreCache", dataAccessBefore, getCatalog().getResourcePool().getDataStoreCache().get( dataStoreId )); | |
| } | |
| @Test | |
| @@ -345,13 +370,27 @@ public class FeatureTypeTest extends CatalogRESTTestSupport { | |
| @Test | |
| public void testDelete() throws Exception { | |
| - assertNotNull( catalog.getFeatureTypeByName("sf", "PrimitiveGeoFeature")); | |
| - for (LayerInfo l : catalog.getLayers( catalog.getFeatureTypeByName("sf", "PrimitiveGeoFeature") ) ) { | |
| + FeatureTypeInfo featureType = catalog.getFeatureTypeByName("sf", "PrimitiveGeoFeature"); | |
| + String featureTypeId = featureType.getId(); | |
| + String dataStoreId = featureType.getStore().getId(); | |
| + | |
| + assertNotNull( "PrmitiveGeoFeature available", featureType ); | |
| + for (LayerInfo l : catalog.getLayers( featureType ) ) { | |
| catalog.remove(l); | |
| } | |
| assertEquals( 200, | |
| deleteAsServletResponse( "/rest/workspaces/sf/datastores/sf/featuretypes/PrimitiveGeoFeature").getStatusCode()); | |
| assertNull( catalog.getFeatureTypeByName("sf", "PrimitiveGeoFeature")); | |
| + | |
| + if( catalog.getResourcePool().getFeatureTypeAttributeCache().containsKey( featureTypeId ) ){ | |
| + List<AttributeTypeInfo> attributesList = catalog.getResourcePool().getFeatureTypeAttributeCache().get( featureTypeId ); | |
| + assertNull( "attributes cleared", attributesList ); | |
| + } | |
| + if( catalog.getResourcePool().getDataStoreCache().containsKey( dataStoreId ) ){ | |
| + DataAccess dataStore = catalog.getResourcePool().getDataStoreCache().get( dataStoreId ); | |
| + List<String> names = dataStore.getNames(); | |
| + assertTrue( names.contains("PrimativeGeoFeature")); | |
| + } | |
| } | |
| @Test | |
| diff --git a/src/security/jdbc/pom.xml b/src/security/jdbc/pom.xml | |
| index 45f7fc8..9f890c2 100644 | |
| --- a/src/security/jdbc/pom.xml | |
| +++ b/src/security/jdbc/pom.xml | |
| @@ -12,12 +12,12 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-security</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.security</groupId> | |
| <artifactId>gs-sec-jdbc</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer JDBC Security Module</name> | |
| <dependencies> | |
| diff --git a/src/security/ldap/pom.xml b/src/security/ldap/pom.xml | |
| index e49542e..3c2a56f 100644 | |
| --- a/src/security/ldap/pom.xml | |
| +++ b/src/security/ldap/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-security</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.security</groupId> | |
| <artifactId>gs-sec-ldap</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer LDAP Security Module</name> | |
| <dependencies> | |
| diff --git a/src/security/pom.xml b/src/security/pom.xml | |
| index 7dc0389..938fcdd 100644 | |
| --- a/src/security/pom.xml | |
| +++ b/src/security/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>gs-security</artifactId> | |
| <packaging>pom</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer Security Modules</name> | |
| <dependencies> | |
| diff --git a/src/wcs/pom.xml b/src/wcs/pom.xml | |
| index 1f9ed41..e4bdbe9 100644 | |
| --- a/src/wcs/pom.xml | |
| +++ b/src/wcs/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/wcs/src/main/java/applicationContext.xml b/src/wcs/src/main/java/applicationContext.xml | |
| index 9e51ed1..05af3a9 100644 | |
| --- a/src/wcs/src/main/java/applicationContext.xml | |
| +++ b/src/wcs/src/main/java/applicationContext.xml | |
| @@ -14,16 +14,8 @@ | |
| <constructor-arg ref="resourceLoader"/> | |
| </bean> | |
| - <!-- the abstract base bean --> | |
| - <bean id="wcsAbstractService" abstract="true" | |
| - class="org.vfny.geoserver.servlets.AbstractService"> | |
| - <!-- reference to geoserver bean defined in the 'main' context --> | |
| - <property name="geoServer" ref="geoServer"/> | |
| - <property name="catalog" ref="catalog"/> | |
| - </bean> | |
| - | |
| <bean id="wcsFactoryExtension" class="org.geoserver.wcs.WCSFactoryExtension"/> | |
| - | |
| + | |
| <!-- http url mapping --> | |
| <bean id="wcsURLMapping" class="org.geoserver.ows.OWSHandlerMapping"> | |
| <constructor-arg ref="catalog"/> | |
| diff --git a/src/wcs1_0/pom.xml b/src/wcs1_0/pom.xml | |
| index 06aa805..9e65c0b 100644 | |
| --- a/src/wcs1_0/pom.xml | |
| +++ b/src/wcs1_0/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/wcs1_1/pom.xml b/src/wcs1_1/pom.xml | |
| index 477d433..cd20b88 100644 | |
| --- a/src/wcs1_1/pom.xml | |
| +++ b/src/wcs1_1/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/wcs2_0/pom.xml b/src/wcs2_0/pom.xml | |
| index 33668d1..8cf3625 100644 | |
| --- a/src/wcs2_0/pom.xml | |
| +++ b/src/wcs2_0/pom.xml | |
| @@ -12,7 +12,7 @@ application directory. | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| diff --git a/src/web/app/pom.xml b/src/web/app/pom.xml | |
| index 5d66af6..356bd14 100644 | |
| --- a/src/web/app/pom.xml | |
| +++ b/src/web/app/pom.xml | |
| @@ -10,12 +10,12 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>web</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-app</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer Web Application</name> | |
| <dependencies> | |
| <dependency> | |
| @@ -371,7 +371,7 @@ | |
| <dependency> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-arcsde</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| </dependencies> | |
| </profile> | |
| @@ -400,7 +400,7 @@ | |
| <dependency> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-sqlserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| </dependencies> | |
| </profile> | |
| @@ -410,7 +410,7 @@ | |
| <dependency> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-oracle</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>com.oracle</groupId> | |
| @@ -425,7 +425,7 @@ | |
| <dependency> | |
| <groupId>org.geoserver.extension</groupId> | |
| <artifactId>gs-mysql</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </dependency> | |
| </dependencies> | |
| </profile> | |
| @@ -458,7 +458,7 @@ | |
| <id>validation</id> | |
| <dependencies> | |
| <dependency> | |
| - <groupId>org.geoserver.extension</groupId> | |
| + <groupId>org.geoserver.community</groupId> | |
| <artifactId>gs-validation</artifactId> | |
| <version>${project.version}</version> | |
| </dependency> | |
| diff --git a/src/web/core/pom.xml b/src/web/core/pom.xml | |
| index 88a97d5..4945fb6 100644 | |
| --- a/src/web/core/pom.xml | |
| +++ b/src/web/core/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>web</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-core</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>Core UI Module</name> | |
| <dependencies> | |
| @@ -86,10 +86,6 @@ | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geotools</groupId> | |
| - <artifactId>gt-validation</artifactId> | |
| - </dependency> | |
| - <dependency> | |
| - <groupId>org.geotools</groupId> | |
| <artifactId>gt-data</artifactId> | |
| </dependency> | |
| <dependency> | |
| diff --git a/src/web/core/src/main/java/org/geoserver/web/wicket/CodeMirrorEditor.java b/src/web/core/src/main/java/org/geoserver/web/wicket/CodeMirrorEditor.java | |
| index 11cdaea..8bd3751 100644 | |
| --- a/src/web/core/src/main/java/org/geoserver/web/wicket/CodeMirrorEditor.java | |
| +++ b/src/web/core/src/main/java/org/geoserver/web/wicket/CodeMirrorEditor.java | |
| @@ -11,6 +11,8 @@ import java.io.InputStreamReader; | |
| import java.io.Reader; | |
| import java.io.StringWriter; | |
| import java.io.Writer; | |
| +import java.util.regex.Matcher; | |
| +import java.util.regex.Pattern; | |
| import org.apache.wicket.ResourceReference; | |
| import org.apache.wicket.ajax.AjaxRequestTarget; | |
| @@ -93,43 +95,107 @@ public class CodeMirrorEditor extends FormComponentPanel<String> { | |
| WebClientInfo clientInfo = (WebClientInfo) WebRequestCycle.get().getClientInfo(); | |
| ClientProperties clientProperties = clientInfo.getProperties(); | |
| if (clientProperties.isBrowserInternetExplorer()) { | |
| - enableCodeMirror = clientProperties.getBrowserVersionMajor() >= 8; | |
| + ClientProperties props = extractIEVersion(clientProperties.getNavigatorUserAgent()); | |
| + enableCodeMirror = clientProperties.getBrowserVersionMajor() >= 8 | |
| + || props.getBrowserVersionMajor() >= 8; | |
| } else if (clientProperties.isBrowserMozillaFirefox()) { | |
| - enableCodeMirror = clientProperties.getBrowserVersionMajor() >= 3; | |
| + ClientProperties props = extractFirefoxVersion(clientProperties.getNavigatorUserAgent()); | |
| + enableCodeMirror = clientProperties.getBrowserVersionMajor() >= 3 | |
| + || props.getBrowserVersionMajor() >= 3; | |
| } else if (clientProperties.isBrowserSafari()) { | |
| - ClientProperties props = extractVersion(clientProperties.getNavigatorAppVersion()); | |
| + ClientProperties props = extractSafariVersion(clientProperties.getNavigatorAppVersion()); | |
| enableCodeMirror = clientProperties.getBrowserVersionMajor() > 5 | |
| - || (clientProperties.getBrowserVersionMajor() == 5 && clientProperties | |
| - .getBrowserVersionMinor() >= 2) | |
| - // Wicket is unable to parse version for safari | |
| + || (clientProperties.getBrowserVersionMajor() == 5 | |
| + && clientProperties.getBrowserVersionMinor() >= 2) | |
| || props.getBrowserVersionMajor() > 5 | |
| - || (props.getBrowserVersionMajor() == 5 && props.getBrowserVersionMinor() >= 2); | |
| + || (props.getBrowserVersionMajor() == 5 | |
| + && props.getBrowserVersionMinor() >= 2); | |
| } else if (clientProperties.isBrowserOpera()) { | |
| - enableCodeMirror = clientProperties.getBrowserVersionMajor() >= 9; | |
| + ClientProperties props = extractOperaVersion(clientProperties.getNavigatorAppVersion()); | |
| + enableCodeMirror = clientProperties.getBrowserVersionMajor() >= 9 | |
| + || props.getBrowserVersionMajor() >= 9; | |
| } | |
| return enableCodeMirror; | |
| } | |
| - private ClientProperties extractVersion(String appVersion) { | |
| + private ClientProperties extractIEVersion(String userAgent) { | |
| ClientProperties props = new ClientProperties(); | |
| props.setBrowserVersionMajor(-1); | |
| props.setBrowserVersionMinor(-1); | |
| - String versionStr = "Version/"; | |
| - int start = appVersion.indexOf(versionStr); | |
| - if (start > -1) { | |
| - int end = appVersion.indexOf(" ", start); | |
| - String version = appVersion.substring(start + versionStr.length(), end); | |
| - String[] versions = version.split("\\."); | |
| - if (versions.length > 0) { | |
| - props.setBrowserVersionMajor(Integer.parseInt(versions[0])); | |
| + if (userAgent != null ) { | |
| + String userAgencyLc = userAgent.toLowerCase(); | |
| + String pattern; | |
| + if (userAgencyLc.contains("like gecko")) { | |
| + pattern = "rv:(\\d+)\\.(\\d+)"; | |
| + } else { | |
| + pattern = "msie (\\d+)\\.(\\d+)"; | |
| } | |
| - if (versions.length > 1) { | |
| - props.setBrowserVersionMinor(Integer.parseInt(versions[1])); | |
| + setMajorMinorVersionByPattern(userAgencyLc, pattern, props); | |
| + } | |
| + return props; | |
| + } | |
| + | |
| + | |
| + private ClientProperties extractFirefoxVersion(String userAgent) { | |
| + ClientProperties props = new ClientProperties(); | |
| + props.setBrowserVersionMajor(-1); | |
| + props.setBrowserVersionMinor(-1); | |
| + if (userAgent != null) { | |
| + String userAgencyLc = userAgent.toLowerCase(); | |
| + props.setBrowserVersionMajor(-1); | |
| + props.setBrowserVersionMinor(-1); | |
| + setMajorMinorVersionByPattern(userAgencyLc, "firefox/(\\d+)\\.(\\d+)", props); | |
| + } | |
| + return props; | |
| + } | |
| + | |
| + private ClientProperties extractOperaVersion(String userAgent) { | |
| + ClientProperties props = new ClientProperties(); | |
| + props.setBrowserVersionMajor(-1); | |
| + props.setBrowserVersionMinor(-1); | |
| + if (userAgent != null) { | |
| + String userAgencyLc = userAgent.toLowerCase(); | |
| + if (userAgencyLc.startsWith("opera/") && userAgencyLc.contains("version/")) { | |
| + setMajorMinorVersionByPattern(userAgencyLc, "version/(\\d+)\\.(\\d+)", props); | |
| + } else if (userAgencyLc.startsWith("opera/") && !userAgencyLc.contains("version/")) { | |
| + setMajorMinorVersionByPattern(userAgencyLc, "opera/(\\d+)\\.(\\d+)", props); | |
| + } else { | |
| + setMajorMinorVersionByPattern(userAgencyLc, "opera (\\d+)\\.(\\d+)", props); | |
| } | |
| } | |
| return props; | |
| } | |
| + private ClientProperties extractSafariVersion(String userAgent) { | |
| + ClientProperties props = new ClientProperties(); | |
| + props.setBrowserVersionMajor(-1); | |
| + props.setBrowserVersionMinor(-1); | |
| + if (userAgent != null) { | |
| + String userAgencyLc = userAgent.toLowerCase(); | |
| + setMajorMinorVersionByPattern(userAgencyLc, "version/(\\d+)\\.(\\d+)", props); | |
| + } | |
| + return props; | |
| + } | |
| + | |
| + private ClientProperties extractChromeVersion(String userAgent) { | |
| + ClientProperties props = new ClientProperties(); | |
| + props.setBrowserVersionMajor(-1); | |
| + props.setBrowserVersionMinor(-1); | |
| + if (userAgent != null) { | |
| + String userAgencyLc = userAgent.toLowerCase(); | |
| + setMajorMinorVersionByPattern(userAgencyLc, "chrome/(\\d+)\\.(\\d+)", props); | |
| + } | |
| + return props; | |
| + } | |
| + | |
| + private void setMajorMinorVersionByPattern(String userAgent, String patternString, ClientProperties properties) { | |
| + Matcher matcher = Pattern.compile(patternString).matcher(userAgent); | |
| + if (matcher.find()) { | |
| + properties.setBrowserVersionMajor(Integer.parseInt(matcher.group(1))); | |
| + properties.setBrowserVersionMinor(Integer.parseInt(matcher.group(2))); | |
| + } | |
| + } | |
| + | |
| public CodeMirrorEditor(String id, IModel<String> model) { | |
| this(id, "xml", model); | |
| } | |
| @@ -175,7 +241,7 @@ public class CodeMirrorEditor extends FormComponentPanel<String> { | |
| public CharSequence decorateScript(CharSequence script) { | |
| // textarea.value = codemirrorinstance.getCode() | |
| String id = getTextAreaMarkupId(); | |
| - return "document.getElementById('" + id + "').value = document.gsEditors." + id + ".getValue();" + script; | |
| + return "if (document.gsEditors) { document.getElementById('" + id + "').value = document.gsEditors." + id + ".getValue(); }" + script; | |
| } | |
| }; | |
| } | |
| diff --git a/src/web/core/src/main/resources/GeoServerApplication_fr.properties b/src/web/core/src/main/resources/GeoServerApplication_fr.properties | |
| index 5b54307..38cc18c 100644 | |
| --- a/src/web/core/src/main/resources/GeoServerApplication_fr.properties | |
| +++ b/src/web/core/src/main/resources/GeoServerApplication_fr.properties | |
| @@ -170,6 +170,9 @@ EnvelopePanel.crs = Syst | |
| PointPanel.x = x | |
| PointPanel.y = y | |
| +# FeatureResourceConfigurationPanel.curves = Curved geometries control | |
| +# FeatureResourceConfigurationPanel.linestrings-are-curves = Linear geometries can contain circular arcs | |
| +# FeatureResourceConfigurationPanel.tolerance = Linearization tolerance (useful only if your data contains curved geometries) | |
| FeatureResourceConfigurationPanel.featureTypeDetails = D�tails sur le type de donn�es | |
| FeatureResourceConfigurationPanel.minMaxOccurences = Occurences Min/Max | |
| FeatureResourceConfigurationPanel.nillable = Supporte l'absence de valeur ? | |
| @@ -476,9 +479,9 @@ SQLViewEditPage.description=Mettre | |
| # CoverageViewEditPage.title=Edit Coverage View configuration | |
| # CoverageViewEditPage.description=Update the Coverage View configuration | |
| -# CoverageViewEditor.addBand=Add >> | |
| -# CoverageViewEditor.removeAllBands=Remove all | |
| -# CoverageViewEditor.removeBands=Remove selected bands | |
| +CoverageViewEditor.addBand=Ajouter >> | |
| +CoverageViewEditor.removeAllBands=Supprimer tout | |
| +CoverageViewEditor.removeBands=Retirer les bandes s�lectionn�es | |
| # CoverageViewEditor.compositionType=Band Composition Type | |
| # CoverageViewEditor.outputBandsChoice=Output bands to be created | |
| # CoverageViewEditor.availableCoverages=Composing coverages/bands | |
| @@ -826,5 +829,5 @@ SRSListTextArea.unknownEPSGCodes = Les codes suivants ne sont pas connu de l'aut | |
| PropertyEditorFormComponent.KeyRequired=Nom de propri�t� requis | |
| PropertyEditorFormComponent.ValueRequired=Valeur de propri�t� requise | |
| -# MetadataLinkEditor$UrlValidator = Invalid metadata link URL | |
| +MetadataLinkEditor$UrlValidator = URL du lien de m�tadonn�es invalide | |
| diff --git a/src/web/core/src/main/resources/GeoServerApplication_ko.properties b/src/web/core/src/main/resources/GeoServerApplication_ko.properties | |
| index 3537b82..f8efc3d 100644 | |
| --- a/src/web/core/src/main/resources/GeoServerApplication_ko.properties | |
| +++ b/src/web/core/src/main/resources/GeoServerApplication_ko.properties | |
| @@ -170,6 +170,9 @@ EnvelopePanel.crs = \uacf5\uac04 \uc88c\ud45c \uccb4\uacc4 | |
| PointPanel.x = x | |
| PointPanel.y = y | |
| +FeatureResourceConfigurationPanel.curves = \uace1\uc120 \uc9c0\uc624\uba54\ud2b8\ub9ac \uc81c\uc5b4 | |
| +FeatureResourceConfigurationPanel.linestrings-are-curves = \uc120\ud615 \uc9c0\uc624\uba54\ud2b8\ub9ac\ub294 \uc6d0\ud638\ub97c \ud3ec\ud568\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4 | |
| +FeatureResourceConfigurationPanel.tolerance = \uc120\ud615\ud654 \ud5c8\uc6a9\uc624\ucc28 (\ub370\uc774\ud130\uac00 \uace1\uc120 \uc9c0\uc624\uba54\ud2b8\ub9ac\ub97c \ud3ec\ud568\ud558\ub294 \uacbd\uc6b0\uc5d0\ub9cc \uc720\uc6a9) | |
| FeatureResourceConfigurationPanel.featureTypeDetails = \ud53c\ucc98 \ud0c0\uc785 \uc0c1\uc138\uc815\ubcf4 | |
| FeatureResourceConfigurationPanel.minMaxOccurences = Min/Max Occurences | |
| FeatureResourceConfigurationPanel.nillable = \ub110\uac12\ud5c8\uc6a9 | |
| diff --git a/src/web/core/src/main/resources/GeoServerApplication_ro.properties b/src/web/core/src/main/resources/GeoServerApplication_ro.properties | |
| index dae110b..a09477c 100644 | |
| --- a/src/web/core/src/main/resources/GeoServerApplication_ro.properties | |
| +++ b/src/web/core/src/main/resources/GeoServerApplication_ro.properties | |
| @@ -170,6 +170,9 @@ EnvelopePanel.crs = Sistem de coordonate de referin\u021b\u0103 | |
| PointPanel.x = x | |
| PointPanel.y = y | |
| +FeatureResourceConfigurationPanel.curves = Controlul geometriilor curbate | |
| +FeatureResourceConfigurationPanel.linestrings-are-curves = Geometriile liniare pot con\u021bine arce circulare | |
| +FeatureResourceConfigurationPanel.tolerance = Toleran\u021b\u0103 de liniarizare (util\u0103 doar �n cazul �n care datele con\u021bin geometrii curbate) | |
| FeatureResourceConfigurationPanel.featureTypeDetails = Detalii despre tipul elementului | |
| FeatureResourceConfigurationPanel.minMaxOccurences = Min/Max Apari\u021bii | |
| FeatureResourceConfigurationPanel.nillable = Nilabil | |
| diff --git a/src/web/core/src/main/resources/GeoServerApplication_tr.properties b/src/web/core/src/main/resources/GeoServerApplication_tr.properties | |
| index 4527276..b9cc04b 100644 | |
| --- a/src/web/core/src/main/resources/GeoServerApplication_tr.properties | |
| +++ b/src/web/core/src/main/resources/GeoServerApplication_tr.properties | |
| @@ -170,6 +170,9 @@ EnvelopePanel.crs = Koordinat Referans Sistemi | |
| PointPanel.x = x | |
| PointPanel.y = y | |
| +FeatureResourceConfigurationPanel.curves = Kavisli geometri kontrol� | |
| +FeatureResourceConfigurationPanel.linestrings-are-curves = Do\u011frusal geometriler yuvarlak yaylar i�erebilir | |
| +FeatureResourceConfigurationPanel.tolerance = Lineerle\u015ftirme Tolerans\u0131 (veri sadece kavisli geometrileri i�eriyorsa yararl\u0131d\u0131r) | |
| FeatureResourceConfigurationPanel.featureTypeDetails = Feature Type Detaylar\u0131 | |
| FeatureResourceConfigurationPanel.minMaxOccurences = Min/Max Occurences | |
| FeatureResourceConfigurationPanel.nillable = Nillable | |
| diff --git a/src/web/demo/pom.xml b/src/web/demo/pom.xml | |
| index b7d1d47..b0c2bc6 100644 | |
| --- a/src/web/demo/pom.xml | |
| +++ b/src/web/demo/pom.xml | |
| @@ -15,13 +15,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>web</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-demo</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>Demoes Module</name> | |
| <dependencies> | |
| @@ -46,10 +46,6 @@ | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geotools</groupId> | |
| - <artifactId>gt-validation</artifactId> | |
| - </dependency> | |
| - <dependency> | |
| - <groupId>org.geotools</groupId> | |
| <artifactId>gt-data</artifactId> | |
| </dependency> | |
| diff --git a/src/web/gwc/pom.xml b/src/web/gwc/pom.xml | |
| index c1c595a..d885bd6 100644 | |
| --- a/src/web/gwc/pom.xml | |
| +++ b/src/web/gwc/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>web</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-gwc</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GWC UI Module</name> | |
| <dependencies> | |
| diff --git a/src/web/gwc/src/main/java/org/geoserver/gwc/web/DefaultGridsetsEditor.java b/src/web/gwc/src/main/java/org/geoserver/gwc/web/DefaultGridsetsEditor.java | |
| index 188ae44..2d4ef8e 100644 | |
| --- a/src/web/gwc/src/main/java/org/geoserver/gwc/web/DefaultGridsetsEditor.java | |
| +++ b/src/web/gwc/src/main/java/org/geoserver/gwc/web/DefaultGridsetsEditor.java | |
| @@ -158,7 +158,8 @@ class DefaultGridsetsEditor extends FormComponentPanel<Set<String>> { | |
| List<String> selectedIds = selection.getObject(); | |
| selectedIds.add(selectedGridset); | |
| - | |
| + // Execute setPageable() in order to re-create the inner record list updated. | |
| + defaultGridsetsTable.setPageable(false); | |
| target.addComponent(defaultGridsetsTable); | |
| target.addComponent(availableGridSets); | |
| } | |
| diff --git a/src/web/gwc/src/main/resources/GeoServerApplication_ro.properties b/src/web/gwc/src/main/resources/GeoServerApplication_ro.properties | |
| index 0918ecc..b053815 100644 | |
| --- a/src/web/gwc/src/main/resources/GeoServerApplication_ro.properties | |
| +++ b/src/web/gwc/src/main/resources/GeoServerApplication_ro.properties | |
| @@ -43,7 +43,7 @@ GWCSettingsPage.defaultCacheFormatsRaster=Straturi raster | |
| GWCSettingsPage.defaultCacheFormatsOther=Grupuri de straturi | |
| GWC.ImageIOFileCachingThresholdUnsetWarning=Op\u021biunea 'Prag Memorie de Stocare ImageIO" din pagina "Acces la acoperire" nu este setat\u0103, ceea ce poate duce la o penalizare de performan\u021b\u0103 sever\u0103 atunci c�nd se genereaz\u0103 dale. O valoare de 1024K ar trebui s\u0103 fie suficient\u0103 pentru dimensiunile comune ale unei dale. | |
| -CachingOptionsPanel.cachedGridsets = Seturile implicie de grile �nmagazinate | |
| +CachingOptionsPanel.cachedGridsets = Seturile implicite de grile �nmagazinate | |
| CachingOptionsPanel.nioLock = Blocare bazat\u0103 pe NIO (blocare interprocesual\u0103) | |
| CachingOptionsPanel.memoryLock = Blocare �n-proces | |
| CachingOptionsPanel.noLock = Dezactiveaz\u0103 blocare | |
| diff --git a/src/web/gwc/src/test/java/org/geoserver/gwc/web/GWCSettingsPageTest.java b/src/web/gwc/src/test/java/org/geoserver/gwc/web/GWCSettingsPageTest.java | |
| index 8ea8c19..feb95fd 100644 | |
| --- a/src/web/gwc/src/test/java/org/geoserver/gwc/web/GWCSettingsPageTest.java | |
| +++ b/src/web/gwc/src/test/java/org/geoserver/gwc/web/GWCSettingsPageTest.java | |
| @@ -12,6 +12,7 @@ import java.io.IOException; | |
| import java.util.List; | |
| import java.util.Set; | |
| +import org.apache.wicket.Component; | |
| import org.apache.wicket.markup.html.form.DropDownChoice; | |
| import org.apache.wicket.util.tester.FormTester; | |
| import org.geoserver.gwc.ConfigurableLockProvider; | |
| @@ -233,4 +234,53 @@ public class GWCSettingsPageTest extends GeoServerWicketTestSupport { | |
| lockProvider = (ConfigurableLockProvider) gwc.getLockProvider(); | |
| assertTrue(lockProvider.getDelegate() instanceof NIOLockProvider); | |
| } | |
| + | |
| + @Test | |
| + public void testNewDefaultGridSet() throws IOException { | |
| + GWC gwc = GWC.get(); | |
| + GWCConfig config = gwc.getConfig(); | |
| + config.setCacheLayersByDefault(true); | |
| + gwc.saveConfig(config); | |
| + // Creation of a new page to test | |
| + GWCSettingsPage page = new GWCSettingsPage(); | |
| + // Start the page | |
| + tester.startPage(page); | |
| + // Ensure the page is correctly rendered | |
| + tester.assertRenderedPage(GWCSettingsPage.class); | |
| + // Ensure the component cachedGridsets belongs to the DefaultGridsetsEditor class | |
| + tester.assertComponent("form:cachingOptionsPanel:container:configs:cachedGridsets", | |
| + DefaultGridsetsEditor.class); | |
| + // Get the available GridSets | |
| + DropDownChoice<String> availableItems = (DropDownChoice<String>) tester | |
| + .getComponentFromLastRenderedPage("form:cachingOptionsPanel:container:configs:cachedGridsets:availableGridsets"); | |
| + // Ensure the component is present | |
| + assertNotNull(availableItems); | |
| + // Get the first item | |
| + String item = availableItems.getChoices().get(0); | |
| + // Ensure the item is not null | |
| + assertNotNull(item); | |
| + // Ensure the item is GlobalCRS84Pixel | |
| + assertTrue(item.equalsIgnoreCase("GlobalCRS84Pixel")); | |
| + | |
| + // Selection of the form tests | |
| + FormTester form = tester.newFormTester("form"); | |
| + form.select("cachingOptionsPanel:container:configs:cachedGridsets:availableGridsets", 0); | |
| + tester.executeAjaxEvent( | |
| + "form:cachingOptionsPanel:container:configs:cachedGridsets:addGridset", "onclick"); | |
| + // Check that the page is correctly rendered | |
| + tester.assertRenderedPage(GWCSettingsPage.class); | |
| + // Save the changes | |
| + form.submit("submit"); | |
| + // Check no exception has been thrown | |
| + tester.assertNoErrorMessage(); | |
| + // Restart the page | |
| + tester.startPage(page); | |
| + // Ensure the page is correctly rendered | |
| + tester.assertRenderedPage(GWCSettingsPage.class); | |
| + // Get the list of available elements | |
| + availableItems = (DropDownChoice<String>) tester | |
| + .getComponentFromLastRenderedPage("form:cachingOptionsPanel:container:configs:cachedGridsets:availableGridsets"); | |
| + // Ensure that the one used above is no more present | |
| + assertFalse(availableItems.getChoices().contains(item)); | |
| + } | |
| } | |
| diff --git a/src/web/pom.xml b/src/web/pom.xml | |
| index a809290..f574d86 100644 | |
| --- a/src/web/pom.xml | |
| +++ b/src/web/pom.xml | |
| @@ -10,13 +10,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>web</artifactId> | |
| <packaging>pom</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>GeoServer Web Modules</name> | |
| <build> | |
| diff --git a/src/web/rest/pom.xml b/src/web/rest/pom.xml | |
| index 27ec02c..c1a90ec 100644 | |
| --- a/src/web/rest/pom.xml | |
| +++ b/src/web/rest/pom.xml | |
| @@ -6,11 +6,11 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>web</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-rest</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>REST UI Module</name> | |
| <url>http://maven.apache.org</url> | |
| <properties> | |
| diff --git a/src/web/security/core/pom.xml b/src/web/security/core/pom.xml | |
| index d1786fe..a0d5a31 100644 | |
| --- a/src/web/security/core/pom.xml | |
| +++ b/src/web/security/core/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-sec</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-sec-core</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>Security UI Core Module</name> | |
| <dependencies> | |
| diff --git a/src/web/security/jdbc/pom.xml b/src/web/security/jdbc/pom.xml | |
| index 8998d6c..85a0db5 100644 | |
| --- a/src/web/security/jdbc/pom.xml | |
| +++ b/src/web/security/jdbc/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-sec</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-sec-jdbc</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>Security UI JDBC Module</name> | |
| <dependencies> | |
| diff --git a/src/web/security/ldap/pom.xml b/src/web/security/ldap/pom.xml | |
| index 255751c..e5ea117 100644 | |
| --- a/src/web/security/ldap/pom.xml | |
| +++ b/src/web/security/ldap/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-sec</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-sec-ldap</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>Security UI LDAP Module</name> | |
| <dependencies> | |
| diff --git a/src/web/security/pom.xml b/src/web/security/pom.xml | |
| index 191667f..9dab6ac 100644 | |
| --- a/src/web/security/pom.xml | |
| +++ b/src/web/security/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>web</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-sec</artifactId> | |
| <packaging>pom</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>Security UI Modules</name> | |
| <dependencies> | |
| diff --git a/src/web/wcs/pom.xml b/src/web/wcs/pom.xml | |
| index 46c1213..d66275b 100644 | |
| --- a/src/web/wcs/pom.xml | |
| +++ b/src/web/wcs/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>web</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-wcs</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>WCS UI Module</name> | |
| <dependencies> | |
| @@ -75,10 +75,6 @@ | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geotools</groupId> | |
| - <artifactId>gt-validation</artifactId> | |
| - </dependency> | |
| - <dependency> | |
| - <groupId>org.geotools</groupId> | |
| <artifactId>gt-data</artifactId> | |
| </dependency> | |
| <dependency> | |
| diff --git a/src/web/wfs/pom.xml b/src/web/wfs/pom.xml | |
| index c06a252..d6afb41 100644 | |
| --- a/src/web/wfs/pom.xml | |
| +++ b/src/web/wfs/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>web</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-wfs</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>WFS UI Module</name> | |
| <dependencies> | |
| @@ -57,10 +57,6 @@ | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geotools</groupId> | |
| - <artifactId>gt-validation</artifactId> | |
| - </dependency> | |
| - <dependency> | |
| - <groupId>org.geotools</groupId> | |
| <artifactId>gt-data</artifactId> | |
| </dependency> | |
| </dependencies> | |
| diff --git a/src/web/wms/pom.xml b/src/web/wms/pom.xml | |
| index 70da39f..9570063 100644 | |
| --- a/src/web/wms/pom.xml | |
| +++ b/src/web/wms/pom.xml | |
| @@ -12,13 +12,13 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>web</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver.web</groupId> | |
| <artifactId>gs-web-wms</artifactId> | |
| <packaging>jar</packaging> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| <name>WMS UI Module</name> | |
| <dependencies> | |
| @@ -67,10 +67,6 @@ | |
| </dependency> | |
| <dependency> | |
| <groupId>org.geotools</groupId> | |
| - <artifactId>gt-validation</artifactId> | |
| - </dependency> | |
| - <dependency> | |
| - <groupId>org.geotools</groupId> | |
| <artifactId>gt-data</artifactId> | |
| </dependency> | |
| </dependencies> | |
| diff --git a/src/web/wms/src/main/java/org/geoserver/wms/web/data/AbstractStylePage.java b/src/web/wms/src/main/java/org/geoserver/wms/web/data/AbstractStylePage.java | |
| index 4a616a7..1318018 100644 | |
| --- a/src/web/wms/src/main/java/org/geoserver/wms/web/data/AbstractStylePage.java | |
| +++ b/src/web/wms/src/main/java/org/geoserver/wms/web/data/AbstractStylePage.java | |
| @@ -152,7 +152,7 @@ public abstract class AbstractStylePage extends GeoServerSecuredPage { | |
| @Override | |
| protected void onUpdate(AjaxRequestTarget target) { | |
| target.appendJavascript(String.format( | |
| - "document.gsEditors.editor.setOption('mode', '%s');", styleHandler().getCodeMirrorEditMode())); | |
| + "if (document.gsEditors) { document.gsEditors.editor.setOption('mode', '%s'); }", styleHandler().getCodeMirrorEditMode())); | |
| } | |
| }); | |
| styleForm.add(formatChoice); | |
| @@ -417,9 +417,10 @@ public abstract class AbstractStylePage extends GeoServerSecuredPage { | |
| @Override | |
| public CharSequence preDecorateScript(CharSequence script) { | |
| - return "if(event.view.document.gsEditors." | |
| - + editor.getTextAreaMarkupId() | |
| - + ".getValue() != '' &&" | |
| + return "var val = event.view.document.gsEditors ? " | |
| + + "event.view.document.gsEditors." + editor.getTextAreaMarkupId() + ".getValue() : " | |
| + + "event.view.document.getElementById(\"" + editor.getTextAreaMarkupId() + "\").value; " | |
| + + "if(val != '' &&" | |
| + "!confirm('" | |
| + new ParamResourceModel("confirmOverwrite", AbstractStylePage.this) | |
| .getString() + "')) return false;" + script; | |
| diff --git a/src/web/wms/src/main/resources/GeoServerApplication_fr.properties b/src/web/wms/src/main/resources/GeoServerApplication_fr.properties | |
| index cf32b8c..44eb968 100644 | |
| --- a/src/web/wms/src/main/resources/GeoServerApplication_fr.properties | |
| +++ b/src/web/wms/src/main/resources/GeoServerApplication_fr.properties | |
| @@ -5,13 +5,13 @@ AbstractStylePage.confirmOverwrite = | |
| AbstractStylePage.copy = Copier ... | |
| AbstractStylePage.copyFrom = Dupliquer un style | |
| AbstractStylePage.format = Format | |
| -AbstractStylePage.formatReadOnly = Format only editable for new styles | |
| +# AbstractStylePage.formatReadOnly = Format only editable for new styles | |
| AbstractStylePage.name = Nom | |
| -AbstractStylePage.styleFile = Fichier SLD | |
| +AbstractStylePage.styleFile = Fichier de style | |
| AbstractStylePage.upload = Charger ... | |
| AbstractStylePage.validate = Valider | |
| AbstractStylePage.preview = Aper�u de la l�gende | |
| -AbstractStylePage.styleNotFound = Fichier SLD "{0} introuvable, entrer un nouvel SLD | |
| +# AbstractStylePage.styleNotFound = Could not find Style file "{0}", please input a new style | |
| AbstractStylePage.genericError = SLD invalide | |
| ExtraStylesPalette.availableHeader = Styles disponibles | |
| ExtraStylesPalette.selectedHeader = Styles s�lectionn�s | |
| @@ -97,12 +97,12 @@ WMSAdminPage.chooseWatermark = Choisir une image pour le filigrane | |
| WMSAdminPage.browse = Parcourir... | |
| WMSAdminPage.scalehintOptions = Scalehint (WMS 1.1.1 seulement) | |
| WMSAdminPage.scalehintUnitsPixel = Pr�senter le Scalehint en unit�s par diagonale de pixel dans la r�ponse GetCapabilities | |
| -# WMSAdminPage.getFeatureInfoMimeTypes= Allowed MIME types for a GetFeatureInfo request | |
| -# WMSAdminPage.getMapMimeTypes = Allowed MIME types for a GetMap request | |
| +WMSAdminPage.getFeatureInfoMimeTypes= Types MIME autoris�s pour une requ�te GetFeatureInfo | |
| +WMSAdminPage.getMapMimeTypes = Types MIME autoris�s pour une requ�te GetMap | |
| -# MimeTypesFormComponent.selectedHeader =Allowed MIME types | |
| -# MimeTypesFormComponent.availableHeader =Available MIME types | |
| -# MimeTypesFormComponent.mimeTypeCheckingEnabled =Enable MIME type checking | |
| +MimeTypesFormComponent.selectedHeader =Types MIME autoris�s | |
| +MimeTypesFormComponent.availableHeader =Types MIME disponibles | |
| +MimeTypesFormComponent.mimeTypeCheckingEnabled =Activer le contr�le du type MIME | |
| WMSLayerConfig.additionalStyles = Styles additionnels | |
| WMSLayerConfig.defaultStyle = Style par d�faut | |
| diff --git a/src/web/wms/src/main/resources/GeoServerApplication_ko.properties b/src/web/wms/src/main/resources/GeoServerApplication_ko.properties | |
| index 4ce8f72..7d07ab9 100644 | |
| --- a/src/web/wms/src/main/resources/GeoServerApplication_ko.properties | |
| +++ b/src/web/wms/src/main/resources/GeoServerApplication_ko.properties | |
| @@ -4,14 +4,14 @@ | |
| AbstractStylePage.confirmOverwrite = \uc815\ub9d0\ub85c \ud604\uc7ac \ud3b8\uc9d1\uae30\uc758 \ub0b4\uc6a9\uc744 \ub36e\uc5b4\uc4f0\uc2dc\uaca0\uc2b5\ub2c8\uae4c? | |
| AbstractStylePage.copy = \ubcf5\uc0ac\ud558\uae30... | |
| AbstractStylePage.copyFrom = \uae30\uc874 \uc2a4\ud0c0\uc77c\ub85c\ubd80\ud130 \ubcf5\uc0ac\ud558\uae30 | |
| -AbstractStylePage.format = Format | |
| -AbstractStylePage.formatReadOnly = Format only editable for new styles | |
| +AbstractStylePage.format = \ud3ec\ub9f7 | |
| +AbstractStylePage.formatReadOnly = \uc0c8\ub85c\uc6b4 \uc2a4\ud0c0\uc77c\uc5d0 \ud3b8\uc9d1\ub9cc \uac00\ub2a5\ud55c \ud3ec\ub9f7 | |
| AbstractStylePage.name = \uc774\ub984 | |
| -AbstractStylePage.styleFile = SLD \ud30c\uc77c | |
| +AbstractStylePage.styleFile = \uc2a4\ud0c0\uc77c \ud30c\uc77c | |
| AbstractStylePage.upload = \uc62c\ub9ac\uae30... | |
| AbstractStylePage.validate = \uc720\ud6a8\uc131 \uac80\uc99d\ud558\uae30 | |
| AbstractStylePage.preview = \ubc94\ub840 \ubbf8\ub9ac\ubcf4\uae30 | |
| -AbstractStylePage.styleNotFound = "{0}" SLD \ud30c\uc77c\uc744 \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. \uc0c8\ub85c\uc6b4 SLD\ub97c \uc785\ub825\ud558\uc2ed\uc2dc\uc624 | |
| +AbstractStylePage.styleNotFound = \uc2a4\ud0c0\uc77c \ud30c\uc77c "{0}"\uc744 \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4, \uc0c8\ub85c\uc6b4 \uc2a4\ud0c0\uc77c\uc744 \uc785\ub825\ud558\uc2ed\uc2dc\uc624 | |
| AbstractStylePage.genericError = SLD\uc5d0 \uc624\ub958\uac00 \uc788\uc2b5\ub2c8\ub2e4 | |
| ExtraStylesPalette.availableHeader = \uc0ac\uc6a9\uac00\ub2a5\ud55c \uc2a4\ud0c0\uc77c \ubaa9\ub85d | |
| ExtraStylesPalette.selectedHeader = \uc120\ud0dd\ub41c \uc2a4\ud0c0\uc77c | |
| diff --git a/src/web/wms/src/main/resources/GeoServerApplication_ro.properties b/src/web/wms/src/main/resources/GeoServerApplication_ro.properties | |
| index aa60c72..b309d85 100644 | |
| --- a/src/web/wms/src/main/resources/GeoServerApplication_ro.properties | |
| +++ b/src/web/wms/src/main/resources/GeoServerApplication_ro.properties | |
| @@ -5,13 +5,13 @@ AbstractStylePage.confirmOverwrite = Sigur dori\u021bi s\u0103 suprascrie\u021bi | |
| AbstractStylePage.copy = Copiaz\u0103 ... | |
| AbstractStylePage.copyFrom = Copiaz\u0103 din stilul existent | |
| AbstractStylePage.format = Format | |
| -AbstractStylePage.formatReadOnly = Format only editable for new styles | |
| +AbstractStylePage.formatReadOnly = Format editabil doar pentru noile stiluri | |
| AbstractStylePage.name = Nume | |
| -AbstractStylePage.styleFile = Fi\u0219ier SLD | |
| +AbstractStylePage.styleFile = Fi\u0219ier de stil | |
| AbstractStylePage.upload = �ncarc\u0103 ... | |
| AbstractStylePage.validate = Valideaz\u0103 | |
| AbstractStylePage.preview = Legend\u0103 previzualizare | |
| -AbstractStylePage.styleNotFound = Nu am putut g\u0103si fi\u0219ierul SLD "{0}", v\u0103 rog s\u0103 introduce\u021bi un nou SLD | |
| +AbstractStylePage.styleNotFound = Nu s-a putut g\u0103si fi\u0219ierul de stil '{0}', v\u0103 rug\u0103m s\u0103 introduce\u021bi un stil nou | |
| AbstractStylePage.genericError = SLD invalid | |
| ExtraStylesPalette.availableHeader = Stiluri disponibile | |
| ExtraStylesPalette.selectedHeader = Stiluri selectate | |
| diff --git a/src/web/wms/src/main/resources/GeoServerApplication_tr.properties b/src/web/wms/src/main/resources/GeoServerApplication_tr.properties | |
| index fc9fe2f..630ee04 100644 | |
| --- a/src/web/wms/src/main/resources/GeoServerApplication_tr.properties | |
| +++ b/src/web/wms/src/main/resources/GeoServerApplication_tr.properties | |
| @@ -4,12 +4,14 @@ | |
| AbstractStylePage.confirmOverwrite = Mevcut edit�r i�eri\u011finin �zerine yazmak istedi\u011finizden emin misiniz? | |
| AbstractStylePage.copy = Kopyala ... | |
| AbstractStylePage.copyFrom = Mevcut stilden kopyalay\u0131n | |
| +AbstractStylePage.format = Format | |
| +AbstractStylePage.formatReadOnly = Sadece yeni stiller i�in d�zenlenebilir formatlar | |
| AbstractStylePage.name = \u0130sim | |
| -AbstractStylePage.sldFile = SLD dosyas\u0131 | |
| +AbstractStylePage.styleFile = Stil dosyas\u0131 | |
| AbstractStylePage.upload = Y�kle ... | |
| AbstractStylePage.validate = Do\u011frula | |
| AbstractStylePage.preview = Lejant �nizleme | |
| -AbstractStylePage.sldNotFound = "{0}" SLD dosyas\u0131 bulunamad\u0131, l�tfen yeni bir SLD giriniz | |
| +AbstractStylePage.styleNotFound = "{0}" stil dosyas\u0131 bulunamad\u0131, l�tfen yeni bir stil giriniz | |
| AbstractStylePage.genericError = Ge�ersiz SLD | |
| ExtraStylesPalette.availableHeader = Mevcut Stiller | |
| ExtraStylesPalette.selectedHeader = Se�ili Stiller | |
| diff --git a/src/wfs/pom.xml b/src/wfs/pom.xml | |
| index eab97c7..86d2544 100644 | |
| --- a/src/wfs/pom.xml | |
| +++ b/src/wfs/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| @@ -73,6 +73,22 @@ | |
| <artifactId>gt-jdbc-h2</artifactId> | |
| <version>${gt.version}</version> | |
| <scope>test</scope> | |
| + </dependency> | |
| + <dependency> | |
| + <groupId>org.easymock</groupId> | |
| + <artifactId>easymock</artifactId> | |
| + <scope>test</scope> | |
| + </dependency> | |
| + <dependency> | |
| + <groupId>org.easymock</groupId> | |
| + <artifactId>easymockclassextension</artifactId> | |
| + <version>2.3</version> | |
| + <scope>test</scope> | |
| + </dependency> | |
| + <dependency> | |
| + <groupId>org.hamcrest</groupId> | |
| + <artifactId>hamcrest-library</artifactId> | |
| + <scope>test</scope> | |
| </dependency> | |
| </dependencies> | |
| diff --git a/src/wfs/src/main/java/org/geoserver/wfs/CatalogNamespaceSupport.java b/src/wfs/src/main/java/org/geoserver/wfs/CatalogNamespaceSupport.java | |
| new file mode 100644 | |
| index 0000000..b1a0bc1 | |
| --- /dev/null | |
| +++ b/src/wfs/src/main/java/org/geoserver/wfs/CatalogNamespaceSupport.java | |
| @@ -0,0 +1,140 @@ | |
| +/* Copyright (c) 2014 OpenPlans - www.openplans.org. All rights reserved. | |
| + * This code is licensed under the GPL 2.0 license, available at the root | |
| + * application directory. | |
| +*/ | |
| +package org.geoserver.wfs; | |
| + | |
| +import com.google.common.collect.Iterators; | |
| +import org.geoserver.catalog.Catalog; | |
| +import org.geoserver.catalog.NamespaceInfo; | |
| +import org.geoserver.catalog.Predicates; | |
| +import org.geoserver.catalog.util.CloseableIterator; | |
| +import org.xml.sax.helpers.NamespaceSupport; | |
| + | |
| +import javax.xml.namespace.NamespaceContext; | |
| +import java.util.Enumeration; | |
| +import java.util.Iterator; | |
| + | |
| +/** | |
| + * NamespaceContext based on GeoServer catalog. | |
| + */ | |
| +public class CatalogNamespaceSupport extends NamespaceSupport { | |
| + | |
| + Catalog catalog; | |
| + | |
| + public CatalogNamespaceSupport(Catalog catalog) { | |
| + super(); | |
| + this.catalog = catalog; | |
| + } | |
| + | |
| + @Override | |
| + public Enumeration getDeclaredPrefixes() { | |
| + return getPrefixes(); | |
| + } | |
| + | |
| + @Override | |
| + public Enumeration getPrefixes() { | |
| + final CloseableIterator<NamespaceInfo> it = catalog.list(NamespaceInfo.class, Predicates.acceptAll()); | |
| + return new Enumeration() { | |
| + @Override | |
| + public boolean hasMoreElements() { | |
| + if (it.hasNext()) { | |
| + return true; | |
| + } | |
| + else { | |
| + it.close(); | |
| + return false; | |
| + } | |
| + } | |
| + | |
| + @Override | |
| + public Object nextElement() { | |
| + return it.next().getPrefix(); | |
| + } | |
| + }; | |
| + } | |
| + | |
| + @Override | |
| + public Enumeration getPrefixes(String uri) { | |
| + final String pre = getPrefix(uri); | |
| + if (pre == null) { | |
| + return new Enumeration() { | |
| + @Override | |
| + public boolean hasMoreElements() { | |
| + return false; | |
| + } | |
| + @Override | |
| + public Object nextElement() { | |
| + return null; | |
| + } | |
| + }; | |
| + } | |
| + | |
| + return new Enumeration() { | |
| + boolean read = false; | |
| + | |
| + @Override | |
| + public boolean hasMoreElements() { | |
| + return !read; | |
| + } | |
| + | |
| + @Override | |
| + public Object nextElement() { | |
| + try { | |
| + return pre; | |
| + } | |
| + finally { | |
| + read = false; | |
| + } | |
| + } | |
| + }; | |
| + } | |
| + | |
| + @Override | |
| + public String getPrefix(String uri) { | |
| + NamespaceInfo ns = "".equals(uri) ? catalog.getDefaultNamespace() : catalog.getNamespaceByURI(uri); | |
| + return ns != null ? ns.getPrefix() : null; | |
| + } | |
| + | |
| + @Override | |
| + public String getURI(String prefix) { | |
| + NamespaceInfo ns = "".equals(prefix) ? catalog.getDefaultNamespace() : catalog.getNamespaceByPrefix(prefix); | |
| + return ns != null ? ns.getURI() : null; | |
| + } | |
| + | |
| + @Override | |
| + public void reset() { | |
| + super.reset(); | |
| + } | |
| + | |
| + @Override | |
| + public void pushContext() { | |
| + throw new UnsupportedOperationException(); | |
| + } | |
| + | |
| + @Override | |
| + public void popContext() { | |
| + throw new UnsupportedOperationException(); | |
| + } | |
| + | |
| + @Override | |
| + public boolean declarePrefix(String prefix, String uri) { | |
| + throw new UnsupportedOperationException(); | |
| + } | |
| + | |
| + @Override | |
| + public String[] processName(String qName, String[] parts, boolean isAttribute) { | |
| + throw new UnsupportedOperationException(); | |
| + } | |
| + | |
| + @Override | |
| + public void setNamespaceDeclUris(boolean value) { | |
| + throw new UnsupportedOperationException(); | |
| + } | |
| + | |
| + @Override | |
| + public boolean isNamespaceDeclUris() { | |
| + throw new UnsupportedOperationException(); | |
| + } | |
| + | |
| +} | |
| diff --git a/src/wfs/src/main/java/org/geoserver/wfs/GetFeature.java b/src/wfs/src/main/java/org/geoserver/wfs/GetFeature.java | |
| index 0b145ad..43f054b 100644 | |
| --- a/src/wfs/src/main/java/org/geoserver/wfs/GetFeature.java | |
| +++ b/src/wfs/src/main/java/org/geoserver/wfs/GetFeature.java | |
| @@ -4,7 +4,7 @@ | |
| */ | |
| package org.geoserver.wfs; | |
| -import static org.geoserver.ows.util.ResponseUtils.buildURL; | |
| +import static org.geoserver.ows.util.ResponseUtils.*; | |
| import java.io.IOException; | |
| import java.math.BigInteger; | |
| @@ -193,13 +193,7 @@ public class GetFeature { | |
| * @return NamespaceSupport from Catalog | |
| */ | |
| public NamespaceSupport getNamespaceSupport() { | |
| - NamespaceSupport ns = new NamespaceSupport(); | |
| - Iterator<NamespaceInfo> it = getCatalog().getNamespaces().iterator(); | |
| - while (it.hasNext()) { | |
| - NamespaceInfo ni = it.next(); | |
| - ns.declarePrefix(ni.getPrefix(), ni.getURI()); | |
| - } | |
| - return ns; | |
| + return new CatalogNamespaceSupport(catalog); | |
| } | |
| /** | |
| @@ -293,7 +287,7 @@ public class GetFeature { | |
| // grab the view params is any | |
| List<Map<String, String>> viewParams = null; | |
| if(request.getViewParams() != null && request.getViewParams().size() > 0) { | |
| - viewParams = (List<Map<String, String>>) request.getViewParams(); | |
| + viewParams = request.getViewParams(); | |
| } | |
| int count = 0; // should probably be long | |
| @@ -398,6 +392,9 @@ public class GetFeature { | |
| //set up joins (if specified) | |
| List<Join> joins = null; | |
| + String primaryAlias = null; | |
| + QName primaryTypeName = query.getTypeNames().get(0); | |
| + FeatureTypeInfo primaryMeta = metas.get(0); | |
| //make sure filters are sane | |
| // | |
| @@ -419,11 +416,15 @@ public class GetFeature { | |
| throw new WFSException(request, | |
| "Unable to preform join with specified filter: " + filter); | |
| } | |
| - //join, need to separate the joining filter from other filters | |
| + // join, need to separate the joining filter from other filters | |
| JoinExtractingVisitor extractor = | |
| new JoinExtractingVisitor(metas, query.getAliases()); | |
| filter.accept(extractor, null); | |
| + primaryAlias = extractor.getPrimaryAlias(); | |
| + primaryMeta = extractor.getPrimaryFeatureType(); | |
| + primaryTypeName = new QName(primaryMeta.getNamespace().getURI(), | |
| + primaryMeta.getNativeName()); | |
| joins = extractor.getJoins(); | |
| if (joins.size() != metas.size()-1) { | |
| throw new WFSException(request, String.format("Query specified %d types but %d " + | |
| @@ -458,7 +459,7 @@ public class GetFeature { | |
| hints = new Hints(ResourcePool.JOINS, joins); | |
| } | |
| FeatureSource<? extends FeatureType, ? extends Feature> source = | |
| - metas.get(0).getFeatureSource(null, hints); | |
| + primaryMeta.getFeatureSource(null, hints); | |
| // handle local maximum | |
| int queryMaxFeatures = maxFeatures - count; | |
| @@ -467,8 +468,9 @@ public class GetFeature { | |
| queryMaxFeatures = metaMaxFeatures; | |
| } | |
| Map<String, String> viewParam = viewParams != null ? viewParams.get(i) : null; | |
| - org.geotools.data.Query gtQuery = toDataQuery(query, filter, offset, queryMaxFeatures, | |
| - source, request, allPropNames.get(0), viewParam, joins); | |
| + org.geotools.data.Query gtQuery = toDataQuery(query, filter, offset, | |
| + queryMaxFeatures, source, request, allPropNames.get(0), viewParam, | |
| + joins, primaryTypeName, primaryAlias); | |
| LOGGER.fine("Query is " + query + "\n To gt2: " + gtQuery); | |
| @@ -516,8 +518,9 @@ public class GetFeature { | |
| else { | |
| //no features might have been because of the offset that was specified, check | |
| // the size of the same query but with no offset | |
| - org.geotools.data.Query q2 = toDataQuery(query, filter, 0, queryMaxFeatures, | |
| - source, request, allPropNames.get(0), viewParam, joins); | |
| + org.geotools.data.Query q2 = toDataQuery(query, filter, 0, | |
| + queryMaxFeatures, source, request, allPropNames.get(0), | |
| + viewParam, joins, primaryTypeName, primaryAlias); | |
| //int size2 = getFeatures(request, source, q2).size(); | |
| int size2 = source.getCount(q2); | |
| @@ -534,8 +537,9 @@ public class GetFeature { | |
| if (calculateSize && queryMaxFeatures == Integer.MAX_VALUE && offset == 0) { | |
| totalCountExecutors.add(new CountExecutor(size)); | |
| } else { | |
| - org.geotools.data.Query qTotal = toDataQuery(query, filter, 0, Integer.MAX_VALUE, | |
| - source, request, allPropNames.get(0), viewParam, joins); | |
| + org.geotools.data.Query qTotal = toDataQuery(query, filter, 0, | |
| + Integer.MAX_VALUE, source, request, allPropNames.get(0), viewParam, | |
| + joins, primaryTypeName, primaryAlias); | |
| totalCountExecutors.add(new CountExecutor(source, qTotal)); | |
| } | |
| @@ -898,9 +902,10 @@ public class GetFeature { | |
| * @return A Query for use with the FeatureSource interface | |
| * | |
| */ | |
| - public org.geotools.data.Query toDataQuery(Query query, Filter filter, int offset, int maxFeatures, | |
| - FeatureSource<? extends FeatureType, ? extends Feature> source, GetFeatureRequest request, | |
| - List<PropertyName> props, Map<String, String> viewParams, List<Join> joins) throws WFSException { | |
| + public org.geotools.data.Query toDataQuery(Query query, Filter filter, int offset, | |
| + int maxFeatures, FeatureSource<? extends FeatureType, ? extends Feature> source, | |
| + GetFeatureRequest request, List<PropertyName> props, Map<String, String> viewParams, | |
| + List<Join> joins, QName primaryTypeName, String primaryAlias) throws WFSException { | |
| String wfsVersion = request.getVersion(); | |
| @@ -929,11 +934,11 @@ public class GetFeature { | |
| transformedFilter = WFSReprojectionUtil.normalizeFilterCRS(filter, source.getSchema(), declaredCRS); | |
| //only handle non-joins for now | |
| - QName typeName = query.getTypeNames().get(0); | |
| + QName typeName = primaryTypeName; | |
| org.geotools.data.Query dataQuery = new org.geotools.data.Query(typeName.getLocalPart(), | |
| transformedFilter, maxFeatures, props, query.getHandle()); | |
| - if (!query.getAliases().isEmpty()) { | |
| - dataQuery.setAlias(query.getAliases().get(0)); | |
| + if (primaryAlias != null) { | |
| + dataQuery.setAlias(primaryAlias); | |
| } | |
| //handle reprojection | |
| @@ -957,7 +962,7 @@ public class GetFeature { | |
| //handle sorting | |
| List<SortBy> sortBy = query.getSortBy(); | |
| if (sortBy != null) { | |
| - dataQuery.setSortBy((SortBy[]) sortBy.toArray(new SortBy[sortBy.size()])); | |
| + dataQuery.setSortBy(sortBy.toArray(new SortBy[sortBy.size()])); | |
| } | |
| //handle version, datastore may be able to use it | |
| diff --git a/src/wfs/src/main/java/org/geoserver/wfs/JoinExtractingVisitor.java b/src/wfs/src/main/java/org/geoserver/wfs/JoinExtractingVisitor.java | |
| index cd45c8e..ee42bdb 100644 | |
| --- a/src/wfs/src/main/java/org/geoserver/wfs/JoinExtractingVisitor.java | |
| +++ b/src/wfs/src/main/java/org/geoserver/wfs/JoinExtractingVisitor.java | |
| @@ -6,7 +6,9 @@ package org.geoserver.wfs; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| +import java.util.HashSet; | |
| import java.util.List; | |
| +import java.util.Set; | |
| import org.geoserver.catalog.FeatureTypeInfo; | |
| import org.geotools.data.Join; | |
| @@ -18,7 +20,6 @@ import org.opengis.filter.BinaryComparisonOperator; | |
| import org.opengis.filter.BinaryLogicOperator; | |
| import org.opengis.filter.ExcludeFilter; | |
| import org.opengis.filter.Filter; | |
| -import org.opengis.filter.FilterFactory; | |
| import org.opengis.filter.FilterFactory2; | |
| import org.opengis.filter.Id; | |
| import org.opengis.filter.IncludeFilter; | |
| @@ -41,23 +42,27 @@ public class JoinExtractingVisitor extends FilterVisitorSupport { | |
| List<FeatureTypeInfo> featureTypes; | |
| List<String> aliases; | |
| + boolean hadAliases; | |
| + | |
| List<Filter> joinFilters = new ArrayList<Filter>(); | |
| List<Filter> filters = new ArrayList<Filter>(); | |
| public JoinExtractingVisitor(List<FeatureTypeInfo> featureTypes, List<String> aliases) { | |
| - this.primaryFeatureType = featureTypes.get(0); | |
| - this.featureTypes = featureTypes.subList(1, featureTypes.size()); | |
| + this.primaryFeatureType = null; | |
| + this.featureTypes = new ArrayList<>(featureTypes); | |
| if (aliases == null || aliases.isEmpty()) { | |
| + hadAliases = false; | |
| //assign prefixes | |
| aliases = new ArrayList<String>(); | |
| for (int i = 0; i < featureTypes.size(); i++) { | |
| aliases.add(String.valueOf((char)('a' + i))); | |
| } | |
| + } else { | |
| + hadAliases = true; | |
| } | |
| - this.primaryAlias = aliases.get(0); | |
| - this.aliases = aliases.subList(1, aliases.size()); | |
| + this.aliases = new ArrayList(aliases); | |
| } | |
| public Object visitNullFilter(Object extraData) { | |
| @@ -171,7 +176,9 @@ public class JoinExtractingVisitor extends FilterVisitorSupport { | |
| public List<Join> getJoins() { | |
| List<Join> joins = new ArrayList(); | |
| - | |
| + | |
| + setupPrimary(); | |
| + | |
| //unroll the contents of the join filters and rewrite them and and assign to correct | |
| //feature type | |
| List<Filter> joinFilters = rewriteAndSort(unroll(this.joinFilters), true); | |
| @@ -180,7 +187,8 @@ public class JoinExtractingVisitor extends FilterVisitorSupport { | |
| List<Filter> otherFilters = rewriteAndSort(unroll(this.filters), false); | |
| for (int i = 0; i < featureTypes.size(); i++) { | |
| - Join join = new Join(featureTypes.get(i).getNativeName(), joinFilters.get(i+1)); | |
| + String nativeName = featureTypes.get(i).getNativeName(); | |
| + Join join = new Join(nativeName, joinFilters.get(i+1)); | |
| if (aliases != null) { | |
| join.setAlias(aliases.get(i)); | |
| } | |
| @@ -193,11 +201,36 @@ public class JoinExtractingVisitor extends FilterVisitorSupport { | |
| return joins; | |
| } | |
| + /** | |
| + * Find the center of the star join, and remove it from the feature types and aliases arrays the | |
| + * rest of the algorithm is setup to have only the secondary types in these arrays | |
| + */ | |
| + private void setupPrimary() { | |
| + if (primaryFeatureType == null) { | |
| + int idx = getPrimaryFeatureTypeIndex(this.joinFilters); | |
| + primaryFeatureType = featureTypes.get(idx); | |
| + primaryAlias = aliases.get(idx); | |
| + featureTypes.remove(idx); | |
| + aliases.remove(idx); | |
| + } | |
| + } | |
| + | |
| public Filter getPrimaryFilter() { | |
| + setupPrimary(); | |
| List<Filter> otherFilters = rewriteAndSort(unroll(this.filters), false); | |
| return otherFilters.get(0); | |
| } | |
| + public String getPrimaryAlias() { | |
| + setupPrimary(); | |
| + return primaryAlias; | |
| + } | |
| + | |
| + public FeatureTypeInfo getPrimaryFeatureType() { | |
| + setupPrimary(); | |
| + return primaryFeatureType; | |
| + } | |
| + | |
| List<Filter> unroll(List<Filter> filters) { | |
| JoinFilterUnroller unroller = new JoinFilterUnroller(); | |
| for (Filter f : filters) { | |
| @@ -207,7 +240,7 @@ public class JoinExtractingVisitor extends FilterVisitorSupport { | |
| } | |
| List<Filter> rewriteAndSort(List<Filter> filters, boolean prefix) { | |
| - Filter[] sorted = new Filter[featureTypes.size()+1]; | |
| + Filter[] sorted = new Filter[featureTypes.size() + 1]; | |
| O: for (Filter f : filters) { | |
| PropertyName[] names = names(f); | |
| @@ -235,6 +268,63 @@ O: for (Filter f : filters) { | |
| return Arrays.asList(sorted); | |
| } | |
| + /** | |
| + * Geotools only support "star" joins with a primary being the center of the join. Figure out if | |
| + * we have one feature type that is acting as the center of the star, or throw an exception if | |
| + * we don't have one. | |
| + * | |
| + * @param filters2 | |
| + * @return | |
| + */ | |
| + private int getPrimaryFeatureTypeIndex(List<Filter> filters) { | |
| + if (featureTypes.size() == 2) { | |
| + return 0; | |
| + } | |
| + | |
| + List<Integer> connecteds = new ArrayList<>(); | |
| + for (int i = 0; i < featureTypes.size(); i++) { | |
| + connecteds.add(i); | |
| + } | |
| + for (Filter filter : filters) { | |
| + PropertyName[] names = names(filter); | |
| + Set<Integer> nameTypes = getPropertyNameTypeIndexes(names); | |
| + connecteds.retainAll(nameTypes); | |
| + } | |
| + | |
| + if (connecteds.isEmpty()) { | |
| + throw new WFSException( | |
| + "Cannot run this type of join, at the moment GeoServer only supports " | |
| + + "joins having a single central feature type joined to all others"); | |
| + } else { | |
| + return connecteds.iterator().next(); | |
| + } | |
| + } | |
| + | |
| + private Set<Integer> getPropertyNameTypeIndexes(PropertyName[] names) { | |
| + Set<Integer> result = new HashSet<Integer>(); | |
| + for (PropertyName pn : names) { | |
| + String n = pn.getPropertyName(); | |
| + int idx = n.indexOf("/"); | |
| + if (idx > 0) { | |
| + String typeName = n.substring(0, idx); | |
| + int aliasIdx = aliases.indexOf(typeName); | |
| + if (aliasIdx >= 0) { | |
| + result.add(aliasIdx); | |
| + } else { | |
| + for (int i = 0; i < featureTypes.size(); i++) { | |
| + FeatureTypeInfo ft = featureTypes.get(i); | |
| + if (typeName.equals(ft.prefixedName()) || typeName.equals(ft.getName())) { | |
| + result.add(i); | |
| + break; | |
| + } | |
| + } | |
| + } | |
| + } | |
| + } | |
| + | |
| + return result; | |
| + } | |
| + | |
| void updateFilter(Filter[] filters, int i, Filter filter) { | |
| if (filters[i] == null) { | |
| filters[i] = filter; | |
| @@ -270,8 +360,8 @@ O: for (Filter f : filters) { | |
| PropertyName rewrite(FeatureTypeInfo featureType, String alias, PropertyName name, boolean prefix) { | |
| String n = name.getPropertyName(); | |
| - if (n.startsWith(featureType.getPrefixedName()+"/")) { | |
| - n = n.substring((featureType.getPrefixedName()+"/").length()); | |
| + if (n.startsWith(featureType.prefixedName() + "/")) { | |
| + n = n.substring((featureType.prefixedName() + "/").length()); | |
| } | |
| else if (n.startsWith(featureType.getName()+"/")) { | |
| n = n.substring((featureType.getName()+"/").length()); | |
| @@ -432,4 +522,5 @@ O: for (Filter f : filters) { | |
| return super.visit(expression, extraData); | |
| } | |
| } | |
| + | |
| } | |
| diff --git a/src/wfs/src/main/java/org/geoserver/wfs/json/GeoJSONBuilder.java b/src/wfs/src/main/java/org/geoserver/wfs/json/GeoJSONBuilder.java | |
| index 82ad6eb..50026df 100644 | |
| --- a/src/wfs/src/main/java/org/geoserver/wfs/json/GeoJSONBuilder.java | |
| +++ b/src/wfs/src/main/java/org/geoserver/wfs/json/GeoJSONBuilder.java | |
| @@ -13,6 +13,7 @@ import net.sf.json.JSONException; | |
| import net.sf.json.util.JSONBuilder; | |
| import org.geotools.geometry.jts.coordinatesequence.CoordinateSequences; | |
| +import org.geotools.referencing.CRS; | |
| import org.geotools.util.Converters; | |
| import com.vividsolutions.jts.geom.Coordinate; | |
| @@ -41,6 +42,8 @@ public class GeoJSONBuilder extends JSONBuilder { | |
| private final Logger LOGGER = org.geotools.util.logging.Logging | |
| .getLogger(this.getClass()); | |
| + private CRS.AxisOrder axisOrder = CRS.AxisOrder.EAST_NORTH; | |
| + | |
| public GeoJSONBuilder(Writer w) { | |
| super(w); | |
| } | |
| @@ -150,17 +153,18 @@ public class GeoJSONBuilder extends JSONBuilder { | |
| } | |
| private JSONBuilder writeCoordinate(double x, double y) { | |
| - this.array(); | |
| - this.value(x); | |
| - this.value(y); | |
| - | |
| - return this.endArray(); | |
| + return writeCoordinate(x, y, Double.NaN); | |
| } | |
| private JSONBuilder writeCoordinate(double x, double y, double z) { | |
| this.array(); | |
| - this.value(x); | |
| - this.value(y); | |
| + if(axisOrder==CRS.AxisOrder.NORTH_EAST){ | |
| + this.value(y); | |
| + this.value(x); | |
| + } else { | |
| + this.value(x); | |
| + this.value(y); | |
| + } | |
| if(!Double.isNaN(z)) { | |
| this.value(z); | |
| } | |
| @@ -178,10 +182,17 @@ public class GeoJSONBuilder extends JSONBuilder { | |
| protected JSONBuilder writeBoundingBox(Envelope env) { | |
| this.key("bbox"); | |
| this.array(); | |
| - this.value(env.getMinX()); | |
| - this.value(env.getMinY()); | |
| - this.value(env.getMaxX()); | |
| - this.value(env.getMaxY()); | |
| + if(axisOrder==CRS.AxisOrder.NORTH_EAST) { | |
| + this.value(env.getMinY()); | |
| + this.value(env.getMinX()); | |
| + this.value(env.getMaxY()); | |
| + this.value(env.getMaxX()); | |
| + } else { | |
| + this.value(env.getMinX()); | |
| + this.value(env.getMinY()); | |
| + this.value(env.getMaxX()); | |
| + this.value(env.getMaxY()); | |
| + } | |
| return this.endArray(); | |
| } | |
| @@ -290,4 +301,13 @@ public class GeoJSONBuilder extends JSONBuilder { | |
| super.value(value); | |
| return this; | |
| } | |
| + | |
| + /** | |
| + * Set the axis order to assume all input will be provided in. Has no effect on geometries | |
| + * that have already been written. | |
| + * @param axisOrder | |
| + */ | |
| + public void setAxisOrder(CRS.AxisOrder axisOrder) { | |
| + this.axisOrder = axisOrder; | |
| + } | |
| } | |
| diff --git a/src/wfs/src/main/java/org/geoserver/wfs/json/GeoJSONGetFeatureResponse.java b/src/wfs/src/main/java/org/geoserver/wfs/json/GeoJSONGetFeatureResponse.java | |
| index 39b5c51..c9a7bf9 100644 | |
| --- a/src/wfs/src/main/java/org/geoserver/wfs/json/GeoJSONGetFeatureResponse.java | |
| +++ b/src/wfs/src/main/java/org/geoserver/wfs/json/GeoJSONGetFeatureResponse.java | |
| @@ -26,6 +26,7 @@ import org.geoserver.catalog.FeatureTypeInfo; | |
| import org.geoserver.config.GeoServer; | |
| import org.geoserver.ows.Dispatcher; | |
| import org.geoserver.ows.Request; | |
| +import org.geoserver.platform.GeoServerExtensions; | |
| import org.geoserver.platform.Operation; | |
| import org.geoserver.platform.ServiceException; | |
| import org.geoserver.wfs.WFSGetFeatureOutputFormat; | |
| @@ -37,6 +38,10 @@ import org.geotools.data.Query; | |
| import org.geotools.feature.FeatureCollection; | |
| import org.geotools.feature.FeatureIterator; | |
| import org.geotools.geometry.jts.ReferencedEnvelope; | |
| +import org.geotools.gml2.SrsSyntax; | |
| +import org.geotools.gml2.bindings.GML2EncodingUtils; | |
| +import org.geotools.referencing.CRS; | |
| +import org.geotools.referencing.CRS.AxisOrder; | |
| import org.geotools.referencing.NamedIdentifier; | |
| import org.opengis.feature.Feature; | |
| import org.opengis.feature.simple.SimpleFeature; | |
| @@ -45,6 +50,7 @@ import org.opengis.feature.type.AttributeDescriptor; | |
| import org.opengis.feature.type.FeatureType; | |
| import org.opengis.feature.type.GeometryDescriptor; | |
| import org.opengis.filter.Filter; | |
| +import org.opengis.referencing.FactoryException; | |
| import org.opengis.referencing.ReferenceIdentifier; | |
| import org.opengis.referencing.crs.CoordinateReferenceSystem; | |
| @@ -180,6 +186,11 @@ public class GeoJSONGetFeatureResponse extends WFSGetFeatureOutputFormat { | |
| } | |
| GeometryDescriptor defaultGeomType = fType.getGeometryDescriptor(); | |
| + CoordinateReferenceSystem featureCrs = | |
| + fType.getGeometryDescriptor().getCoordinateReferenceSystem(); | |
| + | |
| + jsonWriter.setAxisOrder(CRS.getAxisOrder(featureCrs)); | |
| + | |
| if (crs == null && defaultGeomType != null) | |
| crs = fType.getGeometryDescriptor().getCoordinateReferenceSystem(); | |
| @@ -257,29 +268,18 @@ public class GeoJSONGetFeatureResponse extends WFSGetFeatureOutputFormat { | |
| } | |
| jsonWriter.endArray(); // end features | |
| - // Coordinate Referense System, currently only if the namespace is | |
| - // EPSG | |
| - if (crs != null) { | |
| - Set<ReferenceIdentifier> ids = crs.getIdentifiers(); | |
| - // WKT defined crs might not have identifiers at all | |
| - if (ids != null && ids.size() > 0) { | |
| - NamedIdentifier namedIdent = (NamedIdentifier) ids.iterator().next(); | |
| - String csStr = namedIdent.getCodeSpace().toUpperCase(); | |
| - | |
| - if (csStr.equals("EPSG")) { | |
| - jsonWriter.key("crs"); | |
| - jsonWriter.object(); | |
| - jsonWriter.key("type").value(csStr); | |
| - jsonWriter.key("properties"); | |
| - jsonWriter.object(); | |
| - jsonWriter.key("code"); | |
| - jsonWriter.value(namedIdent.getCode()); | |
| - jsonWriter.endObject(); // end properties | |
| - jsonWriter.endObject(); // end crs | |
| - } | |
| + // Coordinate Referense System | |
| + try { | |
| + if ("true".equals(GeoServerExtensions.getProperty("GEOSERVER_GEOJSON_LEGACY_CRS"))){ | |
| + // This is wrong, but GeoServer used to do it this way. | |
| + writeCrsLegacy(jsonWriter, crs); | |
| + } else { | |
| + writeCrs(jsonWriter, crs); | |
| } | |
| + } catch (FactoryException e) { | |
| + throw (IOException) new IOException("Error looking up crs identifier").initCause(e); | |
| } | |
| - | |
| + | |
| // Bounding box for featurecollection | |
| if (hasGeom && featureBounding) { | |
| ReferencedEnvelope e = null; | |
| @@ -294,6 +294,7 @@ public class GeoJSONGetFeatureResponse extends WFSGetFeatureOutputFormat { | |
| } | |
| if (e != null) { | |
| + jsonWriter.setAxisOrder(CRS.getAxisOrder(e.getCoordinateReferenceSystem())); | |
| jsonWriter.writeBoundingBox(e); | |
| } | |
| } | |
| @@ -314,6 +315,61 @@ public class GeoJSONGetFeatureResponse extends WFSGetFeatureOutputFormat { | |
| } | |
| } | |
| + private void writeCrs(final GeoJSONBuilder jsonWriter, | |
| + CoordinateReferenceSystem crs) throws FactoryException { | |
| + if (crs != null) { | |
| + String identifier = CRS.lookupIdentifier(crs, true); | |
| + // If we get a plain EPSG code, generate a URI as the GeoJSON spec says to | |
| + // prefer them. | |
| + | |
| + if(identifier.startsWith("EPSG:")) { | |
| + String code = GML2EncodingUtils.epsgCode(crs); | |
| + if (code != null) { | |
| + identifier = SrsSyntax.OGC_URN.getPrefix() + code; | |
| + } | |
| + } | |
| + jsonWriter.key("crs"); | |
| + jsonWriter.object(); | |
| + jsonWriter.key("type").value("name"); | |
| + jsonWriter.key("properties"); | |
| + jsonWriter.object(); | |
| + jsonWriter.key("name"); | |
| + jsonWriter.value(identifier); | |
| + jsonWriter.endObject(); // end properties | |
| + jsonWriter.endObject(); // end crs | |
| + } else { | |
| + jsonWriter.key("crs"); | |
| + jsonWriter.value(null); | |
| + } | |
| + } | |
| + | |
| + // Doesn't follow spec, but GeoServer used to do this. | |
| + private void writeCrsLegacy(final GeoJSONBuilder jsonWriter, | |
| + CoordinateReferenceSystem crs) { | |
| + // Coordinate Referense System, currently only if the namespace is | |
| + // EPSG | |
| + if (crs != null) { | |
| + Set<ReferenceIdentifier> ids = crs.getIdentifiers(); | |
| + // WKT defined crs might not have identifiers at all | |
| + if (ids != null && ids.size() > 0) { | |
| + NamedIdentifier namedIdent = (NamedIdentifier) ids.iterator().next(); | |
| + String csStr = namedIdent.getCodeSpace().toUpperCase(); | |
| + | |
| + if (csStr.equals("EPSG")) { | |
| + jsonWriter.key("crs"); | |
| + jsonWriter.object(); | |
| + jsonWriter.key("type").value(csStr); | |
| + jsonWriter.key("properties"); | |
| + jsonWriter.object(); | |
| + jsonWriter.key("code"); | |
| + jsonWriter.value(namedIdent.getCode()); | |
| + jsonWriter.endObject(); // end properties | |
| + jsonWriter.endObject(); // end crs | |
| + } | |
| + } | |
| + } | |
| + } | |
| + | |
| private String getCallbackFunction() { | |
| Request request = Dispatcher.REQUEST.get(); | |
| if (request == null) { | |
| diff --git a/src/wfs/src/test/java/org/geoserver/wfs/CatalogNamespaceSupportTest.java b/src/wfs/src/test/java/org/geoserver/wfs/CatalogNamespaceSupportTest.java | |
| new file mode 100644 | |
| index 0000000..507dd4e | |
| --- /dev/null | |
| +++ b/src/wfs/src/test/java/org/geoserver/wfs/CatalogNamespaceSupportTest.java | |
| @@ -0,0 +1,91 @@ | |
| +package org.geoserver.wfs; | |
| + | |
| +import org.geoserver.catalog.Catalog; | |
| +import org.geoserver.catalog.NamespaceInfo; | |
| +import org.junit.Before; | |
| +import org.junit.Test; | |
| + | |
| +import static org.easymock.EasyMock.*; | |
| +import static org.junit.Assert.assertEquals; | |
| +import static org.junit.Assert.assertNull; | |
| + | |
| +public class CatalogNamespaceSupportTest { | |
| + | |
| + @Test | |
| + public void testGetURI() { | |
| + NamespaceInfo ns = createMock(NamespaceInfo.class); | |
| + expect(ns.getURI()).andReturn("http://foo.org"); | |
| + | |
| + Catalog cat = createMock(Catalog.class); | |
| + expect(cat.getNamespaceByPrefix("foo")).andReturn(ns); | |
| + | |
| + replay(ns, cat); | |
| + | |
| + CatalogNamespaceSupport nsSupport = new CatalogNamespaceSupport(cat); | |
| + assertEquals("http://foo.org", nsSupport.getURI("foo")); | |
| + | |
| + verify(ns, cat); | |
| + } | |
| + | |
| + @Test | |
| + public void testGetDefaultURI() { | |
| + NamespaceInfo ns = createMock(NamespaceInfo.class); | |
| + expect(ns.getURI()).andReturn("http://foo.org"); | |
| + | |
| + Catalog cat = createMock(Catalog.class); | |
| + expect(cat.getDefaultNamespace()).andReturn(ns); | |
| + | |
| + replay(ns, cat); | |
| + | |
| + CatalogNamespaceSupport nsSupport = new CatalogNamespaceSupport(cat); | |
| + assertEquals("http://foo.org", nsSupport.getURI("")); | |
| + | |
| + verify(ns, cat); | |
| + } | |
| + | |
| + @Test | |
| + public void testGetPrefix() { | |
| + NamespaceInfo ns = createMock(NamespaceInfo.class); | |
| + expect(ns.getPrefix()).andReturn("foo"); | |
| + | |
| + Catalog cat = createMock(Catalog.class); | |
| + expect(cat.getNamespaceByURI("http://foo.org")).andReturn(ns); | |
| + | |
| + replay(ns, cat); | |
| + | |
| + CatalogNamespaceSupport nsSupport = new CatalogNamespaceSupport(cat); | |
| + assertEquals("foo", nsSupport.getPrefix("http://foo.org")); | |
| + | |
| + verify(ns, cat); | |
| + } | |
| + | |
| + @Test | |
| + public void testGetDefaultPrefix() { | |
| + NamespaceInfo ns = createMock(NamespaceInfo.class); | |
| + expect(ns.getPrefix()).andReturn("foo"); | |
| + | |
| + Catalog cat = createMock(Catalog.class); | |
| + expect(cat.getDefaultNamespace()).andReturn(ns); | |
| + | |
| + replay(ns, cat); | |
| + | |
| + CatalogNamespaceSupport nsSupport = new CatalogNamespaceSupport(cat); | |
| + assertEquals("foo", nsSupport.getPrefix("")); | |
| + | |
| + verify(ns, cat); | |
| + } | |
| + | |
| + @Test | |
| + public void testNulls() { | |
| + Catalog cat = createMock(Catalog.class); | |
| + expect(cat.getNamespaceByURI(null)).andReturn(null); | |
| + expect(cat.getNamespaceByPrefix(null)).andReturn(null); | |
| + replay(cat); | |
| + | |
| + CatalogNamespaceSupport nsSupport = new CatalogNamespaceSupport(cat); | |
| + assertNull(nsSupport.getPrefix(null)); | |
| + assertNull(nsSupport.getURI(null)); | |
| + | |
| + verify(cat); | |
| + } | |
| +} | |
| diff --git a/src/wfs/src/test/java/org/geoserver/wfs/JoinExtractingVisitorTest.java b/src/wfs/src/test/java/org/geoserver/wfs/JoinExtractingVisitorTest.java | |
| new file mode 100644 | |
| index 0000000..670621e | |
| --- /dev/null | |
| +++ b/src/wfs/src/test/java/org/geoserver/wfs/JoinExtractingVisitorTest.java | |
| @@ -0,0 +1,152 @@ | |
| +package org.geoserver.wfs; | |
| + | |
| +import static org.easymock.EasyMock.*; | |
| +import static org.junit.Assert.*; | |
| + | |
| +import java.util.Arrays; | |
| +import java.util.List; | |
| + | |
| +import org.geoserver.catalog.FeatureTypeInfo; | |
| +import org.geotools.data.Join; | |
| +import org.geotools.factory.CommonFactoryFinder; | |
| +import org.junit.Before; | |
| +import org.junit.Test; | |
| +import org.opengis.filter.Filter; | |
| +import org.opengis.filter.FilterFactory2; | |
| + | |
| +public class JoinExtractingVisitorTest { | |
| + | |
| + private FeatureTypeInfo lakes; | |
| + | |
| + private FeatureTypeInfo forests; | |
| + | |
| + private FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(); | |
| + | |
| + private FeatureTypeInfo buildings; | |
| + | |
| + @Before | |
| + public void setup() { | |
| + lakes = createNiceMock(FeatureTypeInfo.class); | |
| + expect(lakes.prefixedName()).andReturn("gs:Lakes").anyTimes(); | |
| + expect(lakes.getNativeName()).andReturn("Lakes").anyTimes(); | |
| + | |
| + forests = createNiceMock(FeatureTypeInfo.class); | |
| + expect(forests.prefixedName()).andReturn("gs:Forests").anyTimes(); | |
| + expect(forests.getNativeName()).andReturn("Forests").anyTimes(); | |
| + | |
| + buildings = createNiceMock(FeatureTypeInfo.class); | |
| + expect(buildings.prefixedName()).andReturn("gs:Buildings").anyTimes(); | |
| + expect(buildings.getNativeName()).andReturn("Buildings").anyTimes(); | |
| + | |
| + replay(lakes, forests, buildings); | |
| + } | |
| + | |
| + @Test | |
| + public void testTwoWayJoin() { | |
| + JoinExtractingVisitor visitor = new JoinExtractingVisitor(Arrays.asList(lakes, forests), | |
| + Arrays.asList("a", "b")); | |
| + Filter f = ff.equals(ff.property("a/FID"), ff.property("b/FID")); | |
| + f.accept(visitor, null); | |
| + | |
| + assertEquals("a", visitor.getPrimaryAlias()); | |
| + | |
| + Filter primary = visitor.getPrimaryFilter(); | |
| + assertNull(primary); | |
| + | |
| + List<Join> joins = visitor.getJoins(); | |
| + assertEquals(1, joins.size()); | |
| + Join join = joins.get(0); | |
| + assertEquals("Forests", join.getTypeName()); | |
| + assertEquals("b", join.getAlias()); | |
| + assertEquals(ff.equals(ff.property("a.FID"), ff.property("b.FID")), join.getJoinFilter()); | |
| + } | |
| + | |
| + @Test | |
| + public void testThreeWayJoin() { | |
| + JoinExtractingVisitor visitor = new JoinExtractingVisitor(Arrays.asList(lakes, forests, | |
| + buildings), Arrays.asList("a", "b", "c")); | |
| + Filter f1 = ff.equals(ff.property("a/FID"), ff.property("b/FID")); | |
| + Filter f2 = ff.equals(ff.property("b/FID"), ff.property("c/FID")); | |
| + Filter f = ff.and(Arrays.asList(f1, f2)); | |
| + f.accept(visitor, null); | |
| + | |
| + assertEquals("b", visitor.getPrimaryAlias()); | |
| + | |
| + Filter primary = visitor.getPrimaryFilter(); | |
| + assertNull(primary); | |
| + | |
| + List<Join> joins = visitor.getJoins(); | |
| + assertEquals(2, joins.size()); | |
| + | |
| + Join j1 = joins.get(0); | |
| + assertEquals("Lakes", j1.getTypeName()); | |
| + assertEquals("a", j1.getAlias()); | |
| + assertEquals(ff.equals(ff.property("a.FID"), ff.property("b.FID")), j1.getJoinFilter()); | |
| + | |
| + Join j2 = joins.get(1); | |
| + assertEquals("Buildings", j2.getTypeName()); | |
| + assertEquals("c", j2.getAlias()); | |
| + assertEquals(ff.equals(ff.property("b.FID"), ff.property("c.FID")), j2.getJoinFilter()); | |
| + } | |
| + | |
| + @Test | |
| + public void testThreeWayJoinPrimaryFilters() { | |
| + JoinExtractingVisitor visitor = new JoinExtractingVisitor(Arrays.asList(lakes, forests, | |
| + buildings), Arrays.asList("a", "b", "c")); | |
| + Filter fj1 = ff.equals(ff.property("a/FID"), ff.property("b/FID")); | |
| + Filter fj2 = ff.equals(ff.property("b/FID"), ff.property("c/FID")); | |
| + Filter f1 = ff.equals(ff.property("a/FID"), ff.literal("Lakes.10")); | |
| + Filter f2 = ff.equals(ff.property("b/FID"), ff.literal("Forests.10")); | |
| + Filter f3 = ff.equals(ff.property("c/FID"), ff.literal("Buildings.10")); | |
| + Filter f = ff.and(Arrays.asList(f1, f2, f3, fj1, fj2)); | |
| + f.accept(visitor, null); | |
| + | |
| + assertEquals("b", visitor.getPrimaryAlias()); | |
| + | |
| + Filter primary = visitor.getPrimaryFilter(); | |
| + assertEquals(ff.equals(ff.property("FID"), ff.literal("Forests.10")), primary); | |
| + | |
| + List<Join> joins = visitor.getJoins(); | |
| + assertEquals(2, joins.size()); | |
| + | |
| + Join j1 = joins.get(0); | |
| + assertEquals("Lakes", j1.getTypeName()); | |
| + assertEquals("a", j1.getAlias()); | |
| + assertEquals(ff.equals(ff.property("a.FID"), ff.property("b.FID")), j1.getJoinFilter()); | |
| + assertEquals(ff.equals(ff.property("FID"), ff.literal("Lakes.10")), j1.getFilter()); | |
| + | |
| + Join j2 = joins.get(1); | |
| + assertEquals("Buildings", j2.getTypeName()); | |
| + assertEquals("c", j2.getAlias()); | |
| + assertEquals(ff.equals(ff.property("b.FID"), ff.property("c.FID")), j2.getJoinFilter()); | |
| + assertEquals(ff.equals(ff.property("FID"), ff.literal("Buildings.10")), j2.getFilter()); | |
| + } | |
| + | |
| + @Test | |
| + public void testThreeWayJoinWithSelf() { | |
| + JoinExtractingVisitor visitor = new JoinExtractingVisitor(Arrays.asList(forests, lakes, | |
| + lakes), Arrays.asList("a", "b", "c")); | |
| + Filter f1 = ff.equals(ff.property("a/FID"), ff.property("b/FID")); | |
| + Filter f2 = ff.equals(ff.property("b/FID"), ff.property("c/FID")); | |
| + Filter f = ff.and(Arrays.asList(f1, f2)); | |
| + f.accept(visitor, null); | |
| + | |
| + assertEquals("b", visitor.getPrimaryAlias()); | |
| + | |
| + Filter primary = visitor.getPrimaryFilter(); | |
| + assertNull(primary); | |
| + | |
| + List<Join> joins = visitor.getJoins(); | |
| + assertEquals(2, joins.size()); | |
| + | |
| + Join j1 = joins.get(0); | |
| + assertEquals("Forests", j1.getTypeName()); | |
| + assertEquals("a", j1.getAlias()); | |
| + assertEquals(ff.equals(ff.property("a.FID"), ff.property("b.FID")), j1.getJoinFilter()); | |
| + | |
| + Join j2 = joins.get(1); | |
| + assertEquals("Lakes", j2.getTypeName()); | |
| + assertEquals("c", j2.getAlias()); | |
| + assertEquals(ff.equals(ff.property("b.FID"), ff.property("c.FID")), j2.getJoinFilter()); | |
| + } | |
| +} | |
| diff --git a/src/wfs/src/test/java/org/geoserver/wfs/json/GeoJSONTest.java b/src/wfs/src/test/java/org/geoserver/wfs/json/GeoJSONTest.java | |
| index 15c3fd3..fb297ef 100644 | |
| --- a/src/wfs/src/test/java/org/geoserver/wfs/json/GeoJSONTest.java | |
| +++ b/src/wfs/src/test/java/org/geoserver/wfs/json/GeoJSONTest.java | |
| @@ -6,27 +6,38 @@ | |
| package org.geoserver.wfs.json; | |
| +import static org.hamcrest.Matchers.*; | |
| import static org.junit.Assert.assertEquals; | |
| +import static org.junit.Assert.assertThat; | |
| import static org.junit.Assert.assertTrue; | |
| import static org.junit.Assert.assertFalse; | |
| import static org.junit.Assert.assertNotNull; | |
| import java.io.File; | |
| +import java.util.Collection; | |
| import java.util.Collections; | |
| +import java.util.regex.Matcher; | |
| +import java.util.regex.Pattern; | |
| import javax.xml.namespace.QName; | |
| -import net.sf.json.JSON; | |
| import net.sf.json.JSONArray; | |
| import net.sf.json.JSONNull; | |
| import net.sf.json.JSONObject; | |
| +import org.geoserver.catalog.FeatureTypeInfo; | |
| +import org.geoserver.catalog.ProjectionPolicy; | |
| import org.geoserver.config.GeoServer; | |
| import org.geoserver.data.test.SystemTestData; | |
| import org.geoserver.data.util.IOUtils; | |
| import org.geoserver.wfs.WFSInfo; | |
| import org.geoserver.wfs.WFSTestSupport; | |
| +import org.geotools.referencing.CRS; | |
| +import org.hamcrest.Description; | |
| +import org.hamcrest.Matchers; | |
| import org.junit.Test; | |
| +import org.opengis.referencing.FactoryException; | |
| +import org.opengis.referencing.crs.CoordinateReferenceSystem; | |
| import com.mockrunner.mock.web.MockHttpServletResponse; | |
| @@ -38,14 +49,37 @@ import com.mockrunner.mock.web.MockHttpServletResponse; | |
| public class GeoJSONTest extends WFSTestSupport { | |
| public static QName LINE3D = new QName(SystemTestData.CITE_URI, "Line3D", SystemTestData.CITE_PREFIX); | |
| + public static QName POINT_LATLON = new QName(SystemTestData.CITE_URI, "PointLatLon", SystemTestData.CITE_PREFIX); | |
| + public static QName POINT_LONLAT = new QName(SystemTestData.CITE_URI, "PointLonLat", SystemTestData.CITE_PREFIX); | |
| @Override | |
| + @SuppressWarnings("unchecked") | |
| protected void setUpInternal(SystemTestData data) throws Exception { | |
| + super.setUpInternal(data); | |
| File security = new File(getTestData().getDataDirectoryRoot(), "security"); | |
| security.mkdir(); | |
| File layers = new File(security, "layers.properties"); | |
| IOUtils.copy(GeoJSONTest.class.getResourceAsStream("layers_ro.properties"), layers); | |
| data.addVectorLayer (LINE3D, Collections.EMPTY_MAP, getClass(), getCatalog()); | |
| + | |
| + // A feature type with Lat-Lon/North-East axis ordering. | |
| + data.addVectorLayer (POINT_LATLON, Collections.EMPTY_MAP, getClass(), getCatalog()); | |
| + CoordinateReferenceSystem crsLatLon = CRS.decode("urn:ogc:def:crs:EPSG::4326"); | |
| + FeatureTypeInfo pointLatLon = getCatalog().getFeatureTypeByName(POINT_LATLON.getPrefix(), POINT_LATLON.getLocalPart()); | |
| + pointLatLon.setNativeCRS(crsLatLon); | |
| + pointLatLon.setSRS("urn:ogc:def:crs:EPSG::4326"); | |
| + pointLatLon.setProjectionPolicy(ProjectionPolicy.FORCE_DECLARED); | |
| + getCatalog().save(pointLatLon); | |
| + | |
| + // A feature type with Lon-Lat/East-North axis ordering. | |
| + data.addVectorLayer (POINT_LONLAT, Collections.EMPTY_MAP, getClass(), getCatalog()); | |
| + CoordinateReferenceSystem crsLonLat = CRS.decode("EPSG:4326", true); | |
| + FeatureTypeInfo pointLonLat = getCatalog().getFeatureTypeByName(POINT_LONLAT.getPrefix(), POINT_LONLAT.getLocalPart()); | |
| + pointLatLon.setNativeCRS(crsLonLat); | |
| + pointLatLon.setSRS("EPSG:4326"); | |
| + pointLatLon.setProjectionPolicy(ProjectionPolicy.FORCE_DECLARED); | |
| + getCatalog().save(pointLonLat); | |
| + | |
| } | |
| @Test | |
| @@ -192,6 +226,10 @@ public class GeoJSONTest extends WFSTestSupport { | |
| geomArray = geomArray.getJSONArray(0); | |
| geomArray = geomArray.getJSONArray(0); | |
| assertEquals(geomArray.getString(0), "55.174"); | |
| + CoordinateReferenceSystem expectedCrs = getCatalog().getLayerByName(getLayerId(SystemTestData.AGGREGATEGEOFEATURE)).getResource().getCRS(); | |
| + JSONObject aCRS = rootObject.getJSONObject("crs"); | |
| + assertThat(aCRS.getString("type"), equalTo("name")); | |
| + assertThat(aCRS, encodesCRS(expectedCrs)); | |
| } | |
| @Test | |
| @@ -303,7 +341,7 @@ public class GeoJSONTest extends WFSTestSupport { | |
| + "&outputformat=" + JSONType.json); | |
| // print(collection); | |
| assertEquals(1, collection.getInt("totalFeatures")); | |
| - assertEquals("4327", collection.getJSONObject("crs").getJSONObject("properties").getString("code")); | |
| + //assertEquals("4327", collection.getJSONObject("crs").getJSONObject("properties").getString("code")); | |
| JSONArray features = collection.getJSONArray("features"); | |
| assertEquals(1, features.size()); | |
| JSONObject feature = features.getJSONObject(0); | |
| @@ -318,5 +356,108 @@ public class GeoJSONTest extends WFSTestSupport { | |
| assertEquals(120, c2.getInt(0)); | |
| assertEquals(0, c2.getInt(1)); | |
| assertEquals(100, c2.getInt(2)); | |
| + | |
| + CoordinateReferenceSystem expectedCrs = CRS.decode("EPSG:4327"); | |
| + JSONObject aCRS = collection.getJSONObject("crs"); | |
| + assertThat(aCRS, encodesCRS(expectedCrs)); | |
| + } | |
| + | |
| + // Checks that the result is in EAST_NORTH/LON_LAT order regardless of the source order | |
| + protected void doAxisSwapTest(QName layer, CRS.AxisOrder sourceOrder) throws Exception { | |
| + // Failure here means the setup for the test is broken and would invalidate the test | |
| + assertThat(CRS.getAxisOrder( | |
| + getCatalog().getFeatureTypeByName(layer.getPrefix(), layer.getLocalPart()).getCRS() | |
| + ), is(sourceOrder)); | |
| + | |
| + JSONObject collection = (JSONObject) getAsJSON("wfs?request=GetFeature&version=1.0.0&typename=" + getLayerId(layer) | |
| + + "&outputformat=" + JSONType.json); | |
| + // print(collection); | |
| + assertThat(collection.getInt("totalFeatures"), is(3)); | |
| + //assertEquals("4327", collection.getJSONObject("crs").getJSONObject("properties").getString("code")); | |
| + JSONArray features = collection.getJSONArray("features"); | |
| + assertThat((Collection<?>)features, Matchers.hasSize(3)); | |
| + JSONObject feature = features.getJSONObject(0); | |
| + | |
| + JSONObject geometry = feature.getJSONObject("geometry"); | |
| + assertThat(geometry.getString("type"), is("Point")); | |
| + | |
| + JSONArray coords = geometry.getJSONArray("coordinates"); | |
| + assertThat((Iterable<?>)coords, contains((Object)120, 0)); | |
| + | |
| + JSONArray bbox = collection.getJSONArray("bbox"); | |
| + assertThat((Iterable<?>)bbox, Matchers.contains((Object)(-170), -30, 120, 45)); | |
| + | |
| + CoordinateReferenceSystem expectedCrs = CRS.decode("EPSG:4326"); | |
| + JSONObject aCRS = collection.getJSONObject("crs"); | |
| + assertThat(aCRS, encodesCRS(expectedCrs)); | |
| + } | |
| + | |
| + @Test | |
| + public void testGetFeatureAxisSwap() throws Exception { | |
| + // Check that a NORTH_EAST source is swapped | |
| + doAxisSwapTest(POINT_LATLON, CRS.AxisOrder.NORTH_EAST); | |
| + } | |
| + | |
| + @Test | |
| + public void testGetFeatureNoAxisSwap() throws Exception { | |
| + // Check that an EAST_NORTH source is not swapped | |
| + doAxisSwapTest(POINT_LONLAT, CRS.AxisOrder.EAST_NORTH); | |
| + } | |
| + | |
| + @Test | |
| + public void testGetFeatureCRS() throws Exception { | |
| + QName layer = SystemTestData.LINES; | |
| + JSONObject collection = (JSONObject) getAsJSON("wfs?request=GetFeature&version=1.0.0&typename=" + getLayerId(layer) | |
| + + "&outputformat=" + JSONType.json); | |
| + CoordinateReferenceSystem expectedCrs = getCatalog().getLayerByName(getLayerId(layer)).getResource().getCRS(); | |
| + JSONObject aCRS = collection.getJSONObject("crs"); | |
| + assertThat(aCRS, encodesCRS(expectedCrs)); | |
| + } | |
| + | |
| + private org.hamcrest.Matcher<JSONObject> encodesCRS(final CoordinateReferenceSystem crs) { | |
| + return new org.hamcrest.BaseMatcher<JSONObject>(){ | |
| + | |
| + @Override | |
| + public boolean matches(Object item) { | |
| + // Try to decode the CRS with both axis orders and check if either matches against | |
| + // the expected CRS. Sorry, this is a horrible hack. KS | |
| + CoordinateReferenceSystem decodedDefault = decodeCRS((JSONObject)item, false); | |
| + if(CRS.equalsIgnoreMetadata(crs, decodedDefault)) return true; | |
| + CoordinateReferenceSystem decodedXY = decodeCRS((JSONObject)item, true); | |
| + if(CRS.equalsIgnoreMetadata(crs, decodedXY)) return true; | |
| + String identifier = ((JSONObject)item).getJSONObject("properties").getString("name"); | |
| + Pattern p = Pattern.compile("^urn:ogc:def:crs:EPSG:[^:]*:(\\d+)$"); | |
| + Matcher m = p.matcher(identifier); | |
| + if(m.matches()){ | |
| + String code = "EPSG:"+m.group(1); | |
| + CoordinateReferenceSystem decodedStripped; | |
| + try { | |
| + decodedStripped = CRS.decode(code, true); | |
| + } catch (FactoryException e) { | |
| + throw new IllegalStateException(e); | |
| + } | |
| + if(CRS.equalsIgnoreMetadata(crs, decodedStripped)) return true; | |
| + } | |
| + | |
| + return false; | |
| + } | |
| + | |
| + @Override | |
| + public void describeTo(Description description) { | |
| + description.appendText("JSON representation of CRS "); | |
| + description.appendValue(crs); | |
| + } | |
| + | |
| + }; | |
| + } | |
| + | |
| + static private CoordinateReferenceSystem decodeCRS(JSONObject json, boolean forceXY) { | |
| + if(!json.getString("type").equals("name")) throw new IllegalArgumentException(); | |
| + String identifier = json.getJSONObject("properties").getString("name"); | |
| + try { | |
| + return CRS.decode(identifier, forceXY); | |
| + }catch (FactoryException e) { | |
| + throw new IllegalStateException(e); | |
| + } | |
| } | |
| } | |
| diff --git a/src/wfs/src/test/java/org/geoserver/wfs/json/PointLatLon.properties b/src/wfs/src/test/java/org/geoserver/wfs/json/PointLatLon.properties | |
| new file mode 100644 | |
| index 0000000..b1f79b3 | |
| --- /dev/null | |
| +++ b/src/wfs/src/test/java/org/geoserver/wfs/json/PointLatLon.properties | |
| @@ -0,0 +1,4 @@ | |
| +_=the_geom:Point:srid=4326,Name:String | |
| +PointLatLon.0=POINT(0 120)| foo | |
| +PointLatLon.1=POINT(45 -170)| bar | |
| +PointLatLon.2=POINT(-30 60)| baz | |
| \ No newline at end of file | |
| diff --git a/src/wfs/src/test/java/org/geoserver/wfs/json/PointLonLat.properties b/src/wfs/src/test/java/org/geoserver/wfs/json/PointLonLat.properties | |
| new file mode 100644 | |
| index 0000000..8ccde67 | |
| --- /dev/null | |
| +++ b/src/wfs/src/test/java/org/geoserver/wfs/json/PointLonLat.properties | |
| @@ -0,0 +1,4 @@ | |
| +_=the_geom:Point:srid=4326,Name:String | |
| +PointLatLon.0=POINT(120 0)| foo | |
| +PointLatLon.1=POINT(-170 45)| bar | |
| +PointLatLon.2=POINT(60 -30)| baz | |
| \ No newline at end of file | |
| diff --git a/src/wfs/src/test/java/org/geoserver/wfs/v2_0/GetFeatureJoinTest.java b/src/wfs/src/test/java/org/geoserver/wfs/v2_0/GetFeatureJoinTest.java | |
| index 012c125..3a20ad4 100644 | |
| --- a/src/wfs/src/test/java/org/geoserver/wfs/v2_0/GetFeatureJoinTest.java | |
| +++ b/src/wfs/src/test/java/org/geoserver/wfs/v2_0/GetFeatureJoinTest.java | |
| @@ -291,6 +291,39 @@ public class GetFeatureJoinTest extends WFS20TestSupport { | |
| } | |
| @Test | |
| + public void testStandardJoinThreeWays() throws Exception { | |
| + String xml = | |
| + "<wfs:GetFeature xmlns:wfs='" + WFS.NAMESPACE + "' xmlns:fes='" + FES.NAMESPACE + "'" + | |
| + " xmlns:gs='" + SystemTestData.DEFAULT_URI + "' version='2.0.0'>" + | |
| + "<wfs:Query typeNames='gs:Forests gs:Lakes gs:Lakes' aliases='a b c'>" + | |
| + "<fes:Filter> " + | |
| + "<And>" + | |
| + "<PropertyIsEqualTo>" + | |
| + "<ValueReference>a/FID</ValueReference>" + | |
| + "<ValueReference>b/FID</ValueReference>" + | |
| + "</PropertyIsEqualTo>" + | |
| + "<PropertyIsEqualTo>" + | |
| + "<ValueReference>b/FID</ValueReference>" + | |
| + "<ValueReference>c/FID</ValueReference>" + | |
| + "</PropertyIsEqualTo>" + | |
| + "</And>" + | |
| + "</fes:Filter> " + | |
| + "</wfs:Query>" + | |
| + "</wfs:GetFeature>"; | |
| + | |
| + Document dom = postAsDOM("wfs", xml); | |
| + // print(dom); | |
| + XMLAssert.assertXpathEvaluatesTo("1", "count(//wfs:Tuple)", dom); | |
| + | |
| + XMLAssert.assertXpathExists( | |
| + "//wfs:Tuple/wfs:member[1]/gs:Lakes/gs:NAME[text() = 'Black Lake']", dom); | |
| + XMLAssert.assertXpathExists( | |
| + "//wfs:Tuple/wfs:member[2]/gs:Forests/gs:NAME[text() = 'Foo Forest']", dom); | |
| + XMLAssert.assertXpathExists( | |
| + "//wfs:Tuple/wfs:member[3]/gs:Lakes/gs:NAME[text() = 'Black Lake']", dom); | |
| + } | |
| + | |
| + @Test | |
| public void testStandardJoin2() throws Exception { | |
| String xml = | |
| "<wfs:GetFeature xmlns:wfs='" + WFS.NAMESPACE + "' xmlns:fes='" + FES.NAMESPACE + "'" + | |
| diff --git a/src/wms/pom.xml b/src/wms/pom.xml | |
| index 5907f0d..f831009 100644 | |
| --- a/src/wms/pom.xml | |
| +++ b/src/wms/pom.xml | |
| @@ -12,7 +12,7 @@ | |
| <parent> | |
| <groupId>org.geoserver</groupId> | |
| <artifactId>geoserver</artifactId> | |
| - <version>2.6-beta</version> | |
| + <version>2.6-RC1</version> | |
| </parent> | |
| <groupId>org.geoserver</groupId> | |
| @@ -30,10 +30,6 @@ | |
| <artifactId>gs-wfs</artifactId> | |
| </dependency> | |
| <dependency> | |
| - <groupId>org.geoserver</groupId> | |
| - <artifactId>gs-wcs</artifactId> | |
| - </dependency> | |
| - <dependency> | |
| <groupId>org.geotools</groupId> | |
| <artifactId>gt-render</artifactId> | |
| </dependency> | |
| diff --git a/src/wms/src/main/java/org/geoserver/wms/featureinfo/FeatureInfoStylePreprocessor.java b/src/wms/src/main/java/org/geoserver/wms/featureinfo/FeatureInfoStylePreprocessor.java | |
| index 92459cb..a251d72 100644 | |
| --- a/src/wms/src/main/java/org/geoserver/wms/featureinfo/FeatureInfoStylePreprocessor.java | |
| +++ b/src/wms/src/main/java/org/geoserver/wms/featureinfo/FeatureInfoStylePreprocessor.java | |
| @@ -52,6 +52,8 @@ class FeatureInfoStylePreprocessor extends SymbolizerFilteringVisitor { | |
| private PropertyName defaultGeometryExpression; | |
| + private boolean addSolidLineSymbolier; | |
| + | |
| public FeatureInfoStylePreprocessor(FeatureType schema) { | |
| this.schema = schema; | |
| this.defaultGeometryExpression = ff.property(""); | |
| @@ -172,8 +174,15 @@ class FeatureInfoStylePreprocessor extends SymbolizerFilteringVisitor { | |
| public void visit(Rule rule) { | |
| geometriesOnLineSymbolizer.clear(); | |
| geometriesOnPolygonSymbolizer.clear(); | |
| + addSolidLineSymbolier = false; | |
| super.visit(rule); | |
| Rule copy = (Rule) pages.peek(); | |
| + if (addSolidLineSymbolier) { | |
| + // add also a black line to make sure we get something in output even | |
| + // if the user clicks in between symbols or dashes | |
| + LineSymbolizer ls = sb.createLineSymbolizer(Color.BLACK); | |
| + copy.symbolizers().add(ls); | |
| + } | |
| // check all the geometries that are on line, but not on polygon | |
| geometriesOnLineSymbolizer.removeAll(geometriesOnPolygonSymbolizer); | |
| for (Expression geom : geometriesOnLineSymbolizer) { | |
| @@ -217,9 +226,7 @@ class FeatureInfoStylePreprocessor extends SymbolizerFilteringVisitor { | |
| float[] dashArray = stroke.getDashArray(); | |
| Graphic graphicStroke = stroke.getGraphicStroke(); | |
| if (graphicStroke != null || dashArray != null && dashArray.length > 0) { | |
| - // add also a black line to make sure we get something in output even | |
| - // if the user clicks in between symbols or dashes | |
| - pages.push(sb.createLineSymbolizer(Color.BLACK)); | |
| + addSolidLineSymbolier = true; | |
| } | |
| } | |
| } | |
| diff --git a/src/wms/src/main/java/org/geoserver/wms/featureinfo/VectorRenderingLayerIdentifier.java b/src/wms/src/main/java/org/geoserver/wms/featureinfo/VectorRenderingLayerIdentifier.java | |
| index 58a9e1d..c8b2cce 100644 | |
| --- a/src/wms/src/main/java/org/geoserver/wms/featureinfo/VectorRenderingLayerIdentifier.java | |
| +++ b/src/wms/src/main/java/org/geoserver/wms/featureinfo/VectorRenderingLayerIdentifier.java | |
| @@ -4,6 +4,10 @@ | |
| */ | |
| package org.geoserver.wms.featureinfo; | |
| +import java.awt.AlphaComposite; | |
| +import java.awt.Color; | |
| +import java.awt.Composite; | |
| +import java.awt.Graphics2D; | |
| import java.awt.Rectangle; | |
| import java.awt.RenderingHints; | |
| import java.awt.RenderingHints.Key; | |
| @@ -19,6 +23,7 @@ import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.HashMap; | |
| import java.util.HashSet; | |
| +import java.util.LinkedHashSet; | |
| import java.util.List; | |
| import java.util.Map; | |
| import java.util.Set; | |
| @@ -45,6 +50,8 @@ import org.geotools.data.collection.ListFeatureCollection; | |
| import org.geotools.factory.CommonFactoryFinder; | |
| import org.geotools.factory.Hints; | |
| import org.geotools.feature.FeatureCollection; | |
| +import org.geotools.feature.simple.SimpleFeatureBuilder; | |
| +import org.geotools.feature.simple.SimpleFeatureTypeBuilder; | |
| import org.geotools.geometry.jts.JTS; | |
| import org.geotools.geometry.jts.ReferencedEnvelope; | |
| import org.geotools.map.FeatureLayer; | |
| @@ -167,16 +174,18 @@ public class VectorRenderingLayerIdentifier extends AbstractVectorLayerIdentifie | |
| Envelope targetModelSpace = JTS.transform(targetRasterSpace, new AffineTransform2D(screenToWorld)); | |
| // prepare the image we are going to check rendering against | |
| - int paintAreaSize = (int) radius * 2 + 1; | |
| - final BufferedImage image = ImageTypeSpecifier.createFromBufferedImageType(BufferedImage.TYPE_INT_ARGB).createBufferedImage(paintAreaSize, paintAreaSize); | |
| + int paintAreaSize = radius * 2 + 1; | |
| + final BufferedImage image = ImageTypeSpecifier.createFromBufferedImageType( | |
| + BufferedImage.TYPE_INT_ARGB).createBufferedImage(paintAreaSize, | |
| + paintAreaSize); | |
| image.setAccelerationPriority(0); | |
| // and now the listener that will check for painted pixels | |
| int mid = radius; | |
| int hitAreaSize = buffer * 2 + 1; | |
| Rectangle hitArea = new Rectangle(mid - buffer, mid - buffer, hitAreaSize, hitAreaSize); | |
| - final FeatureInfoRenderListener featureInfoListener = new FeatureInfoRenderListener(image, | |
| - hitArea, maxFeatures); | |
| + final FeatureInfoRenderListener featureInfoListener = new FeatureInfoRenderListener( | |
| + image, hitArea, maxFeatures, params.getPropertyNames()); | |
| // update the map context | |
| mc.getViewport().setBounds(new ReferencedEnvelope(targetModelSpace, getMap.getCrs())); | |
| @@ -186,11 +195,21 @@ public class VectorRenderingLayerIdentifier extends AbstractVectorLayerIdentifie | |
| // and now run the rendering _almost_ like a GetMap | |
| RenderedImageMapOutputFormat rim = new RenderedImageMapOutputFormat(wms) { | |
| + private Graphics2D graphics; | |
| + | |
| @Override | |
| protected RenderedImage prepareImage(int width, int height, IndexColorModel palette, | |
| boolean transparent) { | |
| return image; | |
| } | |
| + | |
| + @Override | |
| + protected Graphics2D getGraphics(boolean transparent, Color bgColor, | |
| + RenderedImage preparedImage, Map<Key, Object> hintsMap) { | |
| + graphics = super.getGraphics(transparent, bgColor, preparedImage, | |
| + hintsMap); | |
| + return graphics; | |
| + } | |
| @Override | |
| protected void onBeforeRender(StreamingRenderer renderer) { | |
| @@ -202,7 +221,7 @@ public class VectorRenderingLayerIdentifier extends AbstractVectorLayerIdentifie | |
| hints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); | |
| // TODO: should we disable the screenmap as well? | |
| - | |
| + featureInfoListener.setGraphics(graphics); | |
| featureInfoListener.setRenderer(renderer); | |
| renderer.addRenderListener(featureInfoListener); | |
| } | |
| @@ -329,7 +348,8 @@ public class VectorRenderingLayerIdentifier extends AbstractVectorLayerIdentifie | |
| : Integer.MAX_VALUE; | |
| definitionQuery.setMaxFeatures(maxFeatures); | |
| - FeatureLayer result = new FeatureLayer(new AllAttributesFeatureSource(featureSource), style); | |
| + FeatureLayer result = new FeatureLayer(new FeatureInfoFeatureSource(featureSource, | |
| + params.getPropertyNames()), style); | |
| result.setQuery(definitionQuery); | |
| return result; | |
| @@ -461,6 +481,10 @@ public class VectorRenderingLayerIdentifier extends AbstractVectorLayerIdentifie | |
| List<SimpleFeature> features = new ArrayList<SimpleFeature>(); | |
| + String[] propertyNames; | |
| + | |
| + SimpleFeatureBuilder retypeBuilder; | |
| + | |
| private int maxFeatures; | |
| ColorModel cm; | |
| @@ -471,7 +495,10 @@ public class VectorRenderingLayerIdentifier extends AbstractVectorLayerIdentifie | |
| Feature previous; | |
| - public FeatureInfoRenderListener(BufferedImage bi, Rectangle hitArea, int maxFeatures) { | |
| + Graphics2D graphics; | |
| + | |
| + public FeatureInfoRenderListener(BufferedImage bi, Rectangle hitArea, int maxFeatures, | |
| + String[] propertyNames) { | |
| verifyColorModel(bi); | |
| Raster raster = getRaster(bi); | |
| this.scanlineStride = raster.getDataBuffer().getSize() / raster.getHeight(); | |
| @@ -481,6 +508,10 @@ public class VectorRenderingLayerIdentifier extends AbstractVectorLayerIdentifie | |
| this.bi = bi; | |
| } | |
| + public void setGraphics(Graphics2D graphics) { | |
| + this.graphics = graphics; | |
| + } | |
| + | |
| public void setRenderer(StreamingRenderer renderer) { | |
| this.renderer = renderer; | |
| } | |
| @@ -520,6 +551,9 @@ public class VectorRenderingLayerIdentifier extends AbstractVectorLayerIdentifie | |
| // feature caught by more than one rule? | |
| if(feature == previous) { | |
| + // clean the hit area anyways before returning, as the feature might | |
| + // have been rendered twice in a row coloring the hit area twice | |
| + cleanHitArea(); | |
| return; | |
| } | |
| @@ -528,7 +562,7 @@ public class VectorRenderingLayerIdentifier extends AbstractVectorLayerIdentifie | |
| Raster raster = getRaster(bi); | |
| int[] pixels = ((java.awt.image.DataBufferInt) raster.getDataBuffer()).getData(); | |
| - // scan and clean the hit area | |
| + // scan and clean the hit area, bail out early if we find a hit | |
| boolean hit = false; | |
| for (int row = hitArea.y; row < (hitArea.y + hitArea.height) && !hit; row++) { | |
| int idx = row * scanlineStride + hitArea.x; | |
| @@ -538,7 +572,6 @@ public class VectorRenderingLayerIdentifier extends AbstractVectorLayerIdentifie | |
| if (!hit && alpha > 0) { | |
| hit = true; | |
| } | |
| - pixels[idx] = 0; | |
| idx++; | |
| } | |
| } | |
| @@ -546,12 +579,37 @@ public class VectorRenderingLayerIdentifier extends AbstractVectorLayerIdentifie | |
| if (hit) { | |
| previous = feature; | |
| if(features.size() < maxFeatures) { | |
| - features.add(feature); | |
| + SimpleFeature retyped = retype(feature); | |
| + features.add(retyped); | |
| } else { | |
| // we're done, stop rendering | |
| renderer.stopRendering(); | |
| } | |
| } | |
| + | |
| + // clean the hit area to prepare for next feature | |
| + cleanHitArea(); | |
| + } | |
| + | |
| + private SimpleFeature retype(SimpleFeature feature) { | |
| + if (propertyNames == null) { | |
| + return feature; | |
| + } else { | |
| + if (retypeBuilder == null) { | |
| + SimpleFeatureType targetType = SimpleFeatureTypeBuilder.retype( | |
| + feature.getFeatureType(), propertyNames); | |
| + retypeBuilder = new SimpleFeatureBuilder(targetType); | |
| + } | |
| + return SimpleFeatureBuilder.retype(feature, retypeBuilder); | |
| + } | |
| + } | |
| + | |
| + private void cleanHitArea() { | |
| + Composite oldComposite = graphics.getComposite(); | |
| + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC)); | |
| + graphics.setColor(new Color(0, true)); | |
| + graphics.fillRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); | |
| + graphics.setComposite(oldComposite); | |
| } | |
| @Override | |
| @@ -562,38 +620,64 @@ public class VectorRenderingLayerIdentifier extends AbstractVectorLayerIdentifie | |
| } | |
| /** | |
| - * A tiny wrapper that forces all attributes of a feature to be returned: we need this | |
| - * in order to collect full features, the renderer normally tries to get only the attributes | |
| - * it needs for performance reasons | |
| + * A tiny wrapper that forces the attributes needed by getfeatureinfo to be returned: the | |
| + * renderer normally tries to get only the attributes it needs for performance reasons | |
| * | |
| * @author Andrea Aime - GeoSolutions | |
| - * | |
| + * | |
| * @param <T> | |
| * @param <F> | |
| */ | |
| - static class AllAttributesFeatureSource extends DecoratingFeatureSource<FeatureType, Feature> { | |
| + static class FeatureInfoFeatureSource extends DecoratingFeatureSource<FeatureType, Feature> { | |
| - public AllAttributesFeatureSource(FeatureSource delegate) { | |
| + String[] propertyNames; | |
| + | |
| + public FeatureInfoFeatureSource(FeatureSource delegate, String[] propertyNames) { | |
| super(delegate); | |
| + this.propertyNames = propertyNames; | |
| } | |
| @Override | |
| public FeatureCollection getFeatures(Query query) throws IOException { | |
| Query q = new Query(query); | |
| - q.setProperties(Query.ALL_PROPERTIES); | |
| + // we made the renderer believe we support the screenmap, but we don't want | |
| + // it really be applied, so remove it | |
| + if(query.getHints() != null) { | |
| + Hints newHints = new Hints(query.getHints()); | |
| + newHints.remove(Hints.SCREENMAP); | |
| + q.setHints(newHints); | |
| + } | |
| + if (propertyNames == null || propertyNames.length == 0) { | |
| + // no property selection, we return them all | |
| + q.setProperties(Query.ALL_PROPERTIES); | |
| + } else { | |
| + // properties got selected, mix them with the ones needed by the renderer | |
| + if (query.getPropertyNames() == null || query.getPropertyNames().length == 0) { | |
| + q.setPropertyNames(propertyNames); | |
| + } else { | |
| + Set<String> names = new LinkedHashSet<>(Arrays.asList(propertyNames)); | |
| + names.addAll(Arrays.asList(q.getPropertyNames())); | |
| + String[] newNames = names.toArray(new String[names.size()]); | |
| + q.setPropertyNames(newNames); | |
| + } | |
| + } | |
| return super.getFeatures(q); | |
| } | |
| @Override | |
| public Set<Key> getSupportedHints() { | |
| + // force cloning, and make streaming renderer believe we do support | |
| + // the screenmap | |
| Set<Key> hints = delegate.getSupportedHints(); | |
| - if(hints == null || !hints.contains(Hints.FEATURE_DETACHED)) { | |
| - return hints; | |
| + Set<Key> result; | |
| + if(hints == null) { | |
| + result = new HashSet<RenderingHints.Key>(); | |
| } else { | |
| - Set<Key> result = new HashSet<RenderingHints.Key>(hints); | |
| - result.remove(Hints.FEATURE_DETACHED); | |
| - return result; | |
| + result = new HashSet<RenderingHints.Key>(hints); | |
| } | |
| + result.remove(Hints.FEATURE_DETACHED); | |
| + result.add(Hints.SCREENMAP); | |
| + return result; | |
| } | |
| } | |
| diff --git a/src/wms/src/main/java/org/geoserver/wms/map/RenderedImageMapOutputFormat.java b/src/wms/src/main/java/org/geoserver/wms/map/RenderedImageMapOutputFormat.java | |
| index 315f43c..f837ea8 100644 | |
| --- a/src/wms/src/main/java/org/geoserver/wms/map/RenderedImageMapOutputFormat.java | |
| +++ b/src/wms/src/main/java/org/geoserver/wms/map/RenderedImageMapOutputFormat.java | |
| @@ -350,8 +350,7 @@ public class RenderedImageMapOutputFormat extends AbstractMapOutputFormat { | |
| palette, useAlpha); | |
| final Map<RenderingHints.Key, Object> hintsMap = new HashMap<RenderingHints.Key, Object>(); | |
| - final Graphics2D graphic = ImageUtils.prepareTransparency(transparent, bgColor, | |
| - preparedImage, hintsMap); | |
| + final Graphics2D graphic = getGraphics(transparent, bgColor, preparedImage, hintsMap); | |
| // set up the antialias hints | |
| if (AA_NONE.equals(antialias)) { | |
| @@ -532,6 +531,12 @@ public class RenderedImageMapOutputFormat extends AbstractMapOutputFormat { | |
| return map; | |
| } | |
| + protected Graphics2D getGraphics(final boolean transparent, final Color bgColor, | |
| + final RenderedImage preparedImage, final Map<RenderingHints.Key, Object> hintsMap) { | |
| + return ImageUtils.prepareTransparency(transparent, bgColor, | |
| + preparedImage, hintsMap); | |
| + } | |
| + | |
| /** | |
| * Allows subclasses to customize the renderer before the paint method gets invoked | |
| * | |
| diff --git a/src/wms/src/test/java/org/geoserver/wms/featureinfo/GetFeatureInfoJSONTest.java b/src/wms/src/test/java/org/geoserver/wms/featureinfo/GetFeatureInfoJSONTest.java | |
| index d8f1458..01ca0b8 100644 | |
| --- a/src/wms/src/test/java/org/geoserver/wms/featureinfo/GetFeatureInfoJSONTest.java | |
| +++ b/src/wms/src/test/java/org/geoserver/wms/featureinfo/GetFeatureInfoJSONTest.java | |
| @@ -6,9 +6,7 @@ package org.geoserver.wms.featureinfo; | |
| -import static org.junit.Assert.assertEquals; | |
| -import static org.junit.Assert.assertNotNull; | |
| -import static org.junit.Assert.assertTrue; | |
| +import static org.junit.Assert.*; | |
| import net.sf.json.JSONArray; | |
| import net.sf.json.JSONObject; | |
| @@ -132,6 +130,36 @@ public class GetFeatureInfoJSONTest extends GetFeatureInfoTest { | |
| } | |
| @Test | |
| + public void testPropertySelection() throws Exception { | |
| + String layer = getLayerId(MockData.FORESTS); | |
| + String request = "wms?service=wms&version=1.1.1&bbox=-0.002,-0.002,0.002,0.002&styles=&format=jpeg" | |
| + + "&request=GetFeatureInfo&layers=" + layer + "&query_layers=" + layer | |
| + + "&width=20&height=20&x=10&y=10" + "&info_format=" + JSONType.json | |
| + + "&propertyName=NAME"; | |
| + | |
| + // JSON | |
| + MockHttpServletResponse response = getAsServletResponse(request); | |
| + | |
| + // MimeType | |
| + assertEquals(JSONType.json, response.getContentType()); | |
| + | |
| + // Content | |
| + String result = response.getOutputStreamContent(); | |
| + | |
| + assertNotNull(result); | |
| + | |
| + JSONObject rootObject = JSONObject.fromObject(result); | |
| + print(rootObject); | |
| + assertEquals(rootObject.get("type"), "FeatureCollection"); | |
| + JSONArray featureCol = rootObject.getJSONArray("features"); | |
| + JSONObject aFeature = featureCol.getJSONObject(0); | |
| + assertTrue(aFeature.getJSONObject("geometry").isNullObject()); | |
| + JSONObject properties = aFeature.getJSONObject("properties"); | |
| + assertTrue(properties.getJSONObject("FID").isNullObject()); | |
| + assertEquals("Green Forest", properties.get("NAME")); | |
| + } | |
| + | |
| + @Test | |
| public void testReprojectedLayer() throws Exception { | |
| String layer = getLayerId(MockData.MPOLYGONS); | |
| diff --git a/src/wms/src/test/java/org/geoserver/wms/featureinfo/RenderingBasedFeatureInfoTest.java b/src/wms/src/test/java/org/geoserver/wms/featureinfo/RenderingBasedFeatureInfoTest.java | |
| index eaf98b9..46ab96e 100644 | |
| --- a/src/wms/src/test/java/org/geoserver/wms/featureinfo/RenderingBasedFeatureInfoTest.java | |
| +++ b/src/wms/src/test/java/org/geoserver/wms/featureinfo/RenderingBasedFeatureInfoTest.java | |
| @@ -1,8 +1,11 @@ | |
| package org.geoserver.wms.featureinfo; | |
| -import static org.junit.Assert.assertEquals; | |
| +import static org.junit.Assert.*; | |
| import java.io.File; | |
| +import java.util.Collections; | |
| + | |
| +import javax.xml.namespace.QName; | |
| import net.sf.json.JSONObject; | |
| @@ -14,7 +17,11 @@ import org.junit.After; | |
| import org.junit.Test; | |
| public class RenderingBasedFeatureInfoTest extends WMSTestSupport { | |
| - | |
| + | |
| + public static QName GRID = new QName(MockData.CITE_URI, "grid", MockData.CITE_PREFIX); | |
| + public static QName REPEATED = new QName(MockData.CITE_URI, "repeated", MockData.CITE_PREFIX); | |
| + | |
| + | |
| @Override | |
| protected String getLogConfiguration() { | |
| return "/DEFAULT_LOGGING.properties"; | |
| @@ -29,12 +36,19 @@ public class RenderingBasedFeatureInfoTest extends WMSTestSupport { | |
| File symbol = new File("./src/test/resources/org/geoserver/wms/featureinfo/box-offset.png"); | |
| FileUtils.copyFileToDirectory(symbol, styles); | |
| + testData.addVectorLayer(GRID, Collections.EMPTY_MAP, "grid.properties", | |
| + RenderingBasedFeatureInfoTest.class, getCatalog()); | |
| + testData.addVectorLayer(REPEATED, Collections.EMPTY_MAP, "repeated_lines.properties", | |
| + RenderingBasedFeatureInfoTest.class, getCatalog()); | |
| + | |
| testData.addStyle("ranged", "ranged.sld",this.getClass(), getCatalog()); | |
| testData.addStyle("dynamic", "dynamic.sld",this.getClass(), getCatalog()); | |
| testData.addStyle("symbol-uom", "symbol-uom.sld", this.getClass(), getCatalog()); | |
| testData.addStyle("two-rules", "two-rules.sld", this.getClass(), getCatalog()); | |
| testData.addStyle("two-fts", "two-fts.sld", this.getClass(), getCatalog()); | |
| testData.addStyle("dashed", "dashed.sld",this.getClass(), getCatalog()); | |
| + testData.addStyle("polydash", "polydash.sld", this.getClass(), getCatalog()); | |
| + testData.addStyle("doublepoly", "doublepoly.sld", this.getClass(), getCatalog()); | |
| } | |
| @After | |
| @@ -148,6 +162,20 @@ public class RenderingBasedFeatureInfoTest extends WMSTestSupport { | |
| } | |
| @Test | |
| + public void testFillStrokeDashArray() throws Exception { | |
| + String layer = getLayerId(MockData.FORESTS); | |
| + String request = "wms?version=1.1.1&bbox=-0.002,-0.002,0.002,0.002&format=jpeg" | |
| + + "&request=GetFeatureInfo&layers=" + layer + "&query_layers=" + layer | |
| + + "&styles=polydash" + "&width=20&height=20&x=10&y=10&info_format=application/json"; | |
| + | |
| + System.out.println("The response iTESTs: " + getAsString(request)); | |
| + JSONObject result = (JSONObject) getAsJSON(request); | |
| + // we used to get two results when two rules matched the same feature | |
| + // print(result); | |
| + assertEquals(1, result.getJSONArray("features").size()); | |
| + } | |
| + | |
| + @Test | |
| public void testGenericGeometry() throws Exception { | |
| String layer = getLayerId(MockData.GENERICENTITY); | |
| String request = "wms?REQUEST=GetFeatureInfo&BBOX=-2.73291%2C55.220703%2C8.510254%2C69.720703&SERVICE=WMS" | |
| @@ -169,4 +197,34 @@ public class RenderingBasedFeatureInfoTest extends WMSTestSupport { | |
| assertEquals(1, result.getJSONArray("features").size()); | |
| } | |
| + @Test | |
| + public void testDoublePoly() throws Exception { | |
| + String layer = getLayerId(GRID); | |
| + String request = "wms?REQUEST=GetFeatureInfo&&BBOX=0,0,3,3&SERVICE=WMS" | |
| + + "&INFO_FORMAT=application/json&FEATURE_COUNT=50&QUERY_LAYERS=" | |
| + + layer | |
| + + "&Layers=" | |
| + + layer | |
| + + "&WIDTH=90&HEIGHT=90&format=image%2Fpng&styles=doublepoly&srs=EPSG%3A4326&version=1.1.1&x=34&y=34"; | |
| + JSONObject result = (JSONObject) getAsJSON(request); | |
| + // we used to get two results | |
| + assertEquals(1, result.getJSONArray("features").size()); | |
| + } | |
| + | |
| + @Test | |
| + public void testRepeatedLine() throws Exception { | |
| + String layer = getLayerId(REPEATED); | |
| + String request = "wms?REQUEST=GetFeatureInfo&&BBOX=499900,499900,500100,500100&SERVICE=WMS" | |
| + + "&INFO_FORMAT=application/json&FEATURE_COUNT=50&QUERY_LAYERS=" | |
| + + layer | |
| + + "&Layers=" | |
| + + layer | |
| + + "&WIDTH=11&HEIGHT=11&format=image%2Fpng&styles=line&srs=EPSG%3A32615&version=1.1.1&x=5&y=5"; | |
| + JSONObject result = (JSONObject) getAsJSON(request); | |
| + print(result); | |
| + // we used to get two results | |
| + assertEquals(2, result.getJSONArray("features").size()); | |
| + } | |
| + | |
| + | |
| } | |
| diff --git a/src/wms/src/test/resources/org/geoserver/wms/featureinfo/doublepoly.sld b/src/wms/src/test/resources/org/geoserver/wms/featureinfo/doublepoly.sld | |
| new file mode 100644 | |
| index 0000000..3be0a17 | |
| --- /dev/null | |
| +++ b/src/wms/src/test/resources/org/geoserver/wms/featureinfo/doublepoly.sld | |
| @@ -0,0 +1,29 @@ | |
| +<?xml version="1.0" encoding="ISO-8859-1"?> | |
| +<StyledLayerDescriptor version="1.0.0" | |
| + xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" | |
| + xmlns="http://www.opengis.net/sld" | |
| + xmlns:ogc="http://www.opengis.net/ogc" | |
| + xmlns:xlink="http://www.w3.org/1999/xlink" | |
| + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
| + <NamedLayer> | |
| + <Name>doublepoly</Name> | |
| + <UserStyle> | |
| + <FeatureTypeStyle> | |
| + <Rule> | |
| + <Name>r1</Name> | |
| + <PolygonSymbolizer> | |
| + <Fill/> | |
| + <Stroke/> | |
| + </PolygonSymbolizer> | |
| + </Rule> | |
| + <Rule> | |
| + <Name>r2</Name> | |
| + <PolygonSymbolizer> | |
| + <Fill/> | |
| + <Stroke/> | |
| + </PolygonSymbolizer> | |
| + </Rule> | |
| + </FeatureTypeStyle> | |
| + </UserStyle> | |
| + </NamedLayer> | |
| +</StyledLayerDescriptor> | |
| \ No newline at end of file | |
| diff --git a/src/wms/src/test/resources/org/geoserver/wms/featureinfo/grid.properties b/src/wms/src/test/resources/org/geoserver/wms/featureinfo/grid.properties | |
| new file mode 100644 | |
| index 0000000..49a0be5 | |
| --- /dev/null | |
| +++ b/src/wms/src/test/resources/org/geoserver/wms/featureinfo/grid.properties | |
| @@ -0,0 +1,10 @@ | |
| +_=geom:Polygon:srid=4326,id:int | |
| +grid.0=POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))|0 | |
| +grid.1=POLYGON((1 0, 1 1, 2 1, 2 0, 1 0))|1 | |
| +grid.2=POLYGON((2 0, 2 1, 3 1, 3 0, 2 0))|2 | |
| +grid.3=POLYGON((0 1, 0 2, 1 2, 1 1, 0 1))|3 | |
| +grid.4=POLYGON((1 1, 1 2, 2 2, 2 1, 1 1))|4 | |
| +grid.5=POLYGON((2 1, 2 2, 3 2, 3 1, 2 1))|5 | |
| +grid.6=POLYGON((0 2, 0 3, 1 3, 1 2, 0 2))|6 | |
| +grid.7=POLYGON((1 2, 1 3, 2 3, 2 2, 1 2))|7 | |
| +grid.2=POLYGON((2 2, 2 3, 3 3, 3 2, 2 2))|8 | |
| diff --git a/src/wms/src/test/resources/org/geoserver/wms/featureinfo/polydash.sld b/src/wms/src/test/resources/org/geoserver/wms/featureinfo/polydash.sld | |
| new file mode 100644 | |
| index 0000000..4f12ca9 | |
| --- /dev/null | |
| +++ b/src/wms/src/test/resources/org/geoserver/wms/featureinfo/polydash.sld | |
| @@ -0,0 +1,31 @@ | |
| +<?xml version="1.0" encoding="ISO-8859-1"?> | |
| +<StyledLayerDescriptor version="1.0.0" | |
| + xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" | |
| + xmlns="http://www.opengis.net/sld" | |
| + xmlns:ogc="http://www.opengis.net/ogc" | |
| + xmlns:xlink="http://www.w3.org/1999/xlink" | |
| + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
| + <!-- a Named Layer is the basic building block of an SLD document --> | |
| + <NamedLayer> | |
| + <Name>default_line</Name> | |
| + <UserStyle> | |
| + <!-- Styles can have names, titles and abstracts --> | |
| + <Title>Default Line</Title> | |
| + <Abstract>A sample style that draws a line</Abstract> | |
| + <!-- FeatureTypeStyles describe how to render different features --> | |
| + <!-- A FeatureTypeStyle for rendering lines --> | |
| + <FeatureTypeStyle> | |
| + <Rule> | |
| + <Name>rule1</Name> | |
| + <PolygonSymbolizer> | |
| + <Fill/> | |
| + <Stroke> | |
| + <CssParameter name="stroke">#0000FF</CssParameter> | |
| + <CssParameter name="stroke-dasharray">20 20</CssParameter> | |
| + </Stroke> | |
| + </PolygonSymbolizer> | |
| + </Rule> | |
| + </FeatureTypeStyle> | |
| + </UserStyle> | |
| + </NamedLayer> | |
| +</StyledLayerDescriptor> | |
| \ No newline at end of file | |
| diff --git a/src/wms/src/test/resources/org/geoserver/wms/featureinfo/repeated_lines.properties b/src/wms/src/test/resources/org/geoserver/wms/featureinfo/repeated_lines.properties | |
| new file mode 100644 | |
| index 0000000..b7b3838 | |
| --- /dev/null | |
| +++ b/src/wms/src/test/resources/org/geoserver/wms/featureinfo/repeated_lines.properties | |
| @@ -0,0 +1,3 @@ | |
| +_=id:String,geom:LineString:srid=32615 | |
| +Lines.0=l1|LINESTRING(500000 500000, 500001 500001) | |
| +Lines.1=l2|LINESTRING(500000 500000, 500001 500001) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment