[midPoint-git] [Evolveum/midpoint] b3c2a0: Implement formatters of Properties deltas

Andrej noreply at github.com
Sat Mar 29 18:24:47 CET 2025


  Branch: refs/heads/improvement/6112
  Home:   https://github.com/Evolveum/midpoint
  Commit: b3c2a0697924f1463b89cf5e840232dd488bc071
      https://github.com/Evolveum/midpoint/commit/b3c2a0697924f1463b89cf5e840232dd488bc071
  Author: Andrej Zan <andrej.zan at evolveum.com>
  Date:   2025-03-26 (Wed, 26 Mar 2025)

  Changed paths:
    A model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/formatters/AdditionalIdentificationFormatter.java
    A model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/formatters/ContainerPropertiesModificationFormatter.java
    A model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/formatters/IndentationGenerator.java
    A model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/formatters/ModifiedPropertiesFormatter.java
    A model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/formatters/PlainTextPropertiesFormatter.java
    A model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/formatters/PropertiesFormatter.java
    A model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/formatters/PropertyFormatter.java
    A model/notifications-impl/src/test/java/com/evolveum/midpoint/notifications/impl/formatters/ContainerPropertiesModificationFormatterTest.java
    A model/notifications-impl/src/test/java/com/evolveum/midpoint/notifications/impl/formatters/PlainTextPropertiesFormatterTest.java
    A model/notifications-impl/src/test/resources/midpoint-home/localization/Midpoint_en_US.properties

  Log Message:
  -----------
  Implement formatters of Properties deltas

**What**

Implement formatting of added/deleted/modified properties, based on the
"Visualisation Abstraction".


  Commit: bdaaa1ba045f9a0e1e617abee51d481438d67985
      https://github.com/Evolveum/midpoint/commit/bdaaa1ba045f9a0e1e617abee51d481438d67985
  Author: Andrej Zan <andrej.zan at evolveum.com>
  Date:   2025-03-26 (Wed, 26 Mar 2025)

  Changed paths:
    M model/notifications-impl/pom.xml
    A model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/formatters/IDeltaFormatter.java
    A model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/formatters/VisualizationBasedDeltaFormatter.java
    A model/notifications-impl/src/test/java/com/evolveum/midpoint/notifications/impl/formatters/VisualizationBasedDeltaFormatterTest.java
    M model/notifications-impl/src/test/resources/ctx-notifications-test.xml
    M model/notifications-impl/src/test/resources/midpoint-home/localization/Midpoint_en_US.properties
    A model/notifications-impl/src/test/resources/objects/role-superuser.xml
    A model/notifications-impl/src/test/resources/objects/user-administrator.xml

  Log Message:
  -----------
  Implement formatter for object deltas

**What**

Implement formatting of added/deleted/modified objects (and containers)
which is based on the "Visualisation Abstraction".

**Why**

Currently we have two kinds of deltas "visualizations".

One is in form of a preview in the UI, which is based on top of the
"Visualization Abstraction", that provides human readable descriptions
of certain changes.

The second form is plain text, used in notifications. That is based
directly on deltas and does not contain many features which the
"Visualization Abstraction" provides (e.g. human readable descriptions
akka overviews).

This formatters are implemented as an effort to unify all deltas
visualizations to be based on the same abstraction and thus to provide
more or less the same set of visualization "features". They are meant
for usage in notifications, but they may also be used in scripts via
existing `TextFormatter`.

**Notes**

This is still work in progress and implementation may/will change (see
al the TODOs and FIXMEs).

Just one note aside of the TODOs/FIXMEs is the new `IDeltaFormatter`
interface. The `I` prefix will be removed. It is there for now just to
have this commit compilable without the need of changing a lot of other
files (`DeltaFormatter` already exists and it is the current
implementation based on deltas).


  Commit: 61d7c21c02d23e98acca88fabc4b30e158eb0a13
      https://github.com/Evolveum/midpoint/commit/61d7c21c02d23e98acca88fabc4b30e158eb0a13
  Author: Andrej Zan <andrej.zan at evolveum.com>
  Date:   2025-03-26 (Wed, 26 Mar 2025)

  Changed paths:
    M model/model-api/src/main/java/com/evolveum/midpoint/model/api/visualizer/VisualizationDeltaItem.java
    M model/model-api/src/main/java/com/evolveum/midpoint/model/api/visualizer/VisualizationItem.java
    M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/VisualizationContext.java
    M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/Visualizer.java
    M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/output/VisualizationDeltaItemImpl.java
    M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/output/VisualizationImpl.java
    M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/output/VisualizationItemImpl.java
    M model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/formatters/IDeltaFormatter.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/VisualizationBasedDeltaFormatterTest.java

  Log Message:
  -----------
  Add hiding of specified path in delta visualizations

**What**

- Add option to hide specified item paths from delta visualization.
- Few other changes in visualizations, which helps with future code
  changes (e.g. do not return wild-card types when possible).

**Why**

Formatters used by notifications (and possibly also from scripts) had
this option before. In order to be backward compatible would need such
behavior also in new visualization based formatters.

But I believe, that better place to implement such hiding is directly in
the Visualization abstraction, so it could be potentially used also by
other code, not just formatters.

Regarding of the removal of wild-card return types. In general it is not
recommended to return wild-card types if possible, because it in lot of
cases forces clients of the API to cast returned objects.

**Notes**

Currently there is one limitation regarding hiding of the parameters
from deltas. If the delta contains only changes which should be hidden,
then it can cause that visualization would be returned as if something was
changed, but it will not contain any parameters. That is not very
desired and it could potentially fall under MID-5350. This issue was
present also in old formatters (mitigated to some extend). There
already is an improvement for this - MID-6111.


  Commit: 4cdf428e55bc9d529be9416dc5baa4134566e321
      https://github.com/Evolveum/midpoint/commit/4cdf428e55bc9d529be9416dc5baa4134566e321
  Author: Andrej Zan <andrej.zan at evolveum.com>
  Date:   2025-03-26 (Wed, 26 Mar 2025)

  Changed paths:
    M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/VisualizationContext.java
    M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/visualizer/Visualizer.java
    M model/notifications-impl/src/test/java/com/evolveum/midpoint/notifications/impl/formatters/VisualizationBasedDeltaFormatterTest.java

  Log Message:
  -----------
  Implement hiding of metadata in visualizations

**What**

Add option to `Visualizer` which tells it to hid metadata related
changes.

**Why**

Metadata has not been used so far in visualizations of deltas in
notifications. They could be however included if the original formatter
was invoked with the `showOperationalAttributes` (sometimes called
auxiliary attributes) set to true (e.g. from scripts).

In order to preserve the option to include/exclude metadata in delta
representation (together with operational attributes), the option to
hide metadata is added directly to the `Visualizer`, since it is
better place to handle it than it would be in a formatter itself.


  Commit: 8d043c5544ea5b926f9fd1088ed6ed009fbd837e
      https://github.com/Evolveum/midpoint/commit/8d043c5544ea5b926f9fd1088ed6ed009fbd837e
  Author: Andrej Zan <andrej.zan at evolveum.com>
  Date:   2025-03-26 (Wed, 26 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

  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: 08a7760732bdc90248148a6a65c7fb4db22be2a7
      https://github.com/Evolveum/midpoint/commit/08a7760732bdc90248148a6a65c7fb4db22be2a7
  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).


Compare: https://github.com/Evolveum/midpoint/compare/0bca92141521...08a7760732bd

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