Skip to content
Mike Schumacher edited this page Apr 17, 2018 · 23 revisions

Text Merger Plug-in

The Text Merger Plug-in enables merging result free text documents to existing free text documents. Therefore, the algorithms are also very rudimentary.

Merger extensions

There are currently two main merge strategies that apply for the whole document:

  • merge strategy textmerge_append (appends the text directly to the end of the existing document)

  • merge strategy textmerge_appendWithNewLine (appends the text after adding a new line break to the existing document) Remark: empty patches will not result in appending a new line any more since v1.0.1

The following is Work In Progress

Anchor functionality

If a template contains comments that fit the definition of anchor:${documentpart}:${mergestrategy}:anchorend, some additional functionality becomes available about specific parts of the incoming text and the way it will be merged with the existing text. These anchors have to be written as a comment of the language the template results in (As the merger doesn’t know about freemarker comments). Anchors always change things about the text to come up until the next anchor, text before it is ignored. The following functionality is available

Documentparts

  • anchor:header:${mergestrategy}:anchorend marks the beginning of a header, that will be added once when the document is created, but not again.Remark: This is only done once, if you have header in another anchor, it will be treated as default text

  • anchor:footer:${mergestrategy}:anchorend marks the beginning of a footer, that will be added once when the document is created, but not again.

  • anchor:${mergestrategy}:anchorend simply means that the following text is default text that should be merged in a specific way

mergestrategies

  • anchor:${documentpart}::anchorend or anything in place of ${mergestrategy} means that the text should only be appended.

  • anchor:${documentpart}:${}newline:anchorend or anchor:${documentpart}:newline${}:anchorend states that a new line should be appended before or after this anchor, depending on where the newline is (before or after the mergestrategy).

  • anchor:${documentpart}:anchorend does not work, you have to always have at least a default mergestrategy defined.

Clone this wiki locally