Skip to content

Commit

Permalink
dbeaver/dbeaver-vscode#19 map custom folder as project in vc code pro…
Browse files Browse the repository at this point in the history
…duct (#2963)

Co-authored-by: mr-anton-t <[email protected]>
  • Loading branch information
alexander-skoblikov and mr-anton-t authored Oct 8, 2024
1 parent 9103b28 commit 8c30761
Show file tree
Hide file tree
Showing 10 changed files with 411 additions and 272 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.jkiss.dbeaver.model.rm.RMController;
import org.jkiss.dbeaver.model.rm.RMControllerProvider;
import org.jkiss.dbeaver.model.rm.RMProject;
import org.jkiss.dbeaver.model.rm.RMUtils;
import org.jkiss.utils.CommonUtils;
import org.jkiss.utils.Pair;

Expand All @@ -44,11 +43,12 @@ public BaseWebProjectImpl(
@NotNull DBPWorkspace workspace,
@NotNull RMController resourceController,
@NotNull SMSessionContext sessionContext,
@NotNull RMProject project
@NotNull RMProject project,
@NotNull Path path
) {
super(workspace, sessionContext);
this.resourceController = resourceController;
this.path = RMUtils.getProjectPath(project);
this.path = path;
this.project = project;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.cloudbeaver.model.session.WebHeadlessSession;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.model.rm.RMProject;
import org.jkiss.dbeaver.model.rm.RMUtils;

public class WebHeadlessSessionProjectImpl extends WebProjectImpl {
public WebHeadlessSessionProjectImpl(
Expand All @@ -30,7 +31,8 @@ public WebHeadlessSessionProjectImpl(
session.getUserContext().getRmController(),
session.getSessionContext(),
project,
session.getUserContext().getPreferenceStore()
session.getUserContext().getPreferenceStore(),
RMUtils.getProjectPath(project)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,22 @@
import org.jkiss.dbeaver.registry.rm.DataSourceRegistryRM;
import org.jkiss.dbeaver.runtime.DBWorkbench;

import java.nio.file.Path;

public abstract class WebProjectImpl extends BaseWebProjectImpl {
private static final Log log = Log.getLog(WebProjectImpl.class);
@NotNull
protected final DBPPreferenceStore preferenceStore;

public WebProjectImpl(
@NotNull DBPWorkspace workspace,
@NotNull RMController resourceController,
@NotNull SMSessionContext sessionContext,
@NotNull RMProject project,
@NotNull DBPPreferenceStore preferenceStore
@NotNull DBPPreferenceStore preferenceStore,
@NotNull Path path
) {
super(workspace, resourceController, sessionContext, project);
super(workspace, resourceController, sessionContext, project, path);
this.preferenceStore = preferenceStore;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
import org.jkiss.dbeaver.model.app.DBPDataSourceRegistryCache;
import org.jkiss.dbeaver.model.navigator.DBNModel;
import org.jkiss.dbeaver.model.rm.RMProject;
import org.jkiss.dbeaver.model.rm.RMUtils;
import org.jkiss.dbeaver.model.websocket.event.WSEventType;
import org.jkiss.dbeaver.registry.DataSourceDescriptor;
import org.jkiss.dbeaver.runtime.jobs.DisconnectJob;

import java.nio.file.Path;
import java.util.*;
import java.util.stream.Collectors;

Expand All @@ -49,7 +51,24 @@ public WebSessionProjectImpl(
webSession.getRmController(),
webSession.getSessionContext(),
project,
webSession.getUserPreferenceStore()
webSession.getUserPreferenceStore(),
RMUtils.getProjectPath(project)
);
this.webSession = webSession;
}

public WebSessionProjectImpl(
@NotNull WebSession webSession,
@NotNull RMProject project,
@NotNull Path path
) {
super(
webSession.getWorkspace(),
webSession.getRmController(),
webSession.getSessionContext(),
project,
webSession.getUserPreferenceStore(),
path
);
this.webSession = webSession;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.cloudbeaver.model.app;

import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;

import java.util.Map;

Expand All @@ -28,6 +29,7 @@ public interface WebAppConfiguration {

boolean isAnonymousAccessEnabled();

@Nullable
<T> T getResourceQuota(String quotaId);

String getDefaultUserTeam();
Expand Down
Loading

0 comments on commit 8c30761

Please sign in to comment.