Enhancement
Critical
Major
Detail
Detail
Critical
#25647
Multiple relationships between components
Currently, a component channel can only be linked to one other channel. It would be better if it were possible to link several channels to a component channel when selecting it and thus create a composite model.
Important, if e.g. a value list must be calculated from several selections in different components.
Application
In-App Configuration now offers two additional options "Combination" and "Transformation" for component linking. This can be used to combine the values of multiple input channels into one list value,
or a value of an input channel can be transformed via a function.
The XML configuration syntax for combination is:
#!xml <model class="com.top_logic.layout.channel.linking.impl.CombineLinking"> <channel name="selection"> <target name="com.top_logic.demo/technical/components/combiningChannel/attributeChecklistMultiSelector.layout.xml#Selector"/> </channel> <channel name="selection"> <target name="com.top_logic.demo/technical/components/combiningChannel/attributeChecklistSingleSelector.layout.xml#Selector"/> </channel> </model>
The XML configuration syntax for transformation is:
#!xml <model class="com.top_logic.model.search.providers.TransformLinkingByExpression" function="x -> $x.get(`DemoTypes:A#singleStructure`)" input="selection(com.top_logic.demo/technical/components/transformingChannel/asTable.layout.xml#Table)" />
Code migration
The"LayoutRelationManager" has been dropped. Component events are delivered directly by linking component channels.
- LayoutComponent.beforeModelSet(...) has been dropped. AfterModelSet(...) must be used instead.
- Methods LayoutComponent.changedByXXX() have been dropped without replacement.
- The ValidationListener interface and the configurability in LayoutComponent have been dropped. Instead, it must be overridden in a derivation of the component doValidatModel(...).
- The receiveModelXXXByYY(...) methods in LayoutComponent have been dropped. A ChannelListener or ChannelValueFilter can be registered to a component channel instead.
- Components implementing the Selectable interface must no longer override its default methods for getSelected() and setSelected(). Likewise, the fireSelection(...) method of LayoutComponent may no longer be called. Its functionality has been dropped. A new selection is announced exclusively by calling Selectable.setSelected(...). This is automatically handled by the corresponding component channel.
- The possibility to transform component models on receipt in a component has been dropped together with the ModelTransform interface and all configuration options. Corresponding functionality must be mapped via a TransformingChannel.
- The Hook LayoutComponent#getInitialModel() is dropped. Instead, a ModelProvider must be configured to compute the initial model.
- An external Relations.xml file is no longer supported. All component relations must be specified in the component definition.
- A form no longer has a selection channel. Instead of model="selection(MyForm), model="model(MyForm) must now be written.
- The supportsHistoric and showCurrent configuration options in tl:LayoutComponent have been dropped. Components display exactly the models they receive, more details may be provided by a tl:ModelBuilder. The transformation of a historical model into a current one must be realized via a transformation on the model channel.
Test
- /com.top_logic.demo/src/test/com/top_logic/demo/scripted/layout/channels/TestCombiningChannel.script.xml
- /com.top_logic.demo/src/test/com/top_logic/demo/scripted/layout/channels/TestTransformingChannel.script.xml