<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
</head>
<body bgcolor="#ffffff" text="#000000">
<div class="moz-text-flowed" style="font-family: -moz-fixed;
font-size: 14px;" lang="x-western">Dear All,
<br>
<br>
I have a few question regarding GeoExt ux: SimplePrint.<br>
1. My original configuration applied TMS layers (MapProxy), and by
default it generates the following error:
<br>
Error while generating PDF:
<br>
java.lang.StringIndexOutOfBoundsException: String index out of
range: -1
<br>
at java.lang.String.substring(String.java:1937)
<br>
at
org.mapfish.print.map.readers.TmsMapReader.<init>(TmsMapReader.java:48)<br>
at
org.mapfish.print.map.readers.TmsMapReader.create(TmsMapReader.java:86)
<br>
at
org.mapfish.print.map.readers.MapReader.create(MapReader.java:58)
<br>
at
org.mapfish.print.map.MapChunkDrawer.renderImpl(MapChunkDrawer.java:98)
<br>
at org.mapfish.print.ChunkDrawer.render(ChunkDrawer.java:55)
<br>
at
org.mapfish.print.config.layout.MapBlock$1.render(MapBlock.java:62)
<br>
at
org.mapfish.print.PDFCustomBlocks.addAbsoluteDrawer(PDFCustomBlocks.java:169)<br>
at
org.mapfish.print.config.layout.MapBlock.render(MapBlock.java:58)
<br>
at org.mapfish.print.config.layout.Page.render(Page.java:65)
<br>
at
org.mapfish.print.config.layout.MainPage.render(MainPage.java:62)
<br>
at
org.mapfish.print.config.layout.Layout.render(Layout.java:59)
<br>
at org.mapfish.print.MapPrinter.print(MapPrinter.java:144)
<br>
at
org.mapfish.print.servlet.MapPrinterServlet.doCreatePDFFile(MapPrinterServlet.java:275)<br>
at
org.mapfish.print.servlet.MapPrinterServlet.createAndGetPDF(MapPrinterServlet.java:130)<br>
at
org.mapfish.print.servlet.MapPrinterServlet.doGet(MapPrinterServlet.java:68)<br>
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
<br>
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
<br>
at
org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:158)<br>
at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)<br>
at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)<br>
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)<br>
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)<br>
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)<br>
at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)<br>
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
<br>
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
<br>
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)<br>
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)<br>
at
org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)<br>
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)<br>
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)<br>
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)<br>
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)<br>
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)<br>
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)<br>
at
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)<br>
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)<br>
at
org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)<br>
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)<br>
at
org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)<br>
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)<br>
at
org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)<br>
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)<br>
at
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)<br>
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)<br>
at
org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
<br>
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)<br>
at
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)<br>
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)<br>
at
org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)<br>
at
org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)<br>
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)<br>
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)<br>
at
org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73)
<br>
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)<br>
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)<br>
at
org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:183)<br>
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)<br>
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)<br>
at
org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:41)
<br>
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)<br>
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)<br>
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)<br>
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)<br>
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)<br>
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)<br>
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:581)<br>
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)<br>
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)<br>
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)<br>
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)<br>
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)<br>
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)<br>
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)<br>
at java.lang.Thread.run(Thread.java:662)
<br>
<br>
I've tried to reconfigure it using override object, but neither
the type:'WMS' (#1), nor the duplicated layer definition (#2,
defining a 'hidden' WMS layer with the same content) helped. The
overrides parameters seems to be ignored.
<br>
<br>
var TMSlayer = new OpenLayers.Layer.TMS('TMSLayerName',
TMSService, {
<br>
layername: 'TMSLayerName',
<br>
type: 'png',
<br>
tileSize: new OpenLayers.Size(512, 512)
<br>
});
<br>
<br>
var WMSLayer = new OpenLayers.Layer.WMS('WMSLayerName',
WMSService, {
<br>
layers: 'WMSLayerName',
<br>
format: 'image/png'
<br>
}, {
<br>
singleTile: true,
<br>
ratio: 1
<br>
}, {
<br>
isBaseLayer: false,
<br>
visibility: false,
<br>
displayInLayerSwitcher: false
<br>
});
<br>
<br>
#1
<br>
var overrides = {
<br>
'TMSLayerName': {
<br>
baseURL: WMSService,
<br>
type: 'WMS',
<br>
layers: 'WMSLayerName'
<br>
}
<br>
};
<br>
<br>
#2
<br>
var overrides = {
<br>
'WMSLayerName': {
<br>
visibility: true
<br>
},
<br>
'TMSLayerName': {
<br>
visibility: false
<br>
},
<br>
};
<br>
<br>
var printForm = new GeoExt.ux.SimplePrint({
<br>
...
<br>
overrides: overrides,
<br>
...
<br>
});
<br>
<br>
TileCache layer works out of the box (override object is not
required, but a new virtual directory is needed).
<br>
var TCLayer = new OpenLayers.Layer.TileCache('TCLayerName',
TCService, 'TCLayerName', {
<br>
isBaseLayer: true,<br>
...<br>
});
<br>
<br>
Can I use override parameter or it is not implemented yet?<br>
<br>
2. It is possible to print Google layers? I've set my config.yaml
according to the sample here:
<a class="moz-txt-link-freetext" href="http://trac.mapfish.org/trac/mapfish/browser/print/trunk/samples/configNonPremiumGoogle.yaml">http://trac.mapfish.org/trac/mapfish/browser/print/trunk/samples/configNonPremiumGoogle.yaml</a>,
but the result is still a blank white page.<br>
I'm using Google API v3, if it counts. <br>
<br>
3. I wasn't able to use the POST method in the printprovider, the
request does not contain POST parameters, however GET works just
fine.<br>
var printProvider = new GeoExt.data.PrintProvider({<br>
//method: "POST",<br>
method: "GET",<br>
url: "proxy.cgi?url=<a class="moz-txt-link-freetext" href="http://localhost:8080/geoserver/pdf">http://localhost:8080/geoserver/pdf</a>",<br>
autoLoad: true<br>
});<br>
<br>
Cheers,<br>
Attila<br>
</div>
</body>
</html>