Skip to content

Comments

[Server] Add server properties on layer tree group#61195

Merged
troopa81 merged 5 commits intoqgis:masterfrom
troopa81:feat_groupwmsdata
Apr 7, 2025
Merged

[Server] Add server properties on layer tree group#61195
troopa81 merged 5 commits intoqgis:masterfrom
troopa81:feat_groupwmsdata

Conversation

@troopa81
Copy link
Contributor

Allow user to edit server properties on layer tree group and return them on GetCapabilities request. So far, only short name, title and abstract were available. There are now:

  • keywords,
  • data URL (with format)
  • Attribution title and URL
  • Metadata URLs
  • Legend URL (and format), with a default generated one in case there is none defined

Widget

groupwmsdata

GetCapabilities response

<Name>MyShortName</Name>
<Title>This is the title</Title>
<Abstract>
  This is a more descriptive text aboout the WMS data.
</Abstract>
<KeywordList>
  <Keyword>keyword1</Keyword>
  <Keyword>keyword2</Keyword>
</KeywordList>
<CRS>CRS:84</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:3943</CRS>
<CRS>EPSG:3857</CRS>
<EX_GeographicBoundingBox>
  <westBoundLongitude>-180</westBoundLongitude>
  <eastBoundLongitude>180</eastBoundLongitude>
  <southBoundLatitude>-85.051129</southBoundLatitude>
  <northBoundLatitude>85.051129</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox CRS="EPSG:3857" minx="-20037508.343" miny="-20037508.343" maxx="20037508.343" maxy="20037508.343"/>
<BoundingBox CRS="EPSG:3943" minx="-100494907.822" miny="-93107605.747" maxx="103803487.301" maxy="61264912.326"/>
<BoundingBox CRS="EPSG:4326" minx="-85.051129" miny="-180" maxx="85.051129" maxy="180"/>
<DataURL>
  <Format>text/plain</Format>
  <OnlineResource xlink:type="simple" xlink:href="http://mydataurl.com"/>
</DataURL>
<Attribution>
  <Title>Attribution title</Title>
  <OnlineResource xlink:type="simple" xlink:href="http://myattributionurl.com"/>
</Attribution>
<MetadataURL type="FGDC:1998">
  <Format>text/xml</Format>
  <OnlineResource xlink:type="simple" xlink:href="http://mymetadata.com/data1"/>
</MetadataURL>
<MetadataURL type="ISO19115:2003">
  <Format>text/plain</Format>
  <OnlineResource xlink:type="simple" xlink:href="http://mymetadata.com/data2"/>
</MetadataURL>
<Style>
  <Name>default</Name>
  <Title>default</Title>
  <LegendURL>
    <Format>image/png</Format>
    <OnlineResource xlink:type="simple" xlink:href="http://findthelegendhere.com"/>
  </LegendURL>
</Style>

Funded by Ifremer

@troopa81 troopa81 added Feature Server Related to QGIS server labels Mar 26, 2025
@github-actions github-actions bot added this to the 3.44.0 milestone Mar 26, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Mar 26, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 201e6ba)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 201e6ba)

@troopa81
Copy link
Contributor Author

@dmarteau @rldhont Do you mind reviewing this as you were the first to propose to add those properties to the layer tree group ?

@nyalldawson
Copy link
Collaborator

Core changes look good to me.

The new action does make me think we should consider adding a global option for "Expose QGIS Server configuration options" , which, if not checked (the default being unchecked), would hide all these types of actions throughout the app UI. The group context menu is very frequently used, and for the majority of users they'll never need this QGIS server specific option.

@dmarteau
Copy link
Contributor

Nice, this is going to be useful for generating STAC infomations from QGIS server capabilities data.

@troopa81 troopa81 closed this Mar 31, 2025
@troopa81 troopa81 reopened this Mar 31, 2025
@troopa81
Copy link
Contributor Author

Re-run CI, there is another (non related) failure

Core changes look good to me.

Can we merge then ?

The new action does make me think we should consider adding a global option for "Expose QGIS Server configuration options" , which, if not checked (the default being unchecked), would hide all these types of actions throughout the app UI. The group context menu is very frequently used, and for the majority of users they'll never need this QGIS server specific option.

I don't like much UI pieces hidden by default. User can spend lot of time searching for them. And I think this is a more global issue to QGIS where user uses only a tiny bit of button/menus/panel and would like to be able to configure their visibility.

@nyalldawson
Copy link
Collaborator

Can we merge then

I'd like us to explore the UI options a bit more first. @nirvn @DelazJ @elpaso @m-kuhn @3nids what do you think about hiding QGIS server specific functionality like this behind a global toggle?

@3nids
Copy link
Member

3nids commented Apr 2, 2025

