Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25278

Make the export action extensible

    XMLWordPrintable

Details

    • Integration
    • Unknown

    Description

      Allow extensions to provide or overwrite export formats for the export action through a new ExportFormatHandler component role, whose hint is the value of the format request parameter (xar being the default format). Each handler declares whether its export format requires a POST request (the default) or whether it can also be requested with GET, which is the case for export formats that only render a page. A handler can also overwrite an export format supported natively by the export action (xar, html, pdf or one of the office formats).

      This is needed by the PDF export print preview (format=html-print), which is loaded with a GET request by the web browser that generates the PDF. Since XWIKI-23800 the export action refuses GET requests, so the print preview:

      • ignores the requested page revision: exporting an old revision of a page to PDF exports the latest revision instead (see PDFExportIT#pageRevision, failing on CI)
      • is returned with a 405 status code and the X-FRAME-OPTIONS: DENY HTTP header, which breaks the client-side PDF export, where the print preview is loaded in an iframe

      The PDF export application now provides a handler for the html-print export format that accepts GET requests.

      Attachments

        Activity

          People

            mflorea Marius Dumitru Florea
            mflorea Marius Dumitru Florea
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: