From a5845d838e922e99e148639a9193ac36dae28a92 Mon Sep 17 00:00:00 2001 From: sebr72 Date: Mon, 2 Sep 2024 11:34:12 +0200 Subject: [PATCH] Documentation for the synchronous print request --- docs/src/main/resources/templates/api.html | 54 ++++++++++++++++------ 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/docs/src/main/resources/templates/api.html b/docs/src/main/resources/templates/api.html index 10c0568601..f86a808b5e 100644 --- a/docs/src/main/resources/templates/api.html +++ b/docs/src/main/resources/templates/api.html @@ -7,6 +7,7 @@
  • Get the status for a print job
  • Download the report for a print job
  • Cancel a print job
  • +
  • Create a print job and download its report
  • List available fonts @@ -30,8 +31,7 @@

    Response Sample

    "simple", "default" ] - +

    @@ -45,8 +45,10 @@

    URI

    :appId should be the identifier of one of the available print configurations.

    -

    Response Sample

    +

    Request Sample

    Request URI: GET /simple/capabilities.json

    + +

    Response Sample

     {
    @@ -71,8 +73,7 @@ 

    Response Sample

    "enabled": false } } -
    +

    The smtp section shows "enabled": true if the reports can be sent by email. To enable this @@ -118,8 +119,7 @@

    Request

    "body": "Some <b>html</b> body" } } - +

    Response

    @@ -165,8 +165,7 @@

    Request Sample

    "title": "Sample Print" } } - +

    Response Sample

    @@ -177,8 +176,7 @@

    Response Sample

    "statusURL": "/print/status/15179fee-618d-4356-8114-cfd8f146e273.json", "downloadURL": "/print/report/15179fee-618d-4356-8114-cfd8f146e273" } - +

    @@ -234,9 +232,11 @@

    Response

  • -

    Response Sample

    +

    Request Sample

    Request URI: GET /status/15179fee-618d-4356-8114-cfd8f146e273.json

    You should not call this API if you requested the report to be sent by email.

    + +

    Response Sample

     {
    @@ -246,8 +246,7 @@ 

    Response Sample

    "waitingTime": 0, "downloadURL": "/print/report/15179fee-618d-4356-8114-cfd8f146e273" } -
    +

    @@ -289,6 +288,33 @@

    Response

    Request Sample

    Request URI: DELETE /cancel/15179fee-618d-4356-8114-cfd8f146e273

    +

    + Create a print job and download its report + +

    +

    + Triggers the creation of a print job, then download the report. Although it seems synchronous from the + client perspective, the print job might be run by a different server in cluster mode. Despite this, it is + not the recommended manner to use the print server (as too many requests in parallel will grab all the + server resources). +

    +

    URI

    +

    + POST /:appId/buildreport.:format +

    +

    :appId should be the identifier of one of the available print configurations.

    +

    + :format should be one of the formats supported by the specified print configuration (e.g. + pdf or png). +

    + +

    Response

    +

    Status: 200 OK

    + +

    Request Sample

    +

    Request URI: POST /simple/buildreport.pdf

    +

    See Create a print job request sample for the request body.

    +

    List Available Fonts