I would also be in favor of a global toggle for server options. I think server is a quite well isolated (in terms of coherence) topic so it would be quite natural that you need to enable it.
Is there already other places where it could be effective?

The other approach I would consider would be to have a dedicated layer tree for server config (like we do for snapping) where you could define this and would be hosted in the project properties or in its own dialog.

@elpaso
Copy link
Contributor

elpaso commented Apr 2, 2025

Can we merge then

I'd like us to explore the UI options a bit more first. @nirvn @DelazJ @elpaso @m-kuhn @3nids what do you think about hiding QGIS server specific functionality like this behind a global toggle?

I have always thought that the server config in its current state is polluting the GUI for the benefit of a extremely tiny fraction of the users which is not ideal. So hiding it behind a global toggle (disabled by default) seems a good idea to me.
Perhaps as a transitional measure we should still expose the "Server" tab in project and layer properties with a link to the global toggle in case the a.m. tiny fraction of server users get confused.

@troopa81
Copy link
Contributor Author

troopa81 commented Apr 2, 2025

I'd like us to explore the UI options a bit more first. @nirvn @DelazJ @elpaso @m-kuhn @3nids what do you think about hiding QGIS server specific functionality like this behind a global toggle?

The menu item is already existing, this PR propose only to add the same field widgets that already exist for vector layer, raster layer and vector tile layer. I don't mind discussing whether or not we should alleviating the GUI from server options but it's beyond the scope of this PR.

@tudorbarascu
Copy link
Member

Hello! I tend towards leaving QGIS Server GUI options visible by default as users can indeed spend a lot of time searching for them if they aren't enabled by default. I've been seeing a lot of users get confused by the disappearance of Processing/Topology and Geometry checker core plugins and they really have a hard time toggling them on back by themselves. Users do spend a lot of time searching for them if they aren't available in a moment. A toggle option with default ON would be nice though.

@nyalldawson
Copy link
Collaborator

Ok, I'm going to file a QEP to add this switch (default to on for one release, default to off for 4.0) 😜

No objections to merging this as is

@m-kuhn
Copy link
Member

m-kuhn commented Apr 3, 2025

Couldn't we leave the options page on the project properties visible by default and have an option in there to enable the current project for server and make that a project property rather than a global QGIS option?

@jgrocha
Copy link
Member

jgrocha commented Apr 4, 2025

I fully support a new option to enable/disable QGIS Server for each project.

To support this, we need a new first tab in QGSI Server options with a checkbox. But we can move some other existing options to this first new tab, like the one to "Test Configuration". Other QGIS Server options that we can set or unset using environment variables can be added here also, like "Ignore invalid layers"-

But this is another QEP/PR just to redesign the QGIS Server options. It does not make sense to have all this logic in this PR.

I can contribute to this new QEP/PR to redesign the QGIS Server options and review all the UI where QGIS Server related options can be hidden.

Copy link
Collaborator

@ptitjano ptitjano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice refactor!

@troopa81 troopa81 merged commit 68dd820 into qgis:master Apr 7, 2025
78 of 79 checks passed
@zacharlie zacharlie added the Changelog Items that are queued to appear in the visual changelog - remove after harvesting label May 7, 2025
@qgis-bot
Copy link
Collaborator

qgis-bot commented May 7, 2025

@troopa81

This pull request has been tagged for the changelog.

  • The description will be harvested so please provide a "nearly-ready" text for the final changelog
  • If possible, add a nice illustration of the feature. Only the first one in the description will be harvested (GIF accepted as well)
  • If you can, it's better to give credits to your sponsor, see below for different formats.

You can edit the description.

Format available for credits
  • Funded by NAME
  • Funded by URL
  • Funded by NAME URL
  • Sponsored by NAME
  • Sponsored by URL
  • Sponsored by NAME URL

Thank you!

@zacharlie zacharlie added ChangelogHarvested This PR description has been harvested in the Changelog already. and removed Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels May 7, 2025
@DelazJ DelazJ added the Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. label Jun 17, 2025
@qgis-bot
Copy link
Collaborator

@troopa81
This pull request has been tagged as requiring documentation.

A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged.

Please update the description (not the comments) with helpful description and screenshot to help the work from documentors.
Also, any commit having [needs-doc] or [Needs Documentation] in will see its message pushed to the issue, so please be as verbose as you can.

Thank you!

@qgis-bot
Copy link
Collaborator

@troopa81
A documentation ticket has been opened at qgis/QGIS-Documentation#9969
It is your responsibility to visit this ticket and add as much detail as possible for the documentation team to correctly document this change.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ChangelogHarvested This PR description has been harvested in the Changelog already. Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. Server Related to QGIS server

Projects

None yet

Development

Successfully merging this pull request may close these issues.