提交 f6715e65 编写于 作者: S Serge Rider

Datasources configuration refactoring

上级 ba0a4e7c
......@@ -565,6 +565,12 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
xml.addAttribute(RegistryConstants.ATTR_VALUE, CommonUtils.toString(entry.getValue()));
xml.endElement();
}
for (Map.Entry<Object, Object> entry : connectionInfo.getProviderProperties().entrySet()) {
xml.startElement(RegistryConstants.TAG_PROVIDER_PROPERTY);
xml.addAttribute(RegistryConstants.ATTR_NAME, CommonUtils.toString(entry.getKey()));
xml.addAttribute(RegistryConstants.ATTR_VALUE, CommonUtils.toString(entry.getValue()));
xml.endElement();
}
// Save events
for (DBPConnectionEventType eventType : connectionInfo.getDeclaredEvents()) {
......@@ -670,7 +676,11 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
}
}
//xml.addText(CommonUtils.getString(dataSource.getDescription()));
if (!CommonUtils.isEmpty(dataSource.getDescription())) {
xml.startElement(RegistryConstants.TAG_DESCRIPTION);
xml.addText(dataSource.getDescription());
xml.endElement();
}
xml.endElement();
}
......@@ -935,6 +945,13 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
atts.getValue(RegistryConstants.ATTR_VALUE));
}
break;
case RegistryConstants.TAG_PROVIDER_PROPERTY:
if (curDataSource != null) {
curDataSource.getConnectionConfiguration().setProviderProperty(
atts.getValue(RegistryConstants.ATTR_NAME),
atts.getValue(RegistryConstants.ATTR_VALUE));
}
break;
case RegistryConstants.TAG_EVENT:
if (curDataSource != null) {
DBPConnectionEventType eventType = DBPConnectionEventType.valueOf(atts.getValue(RegistryConstants.ATTR_TYPE));
......
......@@ -131,8 +131,9 @@ public class RegistryConstants {
public static final String TAG_DATA_SOURCE = "data-source"; //$NON-NLS-1$
public static final String TAG_EVENT = "event"; //$NON-NLS-1$
public static final String TAG_NETWORK_HANDLER = "network-handler"; //$NON-NLS-1$
public static final String TAG_PROVIDER_PROPERTY = "provider-property"; //$NON-NLS-1$
public static final String TAG_CUSTOM_PROPERTY = "custom-property"; //$NON-NLS-1$
public static final String TAG_NETWORK_HANDLER = "network-handler"; //$NON-NLS-1$
public static final String TAG_DESCRIPTION = "description"; //$NON-NLS-1$
public static final String TAG_CONNECTION = "connection"; //$NON-NLS-1$
public static final String TAG_BOOTSTRAP = "bootstrap"; //$NON-NLS-1$
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册