Data Backbone

A Data Backbone describes the data as it is used by the document and it retrieves and prepares this data from the business application. Several documents use the same set of data and therefore the same Data Backbone.

A Data Backbone is part of a project in Communication Manager Designer. That means that all content in a project use the same Data Backbone. As soon as a Data Backbone has been defined and created, the master templates and the Content Wizards in this project use the Data Backbone.

Data Backbones are collected from the project in Communication Manager Designer when the template is run.

A Data Backbone consists of several parts:

  • Data Definition

    Data Definition part provides the description of data as it it is used by a set of documents and a graphical representation of the Data Definition. It shows the structure and the content (Field Sets) of the Data Definition.

  • Data Retrieval

    In the Data Retrieval part of a Data Backbone, the Fields Sets from the Data Definition are filled with data from a business application.

Creating Data Backbone

Creating a Data Backbone means creating the Data Definition and the related Data Retrieval parts.

Creating Data Definition

Data Definition is a special form of a Data Structure.

Data Definition is defined using the DATABACKBONE Name BEGIN ... END keywords. The name of the Data Backbone is optional. In between the BEGIN and END you define the Data Structure that forms the Data Definition.

Data Definitions are limited compared to a 'normal' Data Structure:

  • Data Definition is only allowed to have the following members: Data Structure, ARRAY of Data Structure, Fieldset, and ARRAY of Fieldset.

  • Data Structures used in a Data Definition are also limited to Data Structures, ARRAY of Data Structure, Fieldset, and ARRAY of Fieldset.

The following examples show how you create a Data Definition:

DATABACKBONE
BEGIN

  FIELDSET Customer
  FIELDSET Person
  ARRAY FIELDSET Children DEFINED_AS Person
  DATASTRUCTURE Orders
  BEGIN
    FIELDSET Order
  END
END
DATABACKBONE Customer
BEGIN
  FIELDSET Customer
  FIELDSET Person
  ARRAY FIELDSET Children DEFINED_AS Person
  DATASTRUCTURE Orders
  BEGIN
    FIELDSET Order
  END
END

Arrays in a Data Backbone cannot contain more than 9999 elements.

Creating Data Retrieval

In the Data Retrieval part of a Data Backbone, the Fields Sets from the Data Definition are filled with data.

Using a Data Backbone automatically introduces a _data variable in the master templates. The variable _data always has the type of this Data Backbone. In the Data Retrieval part the template developer must fill the variable _data with appropriate content. This is done with template scripting language.

Every WIZARD and TEXTBLOCK statement in the master template will implicitly use the _data variable to present repeating elements and fill FieldSet content.

_data

The variable _data represents the Data Backbone in the template scripting language. The Data Retrieval part of the Data Backbone should fill the _data variable with the relevant data it retrieves. The master template and the dynamic components can then use structured data in the Data Backbone to produce the document.

The _data variable represents a Data Structure and can be manipulated as any regular Data Structure:

ASSIGN _data.Customer.SSN := "567-68-0515"
ASSIGN _data.Invoices[4].Line[5].Item := "Ol' Janx Spirit"

The _data variable itself can be manipulated using the SET instruction. The following example copies the Data Backbone and restores it afterwards:

DECLARE copy
SET copy -> NEW _data          (* Perform a copy *)
... (* do some work *) ...
SET _data -> copy              (* Link back to the copy *)

Dynamic objects such as Content Wizards and Text Blocks will use contents of the _data variable implicitly.

_data is a reserved name. It is not possible to re-declare any objects with this name.