|
From: Gabriel R. <gr...@op...> - 2008-08-21 23:26:14
|
Hey, thanks for the feedback.
You're right, here I made a mistake: output formats stated in getcaps shall be
MIME types so its not that right if we include the aliases as output formats.
So what if we do this: lets the GetMapProducer have only a getContentType()
method, returning the MIME type it produces, so that's the one stated in the
caps.
By the other side, replace getOutputFormat():String, which is being used as
the value of a getcaps outputformat, by a
getContentTypeAliases():List<String> and a setter so the aliases can easily
be set by setter injection in applicationContext.xml like this:
<bean id="KMLMapProducer"
singleton="false"
class="org.vfny.geoserver.wms.responses.map.kml.KMLMapProducer">
<property name="contentTypeAliases">
<list>
<value>kml</value>
<value>application/kml</value>
<value>etc...</value>
</list>
</property>
</bean>
Then we can at least be strict about the formats we state in getcaps and still
write down a comment telling what aliases we support.
GetCaps being MIME types brings also an old concern that image/png8 is wrong,
and we should state instead something like "image/png;colordepth=24"
and "image/png;colordepth=16" or just "image/png"
and "image/png;colordepth=16". That's the way I guess exrta parameters are
set for a MIME type, but I still need to check the RFC to see exactly what
the rules are.
BTW, KMLReflector is sending "format=application/vnd.google-earth.kml+XML"
and "format=application/vnd.google-earth.kmz+XML". Note the upper case XML
suffix. Can I let just a single constant for the mime type and remove the
various definitions? (there are a couple repeated constants and a couple
hardcoded values)
Cheers,
Gabriel
On Thursday 21 August 2008 05:30:24 pm Chris Holmes wrote:
> I think aliases are a really good thing. I also noticed that the
> 'openlayers' alias went away. I think we should have that in there.
> When you're using the WMS reflector in particular you don't want to have
> to remember exactly the vnd.google-earth thing.
>
> I think we should only say that the aliases are shortcuts, that they
> should not be used programmatically. But I don't think we should just
> support how things are reported in the caps document, since it's strict
> about it having to be the mime-type, which can have weird definitions.
> But I say we should have lots of aliases - isn't there some quote about
> being lax on what you accept and strict on what you return? Or maybe
> I'm getting it completely backwards.
>
> Chris
>
> Gabriel Roldán wrote:
> > On Thursday 21 August 2008 02:30:22 pm Justin Deoliveira wrote:
> >> Confirmed.
> >>
> >> It appears that the recent code to remove the need for
> >> GetMapProducerFactory (GEOS-654) instances has introduced a problem. It
> >> is doing a strict match against the name of an output format. Where as
> >> the kml stuff requires a check like:
> >>
> >> (mapFormat.startsWith(PRODUCE_TYPE) // "KMZ"
> >> && mapFormat.startsWith("application/vnd.google-earth.kmz"));
> >>
> >> Due to the "+" in the output format name. This is a pretty serious
> >> regression, i am re-openning GEOS-654.
> >
> > Agreed, we don't want regressions...
> > Yet, I wonder about one thing.
> > The old KMZMapProducerFactory stated the official mime type had no
> > "+xml" at the end:
> > /**
> > * Official KMZ mime type
> > */
> > static final String MIME_TYPE = "application/vnd.google-earth.kmz";
> >
> > And that's why I didn't include an alias for the map producer as did for
> > other formats like SVG, or "rss", "application/rss xml",
> > application/rss+xml.
> >
> > I can easily add an alias for "kml" or whatever, but do we actually want
> > the output formats in a request to be "whatever starts with..." It
> > doesn't seem quite right to me. I mean, the output formats are meant to
> > be the ones stated in the capabilities document, not whatever starts with
> > a given string...
> >
> > That's almost it, I didn't allowed that because that was not supposed to
> > happen in my understanding. Yet I see now there's actually a missing
> > alias in order to use just "kmz". Just that before kmz where not stated
> > in the capabilities neither...
> >
> > I propose to use the aliases as stick to what we state we support in the
> > capabilities. Thoughts?
> >
> > Cheers,
> >
> > Gabriel
> >
> >> Thanks for the catch Amr!
> >>
> >> -Justin
> >>
> >> Amr A. Alam wrote:
> >>> I'm trying to view some layer on Google Earth, and am getting this
> >>> error on Geoserver 1.7.0 running under tomcat...
> >>>
> >>> This is happening for one of the default layers:
> >>> http://localhost:8080/geoserver1.7.0/wms?service=WMS&request=GetMap&for
> >>>ma
> >>> t=application/vnd.google-earth.kmz+xml&width=1024&height=1024&srs=EPSG:
> >>>432
> >>> 6&layers=topp:states&styles=population&KMScore=50&KMAttr=true&legend=fa
> >>>lse
> >>>
> >>> Sending the same request to the 1.6.1 version works just fine:
> >>> http://localhost:8080/geoserver1.6.1/wms?service=WMS&request=GetMap&for
> >>>ma
> >>> t=application/vnd.google-earth.kmz+xml&width=1024&height=1024&srs=EPSG:
> >>>432
> >>> 6&layers=topp:states&styles=population&KMScore=50&KMAttr=true&legend=fa
> >>>lse
> >>>
> >>> Any ideas about what's going on? BTW, this is the case with any layer,
> >>> even when using the KML link from the map preview page.
> >>>
> >>> Here's the exception I'm getting in the logs for 1.7.0:
> >>>
> >>> 2008-08-21 09:48:49,332 ERROR [geoserver.ows] -
> >>> org.vfny.geoserver.wms.WmsException: There is no support for creating
> >>> maps in application/vnd.google-earth.kmz xml format
> >>> at
> >>> org.vfny.geoserver.wms.responses.GetMapResponse.getDelegate(GetMapRespo
> >>>ns e.java:612) at
> >>> org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.
> >>>ja va:134) at
> >>> org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.
> >>>ja va:48) at org.geoserver.ows.Dispatcher.response(Dispatcher.java:635)
> >>> at
> >>> org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:198)
> >>> at
> >>> org.springframework.web.servlet.mvc.AbstractController.handleRequest(Ab
> >>>st ractController.java:153) at
> >>> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.hand
> >>>le (SimpleControllerHandlerAdapter.java:48) at
> >>> org.springframework.web.servlet.DispatcherServlet.doDispatch(Dispatcher
> >>>Se rvlet.java:875) at
> >>> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherS
> >>>er vlet.java:809) at
> >>> org.springframework.web.servlet.FrameworkServlet.processRequest(Framewo
> >>>rk Servlet.java:571) at
> >>> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet
> >>>.j ava:501) at
> >>> javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at
> >>> javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at
> >>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> >>>at ionFilterChain.java:290) at
> >>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> >>>te rChain.java:206) at
> >>> org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetChara
> >>>ct erEncodingFilter.java:108) at
> >>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> >>>at ionFilterChain.java:235) at
> >>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> >>>te rChain.java:206) at
> >>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Fil
> >>>te rChainProxy.java:264) at
> >>> org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(Filter
> >>>Se curityInterceptor.java:107) at
> >>> org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(Filt
> >>>er SecurityInterceptor.java:72) at
> >>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Fil
> >>>te rChainProxy.java:274) at
> >>> org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTrans
> >>>la tionFilter.java:110) at
> >>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Fil
> >>>te rChainProxy.java:274) at
> >>> org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilte
> >>>r( AnonymousProcessingFilter.java:125) at
> >>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Fil
> >>>te rChainProxy.java:274) at
> >>> org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProc
> >>>es singFilter.java:178) at
> >>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Fil
> >>>te rChainProxy.java:274) at
> >>> org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(
> >>>Ht tpSessionContextIntegrationFilter.java:229) at
> >>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Fil
> >>>te rChainProxy.java:274) at
> >>> org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:
> >>>14 8) at
> >>> org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.jav
> >>>a: 98) at
> >>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> >>>at ionFilterChain.java:235) at
> >>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> >>>te rChain.java:206) at
> >>> org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73) at
> >>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> >>>at ionFilterChain.java:235) at
> >>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> >>>te rChain.java:206) at
> >>> org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.ja
> >>>va
> >>>
> >>> :163) at
> >>>
> >>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> >>>at ionFilterChain.java:235) at
> >>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> >>>te rChain.java:206) at
> >>> org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:47) at
> >>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> >>>at ionFilterChain.java:235) at
> >>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> >>>te rChain.java:206) at
> >>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
> >>>ve .java:233) at
> >>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal
> >>>ve .java:191) at
> >>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav
> >>>a: 128) at
> >>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav
> >>>a: 102) at
> >>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve
> >>>.j ava:109) at
> >>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
> >>>28 6) at
> >>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:8
> >>>45 ) at
> >>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process
> >>>(H ttp11Protocol.java:583) at
> >>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> >>> at java.lang.Thread.run(Unknown Source)
> >>>
> >>>
> >>>
> >>>
> >>> Thanks,
> >>> Amr.
> >
> > -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> > challenge Build the coolest Linux based applications with Moblin SDK &
> > win great prizes Grand prize is a trip for two to an Open Source event
> > anywhere in the world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > _______________________________________________
> > Geoserver-users mailing list
> > Geo...@li...
> > https://lists.sourceforge.net/lists/listinfo/geoserver-users
|