GS3 Sprint: mapfish-print-v2 version 3 - lol no but I have an alternative

Sharing a topic from GS3 Sprint here for reference.

  1. MapFish Print has a storied history:
    • v2: https://github.com/mapfish/mapfish-print-v2
      (Former OSGeo Project, initially using iText but now migrated to Java 11 and OpenPDF)
    • v3: https://github.com/mapfish/mapfish-print
      (Camptocamp Project using Jasper Reports)
  2. While v3 is an ongoing funded project, there remains no migration path to new tech stack. The two projects seem to have a slightly different scope (hence the selection of Jasper Reporting Engine rather than simple iText as a base).
  3. The earlier project mapfish-print-v2 is integrated in GeoServer and MapStore directly as MapPrinterServlet for the generation of PDFs.
  4. GeoNetwork uses mapfish-print-v2 as a library providing a server-side GIS Client, drawing the generated PDF onto an image which it then saves as a PNG thumbnail.

Two alternatives exist here:

  1. For GeoNetwork it would be ideal to take the codebase to GeoTools and add it to the existing “GIS Client” functionality. There is the problem of license compatibility - but we could ask folks for a code donation? This is especially important as GeoNetwork project Migrates to Spring Boot for GeoNetwork 5.
  2. For GeoServer and MapStore the continued availability of MapPrinterServlet is important, but it needs to migrate today to JakarataEE and Spring Framework 6 as part of GeoServer 3 sprint.

Just to note the recent progress of http://github.com/mapfish/mapfish-print-v2 :

  • Version 2.4.x: Just released based on Java 11 and ImageN.
    This will be “supported” for the duration of GeoServer 2.28.x series..
  • Version 2.3.x: Uses Java 11 and JAI. integration of GeoSolution forks for a single code base, change to maven build because life is too short for Gradle
  • Version 2.2.x: Change from iText to OpenPDF library

By integrating with GeoServer 3.0 we avoid needing to make JakartaEE mapfish-print-v2 version 2.25.x (or mapfish-print-v2 version 3.x :laughing:).

With that in mind I am going ahead with:

  • src/extension/printing/gs-mapfish-core - standalone library following the example of jwt-headers-util for integration in GeoNetwork codebase
  • src/extension/printing/gs-mapfish-servlet - JakartaEE servlet including MapPrinterServlet
  • src/extension/printing/gs-web-printing - existing wicket ui integration

Please note that this is a supported extension, not a community module, so this is case of moving fast during sprint to maintain service.

2 Likes

Sounds good to me

Talking to mapfirsh-print-v3 folks in GeoNetwork 4 meeting, and there is some interest in donating the “GIS Client” code to GeoTools to be shared between GeoServer and MapfishPrint v3.

Indeed there is need to update this code with clients for the newer OGCAPI protocols etc…