2022.2

Table Of Contents
l
If, however, the file is found, then it is loaded with the "Load External File" on page385 task, and
then deleted (for the same reasons).
HTTP brochure request
This workflow builds on the knowledge acquired in "HTTP PDF Invoice Request" on page225 and uses
a single process, but in this case it also uses a PlanetPress Design document (see "PlanetPress
Design documents" on page41) which merges the data received from a browser form with the doc-
ument to generate a PDF brochure, which is sent via email.
Resources
l
HTTPBrochureRequest.zip (PReS Workflow Configuration)
l
InformationBrochure.zip (PlanetPress Design Document)
Installation
l
Download both files and unzip them.
l
Open InformationBrochure.pp7 and send it to PReS Workflow.
l
Open HTTPBrochureRequest.pw7 and send the configuration to your local PReS Workflow ser-
vice.
l
Open your browser to http://localhost:8080/generatebrochure
Task breakdown
l
The HTTP Server Input receives the initial request from the browser.
l
Because this is a demonstration, a backup is made of the XML request. It's not suggested to do
this every time, especially on servers receiving a large number of requests, as these files do take
some amount of space for each request.
l
A condition checks whether the form has been submitted, by verifying that one of the required
fields is empty. If it is, it means this is the initial request, so the condition becomes true.
l
If this is the initial request, an HTML page is created which contains a form asking the client
for a required full name and email, and optional company name. A checkmark also offers to
subscribe to a newsletter (it is unchecked by default!). The form submits back to the same
URL, meaning it is handled by the same process.
l
The file is renamed with the .html extension, so that both the HTTP service and the
browser will recognize it as an HTML page. And then, as usual, it is deleted (but still
returned to the browser).
Page 227