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

Andrej noreply at github.com
Tue Mar 18 15:19:02 CET 2025


  Branch: refs/heads/improvement/6112
  Home:   https://github.com/Evolveum/midpoint
  Commit: e3f68901e806a56025644f150a5f6a0ccab65740
      https://github.com/Evolveum/midpoint/commit/e3f68901e806a56025644f150a5f6a0ccab65740
  Author: Andrej Zan <andrej.zan at evolveum.com>
  Date:   2025-03-17 (Mon, 17 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: 8b1601e1f794b2446748a6329b17b248f77ca82a
      https://github.com/Evolveum/midpoint/commit/8b1601e1f794b2446748a6329b17b248f77ca82a
  Author: Andrej Zan <andrej.zan at evolveum.com>
  Date:   2025-03-17 (Mon, 17 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: 17e249e0fa6f995e13f90c9fff716df032436f7a
      https://github.com/Evolveum/midpoint/commit/17e249e0fa6f995e13f90c9fff716df032436f7a
  Author: Andrej Zan <andrej.zan at evolveum.com>
  Date:   2025-03-18 (Tue, 18 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.


Compare: https://github.com/Evolveum/midpoint/compare/e3f68901e806%5E...17e249e0fa6f

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