XML Component

XML Component Akrogen is XML file stored into Components folder of catalog. It describes the component (Service, DAO, JSP, HTML...) of your application which you wish generate. This component must follow this XML grammar.

Akrogen component can generate or update a file. It is linked with a template (Freemarker, Velocity, XSLT)

Here XML component of helloWord Wizard page :

When you click on Finish button of Wizard page, the template ftl/HelloWord/helloWord.ftl of the Templates folder is merged with the value of the XUL textbox of user id. The template used wait user parameter.

Here Freemarker template used :

  Hello ${user}!

The XML description of the component define 3 sections :

  • Input : this section describes input parameters which are used by the template. Parameters are described with XUL (textbox, checbox,...) which is therefore transformed by Akrogen to display Wizard page Eclipse. Akrogen use Wazaabi to transform XUL to SWT (Wizard page Eclispe).
  • the component/output/file template to use when user click on Finish button of the Wizard Page displayed. Akrogen merge parameters of Wizard page with template to generate or update a file.
  • define the component Model component/model (not required) when :
    • Wizard page Eclispe must generate dynamicly according to selected files (JAVA class, XML).
    • template used wait XML, JAVA model.

XML Grammar

XML component follow this XML grammar :

<?xml version="1.0" encoding="UTF-8"?>
<component>
  
  <!-- Component model -->
  <models>
    <model ...
    ....
  </models>
  
  <!-- Input page -->
  <input>
    <page title="..." >
        <description>...</description>
        
        .... XUL content
        
    </page>
  </input>
  
  <!-- Output page -->
  <output>
    ...
  </output>
  
</component>

Here the HelloWord sample :

<?xml version="1.0" encoding="UTF-8"?>
<component>
  <input>
    <page title="Akrogen Hello Word" >
        <description>HelloWord Akrogen component to generate file with content "Hello $user!".</description>
        <box flex="1" id="" orient="vertical"
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
          <hbox>
            <label value="User: ($user)" />
            <textbox id="user" flex="1" />
          </hbox>
          <hbox>
            <label value="Output base dir:" />
            <textbox id="outputBaseDir" flex="1" />
            <button type="folder" target="outputBaseDir" label="Browse..." />
          </hbox>
          <hbox>
            <label value="Output file name:" />
            <textbox id="outputFileName" flex="1" />
          </hbox>       
          <hbox>
            <button type="preview" label="Preview..." />
          </hbox>                       
        </box>                  
    </page>
  </input>
  <output>
    <file>
      <template uri="/ftl/HelloWord/helloWord.ftl" />
    </file>
  </output>
</component>