FreeMarker tools

Built for TOPdesk workflows

Less template work.
More useful automation.

Turn repetitive FreeMarker logic into reusable building blocks. Parse form answers, work with JSON and handle dates without rebuilding the same helpers in every template.

Pure FreeMarkerVersioned bundlesAvailable on request
request-handler.ftlFTL
01 / DEFINE YOUR FIELDS
<#assign model = {
  "priority": {
    "label": "Priority",
    "mandatory": true,
    "values": ["Normal", "High"]
  }
}>

<#assign result = parseFields(
  requestText, model
)>
02 / WORK WITH THE ANSWERresult.fields.priority → "High"

Structured answers. Separate validation errors.

Small helpers. Real workflow problems.Forms JSON Dates Data transformation

The toolkit

Find your next building block.

Choose the helpers your workflow needs. Each library is delivered as a versioned .ftl bundle.

Payload validation

jsonSchemaLib

Check a payload before it moves on.

Validate JSON text or parsed values against an explicit subset of JSON Schema draft 2020-12, entirely in FreeMarker.

  • Types, required fields, bounds and patterns
  • Conditional rules and local schema references
  • Validation errors with paths and keywords
What you can do

Use validateJson for a JSON string or validateJsonValue for an already parsed value. Share local definitions with $defs and $ref.

This is not a full JSON Schema engine. Unsupported keywords are reported as schema errors. External references are not supported.

Requires FreeMarker 2.3.31+ for ?eval_json.

Request this library
Dates & time

dateLib

Different date formats. One useful result.

Parse supported date and time notations, normalize them and compare moments or calendar days using explicit time zone settings.

  • ISO output and epoch conversion
  • Date comparisons and range checks
  • Day differences and time zone offsets
What you can do

Use parseDate, toIso, diffDays and isBetween for planned dates, deadlines and time windows.

Configure dateDefaultZone and dateDayFirst before loading. Supported zones and notations are defined by the library; it is not a complete IANA time zone database.

Request this library
Objects & JSON

hashLib

Shape the data your next step needs.

Read and update nested hashes, combine objects and serialize values to JSON without repeating object-handling boilerplate.

  • Nested paths with explicit fallbacks
  • Deep merge, defaults, pick and omit
  • Flattening and JSON serialization
What you can do

Build an API request with pick, add missing settings with defaults, or retrieve an optional nested value with getFromPathOr.

Use toJson to serialize the resulting object rather than manually assembling a JSON string.

Request this library
Lists & arrays

seqLib

Make lists easier to work with.

Group, index, filter and summarize sequences. Turn a list of records into the structure your template actually needs.

  • Group, index and count by a field
  • Extract fields and remove duplicate values
  • Totals, safe first/last and paired sequences
What you can do

Group items by category with groupBy, create a lookup with indexBy, or extract one property from every record with pluck.

Use safeFirst and safeLast when an empty response needs an explicit fallback.

Request this library
Text helpers

strLib

The small text tasks, taken care of.

Convert naming conventions, generate slugs and initials, shorten text and mask parts of a string for display.

  • camelCase and snake_case conversion
  • Slugs, initials and truncation
  • String masking and newline formatting
What you can do

Prepare a readable label with truncate, a URL-friendly value with slugify, or convert keys with toSnakeCase.

Masking is a display helper, not encryption or a substitute for access control.

Request this library
Numbers

numLib

Keep numeric output predictable.

Handle everyday numeric operations with compact helpers for ranges, rounding, percentages and readable byte sizes.

  • Clamp values to a defined range
  • Round to a chosen number of decimals
  • Format byte sizes and calculate percentages
What you can do

Use clamp to constrain a value, roundTo for numeric rounding, or formatBytes to display a file size.

These helpers calculate or format values; they do not replace validation of incoming data.

Request this library
Process models

processLib

Give multi-step workflows a shared structure.

Create and check process models, initialize endpoints and record breadcrumb steps as data moves through a workflow.

  • Create and initialize process models
  • Track steps with breadcrumb helpers
  • Initialize endpoint-specific process data
