From 4b9e1c8b9411c1d20cae53987ee3e7405d55d3ac Mon Sep 17 00:00:00 2001 From: Serge Rider Date: Tue, 24 Sep 2024 16:37:09 +0200 Subject: [PATCH] dbeaver/pro#3345 vfs refactoring (#2928) * dbeaver/pro#3345 Navigator model refactoring * dbeaver/pro#3345 Navigator model refactoring * dbeaver/pro#3345 Get rid of org.eclipse.core.resources * dbeaver/pro#3345 SQL dialect model refactoring --------- Co-authored-by: kseniaguzeeva <112612526+kseniaguzeeva@users.noreply.github.com> --- server/bundles/io.cloudbeaver.model/META-INF/MANIFEST.MF | 1 - .../cloudbeaver/model/rm/DBNResourceManagerProject.java | 6 +++--- .../cloudbeaver/model/rm/DBNResourceManagerResource.java | 6 +++--- .../src/io/cloudbeaver/server/WebPlatformActivator.java | 9 --------- .../service/sql/WebSQLQueryDataContainer.java | 2 +- .../features/io.cloudbeaver.server.feature/feature.xml | 1 - server/features/io.cloudbeaver.ws.feature/feature.xml | 1 - 7 files changed, 7 insertions(+), 19 deletions(-) diff --git a/server/bundles/io.cloudbeaver.model/META-INF/MANIFEST.MF b/server/bundles/io.cloudbeaver.model/META-INF/MANIFEST.MF index 8cd9ac3ac9..ffbd8b2f05 100644 --- a/server/bundles/io.cloudbeaver.model/META-INF/MANIFEST.MF +++ b/server/bundles/io.cloudbeaver.model/META-INF/MANIFEST.MF @@ -10,7 +10,6 @@ Bundle-ActivationPolicy: lazy Bundle-ClassPath: . Require-Bundle: org.jkiss.dbeaver.data.gis;visibility:=reexport, org.jkiss.dbeaver.model;visibility:=reexport, - org.jkiss.dbeaver.model.rcp;visibility:=reexport, org.jkiss.dbeaver.model.sm;visibility:=reexport, org.jkiss.dbeaver.model.event;visibility:=reexport, org.jkiss.dbeaver.model.nio;visibility:=reexport, diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerProject.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerProject.java index 7500c25460..d934abf113 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerProject.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerProject.java @@ -121,9 +121,9 @@ public DBNNode refreshNode(DBRProgressMonitor monitor, Object source) throws DBE return this; } - @NotNull + @Nullable @Override - public DBPProject getOwnerProject() { + public DBPProject getOwnerProjectOrNull() { List globalProjects = getModel().getModelProjects(); if (globalProjects != null) { for (DBPProject modelProject : globalProjects) { @@ -132,7 +132,7 @@ public DBPProject getOwnerProject() { } } } - throw new IllegalStateException("Project '" + project.getId() + "' not found in workspace"); + return null; } @Nullable diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerResource.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerResource.java index 0fdc50e6e4..4e2cfbc76f 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerResource.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerResource.java @@ -203,10 +203,10 @@ public DBPObject getObjectDetails(@NotNull DBRProgressMonitor monitor, @NotNull return resource; } - @NotNull + @Nullable @Override - public DBPProject getOwnerProject() { - return getParentNode().getOwnerProject(); + public DBPProject getOwnerProjectOrNull() { + return getParentNode().getOwnerProjectOrNull(); } public RMResource getResource() { diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/server/WebPlatformActivator.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/server/WebPlatformActivator.java index 8234bf2122..94652dd478 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/server/WebPlatformActivator.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/server/WebPlatformActivator.java @@ -16,8 +16,6 @@ */ package io.cloudbeaver.server; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.Plugin; import org.jkiss.dbeaver.ModelPreferences; import org.jkiss.dbeaver.model.impl.preferences.BundlePreferenceStore; @@ -76,13 +74,6 @@ public DBPPreferenceStore getPreferences() { return preferences; } - /** - * Returns the workspace instance. - */ - public static IWorkspace getWorkspace() { - return ResourcesPlugin.getWorkspace(); - } - protected void shutdownPlatform() { } diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLQueryDataContainer.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLQueryDataContainer.java index b8ab7b7af7..1529bbde64 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLQueryDataContainer.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLQueryDataContainer.java @@ -26,11 +26,11 @@ import org.jkiss.dbeaver.model.data.DBDDataFilter; import org.jkiss.dbeaver.model.data.DBDDataReceiver; import org.jkiss.dbeaver.model.exec.*; -import org.jkiss.dbeaver.model.impl.sql.SQLQueryTransformerCount; import org.jkiss.dbeaver.model.sql.SQLQuery; import org.jkiss.dbeaver.model.sql.SQLScriptContext; import org.jkiss.dbeaver.model.sql.SQLSyntaxManager; import org.jkiss.dbeaver.model.sql.data.SQLQueryDataContainer; +import org.jkiss.dbeaver.model.sql.transformers.SQLQueryTransformerCount; import org.jkiss.dbeaver.model.struct.DBSDataContainer; import org.jkiss.dbeaver.model.struct.DBSObject; diff --git a/server/features/io.cloudbeaver.server.feature/feature.xml b/server/features/io.cloudbeaver.server.feature/feature.xml index 159f75d39a..11b1ce71a5 100644 --- a/server/features/io.cloudbeaver.server.feature/feature.xml +++ b/server/features/io.cloudbeaver.server.feature/feature.xml @@ -15,7 +15,6 @@ - diff --git a/server/features/io.cloudbeaver.ws.feature/feature.xml b/server/features/io.cloudbeaver.ws.feature/feature.xml index 714ab2baf7..1ec14c6843 100644 --- a/server/features/io.cloudbeaver.ws.feature/feature.xml +++ b/server/features/io.cloudbeaver.ws.feature/feature.xml @@ -15,7 +15,6 @@ -