Initial setup
To create a document you need components that add activity template/content block functionality linked to the export engine:
- M3367, M3403, M3860 > for activity(ies), activity template(s);
- M3251, M3888, M3890 > for content block(s), content block template(s);
- M3363 > for an export definition.
UML
The basic UML looks like this:
For the activities without content block(s):
For the activities WITH content block(s):
Notice, that content block template has its own export definition (export definition > export dataset > export dataset fields)
So any document falls under activities, and every activity is related to an activity template. Within the activity template there are two ways to create a document:
- Classic: one complete template (.doc, .docx template),
- Content blocks: template composed of reusable building blocks.
Notice, that activity templates and content block templates use the Export engine to replace variables (%link fields%) with a real data from you application, so you need to understand how export works.
Classic
You can use a document template attached to an activity template. The .doc template always contains the variable %activity_content%.
This variable (%activity_content%) is replaced by Activity template > Activity content OR by the content from content block(s) if you will attach any.
Document content could be hardcoded or, more frequantly, defined via the export definition. If you will assign an export definition to an activity template, you can use variables (%variable%) in you activity content.
Styles of a document could be set:
- as inline style (source code),
- as a corporate identity.
Content block
You can create a document with reusable parts - content blocks. Besides, content blocks have a preview, so you can view a document before generating it (the actual values are visible in preview on activity level; on other levels you can see variables):
Content blocks are built based on a content block template. Let’s have a closer look at it:
- the most important is the linked export definition, it defines variables that will be resolved between %% in the “Content”. Note that texts between %% should contain lowercase letters and underscores and can be named exactly the same as they are in the export definition (check for typos!). Otherwise they would not be resolved.
- changing the Read only checkbox will allow or restrict users from changing the content block in a document;
- changing the Active checkbox will affect all places where this content block template is used. If you want to disable a particular content block in a particular document, please, toggle “active” checkbox the linked table or remove the content block from an activity template.
While creating an activity template with content blocks pay attention to sorting them on sequence numbers: they define the order in which content blocks appear in the document.
Export definition for an activity usuing content blocks
- the output type can be either “human readable” or “excel”. This affects the way large numbers are displayed;
- culture. In nl-NL it takes the default for dutch settings in Holland. In en-US mode it will take default settings for english in the United States. The culture setting affects numbers as well as date settings;
- in the export definition you need to use a data set Activitycontentblocks > then you can define any fields.
The table “activitycontentblocks” needs to be present, for everything in a content block depends on that. This table must be a parent for other tables if you need any (for example, invoice lines). If we look at the second dataset, the top part contains our reference:
As we said above, you can assign the export definition to the content block template and use export definition fields as variables (between %%).
Editing a content block (template)
If you correct a spelling error, or make a minor, easily reversible, change, you can edit the original content block template. Remember, that this fix will affect all activity templates where there are content blocks based on this content block template!
But if you will edit a content block (not template) on an activity level > the changes will be applied only for documents generated from this activity.
As soon as changes are done (in content block templates or export definitions) > you can re-define content blocks on an activity level > and generate a document.