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
mapfishapp - datadir #1038
mapfishapp - datadir #1038
Conversation
e89b0fa
to
c526173
Compare
Regression detected without the georchestra.datadir option: Images for the addons are broken. |
Ok fixed ; everything seems to go well now (without the |
- Exports the contexts, addons, JS configuration (including GEOR_custom.js) into the datadir - Makes the rest of the webapp configurable outside of the webapp WAR (using the same mechanisms as previously) - Allows mapfishapp to be easily customized by server-side addons (it allows automatic scanning of jars which classes begin with org.georchestra.mapfishapp.addons) As the other PR, it requires the introduction of the georchestra-module.
Fixing path to the addons in the webapp when no georchestra.datadir is provided.
40b6213
to
cc26a6c
Compare
(FYI I pushed --force after rebasing / integration of the georchestra-commons module) |
<packageDescription>Debian package for the geOrchestra's Viewer</packageDescription> | ||
<projectOrganization>geOrchestra</projectOrganization> | ||
<maintainerName>Pierre Mauduit</maintainerName> | ||
<maintainerEmail>pierre.mauduit@gmail.com</maintainerEmail> |
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.
maintainer = PSC / psc@georchestra.org
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.
As said, I fear that I had to regenerate a GPG key so that I can publish the signed packages on build.georchestra.org ; it will deserve a try in my georchestra-datadir branch, and see if the CI is not broken by the change.
Anyway, I've no objection for such a change
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.
Sync GEOR_custom.js with the one provided by the template configuration.
I will do extra tests by merging back the branch into my own one. |
Runtime tests: Ok (basic tests, mainly on the addons management, with and without |
I'm testing this, with georchestra.datadir set and some customizations done in /etc/georchestra/mapfishapp/js/GEOR_custom.js and mapfishapp/w?s.servers.json, but it seems the values returned by the w?s.servers.json webservice come from the json files in the webapp, and GEOR_custom.js is fetched from the webapp dir too. Interestingly, i see no addon at all listed in 'tools' window, even if some are listed in the default GEOR_custom.js found/used within the webapp. Guess i'll need to dig a bit more.... the mapfishapp/log4j/log4j.properties and mapfishapp/mapfishapp.properties files are properly read/applied from the datadir. /mapfishapp/addons/ and /mapfishapp/contexts/ yield 404's.. maybe relevant info from mapfishapp.log :
|
Hm, i was mistaken, at mapfishapp loading /ws/app/js/GEOR_custom.js is called and it effectively returns the content of the file found in the datadir. |
/ws/addons/ returns
java.lang.NullPointerException at org.georchestra.mapfishapp.ws.AddonController.buildAddonSpecs(AddonController.java:188) /ws/contexts/ returns the default geobretagne context, which seems expected, although it isnt loaded at initial mapfishapp display. It seems nothing calls /ws/contexts/ nor /ws/addons/ at startup.... |
As for the w?s servers, by default mapfishapp/wms.servers.json is loaded/queried (which returns the default list from the webapp) while i think it should be mapfishapp/ws/wms.servers.json (which contains my custom list..) |
TODO:
|
For the w?s server list, i think GEOR_LayerBrowser.js just lacks /ws/ being prepended to GEOR.config.OGC_SERVERS_URL[this.id] in line 59, otherwise the list comes from the webapp. Tested this, works..
|
Maybe only local to my setup, but there are some encoding issues in various places:
|
More details on the encodings:
|
Have you set the URIencoding option onto your tomcat connectors ?
|
I had URIEncoding="UTF-8" set on all the tomcat connectors, but the issue was somewhere else. Setting LANG=C.UTF-8 (or any of the other UTF-8 locales available, check locale -a output) in /etc/default/tomcat-* worked around the issue. Guess that's what i get for not having it set in /etc/default/locale...... |
Small buglet in addons handling.. added openls,magnifier,cadastrapp,streetview & annotation in /etc/georchestra/mapfishapp/addons, loaded /ws/addons -> extractorapp was in the list (and enabled) although not present in the datadir - i think this was caused by cadastrapp not having a config.json file (oversight from me) - i had the error message, but somehow some addon was randomly taken from the webapp..
|
okay, after more explanation from @pmauduit it makes sense to have extractor in the list of app since it's in the webapp, and enabled by default. To disable it, one just needs to make a copy of it in the datadir, and set enable to false in its config.json. |
And with the current logic in https://github.com/georchestra/georchestra/blob/mapfishapp-datadir/mapfishapp/src/main/java/org/georchestra/mapfishapp/ws/AddonController.java#L200 (and also the two loops over addons arrays in constructAddonsSpec()) it doesnt seem possible to 'disable' an addon that is enabled in the webapp. If i copy extractor to my datadir and change enabled to false in config.json, it will still be listed in the available & enabled addons. |
Do not check too early if the addon is activated or not, check it at the very end of the process. This allows to deactivate addons provided by default in mapfishapp, simply by copying it into the datadir and explicitely setting it as disabled in the config.json spec.
- Hardenning tests when trying to find files on the FS - Aslo allows to set images from different formats (JPEG) for context capions. Tests: utests added for NPE avoidance runtime tests for the context captions
Now using the controller systematically, irregardless if georchestra.datadir is configured or not. Getting the relevant file in both cases (like it is done for other controllers).
Done today:
|
Retested tip of the PR, all the previous issues i had are now fixed, i've been able to disable extractor addon and the wxs server lists are fetched from the datadir. Thanks! |
Good, please merge. |
This PR proposes the datadirization of the mapfishapp webapp:
As the other PR, it requires the introduction of the georchestra-commons module. Travis-ci will fail until #1035 is merged.
Note for the reviewers: A lot of files are related to default addons inclusion, the majority of files added to src/deb/resources/etc are not necessary to be reviewed IMHO.
TODO:
georchestra.datadir
georchestra.datadir