-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Graticule extension #456
Add Graticule extension #456
Conversation
afd23cb
to
40eb261
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking really good so far. We would need to:
- Address the requested chages
- Add at least a test for
GraticuleConfiguration
, you can inspire inVectorTilesConfigurationTest
for example. - With
datadir
catalog backend: when creating a graticule store/layer in the webui, the wms layer preview fails withorg.geoserver.platform.ServiceException: Could not find layer cite:Graticule_1_10
. Works when the wms service is restarted. I'll look into it in case it's a problem with the event bus payload. - With the
pgconfig
catalog backend it doesn't work. TheGratitculeDataStoreFactory
has a parameter of typeReferencedEnvelope
that's encoded as JSON asbounds": {"crs": {"srs": "EPSG:4326", "wkt": null}, "coordinates": [-180.0, 180.0, -90.0, 90.0]}
, but then it can't be decoded. I'll look into it.
...s/src/main/java/org/geoserver/cloud/autoconfigure/wms/extensions/GraticuleConfiguration.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @vuilleumierc,
I just realized this is one of those cases where the geoserver plugin contains both the plugin's business classes as well as some wicket configuration extension.
The result is we have now the wms-extensions
module adding transitive dependencies on gs-web-core
and wicket-core
:
[INFO] | +- org.geoserver.community:gs-graticule:jar:2.25.0.1-CLOUD:compile
[INFO] | | +- org.apache.wicket:wicket-core:jar:7.18.0:compile
[INFO] | | | +- org.apache.wicket:wicket-request:jar:7.18.0:compile
[INFO] | | | \- org.apache.wicket:wicket-util:jar:7.18.0:compile
[INFO] | | \- org.geoserver.web:gs-web-core:jar:2.25.0.1-CLOUD:compile
[INFO] | | +- org.apache.wicket:wicket-extensions:jar:7.18.0:compile
[INFO] | | +- org.wicketstuff:wicketstuff-select2:jar:7.18.0:compile
[INFO] | | | \- de.agilecoders.wicket.webjars:wicket-webjars:jar:0.5.3:compile
[INFO] | | +- com.github.svenmeier.wicket-dnd:wicket-dnd:jar:0.7.3:compile
[INFO] | | \- joda-time:joda-time:jar:2.10.13:compile
The problem is, though that's expected for the webui
, it's not for wms
, rest
, and gwc
. I.e. we don't want the additional transitive dependencies for the wicket ui in other services than the webui service itself.
The trick to do so is:
- To add exclusions for
org.apache.wicket:wicket-core
andorg.geoserver.web:gs-web-core
in thegs-graticule
dependency declaration - To split the autoconfiguration in two
@Configuration
classes, one for the regular stuff and one for the webui components. In this particular case there's no much to say about the "regular stuff", since the only spring bean ings-graticule.jar!/applicationContext.xml
is thegraticuleStorePanel
. In any case, there "webui" configuration class should be made conditional in such way that it only engages if the wicket ui is "present" (more on this later). - Finally, I also just realized the
wms-extensions
module is not the proper place for this. What the graticules module really does is to add an additional vector datasource, that happens to create the features on the fly, but still, any layer set up with it can also be used through the WFS for example. So, it belongs to thegs-cloud-starter-vector-formats
module.
To summarize:
- In
src/pom.xml
we declare the dependency with the exclusions mentioned above - In
gs-cloud-starter-vector-formats
we add the dependency. No@Configuration
class is needed here for theGraticuleDataStoreFactory
itself because it only adds aDataStoreFactory
that's discovered through SPI, not through spring beans. - Now for the webui configuration, we will have to add an
@AutoConfiguration
that's, for example,@ConditionalOnClass(org.geoserver.web.GeoServerApplication.class)
. To do that, ings-cloud-starter-vector-formats
'spom.xml
you'll have to add theorg.geoserver.web:gs-web-core
dependency with<optional>true</optional>
. Meaning it's optional and won't be transitively propagated. So, in the webui service, the class will be present and the conditional satisfied, hence the wicket panel contributed to the app context. But in the other services that also depend on
gs-cloud-starter-vector-formats
, the conditional won't match.
Hope that makes sense.
One last thing, I see you've added three commits with messages that don't add new information to the purpose of the pr. In those cases it's better squash them into a single one with a single commit message that makes sense.
Oh and the new test class has the wrong class header:
/*
* Author : Adnovum Informatik AG
*/
Hi @groldan, thanks a lot for the detailed break down. |
103dde8
to
e3140a7
Compare
Working on a new branch |
No description provided.