planetfederal / qgis-suite-plugin

GNU General Public License v2.0
25 stars 17 forks source link

Show workspaces in OpenGeo Explorer display #92

Closed bmmpxf closed 10 years ago

bmmpxf commented 10 years ago

Two layers with same name but in different workspaces. How do you know which is which?

no-ws

volaya commented 10 years ago

That's a limitation of the REST API. Layers are not qualified with the workspace name. If you have "ws:name" and "anotherws:name", the REST API will list a layer named "name".

Since you have 2 named "dem" in your tree, I guess they do not have the same name, but just the same title (the tree item text is the title of the layer, not the name). Maybe an option to use the name instead of the title can be added, so you do not have to look in the properties of the layer to see its name.

Also, I can show the workspace of the underlying resource. It usually is the same as the workspace of the layer, but not always, since layers can exist without being into any worskpace...

bmmpxf commented 10 years ago

Hmm. Is the workspace listed in the layer properties anywhere? Even if it returns just the name, can't we puzzle piece together the workspace from somewhere? Right now in QGIS even when you look at the layer properties it doesn't say what workspace a layer is in. There's just no way to know now, and that seems like an issue.

In the above case, for reference, I had usa:dem, and quickstart:dem.

volaya commented 10 years ago

No, the workspace name is not shown, since it cannot actually be known.

This is what happens:

I have added two layers with the same name, as you have in your repo. The listing of layers reports two layers named "dem", but to get the information about them, they both share the same url (in my case http://localhost:8080/geoserver/rest/layers/dem.html). That takes you to the description of one of them (I do not know how GeoServer selects one or the other in a case of ambiguity like this one), but you cannot get the description of the other one. So basically what you see is the same layer twice in the Explorer tree.

Since there is no way of fixing this, I am going to add a check for duplicated layer names, and in case there are several with the same name, warn the user. also, i will show the workspace name of the underlying data store (not guaranteed to be the same of the layer,though), which should help the user find out which one of the layers with identical name is being represented in the Explorer tree.

Sounds good to you? I cannot think of a better way of finding a solution for this...

volaya commented 10 years ago

Implemented in 47ff7ea74307ee4

bmmpxf commented 10 years ago

Sounds good to me. As long as the user has some idea of what's going on, should be fine.