catch up with branch daily
Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
diff --git a/org.eclipse.osbp.preferences.feature/.project b/org.eclipse.osbp.preferences.feature/.project
index 40209d6..90ed8d8 100644
--- a/org.eclipse.osbp.preferences.feature/.project
+++ b/org.eclipse.osbp.preferences.feature/.project
@@ -16,12 +16,12 @@
</arguments>
</buildCommand>
<buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
+ <name>org.sonarlint.eclipse.core.sonarlintBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
- <name>org.sonarlint.eclipse.core.sonarlintBuilder</name>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
diff --git a/org.eclipse.osbp.preferences.feature/.settings/org.eclipse.xtend.core.Xtend.prefs b/org.eclipse.osbp.preferences.feature/.settings/org.eclipse.xtend.core.Xtend.prefs
index 0933f8c..19e3115 100644
--- a/org.eclipse.osbp.preferences.feature/.settings/org.eclipse.xtend.core.Xtend.prefs
+++ b/org.eclipse.osbp.preferences.feature/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -1,4 +1,5 @@
//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend
+BuilderConfiguration.is_project_specific=true
eclipse.preferences.version=1
is_project_specific=true
outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/data/ProductConfigurationStore.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/data/ProductConfigurationStore.java
index 29808fa..f005248 100644
--- a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/data/ProductConfigurationStore.java
+++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/data/ProductConfigurationStore.java
@@ -75,7 +75,7 @@
for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
if (project.isOpen()) {
IResource resource = ProductConfigurationPrefs.getPrefsFile(project);
- if ((resource != null) && resource.exists()) {
+ if (resource != null) {
availableProductProjects.put(project.getName(), project);
}
}
@@ -181,7 +181,7 @@
}
public String[][] getDataSourcesSelectItems() {
- String[] dataSourceNames = new TreeSet<String>(prefs.getDataSourceNames()).toArray(new String[0]);
+ String[] dataSourceNames = new TreeSet<>(prefs.getDataSourceNames()).toArray(new String[0]);
String[][] namesValues = new String[dataSourceNames.length][2];
for (int i = 0; i < dataSourceNames.length; i++) {
namesValues[i][0] = dataSourceNames[i];
@@ -369,7 +369,6 @@
case EXCHANGE_RATES_EURO_BASED_PREVIOUS: return prefsUsed.getEuroXRefRatesURLPrevious();
case JAVA_POS_CONFIGURATION: return prefsUsed.getJavaPosConfiguration();
case DATAINTERCHANGE_CONFIGURATION: return prefsUsed.getDatainterchangeConfiguration();
- case SIGNAL_CONFIGURATION: return prefsUsed.getSignalConfiguration();
case FILE_CONTENT: return getFileContent();
case LOCALIZATION_SUPPORTED_LANGUAGES: return getSupportedLanguages(prefsUsed);
case DATASOURCES: return DataSourceConfiguration.serialize(prefsUsed.getDataSources());
@@ -437,7 +436,6 @@
case EXCHANGE_RATES_EURO_BASED_PREVIOUS: prefs.setEuroForeignExchangeReferenceRatesURLPrevious(value); return;
case JAVA_POS_CONFIGURATION: prefs.setJavaPosConfiguration(value); return;
case DATAINTERCHANGE_CONFIGURATION: prefs.setDatainterchangeConfiguration(value); return;
- case SIGNAL_CONFIGURATION: prefs.setSignalConfiguration(value); return;
case FILE_CONTENT: return;
case FILE_LOCATION: return;
case FILE_NAME: return;
diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageDemo.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageDemo.java
index 416f4b2..38558af 100644
--- a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageDemo.java
+++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageDemo.java
@@ -33,9 +33,9 @@
return new Item[] {
new Item(Type.TEXT, Preference.SHOW_PRODUCT_CONFIGURATION, "Product Configuration", false),
new Item(""),
-// new Item(Type.BOOLEAN, Preference.DEMO_TOOLS_THEME, "Enable theme selection"),
+ new Item(Type.BOOLEAN, Preference.DEMO_TOOLS_THEME, "Enable theme selection", false),
// new Item(Type.BOOLEAN, Preference.DEMO_TOOLS_STRATEGY, "Enable layout-strategy selection"),
-// new Item(Type.BOOLEAN, Preference.DEMO_TOOLS_LANGUAGE, "Enable language/country selection"),
+ new Item(Type.BOOLEAN, Preference.DEMO_TOOLS_LANGUAGE, "Enable language/country selection", false),
new Item(Type.BOOLEAN, Preference.DEMO_TOOLS_PRINTSERVICE, "Enable print service selection"),
};
}
diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageExternalDataSources.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageExternalDataSources.java
index 8394f4d..be98230 100644
--- a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageExternalDataSources.java
+++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageExternalDataSources.java
@@ -17,7 +17,6 @@
import java.util.regex.Pattern;
import org.eclipse.jface.preference.FieldEditor;
-
import org.eclipse.osbp.preferences.Preference;
import org.eclipse.osbp.preferences.ui.component.APreferencePage;
import org.eclipse.osbp.preferences.ui.component.Item;
@@ -47,8 +46,6 @@
new Item("DataInterchange Settings"),
new Item(Type.TEXT, Preference.DATAINTERCHANGE_CONFIGURATION, "Configuration file"),
new Item(""),
- new Item("Signal Settings"),
- new Item(Type.TEXT, Preference.SIGNAL_CONFIGURATION, "Configuration file"),
};
}
diff --git a/org.eclipse.osbp.preferences/META-INF/MANIFEST.MF b/org.eclipse.osbp.preferences/META-INF/MANIFEST.MF
index d9575b6..f9bffb7 100644
--- a/org.eclipse.osbp.preferences/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.preferences/META-INF/MANIFEST.MF
@@ -5,7 +5,8 @@
Bundle-Version: 0.9.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.eclipse.osbp.preferences;version="0.9.0"
-Import-Package: javax.transaction,
+Import-Package: javax.annotation,
+ javax.transaction,
org.apache.commons.io,
org.apache.commons.lang3;version="3.1.0",
org.apache.log4j,
@@ -13,9 +14,9 @@
org.eclipse.core.resources,
org.eclipse.persistence.config;version="2.6.0",
org.eclipse.persistence.sessions;version="2.6.1",
+ org.joda.time;version="2.7.0",
org.osgi.framework;version="1.6.0",
- org.osgi.service.jdbc,
- javax.annotation
+ org.osgi.service.jdbc
Require-Bundle: org.slf4j.api;bundle-version="1.7.2",
org.eclipse.equinox.preferences,
javax.inject;bundle-version="1.0.0",
diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/AItemDescribed.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/AItemDescribed.java
index 46b4434..5b61814 100644
--- a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/AItemDescribed.java
+++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/AItemDescribed.java
@@ -41,8 +41,8 @@
}
// private final ItemDescription fDescription; // NOSONAR
- protected static final String VALUE_SEPARATOR = ":";
- protected static final String ITEM_SEPARATOR = ";";
+ protected static final String VALUE_SEPARATOR = "##";
+ protected static final String ITEM_SEPARATOR = "!!";
public AItemDescribed(ItemDescription description) {
// fDescription = description; // NOSONAR
diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/DataSourceConfiguration.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/DataSourceConfiguration.java
index 4020f83..412ea3a 100644
--- a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/DataSourceConfiguration.java
+++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/DataSourceConfiguration.java
@@ -1,56 +1,86 @@
-/**
- *
- * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
- */
+/******************************************************************************
+ * *
+ * Copyright (c) 2011 - 2016 - Loetz GmbH & Co KG, 69115 Heidelberg, Germany *
+ * *
+ * All rights reserved. This program and the accompanying materials *
+ * are made available under the terms of the Eclipse Public License v1.0 *
+ * which accompanies this distribution, and is available at *
+ * http://www.eclipse.org/legal/epl-v10.html *
+ * *
+ *============================================================================*
+ * Initial contribution: *
+ * Loetz GmbH & Co. KG, Loetz GmbH & Co KG *
+ ******************************************************************************/
package org.eclipse.osbp.preferences;
+import java.time.ZoneId;
import java.util.Collection;
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;
+import org.joda.time.DateTimeZone;
import org.osgi.service.jdbc.DataSourceFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+// TODO: Auto-generated Javadoc
/**
- * Helper class containing DataSource configuration data needed for JPA and JDBC
+ * Helper class containing DataSource configuration data needed for JPA and
+ * JDBC.
*/
public class DataSourceConfiguration extends AItemDescribed {
+ /** The Constant LOGGER. */
private static final Logger LOGGER = LoggerFactory.getLogger(DataSourceConfiguration.class);
+ /**
+ * The Class DataSourceItemDescription.
+ */
public static final class DataSourceItemDescription extends ItemDescription {
+ /** The Constant INSTANCE. */
public static final DataSourceItemDescription INSTANCE = new DataSourceItemDescription();
+ /** The Constant ROW_NAME. */
private static final String ROW_NAME = "JNDI Data Source";
+
+ /** The Constant DATABASE_TYPE. */
public static final String DATABASE_TYPE = "Database Type";
+
+ /** The Constant DRIVER_CLASS. */
public static final String DRIVER_CLASS = "Driver Class";
+
+ /** The Constant SERVER_NAME. */
public static final String SERVER_NAME = "Server Name";
+
+ /** The Constant SERVER_PORT. */
public static final String SERVER_PORT = "Server Port";
+
+ /** The Constant SERVER_TIMEZONE. */
+ public static final String SERVER_TIMEZONE = "Server Timezone";
+
+ /** The Constant DATABASE_NAME. */
public static final String DATABASE_NAME = "Database Name";
+
+ /** The Constant DATABASE_USER. */
public static final String DATABASE_USER = "Database User";
+
+ /** The Constant DATABASE_PASSWORD. */
public static final String DATABASE_PASSWORD = "Database Password"; // NOSONAR
+ /**
+ * Instantiates a new data source item description.
+ */
protected DataSourceItemDescription() {
super(ROW_NAME,
DATABASE_TYPE, Type.DatabaseType,
DRIVER_CLASS, Type.String,
SERVER_NAME, Type.String,
SERVER_PORT, Type.Integer,
+ SERVER_TIMEZONE, Type.String,
DATABASE_NAME, Type.String,
DATABASE_USER, Type.String,
DATABASE_PASSWORD, Type.String
@@ -58,20 +88,49 @@
}
}
+ /** The name. */
private String fName;
+
+ /** The data base vendor. */
private EnumDatabaseVendor fDataBaseVendor;
+
+ /** The driver vendor. */
private String fDriverVendor;
+
+ /** The driver type. */
private String fDriverType;
+
+ /** The driver class. */
private String fDriverClass;
+
+ /** The server name. */
private String fServerName;
+
+ /** The server port. */
private int fServerPort;
+
+ /** The server timezone. */
+ private String fServerTimezone;
+
+ /** The database name. */
private String fDatabaseName;
+
+ /** The database user. */
private String fDatabaseUser;
+
+ /** The database pass. */
private String fDatabasePass;
+
+ /** The jdbc url format. */
private String fJdbcUrlFormat;
+
+ /** The Constant WORKER. */
private static final DataSourceConfiguration WORKER = new DataSourceConfiguration();
+ /**
+ * Instantiates a new data source configuration.
+ */
private DataSourceConfiguration() {
super(DataSourceItemDescription.INSTANCE);
fName = null;
@@ -81,12 +140,31 @@
fDriverClass = null;
fServerName = null;
fServerPort = 0;
+ fServerTimezone = null;
fDatabaseName = null;
fDatabaseUser = null;
fDatabasePass = null;
fJdbcUrlFormat = null;
}
+ /**
+ * Instantiates a new data source configuration.
+ *
+ * @param name
+ * the name
+ * @param dataBaseVendor
+ * the data base vendor
+ * @param serverName
+ * the server name
+ * @param serverPort
+ * the server port
+ * @param databaseName
+ * the database name
+ * @param databaseUser
+ * the database user
+ * @param databasePass
+ * the database pass
+ */
public DataSourceConfiguration(
String name,
EnumDatabaseVendor dataBaseVendor,
@@ -104,14 +182,39 @@
);
}
+ /**
+ * Instantiates a new data source configuration.
+ *
+ * @param name
+ * the name
+ * @param dataBaseVendor
+ * the data base vendor
+ * @param driverVendor
+ * the driver vendor
+ * @param driverType
+ * the driver type
+ * @param driverClass
+ * the driver class
+ * @param serverName
+ * the server name
+ * @param serverPort
+ * the server port
+ * @param databaseName
+ * the database name
+ * @param databaseUser
+ * the database user
+ * @param databasePass
+ * the database pass
+ * @param jdbcUrlFormat
+ * the jdbc url format
+ */
protected DataSourceConfiguration( // NOSONAR
String name,
EnumDatabaseVendor dataBaseVendor,
String driverVendor, String driverType, String driverClass,
String serverName, int serverPort,
String databaseName, String databaseUser, String databasePass,
- String jdbcUrlFormat) {
- super(DataSourceItemDescription.INSTANCE);
+ String jdbcUrlFormat) { super(DataSourceItemDescription.INSTANCE);
fName = name;
fDataBaseVendor = dataBaseVendor;
fDriverVendor = (driverVendor == null || driverVendor.isEmpty()) ? dataBaseVendor.getDriverVendor() : driverVendor;
@@ -119,22 +222,82 @@
fDriverClass = (driverClass == null || driverClass.isEmpty()) ? dataBaseVendor.getDriverClass() : driverClass;
fServerName = (serverName == null ? "" : serverName);
fServerPort = (serverPort < 0 ? 0 : serverPort);
+ fServerTimezone = DateTimeZone.forID( ZoneId.systemDefault().normalized().toString()).getNameKey(0) ;
fDatabaseName = databaseName;
fDatabaseUser = databaseUser;
fDatabasePass = databasePass;
fJdbcUrlFormat = jdbcUrlFormat;
}
+ /**
+ * Instantiates a new data source configuration.
+ *
+ * @param name
+ * the name
+ * @param dataBaseVendor
+ * the data base vendor
+ * @param driverVendor
+ * the driver vendor
+ * @param driverType
+ * the driver type
+ * @param driverClass
+ * the driver class
+ * @param serverName
+ * the server name
+ * @param serverPort
+ * the server port
+ * @param databaseName
+ * the database name
+ * @param databaseUser
+ * the database user
+ * @param databasePass
+ * the database pass
+ * @param jdbcUrlFormat
+ * the jdbc url format
+ * @param serverTimeZone
+ * the server time zone
+ */
+ protected DataSourceConfiguration( // NOSONAR
+ String name,
+ EnumDatabaseVendor dataBaseVendor,
+ String driverVendor, String driverType, String driverClass,
+ String serverName, int serverPort,
+ String databaseName, String databaseUser, String databasePass,
+ String jdbcUrlFormat,
+ String serverTimeZone) { super(DataSourceItemDescription.INSTANCE);
+ fName = name;
+ fDataBaseVendor = dataBaseVendor;
+ fDriverVendor = (driverVendor == null || driverVendor.isEmpty()) ? dataBaseVendor.getDriverVendor() : driverVendor;
+ fDriverType = (driverType == null || driverType.isEmpty()) ? dataBaseVendor.getDriverType() : driverType;
+ fDriverClass = (driverClass == null || driverClass.isEmpty()) ? dataBaseVendor.getDriverClass() : driverClass;
+ fServerName = (serverName == null ? "" : serverName);
+ fServerPort = (serverPort < 0 ? 0 : serverPort);
+ fServerTimezone = serverTimeZone;
+ fDatabaseName = databaseName;
+ fDatabaseUser = databaseUser;
+ fDatabasePass = databasePass;
+ fJdbcUrlFormat = jdbcUrlFormat;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.preferences.IItemDescribed#getName()
+ */
@Override
public String getName() {
return fName;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.preferences.IItemDescribed#setName(java.lang.String)
+ */
@Override
public void setName(String name) {
fName = name;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.preferences.IItemDescribed#getValue(java.lang.String)
+ */
@Override
public String getValue(String attribute) { // NOSONAR
switch (attribute) { // NOSONAR
@@ -142,6 +305,7 @@
case DataSourceItemDescription.DRIVER_CLASS: return fDriverClass;
case DataSourceItemDescription.SERVER_NAME: return fServerName;
case DataSourceItemDescription.SERVER_PORT: return ((Integer)fServerPort).toString();
+ case DataSourceItemDescription.SERVER_TIMEZONE: return fServerTimezone;
case DataSourceItemDescription.DATABASE_NAME: return fDatabaseName;
case DataSourceItemDescription.DATABASE_USER: return fDatabaseUser;
case DataSourceItemDescription.DATABASE_PASSWORD: return fDatabasePass;
@@ -149,6 +313,9 @@
return null;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.preferences.IItemDescribed#setValue(java.lang.String, java.lang.String)
+ */
@Override
public void setValue(String attribute, String value) {
switch (attribute) { // NOSONAR
@@ -171,6 +338,10 @@
fServerPort = ItemDescription.parseInt(value, fServerPort);
break;
}
+ case DataSourceItemDescription.SERVER_TIMEZONE: { // NOSONAR
+ fServerTimezone = value;
+ break;
+ }
case DataSourceItemDescription.DATABASE_NAME: { // NOSONAR
fDatabaseName = value;
break;
@@ -187,44 +358,110 @@
}
/**
- * @return the name of the jdbc driver class
+ * Gets the driver class.
+ *
+ * @return the name of the jdbc driver class
*/
public String getDriverClass() {
return fDriverClass;
}
+ /**
+ * Gets the driver vendor.
+ *
+ * @return the driver vendor
+ */
public String getDriverVendor() {
return fDriverVendor;
}
+ /**
+ * Gets the driver type.
+ *
+ * @return the driver type
+ */
public String getDriverType() {
return fDriverType;
}
+ /**
+ * Gets the server name.
+ *
+ * @return the server name
+ */
public String getServerName() {
return fServerName;
}
+ /**
+ * Gets the server port.
+ *
+ * @return the server port
+ */
public int getServerPort() {
return fServerPort;
}
+ /**
+ * Gets the server timezone.
+ *
+ * @return the server timezone
+ */
+ public String getServerTimezone() {
+ return fServerTimezone;
+ }
+
+
+ /**
+ * Gets the database name.
+ *
+ * @return the database name
+ */
public String getDatabaseName() {
return fDatabaseName;
}
+ /**
+ * Gets the database user.
+ *
+ * @return the database user
+ */
public String getDatabaseUser() {
return fDatabaseUser;
}
+ /**
+ * Gets the database password.
+ *
+ * @return the database password
+ */
public String getDatabasePass() {
return fDatabasePass; // NOSONAR
}
+
+ /**
+ * Gets the jdbc URL.
+ *
+ * @return the jdbc URL
+ */
+ public String getJdbcURL() {
+ return fDataBaseVendor.jdbcUrl(fDriverVendor, fDriverType, fServerName, fServerPort, fDatabaseName, fJdbcUrlFormat,fServerTimezone, fDatabaseUser, fDatabasePass); // NOSONAR
+ }
+ /**
+ * Gets the database vendor.
+ *
+ * @return the database vendor
+ */
public EnumDatabaseVendor getDatabaseVendor() {
return fDataBaseVendor;
}
+ /**
+ * Gets the default batch writing.
+ *
+ * @return the default batch writing
+ */
public String getDefaultBatchWriting() {
if (fDataBaseVendor != null) {
return fDataBaseVendor.getPersistenceBatchWriting();
@@ -232,14 +469,23 @@
return null;
}
+ /**
+ * Gets the default schema name.
+ *
+ * @return the default schema name
+ */
public String getDefaultSchemaName() {
switch (fDataBaseVendor) { // NOSONAR
case H2_IN_MEMORY:
return "h2memory";
case H2_LOCAL_FILE:
return "h2localfile";
+ case MSSQL:
+ return "dbo";
case MYSQL:
return getDatabaseName();
+ case MYSQL8:
+ return getDatabaseName();
case ORACLE:
return getDatabaseUser();
case DERBY_IN_MEMORY:
@@ -253,7 +499,9 @@
}
/**
- * @return the properties needed to define a DataSource
+ * Gets the data source properties.
+ *
+ * @return the properties needed to define a DataSource
*/
protected Properties getDataSourceProperties() {
Properties properties = new Properties();
@@ -265,10 +513,32 @@
setDataSourceProperty(properties, DataSourceFactory.JDBC_DATABASE_NAME, fDatabaseName);
setDataSourceProperty(properties, DataSourceFactory.JDBC_USER, fDatabaseUser);
setDataSourceProperty(properties, DataSourceFactory.JDBC_PASSWORD, fDatabasePass);
- setDataSourceProperty(properties, DataSourceFactory.JDBC_URL, fDataBaseVendor.jdbcUrl(fDriverVendor, fDriverType, fServerName, fServerPort, fDatabaseName, fJdbcUrlFormat));
+ setDataSourceProperty(properties, DataSourceFactory.JDBC_URL, getJdbcURL());
+ if (LOGGER.isDebugEnabled() ) {
+
+ LOGGER.debug("DataBaseVendor: {}", fDataBaseVendor );
+ if (fDriverType != null && fDriverType.length() > 0) {
+ LOGGER.debug("drivertype: {}", fDriverType);
+ }
+ LOGGER.debug("JDBC_SERVER_NAME: {}", fServerName);
+ LOGGER.debug("JDBC_PORT_NUMBER: {}", fServerPort);
+ LOGGER.debug("JDBC_DATABASE_NAME: {}", fDatabaseName);
+ LOGGER.debug("JDBC_USER: {}", fDatabaseUser);
+ LOGGER.debug("JDBC_URL: {}", getJdbcURL());
+ }
return properties;
}
+ /**
+ * Sets the data source property.
+ *
+ * @param properties
+ * the properties
+ * @param key
+ * the key
+ * @param value
+ * the value
+ */
private void setDataSourceProperty(Properties properties, String key, String value) {
if (fDataBaseVendor.supportsPropertyKey(key)) {
properties.put(key, value);
@@ -279,17 +549,22 @@
}
/**
- * @return the properties needed to define a JPA connection
+ * Gets the jpa properties.
+ *
+ * @return the properties needed to define a JPA connection
*/
protected Properties getJpaProperties() {
Properties properties = new Properties();
properties.put("javax.persistence.jdbc.driver" , getDriverClass());
- properties.put("javax.persistence.jdbc.url" , fDataBaseVendor.jdbcUrl(fDriverVendor, fDriverType, fServerName, fServerPort, fDatabaseName, fJdbcUrlFormat));
+ properties.put("javax.persistence.jdbc.url" , getJdbcURL());
properties.put("javax.persistence.jdbc.user" , fDatabaseUser);
properties.put("javax.persistence.jdbc.password", fDatabasePass);
return properties;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.preferences.AItemDescribed#_serialize()
+ */
@Override
protected String _serialize() {
return fName
@@ -306,6 +581,9 @@
;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.preferences.AItemDescribed#_deserialize(java.lang.String)
+ */
@Override
protected AItemDescribed _deserialize(String serialized) {
String[] tokens = serialized.split(VALUE_SEPARATOR);
@@ -327,6 +605,13 @@
);
}
+ /**
+ * Serialize.
+ *
+ * @param dataSources
+ * the data sources
+ * @return the string
+ */
public static String serialize(Collection<DataSourceConfiguration> dataSources) {
String retcode = null;
for (DataSourceConfiguration datasource : dataSources) {
@@ -340,6 +625,13 @@
return retcode;
}
+ /**
+ * Deserialize.
+ *
+ * @param value
+ * the value
+ * @return the map
+ */
public static Map<String, DataSourceConfiguration> deserialize(String value) {
Map<String, DataSourceConfiguration> dataSources = new TreeMap<>();
String[] datasourceItems = value.split(ITEM_SEPARATOR);
@@ -350,16 +642,25 @@
return dataSources;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.preferences.AItemDescribed#getSubItems()
+ */
@Override
public SubItem[] getSubItems() {
return null;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.preferences.AItemDescribed#getIconName()
+ */
@Override
public String getIconName() {
return null;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.preferences.AItemDescribed#getRowName()
+ */
@Override
public String getRowName() {
return null;
diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/EnumDatabaseVendor.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/EnumDatabaseVendor.java
index 2d97189..fea1ae9 100644
--- a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/EnumDatabaseVendor.java
+++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/EnumDatabaseVendor.java
@@ -1,38 +1,45 @@
-/**
- *
- * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
- */
+/******************************************************************************
+ * *
+ * Copyright (c) 2011 - 2016 - Loetz GmbH & Co KG, 69115 Heidelberg, Germany *
+ * *
+ * All rights reserved. This program and the accompanying materials *
+ * are made available under the terms of the Eclipse Public License v1.0 *
+ * which accompanies this distribution, and is available at *
+ * http://www.eclipse.org/legal/epl-v10.html *
+ * *
+ *============================================================================*
+ * Initial contribution: *
+ * Loetz GmbH & Co. KG, Loetz GmbH & Co KG *
+ ******************************************************************************/
package org.eclipse.osbp.preferences;
+import java.sql.Date;
+import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
-import org.eclipse.core.runtime.IBundleGroup;
-import org.eclipse.core.runtime.IBundleGroupProvider;
-import org.eclipse.core.runtime.Platform;
-import org.osgi.framework.Bundle;
-
+// TODO: Auto-generated Javadoc
class VARIABLE { // NOSONAR
protected static final String VENDOR = "%%VENDOR%%";
protected static final String TYPE = "%%TYPE%%";
protected static final String SERVER = "%%SERVER%%";
+ protected static final String SERVERINSTANCE = "%%INSTANCE%%";
protected static final String PORT = "%%PORT%%";
protected static final String DATABASE = "%%DATABASE%%";
+ protected static final String DATABASESCHEMA = "%%DATABASESCHEMA%%";
protected static final String USERHOME = "%%USERHOME%%";
+ protected static final String TIMEZONE = "%%TIMEZONE%%";
+ protected static final String USERNAME = "%%USERNAME%%";
+ protected static final String PASSWORD = "%%PASSWORD%%";
}
+/**
+ * The Enum EnumDatabaseVendor.
+ */
public enum EnumDatabaseVendor {
+
+ /** The derby in memory. */
/*
* ... // http://hsqldb.org/doc/src/org/hsqldb/jdbc/JDBCDriver.html //
* http://hsqldb.org/doc/guide/dbproperties-chapt.html HSQLDB_IN_MEMORY
@@ -81,9 +88,10 @@
}
},
// https://db.apache.org/derby/papers/DerbyTut/embedded_intro.html
+ /** The derby local file. */
// https://db.apache.org/derby/integrate/plugin_help/derby_app.html
DERBY_LOCAL_FILE(false, "derby", "", "org.apache.derby.jdbc.EmbeddedDriver",
- "jdbc:derby:directory:" + VARIABLE.USERHOME + "/" + VARIABLE.DATABASE
+ "jdbc:derby:directory:" + VARIABLE.DATABASE
// https://db.apache.org/derby/docs/10.8/devguide/cdevdvlp17453.html
// https://db.apache.org/derby/docs/10.8/devguide/cdevdvlpinmemdb.html
// https://db.apache.org/derby/docs/10.8/devguide/cdevdvlp40653.html
@@ -99,6 +107,7 @@
}
},
// https://karussell.wordpress.com/2009/06/09/hibernate-cfg-xml-settings-for-derby-oracle-and-h2/
+ /** The derby client. */
// https://db.apache.org/derby/integrate/plugin_help/derby_app.html
DERBY_CLIENT(false, "derby", "", "org.apache.derby.jdbc.ClientDriver",
"jdbc:derby://" + VARIABLE.SERVER + ":" + VARIABLE.PORT + "/" + VARIABLE.DATABASE + ";create=true", "JDBC",
@@ -112,6 +121,8 @@
return sqlStatement.replace(ONE_ROW_ONE_COLUMN_TABLE, ONE_ROW_ONE_COLUMN_TABLE_DERBY);
}
},
+
+ /** The h2 in memory. */
// http://www.h2database.com/html/features.html#in_memory_databases
H2_IN_MEMORY(true, "h2", "", "org.h2.Driver", "jdbc:h2:mem:" + VARIABLE.DATABASE
// http://h2database.com/html/features.html#execute_sql_on_connection
@@ -152,16 +163,18 @@
}
},
+
+ /** The h2 local file. */
// http://www.h2database.com/html/features.html#database_url
- H2_LOCAL_FILE(false, "h2", "", "org.h2.Driver", "jdbc:h2:file:" + VARIABLE.USERHOME + "/" + VARIABLE.DATABASE
+ H2_LOCAL_FILE(false, "h2", "", "org.h2.Driver", "jdbc:h2:file:" + VARIABLE.DATABASE
// http://h2database.com/html/features.html#execute_sql_on_connection
+ ";LOCK_MODE=0" + ";INIT="
// create schema on initial startup
- + "CREATE SCHEMA IF NOT EXISTS " + VARIABLE.DATABASE
+ + "CREATE SCHEMA IF NOT EXISTS " + VARIABLE.DATABASESCHEMA
// SEPARATOR between multipe SQL commandos
+ "\\;"
// use this schema as default
- + "SET SCHEMA " + VARIABLE.DATABASE
+ + "SET SCHEMA " + VARIABLE.DATABASESCHEMA
// SEPARATOR between multipe SQL commandos
+ "\\;"
// ??? set autocommit to false due to own implemented commit
@@ -189,18 +202,82 @@
return "APP";
}
},
+
+ //jdbc:sqlserver://<server>:<port>;databaseName=<databasename>
+
+ /** The mssql. */
+ MSSQL(false, "sqlserver", "thin", "com.microsoft.sqlserver.jdbc.SQLServerDriver",
+ "jdbc:sqlserver://" + VARIABLE.SERVER + ":" + VARIABLE.PORT + ";databaseName=" + VARIABLE.DATABASE +";instanceName=" + VARIABLE.SERVERINSTANCE + ";trustServerCertificate=true;Integrated Security=false;", "JDBC",
+ "URL, databaseName, authentication, instanceName, serverName, trustServerCertificate, url, user, password",
+ "org.hibernate.dialect.SQLServerDialect",
+ " <plugin id=\"org.eclipse.gemini.dbaccess.mssql\" autoStart=\"true\" startLevel=\"2\" />",
+ " <feature id=\"org.osbee.technologystack.mssql.feature\"/>\n",
+ "id int",
+ "uuid String") {
+ @Override
+ public String applySqlSpecifications(String sqlStatement) {
+ return sqlStatement.replace(ONE_ROW_ONE_COLUMN_TABLE, ONE_ROW_ONE_COLUMN_TABLE_MYSQL);
+ }
+
+
+ @Override
+ public String convertToDateSQL(Date date) {
+ return "cast('"+date.toString().replace(".0","")+"' as datetime)";
+ }
+
+ @Override
+ public String convertToTimestampSQL(Timestamp date) {
+ return "cast('"+date.toString().replace(".0","")+"' as datetime2)";
+ }
+
+ },
// see samples
// -
// http://dev.mysql.com/doc/connector-j/en/connector-j-usagenotes-connect-drivermanager.html
// -
// http://www.mkyong.com/jdbc/how-to-connect-to-mysql-with-jdbc-driver-java/
+ /** The mysql. */
// - http://www.vogella.com/tutorials/MySQLJava/article.html
MYSQL(false, "mysql", "thin", "com.mysql.jdbc.Driver",
- "jdbc:" + VARIABLE.VENDOR + "://" + VARIABLE.SERVER + ":" + VARIABLE.PORT + "/" + VARIABLE.DATABASE, "JDBC",
- "URL, allowLoadLocalInfile, allowMasterDownConnections, allowMultiQueries, allowNanAndInf, allowUrlInLocalInfile, alwaysSendSetIsolation, authenticationPlugins, autoClosePStmtStreams, autoDeserialize, autoGenerateTestcaseScript, autoReconnect, autoReconnectForConnectionPools, autoReconnectForPools, autoSlowLog, blobsAreStrings, cacheCallableStatements, cacheCallableStmts, cachePrepStmts, cachePreparedStatements, cacheResultSetMetadata, cacheServerConfiguration, callableStatementCacheSize, callableStmtCacheSize, capitalizeDBMDTypes, capitalizeTypeNames, characterEncoding, characterSetResults, clientCertificateKeyStorePassword, clientCertificateKeyStoreType, clientCertificateKeyStoreUrl, clientInfoProvider, clobCharacterEncoding, clobberStreamingResults, compensateOnDuplicateKeyUpdateCounts, connectTimeout, connectionAttributes, connectionCollation, connectionLifecycleInterceptors, continueBatchOnError, createDatabaseIfNotExist, databaseName, defaultAuthenticationPlugin, defaultFetchSize, detectCustomCollations, detectServerPreparedStmts, disabledAuthenticationPlugins, disconnectOnExpiredPasswords, dontTrackOpenResources, dumpMetadataOnColumnNotFound, dumpQueriesOnException, dynamicCalendars, elideSetAutoCommits, emptyStringsConvertToZero, emulateLocators, emulateUnsupportedPstmts, enablePacketDebug, enableQueryTimeouts, encoding, exceptionInterceptors, explainSlowQueries, failOverReadOnly, functionsNeverReturnBlobs, gatherPerfMetrics, gatherPerformanceMetrics, generateSimpleParameterMetadata, getProceduresReturnsFunctions, holdResultsOpenOverStatementClose, ignoreNonTxTables, includeInnodbStatusInDeadlockExceptions, includeThreadDumpInDeadlockExceptions, includeThreadNamesAsStatementComment, initialTimeout, interactiveClient, isInteractiveClient, jdbcCompliantTruncation, jdbcCompliantTruncationForReads, largeRowSizeThreshold, loadBalanceAutoCommitStatementRegex, loadBalanceAutoCommitStatementThreshold, loadBalanceBlacklistTimeout, loadBalanceConnectionGroup, loadBalanceEnableJMX, loadBalanceExceptionChecker, loadBalancePingTimeout, loadBalanceSQLExceptionSubclassFailover, loadBalanceSQLStateFailover, loadBalanceStrategy, loadBalanceValidateConnectionOnSwapServer, localSocketAddress, logSlowQueries, logWriter, logXaCommands, logger, loggerClassName, loginTimeout, maintainTimeStats, maxAllowedPacket, maxQuerySizeToLog, maxReconnects, maxRows, metadataCacheSize, netTimeoutForStreamingResults, noAccessToProcedureBodies, noDatetimeStringSync, noTimezoneConversionForTimeType, nullCatalogMeansCurrent, nullNamePatternMatchesAll, overrideSupportsIntegrityEnhancementFacility, packetDebugBufferSize, padCharsWithSpace, paranoid, parseInfoCacheFactory, password, passwordCharacterEncoding, pedantic, pinGlobalTxToPhysicalConnection, populateInsertRowWithDefaultValues, port, portNumber, prepStmtCacheSize, prepStmtCacheSqlLimit, preparedStatementCacheSize, preparedStatementCacheSqlLimit, processEscapeCodesForPrepStmts, profileSQL, profileSql, profilerEventHandler, propertiesTransform, propertiesViaRef, queriesBeforeRetryMaster, queryTimeoutKillsConnection, reconnectAtTxEnd, relaxAutoCommit, replicationEnableJMX, reportMetricsIntervalMillis, requireSSL, resourceId, resultSetSizeThreshold, retainStatementAfterResultSetClose, retriesAllDown, rewriteBatchedStatements, rollbackOnPooledClose, roundRobinLoadBalance, runningCTS13, secondsBeforeRetryMaster, selfDestructOnPingMaxOperations, selfDestructOnPingSecondsLifetime, serverConfigCacheFactory, serverName, serverTimezone, sessionVariables, slowQueryThresholdMillis, slowQueryThresholdNanos, socketFactory, socketFactoryClassName, socketTimeout, statementInterceptors, strictFloatingPoint, strictUpdates, tcpKeepAlive, tcpNoDelay, tcpRcvBuf, tcpSndBuf, tcpTrafficClass, tinyInt1isBit, traceProtocol, transformedBitIsBoolean, treatUtilDateAsTimestamp, trustCertificateKeyStorePassword, trustCertificateKeyStoreType, trustCertificateKeyStoreUrl, ultraDevHack, url, useAffectedRows, useBlobToStoreUTF8OutsideBMP, useColumnNamesInFindColumn, useCompression, useConfigs, useCursorFetch, useDirectRowUnpack, useDynamicCharsetInfo, useFastDateParsing, useFastIntParsing, useGmtMillisForDatetimes, useHostsInPrivileges, useInformationSchema, useJDBCCompliantTimezoneShift, useJvmCharsetConverters, useLegacyDatetimeCode, useLocalSessionState, useLocalTransactionState, useNanosForElapsedTime, useOldAliasMetadataBehavior, useOldUTF8Behavior, useOnlyServerErrorMessages, useReadAheadInput, useSSL, useSSPSCompatibleTimezoneShift, useServerPrepStmts, useServerPreparedStmts, useSqlStateCodes, useStreamLengthsInPrepStmts, useTimezone, useUltraDevWorkAround, useUnbufferedInput, useUnicode, useUsageAdvisor, user, utf8OutsideBmpExcludedColumnNamePattern, utf8OutsideBmpIncludedColumnNamePattern, verifyServerCertificate, yearIsDateType, zeroDateTimeBehavior",
+ "jdbc:mysql://" + VARIABLE.SERVER + ":" + VARIABLE.PORT + "/" + VARIABLE.DATABASE + "?useSSL=false&useLegacyDatetimeCode=false&serverTimezone=" + VARIABLE.TIMEZONE, "JDBC",
+ "URL, allowLoadLocalInfile, allowMasterDownConnections, allowMultiQueries, allowNanAndInf, allowUrlInLocalInfile, alwaysSendSetIsolation," +
+ " authenticationPlugins, autoClosePStmtStreams, autoDeserialize, autoGenerateTestcaseScript, autoReconnect, autoReconnectForConnectionPools," +
+ " autoReconnectForPools, autoSlowLog, blobsAreStrings, cacheCallableStatements, cacheCallableStmts, cachePrepStmts, cachePreparedStatements," +
+ " cacheResultSetMetadata, cacheServerConfiguration, callableStatementCacheSize, callableStmtCacheSize, capitalizeDBMDTypes, capitalizeTypeNames," +
+ " characterEncoding, characterSetResults, clientCertificateKeyStorePassword, clientCertificateKeyStoreType, clientCertificateKeyStoreUrl," +
+ " clientInfoProvider, clobCharacterEncoding, clobberStreamingResults, compensateOnDuplicateKeyUpdateCounts, connectTimeout, connectionAttributes," +
+ " connectionCollation, connectionLifecycleInterceptors, continueBatchOnError, createDatabaseIfNotExist, databaseName, defaultAuthenticationPlugin," +
+ " defaultFetchSize, detectCustomCollations, detectServerPreparedStmts, disabledAuthenticationPlugins, disconnectOnExpiredPasswords, dontTrackOpenResources," +
+ " dumpMetadataOnColumnNotFound, dumpQueriesOnException, dynamicCalendars, elideSetAutoCommits, emptyStringsConvertToZero, emulateLocators," +
+ " emulateUnsupportedPstmts, enablePacketDebug, enableQueryTimeouts, encoding, exceptionInterceptors, explainSlowQueries, failOverReadOnly," +
+ " functionsNeverReturnBlobs, gatherPerfMetrics, gatherPerformanceMetrics, generateSimpleParameterMetadata, getProceduresReturnsFunctions," +
+ " holdResultsOpenOverStatementClose, ignoreNonTxTables, includeInnodbStatusInDeadlockExceptions, includeThreadDumpInDeadlockExceptions," +
+ " includeThreadNamesAsStatementComment, initialTimeout, interactiveClient, isInteractiveClient, jdbcCompliantTruncation, jdbcCompliantTruncationForReads," +
+ " largeRowSizeThreshold, loadBalanceAutoCommitStatementRegex, loadBalanceAutoCommitStatementThreshold, loadBalanceBlacklistTimeout, " +
+ " loadBalanceConnectionGroup, loadBalanceEnableJMX, loadBalanceExceptionChecker, loadBalancePingTimeout, loadBalanceSQLExceptionSubclassFailover," +
+ " loadBalanceSQLStateFailover, loadBalanceStrategy, loadBalanceValidateConnectionOnSwapServer, localSocketAddress, logSlowQueries, logWriter," +
+ " logXaCommands, logger, loggerClassName, loginTimeout, maintainTimeStats, maxAllowedPacket, maxQuerySizeToLog, maxReconnects, maxRows," +
+ " metadataCacheSize, netTimeoutForStreamingResults, noAccessToProcedureBodies, noDatetimeStringSync, noTimezoneConversionForTimeType," +
+ " nullCatalogMeansCurrent, nullNamePatternMatchesAll, overrideSupportsIntegrityEnhancementFacility, packetDebugBufferSize, padCharsWithSpace," +
+ " paranoid, parseInfoCacheFactory, password, passwordCharacterEncoding, pedantic, pinGlobalTxToPhysicalConnection, populateInsertRowWithDefaultValues," +
+ " port, portNumber, prepStmtCacheSize, prepStmtCacheSqlLimit, preparedStatementCacheSize, preparedStatementCacheSqlLimit, processEscapeCodesForPrepStmts," +
+ " profileSQL, profileSql, profilerEventHandler, propertiesTransform, propertiesViaRef, queriesBeforeRetryMaster, queryTimeoutKillsConnection," +
+ " reconnectAtTxEnd, relaxAutoCommit, replicationEnableJMX, reportMetricsIntervalMillis, requireSSL, resourceId, resultSetSizeThreshold," +
+ " retainStatementAfterResultSetClose, retriesAllDown, rewriteBatchedStatements, rollbackOnPooledClose, roundRobinLoadBalance, runningCTS13," +
+ " secondsBeforeRetryMaster, selfDestructOnPingMaxOperations, selfDestructOnPingSecondsLifetime, serverConfigCacheFactory, serverName," +
+ " serverTimezone, sessionVariables, slowQueryThresholdMillis, slowQueryThresholdNanos, socketFactory, socketFactoryClassName, socketTimeout," +
+ " statementInterceptors, strictFloatingPoint, strictUpdates, tcpKeepAlive, tcpNoDelay, tcpRcvBuf, tcpSndBuf, tcpTrafficClass, tinyInt1isBit," +
+ " traceProtocol, transformedBitIsBoolean, treatUtilDateAsTimestamp, trustCertificateKeyStorePassword, trustCertificateKeyStoreType," +
+ " trustCertificateKeyStoreUrl, ultraDevHack, url, useAffectedRows, useBlobToStoreUTF8OutsideBMP, useColumnNamesInFindColumn, useCompression," +
+ " useConfigs, useCursorFetch, useDirectRowUnpack, useDynamicCharsetInfo, useFastDateParsing, useFastIntParsing, useGmtMillisForDatetimes," +
+ " useHostsInPrivileges, useInformationSchema, useJDBCCompliantTimezoneShift, useJvmCharsetConverters, useLegacyDatetimeCode, useLocalSessionState," +
+ " useLocalTransactionState, useNanosForElapsedTime, useOldAliasMetadataBehavior, useOldUTF8Behavior, useOnlyServerErrorMessages, useReadAheadInput," +
+ " useSSL, useSSPSCompatibleTimezoneShift, useServerPrepStmts, useServerPreparedStmts, useSqlStateCodes, useStreamLengthsInPrepStmts, useTimezone," +
+ " useUltraDevWorkAround, useUnbufferedInput, useUnicode, useUsageAdvisor, user, utf8OutsideBmpExcludedColumnNamePattern," +
+ " utf8OutsideBmpIncludedColumnNamePattern, verifyServerCertificate, yearIsDateType, zeroDateTimeBehavior",
"org.hibernate.dialect.MySQLDialect",
" <plugin id=\"org.eclipse.gemini.dbaccess.mysql\" autoStart=\"true\" startLevel=\"2\" />",
- " <feature id=\"org.osbee.dependencies.feature.mysql\"/>\n",
+ " <feature id=\"org.osbee.technologystack.mysql.feature\"/>\n",
"id int",
"uuid String") {
@Override
@@ -218,7 +295,62 @@
public String getToTimestampSQLMethod() {
return "str_to_date";
}
+
+ @Override
+ public String convertToDateSQL(Date date) {
+ return "str_to_date('"+date.toString().replace(".0","")+"','%Y-%m-%d')";
+ }
+
+ @Override
+ public String convertToTimestampSQL(Timestamp date) {
+ return "str_to_date('"+date.toString().replace(".0","")+"','%Y-%m-%d %H:%i:%s')";
+ }
+
},
+ // see samples
+ // -
+ // http://dev.mysql.com/doc/connector-j/en/connector-j-usagenotes-connect-drivermanager.html
+ // -
+ // http://www.mkyong.com/jdbc/how-to-connect-to-mysql-with-jdbc-driver-java/
+ /** The mysql8. */
+ // - http://www.vogella.com/tutorials/MySQLJava/article.html
+ MYSQL8(false, "mysql8", "thin", "com.mysql.cj.jdbc.Driver",
+ "jdbc:mysql://" + VARIABLE.SERVER + ":" + VARIABLE.PORT + "/" + VARIABLE.DATABASE + "?useSSL=false&AllowPublicKeyRetrieval=true&useLegacyDatetimeCode=false&serverTimezone=" + VARIABLE.TIMEZONE, "JDBC",
+ "URL, allowLoadLocalInfile, allowMasterDownConnections, allowMultiQueries, allowNanAndInf, allowPublicKeyRetrieval, allowUrlInLocalInfile, alwaysSendSetIsolation, authenticationPlugins, autoClosePStmtStreams, autoDeserialize, autoGenerateTestcaseScript, autoReconnect, autoReconnectForConnectionPools, autoReconnectForPools, autoSlowLog, blobsAreStrings, cacheCallableStatements, cacheCallableStmts, cachePrepStmts, cachePreparedStatements, cacheResultSetMetadata, cacheServerConfiguration, callableStatementCacheSize, callableStmtCacheSize, capitalizeDBMDTypes, capitalizeTypeNames, characterEncoding, characterSetResults, clientCertificateKeyStorePassword, clientCertificateKeyStoreType, clientCertificateKeyStoreUrl, clientInfoProvider, clobCharacterEncoding, clobberStreamingResults, compensateOnDuplicateKeyUpdateCounts, connectTimeout, connectionAttributes, connectionCollation, connectionLifecycleInterceptors, continueBatchOnError, createDatabaseIfNotExist, databaseName, defaultAuthenticationPlugin, defaultFetchSize, detectCustomCollations, detectServerPreparedStmts, disabledAuthenticationPlugins, disconnectOnExpiredPasswords, dontTrackOpenResources, dumpMetadataOnColumnNotFound, dumpQueriesOnException, dynamicCalendars, elideSetAutoCommits, emptyStringsConvertToZero, emulateLocators, emulateUnsupportedPstmts, enablePacketDebug, enableQueryTimeouts, encoding, exceptionInterceptors, explainSlowQueries, failOverReadOnly, functionsNeverReturnBlobs, gatherPerfMetrics, gatherPerformanceMetrics, generateSimpleParameterMetadata, getProceduresReturnsFunctions, holdResultsOpenOverStatementClose, ignoreNonTxTables, includeInnodbStatusInDeadlockExceptions, includeThreadDumpInDeadlockExceptions, includeThreadNamesAsStatementComment, initialTimeout, interactiveClient, isInteractiveClient, jdbcCompliantTruncation, jdbcCompliantTruncationForReads, largeRowSizeThreshold, loadBalanceAutoCommitStatementRegex, loadBalanceAutoCommitStatementThreshold, loadBalanceBlacklistTimeout, loadBalanceConnectionGroup, loadBalanceEnableJMX, loadBalanceExceptionChecker, loadBalancePingTimeout, loadBalanceSQLExceptionSubclassFailover, loadBalanceSQLStateFailover, loadBalanceStrategy, loadBalanceValidateConnectionOnSwapServer, localSocketAddress, logSlowQueries, logWriter, logXaCommands, logger, loggerClassName, loginTimeout, maintainTimeStats, maxAllowedPacket, maxQuerySizeToLog, maxReconnects, maxRows, metadataCacheSize, netTimeoutForStreamingResults, noAccessToProcedureBodies, noDatetimeStringSync, noTimezoneConversionForTimeType, nullCatalogMeansCurrent, nullNamePatternMatchesAll, overrideSupportsIntegrityEnhancementFacility, packetDebugBufferSize, padCharsWithSpace, paranoid, parseInfoCacheFactory, password, passwordCharacterEncoding, pedantic, pinGlobalTxToPhysicalConnection, populateInsertRowWithDefaultValues, port, portNumber, prepStmtCacheSize, prepStmtCacheSqlLimit, preparedStatementCacheSize, preparedStatementCacheSqlLimit, processEscapeCodesForPrepStmts, profileSQL, profileSql, profilerEventHandler, propertiesTransform, propertiesViaRef, queriesBeforeRetryMaster, queryTimeoutKillsConnection, reconnectAtTxEnd, relaxAutoCommit, replicationEnableJMX, reportMetricsIntervalMillis, requireSSL, resourceId, resultSetSizeThreshold, retainStatementAfterResultSetClose, retriesAllDown, rewriteBatchedStatements, rollbackOnPooledClose, roundRobinLoadBalance, runningCTS13, secondsBeforeRetryMaster, selfDestructOnPingMaxOperations, selfDestructOnPingSecondsLifetime, serverConfigCacheFactory, serverName, serverTimezone, sessionVariables, slowQueryThresholdMillis, slowQueryThresholdNanos, socketFactory, socketFactoryClassName, socketTimeout, statementInterceptors, strictFloatingPoint, strictUpdates, tcpKeepAlive, tcpNoDelay, tcpRcvBuf, tcpSndBuf, tcpTrafficClass, tinyInt1isBit, traceProtocol, transformedBitIsBoolean, treatUtilDateAsTimestamp, trustCertificateKeyStorePassword, trustCertificateKeyStoreType, trustCertificateKeyStoreUrl, ultraDevHack, url, useAffectedRows, useBlobToStoreUTF8OutsideBMP, useColumnNamesInFindColumn, useCompression, useConfigs, useCursorFetch, useDirectRowUnpack, useDynamicCharsetInfo, useFastDateParsing, useFastIntParsing, useGmtMillisForDatetimes, useHostsInPrivileges, useInformationSchema, useJDBCCompliantTimezoneShift, useJvmCharsetConverters, useLegacyDatetimeCode, useLocalSessionState, useLocalTransactionState, useNanosForElapsedTime, useOldAliasMetadataBehavior, useOldUTF8Behavior, useOnlyServerErrorMessages, useReadAheadInput, useSSL, useSSPSCompatibleTimezoneShift, useServerPrepStmts, useServerPreparedStmts, useSqlStateCodes, useStreamLengthsInPrepStmts, useTimezone, useUltraDevWorkAround, useUnbufferedInput, useUnicode, useUsageAdvisor, user, utf8OutsideBmpExcludedColumnNamePattern, utf8OutsideBmpIncludedColumnNamePattern, verifyServerCertificate, yearIsDateType, zeroDateTimeBehavior",
+ "org.hibernate.dialect.MySQLDialect",
+ " <plugin id=\"org.eclipse.gemini.dbaccess.mysql8\" autoStart=\"true\" startLevel=\"2\" />",
+ " <feature id=\"org.osbee.technologystack.mysql8.feature\"/>\n",
+ "id int",
+ "uuid String") {
+ @Override
+ public String applySqlSpecifications(String sqlStatement) {
+ return sqlStatement.replace(ONE_ROW_ONE_COLUMN_TABLE, ONE_ROW_ONE_COLUMN_TABLE_MYSQL);
+ }
+
+ @Override
+ public String getToDateSQLMethod() {
+ return "str_to_date";
+
+ }
+
+ @Override
+ public String getToTimestampSQLMethod() {
+ return "str_to_date";
+ }
+
+ @Override
+ public String convertToDateSQL(Date date) {
+ return "str_to_date('"+date.toString().replace(".0","")+"','%Y-%m-%d')";
+ }
+
+ @Override
+ public String convertToTimestampSQL(Timestamp date) {
+ return "str_to_date('"+date.toString().replace(".0","")+"','%Y-%m-%d %H:%i:%s')";
+ }
+
+ },
+
+ /** The oracle. */
ORACLE(false, "oracle", "thin", "oracle.jdbc.OracleDriver",
"jdbc:" + VARIABLE.VENDOR + ":" + VARIABLE.TYPE + ":@" + VARIABLE.SERVER + ":" + VARIABLE.PORT + ":"
+ VARIABLE.DATABASE,
@@ -237,21 +369,78 @@
public String getToTimestampSQLMethod() {
return "to_timestamp";
}
+
+ @Override
+ public String convertToTimestampSQL(Timestamp date) {
+ return "to_timestamp('"+date.toString().replace(".0","")+"','YYYY-MM-DD HH24:MI:SS')";
+ }
+
};
+ /** The is in memory. */
private final boolean fIsInMemory;
+
+ /** The driver vendor. */
private final String fDriverVendor;
+
+ /** The driver type. */
private final String fDriverType;
+
+ /** The driver class. */
private final String fDriverClass;
+
+ /** The jdbc url format. */
private final String fJdbcUrlFormat;
+
+ /** The persistence batch writing. */
private final String fPersistenceBatchWriting;
+
+ /** The hibernate dialect. */
private final String fHibernateDialect;
+
+ /** The product features. */
private final String fProductFeatures;
+
+ /** The product configurations. */
private final String fProductConfigurations;
+
+ /** The entity property base ID. */
private final String fEntityPropertyBaseID;
+
+ /** The entity property base UUID. */
private final String fEntityPropertyBaseUUID;
+
+ /** The property keys. */
private final List<String> fPropertyKeys;
+ /**
+ * Instantiates a new enum database vendor.
+ *
+ * @param isInMemory
+ * the is in memory
+ * @param driverVendor
+ * the driver vendor
+ * @param driverType
+ * the driver type
+ * @param driverClass
+ * the driver class
+ * @param jdbcUrlFormat
+ * the jdbc url format
+ * @param persistenceBatchWriting
+ * the persistence batch writing
+ * @param propertyKeys
+ * the property keys
+ * @param hibernateDialect
+ * the hibernate dialect
+ * @param productConfigurations
+ * the product configurations
+ * @param productFeatures
+ * the product features
+ * @param entityPropertyBaseID
+ * the entity property base ID
+ * @param entityPropertyBaseUUID
+ * the entity property base UUID
+ */
private EnumDatabaseVendor(boolean isInMemory, String driverVendor, String driverType, String driverClass,
String jdbcUrlFormat, String persistenceBatchWriting, String propertyKeys, String hibernateDialect,
String productConfigurations, String productFeatures, String entityPropertyBaseID,
@@ -275,30 +464,60 @@
fEntityPropertyBaseUUID = entityPropertyBaseUUID;
}
+ /**
+ * Equals ignore case.
+ *
+ * @param s1
+ * the s 1
+ * @param s2
+ * the s 2
+ * @return true, if successful
+ */
private static boolean equalsIgnoreCase(String s1, String s2) {
s1 = s1.replaceAll("_IN_", "").replaceAll("_", ""); // NOSONAR
s2 = s2.replaceAll("_IN_", "").replaceAll("_", ""); // NOSONAR
return s1.equalsIgnoreCase(s2);
}
+ /**
+ * Gets the database features.
+ *
+ * @param vendors
+ * the vendors
+ * @return the database features
+ */
public static String getDatabaseFeatures(Set<EnumDatabaseVendor> vendors) {
- ArrayList<String> result = new ArrayList<String>();
+ ArrayList<String> result = new ArrayList<>();
for (EnumDatabaseVendor vendor : vendors) {
result.add(vendor.getProductFeatures());
}
return String.join("\n", result);
}
+ /**
+ * Gets the necessary configurations.
+ *
+ * @param vendors
+ * the vendors
+ * @return the necessary configurations
+ */
public static String getNecessaryConfigurations(Set<EnumDatabaseVendor> vendors) {
- ArrayList<String> result = new ArrayList<String>();
+ ArrayList<String> result = new ArrayList<>();
for (EnumDatabaseVendor vendor : vendors) {
result.add(vendor.getProductConfigurations());
}
return String.join("\n", result);
}
+ /**
+ * Gets the unnecessary configurations.
+ *
+ * @param vendors
+ * the vendors
+ * @return the unnecessary configurations
+ */
public static String getUnnecessaryConfigurations(Set<EnumDatabaseVendor> vendors) {
- ArrayList<String> result = new ArrayList<String>();
+ ArrayList<String> result = new ArrayList<>();
for (EnumDatabaseVendor vendor : values()) {
if (!vendors.contains(vendor)) {
result.add(vendor.getProductConfigurations());
@@ -307,10 +526,28 @@
return String.join("\n", result);
}
+ /**
+ * By name.
+ *
+ * @param vendorName
+ * the vendor name
+ * @return the enum database vendor
+ */
public static EnumDatabaseVendor byName(String vendorName) { // NOSONAR
return byName(vendorName, vendorName, vendorName);
}
+ /**
+ * By name.
+ *
+ * @param vendorName
+ * the vendor name
+ * @param driverVendor
+ * the driver vendor
+ * @param dataBaseName
+ * the data base name
+ * @return the enum database vendor
+ */
public static EnumDatabaseVendor byName(String vendorName, String driverVendor, String dataBaseName) { // NOSONAR
for (EnumDatabaseVendor step : values()) {
if (equalsIgnoreCase(step.name(), vendorName) || equalsIgnoreCase(step.fDriverVendor, vendorName)) {
@@ -328,80 +565,199 @@
return ORACLE;
}
+ /** The Constant ONE_ROW_ONE_COLUMN_TABLE. */
public static final String ONE_ROW_ONE_COLUMN_TABLE = "{{ONE_ROW_ONE_COLUMN_TABLE}}";
+
+ /** The Constant ONE_ROW_ONE_COLUMN_TABLE_DERBY. */
public static final String ONE_ROW_ONE_COLUMN_TABLE_DERBY = "SYSIBM.SYSDUMMY1";
+
+ /** The Constant ONE_ROW_ONE_COLUMN_TABLE_H2. */
public static final String ONE_ROW_ONE_COLUMN_TABLE_H2 = "DUAL";
+
+ /** The Constant ONE_ROW_ONE_COLUMN_TABLE_MYSQL. */
public static final String ONE_ROW_ONE_COLUMN_TABLE_MYSQL = "DUAL";
+
+ /** The Constant ONE_ROW_ONE_COLUMN_TABLE_ORACLE. */
public static final String ONE_ROW_ONE_COLUMN_TABLE_ORACLE = "DUAL";
/**
+ * Apply sql specifications.
+ *
* @param sqlStatement
+ * the sql statement
* @return applied vendor specific SQL statement
*/
abstract public String applySqlSpecifications(String sqlStatement);
/**
- * @param sqlStatement
+ * Gets the to date SQL method.
+ *
* @return applied vendor specific 'to date' SQL statement prefix
*/
+ @Deprecated
public String getToDateSQLMethod() {
return "to_date";
}
/**
- * @param sqlStatement
+ * Gets the to timestamp SQL method.
+ *
* @return applied vendor specific 'to timestamp' SQL statement prefix
*/
+ @Deprecated
public String getToTimestampSQLMethod() {
return "to_timestamp";
}
+
+ /**
+ * Convert to date SQL.
+ *
+ * @param date
+ * the date
+ * @return applied vendor specific 'to date' SQL statement part
+ */
+ public String convertToDateSQL(Date date) {
+ return "to_date('"+date.toString().replace(".0","")+"','YYYY-MM-DD HH24:MI:SS')";
+ }
+
+ /**
+ * Convert to timestamp SQL.
+ *
+ * @param date
+ * the date
+ * @return applied vendor specific 'to date' SQL statement part
+ */
+ public String convertToTimestampSQL(Timestamp date) {
+ return "to_timestamp('"+date.toString().replace(".0","")+"','YYYY-MM-DD HH24:MI:SS')";
+ }
+
+ /**
+ * Apply schema name specifications.
+ *
+ * @param schemaName
+ * the schema name
+ * @return the string
+ */
public String applySchemaNameSpecifications(String schemaName) {
return schemaName;
}
+ /**
+ * Checks if is in memory.
+ *
+ * @return true, if is in memory
+ */
public boolean isInMemory() {
return fIsInMemory;
}
+ /**
+ * Gets the driver vendor.
+ *
+ * @return the driver vendor
+ */
public String getDriverVendor() {
return fDriverVendor;
}
+ /**
+ * Gets the driver type.
+ *
+ * @return the driver type
+ */
public String getDriverType() {
return fDriverType;
}
+ /**
+ * Gets the driver class.
+ *
+ * @return the driver class
+ */
public String getDriverClass() {
return fDriverClass;
}
+ /**
+ * Gets the hibernate dialect.
+ *
+ * @return the hibernate dialect
+ */
public String getHibernateDialect() {
return fHibernateDialect;
}
+ /**
+ * Gets the product features.
+ *
+ * @return the product features
+ */
public String getProductFeatures() {
return fProductFeatures;
}
+ /**
+ * Gets the product configurations.
+ *
+ * @return the product configurations
+ */
public String getProductConfigurations() {
return fProductConfigurations;
}
+ /**
+ * Gets the entity property base ID.
+ *
+ * @return the entity property base ID
+ */
public String getEntityPropertyBaseID() {
return fEntityPropertyBaseID;
}
+ /**
+ * Gets the entity property base UUID.
+ *
+ * @return the entity property base UUID
+ */
public String getEntityPropertyBaseUUID() {
return fEntityPropertyBaseUUID;
}
+ /**
+ * Gets the persistence batch writing.
+ *
+ * @return the persistence batch writing
+ */
public String getPersistenceBatchWriting() {
return fPersistenceBatchWriting;
}
+ /**
+ * Jdbc url.
+ *
+ * @param driverVendor
+ * the driver vendor
+ * @param driverType
+ * the driver type
+ * @param serverName
+ * the server name
+ * @param serverPort
+ * the server port
+ * @param databaseName
+ * the database name
+ * @param jdbUrlFormat
+ * the jdb url format
+ * @param timezone
+ * the timezone
+ * @param username
+ * the username
+ * @param password
+ * the password
+ * @return the string
+ */
public String jdbcUrl(String driverVendor, String driverType, String serverName, int serverPort,
- String databaseName, String jdbUrlFormat) {
+ String databaseName, String jdbUrlFormat, String timezone, String username, String password) {
if ((driverVendor == null) || driverVendor.trim().isEmpty()) {
driverVendor = fDriverVendor; // NOSONAR
}
@@ -411,18 +767,45 @@
if (serverName == null) {
serverName = "???"; // NOSONAR
}
+ // for sqlserver ....
+ String serverInstance = "";
+ int idx=serverName.indexOf('\\');
+ if ( idx >= 0 ) {
+ serverInstance=serverName.substring(idx+1);
+ serverName=serverName.substring(0,idx);
+ }
+
if (serverPort == 0) {
serverPort = -1; // NOSONAR
}
+
+ String databaseSchema=databaseName;
+ if ( databaseSchema.contains("/") ) {
+ databaseSchema = databaseSchema.replaceAll(".*/", "");
+ }
+
String format = ((jdbUrlFormat != null) && !jdbUrlFormat.isEmpty()) ? jdbUrlFormat : fJdbcUrlFormat;
String retcode = format // NOSONAR
.replaceAll(VARIABLE.VENDOR, driverVendor).replaceAll(VARIABLE.TYPE, driverType)
.replaceAll(VARIABLE.SERVER, serverName).replaceAll(VARIABLE.PORT, ((Integer) serverPort).toString())
.replaceAll(VARIABLE.DATABASE, databaseName)
- .replaceAll(VARIABLE.USERHOME, System.getProperty("user.home").replace(java.io.File.separator, "/"));
+ .replaceAll(VARIABLE.DATABASESCHEMA, databaseSchema)
+ .replaceAll(VARIABLE.SERVERINSTANCE, serverInstance)
+ .replaceAll(VARIABLE.USERHOME, System.getProperty("user.home").replace(java.io.File.separator, "/")+"/")
+ .replaceAll(VARIABLE.TIMEZONE, timezone)
+ .replaceAll(VARIABLE.USERNAME, username)
+ .replaceAll(VARIABLE.PASSWORD, password);
+
return retcode;
}
+ /**
+ * Supports property key.
+ *
+ * @param key
+ * the key
+ * @return true, if successful
+ */
public boolean supportsPropertyKey(String key) {
if (fPropertyKeys.isEmpty()) {
return true;
diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/IProductConfigurationPrefs.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/IProductConfigurationPrefs.java
index 41ab9ee..47e5224 100644
--- a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/IProductConfigurationPrefs.java
+++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/IProductConfigurationPrefs.java
@@ -140,8 +140,6 @@
public abstract String getDatainterchangeConfiguration();
- public abstract String getSignalConfiguration();
-
public abstract boolean isMavenActivated();
public abstract String getReportPrinter(String reportName);
diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/Preference.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/Preference.java
index b2ddc85..8141edf 100644
--- a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/Preference.java
+++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/Preference.java
@@ -58,7 +58,6 @@
HYBRID_REFRESH_PERSPECTIVE_INACTIVE,
JAVA_POS_CONFIGURATION,
DATAINTERCHANGE_CONFIGURATION,
- SIGNAL_CONFIGURATION,
LDAP_CONTEXT_FACTORY_URL,
LDAP_REALM_PORTAL_ID,
LDAP_USER_DN_TEMPLATE,
diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfiguration.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfiguration.java
index a79c6b0..ace2ec4 100644
--- a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfiguration.java
+++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfiguration.java
@@ -407,12 +407,4 @@
public static String getDatainterchangeConfiguration() {
return prefs().getDatainterchangeConfiguration();
}
-
- public static String getSignalConfiguration() {
- return prefs().getSignalConfiguration();
- }
-
- public static void setSignalConfiguration(String value) {
- prefs().setSignalConfiguration(value);
- }
}
diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfigurationDefaultPrefs.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfigurationDefaultPrefs.java
index f4abb5f..c7af50b 100644
--- a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfigurationDefaultPrefs.java
+++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfigurationDefaultPrefs.java
@@ -31,18 +31,23 @@
*/
public class ProductConfigurationDefaultPrefs implements IProductConfigurationPrefs {
+ public static final String MSSQL = "sqlserver";
public static final String MYSQL = "mysql";
+ public static final String MYSQL8 = "mysql8";
public static final String ORACLE = "oracle";
public static final String PASSWORD_HINT = "<password>"; // NOSONAR
public static final String USERNAME_HINT = "<username>";
public static final String DATABASE_HINT = "<database>";
public static final String H2MEMORY = "H2MEMORY";
public static final String DERBYLOCALFILE = "DERBYLOCALFILE";
+ public static final String DERBYLOCALFILEFILE = "%%USERHOME%%/derbylocaldb";
public static final String H2LOCALFILE = "H2LOCALFILE";
+ public static final String H2LOCALFILEFILE = "%%USERHOME%%/h2localdb";
public static final String DERBYMEMORY = "DERBYMEMORY";
public static final String IP_OR_HOST = "<ip-or-host>";
public static final String BPM_ENGINE_PERSISTENCE_UNIT = "bpm";
+ @Override
public String getBusinessBundleClassNameReadOnly() {
return "";
}
@@ -54,20 +59,26 @@
initializeIfNotExists (ORACLE, ORACLE,
EnumDatabaseVendor.ORACLE, IP_OR_HOST, 1521, DATABASE_HINT, USERNAME_HINT, PASSWORD_HINT);
/* === datasource using a MySQL database === */
+ initializeIfNotExists (MSSQL, null,
+ EnumDatabaseVendor.MSSQL, IP_OR_HOST, 1433, DATABASE_HINT, USERNAME_HINT, "");
+ /* === datasource using a MySQL database === */
initializeIfNotExists (MYSQL, null,
EnumDatabaseVendor.MYSQL, IP_OR_HOST, 3306, DATABASE_HINT, USERNAME_HINT, "");
+ /* === datasource using a MySQL database === */
+ initializeIfNotExists (MYSQL8, null,
+ EnumDatabaseVendor.MYSQL8, IP_OR_HOST, 3306, DATABASE_HINT, USERNAME_HINT, "");
/* === datasource using a H2 in-Memory database === */
initializeIfNotExists (ProductConfigurationPrefs.DEFAULT_H2MEMORY_DATASOURCE, null,
EnumDatabaseVendor.H2_IN_MEMORY, null, -1, H2MEMORY, H2MEMORY, H2MEMORY); // NOSONAR
/* === datasource using a H2 local-file database === */
initializeIfNotExists (ProductConfigurationPrefs.DEFAULT_H2LOCALFILE_DATASOURCE, null,
- EnumDatabaseVendor.H2_LOCAL_FILE, null, -1, H2LOCALFILE, H2LOCALFILE, H2LOCALFILE);
+ EnumDatabaseVendor.H2_LOCAL_FILE, null, -1, H2LOCALFILEFILE, H2LOCALFILE, H2LOCALFILE);
/* === datasource using a Derby in-Memory database === */
initializeIfNotExists (ProductConfigurationPrefs.DEFAULT_DERBYMEMORY_DATASOURCE, null,
EnumDatabaseVendor.DERBY_IN_MEMORY, null, -1, DERBYMEMORY, DERBYMEMORY, DERBYMEMORY);
/* === datasource using a Derby local-file database === */
initializeIfNotExists (ProductConfigurationPrefs.DEFAULT_DERBYLOCALFILE_DATASOURCE, null,
- EnumDatabaseVendor.DERBY_LOCAL_FILE, null, -1, DERBYLOCALFILE, DERBYLOCALFILE, DERBYLOCALFILE);
+ EnumDatabaseVendor.DERBY_LOCAL_FILE, null, -1, DERBYLOCALFILEFILE, DERBYLOCALFILE, DERBYLOCALFILE);
/* === datasource using a Derby database === */
initializeIfNotExists (ProductConfigurationPrefs.DEFAULT_DERBYSERVER_DATASOURCE, null,
EnumDatabaseVendor.DERBY_CLIENT, IP_OR_HOST, 1527, DATABASE_HINT, USERNAME_HINT, PASSWORD_HINT);
@@ -210,6 +221,7 @@
return 10000;
}
+ @Override
public final String getAuthenticationOrganizationId() {
return "FoodMart";
}
@@ -329,9 +341,7 @@
Locale[] supported = new Locale[] {
Locale.GERMAN,
Locale.ENGLISH,
- Locale.FRENCH,
- new Locale("de", "AT"),
- Locale.US
+ Locale.FRENCH
};
for (Locale locale : supported) {
languages.put(locale.toString(), locale);
@@ -466,11 +476,6 @@
}
@Override
- public String getSignalConfiguration() {
- return "";
- }
-
- @Override
public boolean isMavenActivated() {
return false;
}
diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfigurationPrefs.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfigurationPrefs.java
index 28a4a27..328bb02 100644
--- a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfigurationPrefs.java
+++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfigurationPrefs.java
@@ -19,6 +19,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
+import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
@@ -40,6 +41,7 @@
import org.eclipse.core.internal.preferences.EclipsePreferences;
import org.eclipse.core.internal.preferences.InstancePreferences;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
@@ -55,6 +57,7 @@
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.persistence.config.PersistenceUnitProperties;
+import org.joda.time.DateTimeZone;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;
import org.slf4j.Logger;
@@ -140,7 +143,6 @@
private Boolean emailUseSslOnConnect;
private String javaPosConfiguration;
private String datainterchangeConfiguration;
- private String signalConfiguration;
public static final String BUSINESS_BUNDLE_CLASS_NAME = "BUSINESS_BUNDLE_CLASS_NAME_read_only";
@@ -182,11 +184,6 @@
private static final String DATAINTERCHANGE_NODE = "datainterchange";
private static final String DATAINTERCHANGE_CONFIGURATION = "datainterchangeConfiguration";
- /* ========================= Signal initializer =========================== */
-
- private static final String SIGNAL_NODE = "signal";
- private static final String SIGNAL_CONFIGURATION = "signalConfiguration";
-
/* ========================= authentication initializer =========================== */
public static final String AUTHENTICATION_NODE = "authentication";
@@ -258,6 +255,7 @@
private static final String DATASOURCE_DRIVER_CLASS = "driver.class";
private static final String DATASOURCE_SERVER_NAME = "server.name";
private static final String DATASOURCE_SERVER_PORT = "server.port";
+ private static final String DATASOURCE_SERVER_TIMEZONE = "server.timezone";
private static final String DATASOURCE_DATABASE_NAME = "database.name";
private static final String DATASOURCE_DATABASE_USER = "database.user";
private static final String DATASOURCE_DATABASE_PASS = "database.pass";
@@ -345,7 +343,7 @@
}
public Set<EnumDatabaseVendor> getDataBaseVendors() {
- TreeSet<EnumDatabaseVendor> result = new TreeSet<EnumDatabaseVendor>();
+ TreeSet<EnumDatabaseVendor> result = new TreeSet<>();
for (String pu : getPersistenceUnitNames()) {
addDataBaseVendor(result, getPersistenceUnitJndiName(pu));
}
@@ -353,7 +351,7 @@
}
public Set<EnumDatabaseVendor> getDataBaseVendors(String... jndiNames) {
- TreeSet<EnumDatabaseVendor> result = new TreeSet<EnumDatabaseVendor>();
+ TreeSet<EnumDatabaseVendor> result = new TreeSet<>();
for (String jndiName : jndiNames) {
addDataBaseVendor(result, jndiName);
}
@@ -398,6 +396,7 @@
this(name, scopeContext, false, null);
}
+ @Override
public IProject getProject() {
if (project instanceof IProject) {
return project;
@@ -448,46 +447,65 @@
}
}
- public static IResource getPrefsFile(IProject project) {
- IResource prefsFile = null;
+ public static IResource getPrefsFile(IResource project) {
+ if( (project instanceof IProject ) && ! ((IProject)project).isOpen() )
+ return null;
try {
- for (IResource resource : project.members()) {
- if ((resource instanceof IFile) && "product".equals(resource.getFileExtension())) {
- try {
- String[] tokens = IOUtils.toString(((IFile)resource).getContents()).split("-DproductConfigurationFile=");
- if (tokens.length > 1) {
- String filePath = tokens[1].replace('\r', ' ').replace('\n', ' ').replace('\t', ' ').split(" ")[0].replace("DEFAULTFILE", PREFERENCES_FULL_PATH);
- // The following line is required to perform a string substitution.
- // In case of having a file path with placeholders this will replace them with the defined string in the eclipse string substitution preferences:
- // Reference > Preferences > Run/Debug > String Substitution
- filePath = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(filePath);
- File handle = new File(filePath);
- if (handle.exists()) {
- String fileName = handle.getAbsolutePath();
- IWorkspace space = ResourcesPlugin.getWorkspace();
- IWorkspaceRoot root=space.getRoot();
- try { // NOSONAR
- IFile[] resources = root.findFilesForLocationURI(new File(fileName).toURI());
- if (resources != null) {
- prefsFile = resources[0];
- break;
- }
- }
- catch (Exception e) { // NOSONAR
- e.printStackTrace();
- } // NOSONAR
- }
+
+ IResource[] rl=null;
+
+ if (project instanceof IProject ) rl=((IProject)project).members();
+ if (project instanceof IFolder ) rl=((IFolder)project).members();
+
+ for (IResource resource : rl) {
+ if ( resource.exists() ) {
+ if ( (resource instanceof IFolder ) ) {
+ IResource f = getPrefsFile( resource);
+ if ( f != null ) {
+ return f;
}
- } catch (IOException e) {
- e.printStackTrace(); // NOSONAR
- }
- } // NOSONAR
+ } else if ((resource instanceof IFile) && "product".equals(resource.getFileExtension())) {
+ try {
+ String[] tokens = IOUtils.toString(((IFile)resource).getContents()).split("-DproductConfigurationFile=");
+ if (tokens.length > 1) {
+ String filePath = tokens[1].replace('\r', ' ').replace('\n', ' ').replace('\t', ' ').split(" ")[0].replace("DEFAULTFILE", PREFERENCES_FULL_PATH);
+ // The following line is required to perform a string substitution.
+ // In case of having a file path with placeholders this will replace them with the defined string in the eclipse string substitution preferences:
+ // Reference > Preferences > Run/Debug > String Substitution
+ filePath = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(filePath);
+ File handle = new File(filePath);
+ if (handle.exists()) {
+ String fileName = handle.getAbsolutePath();
+ IWorkspace space = ResourcesPlugin.getWorkspace();
+ IWorkspaceRoot root=space.getRoot();
+ try { // NOSONAR
+ IFile[] resources = root.findFilesForLocationURI(new File(fileName).toURI());
+ if (resources != null) {
+ for ( IFile f : resources ) {
+ if ( f.exists() ) {
+ return f;
+ }
+ }
+ }
+ LOGGER.error("Preferences file not found: {}",fileName);
+ }
+ catch (Exception e) { // NOSONAR
+ e.printStackTrace();
+ } // NOSONAR
+ }
+ LOGGER.error("Preferences file not found: {}",filePath);
+ }
+ } catch (IOException e) {
+ e.printStackTrace(); // NOSONAR
+ }
+ } // NOSONAR
+ }
}
}
catch (CoreException e) { // NOSONAR
e.printStackTrace(); // NOSONAR
}
- return prefsFile;
+ return null;
}
@@ -503,6 +521,7 @@
* @return URL to server with the daily Euro Foreign Exchange Reference
* Rates
*/
+ @Override
public String getEuroXRefRatesURLDaily() {
initialize();
return euroForeignExchangeReferenceRatesURLDaily;
@@ -513,6 +532,7 @@
* @return URL to server with the previous Euro Foreign Exchange Reference
* Rates
*/
+ @Override
public String getEuroXRefRatesURLPrevious() {
initialize();
return euroForeignExchangeReferenceRatesURLPrevious;
@@ -521,6 +541,7 @@
/**
* @return name of the server running the ActiveMQ Broker Service
*/
+ @Override
public String getActiveMqBrokerServerName() {
initialize();
return activeMqBrokerServerName;
@@ -529,6 +550,7 @@
/**
* @return port of the server running the ActiveMQ Broker Service
*/
+ @Override
public int getActiveMqBrokerServerPort() {
initialize();
return activeMqBrokerServerPort;
@@ -537,6 +559,7 @@
/**
* @return milliseconds for refresher in an active hybrid ccng view
*/
+ @Override
public int getHybridRefresherMilliSecsActive() {
initialize();
return hybridRefresherMilliSecsActive;
@@ -545,6 +568,7 @@
/**
* @return milliseconds for refresher in an inactive hybrid ccng view
*/
+ @Override
public int getHybridRefresherMilliSecsInactive() {
initialize();
return hybridRefresherMilliSecsInactive;
@@ -553,6 +577,7 @@
/**
* @return list of name of all defined DataSources
*/
+ @Override
public Collection<DataSourceConfiguration> getDataSources() {
initialize();
return dataSources.values();
@@ -654,12 +679,27 @@
/**
* @return list of name of all defined DataSources
*/
+ @Override
public Collection<PersistenceUnitConfiguration> getPersistenceUnits() {
initialize();
return persistenceUnits.values();
}
/**
+ * @return JNDI name for the given persistence unit
+ */
+ public PersistenceUnitConfiguration getPersistenceUnit(String persistenceUnitName) {
+ initialize();
+ PersistenceUnitConfiguration puConfig = persistenceUnits.get(persistenceUnitName);
+ if (puConfig!=null){
+ return puConfig;
+ } else {
+ LOGGER.error("No persistence unit named '{}' found. Check the defined persistence unit of your entity.",persistenceUnitName);
+ return null;
+ }
+ }
+
+ /**
* @return list of name of all defined DataSources
*/
public Set<String> getPersistenceUnitNames() {
@@ -671,12 +711,10 @@
* @return JNDI name for the given persistence unit
*/
public String getPersistenceUnitJndiName(String persistenceUnitName) {
- initialize();
- PersistenceUnitConfiguration puConfig = persistenceUnits.get(persistenceUnitName);
+ PersistenceUnitConfiguration puConfig = getPersistenceUnit(persistenceUnitName);
if (puConfig!=null){
return puConfig.getJndiName();
} else {
- LOGGER.error("No persistence unit named '" + persistenceUnitName + "' found. Check the defined persistence unit of your entity.");
return null;
}
}
@@ -698,7 +736,12 @@
* @return the ddl generation flag
*/
public String getPersistenceUnitParameterizedEclipseLinkDdlGeneration(String persistenceUnitName) {
- return persistenceUnits.get(persistenceUnitName).getDdlGeneration();
+ PersistenceUnitConfiguration puConfig = getPersistenceUnit(persistenceUnitName);
+ if (puConfig!=null){
+ return puConfig.getDdlGeneration();
+ } else {
+ return null;
+ }
}
/**
@@ -729,12 +772,12 @@
*/
public Properties getPersistenceUnitProperties(
String persistenceUnitName, CommonDataSource dataSource, ClassLoader classLoader) {
- initialize();
- if (persistenceUnits.containsKey(persistenceUnitName)) {
- return persistenceUnits.get(persistenceUnitName)
- .getPersistenceUnitProperties(dataSource, classLoader);
+ PersistenceUnitConfiguration puConfig = getPersistenceUnit(persistenceUnitName);
+ if (puConfig!=null){
+ return puConfig.getPersistenceUnitProperties(dataSource, classLoader);
+ } else {
+ return null;
}
- return null;
}
@Override
@@ -747,6 +790,7 @@
* @return port of the RESTful authentication API, needed by the hybrid
* WebClient cxauth
*/
+ @Override
public final int getAuthRESTfulPort() {
initialize();
return authRESTfulApiPort;
@@ -755,6 +799,7 @@
/**
* @return decide remember-me function performs an auto-login or not
*/
+ @Override
public final boolean hasAutoLogin() {
initialize();
return autoLogin;
@@ -763,11 +808,13 @@
/**
* @return hide remember-me function if true
*/
+ @Override
public final boolean hasNoRememberMe() {
initialize();
return noRememberMe;
}
+ @Override
public final int getDtoRealmPortalId() {
initialize();
try {
@@ -780,6 +827,7 @@
return 1;
}
+ @Override
public final int getLdapRealmPortalId() {
initialize();
try {
@@ -792,6 +840,7 @@
return 1;
}
+ @Override
public final String getLdapContextFactoryUrl() {
initialize();
try {
@@ -806,6 +855,7 @@
return "ldap://<ldapserver>:389";
}
+ @Override
public final String getLdapUserDnTemplate() {
initialize();
try {
@@ -841,21 +891,25 @@
/**
* @return maximum failed login attempts
*/
+ @Override
public final int getMaxLoginAttempts() {
initialize();
return maxLoginAttempts;
}
+ @Override
public final String getProtocolDatasource() {
initialize();
return protocolDatasource;
}
+ @Override
public final String getProtocolUnit() {
initialize();
return protocolUnit;
}
+ @Override
public final boolean getIdentifyByUsername() {
initialize();
return identifyByUsername;
@@ -914,26 +968,31 @@
}
}
+ @Override
public Map<String, Locale> getLanguages() {
initialize();
return languages;
}
+ @Override
public boolean isLanguagesAutotranslate() {
initialize();
return languagesAutotranslate;
}
+ @Override
public boolean willLanguagesAutocreate() {
initialize();
return languagesAutocreate;
}
+ @Override
public boolean isUomoMetricUnit() {
initialize();
return uomoMetricUnit;
}
+ @Override
public boolean showLanguageSelectInRespectiveLocale() {
initialize();
return showLanguageSelectInRespectiveLocale;
@@ -942,6 +1001,7 @@
/**
* @return show theme tool control if true
*/
+ @Override
public final boolean hasDemoToolsTheme() {
initialize();
return demoToolsTheme;
@@ -950,6 +1010,7 @@
/**
* @return show langauge tool control if true
*/
+ @Override
public final boolean hasDemoToolsLanguage() {
initialize();
return demoToolsLanguage;
@@ -958,6 +1019,7 @@
/**
* @return show print service tool control if true
*/
+ @Override
public final boolean hasToolsPrintService() {
initialize();
return demoToolsPrintService;
@@ -966,6 +1028,7 @@
/**
* @return use absolute location for project wizard if true
*/
+ @Override
public final boolean projectWizardUsesAbsoluteLocation() {
initialize();
return projectWizardAbsoluteLocation;
@@ -1117,6 +1180,7 @@
put(dataSource, DATASOURCE_DRIVER_CLASS, dsc.getDriverClass());
put(dataSource, DATASOURCE_SERVER_NAME, dsc.getServerName());
put(dataSource, DATASOURCE_SERVER_PORT, dsc.getServerPort());
+ put(dataSource, DATASOURCE_SERVER_TIMEZONE, dsc.getServerTimezone());
put(dataSource, DATASOURCE_DATABASE_NAME, dsc.getDatabaseName());
put(dataSource, DATASOURCE_DATABASE_USER, dsc.getDatabaseUser());
put(dataSource, DATASOURCE_DATABASE_PASS, dsc.getDatabasePass());
@@ -1207,21 +1271,25 @@
showLanguageSelectInRespectiveLocale);
}
+ @Override
public String getBusinessBundleClassNameReadOnly() {
initialize();
return businessBundleClassNameReadOnly;
}
+ @Override
public String getBpmServerIp() {
initialize();
return bpmServerIp;
}
+ @Override
public int getBpmServerPort() {
initialize();
return bpmServerPort;
}
+ @Override
public int getBpmResponseTimeout() {
initialize();
return bpmResponseTimeout;
@@ -1312,7 +1380,7 @@
// Preferences myInstanceNode = root.node(project.getName()).node(InstanceScope.SCOPE).node(PRODUCT_PREFERENCES);
// return (IEclipsePreferences) myInstanceNode;
//??? return applyCustomizedPreferenceDirectory((IEclipsePreferences) scopeContext.getNode(InstanceScope.SCOPE).node(PRODUCT_PREFERENCES));
- return applyCustomizedPreferenceDirectory((IEclipsePreferences) scopeContext.getNode(PRODUCT_PREFERENCES));
+ return applyCustomizedPreferenceDirectory(scopeContext.getNode(PRODUCT_PREFERENCES));
}
else {
return scopeContext.getNode(PRODUCT_PREFERENCES);
@@ -1553,11 +1621,6 @@
exceptions.add(e);
}
try {
- initializeSignal();
- } catch (Exception e) {
- exceptions.add(e);
- }
- try {
initializeLanguages();
} catch (Exception e) {
exceptions.add(e);
@@ -1665,12 +1728,6 @@
datainterchangeConfiguration = datainterchange.get(DATAINTERCHANGE_CONFIGURATION, defaultPrefs.getDatainterchangeConfiguration());
}
- private void initializeSignal() throws Exception {
- Preferences signal = getProductPreferencesNode(SIGNAL_NODE);
- // --- read all preferences ---
- signalConfiguration = signal.get(SIGNAL_CONFIGURATION, defaultPrefs.getSignalConfiguration());
- }
-
private void initializeReadOnly() throws Exception {
Preferences readOnly = getProductPreferences();
businessBundleClassNameReadOnly = readOnly.get(BUSINESS_BUNDLE_CLASS_NAME, "");
@@ -1768,6 +1825,8 @@
if (serverPort >= 0) {
put(dataSourcePref, DATASOURCE_SERVER_PORT, serverPort);
}
+
+ put(dataSourcePref, DATASOURCE_SERVER_TIMEZONE, DateTimeZone.forID( ZoneId.systemDefault().normalized().toString()).getNameKey(0) );
put(dataSourcePref, DATASOURCE_DATABASE_NAME, database);
put(dataSourcePref, DATASOURCE_DATABASE_USER, username);
put(dataSourcePref, DATASOURCE_DATABASE_PASS, password);
@@ -1783,9 +1842,15 @@
/* === datasource using a Oracle database === */
initializeIfNotExists (root, dataSourcesPrefs, ProductConfigurationDefaultPrefs.ORACLE, ProductConfigurationDefaultPrefs.ORACLE,
EnumDatabaseVendor.ORACLE, ProductConfigurationDefaultPrefs.IP_OR_HOST, 1521, ProductConfigurationDefaultPrefs.DATABASE_HINT, ProductConfigurationDefaultPrefs.USERNAME_HINT, ProductConfigurationDefaultPrefs.PASSWORD_HINT);
+ /* === datasource using a Microsoft SQLserver database === */
+ initializeIfNotExists (root, dataSourcesPrefs, ProductConfigurationDefaultPrefs.MSSQL, null,
+ EnumDatabaseVendor.MSSQL, "localhost", 1433, ProductConfigurationDefaultPrefs.DATABASE_HINT, ProductConfigurationDefaultPrefs.USERNAME_HINT, "");
/* === datasource using a MySQL database === */
initializeIfNotExists (root, dataSourcesPrefs, ProductConfigurationDefaultPrefs.MYSQL, null,
- EnumDatabaseVendor.MYSQL, "<ip-or-host>", 3306, ProductConfigurationDefaultPrefs.DATABASE_HINT, ProductConfigurationDefaultPrefs.USERNAME_HINT, "");
+ EnumDatabaseVendor.MYSQL, "localhost", 3306, ProductConfigurationDefaultPrefs.DATABASE_HINT, ProductConfigurationDefaultPrefs.USERNAME_HINT, "");
+ /* === datasource using a MySQL8 database === */
+ initializeIfNotExists (root, dataSourcesPrefs, ProductConfigurationDefaultPrefs.MYSQL8, null,
+ EnumDatabaseVendor.MYSQL8, "localhost", 3306, ProductConfigurationDefaultPrefs.DATABASE_HINT, ProductConfigurationDefaultPrefs.USERNAME_HINT, "");
/* === datasource using a H2 in-Memory database === */
initializeIfNotExists (root, dataSourcesPrefs, DEFAULT_H2MEMORY_DATASOURCE, null,
EnumDatabaseVendor.H2_IN_MEMORY, null, -1, ProductConfigurationDefaultPrefs.H2MEMORY, ProductConfigurationDefaultPrefs.H2MEMORY, ProductConfigurationDefaultPrefs.H2MEMORY); // NOSONAR
@@ -1811,6 +1876,7 @@
String driverClass = dataSource.get(DATASOURCE_DRIVER_CLASS, "");
String serverName = dataSource.get(DATASOURCE_SERVER_NAME, "");
int serverPort = dataSource.getInt(DATASOURCE_SERVER_PORT, 0);
+ String serverTimezone = dataSource.get(DATASOURCE_SERVER_TIMEZONE, DateTimeZone.forID( ZoneId.systemDefault().normalized().toString()).getNameKey(0));
String databaseUser = dataSource.get(DATASOURCE_DATABASE_USER, "");
String databasePass = dataSource.get(DATASOURCE_DATABASE_PASS, "");
String jdbcUrlFormat = dataSource.get(DATASOURCE_JDBC_URL_FORMAT, null);
@@ -1821,7 +1887,7 @@
vendor,
driverVendor, driverType, driverClass, serverName,
serverPort, databaseName, databaseUser, databasePass,
- jdbcUrlFormat);
+ jdbcUrlFormat, serverTimezone);
dataSources.put(dataSourceName, configuration);
}
}
@@ -2045,15 +2111,6 @@
public String getDatainterchangeConfiguration() {
return datainterchangeConfiguration;
}
-
- @Override
- public String getSignalConfiguration() {
- return signalConfiguration;
- }
-
- public void setSignalConfiguration(String value) {
- this.signalConfiguration = put(SIGNAL_NODE, SIGNAL_CONFIGURATION, value);
- }
@Override
public boolean isMavenActivated() {
diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductFileConfigurations.xtend b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductFileConfigurations.xtend
index 057a8fb..ee4776c 100644
--- a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductFileConfigurations.xtend
+++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductFileConfigurations.xtend
@@ -42,6 +42,8 @@
prepareSerialized(
'''
${{NECESSARY_DATA_BASE_VENDOR_CONFIGURATIONS}}
+ <plugin id="org.apache.aries.spifly.dynamic.bundle" autoStart="true" startLevel="2" />
+ <plugin id="org.apache.aries.util" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.e4.ui.services" autoStart="false" startLevel="1" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
@@ -60,7 +62,8 @@
<plugin id="org.eclipse.osbp.runtime.typeprovider.bundlespace" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.osbp.utils.entitymock.dbfill.ui" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" />
- ''')
+ <plugin id="org.objectweb.asm.commons" autoStart="true" startLevel="2" />
+ ''')
}
override getRecommendedAsString() {
diff --git a/org.eclipse.osbp.preferences/xtend-gen/org/eclipse/osbp/preferences/ProductFileConfigurations.java b/org.eclipse.osbp.preferences/xtend-gen/org/eclipse/osbp/preferences/ProductFileConfigurations.java
index 0cf299b..558bdd5 100644
--- a/org.eclipse.osbp.preferences/xtend-gen/org/eclipse/osbp/preferences/ProductFileConfigurations.java
+++ b/org.eclipse.osbp.preferences/xtend-gen/org/eclipse/osbp/preferences/ProductFileConfigurations.java
@@ -2,10 +2,10 @@
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
+ * are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
- *
+ *
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
@@ -56,6 +56,10 @@
StringConcatenation _builder = new StringConcatenation();
_builder.append("${{NECESSARY_DATA_BASE_VENDOR_CONFIGURATIONS}}");
_builder.newLine();
+ _builder.append("<plugin id=\"org.apache.aries.spifly.dynamic.bundle\" autoStart=\"true\" startLevel=\"2\" />");
+ _builder.newLine();
+ _builder.append("<plugin id=\"org.apache.aries.util\" autoStart=\"true\" startLevel=\"2\" />");
+ _builder.newLine();
_builder.append("<plugin id=\"org.eclipse.core.runtime\" autoStart=\"true\" startLevel=\"0\" />");
_builder.newLine();
_builder.append("<plugin id=\"org.eclipse.e4.ui.services\" autoStart=\"false\" startLevel=\"1\" />");
@@ -92,6 +96,8 @@
_builder.newLine();
_builder.append("<plugin id=\"org.eclipse.osgi\" autoStart=\"true\" startLevel=\"-1\" />");
_builder.newLine();
+ _builder.append("<plugin id=\"org.objectweb.asm.commons\" autoStart=\"true\" startLevel=\"2\" />\t\t");
+ _builder.newLine();
return this.prepareSerialized(_builder.toString());
}
diff --git a/org.eclipse.osbp.preferences/xtend-gen/org/eclipse/osbp/preferences/ProductFileFeatures.java b/org.eclipse.osbp.preferences/xtend-gen/org/eclipse/osbp/preferences/ProductFileFeatures.java
index 9fc521f..570efc9 100644
--- a/org.eclipse.osbp.preferences/xtend-gen/org/eclipse/osbp/preferences/ProductFileFeatures.java
+++ b/org.eclipse.osbp.preferences/xtend-gen/org/eclipse/osbp/preferences/ProductFileFeatures.java
@@ -2,10 +2,10 @@
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
+ * are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
- *
+ *
* SPDX-License-Identifier: EPL-2.0
*
* Contributors: