-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4dac461
commit afd23cb
Showing
6 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
60 changes: 60 additions & 0 deletions
60
...rc/main/java/org/geoserver/cloud/autoconfigure/wms/extensions/GraticuleConfiguration.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the | ||
* GPL 2.0 license, available at the root application directory. | ||
*/ | ||
|
||
package org.geoserver.cloud.autoconfigure.wms.extensions; | ||
|
||
import org.geoserver.cloud.config.factory.FilteringXmlBeanDefinitionReader; | ||
import org.geoserver.platform.ModuleStatus; | ||
import org.geoserver.platform.ModuleStatusImpl; | ||
import org.geotools.data.graticule.GraticuleDataStoreFactory; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.ImportResource; | ||
|
||
@Configuration | ||
public class GraticuleConfiguration { | ||
|
||
@Bean | ||
@ConditionalOnProperty( | ||
prefix = "geoserver.wms.graticule", | ||
name = "enabled", | ||
havingValue = "true", | ||
matchIfMissing = true) | ||
public GraticuleDataStoreFactory graticuleDataStoreFactory() { | ||
return new GraticuleDataStoreFactory(); | ||
} | ||
|
||
@Configuration | ||
@ConditionalOnProperty( | ||
prefix = "geoserver.wms.graticule", | ||
name = "enabled", | ||
matchIfMissing = true) | ||
@ImportResource( // | ||
reader = FilteringXmlBeanDefinitionReader.class, // | ||
locations = {"jar:gs-graticule-.*!/applicationContext.xml"}) | ||
static class Enabled {} | ||
|
||
@Configuration | ||
@ConditionalOnProperty( | ||
prefix = "geoserver.wms.graticule", | ||
name = "enabled", | ||
havingValue = "false") | ||
static class Disabled { | ||
|
||
@Bean | ||
ModuleStatus graticuleDisabledModuleStatus() { | ||
ModuleStatusImpl mod = new ModuleStatusImpl(); | ||
mod.setAvailable(true); | ||
mod.setEnabled(false); | ||
mod.setMessage( | ||
"Graticule module disabled through config property geoserver.wms.graticule.enabled=false"); | ||
mod.setComponent("GeoServer Graticule"); | ||
mod.setModule("gs-graticule"); | ||
mod.setName("Graticule"); | ||
return mod; | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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