Sample flow: serve preview
This topic describes a sample print flow that serves the Print section of an OL Connect template as PDF.
Note: Sample flows are provided by OL Connect Automate, once installed. It appears in the flows folder in the Import dialog in Node-RED which allows you to import the sample into a new or existing flow; see Importing and Exporting Flows in the Node-RED documentation. Instructions are given in this topic, but can also be found in the Read me comment that comes with the sample flow.
For a list of all sample flows, see Sample flows.
Prerequisites
Before running the sample flow:
-
Download the sample template and deploy it to the OL Connect Server using the Send to Server option in OL Connect Designer (see Sending files to Connect Server or to another server):
-
In the settings of the preview pdf node, select the OL Connect Server to which the resource has been sent.
The sample flow
Node-RED automatically captures URL parameters and stores them in msg.payload
.
The preview pdf node passes objects stored in msg.payload
to the Data Model of the template allowing the template to use this data for personalization purposes (in scripts or expressions).
Sample URLs:
http://localhost:1880/preview/certificate/pdf?name=Peter+Parker&course=OL%20Connect+-+Essentials
http://localhost:1880/preview/certificate/pdf?name=Antonio+Viñés&course=OL%20Connect+-+Advanced