[midPoint-git] [Evolveum/midpoint] dba43a: Add API for wrapping specific parts of an overview
Andrej
noreply at github.com
Mon Mar 31 08:05:53 CEST 2025
Branch: refs/heads/improvement/6112
Home: https://github.com/Evolveum/midpoint
Commit: dba43a7ff016cacc6a39f6aed653e7fbee4ba624
https://github.com/Evolveum/midpoint/commit/dba43a7ff016cacc6a39f6aed653e7fbee4ba624
Author: Andrej Zan <andrej.zan at evolveum.com>
Date: 2025-03-29 (Sat, 29 Mar 2025)
Changed paths:
A model/model-api/src/main/java/com/evolveum/midpoint/model/api/visualizer/localization/LocalizableObject.java
A model/model-api/src/main/java/com/evolveum/midpoint/model/api/visualizer/localization/LocalizationPart.java
A model/model-api/src/main/java/com/evolveum/midpoint/model/api/visualizer/localization/LocalizationPartsCombiner.java
A model/model-api/src/main/java/com/evolveum/midpoint/model/api/visualizer/localization/LocalizationPartsWrapper.java
A model/model-api/src/main/java/com/evolveum/midpoint/model/api/visualizer/localization/WrapableLocalization.java
A model/model-api/src/main/java/com/evolveum/midpoint/model/api/visualizer/localization/WrapableLocalizationImpl.java
A model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/visualizer/localization/TestWrapableLocalizationImpl.java
M model/model-impl/testng-unit.xml
Log Message:
-----------
Add API for wrapping specific parts of an overview
**What**
Add new API, which will allow (when integrated) to wrap some parts of
overview generated by the `Visualizer` and thus allow for partial
customization of the overview presentation. E.g. it can be used to add
bold font style to certain overview parts.
**Why**
Overview generated by `Visualizer` contains some specific parts, which
could potentially be handled in special way by the clients (e.g.
specific formatting may be applied).
Currently, such thing is not possible, because the overview is an
`LocalizableMessage` without any possibility of modifications. When
let's say UI wants to highlight certain part of the overview with bold
font style, then it needs to be set directly in the `LocalizableMessage`
thus directly in the localization resources as raw html tags.
There are also places, where overview could not be currently used (and
it isn't even generated for such cases), because the UI code for example
generates links from certain parts of the sentence, or adds various
icons. The new API which this commit adds, should allow to use overviews
(when integrated) also in such cases, where more custom presentation
of sentence parts is desired.
**Notes**
Technically speaking, the API allows not just wrapping of particular
parts of the localization to some arbitrary objects, but it also could
be used to totally transform them to something else. However that defies
the purpose of the interface and should never be used in such a way.
The reason, why localization parts should never be `transformed`, but
just wrapped is that the localization is basically defined by the
translator. Changing its individual parts, or changing the order of
parts in whole localization may make whole localization grammatically
incorrect or in worse case even change its meaning.
Commit: edb7f24f7a3a7a1263f1502d769fb3bd2d099a82
https://github.com/Evolveum/midpoint/commit/edb7f24f7a3a7a1263f1502d769fb3bd2d099a82
Author: Andrej Zan <andrej.zan at evolveum.com>
Date: 2025-03-29 (Sat, 29 Mar 2025)
Changed paths:
M gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java
M gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/model/operationStatus/ModelOperationStatusDto.java
M gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/show/VisualizationItemDto.java
M gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/show/VisualizationItemLineDto.java
M gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/show/VisualizationItemLinePanel.java
M gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/show/VisualizationItemValuePanel.java
M gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/show/VisualizationPanel.java
M gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/show/WrapperVisualization.java
Log Message:
-----------
Small fixes in coded related to visualizations panels
**What**
Fixes of various small mistakes or suboptimal things. Some of these
fixes are consequence of previous changes in Visualizations API (e.g.
removal of wild-card types in return types).
Commit: 6951898c3c7d8fc8d969187527c42777b5a33ab7
https://github.com/Evolveum/midpoint/commit/6951898c3c7d8fc8d969187527c42777b5a33ab7
Author: Andrej Zan <andrej.zan at evolveum.com>
Date: 2025-03-29 (Sat, 29 Mar 2025)
Changed paths:
M gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/show/WrapperVisualization.java
A model/model-api/src/main/java/com/evolveum/midpoint/model/api/visualizer/ActionType.java
A model/model-api/src/main/java/com/evolveum/midpoint/model/api/visualizer/LocalizationCustomizationContext.java
M model/model-api/src/main/java/com/evolveum/midpoint/model/api/visualizer/Name.java
M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/ActivationDescriptionHandler.java
M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/AssignmentDescriptionHandler.java
M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/AssociationDescriptionHandler.java
M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/ClassLoggerDescriptionHandler.java
M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/PasswordDescriptionHandler.java
M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/Resolver.java
M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/ShadowDescriptionHandler.java
M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/output/NameImpl.java
M model/notifications-impl/pom.xml
M model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/formatters/VisualizationBasedDeltaFormatter.java
M model/notifications-impl/src/test/java/com/evolveum/midpoint/notifications/impl/formatters/VisualizationBasedDeltaFormatterTest.java
R model/notifications-impl/src/test/resources/midpoint-home/localization/Midpoint_en_US.properties
A model/notifications-impl/src/test/resources/objects/resource-dummy.xml
Log Message:
-----------
Integrate localization parts wrapping API to Visualizations
**What**
Integrate the new API which allows to customize (wrap) parts of the
localization to the Visualizations abstraction as new kind of
"customizable overview".
**Why**
This new overviews implemented using the `WrapableLocalization` API
allows to do additional "formatting" of individual overview parts. That
means we can (eventually) get rid of the formatting html tags directly
in the localizations.
**Note**
Currently the new customizable overview is used only by the delta
formatters from notifications module. In order to use them also on the
UI, there are few necessary adjustments which needs to be done in the
`WrapableLocalizations`'s API (technically, it could be used also now,
but it would not be ideal).
The implementation of that API as it is right now, does translate the
underlying localization immediately after calling the `translate` method
on the `LocalizableObject` instance. Only after that translation, the
actual wrapping functions are applied.
However, in the Wicket UI, we would need to "postpone" the translation
to the invocation of the `getModelObject` method on the instance of the
`IModel` interface, which should be result of one of the wrappings.
In other words, the `translate` method on `LocalizableObject` should not
actually do the translation, but only provide some kind of a "supplier"
which would be then handed to the `IModel` instance, which in turn would
call that supplier when necessary.
The actual wrapping would then looks like this:
`translated localization supplier -> wrap to IModel -> wrap to ? extends
Component`. Only when the component would call the `getModelObject`
during the rendering phase, it would actually do the translation.
Commit: 6687931eefa80fc65c613e278f506e12f9a43f48
https://github.com/Evolveum/midpoint/commit/6687931eefa80fc65c613e278f506e12f9a43f48
Author: Andrej Zan <andrej.zan at evolveum.com>
Date: 2025-03-31 (Mon, 31 Mar 2025)
Changed paths:
M model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/formatters/AdditionalIdentificationFormatter.java
M model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/formatters/ContainerPropertiesModificationFormatter.java
M model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/formatters/VisualizationBasedDeltaFormatter.java
M model/notifications-impl/src/test/java/com/evolveum/midpoint/notifications/impl/formatters/ContainerPropertiesModificationFormatterTest.java
Log Message:
-----------
Add "additional identification" formatter
**What**
Add implementation of formatter, which handles "additional
identification" properties, also known as "descriptive" properties.
**Why**
Descriptive properties in visualizations are properties, which
themselves were not changed, but they act as a hint about what
particular "container" was changed. The reason is, that sometimes the
mere name of the container is not enough.
**Notes**
Integration of this new formatter, is currently implemented as a
workaround and should be reworked later. The issues is, that currently
we can not rely on the `isDescriptive` method in the
`VisualizationItem`, because there is a bug (MID-10620), which causes
that `Visualizer` does not properly mark items as descriptive. In fact,
it does mark as descriptive also items, which are certainly not
descriptive. Another problem is that the UI sort of relies on that bug
(in fact, it was introduced as a "fix" for some UI bug).
Compare: https://github.com/Evolveum/midpoint/compare/08a7760732bd...6687931eefa8
To unsubscribe from these emails, change your notification settings at https://github.com/Evolveum/midpoint/settings/notifications
More information about the midPoint-svn
mailing list