[Users] GeoExt.ux.SimplePrint questions

BERÉNYI Attila atis at airdesignstudio.hu
Wed Jan 26 11:44:56 CET 2011


Dear All,

I have a few question regarding GeoExt ux: SimplePrint.
1. My original configuration applied TMS layers (MapProxy), and by 
default it generates the following error:
Error while generating PDF:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
     at java.lang.String.substring(String.java:1937)
     at 
org.mapfish.print.map.readers.TmsMapReader.<init>(TmsMapReader.java:48)
     at 
org.mapfish.print.map.readers.TmsMapReader.create(TmsMapReader.java:86)
     at org.mapfish.print.map.readers.MapReader.create(MapReader.java:58)
     at 
org.mapfish.print.map.MapChunkDrawer.renderImpl(MapChunkDrawer.java:98)
     at org.mapfish.print.ChunkDrawer.render(ChunkDrawer.java:55)
     at org.mapfish.print.config.layout.MapBlock$1.render(MapBlock.java:62)
     at 
org.mapfish.print.PDFCustomBlocks.addAbsoluteDrawer(PDFCustomBlocks.java:169)
     at org.mapfish.print.config.layout.MapBlock.render(MapBlock.java:58)
     at org.mapfish.print.config.layout.Page.render(Page.java:65)
     at org.mapfish.print.config.layout.MainPage.render(MainPage.java:62)
     at org.mapfish.print.config.layout.Layout.render(Layout.java:59)
     at org.mapfish.print.MapPrinter.print(MapPrinter.java:144)
     at 
org.mapfish.print.servlet.MapPrinterServlet.doCreatePDFFile(MapPrinterServlet.java:275)
     at 
org.mapfish.print.servlet.MapPrinterServlet.createAndGetPDF(MapPrinterServlet.java:130)
     at 
org.mapfish.print.servlet.MapPrinterServlet.doGet(MapPrinterServlet.java:68)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
     at 
org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:158)
     at 
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
     at 
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
     at 
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
     at 
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
     at 
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
     at 
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
     at 
org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
     at 
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
     at 
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
     at 
org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
     at 
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
     at 
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
     at 
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
     at 
org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
     at 
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
     at 
org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
     at 
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
     at 
org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
     at 
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
     at 
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
     at 
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
     at 
org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
     at 
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
     at 
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
     at 
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
     at 
org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
     at 
org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
     at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73)
     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
     at 
org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:183)
     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
     at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:41)
     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
     at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
     at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
     at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
     at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
     at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:581)
     at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
     at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
     at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
     at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
     at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
     at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
     at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
     at java.lang.Thread.run(Thread.java:662)

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.

var TMSlayer = new OpenLayers.Layer.TMS('TMSLayerName', TMSService, {
     layername: 'TMSLayerName',
     type: 'png',
     tileSize: new OpenLayers.Size(512, 512)
});

var WMSLayer = new OpenLayers.Layer.WMS('WMSLayerName', WMSService, {
     layers: 'WMSLayerName',
     format: 'image/png'
}, {
     singleTile: true,
     ratio: 1
}, {
     isBaseLayer: false,
     visibility: false,
     displayInLayerSwitcher: false
});

#1
var overrides = {
     'TMSLayerName': {
         baseURL: WMSService,
         type: 'WMS',
         layers: 'WMSLayerName'
     }
};

#2
var overrides = {
     'WMSLayerName': {
         visibility: true
     },
     'TMSLayerName': {
         visibility: false
     },
};

var printForm = new GeoExt.ux.SimplePrint({
     ...
     overrides: overrides,
     ...
});

TileCache layer works out of the box (override object is not required, 
but a new virtual directory is needed).
var TCLayer = new OpenLayers.Layer.TileCache('TCLayerName', TCService, 
'TCLayerName', {
     isBaseLayer: true,
     ...
});

Can I use override parameter or it is not implemented yet?

2. It is possible to print Google layers? I've set my config.yaml 
according to the sample here: 
http://trac.mapfish.org/trac/mapfish/browser/print/trunk/samples/configNonPremiumGoogle.yaml, 
but the result is still a blank white page.
I'm using Google API v3, if it counts.

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.
var printProvider = new GeoExt.data.PrintProvider({
     //method: "POST",
     method: "GET",
     url: "proxy.cgi?url=http://localhost:8080/geoserver/pdf",
     autoLoad: true
});

Cheers,
Attila
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110126/8265f6da/attachment-0001.htm 


More information about the Users mailing list