Skip to content
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

WMS GetCapabilities not returning the workspace prefix inside style names in 2.19.x #315

Open
giohappy opened this issue Sep 24, 2021 · 6 comments

Comments

@giohappy
Copy link

MapStore expects to receive the the workspace prefix inside the style name returned by the GetCapabilities. It used to work in 2.18.x, even for GC requests toward workspaced services.
For example this request returns

Style>
  <Name>geonode:Major_Roads0</Name>
  <Title>A dark yellow line style</Title>
  <LegendURL width="20" height="20">
	<Format>image/png</Format>
	<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="https://stable.demo.geonode.org/geoserver/geonode/Major_Roads0/ows?service=WMS&amp;request=GetLegendGraphic&amp;format=image%2Fpng&amp;width=20&amp;height=20&amp;layer=Major_Roads0"/>
  </LegendURL>
</Style>

2.19.x doesn't return the workspace prefix anymore. A similar request returns

<Style>
  <Name>states</Name>
  <Title>A dark yellow polygon style</Title>
  <LegendURL width="20" height="20">
	<Format>image/png</Format>
	<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="https://development.demo.geonode.org/geoserver/geonode/states/ows?service=WMS&amp;request=GetLegendGraphic&amp;format=image%2Fpng&amp;width=20&amp;height=20&amp;layer=states"/>
  </LegendURL>
</Style>

Is this behaviour expected? Is the change on 2.19.x done on purpose?

The missing prefix breaks MapStore's Style Editor logic.

@giohappy
Copy link
Author

@aaime can you shed some light on this?

@aaime
Copy link
Member

aaime commented Sep 24, 2021

The 2.19.x behavior is the correct one, if you're requesting on a workspace-specific capabilities document, all names must be de-qualified, including style ones, not just layer ones like in the past. It's something we fixed recently.

@giohappy
Copy link
Author

thanks @aaime.
So MapStore built a functionality on top of a wrong behaviour of previous GS versions...

@allyoucanmap
Copy link

@giohappy @aaime I was working to improve the client but there is a case where I'm not able to recognize the correct workspace of a style.
See this comment GeoNode/geonode-mapstore-client#519 (comment)

@giohappy
Copy link
Author

giohappy commented Oct 7, 2021

@aaime I undersand the rationale under the decsion of dropping the workspace prefix, but now I see a couple of inconsistencies.

Ambigous GetCap response

  1. I create two style with same name under two different worspaces,
  2. I assign them to one layer
  3. I obtain the GetCap for one or the other workspace -> I have two styles with same name, title, etc. and I have no clue to know which one is what.
  4. Which style will be used when I call the GetMap without prefixing the style with the workspace?

image

REST API response inconsistency

While testing other solutions based on the metadata returned from the API we notices that the workspace prefix has been stripped from the style response, but it's still used inside the layer response.
Is this behaviour done on purpose?

@simboss simboss reopened this Oct 7, 2021
@giohappy giohappy assigned giohappy and unassigned simboss Oct 7, 2021
@giohappy
Copy link
Author

giohappy commented Oct 8, 2021

quick report of the internal call:

  • Geoserver shouldn't return any global style or styles from other workspacess when GetCaps are request is workspaced. The case was reproduced associating a global style, a style from the local workspace and a style from another workspace to same layer. The output is reported below.
  • This causes name clashing in case the styles have the same name, but MapStore can safely pick any of them, since any subsequent (workspaced) request will use the style from the current workspace. As agreed this will be the solution that @allyoucanmap will adopt to solve the issue.
  • REST APIs return namespaced names when they include references to resources. The reference to a style returned inside the layer API will remain namespaces, since it's out of the workspace naming control.

image

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

No branches or pull requests

4 participants