What you can do

Use createProcess, addToBreadcrumb and getBreadcrumb to carry structured process context between steps.

This library follows its own process-model convention. Some initialization helpers update template variables; review the model and namespace behavior before integrating it.

Request this library

In practice

A little less boilerplate.

Real FreeMarker calls, not a new template language. Load a bundle and use its functions in your existing workflow.

Parse a form answer

fieldHandlingLib
<@fieldHandlingLibSrc?interpret />
<#assign model = {
  "priority": {
    "label": "Priority",
    "mandatory": true,
    "values": ["Normal", "High"]
  }
}>
<#assign result = parseFields(
  "Priority: High", model
)>
${result.fields.priority!""}

Output: High. Check result.errors before using the answer in your next step.

Validate an API payload

jsonSchemaLib
<@jsonSchemaLibSrc?interpret />
<#assign schema = {
  "type": "object",
  "required": ["subject"],
  "properties": {
    "subject": {
      "type": "string", "minLength": 1
    }
  }
}>
<#assign result = validateJson(
  '{"subject":"New laptop"}', schema
)>

Result: result.valid is true. Invalid payloads include structured validation errors.

Read an optional value

hashLib
<@hashLibSrc?interpret />
<#assign ticket = {
  "caller": {
    "name": "Alex",
    "location": {"name": "London"}
  }
}>

<#assign location = getFromPathOr(
  ticket,
  "caller.location.name",
  "Not specified"
)>
${location}

Output: London. The fallback is used when the nested path is missing.

Examples assume the corresponding ...LibSrc variable already contains the library source. These are illustrations, not a browser-based FreeMarker runtime.

Getting started

From a useful idea to your template.

No need to start with the whole toolkit. Tell us what you are building and which helpers would make a difference.

  1. Choose your libraries

    Explore the toolkit and identify the form, data or workflow tasks you want to simplify.

  2. Send a request

    Email Allsrvs with the libraries you are interested in, your use case and your FreeMarker environment if known.

  3. Integrate the bundle

    Once provided, store the source as a string, load it with ?interpret and test it against representative workflow data.

Designed to be loaded at runtime

Compiled bundles contain their referenced helpers inline. Standard, minified and obfuscated variants are built from the same versioned sources. Check runtime compatibility for each library and watch for shared function names when combining bundles.

Let's make it useful

What are you building?

Request a library or tell us about the workflow you want to improve. We can discuss which parts of the toolkit fit your situation.

Libraries are available on request. Availability and any applicable terms are discussed directly; this website does not publish pricing or grant a license.

Start your request

Open email request

Opens a draft in your email app. Nothing is sent until you send the email. Avoid including ticket data, credentials or other sensitive information.

No email app configured? Write directly to info@allsrvs.nl.

A few useful answers

Before you get started.

Is this an official TOPdesk or Apache FreeMarker product?

No. This is an independent toolkit from Allsrvs for use in FreeMarker-based TOPdesk workflows. It is not an official product of, or endorsed by, TOPdesk or the Apache Software Foundation.

Can I download the libraries here?

The libraries are available on request, not as public downloads on this site. Email info@allsrvs.nl with the libraries you need and your use case to discuss availability and applicable terms.

Do I need Java code in my TOPdesk template?

The libraries themselves contain FreeMarker functions. You do not need to deploy their development test harness to use them. Your environment must support the FreeMarker features used by the relevant bundle.

Will every library work with every TOPdesk environment?

Compatibility depends on your FreeMarker version and template setup. fieldHandlingLib and jsonSchemaLib require FreeMarker 2.3.31 or later. Confirm your environment before integration and test your own inputs and error paths.

Does the website store my request?

No. The request helper runs in your browser and prepares an email link. This site does not submit form data, use analytics, or set cookies. Only your language and theme preferences are saved in local browser storage, not your request text. When you send an email, it is handled by your email provider and the recipient. Hosting infrastructure may separately record ordinary access logs.