qgis / qwc2-demo-app

QWC2 demo application
Other
243 stars 155 forks source link

GET Request not reading themesConfig.json #526

Closed shapley closed 8 months ago

shapley commented 9 months ago

Hi,

I'm trying to access a 'manual' 'themesConfig.json" stored in ' /volumes/config-in/default/' but the 'GET' request defaults to the "GET /ows/qwc_demo?' I want it to see my project instead. What is perhaps going wrong?

The 'themesConfig.json' is currently located in "/volumes/config-in/default/themesConfig.json"... I appreciate this should have been posted here "https://lists.osgeo.org/mailman/listinfo/qgis-qwc2" but I got no response last time forcing me back here.

GET-Request

My appologies for posting this config issue here...

Mrpolit commented 8 months ago

Hi, i'm not shore that i fully understand what your question is but if you want to give your ''themesConfig.json'' file to your qwc2 project for it to automatically creat themes.json file and other files you can go in ''qwc2/scripts/themesConfig.js'' line 23 and give it your ''themesConfig.json'' file location

shapley commented 8 months ago

Hi Mrpolit,

Thanks for your reply. I'm ultimately trying to get the 'qwc-docker' install to point to my 'themesConfig.json' file but don't know why it's 'GET /ows/qwc_demo? instead of 'GET /ows/myproject?SERVICE=WMS etc. I thought this was set in '/volumes/config-in/default/themesConfig.json' but I must be missing other configs elsewhere but don't know where to start. This is a different config to the html version.

shapley commented 8 months ago

Hi Mrpolit,

Perhaps I'm not understanding/or missing this config from [https://github.com/qwc-services/qwc-docker]?

What does this mean below?

Run local services (set $QGIS_SERVER_URL to your QGIS server and $QWC2_PATH to your QWC2 files):

cd qwc-config-service/ QGIS_SERVER_URL=http://localhost:8001/ows/ QWC2_PATH=qwc2/ python server.py

cd qwc-ogc-service/ QGIS_SERVER_URL=http://localhost:8001/ows/ CONFIG_SERVICE_URL=http://localhost:5010/ python server.py

cd qwc-data-service/ CONFIG_SERVICE_URL=http://localhost:5010/ python server.py

cd qwc-map-viewer/ OGC_SERVICE_URL=http://localhost:5013/ CONFIG_SERVICE_URL=http://localhost:5010/ QWC2_PATH=qwc2/ python server.py

cd qwc-admin-gui/ python server.py

manisandro commented 8 months ago

@shapley If you use the qwc-docker demo setup, the setup is pre-configured, and you don't need to change anything. Just follow the steps in the quickstart [1]. You should only change the service URLs etc if you have some understanding how the application is structured. But it is definitely not needed to configure a theme.

[1] https://qwc-services.github.io/2024-lts/QuickStart/

shapley commented 8 months ago

Hi Manisandro,

Thanks...when you say "You should only change the service URLs" Where are those URL's changed? That's possibly where I'm missing somewhere here. It would be good to know where because I've followed your QuickStart link a couple of times but only end up with the demo project not my own.

manisandro commented 8 months ago

The important notion is that you place your project below volumes/qgs-projects/path/to/project.qgs and write the theme configuration entry in themesConfig.json with "url": "/ows/path/to/project" (without .qgs at the end). So say your project is located atvolumes/qgs-projects/subfolder/myproject.qgs, you'd have"url": "/ows/subfolder/myproject".

You shouldn't be touching any of the service URLs to get your project configured.

shapley commented 8 months ago

So...I've changed the 'themesConfig.json' format to resemble the 'qwc_demo' style. Yet again it pulls the 'qwc_demo' instead.

gateway

themesConfig.json

Only thing left is maybe I need to change 'tenantConfig.json' I just need to know why the 'qwc_demo' is being called instead of 'mainQGISTemplate'

manisandro commented 8 months ago

Are you actually running the config generator after changing the themesConfig.json/tenantConfig.json?

shapley commented 8 months ago

Hi Manisandro,

I'm not using the config generator. I have a custom themesConfig.json file which I can add themes to. I haven't changed tenantConfig to reflect any changes to themesConfig.

manisandro commented 8 months ago

If you use qwc-docker, you definitely should be using the config-generator. If you use a standalone qwc2 build, you need to use yarn run themesconfig to generate the themes.json. themesConfig.json is not read directly by the viewer.

shapley commented 8 months ago

OK... I think it's possibly related to the failure of the 'qwc_admin' page loading (which I've ignored but is relevant to this issue). As I understand it this is how the themesConfig is set up in qwc-docker.

Will close call and may raise another relating to 'qwc_admin' page later if necessary.