Questions tagged [fmpp]

FMPP is a general-purpose text file preprocessor tool that uses FreeMarker templates.

FMPP uses FreeMarker templates to generate static websites, source code or any text files. FMPP is extendable with Java classes to pull data from any data sources (e.g. XML, databases, CSV) and embed these data into the generated files.

23 questions
6
votes
2 answers

Freemarker model convert timestamp in milliseconds to date

I have a csv-file which i want to transform with fmpp (freemarker). The first column is a long value (milliseconds since 1.1.1970) which i want to convert into a date and format it as datetime. src…
Andreas
  • 1,183
  • 1
  • 11
  • 24
5
votes
4 answers

Does anyone know of a Python equivalent of FMPP?

Does anyone know of a Python equivalent for FMPP the text file preprocessor? Follow up: I am reading the docs and looking at the examples for the suggestions given. Just to expand. My usage of FMPP is to read in a data file (csv) and use multiple…
1.01pm
  • 841
  • 1
  • 12
  • 23
2
votes
0 answers

How can you load data dynamically with the FMPP Java API?

I am integrating a FMPP transformation into our Java code base. For this, I am using the FMPP Java API. For practical reasons, I have two separate directories: one which contains the template: /template.ftlx one which…
2
votes
1 answer

Using fmpp in gradle to generate java files

I have an existing maven project which I am attempting to port to gradle. One sub module uses fmpp/freemarker to generate a whole lot of java files which are then fed back into the build. I'm new to gradle, and was wondering if anyone knows of an…
Ben
  • 6,567
  • 10
  • 42
  • 64
1
vote
2 answers

How can I serialize() a fmpp CsvSequence in FreeMarker?

I tried using both flexjson.JSONSerializer and com.fasterxml.jackson.databind.ObjectMapper in a freemarker template to convert a csv file loaded via the csv data loader csv(menu.csv, {trimCells: true}) to JSON. When I try to run this, I get the…
Peter T.
  • 2,927
  • 5
  • 33
  • 40
1
vote
1 answer

Using FMPP with Gradle

I am attempting to convert an ant task which uses fmpp over to gradle. I am unable to get my project to build. I have the following in my build.xml file:
Ed Dunn
  • 1,152
  • 3
  • 11
  • 27
1
vote
0 answers

Where do code generation sources (templates) go in maven's standard directory structure?

I have some java source files that need to be generated from templates and data. I'm using freemarker for this with fmpp and the maven exec plugin. It's working great, but I'm not sure where my templates should be put in the maven standard directory…
John Calcote
  • 793
  • 1
  • 8
  • 15
1
vote
2 answers

FMPP use old FTL syntax

It should be possible to configure freemarker to use the old #-less syntax. However, to give users time to prepare for this change, in FreeMarker 2.1 and 2.2 the usage of # is optional, unless the programmer enables strict syntax mode in the…
setchock
  • 151
  • 1
  • 2
  • 9
1
vote
1 answer

Java Code Generation - Is there a way to dymanically generate folders with the names you want?

I have been trying out fmpp for code generation. But I haven't been able to achieve one of the function that I want at this moment, which is dynamically replace the folder name and file name. For example, if I have a folder with file as…
Hong Wei Wang
  • 1,388
  • 3
  • 19
  • 29
1
vote
1 answer

Fmpp template for directory name

I am using freemarker templates to automatically generate files. While this works fine so far - including changing the names of files - I have one additional feature I need. The name of some directories within the virtual file path have to be…
Yanick Salzmann
  • 1,456
  • 1
  • 15
  • 27
1
vote
2 answers

one template to several output files with fmpp

I want to set up an maven plugin that will take a few freemarker templates, and expand each one several times, each time with a different set of input values. Is there any better way to do this with fmpp that brute force processing them over and…
bmargulies
  • 97,814
  • 39
  • 186
  • 310
1
vote
1 answer

How to make fmpp fail if a value cannot be found for a variable?

Is there a parameter to make FMPP fail when it is unable to find a value for a variable in the template? right now it just leaves the text intact with ${} if it cannot resolve a variable.
Usman Ismail
  • 17,999
  • 14
  • 83
  • 165
1
vote
1 answer

Cobertura code coverage for Freemarker auto-generated code

I am trying to set up Cobertura code coverage on a project which includes auto-generated code, created from templates using Freemarker (explicitly, using the fmpp maven plugin). I then have unit tests for those auto-generated classes. However, these…
amaidment
  • 6,942
  • 5
  • 52
  • 88
0
votes
0 answers

Generate Project Structure Dynamically Freemarker/FMPP

I am new to Freemarker and writing a new Software. Before starting of any functionality, I want to get a complete folder structure to be created dynamically on the basis of user input (like Project Name, package name etc.) But I am not able to find…
Ashish
  • 341
  • 2
  • 7
  • 17
0
votes
1 answer

Is there any way to define methods for data model when using FMPP?

I want to add methods to my datamodel so I need a way to specify them inside my tdd data file(s). For example having a tdd data file containing two scalars : a: 1 b: 1 I would like to add a method area which multiplies them. Is this even possible…
user10568173
  • 61
  • 1
  • 7
1
2