[Geoserver-devel] Geoserver urls that refer back to geoserver

Hey all,

So there are parts of geoserver that need to refer 'back' to the geoserver
install you're using. For example:
  * GetFeature has a reference back to the DescribeFeatureType which defines
the output schema for that featureType.
  * GetCapabilities has a reference back to the eventual OnlineResource urls
for each supported operation.

In both of these cases, a url which references the "geoserver that was
requested" needs to be generated. Stuff that comes after the "?" in such
a self-referential url is pretty easy, but what comes before it? In order
to figure out how to respond to such requests, you need access to two pieces
of information:

#1) What was the url used by the client to MAKE the request?
#2) Is there a proxyURL defined which overrides #1?

Currently, only #2 is available. Making #1 available generally means that
we need to attach an appropriate URL (extracted from the HttpServletRequest)
to every OWS request object which needs to do 'client-facing
self-referential' urls. GetFeature, GetCapabilities, etc.

After chatting with andrea, justin, jody, and gabriel, we came up with the
following solution:

Have the Dispatcher examine every built OWS Request object for an
'onlineResource' property, and if it's present (i.e. if there's a method
called 'setOnlineResource') then inject #1 into that slot.

I was tasked with sending an email out that explains the rationale, and the
implementation of this, so here it is. This should affect very few people
and should only make more of geoserver's self-facing urls 'just work'.

Please respond if you have any comments, questions or other feedback.

--saul

--
View this message in context: http://www.nabble.com/Geoserver-urls-that-refer-back-to-geoserver-tf4308076.html#a12263996
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

Hi Saul,

Thanks for summing up the issue nicely. If i can just provide a bit more
context. The reason why this is an issue now is because as many people
know that with the new dispatching architecture there is no base request
class as there was before. For instance the wfs request objects are
generated straight up from the schema.

So the idea is to how have any request object that needs to know what
the url it is being called from all it needs to do is declare a method:

setOnlineResource(String onlineResource);

And thats it. The dispatcher will recognize it and set it accordingly. I
like this solution because it falls inline nicely with how the
dispatcher sets all the other properties of the request object which
come from kvp's.

-Justin

sfarber wrote:

Hey all,

So there are parts of geoserver that need to refer 'back' to the geoserver
install you're using. For example:
  * GetFeature has a reference back to the DescribeFeatureType which defines
the output schema for that featureType.
  * GetCapabilities has a reference back to the eventual OnlineResource urls
for each supported operation.

In both of these cases, a url which references the "geoserver that was
requested" needs to be generated. Stuff that comes after the "?" in such
a self-referential url is pretty easy, but what comes before it? In order
to figure out how to respond to such requests, you need access to two pieces
of information:

#1) What was the url used by the client to MAKE the request?
#2) Is there a proxyURL defined which overrides #1?

Currently, only #2 is available. Making #1 available generally means that
we need to attach an appropriate URL (extracted from the HttpServletRequest)
to every OWS request object which needs to do 'client-facing
self-referential' urls. GetFeature, GetCapabilities, etc.

After chatting with andrea, justin, jody, and gabriel, we came up with the
following solution:

Have the Dispatcher examine every built OWS Request object for an
'onlineResource' property, and if it's present (i.e. if there's a method
called 'setOnlineResource') then inject #1 into that slot.

I was tasked with sending an email out that explains the rationale, and the
implementation of this, so here it is. This should affect very few people
and should only make more of geoserver's self-facing urls 'just work'.

Please respond if you have any comments, questions or other feedback.

--saul

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

sfarber ha scritto:
...

After chatting with andrea, justin, jody, and gabriel, we came up with the
following solution:

Have the Dispatcher examine every built OWS Request object for an
'onlineResource' property, and if it's present (i.e. if there's a method
called 'setOnlineResource') then inject #1 into that slot.

I was tasked with sending an email out that explains the rationale, and the
implementation of this, so here it is. This should affect very few people
and should only make more of geoserver's self-facing urls 'just work'.

Looks good to me
Cheers
Andrea