提交 012f0b33 编写于 作者: S serge-rider

#4985 Data transfer processors settings save/load fix

上级 7a2803b2
......@@ -172,4 +172,9 @@ public class DataTransferProcessorDescriptor extends AbstractDescriptor implemen
public String getFullId() {
return node.getId() + ":" + getId();
}
@Override
public String toString() {
return getFullId();
}
}
......@@ -426,6 +426,14 @@ public class DataTransferSettings {
for (IDialogSettings procSection : ArrayUtils.safeArray(processorsSection.getSections())) {
String processorId = procSection.getName();
String nodeId = procSection.get("@node");
if (CommonUtils.isEmpty(nodeId)) {
// Legacy code support
int divPos = processorId.indexOf(':');
if (divPos != -1) {
nodeId = processorId.substring(0, divPos);
processorId = processorId.substring(divPos + 1);
}
}
String propNamesId = procSection.get("@propNames");
DataTransferNodeDescriptor node = DataTransferRegistry.getInstance().getNodeById(nodeId);
if (node != null) {
......@@ -466,12 +474,11 @@ public class DataTransferSettings {
}
// Save processors' properties
IDialogSettings processorsSection = DialogSettings.getOrCreateSection(dialogSettings, "processors");
IDialogSettings processorsSection = dialogSettings.addNewSection("processors");
for (DataTransferProcessorDescriptor procDescriptor : processorPropsHistory.keySet()) {
IDialogSettings procSettings = DialogSettings.getOrCreateSection(processorsSection, procDescriptor.getId());
procSettings.put("@node", procDescriptor.getNode().getId());
IDialogSettings procSettings = processorsSection.addNewSection(procDescriptor.getFullId());
Map<Object, Object> props = processorPropsHistory.get(procDescriptor);
if (props != null) {
if (!CommonUtils.isEmpty(props)) {
StringBuilder propNames = new StringBuilder();
for (Map.Entry<Object, Object> prop : props.entrySet()) {
propNames.append(prop.getKey()).append(',');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册