Release 2021.9.0

Expanders & Expanded Code

Changes affecting expanded code.

  • nsx-default-stack 2021.6.0 → 2021.9.0
  • Expanders 4.16.3 → 5.1.0
  • base-components 2021.2.1 → 2021.3.1
  • web-styles 2021.0.4 → 2021.1.0

Expanders 4.16.3 → 5.1.0

DataElement HTML Pages (NG/UI2 only)

Individual root html pages for each DataElement (and/or it’s IO) are no longer expanded; instead they are routed through a single JSP page page found in struts/jsp/ps2/page.jsp. The canonical entry point is now the associated page model (%component%/%dataElement%/%dataElement%-page-model).

This change is transparent and no action should be necessary for expanded code.

Custom (ext) pages created by copy-pasting the expanded ones can mostly be removed and replaced in struts with /jsp/ps2/page.jsp?pageModel={path-to-ext-page-model-js-file} (without extension), e.g. /jsp/ps2/page.jsp?pageModel=testComp/Person/custom-page-model.

Content Security Policy (NG/UI2 only)

Related to the removal of the individual root pages, its previous script blocks were also removed to allow the use of strict CSP. This does not apply to ext pages, which will need to be updated first.

Favicon Name Change

In your repository, place your favicon to applications/$application$/ext/view-ext/knockout/images/favicon.ico

Finders and Customizable Finders

Customizable Finders [NSX-164],[VEGA-121]

A new isCustomizableFinder finder option has been added (not to be confused with isCustomFinder).

Customizable Finder is structured as a regular finder (we expect users to use fieldOperatorPairs), but additionally provides custom anchors in FinderBean to customize additional filters, sorting, or search post-processing.

New Operators And Options [NSX-117],[NSX-157]

New FieldOperatorPairs introduced: Gte, Lte, Null, Notnull, In, and Nin (not in). Note that (Not)Null, and (N)in are currently supported only in the FinderBean, but not in the UI.

Added option noViewLayer to exclude a finder from the UI for technical finders. (both OG (1.x)/NG (2.x)). Due to optionality semantics of finders it is generally recommended to use QuerySearch for technical finders.

Auto-Creation of Default Finders [NSX-169]

Finders findAll<DataElement> and findByNameEq are no longer required to be explicitly defined in the model.

For more information on finders, see Finder docs.

Additional Fixes

  • [NSX-69],[cruds] resolveDataRef and findData now returns error if the the functional key is malformed (such as having null or empty fields)
  • [NSX-130] Added missing uniqueKey validation to createOrModify method in the bean
  • [NSX-131] uniqueKey validation in Bean moved from @preCreate, @preModify, and @preCreateOrModify to their @pre-validation anchor counterparts.
  • [NSX-144] isRequired validation in Cruds moved from @preCreate, @preCreate-projection, @preModify, and @preModify-projection to their @pre-validation anchor counterparts.
  • [NSX-163],[VEGA-150] Added field option validation.listField. This option adds a validation in the bean class, which matches incoming values of that field with the options configured in the TagValuePair table. If the value is not a valid option, the validation will return an error.
  • [NSX-166] Data projector in Struts UI now does not show a “find failed” warning after element deletion.
  • [NSX-172],[JPA] Ln04 linkFields now support fieldOption hasOtmMappedBy
  • [NSX-180] Added missing details method variable within the find method of a customizable finder without field operator pairs.
  • [NSX-181] Added custom anchors to the form html file of a customizable finder.
  • [VEGA-107] Implemented cruds.bulk.delete for knockout v1 (NSX KNOCKOUT OG)
  • [VEGA-145] Added valueListTag to connectorField. By providing a value, the field will be rendered as a dropdown, where the options will be selected based on the matching instances in the TagValuePair table. (Only for expanded command form)
  • [VEGA-162] Added applicationInstanceOption vega.transient.taskBean.mImplementation to provide TaskBean implementation under previous variable name; also marked implementation variable in TaskBean as final for safety
  • [VEGA-178] Bean methods importFile/exportFile are now only expanded whenincludeCsvImport/includeCsvExport option is defined

Web-Styles 2021.0.4 → 2021.1.0

Bulk delete for UI 1 [VEGA-107]

The ‘bulk delete’ feature has been implemented for Knockout UI1. It can be activated with the ApplicationInstance option cruds.bulk.delete. When active, it is possible to select multiple rows of the data table by holding ctrl or shift. Clicking delete will then remove all selected rows.

Changes to existing files in the struts/ directory

Expanded requireConfig.js

The requireConfig.js file is now always expanded (applicationInstanceOption webstyles.require.expandconfig no longer has any effect and can be removed). The expanded file includes custom anchors to customize the file. Please check any overlay of the file to see if they are still relevant, or can be replaced with custom code in the anchors.

In addition to this, the urlArgs variable is now defined as 'v=${build.cache.version}' to provide cache-busting for new builds. The build.cache.version variable is filtered by maven:

  • the default implementation inserts the build timestamp (in format yyyyMMddHHmmss)
  • can be overridden from root pom, or via command line by explicitly setting the property with -Dbuild.cache.version={some-value}

For UI 2.x (NG), the build.cache.version is also used in struts/jsp/ps2/page.jsp to always serve correct requireConfig.js.

Minified NSX js files

JS files provided by NSX will now be delivered as minified js files (does not apply to expanded scripts):

  • Pages should load faster, since the files are smaller
  • Minification removes any comments, which means they will no longer be picked up (e.g. TODO’s found by IntelliJ or SonarQube)

