The modules listed in a table in the Model Editor are confusing because the user's own application module(s) are mixed in somewhere among the built-in TopLogic modules.
Improvement
Display modules as a tree as well
TopLogic +- Base Types +- Model +- ... Demo +- DemoTypes +- DemoPlain +- ... Test +- ... MyApp +- MyModule1 +- MyModule2
Implementation
The type tree in the Model Editor now uses a layout similar to the hierarchical view in the Package Explorer of a common IDE such as Eclipse.
The module name defines the structure of the tree. The name is broken down into individual parts, separated by a period. A new node is created for each of these parts.
For example, if there is a module named tl.core.FooBar, a node named tl is created, which contains a child named tl.core, which in turn contains the module tl.core.FooBar. If the tl node has no other child besides tl.core, the tl node is removed.
Instead of modifying module names (which would require a “major” migration) to change the structure in the Model Editor, you can use the tl:TLModuleDisplayGroup annotation, which is evaluated first to determine the group into which the module is classified. If this annotation does not exist, the technical name of the module is used.
Code Migration
Paths in scripted tests must be adjusted if they navigate the domain object tree in the Model Editor, since the structure has changed.
Test
- Create a new module named com.mycompany.FooBar. The module should be located under the path com > mycompany > Foo Bar.
- Create a new module named com.mycompany.FooBar and enter "Hallo Welt " as the German label (translation service disabled). The module should be located under the path com > mycompany > Hallo Welt. The module’s label should have “Hallo Welt” as both the German and English translations.
- Create a new module named com.mycompany.FooBar and enter “Hello World” as the English label (translation service turned off). The module should be located under the path com > mycompany > Hello World. The module’s label should be “Hello World” for both the German and English translations.
- Create a new module named com.mycompany.FooBar and enter “Hallo Welt” as the German label and “Hello World ” as the English label (translation service enabled), then check whether the other translations of the module’s label have been added correctly.