major
nice-to-have
minor
In the WYSIWYG editor, you can create links to subject objects. These are always opened using the "Go To" mechanism.
Improvement
It should be possible to specify in the WYSIWYG field how these links are opened. For example, in #19000, the in-app documentation, the pages of the documentation are linked to one another using such links. This makes much of what the "Go To" feature does unnecessary: There is no need to first determine which component should display this business object. It should be displayed directly within the current component. Therefore, this behavior should be customizable: Depending on the type of business object, a different CommandHandler should be responsible for displaying it.
Usage
- The ` OpenTLObjectLink.annotateCommandId(TypedAnnotatable annotatable, Function<TLType, String> commandMapping) ` method can be used to annotate which CommandHandler should be used to open an object.
- If nothing is annotated, or if the annotated mapping returns null, the normal Goto mechanism is used.
- Both the WYSIWYG field and the component can be annotated. In that case, the annotation applies to all WYSIWYG fields within it.
- This is used by the FormContextModificator ` SetOpenLinkCommandModificator ` to annotate a field accordingly. The field name and the CommandHandler mapping can be configured as follows:
{{{#!xml <modifier class="com.top_logic.layout.wysiwyg.ui.SetOpenLinkCommandModificator"
field="content"
>
<commandMapping
commandId="setComponentModel"
type="tl.doc:Page"
/>
<commandMapping
commandId="openComponentForWritingMails"
type="contact:Person"
/>
...
</modifier> }}}
Related Ticket
Required as part of #19000.
Test
- There is no test for configurability.
- The links in the documentation application from one page to another must continue to work.
- Existing links in the application—for example, to people or contacts—must continue to work.