Skip to main content

Standard Rendering Script for List Plannings

The standard script "Build List Plannings" (1004) is automatically created in every new comet project. It can be used to build list plannings created with "Flatplan Content Assignment" in Neowise for dynamic documents as well as with old "Planning & Briefing" in priint:planner.

There are several constants in the main function, which can be changed to customize the script behavior.

Start PageThe building will start on the page given in the variable start_page. For using the last page, set it to document::pages(gDocument).
Page Template Set the variable pageTemplateId to a value > 0, the identifier of an existing page template to fix its usage. If the variable value is Zero, the page template identifier will be read from the standard publication parameter "_priint_pageTemplate". Neowise Flatplan Preparation stage stores there the page template the user sets for dynamic documents.
Build LayerThe templates are always built on one layer. If other layers are needed, frame layout rules must be applied to the specific frames or frame groups. The script supports three ways to define the layer:
1. Add the fixed layer name in variable build_layer, for example: char * build_layer = "templates"; Additional set build_layer_index to -1: int build_layer_index = -1;
2. Set build_layer_index to the fixed index of the layer needed (value >=0): int build_layer_index = 1;
3. Read the layer name from a publication parameter "_priint_layer". If this parameter does not exists, it must be created and added to the used publication type, or use an other existing text parameter. Set build_layer_index to -2: int build_layer_index = -2;
char * build_layer_parameter = "_priint_layer";
Build FlagsSet the variable flags for productlist::establish. Possible values are explained in detail here. Default is Zero, no flags.
Fall Back TemplateSet a fallback template in the variable defaultTemplateId, or depending on the flags described above, overwrite the template in the planning records.
Execute Pre-ScriptThe planning list can be filtered and modified by a so called pre-script. Set its id in the variable preScript. Find the documentation here.
Record Id MappingWhich ids are given to the templates is controlled by the parameter id_flag. See here for more explanation.

The comet function productlist:establish has more possibilities to control the building process and there are many more functions to be used. Feel free to adjust this script to the needs of your project.

Error Handling

The script makes use of the gOutput mechanism for returning errors to priint:bpm processes, for example the standard process "Run Renderer Script". See here for more details.

Some errors can be fixed by the user who started the process. This might be a planned bucket without template or no page template given, or the page template and a used template do not fit to each other. Then a BusinessError user task will be created for that user. If the error is more technical, a user task for the standard team Renderer-Administration will be created. Both user tasks will contain a message describing the issue.

The script implements and calls the function checkForFailedPlaceholders after establishing the templates. This function will crawl though the document and search for placeholders with an error state. If it finds any, a TechnicalError user task for the team Renderer-Administration will be created.