Overlays

Both expanders and Prime Radiant offer the possibility to apply overlays.

Overlay is used primarily as temporary way to override specific generated files, to e.g. add more customization anchors, or change non-customizable behavior of expanded code.

Using overlays puts all maintenance responsibility on the application developers. Due to the brittleness of overlays (potentially any change in the generated code can break the application), it is recommended to use them only temporarily until the required changes are applied to the expanders.

Expanders’ Overlay Step

Expanders include an overlay phase and an ApplicationOverlay Step that is running by default.

This step automatically copies all files from {SOURCE_DIRECTORY}/applications/{appShortName}/overlay to {EXPANSION_DIRECTORY}/{appShortName}.

E.g.:

  • source file: {C:\NSF\workspace\demobooking}\applications\{bookingApp}\overlay\components\account\pom.xml
  • destination file: {C:\NSF\expansions\bookingApp-latest}\{bookingApp}\components\account\pom.xml

If you want to temporarily disable overlay phase, use Expand > Skip Overlays in Prime Radiant, or add an skipPhase : overlay expansionOption before expanding.

Prime Radiant Overlays (removed)

NOTE This functionality has been removed in Prime Radiant 2021.0.0.

Some projects may contain separate overlay script file in:

  • {SOURCE_DIRECTORY}/applications/{appShortName}/overlay_application_{appShortName}.bat (or .sh)
  • {SOURCE_DIRECTORY}/applications/{appShortName}/windows (or linux)

Unless you explicitly call these scripts, you should be safe to remove them.

If you have a script that you want to migrate, replace any copying step with a regular overlay step (see Expanders’ Overlay Step). For any special step performed in the script, the recommended approach is to create a separate ExpansionStep executed in the overlay phase.

For reference, these environment variables were injected into the overlay script:

Name Description Example
EXPANSION_DIRECTORY Directory where the application has been expanded to. C:\NSF\primespace\expansions\demobookingApp-id10
DEMOCRITUS_ROOT Same as EXPANSION_DIRECTORY. C:\NSF\primespace\expansions\demobookingApp-id10
SOURCE_DIRECTORY Directory of the application’s model/code (typically root of a git repository). C:\NSF\workspace\demobooking
PALVER_ROOT Same as SOURCE_DIRECTORY. C:\NSF\workspace\demobooking