Skip to content

Commit

Permalink
Merge branch 'devel' into CB-5340-unit-tests-for-basic-core-blocks-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Wroud authored Aug 7, 2024
2 parents f26ac1b + babb29f commit 56b36c7
Show file tree
Hide file tree
Showing 137 changed files with 2,296 additions and 1,507 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ You can see live demo of CloudBeaver here: https://demo.cloudbeaver.io

## Changelog

### 24.1.4. 2024-08-05
- Redesigned administration navigation panel - now it is more compact and clear;
- Added the ability to close editor tabs with the middle mouse button;
- Improved display of the long error messages in the SQL Editor and Log viewer;
- SQL Editor auto-completion was enhanced to get column, table, and function names faster.

### 24.1.3. 2024-07-22
- Data Editor:
- Enhanced IPv6 and DateTime32 data representation for Clickhouse;
Expand Down
4 changes: 2 additions & 2 deletions server/bundles/io.cloudbeaver.model/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
Bundle-Vendor: DBeaver Corp
Bundle-Name: Cloudbeaver Web Model
Bundle-SymbolicName: io.cloudbeaver.model;singleton:=true
Bundle-Version: 1.0.58.qualifier
Bundle-Release-Date: 20240805
Bundle-Version: 1.0.59.qualifier
Bundle-Release-Date: 20240819
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Expand Down
2 changes: 1 addition & 1 deletion server/bundles/io.cloudbeaver.model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<relativePath>../</relativePath>
</parent>
<artifactId>io.cloudbeaver.model</artifactId>
<version>1.0.58-SNAPSHOT</version>
<version>1.0.59-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import io.cloudbeaver.model.app.WebAppConfiguration;
import io.cloudbeaver.model.app.WebApplication;
import io.cloudbeaver.model.app.WebServerConfiguration;
import io.cloudbeaver.model.session.WebSession;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
Expand All @@ -31,6 +32,7 @@ public interface DBWServiceServerConfigurator extends DBWServiceBinding {
void configureServer(
@NotNull WebApplication application,
@Nullable WebSession session,
@NotNull WebServerConfiguration serverConfiguration,
@NotNull WebAppConfiguration appConfig
) throws DBException;

Expand Down
4 changes: 2 additions & 2 deletions server/bundles/io.cloudbeaver.product.ce/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
Bundle-Vendor: DBeaver Corp
Bundle-Name: Cloudbeaver Community Product
Bundle-SymbolicName: io.cloudbeaver.product.ce;singleton:=true
Bundle-Version: 24.1.4.qualifier
Bundle-Release-Date: 20240805
Bundle-Version: 24.1.5.qualifier
Bundle-Release-Date: 20240819
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Expand Down
2 changes: 1 addition & 1 deletion server/bundles/io.cloudbeaver.product.ce/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<relativePath>../</relativePath>
</parent>
<artifactId>io.cloudbeaver.product.ce</artifactId>
<version>24.1.4-SNAPSHOT</version>
<version>24.1.5-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Base JDBC drivers
Bundle-SymbolicName: io.cloudbeaver.resources.drivers.base;singleton:=true
Bundle-Version: 1.0.103.qualifier
Bundle-Release-Date: 20240805
Bundle-Version: 1.0.104.qualifier
Bundle-Release-Date: 20240819
Bundle-Vendor: DBeaver Corp
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: io.cloudbeaver.resources.drivers.base
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<relativePath>../</relativePath>
</parent>
<artifactId>io.cloudbeaver.resources.drivers.base</artifactId>
<version>1.0.103-SNAPSHOT</version>
<version>1.0.104-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
4 changes: 2 additions & 2 deletions server/bundles/io.cloudbeaver.server/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
Bundle-Vendor: DBeaver Corp
Bundle-Name: Cloudbeaver Web Server
Bundle-SymbolicName: io.cloudbeaver.server;singleton:=true
Bundle-Version: 24.1.4.qualifier
Bundle-Release-Date: 20240805
Bundle-Version: 24.1.5.qualifier
Bundle-Release-Date: 20240819
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Bundle-Activator: io.cloudbeaver.server.CBPlatformActivator
Expand Down
2 changes: 1 addition & 1 deletion server/bundles/io.cloudbeaver.server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<relativePath>../</relativePath>
</parent>
<artifactId>io.cloudbeaver.server</artifactId>
<version>24.1.4-SNAPSHOT</version>
<version>24.1.5-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,16 @@ protected void performAutoConfiguration(File configPath) {
log.info("No auto configuration was found. Server must be configured manually");
return;
}
CBServerConfig serverConfig = new CBServerConfig();
serverConfig.setServerName(autoServerName);
serverConfig.setServerURL(autoServerURL);
serverConfig.setMaxSessionIdleTime(getMaxSessionIdleTime());
try {
finishConfiguration(
autoServerName,
autoServerURL,
autoAdminName,
autoAdminPassword,
Collections.emptyList(),
getMaxSessionIdleTime(),
serverConfig,
getAppConfiguration(),
null
);
Expand Down Expand Up @@ -524,12 +526,10 @@ public List<InetAddress> getLocalInetAddresses() {
}

public synchronized void finishConfiguration(
@NotNull String newServerName,
@NotNull String newServerURL,
@NotNull String adminName,
@Nullable String adminPassword,
@NotNull List<AuthInfo> authInfoList,
long sessionExpireTime,
@NotNull CBServerConfig serverConfig,
@NotNull CBAppConfig appConfig,
@Nullable SMCredentialsProvider credentialsProvider
) throws DBException {
Expand All @@ -543,7 +543,7 @@ public synchronized void finishConfiguration(

// Save runtime configuration
log.debug("Saving runtime configuration");
getServerConfigurationController().saveRuntimeConfig(newServerName, newServerURL, sessionExpireTime, appConfig, credentialsProvider);
getServerConfigurationController().saveRuntimeConfig(serverConfig, appConfig, credentialsProvider);

// Grant permissions to predefined connections
if (appConfig.isGrantConnectionsAccessToAnonymousTeam()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
import io.cloudbeaver.service.security.db.WebDatabaseConfig;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.Log;
import org.jkiss.utils.CommonUtils;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -58,18 +55,6 @@ public class CBServerConfig implements WebServerConfiguration {
private String staticContent = "";

public String getServerURL() {
if (serverURL == null) {
String hostName = serverHost;
if (CommonUtils.isEmpty(hostName)) {
try {
hostName = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
log.debug("Error resolving localhost address: " + e.getMessage());
hostName = CBApplication.HOST_LOCALHOST;
}
}
serverURL = "http://" + hostName + ":" + serverPort;
}
return serverURL;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,28 +332,21 @@ protected GsonBuilder getGsonBuilder() {

protected void saveRuntimeConfig(SMCredentialsProvider credentialsProvider) throws DBException {
saveRuntimeConfig(
serverConfiguration.getServerName(),
serverConfiguration.getServerURL(),
serverConfiguration.getMaxSessionIdleTime(),
serverConfiguration,
appConfiguration,
credentialsProvider
);
}

protected void saveRuntimeConfig(
String newServerName,
String newServerURL,
long sessionExpireTime,
CBAppConfig appConfig,
@NotNull CBServerConfig serverConfig,
@NotNull CBAppConfig appConfig,
SMCredentialsProvider credentialsProvider
) throws DBException {
if (newServerName == null) {
if (serverConfig.getServerName() == null) {
throw new DBException("Invalid server configuration, server name cannot be empty");
}
Map<String, Object> configurationProperties = collectConfigurationProperties(newServerName,
newServerURL,
sessionExpireTime,
appConfig);
Map<String, Object> configurationProperties = collectConfigurationProperties(serverConfig, appConfig);
writeRuntimeConfig(getRuntimeAppConfigPath(), configurationProperties);
}

Expand Down Expand Up @@ -382,18 +375,13 @@ public void updateServerUrl(@NotNull SMCredentialsProvider credentialsProvider,
}

protected Map<String, Object> collectConfigurationProperties(
String newServerName,
String newServerURL,
long sessionExpireTime,
CBAppConfig appConfig
@NotNull CBServerConfig serverConfig,
@NotNull CBAppConfig appConfig
) {
Map<String, Object> rootConfig = new LinkedHashMap<>();
{
var originServerConfig = BaseWebApplication.getServerConfigProps(this.originalConfigurationProperties); // get server properties from original configuration file
var serverConfigProperties = collectServerConfigProperties(newServerName,
newServerURL,
sessionExpireTime,
originServerConfig);
var serverConfigProperties = collectServerConfigProperties(serverConfig, originServerConfig);
rootConfig.put("server", serverConfigProperties);
}
{
Expand Down Expand Up @@ -511,28 +499,26 @@ protected Map<String, Object> collectConfigurationProperties(

@NotNull
protected Map<String, Object> collectServerConfigProperties(
String newServerName,
String newServerURL,
long sessionExpireTime,
@NotNull CBServerConfig serverConfig,
Map<String, Object> originServerConfig
) {
var serverConfigProperties = new LinkedHashMap<String, Object>();
if (!CommonUtils.isEmpty(newServerName)) {
if (!CommonUtils.isEmpty(serverConfig.getServerName())) {
copyConfigValue(originServerConfig,
serverConfigProperties,
CBConstants.PARAM_SERVER_NAME,
newServerName);
serverConfig.getServerName());
}
if (!CommonUtils.isEmpty(newServerURL)) {
if (!CommonUtils.isEmpty(serverConfig.getServerURL())) {
copyConfigValue(
originServerConfig, serverConfigProperties, CBConstants.PARAM_SERVER_URL, newServerURL);
originServerConfig, serverConfigProperties, CBConstants.PARAM_SERVER_URL, serverConfig.getServerURL());
}
if (sessionExpireTime > 0) {
if (serverConfig.getMaxSessionIdleTime() > 0) {
copyConfigValue(
originServerConfig,
serverConfigProperties,
CBConstants.PARAM_SESSION_EXPIRE_PERIOD,
sessionExpireTime);
serverConfig.getMaxSessionIdleTime());
}
var productConfigProperties = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
Map<String, Object> oldProductRuntimeConfig = JSONUtils.getObject(originServerConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,10 @@ public CBServerConfigurationControllerEmbedded(@NotNull T serverConfig, @NotNull
@NotNull
@Override
protected Map<String, Object> collectServerConfigProperties(
String newServerName,
String newServerURL,
long sessionExpireTime,
Map<String, Object> originServerConfig
@NotNull CBServerConfig serverConfig,
@NotNull Map<String, Object> originServerConfig
) {
Map<String, Object> serverConfigProperties = super.collectServerConfigProperties(
newServerName, newServerURL, sessionExpireTime, originServerConfig);
Map<String, Object> serverConfigProperties = super.collectServerConfigProperties(serverConfig, originServerConfig);

var databaseConfigProperties = new LinkedHashMap<String, Object>();
Map<String, Object> oldRuntimeDBConfig = JSONUtils.getObject(originServerConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ public Integer getOrdinalPosition() {

@Property
public String getFullyQualifiedName() {
return object instanceof DBPQualifiedObject ? ((DBPQualifiedObject) object).getFullyQualifiedName(DBPEvaluationContext.UI) : getName();
return object instanceof DBPQualifiedObject
? ((DBPQualifiedObject) object).getFullyQualifiedName(DBPEvaluationContext.UI)
: getName();
}

@Property
Expand Down Expand Up @@ -151,7 +153,7 @@ public String[] getFeatures() {
return features.toArray(new String[0]);
}

private static void getObjectFeatures(DBSObject object, List<String> features) {
private void getObjectFeatures(DBSObject object, List<String> features) {
boolean isDiagramSupported = true;
if (object instanceof DBPScriptObject) features.add(OBJECT_FEATURE_SCRIPT);
if (object instanceof DBPScriptObjectExt) features.add(OBJECT_FEATURE_SCRIPT_EXTENDED);
Expand Down Expand Up @@ -181,7 +183,7 @@ private static void getObjectFeatures(DBSObject object, List<String> features) {
features.add(OBJECT_FEATURE_OBJECT_CONTAINER);
try {
Class<? extends DBSObject> childType = objectContainer.getPrimaryChildType(null);
Collection<? extends DBSObject> childrenCollection = objectContainer.getChildren(null);
Collection<? extends DBSObject> childrenCollection = objectContainer.getChildren(session.getProgressMonitor());
if (DBSTable.class.isAssignableFrom(childType) && childrenCollection != null) {
features.add(OBJECT_FEATURE_ENTITY_CONTAINER);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
Bundle-Vendor: DBeaver Corp
Bundle-Name: Cloudbeaver Web Service - Administration
Bundle-SymbolicName: io.cloudbeaver.service.admin;singleton:=true
Bundle-Version: 1.0.102.qualifier
Bundle-Release-Date: 20240805
Bundle-Version: 1.0.103.qualifier
Bundle-Release-Date: 20240819
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Expand Down
2 changes: 1 addition & 1 deletion server/bundles/io.cloudbeaver.service.admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<relativePath>../</relativePath>
</parent>
<artifactId>io.cloudbeaver.service.admin</artifactId>
<version>1.0.102-SNAPSHOT</version>
<version>1.0.103-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

</project>
Loading

0 comments on commit 56b36c7

Please sign in to comment.