Create Web Content
The Create Web Content task generates the output of the HTML Context of a specified template for a single record and returns the HTML code to PlanetPress Workflow for further processing and return to the requester. Generally, this task is placed within an HTTP Server Workflow.
This task can be added as an Action task (see Action Tasks) or as an Output task (see Output Tasks). Adding it as an Action task enables the process or branch to continue after this task. An Output task is always located at the end of a process or branch.
Input
This task must receive either a valid Record ID or a JSON object.
Record ID
A valid Record ID can be retrieved from various data sources. By default, when the Record ID input option is selected, the metadata is used as input. The Execute Data Mapping task and the Retrieve Items task output metadata containing information regarding records.
JSON
The Create Web Content task supports two types of JSON:
- A JSON object or an array of JSON objects representing records. If a value in a record object is a string, it is considered to be a field value. If a value in a record object is a JSON object, it is considered to be a nested table with detail records. For examples, see JSON string samples.
- A JSON Record Data List (see the REST API Cookbook). When the Retrieve Items task is set to output Records in JSON, it outputs this kind of JSON data.
If the input is JSON data, the task makes a call to the REST workflow/contentcreation/html/{templateId} endpoint on the Connect Server. For more information see the REST API Cookbook. Note that only the first JSON object is processed, as the endpoint generates HTML output for a single record.
Processing
For a single record, this task generates the output for the HTML Context of the specified template. Any external resources such as images, css stylesheets or JavaScript files, are also produced and put aside on the OL Connect Server component.
Output
The task outputs HTML code as a job file. Within this HTML code, references to external resources point to the local OL Connect Server and are served to the requester directly when the HTML file is opened in a browser.
Properties
General Tab
- Template File:
- "%o": Select to use a dynamic template name. Click on %o to change the expression that determines the name of the template to use.
- Template Names: Select the appropriate template. Adding template is done through the Send to Workflow option in the Designer Module.
- Section: Enter the section name that will generate output. Only one section can be output. If no section is defined or if the section name is invalid, the default section will be output.
- Data Source (see Input):
- Record ID:
- Enter a valid ID for a record, or 0 to provide no data. The record must be valid for the template used. By default, the record ID is pre-filled with the first record in the metadata. Right-click the field to access other data selection methods (see Data selections).
- JSON:
- JSON String: A JSON object or an array of JSON objects representing records (see JSON) or a JSON Record Data List (see the REST API Cookbook).
This option requires that keys in the JSON data have matching field names in the data model of the template. When they have, the JSON values are passed to the template and the personalization scripts of the template will have access to the values through the record's data fields. (See the Designer help: Adding Variable Data.)The JSON format is not validated by the plugin; it is passed as is to the server. Only the first record or JSON object is processed, since this task can only generate HTML output for a single record.
- Embed all resources: Check this option to download the resources and embed them in the HTML.
- Do not alter HTML: Check this option to prevent the HTML <base> tag from being added to the page. This is useful if the template's resources are all hosted outside of the template (for instance, on a CMS repository).
By default, the Create Web Content task adds the <base> tag to the HTML to specify a default URL and a default target for all links on the page. However, this is only useful when Workflow's HTTP Server is used to deliver the web page and its resources to a web client. The tag will be omitted if the 'Embed all resources' and/or 'Do not alter HTML' option is checked.
OL Connect Proxy Tab
This tab is common to all OL Connect tasks and defines where to process the jobs sent through these tasks. When these fields are empty, they use the defaults set in the OL Connect User Options page of the preferences.
Defaults are not used unless the configuration is sent to the Workflow service.
- OL Connect Proxy Address: Enter the machine name or IP Address where the OL Connect Server resides.
- Port: Enter the port to use to communicate with the OL Connect Server. Default: 9340
- User name: Enter the user name expected by the OL Connect Server.
- Password: Enter the password expected by the OL Connect Server for the above user name.
On Error Tab
Comments Tab
The Comments tab is common to all tasks. It contains a text area (Task comments) that lets you write comments about the task. These comments are saved when the dialog is closed with the OK button, and are displayed in the Task Comments Pane.
Check the option Use as step description to display the text next to the icon of the plugin in the Process area.
|