Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbeaver/dbeaver-vscode#22 Support non-CB applications #3073

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open
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 @@ -20,6 +20,7 @@
import org.jkiss.dbeaver.model.app.DBPProject;
import org.jkiss.dbeaver.model.websocket.WSConstants;
import org.jkiss.dbeaver.model.websocket.event.WSEvent;
import org.jkiss.dbeaver.model.websocket.event.WSEventController;
import org.jkiss.dbeaver.model.websocket.event.datasource.WSDataSourceEvent;
import org.jkiss.dbeaver.model.websocket.event.datasource.WSDataSourceProperty;
import org.jkiss.dbeaver.model.websocket.event.datasource.WSDatasourceFolderEvent;
Expand Down Expand Up @@ -47,8 +48,12 @@
if (project == null) {
return;
}
WSEventController eventController = WebAppUtils.getWebApplication().getEventController();
if (eventController == null) {
return;
}
WSEvent event = null;
switch (eventAction) {

Check warning on line 56 in server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebEventUtils.java

View workflow job for this annotation

GitHub Actions / Server / Lint

[checkstyle] reported by reviewdog 🐶 switch without "default" clause. Raw Output: /github/workspace/./server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebEventUtils.java:56:9: warning: switch without "default" clause. (com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefaultCheck)
case CREATE:
event = WSDataSourceEvent.create(
session.getUserContext().getSmSessionId(),
Expand Down Expand Up @@ -80,10 +85,10 @@
if (event == null) {
return;
}
WebAppUtils.getWebApplication().getEventController().addEvent(event);
eventController.addEvent(event);
}

public static void addNavigatorNodeUpdatedEvent(

Check warning on line 91 in server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebEventUtils.java

View workflow job for this annotation

GitHub Actions / Server / Lint

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebEventUtils.java:91:5: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)
DBPProject project,
WebSession session,
String nodePath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@
import org.jkiss.dbeaver.model.DBPDataSourceContainer;
import org.jkiss.dbeaver.model.DBPObject;
import org.jkiss.dbeaver.model.access.DBAAuthCredentials;
import org.jkiss.dbeaver.model.app.DBPApplication;
import org.jkiss.dbeaver.model.app.DBPDataSourceRegistry;
import org.jkiss.dbeaver.model.app.DBPProject;
import org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration;
import org.jkiss.dbeaver.model.connection.DBPDriver;
import org.jkiss.dbeaver.model.impl.app.BaseApplicationImpl;
import org.jkiss.dbeaver.model.impl.auth.AuthModelDatabaseNativeCredentials;
import org.jkiss.dbeaver.model.navigator.DBNBrowseSettings;
import org.jkiss.dbeaver.model.navigator.DBNModel;
Expand Down Expand Up @@ -133,13 +135,16 @@
if (config.getFolder() != null) {
newDataSource.setFolder(registry.getFolder(config.getFolder()));
}
((DataSourceDescriptor)newDataSource).setTemplate(config.isTemplate());

Check warning on line 138 in server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/WebServiceUtils.java

View workflow job for this annotation

GitHub Actions / Server / Lint

[checkstyle] reported by reviewdog 🐶 'typecast' is not followed by whitespace. Raw Output: /github/workspace/./server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/WebServiceUtils.java:138:31: warning: 'typecast' is not followed by whitespace. (com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck)

// Set default navigator settings
DataSourceNavigatorSettings navSettings = new DataSourceNavigatorSettings(
CBApplication.getInstance().getAppConfiguration().getDefaultNavigatorSettings());
//navSettings.setShowSystemObjects(false);
((DataSourceDescriptor)newDataSource).setNavigatorSettings(navSettings);
DBPApplication application = BaseApplicationImpl.getInstance();
if (application instanceof CBApplication<?> cbApp) {
DataSourceNavigatorSettings navSettings = new DataSourceNavigatorSettings(
cbApp.getAppConfiguration().getDefaultNavigatorSettings());
//navSettings.setShowSystemObjects(false);
((DataSourceDescriptor) newDataSource).setNavigatorSettings(navSettings);
}

saveAuthProperties(
newDataSource,
Expand Down