major
nice-to-have
defect
major
The standard functionality fails if the root node of a standard structure is not displayed:
- Tree selection is inconsistent: If the tree is empty (no children other than the root node), the tree selects the invisible root node.
- You cannot use the "Create" command on level 1 (directly below the invisible root node). If you deselect the tree (Ctrl-click on the selection), the tree selection becomes empty and the "Create" command disappears. This means you can create at most one child on level 1, and even that is only possible because of the first bug.
Improvements
Layout template for editing structures without a root node
See /com.top_logic.element/webapp/WEB-INF/layouts/editStructureNoRoot.xml.
Configurable Model Transformation
New configuration options:
WithModelTransform (new mixin interface for LayoutComponent.Config and CommandHandler.Config:
List<PolymorphicConfiguration<? extends ModelTransform>> getTransforms()
A ModelTransform is a function that transforms a component model or the base model of a CommandHandler. Previously, the model that a `CommandHandler` receives in `handleCommand(DisplayContext, LayoutComponent, Object model, Map<String, Object>) ` could be selected relative to the component on which the handler is configured using the `target` configuration option. Possible values include access to component channels, such as ` selection(self())`. Now, a transformation of this selected model can also be configured. The transformation is applied to the model selected via the component channel in `target`. The transformation can either be implemented in Java or specified directly using TL Script:
#!xml
<open-handler id="openCreateElementDialog"
target="selection(self())"
>
<transforms>
<script function="x -> ($x == null).ifElse(`DemoTypes#ROOT`, $x)"/>
</transforms>
</open-handler>
Here, the open handler of a dialog receives either the selected object from the opening component or the ROOT singleton of the DemoTypes structure if nothing is selected.
Code Migration
- com.top_logic.layout.component.ModelForwardingDialogOpener has been removed. Configuration of this handler is no longer necessary; its functionality is available in the default open handler.
- com.top_logic.mig.html.layout.DialogInfo.getOpenHandler() now uses com.top_logic.tool.boundsec.OpenModalDialogCommandHandler as its default implementation. Explicit configurations are no longer necessary.
Test
- The aspect inheritance types in tl-demo are now displayed without a root node.
- /com.top_logic.demo/src/test/com/top_logic/demo/scripted/tree/TestTreeWithoutRoot.script.xml