Skip to content

Commit

Permalink
[doc] Add the ADR for supporting any kind of object as semantic eleme…
Browse files Browse the repository at this point in the history
…nt in trees

Signed-off-by: Jerome Gout <[email protected]>
  • Loading branch information
jerome-obeo authored and sbegaudeau committed Jul 15, 2024
1 parent d1964bc commit 70a563e
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

=== Architectural decision records

- [ADR-152] Add support for any kind of object as semantic element in the tree representation

=== Deprecation warning

Expand Down Expand Up @@ -42,7 +43,7 @@

=== Architectural decision records

[ADR-151] Improve Diagram Subscription Lifecycle
- [ADR-151] Improve Diagram Subscription Lifecycle

=== Deprecation warning

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= [ADR-137] Use a common identification strategy for transient representations
= ADR-137 Use a common identification strategy for transient representations

== Context

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= [ADR-138] Allow consumers to reuse smaller parts of the Sirius Web backend
= ADR-138 Allow consumers to reuse smaller parts of the Sirius Web backend

== Context

Expand Down
2 changes: 1 addition & 1 deletion doc/adrs/141_factorize-graphql_queries_in_tests.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= [ADR-141] Factorize GraphQL queries in tests
= ADR-141 Factorize GraphQL queries in tests

== Context

Expand Down
2 changes: 1 addition & 1 deletion doc/adrs/142_add_report_on_document_upload.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= [ADR-142] Add report on document upload
= ADR-142 Add report on document upload

== Context

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= [ADR-143] Handle documents upload with other formats than JSON and XMI
= ADR-143 Handle documents upload with other formats than JSON and XMI

== Context

Expand Down
2 changes: 1 addition & 1 deletion doc/adrs/145_add_a_hook_to_update_nodes_in_reactflow.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= [ADR-145] Add a hook to update nodes in ReactFlow
= ADR-145 Add a hook to update nodes in ReactFlow

== Context

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= [ADR-146] Add support for contributing representation metadata for transient representations
= ADR-146 Add support for contributing representation metadata for transient representations

== Context

Expand Down
2 changes: 1 addition & 1 deletion doc/adrs/147_overlapping_nodes.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= [ADR-147] Add support for overlapping nodes
= ADR-147 Add support for overlapping nodes

== Context

Expand Down
2 changes: 1 addition & 1 deletion doc/adrs/148_improves_edge_layout.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= [ADR-148] Improve edge layout
= ADR-148 Improve edge layout

== Context

Expand Down
2 changes: 1 addition & 1 deletion doc/adrs/151_improve_diagram_subscription_lifecycle.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= [ADR-151] Improve Diagram Subscription Lifecycle
= ADR-151 Improve Diagram Subscription Lifecycle

== Context

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
= ADR-152 Add support for any kind of object as semantic element in the tree representation

== Context

Sirius Web doesn't provide in its Tree description API a way to retrieve the model element associated to a TreeItem.
At the moment Sirius Web Explorer relies on `IObjectSearchService.getObject()` to retrieve the object associated to a given TreeItem node using its `id`.
While it works, it is restricted to objects that have been considered as semantic elements by the server.

In order to extend the tree capabilities to handle any kind of object, we need to be able to extend this behavior.
For that, we will provide a mechanism to find an object associated to a TreeItem using its id.

== Decision

We will add a new field `Function<VariableManager, Object> treeItemObjectProvider` in `org.eclipse.sirius.components.trees.description.TreeDescription` and in its builder.
Existing usages of `org.eclipse.sirius.components.trees.description.TreeDescription` should be completed by providing a default object retrieval mechanism which can delegate its behavior to `IObjectSearchService.getObject()`.

`o.e.s.w.a.v.explorer.services.DeleteObjectTreeItemEventHandler` and `o.e.s.w.a.v.explorer.services.RenameObjectTreeItemEventHandler` should be updated, because they rely on the `IObjectSearchService.getObject()` service to retrieve the object before performing the deletion or renaming operations.
`o.e.s.w.a.v.explorer.services.ExplorerNavigationService` and `o.e.s.w.a.v.explorer.services.ExpandAllTreePathProvider` are also retrieving the object associated to a TreeItem using `IObjectSearchService.getObject()` service.

They should instead get the object by calling `treeItemObjectProvider` specified on the tree description of the Sirius Web Explorer in our case.

== Status

Work in progress

0 comments on commit 70a563e

Please sign in to comment.