<div dir="ltr"><div dir="ltr">Hi Toni<div>I am back on this. Many thanks for your insightful comments.</div><div>I found the way to bypass the cache. I noticed that the requests to the basemap API are sent to printng in the correct form (which includes the API key). But, even then, the background map is missing in the thumbnail. This is not happening with OpenStreetMap.</div><div>I cannot see errors in the log file, so I am not sure why this is happening. Definitely java debugging the plugin code would help I think.</div><div>cheers and many thanks again</div><div>Paolo</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 26, 2019 at 2:34 AM Toni Schönbuchner <<a href="mailto:toni.schoenbuchner@csgis.de" target="_blank">toni.schoenbuchner@csgis.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Dear Paolo,<div><br></div><div>sorry I´ve might have sent you on a wrong track. But I think printing plugin (mapfish) and printng are different extensions.</div><div><br></div><div>The one you might be interested in should be:</div><div><a href="https://github.com/boundlessgeo/geoserver-exts/tree/46dc818caf57d2b5ca1d04e8f40926c67b11493f/printng" target="_blank">https://github.com/boundlessgeo/geoserver-exts/tree/46dc818caf57d2b5ca1d04e8f40926c67b11493f/printng</a></div><div><br></div><div>where you find some docs here:</div><div><a href="https://github.com/boundlessgeo/geoserver-exts/blob/46dc818caf57d2b5ca1d04e8f40926c67b11493f/printng/doc/api.rst" target="_blank">https://github.com/boundlessgeo/geoserver-exts/blob/46dc818caf57d2b5ca1d04e8f40926c67b11493f/printng/doc/api.rst</a></div><div><br></div><div>In case of the caching behavior maybe it helps  to dig a bit in code</div><div><a href="https://github.com/boundlessgeo/geoserver-exts/blob/46dc818caf57d2b5ca1d04e8f40926c67b11493f/printng/src/main/java/org/geoserver/printng/PrintUserAgentCallback.java#L156" target="_blank">https://github.com/boundlessgeo/geoserver-exts/blob/46dc818caf57d2b5ca1d04e8f40926c67b11493f/printng/src/main/java/org/geoserver/printng/PrintUserAgentCallback.java#L156</a></div><div> <br><div>So from what I see caching has nothing to do with GWC but with a base64 string written to cacheDIr:</div><div><a href="https://github.com/boundlessgeo/geoserver-exts/blob/46dc818caf57d2b5ca1d04e8f40926c67b11493f/printng/src/main/java/org/geoserver/printng/PrintUserAgentCallback.java#L147" target="_blank">https://github.com/boundlessgeo/geoserver-exts/blob/46dc818caf57d2b5ca1d04e8f40926c67b11493f/printng/src/main/java/org/geoserver/printng/PrintUserAgentCallback.java#L147</a></div><div><br></div><div>Where cacheDir is the java.io.tmpdir value.  Which might be just /tmp or /var/tmp on Linux plattforms.</div><div><a href="https://github.com/boundlessgeo/geoserver-exts/blob/46dc818caf57d2b5ca1d04e8f40926c67b11493f/printng/src/main/java/org/geoserver/printng/PrintSupport.java#L28" target="_blank">https://github.com/boundlessgeo/geoserver-exts/blob/46dc818caf57d2b5ca1d04e8f40926c67b11493f/printng/src/main/java/org/geoserver/printng/PrintSupport.java#L28</a></div><div><br></div><div>My guess is your baselayer is kicked out somewhere here:</div><div><a href="https://github.com/boundlessgeo/geoserver-exts/blob/46dc818caf57d2b5ca1d04e8f40926c67b11493f/printng/src/main/java/org/geoserver/printng/PrintUserAgentCallback.java#L92" target="_blank">https://github.com/boundlessgeo/geoserver-exts/blob/46dc818caf57d2b5ca1d04e8f40926c67b11493f/printng/src/main/java/org/geoserver/printng/PrintUserAgentCallback.java#L92</a></div><div><br></div><div>Can you double check that your sent html fulfills all requirements like img tags, correct style attribute with</div><div>no display: none etc in other words what the if statements expect?</div><div><br></div><div>Another thing what could fail is when loading the resource:</div><div><a href="https://github.com/boundlessgeo/geoserver-exts/blob/46dc818caf57d2b5ca1d04e8f40926c67b11493f/printng/src/main/java/org/geoserver/printng/PrintUserAgentCallback.java#L78" target="_blank">https://github.com/boundlessgeo/geoserver-exts/blob/46dc818caf57d2b5ca1d04e8f40926c67b11493f/printng/src/main/java/org/geoserver/printng/PrintUserAgentCallback.java#L78</a></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-variant-ligatures:normal;white-space:pre-wrap;background-color:rgb(255,255,255)"><br></span></div><div>Unfortunately I´m not a Java guy at all, so others might definitly know better.</div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-variant-ligatures:normal;white-space:pre-wrap;background-color:rgb(255,255,255)"><br></span></div><div><br></div><div>Best regards,</div><div><br></div><div>Toni</div><div><br></div><div><br></div><div><br><blockquote type="cite"><div>Am 26.02.2019 um 00:20 schrieb Paolo Corti <<a href="mailto:pcorti@gmail.com" target="_blank">pcorti@gmail.com</a>>:</div><br class="gmail-m_-6076482917237092770gmail-m_6840813318841009595Apple-interchange-newline"><div><div>Hi Toni<br><br>thanks for helping with this.<br><br>As a first thing, I tried to add the base layers IP in the hosts<br>section of config.yaml (with !dnsMatch).<br>What is confusing me, looking at the log, is that GeoServer is trying<br>to read the tiles from the cache, as it would be a local layer:<br><br>....<br>2019-02-25 23:16:25,811 DEBUG [geoserver.printng] - using cache for<br><a href="http://t4.tianditu.com/DataServer?T=vec_w&X=14&Y=7&L=4&tk=mykey" target="_blank">http://t4.tianditu.com/DataServer?T=vec_w&X=14&Y=7&L=4&tk=mykey</a><br>2019-02-25 23:16:25,812 DEBUG [geoserver.printng] - using cache for<br><a href="http://t4.tianditu.com/DataServer?T=vec_w&X=14&Y=5&L=4&tk=mykey" target="_blank">http://t4.tianditu.com/DataServer?T=vec_w&X=14&Y=5&L=4&tk=mykey</a><br>...<br><br>not sure how to solve this. Maybe I'll ask in the GeoServer list<br>best<br>Paolo<br><br>On Sat, Feb 23, 2019 at 3:38 PM Toni Schönbuchner<br><<a href="mailto:toni.schoenbuchner@csgis.de" target="_blank">toni.schoenbuchner@csgis.de</a>> wrote:<br><blockquote type="cite"><br>Dear Paolo,<br><br>some time ago I´ve been in a similar situation trying to debug thumbnails with leaflet.<br>Unfortuantely I could not find docs for printing execept:<br><br><a href="https://docs.geoserver.org/latest/en/user/extensions/printing/index.html" target="_blank">https://docs.geoserver.org/latest/en/user/extensions/printing/index.html</a><br><a href="https://docs.geoserver.org/stable/en/user/extensions/printing/configuration.html" target="_blank">https://docs.geoserver.org/stable/en/user/extensions/printing/configuration.html</a><br><br>However what helped me was a to double check that cleaned markup has everything we need:<br><a href="https://github.com/GeoNode/geonode/blob/master/geonode/static/geonode/js/utils/thumbnail.js#L17" target="_blank">https://github.com/GeoNode/geonode/blob/master/geonode/static/geonode/js/utils/thumbnail.js#L17</a><br><br>I did this by just testing the code in browser console and adding the cloned map to the body.<br>Then to work a bit faster I´ve used <a href="https://www.getpostman.com/" target="_blank">https://www.getpostman.com/</a> to send the generated markup to the printing endpoint.<br><br>If I remember correctly I´ve faced an issue with thumbnail.js deleting to much and some SSL mixed<br>content blocking.<br><br>Not much, but hopefully a start.<br><br>cheers,<br><br>Toni<br><br><br><br>Message: 1<br>Date: Fri, 22 Feb 2019 17:35:04 -0500<br>From: Paolo Corti <<a href="mailto:pcorti@gmail.com" target="_blank">pcorti@gmail.com</a>><br>To: geonode-devel <<a href="mailto:geonode-devel@lists.osgeo.org" target="_blank">geonode-devel@lists.osgeo.org</a>><br>Subject: [GeoNode-devel] generation of layer's thumbnail with a custom<br>base map<br>Message-ID:<br><CAHXrU-KOd-v4aivGgvz3O9c0Sv-qmSmW=<a href="mailto:4gLT1QKTH5Mgidbfg@mail.gmail.com" target="_blank">4gLT1QKTH5Mgidbfg@mail.gmail.com</a>><br>Content-Type: text/plain; charset="UTF-8"<br><br>Hi GeoNode developers<br><br>We have the following problem: in one of our instances we are using<br>some custom basemaps. When using the "Set Thumbnail" feature from<br>layer page using one of this custom base maps, the thumbnail is<br>created but only the layer is rendered, in a white background.<br>Debugging the code, it looks like the thumbnail is generated by<br>sending a post request to geoserver/rest/printng (in the<br>geoserver/<a href="http://helpers.py/_render_thumbnail" target="_blank">helpers.py/_render_thumbnail</a>).<br>Where can I find some documentation about this printng GeoServer endpoint?<br><br>Thanks<br>Paolo<br><br>--<br>Paolo Corti<br>Geospatial software developer<br>web: <a href="http://www.paolocorti.net" target="_blank">http://www.paolocorti.net</a><br>twitter: @capooti<br>skype: capooti<br><br><br>------------------------------<br><br>Subject: Digest Footer<br><br>_______________________________________________<br>geonode-devel mailing list<br><a href="mailto:geonode-devel@lists.osgeo.org" target="_blank">geonode-devel@lists.osgeo.org</a><br><a href="https://lists.osgeo.org/mailman/listinfo/geonode-devel" target="_blank">https://lists.osgeo.org/mailman/listinfo/geonode-devel</a><br><br><br>------------------------------<br><br>End of geonode-devel Digest, Vol 49, Issue 22<br>*********************************************<br><br><br></blockquote><br><br>-- <br>Paolo Corti<br>Geospatial software developer<br>web: <a href="http://www.paolocorti.net" target="_blank">http://www.paolocorti.net</a><br>twitter: @capooti<br>skype: capooti<br><br></div></div></blockquote></div><br></div></div></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-6076482917237092770gmail_signature">Paolo Corti<br>Geospatial software developer<br>web: <a href="http://www.paolocorti.net" target="_blank">http://www.paolocorti.net</a><br>twitter: @capooti<br>skype: capooti</div>