Skip to content

Commit 87fbb4b

Browse files
committed
[releng] Switch to Sirius Web 2025.8.5
Signed-off-by: Axel RICHARD <axel.richard@obeo.fr>
1 parent 946351d commit 87fbb4b

35 files changed

Lines changed: 513 additions & 319 deletions

File tree

CHANGELOG.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Any `Namespace` stored in those libraries are now cached for quick access.
5252

5353
=== Dependency update
5454

55-
- [releng] Update to https://github.com/eclipse-sirius/sirius-web[Sirius Web 2025.8.4]
55+
- [releng] Update to https://github.com/eclipse-sirius/sirius-web[Sirius Web 2025.8.5]
5656
- [releng] Update to https://github.com/spring-projects/spring-boot/releases/tag/v3.5.5[Spring Boot 3.5.5]
5757
- [releng] Update to vite 7.1.1 and @vitejs/plugin-react 5.0.0
5858
- [releng] Update to vitest 3.2.4 and @vitest/coverage-v8 3.2.4

backend/application/syson-application-configuration/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
<properties>
3131
<java.version>17</java.version>
32-
<sirius.web.version>2025.8.4</sirius.web.version>
32+
<sirius.web.version>2025.8.5</sirius.web.version>
3333
</properties>
3434

3535
<repositories>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 Obeo.
3+
* This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v2.0
5+
* which accompanies this distribution, and is available at
6+
* https://www.eclipse.org/legal/epl-2.0/
7+
*
8+
* SPDX-License-Identifier: EPL-2.0
9+
*
10+
* Contributors:
11+
* Obeo - initial API and implementation
12+
*******************************************************************************/
13+
package org.eclipse.syson.application.nodes;
14+
15+
import com.fasterxml.jackson.core.JsonProcessingException;
16+
import com.fasterxml.jackson.databind.ObjectMapper;
17+
18+
import org.eclipse.sirius.components.collaborative.diagrams.api.ICustomNodeStyleDeserializer;
19+
import org.eclipse.sirius.components.diagrams.INodeStyle;
20+
import org.springframework.stereotype.Service;
21+
22+
/**
23+
* Use to correctly deserialize custom node style.
24+
*
25+
* @author arichard
26+
*/
27+
@Service
28+
public class SysMLImportedPackageNodeStyleDeserializer implements ICustomNodeStyleDeserializer {
29+
30+
@Override
31+
public boolean canHandle(String type) {
32+
return type.equals(SysMLImportedPackageNodeStyleProvider.NODE_SYSML_IMPORTED_PACKAGE);
33+
}
34+
35+
@Override
36+
public INodeStyle handle(ObjectMapper mapper, String root) throws JsonProcessingException {
37+
return mapper.readValue(root, SysMLImportedPackageNodeStyle.class);
38+
}
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 Obeo.
3+
* This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v2.0
5+
* which accompanies this distribution, and is available at
6+
* https://www.eclipse.org/legal/epl-2.0/
7+
*
8+
* SPDX-License-Identifier: EPL-2.0
9+
*
10+
* Contributors:
11+
* Obeo - initial API and implementation
12+
*******************************************************************************/
13+
package org.eclipse.syson.application.nodes;
14+
15+
import com.fasterxml.jackson.core.JsonProcessingException;
16+
import com.fasterxml.jackson.databind.ObjectMapper;
17+
18+
import org.eclipse.sirius.components.collaborative.diagrams.api.ICustomNodeStyleDeserializer;
19+
import org.eclipse.sirius.components.diagrams.INodeStyle;
20+
import org.springframework.stereotype.Service;
21+
22+
/**
23+
* Use to correctly deserialize custom node style.
24+
*
25+
* @author arichard
26+
*/
27+
@Service
28+
public class SysMLNoteNodeStyleDeserializer implements ICustomNodeStyleDeserializer {
29+
30+
@Override
31+
public boolean canHandle(String type) {
32+
return type.equals(SysMLNoteNodeStyleProvider.NODE_SYSML_NOTE);
33+
}
34+
35+
@Override
36+
public INodeStyle handle(ObjectMapper mapper, String root) throws JsonProcessingException {
37+
return mapper.readValue(root, SysMLNoteNodeStyle.class);
38+
}
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 Obeo.
3+
* This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v2.0
5+
* which accompanies this distribution, and is available at
6+
* https://www.eclipse.org/legal/epl-2.0/
7+
*
8+
* SPDX-License-Identifier: EPL-2.0
9+
*
10+
* Contributors:
11+
* Obeo - initial API and implementation
12+
*******************************************************************************/
13+
package org.eclipse.syson.application.nodes;
14+
15+
import com.fasterxml.jackson.core.JsonProcessingException;
16+
import com.fasterxml.jackson.databind.ObjectMapper;
17+
18+
import org.eclipse.sirius.components.collaborative.diagrams.api.ICustomNodeStyleDeserializer;
19+
import org.eclipse.sirius.components.diagrams.INodeStyle;
20+
import org.springframework.stereotype.Service;
21+
22+
/**
23+
* Use to correctly deserialize custom node style.
24+
*
25+
* @author arichard
26+
*/
27+
@Service
28+
public class SysMLPackageNodeStyleDeserializer implements ICustomNodeStyleDeserializer {
29+
30+
@Override
31+
public boolean canHandle(String type) {
32+
return type.equals(SysMLPackageNodeStyleProvider.NODE_SYSML_PACKAGE);
33+
}
34+
35+
@Override
36+
public INodeStyle handle(ObjectMapper mapper, String root) throws JsonProcessingException {
37+
return mapper.readValue(root, SysMLPackageNodeStyle.class);
38+
}
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 Obeo.
3+
* This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v2.0
5+
* which accompanies this distribution, and is available at
6+
* https://www.eclipse.org/legal/epl-2.0/
7+
*
8+
* SPDX-License-Identifier: EPL-2.0
9+
*
10+
* Contributors:
11+
* Obeo - initial API and implementation
12+
*******************************************************************************/
13+
package org.eclipse.syson.application.nodes;
14+
15+
import com.fasterxml.jackson.core.JsonProcessingException;
16+
import com.fasterxml.jackson.databind.ObjectMapper;
17+
18+
import org.eclipse.sirius.components.collaborative.diagrams.api.ICustomNodeStyleDeserializer;
19+
import org.eclipse.sirius.components.diagrams.INodeStyle;
20+
import org.springframework.stereotype.Service;
21+
22+
/**
23+
* Use to correctly deserialize custom node style.
24+
*
25+
* @author arichard
26+
*/
27+
@Service
28+
public class SysMLViewFrameNodeStyleDeserializer implements ICustomNodeStyleDeserializer {
29+
30+
@Override
31+
public boolean canHandle(String type) {
32+
return type.equals(SysMLViewFrameNodeStyleProvider.NODE_SYSML_VIEW_FRAME);
33+
}
34+
35+
@Override
36+
public INodeStyle handle(ObjectMapper mapper, String root) throws JsonProcessingException {
37+
return mapper.readValue(root, SysMLViewFrameNodeStyle.class);
38+
}
39+
}

backend/application/syson-application-configuration/src/main/java/org/eclipse/syson/application/services/SysMLv2EditService.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import org.eclipse.emf.ecore.EClass;
2424
import org.eclipse.emf.ecore.EObject;
25+
import org.eclipse.emf.ecore.EPackage;
2526
import org.eclipse.emf.ecore.util.EcoreUtil;
2627
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
2728
import org.eclipse.sirius.components.collaborative.api.IRepresentationMetadataPersistenceService;
@@ -33,12 +34,12 @@
3334
import org.eclipse.sirius.components.core.api.IEditServiceDelegate;
3435
import org.eclipse.sirius.components.core.api.IEditingContext;
3536
import org.eclipse.sirius.components.core.api.ILabelService;
37+
import org.eclipse.sirius.components.core.api.IObjectSearchService;
3638
import org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService;
3739
import org.eclipse.sirius.components.core.api.labels.StyledString;
3840
import org.eclipse.sirius.components.diagrams.Diagram;
3941
import org.eclipse.sirius.components.diagrams.description.DiagramDescription;
4042
import org.eclipse.sirius.components.emf.services.api.IEMFEditingContext;
41-
import org.eclipse.sirius.components.emf.services.api.IEMFKindService;
4243
import org.eclipse.sirius.components.representations.VariableManager;
4344
import org.eclipse.syson.services.DeleteService;
4445
import org.eclipse.syson.services.ElementInitializerSwitch;
@@ -69,7 +70,7 @@ public class SysMLv2EditService implements IEditServiceDelegate {
6970

7071
private final ILabelService labelService;
7172

72-
private final IEMFKindService emfKindService;
73+
private final IObjectSearchService objectSearchService;
7374

7475
private final IDiagramCreationService diagramCreationService;
7576

@@ -83,12 +84,12 @@ public class SysMLv2EditService implements IEditServiceDelegate {
8384

8485
private final UtilService utilService;
8586

86-
public SysMLv2EditService(IDefaultEditService defaultEditService, ILabelService labelService, IEMFKindService emfKindService, IDiagramCreationService diagramCreationService,
87+
public SysMLv2EditService(IDefaultEditService defaultEditService, ILabelService labelService, IObjectSearchService objectSearchService, IDiagramCreationService diagramCreationService,
8788
IRepresentationDescriptionSearchService representationDescriptionSearchService, IRepresentationMetadataPersistenceService representationMetadataPersistenceService,
8889
IRepresentationPersistenceService representationPersistenceService) {
8990
this.defaultEditService = Objects.requireNonNull(defaultEditService);
9091
this.labelService = Objects.requireNonNull(labelService);
91-
this.emfKindService = Objects.requireNonNull(emfKindService);
92+
this.objectSearchService = Objects.requireNonNull(objectSearchService);
9293
this.diagramCreationService = Objects.requireNonNull(diagramCreationService);
9394
this.representationDescriptionSearchService = Objects.requireNonNull(representationDescriptionSearchService);
9495
this.representationMetadataPersistenceService = Objects.requireNonNull(representationMetadataPersistenceService);
@@ -140,15 +141,20 @@ public List<ChildCreationDescription> getRootCreationDescriptions(IEditingContex
140141
}
141142

142143
@Override
143-
public List<ChildCreationDescription> getChildCreationDescriptions(IEditingContext editingContext, String kind, String referenceKind) {
144-
List<ChildCreationDescription> result;
145-
String ePackageName = this.emfKindService.getEPackageName(kind);
146-
if (SysmlPackage.eNS_PREFIX.equals(ePackageName)) {
147-
List<ChildCreationDescription> childCreationDescriptions = new ArrayList<>();
148-
String eClassName = this.emfKindService.getEClassName(kind);
149-
Optional<EClass> eClass = this.getEClass(eClassName);
150-
if (eClass.isPresent()) {
151-
List<EClass> childrenCandidates = new GetChildCreationSwitch().doSwitch(eClass.get());
144+
public List<ChildCreationDescription> getChildCreationDescriptions(IEditingContext editingContext, String containerId, String referenceKind) {
145+
List<ChildCreationDescription> result = new ArrayList<>();
146+
147+
var optionalContainer = this.objectSearchService.getObject(editingContext, containerId)
148+
.filter(EObject.class::isInstance)
149+
.map(EObject.class::cast);
150+
151+
if (optionalContainer.isPresent()) {
152+
EObject container = optionalContainer.get();
153+
EClass eClass = container.eClass();
154+
EPackage ePackage = eClass.getEPackage();
155+
if (SysmlPackage.eNS_PREFIX.equals(ePackage.getNsPrefix())) {
156+
List<ChildCreationDescription> childCreationDescriptions = new ArrayList<>();
157+
List<EClass> childrenCandidates = new GetChildCreationSwitch().doSwitch(eClass);
152158
childrenCandidates.forEach(candidate -> {
153159
List<String> iconURL = this.labelService.getImagePaths(EcoreUtil.create(candidate));
154160
StyledString styledLabel = this.labelService.getStyledLabel(candidate);
@@ -159,10 +165,10 @@ public List<ChildCreationDescription> getChildCreationDescriptions(IEditingConte
159165
ChildCreationDescription childCreationDescription = new ChildCreationDescription(ID_PREFIX + candidate.getName(), label, iconURL);
160166
childCreationDescriptions.add(childCreationDescription);
161167
});
168+
result = childCreationDescriptions;
169+
} else {
170+
result = this.defaultEditService.getChildCreationDescriptions(editingContext, containerId, referenceKind);
162171
}
163-
result = childCreationDescriptions;
164-
} else {
165-
result = this.defaultEditService.getChildCreationDescriptions(editingContext, kind, referenceKind);
166172
}
167173
Collections.sort(result, Comparator.comparing(ChildCreationDescription::label, String.CASE_INSENSITIVE_ORDER));
168174
return result;
@@ -240,12 +246,6 @@ public void delete(Object object) {
240246
optionalElement.ifPresent(element -> this.deleteService.deleteFromModel(element));
241247
}
242248

243-
private Optional<EClass> getEClass(String eClassName) {
244-
return Optional.ofNullable(SysmlPackage.eINSTANCE.getEClassifier(eClassName))
245-
.filter(EClass.class::isInstance)
246-
.map(EClass.class::cast);
247-
}
248-
249249
/**
250250
* Create a General View diagram and associate it to the given ViewUsage.
251251
*/

backend/application/syson-application/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
<properties>
3131
<java.version>17</java.version>
32-
<sirius.web.version>2025.8.4</sirius.web.version>
32+
<sirius.web.version>2025.8.5</sirius.web.version>
3333
</properties>
3434

3535
<repositories>

backend/application/syson-application/src/test/java/org/eclipse/syson/application/controllers/diagrams/general/view/GVBindingConnectorAsUsageTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ private AtomicReference<String> reconnect(String edgeId, String newTarget, Recon
269269
.hasSourceArrow(ArrowStyle.None)
270270
.hasTargetArrow(ArrowStyle.None);
271271
assertThat(newEdge)
272-
.extracting(e -> e.getCenterLabel().getText()).isEqualTo("=");
272+
.extracting(e -> e.getCenterLabel().text()).isEqualTo("=");
273273
};
274274

275275
this.diagramCheckerService.checkDiagram(diagramCheckerTarget, this.diagram, this.verifier);
@@ -302,7 +302,7 @@ private AtomicReference<String> createEdge(String sourceName, String targetName,
302302
.hasSourceArrow(ArrowStyle.None)
303303
.hasTargetArrow(ArrowStyle.None);
304304
assertThat(newEdges).hasSize(1).first(EDGE)
305-
.extracting(e -> e.getCenterLabel().getText()).isEqualTo("=");
305+
.extracting(e -> e.getCenterLabel().text()).isEqualTo("=");
306306
result.set(newEdges.get(0).getTargetObjectId());
307307
};
308308

backend/application/syson-application/src/test/java/org/eclipse/syson/application/controllers/diagrams/general/view/GVIncludeUseCaseUsageTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public void checkIncludeUsageActionCreation() {
165165
assertThat(newEdge).hasSourceId(IncludeUseCaseUsageProjectData.GraphicalIds.INCLUDING_USE_CASE_ID);
166166
assertThat(newEdge).hasTargetId(IncludeUseCaseUsageProjectData.GraphicalIds.INCLUDED_USE_CASE_2_ID);
167167
assertThat(newEdge.getStyle()).hasTargetArrow(ArrowStyle.InputFillClosedArrow);
168-
assertThat(newEdge.getCenterLabel().getText()).isEqualTo(LabelConstants.OPEN_QUOTE + "include" + LabelConstants.CLOSE_QUOTE);
168+
assertThat(newEdge.getCenterLabel().text()).isEqualTo(LabelConstants.OPEN_QUOTE + "include" + LabelConstants.CLOSE_QUOTE);
169169
};
170170

171171
this.diagramCheckerService.checkDiagram(diagramChecker, this.diagram, this.verifier);

0 commit comments

Comments
 (0)