Table of Contents

Document Structure

Document Rules

Three rules are required for each letter (“documentheader”, “document”, “documentfooter”), which print in the respective page area of the document. You find them in the “Module Explorer” under “Rules\ Document Rules”. In exceptional cases (e.g. in internal letters or reply letters) it is possible that fewer than three rules are sufficient.

Tip: The unused rule does not have to be available. However, it makes sense to keep this unrequired “documentheader/documentfooter” rule, but without the relevant lower-level subrule; e.g. “XMLPrintHeader” If the “documentheader/documentfooter rule” is ever amended to include an appropriate comment explaing why this XML panel does not need to have a header/ footer, the rule becomes easily comprehensible.

Rule documentheader

This rule usually launches the “XMLPrtHeader” rule because the header area of each bank and the Output Channel remains almost unchanged in all messages. In this area, the logo (on the left) and the sender information (on the right) are displayed by default.

“XMLPrtHeader” contains the following Subrules:

At first the Logo has to be copied into the respective directories “\FRAME\<Language>\” as “*.GIF” files with the same name (i.e. you can choose a different logo for each language). The rule “XMLGetLogo” reads out the file name either from “SYSMOD\ETY\LETLOG” (separate logo for letters) or from “SYSMOD\ETY\OFFLOG”. Of course, the logos need to have been properly mapped to the respective entity (via Entity Maintenance).

Rule document

This is where the actual message begins (mostly the individual part). This rule initiates the output of the Postal Notice with address field (recipient), subject line, salutation, actual message and complimentary close.

1. Start

Postal notice, recipient address, subject and salutation will be displayed via the following rules:

The rule for the specific area should be used. Transactions that create a subcontract should use “XMLDocStart-” Regel of the subarea (e.g. BRTMOD\BRTDOC.XMLDocStartBR( <Dokumententitel> ).

“DocStart[XX]” contains individual subrules:

These rules provide the single components separately.

2. Body / Main Part

The individual (main) part, i.e. the actual content of the message, is programmed directly within the “document” rule using XML elements. However, if it is reasonable, it is also possible that it will be (partly) centralized.

Tips:

Good Example: Bad Example:
# Introduction
if LIDGRP\ADV.IsRolSet then
 print using introToADV, XMLGetPtyNam( LIDGRP\BEN )
(““Herewith we open our document L/C in favor of {XMLGetPtyNam(LIDGRP\BEN)}, which can be used against presentation of the documents stated below.”
else
 print using introToBEN
”(“Herewith we open our document L/C in favor of which can be used against presentation of the documents stated below.”)“
endif # Print LC Details as list of labeled fields
LITMOD\LITDOC.XMLPrtDetails
$LcrTyp = LITMOD\LITDOC.XMLGetLCRTYP

$var1 = ”“
if LIDGRP\REC\AVBBY = “P” then
  $var1 = 'at Sight '
else
  if LIDGRP\REC\AVBBY = “N” then
    $var1 = LIDGRP\BLK\DFTAT + ” “
  endif
endif

$var2 = ”“
if PtsIsRolSet( LIDGRP, “ADV” ) then
  $var2 = 'against draft of beneficiary ' + $var1 + 'drawn against ' + LIDGRP\ADV\ADR\NAM1 + ' and '
endif

$AvbBy = LITMOD\LITDOC.XMLGetAVBBY

print using introBEN, $LcrTyp, LIDGRP\ADV\ADR\NAM1, $AvbBy, $var2
”(“Herewith we open this {$LcrTyp} L/C in favor of the above mentioned beneficiary, which can be used at {LIDGRP\ADV\ADR\NAM1} {$AvbBy} {$var2} against presentation of the documents listed below.”)“

3. End

The following calls make up the end of the “document” rule:

Rule documentfooter

Generally, in this area only the rule “XMLPrtFooter” is called, because the footer area is identical in almost every letter. This rule controls, for example, the page numbers. It can also be used to display the court of jurisdiction or the like.

Nomenclature

Subrules creating direct outputs via “print using”, always start with ”“XMLPrt…”“. Note: Names have to be self-explanatory and as short and easy as possible.

Blank Lines

Blank lines belong logically to the preceding element. Only the current element 'knows', if a blank line follows or not. A blank line is created by calling “XMLPrtEmptyLine” because they can easily be forgotten during the translation, which can result in hardly traceable effects. A “XMLPrtEmptyLine” is also responsible for a correct page break.

Page Break

Creating a (conditional) Page Break

A page break in its simple form is created by the commands “print pagebreak” or “print FF” (for form feed). In this way, a command for an immediate start of a new page is given out in the created text.

A conditional page break can be achieved by using “print pagebreak ( <Length>, <Unit> [, <Reference Point> ] )”. A command for the start of a new page in the created text will be given out, if the parametric conditions do not match at that point in time, when the documents are formatted.

The effect of the function depends on the <Reference Point> parameter value. If this value or “tdSpaceRemaining” is not specified, the <Length>/ <Unit> define the remaining space on the page, which has to be at least available, in order to call “print pagebreak” at that point. If the remaining space is less than the given value for <Length>/ <Unit>, a page break will be carried out. Otherwise the command will be ignored.

If you use “tdPosAbsolute”, <Length>/ <Unit> defines the maximum distance to the top edge of the page. If this value will be exceeded, a page break will be inserted. Otherwise the command will be ignored.

“print pagebreak” take only effect in the body area (“document” rules). This is the main area of the document. Its text is distributed over several pages. “The print pagebreak” commands being used within “beginarea … endarea” do not have any effect.

Keeping Outputs Together on a Page

With the commands “print protect( TRUE )” and “print protect ( FALSE )” you can protect areas in the document against cutting off texts via page breaks. Such a group of text outputs will be displayed on the following page, if it does not (quite) fit on the current page as a whole. If the text of the whole group does not fit completely on the next page, a page break to the following pages will then be inserted.

“print protect” has the same effect like “print protect ( TRUE )”.

“print protect ( FALSE )” ends a block which was started with “print protect ( TRUE )”.

Every call of “print protect ( TRUE )” ends the preceding block that was protected.

Controlling Page Breaks via one or more XML elements

The behavior of XML elements during formatting can be defined on the “Cell” tab of the “XML Properties” editor. These properties can only be set for single-column XML elements.

The default values are read out as ”*.XSI“ file. For the page break these values are visible in the area “Page-break”.

Enforced display of at least n lines of a text block at the beginning or the end of a page

The property “Orphans” defines the minimum number of lines of an output block at the end of a page. If it is not defined, the whole block will be moved to the following page.

The property “Widows” defines the minimum number of lines of an output block at the beginning of a page. If it is not defined, the whole block will be displayed on this page.

Combining multiple text blocks to one logical block

keep with next”: The XML element will be combined with its immediate successor in the output to a logical output block. The properties “Orphans” and “Widows” apply to the whole block. The “Orphans/Widows” value of the group is defined as maximum of all individual values for Orphans/ Widows in a group.

keep with previous”: The XML element will be combined with its immediate predecessor in the output to a logical output block. The properties “Orphans” and “Widows” apply to the whole block. The “Orphans/Widows” value of the group is defined as maximum of all individual values for Orphans/ Widows in a group.

From the technical point of view “keep with next” and “keep with previous” are identical. Before the actual document formatting they are transferred into one of both cases.

Example

In the MyModelbank there is an example for this case in the rule “XMLDocEnd”.

If the salutation or another part [enclosure(s)] is moved to the following page, the last two lines of the preceding text shall always be displayed on top of the following page. At first, the XML elements “EncInf” (single-line), “emptyline” (single-line) and “DocEnd” (double-spaced) are connected to each other via “keep with previous”. Altogether the salutation has a length of 7 lines (because of the 4 blank lines). To get the two lines of the preceding page plus one blank line onto the following page, the property “Widows” has to be adapted (Standard: 2). The new value for “EncInf” will then be 10 lines (7+3). If there are no enclosures, only “DocEnd” is displayed; wherefore the new values is 5 lines (2+3).

Of course, now it has to be ensured that the rule “XMLDocEnd” will be used in every “document” rule. Otherwise the control function would only be limited.

Apart from that, the property “Widows was increased for emptyline” up to 3 lines. In this way, every text block that will be moved sometime and which will be added this blank line via “XMLPrtEmptyLine”, will also be moved with two visible lines (i.e. 2 lines + 1 blank lines).

Modules

General Rules (available in all areas)

General rules are defined in “TRNMOD\TRNDOC”. Moreover they have to be declared as “global”, “static” or “method”. These rules are merely called via their names and paths (if necessary).

Examples for available rules:

Area-specific Rules

Area-specific rules are defined in “xxTMOD\xxTDOC” (e.g. “RMTMOD\RMTDOC”). These rules must have the property “method”. They are called via “xxTMOD\xxTDOC.<Rule Name>”.

Example for available rules:

Settlement

Rules that process the settlement of fees and amounts are defined in “SETMOD”

An existing rule is, for example:

Liability

Rules that process data from the liability in order that they can be displayed accordingly in messages, are defined in “LIAALL”.

Examples:

Structure Chart

The following picture shows, in which rules the individual components of a message are processed.