Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
import org.eclipse.swt.widgets.Display;
import org.knime.core.node.NodeLogger;
import org.knime.gateway.api.service.GatewayException;
import org.knime.ui.java.util.ProgressReporter;
import org.knime.gateway.api.webui.entity.GatewayProblemDescriptionEnt;
import org.knime.gateway.api.webui.service.util.MutableServiceCallException;
import org.knime.gateway.api.webui.service.util.ServiceExceptions.LoggedOutException;
Expand All @@ -86,6 +85,7 @@
import org.knime.ui.java.profile.UserProfile;
import org.knime.ui.java.util.ExampleProjects;
import org.knime.ui.java.util.MostRecentlyUsedProjects;
import org.knime.ui.java.util.ProgressReporter;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down Expand Up @@ -268,7 +268,7 @@ private static Object invokeMethod(final Method m, final Object[] args) throws T
* @param progressReporter
* @throws IllegalStateException if the dependencies have been already injected
*/
@SuppressWarnings({"java:S107", "JavadocDeclaration", "javadoc"}) // Parameter count
@SuppressWarnings({"java:S107", "JavadocDeclaration"}) // Parameter count
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'javadoc' suppression was removed from the @SuppressWarnings annotation, but 'JavadocDeclaration' was kept. These suppressions serve similar purposes, so verify that 'JavadocDeclaration' is the correct and sufficient suppression for this context.

Suggested change
@SuppressWarnings({"java:S107", "JavadocDeclaration"}) // Parameter count
@SuppressWarnings("java:S107") // Parameter count

Copilot uses AI. Check for mistakes.
public static void injectDependencies( //
final ProjectManager projectManager, //
final WorkflowMiddleware workflowMiddleware, //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import org.knime.core.node.workflow.contextv2.HubSpaceLocationInfo;
import org.knime.core.util.Pair;
import org.knime.core.util.hub.NamedItemVersion;
import org.knime.ui.java.util.ProgressReporter;
import org.knime.gateway.api.util.VersionId;
import org.knime.gateway.api.webui.entity.SpaceItemReferenceEnt.ProjectTypeEnum;
import org.knime.gateway.api.webui.entity.SpaceItemVersionEnt;
Expand All @@ -75,6 +74,7 @@
import org.knime.ui.java.util.CreateProject;
import org.knime.ui.java.util.DesktopAPUtil;
import org.knime.ui.java.util.MostRecentlyUsedProjects;
import org.knime.ui.java.util.ProgressReporter;
import org.knime.workbench.core.imports.RepoObjectImport;

/**
Expand Down Expand Up @@ -136,7 +136,8 @@ static void openProject(final String spaceId, final String itemId, final String
project = optProject.get();
} else {
final var origin = new Origin(spaceProviderId, spaceId, itemId, projectType);
project = CreateProject.createProjectFromOrigin(origin, DesktopAPI.getDeps(ProgressReporter.class), space);
final var progressReporter = DesktopAPI.getDeps(ProgressReporter.class);
project = CreateProject.createProjectFromOrigin(origin, progressReporter, space);
}

// already trigger loading of wfm here because we want to abort and not register the project if this fails
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ private static boolean isExecutionInProgress(final WorkflowManager wfm) {
return state.isExecutionInProgress() || state.isExecutingRemotely();
}

/**
* Starts a separate thread to show a progress bar while saving the project. This is a blocking operation since we
* wait for the saving to finish and block the UI thread in the meantime.
*/
private static Boolean saveProjectWithProgressBar(final WorkflowManager wfm, final boolean localOnly,
final boolean allowOverwritePrompt) {
var wasSaveSuccessful = new AtomicBoolean();
Expand Down Expand Up @@ -277,6 +281,9 @@ private static boolean saveBackToServerOrHub(final IProgressMonitor rootMonitor,
}
}

/**
* Checks whether an upload to Hub can proceed, possibly prompting the user about overwriting existing items.
*/
private static boolean checkHubUpload(final String mountId, final HubSpaceLocationInfo hubInfo,
final Space hubSpace, final boolean allowOverwritePrompt) throws GatewayException {

Expand Down Expand Up @@ -307,6 +314,9 @@ private static boolean hubItemExists(final HubSpaceLocationInfo hubInfo, final S
}
}

/**
* Checks whether an upload to Server can proceed, possibly prompting the user about overwriting existing items.
*/
private static boolean checkServerUpload(final URI mountpointUri) {
final var remoteStore = (RemoteExplorerFileStore)ExplorerMountTable.getFileSystem().getStore(mountpointUri);
final var fetchedInfo = remoteStore.fetchInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ static LifeCycleStateInternal run(final LifeCycleStateInternal state, final bool
state.getWelcomeApEndpoint(), //
createExampleProjects(), //
state.getUserProfile(), //
progressReporter //
);
progressReporter);

// Register listeners
var softwareUpdateProgressListener = registerSoftwareUpdateProgressListener(eventConsumer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,7 @@ public static Project createProjectFromOrigin(final Origin origin, final Progres
return createProjectFromOrigin(projectId, name, origin, progressReporter, space);
}

/**
* Create a {@link Project} instance that corresponds to an {@link Origin}, i.e. an item in a {@link Space}.
*
* @param projectId -
* @param name -
* @param origin -
* @param progressReporter -
* @param space -
* @return -
*/
public static Project createProjectFromOrigin(final String projectId, final String name, final Origin origin,
private static Project createProjectFromOrigin(final String projectId, final String name, final Origin origin,
final ProgressReporter progressReporter, final Space space) {
return Project.builder() //
.setWfmLoader(fromOriginWithProgressReporter(origin, progressReporter, space)) //
Expand Down
Loading