Freemarker Document Rendering Library

This module (incode-module-docrendering-freemarker) provides an implementation of the Document subdomain module’s Renderer interface using the freemarker library module.

API

The module provides the RendererForFreemarker class which implements RendererFromCharsToChars. This can be used to render a document name, or to perform a "mail merge" for a text document, such as an HTML email.

The class is intended to be used as the Renderer implementation for a Document RenderingStrategy. The RenderingStrategyFSForFreemarker fixture script can be used to create such an entity, eg:

public class RenderingStrategyFSForFreemarker extends RenderingStrategyFSAbstract {

    public static final String REF = "FMK";

    @Override
    protected void execute(ExecutionContext executionContext) {
        upsertRenderingStrategy(
                REF,
                "RendererForFreemarker Rendering Strategy",
                DocumentNature.CHARACTERS, DocumentNature.CHARACTERS,
                RendererForFreemarker.class, executionContext);
    }
}

The document subdomain module also allows RenderingStrategys to be created from the UI; it will "discover" all Renderer implementations from the classpath.

How to configure/use

Classpath

Update your classpath by adding this dependency in your dom project’s pom.xml:

<dependency>
    <groupId>org.incode.module.docrendering</groupId>
    <artifactId>incode-module-docrendering-freemarker-dom</artifactId>
    <version>1.15.0</version>
</dependency>

Check for later releases by searching Maven Central Repo.

For instructions on how to use the latest -SNAPSHOT, see the contributors guide.

Bootstrapping

In the AppManifest, update its getModules() method:

@Override
public List<Class<?>> getModules() {
    return Arrays.asList(
            ...
            org.incode.module.docrendering.freemarker.dom.FreemarkerDocRenderingModule.class,
    );
}

Known issues

None known at this time.

Dependencies

Maven can report modules dependencies using:

mvn dependency:list -o -pl modules/lib/docrendering-freemarker/impl -D excludeTransitive=true

which, excluding Apache Isis itself, returns no direct compile/runtime dependencies:

From the Incode Platform it uses: