Skip to main content

NS Initializer

Initializer Expansion Bundles​

The initializer expansion bundles are in essence the same as any other expansion resourcesExpansion Resource (ExpansionResource). A reusable resource bundle containing expanders and features that provide specific application capabilities, defined in the expansion settings and added to the classpath during expansion., with the exception that they contains data resources which represent the project type in a model, as well as some Java classes for dynamic behavior.

On this page some key information about the initializer is described. The other sections of the initializer documentation:

Version History​

The initializer has many similarities to the expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact., in that it generates some files and performs some actions based on a set of predefined arguments. Because of this, the initializer was upgraded to v2.x by replacing the templating systemSystemA set of interconnected components that work together to achieve a specific purpose or function. with actual expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. that were executed internally in the initializer at runtime. This systemSystemA set of interconnected components that work together to achieve a specific purpose or function. made extensive use of the expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. infrastructure, but also limited itself to a very specific subset of capabilities.

Version 3.x addresses this by completely migrating the initialization process into expander bundlesExpander BundleA set of expanders sharing a repository, packaged into an expansion resource or archive., making it fully use the expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. infrastructure. What remains of the initializer applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution. itself, is that it facilitates the input of arguments that are needed to run the initialization itself.

ExpansionSettings file​

The initializer applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution. operates on a set expansion resourcesExpansion Resource (ExpansionResource). A reusable resource bundle containing expanders and features that provide specific application capabilities, defined in the expansion settings and added to the classpath during expansion. which are set in an expansionSettings.xml file:

expansionSettings.xml
<expansionSettings>
<expansionResources>
<expansionResource name="net.democritus.initializer:nsx-application-initializer" version="7.0.1"/>
<expansionResource name="net.democritus.initializer:nsx-expanders-initializer" version="7.0.1"/>
<expansionResource name="net.democritus.initializer:initializer-initializer" version="7.0.1"/>
</expansionResources>
</expansionSettings>

This file is identically structured as any other file with an ExpansionSettings model, but it only contains expansionResource data refsData Ref (DataRef). An object encapsulating a reference (such as a database ID, name, or functional key) to a specific DataElement instance. of all bundles with initializer projects which the initializer should load and process.

By default, the initializer comes with an internal file containing predefined initializer bundles that it will use. It is possible to override this with a different expansionSettings.xml file, by placing it in one of two locations (with the following priority:

  • In a subfolder of the user folder: ~/.nsinit/expansionSettings.xml.
  • The same directory as the initializer jar file.

Parameters​

For an overview, run nsinit -h.

OptionDescription
-h,
--help
Returns the help with an overview of all commands.
-V,
--version
Returns the version of the ns-initializer.
--updateChecks for an updated version and downloads it to the target folder next to the initializer jar.
--extract-scriptsExtract the command-line scripts to the initializer jar file location.