[
https://issues.apache.org/jira/browse/FREEMARKER-188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17411439#comment-17411439
]
Siegfried Goeschl edited comment on FREEMARKER-188 at 9/8/21, 5:55 PM:
-----------------------------------------------------------------------
h3. Examples (Work In Progress)
Pickup all CSV files found in the current working directory and transform them
into HTML files (keeping the relative paths)
{noformat}
> bin/freemarker-generator \
--seed=datasource \
--template freemarker-generator/csv/html/transform.ftl \
--data-source . \
--data-source-include="*.csv" \
--output target \
--output-mapper="*.html"
> tree target
target
`-- examples
`-- data
`-- csv
|-- contract.html
|-- dataframe.html
|-- excel-export-utf8.html
|-- locker-test-users.html
|-- sales-records.html
|-- transactions.html
`-- user.html
{noformat}
Pickup all CSV files found in a given directory and transform them into HTML
files
{noformat}
> bin/freemarker-generator -M generate -t
> freemarker-generator/csv/html/transform.ftl -o target examples/data/csv
> tree target
>
target
|-- contract.html
|-- dataframe.html
|-- excel-export-utf8.html
|-- locker-test-users.html
|-- sales-records.html
|-- transactions.html
`-- user.html
{noformat}
It is also possible to invoke multiple transformations with a single command
line invocation
{noformat}
> bin/freemarker-generator \
-M generate -t freemarker-generator/csv/html/transform.ftl -s .
--data-source-include="*.csv" -o target \
-M generate -t freemarker-generator/csv/html/transform.ftl -o target
examples/data/csv
> tree target
target
|-- contract.html
|-- dataframe.html
|-- examples
| `-- data
| `-- csv
| |-- contract.html
| |-- dataframe.html
| |-- excel-export-utf8.html
| |-- locker-test-users.html
| |-- sales-records.html
| |-- transactions.html
| `-- user.html
|-- excel-export-utf8.html
|-- locker-test-users.html
|-- sales-records.html
|-- transactions.html
`-- user.html
{noformat}
If no output directory is defined, all output is written to stdout.
was (Author: sgoeschl):
h3. Examples (Work In Progress)
Pickup all CSV files found in the current working directory and transform them
into HTML files (keeping the relative paths)
{noformat}
> bin/freemarker-generator -M generate -t
> freemarker-generator/csv/html/transform.ftl -s .
> --data-source-include="*.csv" -o target
> tree target
target
`-- examples
`-- data
`-- csv
|-- contract.html
|-- dataframe.html
|-- excel-export-utf8.html
|-- locker-test-users.html
|-- sales-records.html
|-- transactions.html
`-- user.html
{noformat}
Pickup all CSV files found in a given directory and transform them into HTML
files
{noformat}
> bin/freemarker-generator -M generate -t
> freemarker-generator/csv/html/transform.ftl -o target examples/data/csv
> tree target
>
target
|-- contract.html
|-- dataframe.html
|-- excel-export-utf8.html
|-- locker-test-users.html
|-- sales-records.html
|-- transactions.html
`-- user.html
{noformat}
It is also possible to invoke multiple transformations with a single command
line invocation
{noformat}
> bin/freemarker-generator \
-M generate -t freemarker-generator/csv/html/transform.ftl -s .
--data-source-include="*.csv" -o target \
-M generate -t freemarker-generator/csv/html/transform.ftl -o target
examples/data/csv
> tree target
target
|-- contract.html
|-- dataframe.html
|-- examples
| `-- data
| `-- csv
| |-- contract.html
| |-- dataframe.html
| |-- excel-export-utf8.html
| |-- locker-test-users.html
| |-- sales-records.html
| |-- transactions.html
| `-- user.html
|-- excel-export-utf8.html
|-- locker-test-users.html
|-- sales-records.html
|-- transactions.html
`-- user.html
{noformat}
If no output directory is defined, all output is written to stdout.
> [freemarker-generator] Support an output "generation" mode
> ----------------------------------------------------------
>
> Key: FREEMARKER-188
> URL: https://issues.apache.org/jira/browse/FREEMARKER-188
> Project: Apache Freemarker
> Issue Type: Improvement
> Reporter: Siegfried Goeschl
> Assignee: Siegfried Goeschl
> Priority: Major
>
> The current "freemarker-generator" implementation supports only
> "aggregation" of multiple data source, e.g. one template takes 0..N data
> sources to generate a template output (stdout or file)
> *1 template + 0..N data sources -> 1 template output*
> We need to provide a "generation" type of transformation as well in order to
> provide
> *1 template + 1..N data sources -> 1..N template outputs*
> Topics to be resolved
> * We need something like an "Output Mapper" to determine the final path
> and/or name of the generated output file
> * We need a way to distinguish between "generate" and "aggregate", e.g. using
> a command line parameter
> ** "--output-mode=generate|aggregate" or
> ** "--seed=template|datasource"
> * We need to support multiple transformations on the command line (mostly
> because JVM is slow to start)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)