Skip to main content

Creating a New Expander

When you have the latest version of the nsx-support plugin, you will be able to create new expanders using IntelliJ:

menu: new expander

This will open a form:

new expander

What it generates

After submitting the expander, the plugin will generate 5 files:

  • An {Expander}.xml file, which contains the information on the expander needed by the expansion control layer
  • An {Expander}.stg file, which contains the template for the expander. It uses StringTemplate 4 as templating engine.
  • An {Expander}Mapping.xml file, which describes the transformation of the raw input to a model used in the template.
  • An {Expander}Test.java file, which contains the unit tests.
  • An {Expander}Test.stg file, which contains templates used by the unit tests.

The plugin will automatically group all files of the expander in the navigation. The best way to work with expanders is to select the Packages view, because this will show the source files and test files together:

expander grouping

Some things to know

  • The package name will be automatically filled in with the package you've selected when opening the form
  • Expander names should be PascalCase and always end with 'Expander'
  • The element type can be one of the available elements or can be edited freely in case you are working with a custom meta-model
  • Layer, Technology and SourceType will decide where the expanded artifact will be located and when it will be expanded. E.g. DATA_LAYER expanders will be skipped on option noDataLayer and KNOCKOUT expanders will only be expanded if the technology is enabled
  • Settings chosen in the form can later be modified in the expander xml file if necessary

Next: Learn about defining the name and location of the expanded artifact in Artifact Paths