Sounds good to me. I don't see any drawback. Cheers, Gabriel Andrea Aime wrote: > Gabriel Roldan ha scritto: >>> Any comments on the API? The biggest question is whether having a kvp >>> Map is overkill or not. And if not, should it still be possible to >>> have GET parameters appended into the URL without them being in the >>> kvp? >> question: what is your intended use for URLType? I see you may want to >> append or not your auth token based on whether the url points outside >> the server or not... still, I don't think there're programmaticaly >> created URLs pointing outside the server? (at least none that I can >> think of off the top of my head) > > Right, at the moment we don't, but in theory we could, or new > services might have a need to. With REST extensions and the work > David is doing on integrating Javascript and the interest in other > scripting languages I think it's fair to assume we'll see other > people needing to generate links in their responses: we cannot > exclude those will never point outwards. > >> API wise, in principle the approach is correct. Now that we settled >> down the separation of concerns between service response urls (usually >> schema locations, either static or dynamically generated like >> DescribeFeatureType), the fact is that all URL constructions in >> GeoServer go through the RequestUtils.baseUrl(HttpServletRequest) >> method, so it seems that's where to inject the extension point? >> >> I've cooked the following patch which hopefully may simplify a bit the >> API and still provide enough context as to create your callback: >> <http://pastebin.com/m24ed06a0> >> >> Please tell me if it seems appropriate or am I missing something. > > The spirit of the above is right, but the implementation as is won't > work. Sampo needs to add a kvp parameter to the request, the existing > code uses the proxifier just to change the base url and then > adds a extension path and kvp params. > That needs to be changed so that the code needing to build a URL > passes the base path (http://host:port/geoserver), the extension > to the base (/wms), whatever kvp parameter (request=GetMap) so that > the utility method building the final url can: > - change the base path if needed > - change the URL params if needed > - assemble a final URL > > The changes above would be done by calling the URL callbacks (the one > that changes the base path would be just another callback). > > What needs doing is to add the above API and then change the call > points that build a URL so that they use the new API (there are > around 40 calling points in the code base). > > Makes sense? > > Cheers > Andrea >
-- Gabriel Roldan OpenGeo - http://opengeo.org Expert service straight from the developers. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Geoserver-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-devel