Do note that this can have consequences to your application:

  • Faster loading means some issues in the loading of your pages can become visible where they used to be hidden. Especially when requiring libraries with the commonjs syntax (e.g. const myLib = require(‘my-lib’);) can break, because the library was not yet loaded. RequireJs works best with the AMD syntax ( e.g. define([‘my-lib'], function (myLib) {...})
  • The minified versions of the NSX libraries will not be readable.

Should you encounter any issues with the loading of your page or simply want to see the original contents of the files, you can add the ApplicationInstance option webstyles.patch.unminify to instead expand the original unminified files.

Some small improvements

  • The default favicon has been renamed from pageIcon.ico to favicon.ico
  • The js/lib directory has been cleaned up by excluding several unused files
  • Removed obsolete/unused jqplot and all associated/dependent code. For custom code loading compatibility, several empty files (requireConfig-jqplot.js, etc.) are preserved
  • [NSX-182] The perform command is no longer executed synchronously, which would block the UI
  • [NSX-173] Page should keep active tabs active instead of always selecting the first one (NG/UI2)
  • [NSX-178] Added some missing builtin valueTypes to fieldTypes.js (note: the observableInstanceBuilder is not supported)
  • [VEGA-120] Fixed instance-id only replacing the first whitespace character

BaseComponents 2021.2.1 → 2021.3.1

Account: Improvements to DataAccess element

  • Added support for the component name in the DataAccess element. It should be inserted in the element field as {componentName}_{dataElementName}. Just defining the name of the element is still supported, but discouraged.
  • Added the option to define the functionality in DataAccess as all. This acts as a wildcard, which denies all rights for an element in case of blacklisting, or allows all rights for an element in case of whitelisting.
  • Added simple wildcard support for components and elements in the DataAccess element where the element can be * to cover all elements in every component, or {componentName}_* to cover every element in a component.
  • Added net.democritus.acl.ConfigurableDataAuthorizationImpl and net.democritus.acl.ConfigurableTaskAuthorizationImpl classes as an alternative default implementation for the authorization tasks. They default to ‘deny all’ (or whitelisting), which requires you to define all rights (made easier by the wildcard support). It can be configured to use ‘allow all’ (or blacklisting) by default if the ParamTargetValue with name defaultAccessRights is set to allowAll.
  • DataAccessRights and TaskAccessRights can now take an instance of AccessRightStrategy, which determines the default authorization for access rights, as well as how access rights are combined.

Expanders 5.x - For Metamodel and Expander Developers

Whilst Expanders 4.x and earlier were primarily focused on expanding an opinionated stack of JEE applications, Expanders 5.x mark a conceptual shift towards clean support for a broad variety of different and custom expansion targets as well as additional metamodels driven by programTypes, moduleTypes, expandableElements, and custom technology stacks.

The previous JEE application stack has been reimplemented to operate under this new regime, and more stacks are in works.

Note that the shift from 4.x to 5.x is fully backwards compatible and is expected to work out of the box, as do Custom Expanders / Expansion Resources.

  • Application is now an expandable element, and Component now has Application as its parent in the expansion hierarchy. Expanding with ApplicationInstance still works as before.
  • Expansion now uses specialized ExpansionRunner classes instead of expanded classes. Old setups using expansionSteps should still work, but easier alternatives are now available using dataResources describing expandable elements.
  • ApplicationExpansionSettingsComposite has been replaced with the ExpansionSettingsComposite. A stubbed object is still available, but it is highly recommended switching to the new composite class.
  • ExpansionJobManager has a new method submit(Consumer<T>, Iterable<T>) to submit new tasks, which replaces the outdated IExecutor interface with the java 8 Consumer interface.
  • Specific expansionContext classes should no longer be directly implemented against. Instead use interfaces such as ProgramExpansionContext, ModuleExpansionContext and ElementExpansionContext.
  • The Meta-model-stack 4.x will not be expanding some of classes it used to, such as the ExpansionRunner and ExpansionContext classes. Instead, it will generate a expandableElements.xml file with the same functionality.

You can find the technical description of the new mechanism at ModelLoader and Expansion Infrastructure.

Technologies and Layers

  • Layers are decided by the ModuleType and ProgramType configuration. These include all applicable layers. In case you have expanders that introduce a new layer, the correct way to add the layer is to define a new ModuleType and ProgramType with your new layer included.
  • Technologies are decided by the linked TechnologyStacks. If your expanders introduce a new Technology, users will have to add it to their technologyStacks.
  • Changed view layer expanders to use NSX KNOCKOUT OG/NG technologies, which replace the version on PresentationSettings. PresentationVersionHelper is now obsolete.
  • Updated ApplicationPropertiesExpander to use more of the modern composite API

New Model Loading infrastructure:

  • Introduced the ModelLoader class, which handles all model loading, from reading the expansionSettings file up to configuring expansion.
  • Added Programs and Module. You can register new ProgramTypes and ModuleTypes in dataResources. You can then reference them in the expansionSettings file, so that models are loaded with the information from the types. This allows you to define new meta-models, detached from Application and Component
  • Technologies are now properties on the Program- and ModuleComposites, which are set during model loading. They are based on TechnologyStack settings, or, in case none are defined, GlobalOptionSettings, BusinessLogicSettings etc.
  • LayerTypes are properties of Program- and ModuleTypes. Only layers included in the program- or moduleType will be expanded. (This is combined with no*Layer options)

Interface changes

Some of the interfaces in prime-core have been changed to suit the needs of the new model loading mechanism. The interfaces have been changed in such a way that they are still backwards compatible.

  • The convertOptions() methods on the TreeToComposite classes have been moved to separate CompositeEnricher classes.
  • The transformTree() methods on the TreeToComposite have been deprecated in favour of the convertTree() methods, which do not use the CompositeEnricher.


Model Loading Listeners are custom logic that hooks into the Model Loading logic

See ModelLoadingListener