提交 33c6ed30 编写于 作者: S serge-rider

#10 Project registry bundle

上级 a2be4372
......@@ -42,6 +42,7 @@
<plugin id="org.jkiss.utils" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.jkiss.dbeaver.model" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.jkiss.dbeaver.registry" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.jkiss.dbeaver.core" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.jkiss.dbeaver.net.ssh" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.jkiss.dbeaver.net.ssh.jsch" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
......
......@@ -11,10 +11,8 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.jkiss.dbeaver,
org.jkiss.dbeaver.core,
org.jkiss.dbeaver.registry,
org.jkiss.dbeaver.registry.datatype,
org.jkiss.dbeaver.registry.driver,
org.jkiss.dbeaver.registry.tools,
org.jkiss.dbeaver.registry.updater,
org.jkiss.dbeaver.ui.dialogs,
org.jkiss.dbeaver.tools,
org.jkiss.dbeaver.tools.compare,
......@@ -66,6 +64,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.e4.ui.workbench.swt,
org.eclipse.e4.ui.workbench.renderers.swt,
org.jkiss.dbeaver.model;visibility:=reexport,
org.jkiss.dbeaver.registry;visibility:=reexport,
org.jkiss.dbeaver.ui;visibility:=reexport,
org.jkiss.dbeaver.ui.editors.base;visibility:=reexport,
org.jkiss.dbeaver.ui.editors.data;visibility:=reexport,
......
......@@ -2,18 +2,12 @@
Bundle-Vendor = JKISS
Bundle-Name = DBeaver Core Plug-in
extension-point.org.jkiss.dbeaver.mavenRepository.name = Maven repositories config
extension-point.org.jkiss.dbeaver.dataSourceProvider.name = DataSource provider
extension-point.org.jkiss.dbeaver.dataSourceView.name = DataSource views
extension-point.org.jkiss.dbeaver.databaseEditor.name = Custom entity editor
extension-point.org.jkiss.dbeaver.objectManager.name = Database object managers
extension-point.org.jkiss.dbeaver.resourceHandler.name = Resource Handlers
extension-point.org.jkiss.dbeaver.networkHandler.name = Network Handlers
extension-point.org.jkiss.dbeaver.resources.name = Resources
extension-point.org.jkiss.dbeaver.tools.name = Tools
extension-point.org.jkiss.dbeaver.product.bundles.name = Product bundles
extension-point.org.jkiss.dbeaver.workbenchHandler.name = Workbench handlers
extension-point.org.jkiss.dbeaver.language.name = Language
extension-point.org.jkiss.dbeaver.ui.propertyConfigurator.name = UI property configurator
content-type.org.jkiss.dbeaver.bookmark.name = Bookmark
......
......@@ -6,13 +6,6 @@
extension-point.org.jkiss.dbeaver.dataSourceProvider.name = DataSource-Provider
extension-point.org.jkiss.dbeaver.dataSourceView.name = DataSource-Ansichten
extension-point.org.jkiss.dbeaver.databaseEditor.name = Benutzerdefinierter Entit\u00E4tseditor
extension-point.org.jkiss.dbeaver.language.name = Sprache
extension-point.org.jkiss.dbeaver.mavenRepository.name = Maven Repositories Konfiguration
extension-point.org.jkiss.dbeaver.networkHandler.name = Netzwerk-Handler
extension-point.org.jkiss.dbeaver.pluginService.name = Plugin Service
extension-point.org.jkiss.dbeaver.product.bundles.name = Produktbundle
extension-point.org.jkiss.dbeaver.resourceHandler.name = Resourcen-Handler
extension-point.org.jkiss.dbeaver.resources.name = Resourcen
extension-point.org.jkiss.dbeaver.tools.name = Werkzeuge
extension-point.org.jkiss.dbeaver.ui.propertyConfigurator.name = UI-Eigenschaftskonfigurator
extension-point.org.jkiss.dbeaver.workbenchHandler.name = Workbench-Handler
......
......@@ -6,16 +6,10 @@ Bundle-Name = Extension Noyau DBeaver
extension.org.jkiss.dbeaver.DBeaverNature.name = DBeaver Nature
extension-point.org.jkiss.dbeaver.mavenRepository.name = Config des d\u00E9p\u00F4ts Maven
extension-point.org.jkiss.dbeaver.dataSourceProvider.name = Fournisseur de Sources de donn\u00E9es
extension-point.org.jkiss.dbeaver.databaseEditor.name = Editeur d'entit\u00E9 personnalis\u00E9es
extension-point.org.jkiss.dbeaver.resourceHandler.name = Handlers de ressources
extension-point.org.jkiss.dbeaver.networkHandler.name = Handlers de r\u00E9seaux
extension-point.org.jkiss.dbeaver.resources.name = Ressources
extension-point.org.jkiss.dbeaver.tools.name = Outils
extension-point.org.jkiss.dbeaver.product.bundles.name = Product bundles
extension-point.org.jkiss.dbeaver.workbenchHandler.name = Workbench handlers
extension-point.org.jkiss.dbeaver.language.name = Langage
extension-point.org.jkiss.dbeaver.ui.propertyConfigurator.name = Configation des propri\u00E9t\u00E9s de l'interface
view.query.manager.title = Gestionnaire de requ\u00EAtes
......
Bundle-Name =DBeaver\u30B3\u30A2\u30D7\u30E9\u30B0\u30A4\u30F3
extension-point.org.jkiss.dbeaver.mavenRepository.name =Maven\u30EA\u30DD\u30B8\u30C8\u30EA\u8A2D\u5B9A
extension-point.org.jkiss.dbeaver.dataSourceProvider.name =\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u30D7\u30ED\u30D0\u30A4\u30C0
extension-point.org.jkiss.dbeaver.databaseEditor.name =\u30AB\u30B9\u30BF\u30E0\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u30A8\u30C7\u30A3\u30BF
extension-point.org.jkiss.dbeaver.resourceHandler.name =\u30EA\u30BD\u30FC\u30B9\u30CF\u30F3\u30C9\u30E9
extension-point.org.jkiss.dbeaver.networkHandler.name =\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30CF\u30F3\u30C9\u30E9
extension-point.org.jkiss.dbeaver.resources.name =\u30EA\u30BD\u30FC\u30B9
extension-point.org.jkiss.dbeaver.tools.name =\u30C4\u30FC\u30EB
extension-point.org.jkiss.dbeaver.product.bundles.name =\u88FD\u54C1\u30D0\u30F3\u30C9\u30EB
extension-point.org.jkiss.dbeaver.workbenchHandler.name =\u30EF\u30FC\u30AF\u30D9\u30F3\u30C1\u30CF\u30F3\u30C9\u30E9
extension-point.org.jkiss.dbeaver.language.name =\u8A00\u8A9E
extension-point.org.jkiss.dbeaver.ui.propertyConfigurator.name =UI\u30D7\u30ED\u30D1\u30C6\u30A3\u30B3\u30F3\u30D5\u30A3\u30B0\u30EC\u30FC\u30BF
content-type.org.jkiss.dbeaver.bookmark.name =\u30D6\u30C3\u30AF\u30DE\u30FC\u30AF
......
......@@ -148,12 +148,6 @@ content-type.org.jkiss.dbeaver.bookmark.name = \u4E66\u7B7E
extension-point.org.jkiss.dbeaver.dataSourceProvider.name = \u6570\u636E\u6E90\u63D0\u4F9B\u8005
extension-point.org.jkiss.dbeaver.dataSourceView.name = \u6570\u636E\u6E90\u67E5\u770B\u5668
extension-point.org.jkiss.dbeaver.databaseEditor.name = \u81EA\u5B9A\u4E49\u5B9E\u4F53\u7F16\u8F91\u5668
extension-point.org.jkiss.dbeaver.language.name = \u8BED\u8A00
extension-point.org.jkiss.dbeaver.mavenRepository.name = Maven \u4ED3\u5E93\u914D\u7F6E
extension-point.org.jkiss.dbeaver.networkHandler.name = \u7F51\u7EDC\u5904\u7406\u5668
extension-point.org.jkiss.dbeaver.product.bundles.name = \u4EA7\u54C1\u5305
extension-point.org.jkiss.dbeaver.resourceHandler.name = \u8D44\u6E90\u5904\u7406\u7A0B\u5E8F
extension-point.org.jkiss.dbeaver.resources.name = \u8D44\u6E90
extension-point.org.jkiss.dbeaver.tools.name = \u5DE5\u5177
extension-point.org.jkiss.dbeaver.ui.propertyConfigurator.name = UI \u5C5E\u6027\u914D\u7F6E
extension-point.org.jkiss.dbeaver.workbenchHandler.name = \u5DE5\u4F5C\u53F0\u5904\u7406\u7A0B\u5E8F
......
......@@ -47,6 +47,7 @@ import org.jkiss.dbeaver.model.runtime.VoidProgressMonitor;
import org.jkiss.dbeaver.model.sql.format.SQLFormatterRegistry;
import org.jkiss.dbeaver.registry.*;
import org.jkiss.dbeaver.registry.datatype.DataTypeProviderRegistry;
import org.jkiss.dbeaver.registry.driver.DriverDescriptor;
import org.jkiss.dbeaver.registry.formatter.DataFormatterRegistry;
import org.jkiss.dbeaver.registry.language.PlatformLanguageRegistry;
import org.jkiss.dbeaver.runtime.IPluginService;
......@@ -547,6 +548,11 @@ public class DBeaverCore implements DBPPlatform {
return DBeaverActivator.getConfigurationFile(fileName);
}
@Override
public File getCustomDriversHome() {
return DriverDescriptor.getCustomDriversHome();
}
@Override
public boolean isShuttingDown() {
return isClosing();
......
......@@ -19,8 +19,8 @@ package org.jkiss.dbeaver.registry;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.activities.IActivityManager;
//import org.eclipse.ui.PlatformUI;
//import org.eclipse.ui.activities.IActivityManager;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.Log;
......@@ -207,11 +207,13 @@ public class DataSourceProviderRegistry implements DBPDataSourceProviderRegistry
public List<DataSourceProviderDescriptor> getEnabledDataSourceProviders()
{
IActivityManager activityManager = PlatformUI.getWorkbench().getActivitySupport().getActivityManager();
//IActivityManager activityManager = PlatformUI.getWorkbench().getActivitySupport().getActivityManager();
List<DataSourceProviderDescriptor> enabled = new ArrayList<>(dataSourceProviders);
/*
enabled.removeIf(p ->
!activityManager.getIdentifier(p.getFullIdentifier()).isEnabled()
);
*/
return enabled;
}
......
......@@ -34,10 +34,7 @@ import org.jkiss.dbeaver.model.preferences.DBPPreferenceStore;
import org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.runtime.OSDescriptor;
import org.jkiss.dbeaver.registry.DataSourceProviderDescriptor;
import org.jkiss.dbeaver.registry.DataSourceProviderRegistry;
import org.jkiss.dbeaver.registry.NativeClientDescriptor;
import org.jkiss.dbeaver.registry.RegistryConstants;
import org.jkiss.dbeaver.registry.*;
import org.jkiss.dbeaver.registry.maven.MavenArtifactReference;
import org.jkiss.dbeaver.runtime.DBWorkbench;
import org.jkiss.dbeaver.ui.UITask;
......@@ -1046,7 +1043,7 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver {
final Collection<String> availableVersions = library.getAvailableVersions(monitor);
if (!CommonUtils.isEmpty(availableVersions)) {
final String curVersion = library.getVersion();
String latestVersion = DriverUtils.findLatestVersion(availableVersions);
String latestVersion = VersionUtils.findLatestVersion(availableVersions);
if (latestVersion != null && !latestVersion.equals(curVersion)) {
log.debug("Update driver " + getName() + " " + curVersion + "->" + latestVersion);
}
......
......@@ -22,8 +22,12 @@ import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.DBPDataSourceContainer;
import org.jkiss.dbeaver.model.DBPNamedObject;
import org.jkiss.dbeaver.model.connection.DBPDataSourceProviderDescriptor;
import org.jkiss.dbeaver.model.connection.DBPDriver;
import org.jkiss.dbeaver.registry.*;
import org.jkiss.dbeaver.registry.DataSourceRegistry;
import org.jkiss.dbeaver.registry.ProductBundleRegistry;
import org.jkiss.dbeaver.registry.RegistryConstants;
import org.jkiss.dbeaver.runtime.DBWorkbench;
import org.jkiss.utils.CommonUtils;
import org.jkiss.utils.IOUtils;
......@@ -40,60 +44,6 @@ public class DriverUtils {
public static final String ZIP_EXTRACT_DIR = "zip-cache";
public static boolean isBetaVersion(@NotNull String versionInfo) {
return versionInfo.contains("beta") || versionInfo.contains("alpha");
}
@Nullable
public static String findLatestVersion(@NotNull Collection<String> allVersions) {
String latest = null;
for (String version : allVersions) {
if (isBetaVersion(version)) {
continue;
}
if (latest == null || compareVersions(version, latest) > 0) {
latest = version;
}
}
if (latest == null) {
// Now use beta versions too
for (String version : allVersions) {
if (latest == null || compareVersions(version, latest) > 0) {
latest = version;
}
}
}
return latest;
}
public static int compareVersions(@NotNull String v1, @NotNull String v2) {
StringTokenizer st1 = new StringTokenizer(v1, ".-_");
StringTokenizer st2 = new StringTokenizer(v2, ".-_");
while (st1.hasMoreTokens() && st2.hasMoreTokens()) {
String t1 = st1.nextToken();
String t2 = st2.nextToken();
try {
int cmp = Integer.parseInt(t1) - Integer.parseInt(t2);
if (cmp != 0) {
return cmp;
}
} catch (NumberFormatException e) {
// Non-numeric versions - use lexicographical compare
int cmp = t1.compareTo(t2);
if (cmp != 0) {
return cmp;
}
}
}
if (st1.hasMoreTokens()) {
return 1;
} else if (st2.hasMoreTokens()) {
return -1;
} else {
return 0;
}
}
public static boolean matchesBundle(IConfigurationElement config) {
// Check bundle
String bundle = config.getAttribute(RegistryConstants.ATTR_BUNDLE);
......@@ -230,10 +180,10 @@ public class DriverUtils {
}
public static List<DBPDriver> getAllDrivers() {
List<DataSourceProviderDescriptor> providers = DataSourceProviderRegistry.getInstance().getEnabledDataSourceProviders();
List<? extends DBPDataSourceProviderDescriptor> providers = DBWorkbench.getPlatform().getDataSourceProviderRegistry().getEnabledDataSourceProviders();
List<DBPDriver> allDrivers = new ArrayList<>();
for (DataSourceProviderDescriptor dpd : providers) {
for (DBPDataSourceProviderDescriptor dpd : providers) {
allDrivers.addAll(dpd.getEnabledDrivers());
}
allDrivers.sort(Comparator.comparing(DBPNamedObject::getName));
......
......@@ -16,6 +16,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.jface.text,
org.eclipse.ui.workbench.texteditor,
org.jkiss.dbeaver.core,
org.jkiss.dbeaver.registry,
org.jkiss.utils
Export-Package: org.jkiss.dbeaver.ext.mockdata,
org.jkiss.dbeaver.ext.mockdata.generator,
......
......@@ -99,6 +99,9 @@ public interface DBPPlatform
@NotNull
File getConfigurationFile(String fileName);
@NotNull
File getCustomDriversHome();
boolean isShuttingDown();
}
......@@ -25,6 +25,8 @@ public interface DBPDataSourceProviderRegistry {
List<? extends DBPDataSourceProviderDescriptor> getDataSourceProviders();
List<? extends DBPDataSourceProviderDescriptor> getEnabledDataSourceProviders();
DBPDataSourceProviderDescriptor getDataSourceProvider(String id);
void saveConnectionTypes();
......
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Vendor: %Bundle-Vendor
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.jkiss.dbeaver.registry;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Release-Date: 20190408
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.jkiss.dbeaver.registry,
org.jkiss.dbeaver.registry.datatype,
org.jkiss.dbeaver.registry.language,
org.jkiss.dbeaver.registry.maven,
org.jkiss.dbeaver.registry.network,
org.jkiss.dbeaver.registry.updater
Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.filesystem,
org.eclipse.core.resources,
org.eclipse.core.expressions,
org.eclipse.core.net,
org.eclipse.equinox.security,
org.jkiss.dbeaver.model;visibility:=reexport
Bundle-Localization: OSGI-INF/l10n/bundle
Bundle-Vendor = DBeaver Corp
Bundle-Name = DBeaver Registry Plug-in
extension-point.org.jkiss.dbeaver.mavenRepository.name = Maven repositories config
extension-point.org.jkiss.dbeaver.dataSourceProvider.name = DataSource provider
extension-point.org.jkiss.dbeaver.resourceHandler.name = Resource Handlers
extension-point.org.jkiss.dbeaver.networkHandler.name = Network Handlers
extension-point.org.jkiss.dbeaver.resources.name = Resources
extension-point.org.jkiss.dbeaver.product.bundles.name = Product bundles
extension-point.org.jkiss.dbeaver.language.name = Language
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
# DBeaver - Universal Database Manager
# Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
# Copyright (C) 2016 Karl Griesser (fullref@gmail.com)
extension-point.org.jkiss.dbeaver.dataSourceProvider.name = DataSource-Provider
extension-point.org.jkiss.dbeaver.language.name = Sprache
extension-point.org.jkiss.dbeaver.mavenRepository.name = Maven Repositories Konfiguration
extension-point.org.jkiss.dbeaver.networkHandler.name = Netzwerk-Handler
extension-point.org.jkiss.dbeaver.pluginService.name = Plugin Service
extension-point.org.jkiss.dbeaver.product.bundles.name = Produktbundle
extension-point.org.jkiss.dbeaver.resourceHandler.name = Resourcen-Handler
extension-point.org.jkiss.dbeaver.resources.name = Resourcen
# DBeaver - Universal Database Manager
# Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
extension-point.org.jkiss.dbeaver.mavenRepository.name = Config des d\u00E9p\u00F4ts Maven
extension-point.org.jkiss.dbeaver.dataSourceProvider.name = Fournisseur de Sources de donn\u00E9es
extension-point.org.jkiss.dbeaver.resourceHandler.name = Handlers de ressources
extension-point.org.jkiss.dbeaver.networkHandler.name = Handlers de r\u00E9seaux
extension-point.org.jkiss.dbeaver.resources.name = Ressources
extension-point.org.jkiss.dbeaver.product.bundles.name = Product bundles
extension-point.org.jkiss.dbeaver.language.name = Langage
extension-point.org.jkiss.dbeaver.mavenRepository.name =Maven\u30EA\u30DD\u30B8\u30C8\u30EA\u8A2D\u5B9A
extension-point.org.jkiss.dbeaver.dataSourceProvider.name =\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u30D7\u30ED\u30D0\u30A4\u30C0
extension-point.org.jkiss.dbeaver.resourceHandler.name =\u30EA\u30BD\u30FC\u30B9\u30CF\u30F3\u30C9\u30E9
extension-point.org.jkiss.dbeaver.networkHandler.name =\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30CF\u30F3\u30C9\u30E9
extension-point.org.jkiss.dbeaver.resources.name =\u30EA\u30BD\u30FC\u30B9
extension-point.org.jkiss.dbeaver.product.bundles.name =\u88FD\u54C1\u30D0\u30F3\u30C9\u30EB
extension-point.org.jkiss.dbeaver.language.name =\u8A00\u8A9E
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
# Copyright (C) 2017 Liu, Yuanyuan (liuyuanyuan@highgo.com)
# Copyright (C) 2012 Brook.Tran (Brook.Tran.C@gmail.com)
# Copyright (C) 2018 Chao Feng (chaofeng111@qq.com)
extension-point.org.jkiss.dbeaver.dataSourceProvider.name = \u6570\u636E\u6E90\u63D0\u4F9B\u8005
extension-point.org.jkiss.dbeaver.language.name = \u8BED\u8A00
extension-point.org.jkiss.dbeaver.mavenRepository.name = Maven \u4ED3\u5E93\u914D\u7F6E
extension-point.org.jkiss.dbeaver.networkHandler.name = \u7F51\u7EDC\u5904\u7406\u5668
extension-point.org.jkiss.dbeaver.product.bundles.name = \u4EA7\u54C1\u5305
extension-point.org.jkiss.dbeaver.resourceHandler.name = \u8D44\u6E90\u5904\u7406\u7A0B\u5E8F
extension-point.org.jkiss.dbeaver.resources.name = \u8D44\u6E90
source.. = src/
output.. = target/classes/
bin.includes = .,\
META-INF/,\
OSGI-INF/,\
plugin.xml,\
schema/
jars.compile.order = .
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension-point id="org.jkiss.dbeaver.pluginService" name="%extension-point.org.jkiss.dbeaver.pluginService.name" schema="schema/org.jkiss.dbeaver.pluginService.exsd"/>
<!-- Non UI extensions -->
<extension-point id="org.jkiss.dbeaver.mavenRepository" name="%extension-point.org.jkiss.dbeaver.mavenRepository.name" schema="schema/org.jkiss.dbeaver.mavenRepository.exsd"/>
<!--<extension-point id="org.jkiss.dbeaver.dataSourceProvider" name="%extension-point.org.jkiss.dbeaver.dataSourceProvider.name" schema="schema/org.jkiss.dbeaver.dataSourceProvider.exsd"/>-->
<!--<extension-point id="org.jkiss.dbeaver.driverManager" name="%extension-point.org.jkiss.dbeaver.driverManager.name" schema="schema/org.jkiss.dbeaver.driverManager.exsd"/>-->
<extension-point id="org.jkiss.dbeaver.resourceHandler" name="%extension-point.org.jkiss.dbeaver.resourceHandler.name" schema="schema/org.jkiss.dbeaver.resourceHandler.exsd"/>
<extension-point id="org.jkiss.dbeaver.networkHandler" name="%extension-point.org.jkiss.dbeaver.networkHandler.name" schema="schema/org.jkiss.dbeaver.networkHandler.exsd"/>
<extension-point id="org.jkiss.dbeaver.resources" name="%extension-point.org.jkiss.dbeaver.resources.name" schema="schema/org.jkiss.dbeaver.resources.exsd"/>
<extension-point id="org.jkiss.dbeaver.product.bundles" name="%extension-point.org.jkiss.dbeaver.product.bundles.name" schema="schema/org.jkiss.dbeaver.product.bundles.exsd"/>
<extension-point id="org.jkiss.dbeaver.language" name="%extension-point.org.jkiss.dbeaver.language.name" schema="schema/org.jkiss.dbeaver.language.exsd"/>
</plugin>
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jkiss.dbeaver</groupId>
<artifactId>plugins</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>org.jkiss.dbeaver.registry</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jkiss.dbeaver.core" xmlns="http://www.w3.org/2001/XMLSchema">
<schema targetNamespace="org.jkiss.dbeaver.registry" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.jkiss.dbeaver.core" id="org.jkiss.dbeaver.language" name="Language description"/>
<meta.schema plugin="org.jkiss.dbeaver.registry" id="org.jkiss.dbeaver.language" name="Language description"/>
</appInfo>
<documentation>
Plugin Service
......
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jkiss.dbeaver.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.jkiss.dbeaver.core" id="org.jkiss.dbeaver.mavenRepository" name="Maven Repository"/>
</appInfo>
<documentation>
Plugin Service
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="service" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="class" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<element name="service">
<complexType>
<attribute name="class" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":org.jkiss.dbeaver.runtime.IPluginService"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="examples"/>
</appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="apiinfo"/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jkiss.dbeaver.registry" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.jkiss.dbeaver.registry" id="org.jkiss.dbeaver.mavenRepository" name="Maven Repository"/>
</appInfo>
<documentation>
Plugin Service
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="service" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="class" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<element name="service">
<complexType>
<attribute name="class" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":org.jkiss.dbeaver.runtime.IPluginService"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="examples"/>
</appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="apiinfo"/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jkiss.dbeaver.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.jkiss.dbeaver.core" id="org.jkiss.dbeaver.networkHandler" name="Network Handlers"/>
</appInfo>
<documentation>
[Enter description of this extension point.]
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="handler" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="label" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="handler">
<complexType>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="label" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
<attribute name="description" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
<attribute name="type" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="secured" type="boolean">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="handlerClass" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":org.jkiss.dbeaver.model.net.DBWNetworkHandler"/>
</appInfo>
</annotation>
</attribute>
<attribute name="uiClass" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":org.jkiss.dbeaver.ui.IObjectPropertyConfigurator"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="examples"/>
</appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="apiinfo"/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jkiss.dbeaver.registry" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.jkiss.dbeaver.registry" id="org.jkiss.dbeaver.networkHandler" name="Network Handlers"/>
</appInfo>
<documentation>
[Enter description of this extension point.]
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="handler" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="label" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="handler">
<complexType>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="label" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
<attribute name="description" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
<attribute name="type" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="secured" type="boolean">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="handlerClass" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":org.jkiss.dbeaver.model.net.DBWNetworkHandler"/>
</appInfo>
</annotation>
</attribute>
<attribute name="uiClass" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":org.jkiss.dbeaver.ui.IObjectPropertyConfigurator"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="examples"/>
</appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="apiinfo"/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jkiss.dbeaver.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.jkiss.dbeaver.core" id="org.jkiss.dbeaver.pluginService" name="Plugin Service"/>
</appInfo>
<documentation>
Plugin Service
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="service" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="class" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<element name="service">
<complexType>
<attribute name="class" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":org.jkiss.dbeaver.runtime.IPluginService"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="examples"/>
</appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="apiinfo"/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jkiss.dbeaver.registry" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.jkiss.dbeaver.registry" id="org.jkiss.dbeaver.pluginService" name="Plugin Service"/>
</appInfo>
<documentation>
Plugin Service
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="service" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="class" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<element name="service">
<complexType>
<attribute name="class" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":org.jkiss.dbeaver.runtime.IPluginService"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="examples"/>
</appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="apiinfo"/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jkiss.dbeaver.core" xmlns="http://www.w3.org/2001/XMLSchema">
<schema targetNamespace="org.jkiss.dbeaver.registry" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.jkiss.dbeaver.core" id="org.jkiss.dbeaver.product.bundles" name="Product bundles"/>
<meta.schema plugin="org.jkiss.dbeaver.registry" id="org.jkiss.dbeaver.product.bundles" name="Product bundles"/>
</appInfo>
<documentation>
Tools
......
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jkiss.dbeaver.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.jkiss.dbeaver.core" id="org.jkiss.dbeaver.resourceHandler" name="Resource Handlers"/>
</appInfo>
<documentation>
[Enter description of this extension point.]
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="handler" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="handler">
<complexType>
<sequence>
<element ref="resourceTypeBinding" minOccurs="0" maxOccurs="unbounded"/>
<element ref="contentTypeBinding" minOccurs="0" maxOccurs="unbounded"/>
<element ref="root" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="class" type="string" use="required">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":org.jkiss.dbeaver.model.project.DBPResourceHandler"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="resourceTypeBinding">
<complexType>
<attribute name="resourceType" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<element name="contentTypeBinding">
<complexType>
<attribute name="contentTypeId" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<element name="root">
<complexType>
<attribute name="folder" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="examples"/>
</appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="apiinfo"/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jkiss.dbeaver.registry" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.jkiss.dbeaver.registry" id="org.jkiss.dbeaver.resourceHandler" name="Resource Handlers"/>
</appInfo>
<documentation>
[Enter description of this extension point.]
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="handler" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="handler">
<complexType>
<sequence>
<element ref="resourceTypeBinding" minOccurs="0" maxOccurs="unbounded"/>
<element ref="contentTypeBinding" minOccurs="0" maxOccurs="unbounded"/>
<element ref="root" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="class" type="string" use="required">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":org.jkiss.dbeaver.model.project.DBPResourceHandler"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="resourceTypeBinding">
<complexType>
<attribute name="resourceType" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<element name="contentTypeBinding">
<complexType>
<attribute name="contentTypeId" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<element name="root">
<complexType>
<attribute name="folder" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="examples"/>
</appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="apiinfo"/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jkiss.dbeaver.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.jkiss.dbeaver.core" id="org.jkiss.dbeaver.resources" name="External Resources"/>
</appInfo>
<documentation>
[Enter description of this extension point.]
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="resource" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="label" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="resource">
<complexType>
<attribute name="name" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="examples"/>
</appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="apiinfo"/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jkiss.dbeaver.registry" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.jkiss.dbeaver.registry" id="org.jkiss.dbeaver.resources" name="External Resources"/>
</appInfo>
<documentation>
[Enter description of this extension point.]
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="resource" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="label" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="resource">
<complexType>
<attribute name="name" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="examples"/>
</appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="apiinfo"/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.registry;
import org.eclipse.core.runtime.IConfigurationElement;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.impl.AbstractDescriptor;
import java.net.URL;
/**
* ExternalResourceDescriptor
*/
public class ExternalResourceDescriptor extends AbstractDescriptor
{
public static final String EXTENSION_ID = "org.jkiss.dbeaver.resources"; //$NON-NLS-1$
private static final Log log = Log.getLog(ExternalResourceDescriptor.class);
private final String name;
private final String alias;
public ExternalResourceDescriptor(IConfigurationElement config)
{
super(config);
this.name = config.getAttribute(RegistryConstants.ATTR_NAME);
this.alias = config.getAttribute(RegistryConstants.ATTR_ALIAS);
}
public String getName()
{
return name;
}
public String getAlias() {
return alias;
}
public URL getURL()
{
return getContributorBundle().getEntry(name);
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.registry;
import org.eclipse.core.runtime.IConfigurationElement;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.impl.AbstractDescriptor;
import java.net.URL;
/**
* ExternalResourceDescriptor
*/
public class ExternalResourceDescriptor extends AbstractDescriptor
{
public static final String EXTENSION_ID = "org.jkiss.dbeaver.resources"; //$NON-NLS-1$
private static final Log log = Log.getLog(ExternalResourceDescriptor.class);
private final String name;
private final String alias;
public ExternalResourceDescriptor(IConfigurationElement config)
{
super(config);
this.name = config.getAttribute(RegistryConstants.ATTR_NAME);
this.alias = config.getAttribute(RegistryConstants.ATTR_ALIAS);
}
public String getName()
{
return name;
}
public String getAlias() {
return alias;
}
public URL getURL()
{
return getContributorBundle().getEntry(name);
}
}
\ No newline at end of file
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.registry;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.impl.AbstractDescriptor;
import org.jkiss.dbeaver.runtime.IPluginService;
import java.util.ArrayList;
import java.util.List;
public class PluginServiceRegistry
{
private static final Log log = Log.getLog(PluginServiceRegistry.class);
public static final String EXTENSION_ID = "org.jkiss.dbeaver.pluginService"; //$NON-NLS-1$
private static PluginServiceRegistry instance = null;
private class ServiceDescriptor extends AbstractDescriptor {
private final ObjectType type;
protected ServiceDescriptor(IConfigurationElement config) {
super(config);
type = new ObjectType(config.getAttribute(RegistryConstants.ATTR_CLASS));
}
}
public synchronized static PluginServiceRegistry getInstance()
{
if (instance == null) {
instance = new PluginServiceRegistry(Platform.getExtensionRegistry());
}
return instance;
}
private final List<IPluginService> services = new ArrayList<>();
private PluginServiceRegistry(IExtensionRegistry registry)
{
IConfigurationElement[] extElements = registry.getConfigurationElementsFor(EXTENSION_ID);
for (IConfigurationElement ext : extElements) {
ServiceDescriptor serviceDescriptor = new ServiceDescriptor(ext);
try {
IPluginService pluginService = serviceDescriptor.type.createInstance(IPluginService.class);
services.add(pluginService);
} catch (DBException e) {
log.error("Can't create plugin service", e);
}
}
}
public List<IPluginService> getServices()
{
return services;
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.registry;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.impl.AbstractDescriptor;
import org.jkiss.dbeaver.runtime.IPluginService;
import java.util.ArrayList;
import java.util.List;
public class PluginServiceRegistry
{
private static final Log log = Log.getLog(PluginServiceRegistry.class);
public static final String EXTENSION_ID = "org.jkiss.dbeaver.pluginService"; //$NON-NLS-1$
private static PluginServiceRegistry instance = null;
private class ServiceDescriptor extends AbstractDescriptor {
private final ObjectType type;
protected ServiceDescriptor(IConfigurationElement config) {
super(config);
type = new ObjectType(config.getAttribute(RegistryConstants.ATTR_CLASS));
}
}
public synchronized static PluginServiceRegistry getInstance()
{
if (instance == null) {
instance = new PluginServiceRegistry(Platform.getExtensionRegistry());
}
return instance;
}
private final List<IPluginService> services = new ArrayList<>();
private PluginServiceRegistry(IExtensionRegistry registry)
{
IConfigurationElement[] extElements = registry.getConfigurationElementsFor(EXTENSION_ID);
for (IConfigurationElement ext : extElements) {
ServiceDescriptor serviceDescriptor = new ServiceDescriptor(ext);
try {
IPluginService pluginService = serviceDescriptor.type.createInstance(IPluginService.class);
services.add(pluginService);
} catch (DBException e) {
log.error("Can't create plugin service", e);
}
}
}
public List<IPluginService> getServices()
{
return services;
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.registry;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.DBPImage;
import org.jkiss.dbeaver.model.app.DBPResourceHandler;
import org.jkiss.dbeaver.model.app.DBPResourceHandlerDescriptor;
import org.jkiss.dbeaver.model.impl.AbstractDescriptor;
import org.jkiss.dbeaver.utils.RuntimeUtils;
import org.jkiss.utils.ArrayUtils;
import org.jkiss.utils.CommonUtils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* ResourceHandlerDescriptor
*/
public class ResourceHandlerDescriptor extends AbstractDescriptor implements DBPResourceHandlerDescriptor
{
private static final Log log = Log.getLog(ResourceHandlerDescriptor.class);
public static final String EXTENSION_ID = "org.jkiss.dbeaver.resourceHandler"; //$NON-NLS-1$
private String id;
private String name;
private boolean managable;
private DBPImage icon;
private ObjectType handlerType;
private DBPResourceHandler handler;
private List<IContentType> contentTypes = new ArrayList<>();
private List<ObjectType> resourceTypes = new ArrayList<>();
private List<String> roots = new ArrayList<>();
private String defaultRoot;
ResourceHandlerDescriptor(IConfigurationElement config)
{
super(config);
this.id = config.getAttribute(RegistryConstants.ATTR_ID);
this.name = config.getAttribute(RegistryConstants.ATTR_NAME);
this.managable = CommonUtils.toBoolean(config.getAttribute(RegistryConstants.ATTR_MANAGABLE));
this.icon = iconToImage(config.getAttribute(RegistryConstants.ATTR_ICON));
this.handlerType = new ObjectType(config.getAttribute(RegistryConstants.ATTR_CLASS));
for (IConfigurationElement contentTypeBinding : ArrayUtils.safeArray(config.getChildren("contentTypeBinding"))) {
String contentTypeId = contentTypeBinding.getAttribute("contentTypeId");
if (!CommonUtils.isEmpty(contentTypeId)) {
IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeId);
if (contentType != null) {
contentTypes.add(contentType);
} else {
log.warn("Content type '" + contentTypeId + "' not recognized");
}
}
}
for (IConfigurationElement resourceTypeBinding : ArrayUtils.safeArray(config.getChildren("resourceTypeBinding"))) {
String resourceType = resourceTypeBinding.getAttribute("resourceType");
if (!CommonUtils.isEmpty(resourceType)) {
resourceTypes.add(new ObjectType(resourceType));
}
}
for (IConfigurationElement rootConfig : ArrayUtils.safeArray(config.getChildren("root"))) {
String folder = rootConfig.getAttribute("folder");
if (!CommonUtils.isEmpty(folder)) {
roots.add(folder);
}
if ("true".equals(rootConfig.getAttribute("default"))) {
defaultRoot = folder;
}
}
if (CommonUtils.isEmpty(defaultRoot) && !CommonUtils.isEmpty(roots)) {
defaultRoot = roots.get(0);
}
}
void dispose()
{
this.handler = null;
this.handlerType = null;
}
@Override
public String getId() {
return id;
}
@Override
public String getName() {
return name;
}
@Override
public boolean isManagable() {
return managable;
}
@Override
public DBPImage getIcon() {
return icon;
}
public synchronized DBPResourceHandler getHandler()
{
if (handler == null) {
Class<? extends DBPResourceHandler> clazz = handlerType.getObjectClass(DBPResourceHandler.class);
if (clazz == null) {
return null;
}
try {
handler = clazz.newInstance();
} catch (Exception e) {
log.error("Can't instantiate resource handler", e);
}
}
return handler;
}
public boolean canHandle(IResource resource)
{
if (!contentTypes.isEmpty() && resource instanceof IFile) {
try {
IContentDescription contentDescription = ((IFile) resource).getContentDescription();
if (contentDescription != null) {
IContentType fileContentType = contentDescription.getContentType();
if (fileContentType != null && contentTypes.contains(fileContentType)) {
return true;
}
}
} catch (CoreException e) {
log.debug("Can't obtain content description for '" + resource.getName() + "'", e);
}
// Check for file extension
String fileExtension = resource.getFileExtension();
for (IContentType contentType : contentTypes) {
String[] ctExtensions = contentType.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
if (!ArrayUtils.isEmpty(ctExtensions)) {
for (String ext : ctExtensions) {
if (ext.equalsIgnoreCase(fileExtension)) {
return true;
}
}
}
}
}
if (!resourceTypes.isEmpty()) {
for (ObjectType objectType : resourceTypes) {
if (objectType.appliesTo(resource, null)) {
return true;
}
}
}
return false;
}
public Collection<IContentType> getContentTypes()
{
return contentTypes;
}
public Collection<ObjectType> getResourceTypes()
{
return resourceTypes;
}
public String getDefaultRoot(IProject project)
{
try {
IEclipsePreferences resourceHandlers = RuntimeUtils.getResourceHandlerPreferences(project, DBPResourceHandlerDescriptor.RESOURCE_ROOT_FOLDER_NODE);
return resourceHandlers.get(id, defaultRoot);
} catch (Exception e) {
log.error("Can't obtain resource handler preferences", e);
return null;
}
}
public List<String> getRoots()
{
return roots;
}
@Override
public String toString() {
return id;
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.registry;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.DBPImage;
import org.jkiss.dbeaver.model.app.DBPResourceHandler;
import org.jkiss.dbeaver.model.app.DBPResourceHandlerDescriptor;
import org.jkiss.dbeaver.model.impl.AbstractDescriptor;
import org.jkiss.dbeaver.utils.RuntimeUtils;
import org.jkiss.utils.ArrayUtils;
import org.jkiss.utils.CommonUtils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* ResourceHandlerDescriptor
*/
public class ResourceHandlerDescriptor extends AbstractDescriptor implements DBPResourceHandlerDescriptor
{
private static final Log log = Log.getLog(ResourceHandlerDescriptor.class);
public static final String EXTENSION_ID = "org.jkiss.dbeaver.resourceHandler"; //$NON-NLS-1$
private String id;
private String name;
private boolean managable;
private DBPImage icon;
private ObjectType handlerType;
private DBPResourceHandler handler;
private List<IContentType> contentTypes = new ArrayList<>();
private List<ObjectType> resourceTypes = new ArrayList<>();
private List<String> roots = new ArrayList<>();
private String defaultRoot;
public ResourceHandlerDescriptor(IConfigurationElement config)
{
super(config);
this.id = config.getAttribute(RegistryConstants.ATTR_ID);
this.name = config.getAttribute(RegistryConstants.ATTR_NAME);
this.managable = CommonUtils.toBoolean(config.getAttribute(RegistryConstants.ATTR_MANAGABLE));
this.icon = iconToImage(config.getAttribute(RegistryConstants.ATTR_ICON));
this.handlerType = new ObjectType(config.getAttribute(RegistryConstants.ATTR_CLASS));
for (IConfigurationElement contentTypeBinding : ArrayUtils.safeArray(config.getChildren("contentTypeBinding"))) {
String contentTypeId = contentTypeBinding.getAttribute("contentTypeId");
if (!CommonUtils.isEmpty(contentTypeId)) {
IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeId);
if (contentType != null) {
contentTypes.add(contentType);
} else {
log.warn("Content type '" + contentTypeId + "' not recognized");
}
}
}
for (IConfigurationElement resourceTypeBinding : ArrayUtils.safeArray(config.getChildren("resourceTypeBinding"))) {
String resourceType = resourceTypeBinding.getAttribute("resourceType");
if (!CommonUtils.isEmpty(resourceType)) {
resourceTypes.add(new ObjectType(resourceType));
}
}
for (IConfigurationElement rootConfig : ArrayUtils.safeArray(config.getChildren("root"))) {
String folder = rootConfig.getAttribute("folder");
if (!CommonUtils.isEmpty(folder)) {
roots.add(folder);
}
if ("true".equals(rootConfig.getAttribute("default"))) {
defaultRoot = folder;
}
}
if (CommonUtils.isEmpty(defaultRoot) && !CommonUtils.isEmpty(roots)) {
defaultRoot = roots.get(0);
}
}
void dispose()
{
this.handler = null;
this.handlerType = null;
}
@Override
public String getId() {
return id;
}
@Override
public String getName() {
return name;
}
@Override
public boolean isManagable() {
return managable;
}
@Override
public DBPImage getIcon() {
return icon;
}
public synchronized DBPResourceHandler getHandler()
{
if (handler == null) {
Class<? extends DBPResourceHandler> clazz = handlerType.getObjectClass(DBPResourceHandler.class);
if (clazz == null) {
return null;
}
try {
handler = clazz.newInstance();
} catch (Exception e) {
log.error("Can't instantiate resource handler", e);
}
}
return handler;
}
public boolean canHandle(IResource resource)
{
if (!contentTypes.isEmpty() && resource instanceof IFile) {
try {
IContentDescription contentDescription = ((IFile) resource).getContentDescription();
if (contentDescription != null) {
IContentType fileContentType = contentDescription.getContentType();
if (fileContentType != null && contentTypes.contains(fileContentType)) {
return true;
}
}
} catch (CoreException e) {
log.debug("Can't obtain content description for '" + resource.getName() + "'", e);
}
// Check for file extension
String fileExtension = resource.getFileExtension();
for (IContentType contentType : contentTypes) {
String[] ctExtensions = contentType.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
if (!ArrayUtils.isEmpty(ctExtensions)) {
for (String ext : ctExtensions) {
if (ext.equalsIgnoreCase(fileExtension)) {
return true;
}
}
}
}
}
if (!resourceTypes.isEmpty()) {
for (ObjectType objectType : resourceTypes) {
if (objectType.appliesTo(resource, null)) {
return true;
}
}
}
return false;
}
public Collection<IContentType> getContentTypes()
{
return contentTypes;
}
public Collection<ObjectType> getResourceTypes()
{
return resourceTypes;
}
public String getDefaultRoot(IProject project)
{
try {
IEclipsePreferences resourceHandlers = RuntimeUtils.getResourceHandlerPreferences(project, DBPResourceHandlerDescriptor.RESOURCE_ROOT_FOLDER_NODE);
return resourceHandlers.get(id, defaultRoot);
} catch (Exception e) {
log.error("Can't obtain resource handler preferences", e);
return null;
}
}
public List<String> getRoots()
{
return roots;
}
@Override
public String toString() {
return id;
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.registry;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.Log;
import java.util.Collection;
import java.util.StringTokenizer;
/**
* VersionUtils
*/
public class VersionUtils {
private static final Log log = Log.getLog(VersionUtils.class);
public static boolean isBetaVersion(@NotNull String versionInfo) {
return versionInfo.contains("beta") || versionInfo.contains("alpha");
}
@Nullable
public static String findLatestVersion(@NotNull Collection<String> allVersions) {
String latest = null;
for (String version : allVersions) {
if (isBetaVersion(version)) {
continue;
}
if (latest == null || compareVersions(version, latest) > 0) {
latest = version;
}
}
if (latest == null) {
// Now use beta versions too
for (String version : allVersions) {
if (latest == null || compareVersions(version, latest) > 0) {
latest = version;
}
}
}
return latest;
}
public static int compareVersions(@NotNull String v1, @NotNull String v2) {
StringTokenizer st1 = new StringTokenizer(v1, ".-_");
StringTokenizer st2 = new StringTokenizer(v2, ".-_");
while (st1.hasMoreTokens() && st2.hasMoreTokens()) {
String t1 = st1.nextToken();
String t2 = st2.nextToken();
try {
int cmp = Integer.parseInt(t1) - Integer.parseInt(t2);
if (cmp != 0) {
return cmp;
}
} catch (NumberFormatException e) {
// Non-numeric versions - use lexicographical compare
int cmp = t1.compareTo(t2);
if (cmp != 0) {
return cmp;
}
}
}
if (st1.hasMoreTokens()) {
return 1;
} else if (st2.hasMoreTokens()) {
return -1;
} else {
return 0;
}
}
}
......@@ -20,7 +20,7 @@ import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.registry.driver.DriverUtils;
import org.jkiss.dbeaver.registry.VersionUtils;
import org.jkiss.dbeaver.registry.maven.versioning.DefaultArtifactVersion;
import org.jkiss.dbeaver.registry.maven.versioning.VersionRange;
import org.jkiss.dbeaver.runtime.WebUtils;
......@@ -315,7 +315,7 @@ public class MavenArtifact implements IMavenIdentifier
switch (versionRef) {
case MavenArtifactReference.VERSION_PATTERN_RELEASE:
versionInfo = releaseVersion;
if (!CommonUtils.isEmpty(versionInfo) && DriverUtils.isBetaVersion(versionInfo)) {
if (!CommonUtils.isEmpty(versionInfo) && VersionUtils.isBetaVersion(versionInfo)) {
versionInfo = null;
}
break;
......@@ -334,7 +334,7 @@ public class MavenArtifact implements IMavenIdentifier
iter.remove();
}
}
versionInfo = DriverUtils.findLatestVersion(versions);
versionInfo = VersionUtils.findLatestVersion(versions);
} catch (Exception e) {
throw new IOException("Bad version pattern: " + regex);
}
......@@ -348,7 +348,7 @@ public class MavenArtifact implements IMavenIdentifier
throw new IOException("Artifact '" + this + "' has empty version list");
}
// Use latest version
versionInfo = DriverUtils.findLatestVersion(allVersions);
versionInfo = VersionUtils.findLatestVersion(allVersions);
}
} else {
if (versionRef.startsWith("[") || versionRef.startsWith("(")) {
......
......@@ -23,7 +23,7 @@ import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.access.DBAAuthInfo;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.registry.RegistryConstants;
import org.jkiss.dbeaver.registry.driver.DriverDescriptor;
import org.jkiss.dbeaver.runtime.DBWorkbench;
import org.jkiss.utils.CommonUtils;
import java.io.File;
......@@ -222,7 +222,7 @@ public class MavenRepository
extPath = id;
break;
}
File homeFolder = new File(DriverDescriptor.getCustomDriversHome(), "maven/" + extPath);
File homeFolder = new File(DBWorkbench.getPlatform().getCustomDriversHome(), "maven/" + extPath);
//File homeFolder = new File(DBeaverActivator.getInstance().getStateLocation().toFile(), "maven/" + extPath);
if (!homeFolder.exists()) {
if (!homeFolder.mkdirs()) {
......
package org.jkiss.dbeaver.registry.maven.versioning;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* Describes an artifact version in terms of its components, converts it to/from a string and
* compares two versions.
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
*/
public interface ArtifactVersion
extends Comparable<ArtifactVersion>
{
int getMajorVersion();
int getMinorVersion();
int getIncrementalVersion();
int getBuildNumber();
String getQualifier();
void parseVersion(String version);
}
package org.jkiss.dbeaver.registry.maven.versioning;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* Describes an artifact version in terms of its components, converts it to/from a string and
* compares two versions.
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
*/
public interface ArtifactVersion
extends Comparable<ArtifactVersion>
{
int getMajorVersion();
int getMinorVersion();
int getIncrementalVersion();
int getBuildNumber();
String getQualifier();
void parseVersion(String version);
}
package org.jkiss.dbeaver.registry.maven.versioning;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.util.NoSuchElementException;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
/**
* Default implementation of artifact versioning.
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
*/
public class DefaultArtifactVersion
implements ArtifactVersion {
private Integer majorVersion;
private Integer minorVersion;
private Integer incrementalVersion;
private Integer buildNumber;
private String qualifier;
private ComparableVersion comparable;
public DefaultArtifactVersion(String version) {
parseVersion(version);
}
@Override
public int hashCode() {
return 11 + comparable.hashCode();
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof ArtifactVersion)) {
return false;
}
return compareTo((ArtifactVersion) other) == 0;
}
public int compareTo(ArtifactVersion otherVersion) {
if (otherVersion instanceof DefaultArtifactVersion) {
return this.comparable.compareTo(((DefaultArtifactVersion) otherVersion).comparable);
} else {
return compareTo(new DefaultArtifactVersion(otherVersion.toString()));
}
}
public int getMajorVersion() {
return majorVersion != null ? majorVersion : 0;
}
public int getMinorVersion() {
return minorVersion != null ? minorVersion : 0;
}
public int getIncrementalVersion() {
return incrementalVersion != null ? incrementalVersion : 0;
}
public int getBuildNumber() {
return buildNumber != null ? buildNumber : 0;
}
public String getQualifier() {
return qualifier;
}
public final void parseVersion(String version) {
comparable = new ComparableVersion(version);
int index = version.indexOf("-");
String part1;
String part2 = null;
if (index < 0) {
part1 = version;
} else {
part1 = version.substring(0, index);
part2 = version.substring(index + 1);
}
if (part2 != null) {
try {
if ((part2.length() == 1) || !part2.startsWith("0")) {
buildNumber = Integer.valueOf(part2);
} else {
qualifier = part2;
}
} catch (NumberFormatException e) {
qualifier = part2;
}
}
if ((!part1.contains(".")) && !part1.startsWith("0")) {
try {
majorVersion = Integer.valueOf(part1);
} catch (NumberFormatException e) {
// qualifier is the whole version, including "-"
qualifier = version;
buildNumber = null;
}
} else {
boolean fallback = false;
StringTokenizer tok = new StringTokenizer(part1, ".");
try {
majorVersion = getNextIntegerToken(tok);
if (tok.hasMoreTokens()) {
minorVersion = getNextIntegerToken(tok);
}
if (tok.hasMoreTokens()) {
incrementalVersion = getNextIntegerToken(tok);
}
if (tok.hasMoreTokens()) {
qualifier = tok.nextToken();
fallback = Pattern.compile("\\d+").matcher(qualifier).matches();
}
// string tokenzier won't detect these and ignores them
if (part1.contains("..") || part1.startsWith(".") || part1.endsWith(".")) {
fallback = true;
}
} catch (NumberFormatException e) {
fallback = true;
}
if (fallback) {
// qualifier is the whole version, including "-"
qualifier = version;
majorVersion = null;
minorVersion = null;
incrementalVersion = null;
buildNumber = null;
}
}
}
private static Integer getNextIntegerToken(StringTokenizer tok) {
try {
String s = tok.nextToken();
if ((s.length() > 1) && s.startsWith("0")) {
throw new NumberFormatException("Number part has a leading 0: '" + s + "'");
}
return Integer.valueOf(s);
} catch (NoSuchElementException e) {
throw new NumberFormatException("Number is invalid");
}
}
@Override
public String toString() {
return comparable.toString();
}
}
package org.jkiss.dbeaver.registry.maven.versioning;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.util.NoSuchElementException;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
/**
* Default implementation of artifact versioning.
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
*/
public class DefaultArtifactVersion
implements ArtifactVersion {
private Integer majorVersion;
private Integer minorVersion;
private Integer incrementalVersion;
private Integer buildNumber;
private String qualifier;
private ComparableVersion comparable;
public DefaultArtifactVersion(String version) {
parseVersion(version);
}
@Override
public int hashCode() {
return 11 + comparable.hashCode();
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof ArtifactVersion)) {
return false;
}
return compareTo((ArtifactVersion) other) == 0;
}
public int compareTo(ArtifactVersion otherVersion) {
if (otherVersion instanceof DefaultArtifactVersion) {
return this.comparable.compareTo(((DefaultArtifactVersion) otherVersion).comparable);
} else {
return compareTo(new DefaultArtifactVersion(otherVersion.toString()));
}
}
public int getMajorVersion() {
return majorVersion != null ? majorVersion : 0;
}
public int getMinorVersion() {
return minorVersion != null ? minorVersion : 0;
}
public int getIncrementalVersion() {
return incrementalVersion != null ? incrementalVersion : 0;
}
public int getBuildNumber() {
return buildNumber != null ? buildNumber : 0;
}
public String getQualifier() {
return qualifier;
}
public final void parseVersion(String version) {
comparable = new ComparableVersion(version);
int index = version.indexOf("-");
String part1;
String part2 = null;
if (index < 0) {
part1 = version;
} else {
part1 = version.substring(0, index);
part2 = version.substring(index + 1);
}
if (part2 != null) {
try {
if ((part2.length() == 1) || !part2.startsWith("0")) {
buildNumber = Integer.valueOf(part2);
} else {
qualifier = part2;
}
} catch (NumberFormatException e) {
qualifier = part2;
}
}
if ((!part1.contains(".")) && !part1.startsWith("0")) {
try {
majorVersion = Integer.valueOf(part1);
} catch (NumberFormatException e) {
// qualifier is the whole version, including "-"
qualifier = version;
buildNumber = null;
}
} else {
boolean fallback = false;
StringTokenizer tok = new StringTokenizer(part1, ".");
try {
majorVersion = getNextIntegerToken(tok);
if (tok.hasMoreTokens()) {
minorVersion = getNextIntegerToken(tok);
}
if (tok.hasMoreTokens()) {
incrementalVersion = getNextIntegerToken(tok);
}
if (tok.hasMoreTokens()) {
qualifier = tok.nextToken();
fallback = Pattern.compile("\\d+").matcher(qualifier).matches();
}
// string tokenzier won't detect these and ignores them
if (part1.contains("..") || part1.startsWith(".") || part1.endsWith(".")) {
fallback = true;
}
} catch (NumberFormatException e) {
fallback = true;
}
if (fallback) {
// qualifier is the whole version, including "-"
qualifier = version;
majorVersion = null;
minorVersion = null;
incrementalVersion = null;
buildNumber = null;
}
}
}
private static Integer getNextIntegerToken(StringTokenizer tok) {
try {
String s = tok.nextToken();
if ((s.length() > 1) && s.startsWith("0")) {
throw new NumberFormatException("Number part has a leading 0: '" + s + "'");
}
return Integer.valueOf(s);
} catch (NoSuchElementException e) {
throw new NumberFormatException("Number is invalid");
}
}
@Override
public String toString() {
return comparable.toString();
}
}
package org.jkiss.dbeaver.registry.maven.versioning;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* Occurs when a version is invalid.
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
*/
public class InvalidVersionSpecificationException
extends Exception {
public InvalidVersionSpecificationException(String message) {
super(message);
}
}
package org.jkiss.dbeaver.registry.maven.versioning;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* Occurs when a version is invalid.
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
*/
public class InvalidVersionSpecificationException
extends Exception {
public InvalidVersionSpecificationException(String message) {
super(message);
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.registry.network;
import org.eclipse.core.runtime.IConfigurationElement;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.DBPDataSourceProvider;
import org.jkiss.dbeaver.model.net.DBWHandlerDescriptor;
import org.jkiss.dbeaver.model.net.DBWHandlerType;
import org.jkiss.dbeaver.model.net.DBWNetworkHandler;
import org.jkiss.dbeaver.model.impl.AbstractContextDescriptor;
import org.jkiss.dbeaver.registry.RegistryConstants;
import org.jkiss.utils.CommonUtils;
import java.util.Locale;
/**
* NetworkHandlerDescriptor
*/
public class NetworkHandlerDescriptor extends AbstractContextDescriptor implements DBWHandlerDescriptor
{
public static final String EXTENSION_ID = "org.jkiss.dbeaver.networkHandler"; //$NON-NLS-1$
private final String id;
private final String label;
private final String description;
private DBWHandlerType type;
private final boolean secured;
private final ObjectType handlerType;
private final int order;
NetworkHandlerDescriptor(
IConfigurationElement config)
{
super(config);
this.id = config.getAttribute(RegistryConstants.ATTR_ID);
this.label = config.getAttribute(RegistryConstants.ATTR_LABEL);
this.description = config.getAttribute(RegistryConstants.ATTR_DESCRIPTION);
this.type = DBWHandlerType.valueOf(config.getAttribute(RegistryConstants.ATTR_TYPE).toUpperCase(Locale.ENGLISH));
this.secured = CommonUtils.getBoolean(config.getAttribute(RegistryConstants.ATTR_SECURED), false);
this.handlerType = new ObjectType(config.getAttribute(RegistryConstants.ATTR_HANDLER_CLASS));
this.order = CommonUtils.toInt(config.getAttribute(RegistryConstants.ATTR_ORDER), 1);
}
@NotNull
public String getId()
{
return id;
}
public String getLabel()
{
return label;
}
public String getDescription()
{
return description;
}
public DBWHandlerType getType()
{
return type;
}
public boolean isSecured()
{
return secured;
}
public int getOrder() {
return order;
}
public boolean matches(DBPDataSourceProvider provider)
{
return appliesTo(provider);
}
public ObjectType getHandlerType() {
return handlerType;
}
public <T extends DBWNetworkHandler> T createHandler(Class<T> impl)
throws DBException
{
return handlerType.createInstance(impl);
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.registry.network;
import org.eclipse.core.runtime.IConfigurationElement;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.DBPDataSourceProvider;
import org.jkiss.dbeaver.model.net.DBWHandlerDescriptor;
import org.jkiss.dbeaver.model.net.DBWHandlerType;
import org.jkiss.dbeaver.model.net.DBWNetworkHandler;
import org.jkiss.dbeaver.model.impl.AbstractContextDescriptor;
import org.jkiss.dbeaver.registry.RegistryConstants;
import org.jkiss.utils.CommonUtils;
import java.util.Locale;
/**
* NetworkHandlerDescriptor
*/
public class NetworkHandlerDescriptor extends AbstractContextDescriptor implements DBWHandlerDescriptor
{
public static final String EXTENSION_ID = "org.jkiss.dbeaver.networkHandler"; //$NON-NLS-1$
private final String id;
private final String label;
private final String description;
private DBWHandlerType type;
private final boolean secured;
private final ObjectType handlerType;
private final int order;
NetworkHandlerDescriptor(
IConfigurationElement config)
{
super(config);
this.id = config.getAttribute(RegistryConstants.ATTR_ID);
this.label = config.getAttribute(RegistryConstants.ATTR_LABEL);
this.description = config.getAttribute(RegistryConstants.ATTR_DESCRIPTION);
this.type = DBWHandlerType.valueOf(config.getAttribute(RegistryConstants.ATTR_TYPE).toUpperCase(Locale.ENGLISH));
this.secured = CommonUtils.getBoolean(config.getAttribute(RegistryConstants.ATTR_SECURED), false);
this.handlerType = new ObjectType(config.getAttribute(RegistryConstants.ATTR_HANDLER_CLASS));
this.order = CommonUtils.toInt(config.getAttribute(RegistryConstants.ATTR_ORDER), 1);
}
@NotNull
public String getId()
{
return id;
}
public String getLabel()
{
return label;
}
public String getDescription()
{
return description;
}
public DBWHandlerType getType()
{
return type;
}
public boolean isSecured()
{
return secured;
}
public int getOrder() {
return order;
}
public boolean matches(DBPDataSourceProvider provider)
{
return appliesTo(provider);
}
public ObjectType getHandlerType() {
return handlerType;
}
public <T extends DBWNetworkHandler> T createHandler(Class<T> impl)
throws DBException
{
return handlerType.createInstance(impl);
}
}
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册