File generation

File generation is done with template (Freemarker, velocity, XSL,...). File generation require to :

  • define into input/page element 2 textbox XUL with ID :
    • outputBaseDir which must contain value of output base dir of the file to generate.
    • outputFileName which must contain value of file name to generate.
  • define file element which is linked with template to use.

Akrogen merge input parameters of the component with template. It generate file by using values of XUL textbox outputBaseDir et outputFileName. File content is the result of this merge.


To generate file with template path_of_myTemplate, output must contain :

  <template uri="path_of_myTemplate" />

Here component sample which define 2 XUL textbox outputBaseDir et outputFileName and file element :

For instance :

<?xml version="1.0" encoding="UTF-8"?>
    <page title="Akrogen Hello Word" >
        <box flex="1" id="" orient="vertical"
            <label value="Output base dir:" />
            <textbox id="outputBaseDir" flex="1" />
            <button type="folder" target="outputBaseDir" label="Browse..." />
            <label value="Output file name:" />
            <textbox id="outputFileName" flex="1" />
      <template uri="/ftl/HelloWord/helloWord.ftl" />