Download OpenAPI specification:Download
Component | Category | Description |
---|---|---|
PUZZLE Reporter Plugin 2.0.0 | Dependency | PUZZLE core version ${puzzle-core.version}. |
Improvement | Initial version. |
This PUZZLE plugin allows a client to request PUZZLE to create a report for a solution of a job. A report is a document based on a template filled with values from a solution of a job.
PUZZLE creates reports for a solution on demand. When you request PUZZLE to create a report, PUZZLE performs the following steps:
template
attribute of the request body as a urlPUZZLE fills the values of the solution with solutionId
for the job with id jobId
into the template.
PUZZLE resolves any resource reference in the template, by looking in the resourcesUrl
attribute and the default resource directory.
format
.The default resource directory is the fallback directory for resolving resource reference. This section describe the resolving process in details.
PUZZLE supports file
and http
url types.
Important: Every URL must be reachable from the point of view of the host running the PUZZLE instance.
By default, a PUZZLE REST installation contains a set of templates in the directory static/templates
and the set of corresponding resources in the directory static/resources
.
The directory static/resources
is used as the default resources directory.
The following table lists all resource references of the default templates.
template | Resource reference | Description |
---|---|---|
en/puzzle_report_pallet_template.jrxml | logo.png | The png image that is used as logo in the upper right corner of the report. |
en/puzzle_report_box_template.jrxml | logo.png | The png image that is used as logo in the upper right corner of the report. |
en/puzzle_report_pack_template.jrxml | logo.png | The png image that is used as logo in the upper right corner of the report. |
en/puzzle_report_pack_plus_template.jrxml | logo.png | The png image that is used as logo in the upper right corner of the report. |
en/puzzle_report_ship_it_template.jrxml | logo.png | The png image that is used as logo in the upper right corner of the report. |
de/puzzle_report_pallet_template.jrxml | logo.png | The png image that is used as logo in the upper right corner of the report. |
de/puzzle_report_box_template.jrxml | logo.png | The png image that is used as logo in the upper right corner of the report. |
de/puzzle_report_pack_template.jrxml | logo.png | The png image that is used as logo in the upper right corner of the report. |
de/puzzle_report_pack_plus_template.jrxml | logo.png | The png image that is used as logo in the upper right corner of the report. |
de/puzzle_report_ship_it_template.jrxml | logo.png | The png image that is used as logo in the upper right corner of the report. |
First PUZZLE tries to resolve resource references with the resourcesUrl
attribute and uses the default resource directory if necessary.
The default resource directory is set by default to ./static/resources
and can be changed using the Reporter.defaultResourcesDirectory
parameter in the puzzle.parameter
file.
For example, the template static/templates/puzzle_pallet_template.jrxml
contains a reference to the resource logo.png
.
If you set resourcesUrl
in a request to http://mypuzzle.de/resources
,
PUZZLE will resolve the resource reference logo.png
with http://mypuzzle.de/resources/logo.png
.
If no file is available at this url, PUZZLE verify if the default resources directory contains a file named logo.png
.
If this file exists, PUZZLE uses this file to resolve the resource reference logo.png
, otherwise PUZZLE returns an error.
If you do not specify a resourcesUrl
, PUZZLE immediately searches for resource references in the default resource directory.
Precondition: the state of the job is DONE.
Create a report for a solution of a job. PUZZLE uses the template and the format specified in the request body.
jobId required | integer <int64> (jobId) >= 1 |
solutionId required | integer >= 1 Identifier of the solution of the specified job for which PUZZLE should create a report. |
format required | string PUZZLE should create a report in this format. Currently supported values are:
|
template required | string A url that references the template to be used to create the report. |
resourcesUrl | string Url used by PUZZLE to resolve the resource reference specified in the |
dpi | integer >= 72 Only used if format is |
pixelWidth | integer >= 595 Only used if format is |
{- "jobId": 123,
- "solutionId": 1,
- "format": "pdf",
- "template": "file:./static/templates/puzzle_pallet_template.jrxml",
- "dpi": 300,
- "pixelWidth": 2480
}
{- "errorMessage": "PUZZLE cannot find job with id 123",
- "additionalInformation": "",
- "errorClass": "de.fraunhofer.iml.puzzle.adapter.execution.Exceptions.Rest.PuzzleJobNotFoundException"
}