Skip to content

Commit

Permalink
Add graticule extension
Browse files Browse the repository at this point in the history
  • Loading branch information
vuilleumierc committed Jun 5, 2024
1 parent 627135f commit 8ff150d
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Only a curated list of the [vast amount](http://geoserver.org/release/stable/) o
- cog
- importer
- imagepyramid
- graticules

Advanced ACL system is available through the project [GeoServer ACL](https://github.com/geoserver/geoserver-acl) which offers the same capacities as GeoFence.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
*/
package org.geoserver.cloud.autoconfigure.web.extension;

import org.geoserver.cloud.autoconfigure.web.extension.graticule.GraticuleAutoConfiguration;
import org.geoserver.cloud.autoconfigure.web.extension.importer.ImporterAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@Import({
ImporterAutoConfiguration.class //
ImporterAutoConfiguration.class, //
GraticuleAutoConfiguration.class
})
public class ExtensionsAutoConfiguration {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* (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.web.extension.graticule;

import org.geoserver.cloud.config.factory.FilteringXmlBeanDefinitionReader;
import org.geotools.data.graticule.GraticuleDataStoreFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

/** Auto configuration to enable the graticule customized store panel. */
@Configuration
@ConditionalOnClass(GraticuleDataStoreFactory.class)
@ImportResource( //
reader = FilteringXmlBeanDefinitionReader.class, //
locations = {"jar:gs-graticule-.*!/applicationContext.xml"})
public class GraticuleAutoConfiguration {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* (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.web.extension.graticule;

import static org.assertj.core.api.Assertions.assertThat;

import org.geoserver.web.data.resource.DataStorePanelInfo;
import org.geoserver.web.data.store.graticule.GraticuleStoreEditPanel;
import org.geotools.data.graticule.GraticuleDataStoreFactory;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;

/**
* Test suite for {@link GraticuleAutoConfiguration}
*
* @since 1.8
*/
class GraticuleAutoConfigurationTest {

private final ApplicationContextRunner contextRunner =
new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(GraticuleAutoConfiguration.class));

@Test
void test_enabled() {

contextRunner.run(
context -> {
assertThat(context)
.hasBean("graticuleStorePanel")
.getBean("graticuleStorePanel")
.isInstanceOf(DataStorePanelInfo.class);

assertThat(context.getBean("graticuleStorePanel", DataStorePanelInfo.class))
.hasFieldOrPropertyWithValue(
"factoryClass", GraticuleDataStoreFactory.class);

assertThat(context.getBean("graticuleStorePanel", DataStorePanelInfo.class))
.hasFieldOrPropertyWithValue(
"componentClass", GraticuleStoreEditPanel.class);
});
}
}
15 changes: 15 additions & 0 deletions src/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,21 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.geoserver.community</groupId>
<artifactId>gs-graticule</artifactId>
<version>${gs.community.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.geoserver.web</groupId>
<artifactId>gs-web-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<!--- Override old aws version without support for "IAM roles for service accounts" -->
<groupId>software.amazon.awssdk</groupId>
Expand Down
4 changes: 4 additions & 0 deletions src/starters/vector-formats/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,9 @@
<groupId>org.geoserver.extension</groupId>
<artifactId>gs-feature-pregeneralized</artifactId>
</dependency>
<dependency>
<groupId>org.geoserver.community</groupId>
<artifactId>gs-graticule</artifactId>
</dependency>
</dependencies>
</project>

0 comments on commit 8ff150d

Please sign in to comment.