Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
54 changes: 54 additions & 0 deletions java-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,60 @@
<version>${set-version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.eclipse.set</groupId>
<artifactId>org.eclipse.set.feature.integration</artifactId>
<version>${set-version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.eclipse.set</groupId>
<artifactId>org.eclipse.set.model.integrationview</artifactId>
<version>${set-version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.eclipse.set</groupId>
<artifactId>org.eclipse.set.model.integrationview.edit</artifactId>
<version>${set-version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.eclipse.set</groupId>
<artifactId>org.eclipse.set.model.simplemerge</artifactId>
<version>${set-version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.eclipse.set</groupId>
<artifactId>org.eclipse.set.model.simplemerge.edit</artifactId>
<version>${set-version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.eclipse.set</groupId>
<artifactId>org.eclipse.set.model.simplemerge.extensions</artifactId>
<version>${set-version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.eclipse.set</groupId>
<artifactId>org.eclipse.set.model.temporaryintegration</artifactId>
<version>${set-version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.eclipse.set</groupId>
<artifactId>org.eclipse.set.model.temporaryintegration.edit</artifactId>
<version>${set-version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.eclipse.set</groupId>
<artifactId>org.eclipse.set.model.temporaryintegration.extensions</artifactId>
<version>${set-version}</version>
<type>jar</type>
</dependency>
</dependencies>
<repositories>
<repository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@
*/
package org.eclipse.set.application.defaultvalue

import org.eclipse.core.runtime.Assert
import org.eclipse.set.core.services.defaultvalue.DefaultValueService
import org.eclipse.set.model.planpro.PlanPro.ENUMUntergewerkArt
import org.eclipse.set.model.planpro.PlanPro.PlanProFactory
import org.eclipse.set.model.planpro.PlanPro.PlanPro_Schnittstelle
import jakarta.inject.Inject
import org.eclipse.core.runtime.Assert
import org.eclipse.set.core.services.defaultvalue.DefaultValueService
import org.eclipse.set.core.services.version.PlanProVersionService
import org.eclipse.set.ppmodel.extensions.PlanProPackageExtensions

import static extension org.eclipse.set.ppmodel.extensions.PlanProSchnittstelleExtensions.*
import static extension org.eclipse.set.ppmodel.extensions.PlanungProjektExtensions.*
import static extension org.eclipse.set.ppmodel.extensions.PlanungEinzelExtensions.*
import static extension org.eclipse.set.ppmodel.extensions.PlanungProjektExtensions.*

/**
* Implementation of {@link DefaultValueService}.
Expand All @@ -27,9 +26,6 @@ import static extension org.eclipse.set.ppmodel.extensions.PlanungEinzelExtensio
*/
class DefaultValueServiceImpl implements DefaultValueService {

@Inject
PlanProVersionService versionService

override setDefaultValues(PlanPro_Schnittstelle planProSchnittstelle) {
Assert.isNotNull(planProSchnittstelle)

Expand Down Expand Up @@ -94,8 +90,7 @@ class DefaultValueServiceImpl implements DefaultValueService {
}

if (planungGAllg.planProXSDVersion.wert === null) {
val versionInfo = versionService.createSupportedVersion()
planungGAllg.planProXSDVersion.wert = versionInfo.planPro
planungGAllg.planProXSDVersion.wert = PlanProPackageExtensions.modelVersion
}

if (planungGAllg.untergewerkArt === null) {
Expand Down
3 changes: 3 additions & 0 deletions java/bundles/org.eclipse.set.basis/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ Import-Package: com.google.common.collect,
org.eclipse.jface.text.rules,
org.eclipse.jface.window,
org.eclipse.osgi.util,
org.eclipse.set.model.simplemerge,
org.eclipse.set.model.temporaryintegration,
org.eclipse.set.model.temporaryintegration.util,
org.eclipse.set.model.validationreport,
org.eclipse.set.model.zipmanifest,
org.eclipse.set.ppmodel.extensions.container,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.io.IOException;
import java.nio.file.Path;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
import java.util.function.Predicate;
Expand All @@ -27,6 +28,7 @@
import org.eclipse.set.basis.files.ToolboxFile;
import org.eclipse.set.model.planpro.Layoutinformationen.PlanPro_Layoutinfo;
import org.eclipse.set.model.planpro.PlanPro.PlanPro_Schnittstelle;
import org.eclipse.set.model.temporaryintegration.TemporaryIntegration;
import org.eclipse.set.ppmodel.extensions.container.MultiContainer_AttributeGroup;
import org.eclipse.swt.widgets.Shell;

Expand Down Expand Up @@ -332,4 +334,10 @@ enum SaveFixResult {
* @return the applied level of save fixes from the last save
*/
SaveFixResult getSaveFixResult();

Optional<TemporaryIntegration> getTemporaryIntegration();

void switchToMergeMode(TemporaryIntegration newTemporaryIntegration,
String mergeDir, Shell shell, ToolboxFile temporaryToolboxFile)
throws IOException, UserAbortion;
}
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ public interface CacheId {
*/
public static final String TOOLBOX_DIRECTORY_NAME_TEMPORARY_INTEGRATION = "tempintegrationfile";

/**
* The name for the temporary directory of a toolbox file used as a
* mergeplanning.
*/
public static final String TOOLBOX_DIRECTORY_NAME_MERGE_PLANNING = "mergeplanning";
/**
* The id of the validation part.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class PathExtensions {
}

static def String getBaseFileName(Path path) {
return path.fileName.toString.replaceFirst("\\.[^.]*$", "")
return path?.fileName?.toString?.replaceFirst("\\.[^.]*$", "")
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,5 +298,4 @@ public static interface Format {
* @param path
*/
void setResourcePath(Resource resource, Path path);

}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ public enum ToolboxFileRole {
/**
* The ToolboxFile is used as a temporary integration
*/
TEMPORARY_INTEGRATION,;
TEMPORARY_INTEGRATION,
/**
*
*/
MERGE_PLANNING;

/**
* Translates the role name into a directory name
Expand All @@ -70,6 +74,8 @@ public String toDirectoryName() {
case FIRST_PLANNING_TO_IMPORT -> ToolboxConstants.TOOLBOX_DIRECTORY_NAME_FIRST_PLANNING_TO_IMPORT;
case SECOND_PLANNING_TO_IMPORT -> ToolboxConstants.TOOLBOX_DIRECTORY_NAME_SECOND_PLANNING_TO_IMPORT;
case COMPARE_PLANNING -> ToolboxConstants.TOOLBOX_DIRECTORY_NAME_COMPARE_PLANNING;
case TEMPORARY_INTEGRATION -> ToolboxConstants.TOOLBOX_DIRECTORY_NAME_TEMPORARY_INTEGRATION;
case MERGE_PLANNING -> ToolboxConstants.TOOLBOX_DIRECTORY_NAME_MERGE_PLANNING;
default -> ToolboxConstants.TOOLBOX_DIRECTORY_NAME_SESSION;
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Import-Package: com.fasterxml.jackson.databind,
org.eclipse.set.basis.ui,
org.eclipse.set.basis.viewgroups,
org.eclipse.set.model.siteplan,
org.eclipse.set.model.temporaryintegration,
org.eclipse.set.model.validationreport,
org.eclipse.set.ppmodel.extensions.container,
org.locationtech.jts.geom;version="1.19.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.eclipse.set.basis.files.ToolboxFile.Format;
import org.eclipse.set.basis.files.ToolboxFileAC;
import org.eclipse.set.basis.files.ToolboxFileRole;
import org.eclipse.set.model.temporaryintegration.TemporaryIntegration;

/**
* This service can provide toolbox files.
Expand Down Expand Up @@ -93,4 +94,13 @@ ToolboxFile convertFormat(ToolboxFile toolboxFile, ToolboxFileRole role,
* @return the toolbox file for the path
*/
ToolboxFileAC loadAC(Path path, ToolboxFileRole role);

/**
* @param path
* @param tempDir
* @param tmpInt
* @return
*/
ToolboxFile createTemporaryToolboxFile(Path path, Path tempDir,
TemporaryIntegration tmpInt);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
19132
2 changes: 2 additions & 0 deletions java/bundles/org.eclipse.set.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ Import-Package: com.fasterxml.jackson.annotation,
org.eclipse.set.core.services.version,
org.eclipse.set.core.services.viewmodel,
org.eclipse.set.custom.extensions,
org.eclipse.set.model.temporaryintegration,
org.eclipse.set.model.temporaryintegration.util,
org.eclipse.set.model.validationreport,
org.eclipse.set.model.zipmanifest,
org.eclipse.set.ppmodel.extensions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,12 @@ public DocumentRoot getPlanProDocumentRoot() {
if (contents.isEmpty()) {
return null;
}
return (org.eclipse.set.model.planpro.PlanPro.DocumentRoot) contents
.getFirst();

if (contents
.getFirst() instanceof final org.eclipse.set.model.planpro.PlanPro.DocumentRoot documentRoot) {
return documentRoot;
}
return null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ import java.util.HashMap
import java.util.Map
import org.eclipse.emf.ecore.EObject
import org.eclipse.set.model.planpro.Basisobjekte.Ur_Objekt
import org.eclipse.set.model.planpro.Layoutinformationen.PlanPro_Layoutinfo
import org.eclipse.set.model.planpro.PlanPro.Ausgabe_Fachdaten
import org.eclipse.set.model.planpro.PlanPro.Container_AttributeGroup
import org.eclipse.set.model.planpro.PlanPro.PlanPro_Schnittstelle
import org.eclipse.set.core.fileservice.GuidCache.ContainerType
import org.eclipse.set.model.planpro.Layoutinformationen.PlanPro_Layoutinfo

/**
* Guid to Object cache for faster lookups
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright (c) 2026 DB InfraGO AG and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
*/
package org.eclipse.set.core.fileservice;

import org.eclipse.set.model.planpro.PlanPro.PlanPro_Schnittstelle;

/**
*
*/
public class IDReferenceUtils {

public static void retargetIDReferences(final PlanPro_Schnittstelle source,
final PlanPro_Schnittstelle target) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.eclipse.set.model.planpro.PlanPro.DocumentRoot;
import org.eclipse.set.model.planpro.PlanPro.PlanProFactory;
import org.eclipse.set.model.planpro.PlanPro.PlanPro_Schnittstelle;
import org.eclipse.set.model.temporaryintegration.TemporaryIntegration;
import org.eclipse.set.ppmodel.extensions.DocumentRootExtensions;
import org.eclipse.set.ppmodel.extensions.PlanProSchnittstelleExtensions;
import org.osgi.service.component.annotations.Component;
Expand Down Expand Up @@ -73,6 +74,7 @@ public ToolboxFile convertFormat(final ToolboxFile toolboxFile,
newToolboxFile = convertToZipped(role);
newPath = PathExtensions.replaceExtension(newPath,
ToolboxConstants.EXTENSION_PLANPRO);
newToolboxFile.setTemporaryDirectory(tempDir);
} else if (format.isPlain()) {
newToolboxFile = convertToPlain(role);
newPath = PathExtensions.replaceExtension(newPath,
Expand Down Expand Up @@ -150,6 +152,25 @@ public ToolboxFileAC loadAC(final Path path, final ToolboxFileRole role) {
return new ToolboxFileAC(load(path, role));
}

@Override
public ToolboxFile createTemporaryToolboxFile(final Path path,
final Path tmpDir, final TemporaryIntegration tmpInt) {
final Path mergeDirFileNameExtension = PathExtensions.replaceExtension(
path,
extensionsForCategory(
ToolboxConstants.EXTENSION_CATEGORY_PPMERGE)
.getFirst());

final ToolboxFile tmpToolboxfile = create(
SetFormat.createTemporaryIntegration(),
ToolboxFileRole.TEMPORARY_INTEGRATION);
tmpToolboxfile.setTemporaryDirectory(tmpDir);
tmpToolboxfile.setPath(mergeDirFileNameExtension);
tmpToolboxfile.getPlanProResource().getContents().add(tmpInt);

return tmpToolboxfile;
}

/**
* @param format
* the toolbox file format service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ private ToolboxIDResolver(final PlanPro_Layoutinfo model) {
* the model
*/
public static void resolveIDReferences(final PlanPro_Schnittstelle model) {
if (model == null) {
return;
}
resolveIDReferences(model, new ToolboxIDResolver(model));
}

Expand All @@ -58,6 +61,9 @@ public static void resolveIDReferences(final PlanPro_Schnittstelle model) {
* the model
*/
public static void resolveIDReferences(final PlanPro_Layoutinfo model) {
if (model == null) {
return;
}
resolveIDReferences(model, new ToolboxIDResolver(model));
}

Expand Down
Loading
Loading