Hello!
there is a (easy) way to modify the templates used for the GetCapabilities requests?
Best regards, Tomm
Hello!
there is a (easy) way to modify the templates used for the GetCapabilities requests?
Best regards, Tomm
There are no templates for GetCapabilities, it’s all java code.
What part of the output do you want to modify?
In any case, a common way to customize, if your layer list is stable, is to save it once, edit it, and then serve it as a static file, either from a static web server, or I guess through a proxy.
Cheers
Andrea
When using isolated workspaces, the names of the featuretypes contain currently the name of the workspace, like this: WORKSPACE:LAYERNAME
I would like to have just LAYERNAME, as the workspace name is always the same, because of the isolated workspace.
Regards, Tomm
Oh, that’s built-in fuctionality then, you just need to ask for the workspace specific service by adding the workspace name in the path.
For example:
https://gs-main.geosolutionsgroup.com/geoserver/topp/ows?service=WMS&version=1.3.0&request=GetCapabilities
(see that “topp” in the url)
and the usual “topp:states” becomes:
<Layer queryable="1" opaque="0">
<Name>states</Name>
<Title>USA Population</Title>
<Abstract>This is some census data on the states.</Abstract>
<KeywordList>
<Keyword>census</Keyword>
<Keyword>united</Keyword>
<Keyword>boundaries</Keyword>
<Keyword>state</Keyword>
<Keyword>states</Keyword>
</KeywordList>
Cheers
Andrea
Yes, this work, but it seems that it just works for WMS?
With WFS I still get the workspace:
https://gs-main.geosolutionsgroup.com/geoserver/topp/ows?service=WFS&request=GetCapabilities
<FeatureType>
<Name>topp:states</Name>
<Title>USA Population</Title>
<Abstract>This is some census data on the states.</Abstract>
Best regards, Tomm
For WFS the namespace has to be there by specification, as far a I remember? It has to be a QName, qualified name:
<xsd:complexType name="FeatureTypeType">
<xsd:sequence>
<xsd:element name="Name" type="xsd:QName"/>
Hum… maybe it’s possible to remove it, if the namespace associated to “topp” is declared as the default namespace at the top of the document, so that “states” is implied being “topp:states”.
I don’t remember seeing a WFS working like this, but it may be something to try out, if you’re so inclined, and see if test and the OGC certification are still working after the change.
See here on how to get that done:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-fixes,-improvements-and-new-features-in-GeoServer,-GeoTools-and-GeoWebCache
Chers
Andrea
But actually the WFS request works even without namespace in the typenames param?
For example:
Regards, Tomm
The GetFeature implementation is tolerant and allows not having a prefix.
That has nothing to do with how the capabilties document is implemented.
See my previous answer to get a capabilities document like the one you want. It will require coding, not discussion
Cheers
Andrea
I am not sure what would be easier, having wfs
as the default name space, or topp
?
It would force the document to be:
<wfs:FeatureType>
<wfs:Name>topp:states</wfs:Name>
<wfs:Title>USA Population</wfs:Title>
<wfs:Abstract>This is some census data on the states.</wfs:Abstract>
Which is going to be much more verbose…