Skip to content

Latest commit

 

History

History
62 lines (51 loc) · 2.58 KB

README.md

File metadata and controls

62 lines (51 loc) · 2.58 KB

Foptility

Spring boot application that generates pdf files starting from a set of xslt templates and a collection of parameters specifically formatted.


Rest API that exposes method to perform PDF generation given its content. This application only generates PDF associated with product tracking workflow relative to Italian land production of small enterprises.

Currently are handled only 6 types of documents that are the following:

  • Tracciabilità piante e semi
  • Tracciabilità materie prime
  • Checlist materie prime
  • Tracciabilità prodotto finito (lavorazione)
  • Controllo pulizie
  • Tracciabilità prodotto finito

How to use

Execute a POST request to the exposed endpoint and provide a JSON well-formatted containing all required parameters. The provided JSON must be wrapped in parameters object and must contain:
  1. Filename associated with the required PDF (ChecklistMateriePrime.pdf, ControlloPulizie.pdf, LavorazioneProdottoFinito.pdf, TracciabilitaMateriePrime.pdf, TracciabilitaPianteESemi.pdf, TracciabilitaProdottoFinito.pdf).
  2. Information about the footer, composed of two fields: title and subtitle (can be left empty).
  3. A list of items containing all custom text to inject in the PDF. This can vary from template to template.
  4. A field productInfo that contains generic properties. Only necessary for specific templates.

Following is a snipped example that can be executed with a REST Client.

POST https://foptility/transform/json
Content-Type: application/json

{
    "parameters": {
        "filename": "TracciabilitaMateriePrime.pdf",
        "footer": {
          "title": "Enterprise Name",
          "subtitle": "Enterprise subtitle"
        },
        "items": {
          "plants": "Tomatoes",
          "origin": "Autoproduzione',
          "lot": "123ABC",
          "isCompliant": true,
          "kg": "12",
        }
    }
}

The application uses Java11+ and Maven 3.6+.