Skip to content

Commit

Permalink
[TOOLS-4532] Migration Wizard Step 4(Schema Mapping Page) improvements (
Browse files Browse the repository at this point in the history
  • Loading branch information
Srltas authored Oct 20, 2023
1 parent 026f7e8 commit c7f11b0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ targetDBPageComboDefault=Default
targetDBPageFileRepositoryLabel=File Repositor&y \:
targetDBPageOfflineErrMsg2=Name can not be empty
targetDBPageOfflineTargetFileRepositoryErrMsg=Select file repository path
targetDBVersion=DB Version\:
targetDBVersion=CUBRID Version\:
targetPKColumns=Target PK Columns
targetSchema=Target Schema
targetSchemaDes=Target DB's Target Schema Name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ targetDBPageComboDefault=\uAE30\uBCF8\uAC12
targetDBPageFileRepositoryLabel=\uD30C\uC77C \uACBD\uB85C \:
targetDBPageOfflineErrMsg2=\uC774\uB984\uC744 \uC785\uB825\uD574 \uC8FC\uC138\uC694.
targetDBPageOfflineTargetFileRepositoryErrMsg=\uD30C\uC77C\uB85C \uC800\uC7A5\uD560 \uACBD\uB85C\uB97C \uC120\uD0DD\uD558\uC138\uC694.
targetDBVersion=DB \uBC84\uC804\:
targetDBVersion=CUBRID \uBC84\uC804\:
targetPKColumns=\uB300\uC0C1 PK \uCEEC\uB7FC
targetSchema=\ub300\uc0c1 \uc2a4\ud0a4\ub9c8
targetSchemaDes=\uc774\uad00\ub420 \ub300\uc0c1 \u0044\u0042\uc758 \uc2a4\ud0a4\ub9c8 \uc774\ub984\uc785\ub2c8\ub2e4\u002e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.PageChangedEvent;
Expand Down Expand Up @@ -285,7 +286,6 @@ public void dispose() {}

@Override
public void addListener(ILabelProviderListener listener) {}

});

srcTableViewer.setColumnProperties(propertyList);
Expand Down Expand Up @@ -547,7 +547,7 @@ private void setOfflineData() {

} else {
if (config.isAddUserSchema()) {
srcTable.setTarSchema(Messages.msgTypeSchema);
srcTable.setTarSchema(srcTable.getSrcSchema());
} else {
srcTable.setTarSchema(srcTable.getSrcSchema());
}
Expand All @@ -559,7 +559,6 @@ private void setOnlineSchemaMappingPage() {
setOnlineData();
getSchemaValues();
setOnlineEditor();

}

private void setOnlineData() {
Expand Down Expand Up @@ -615,29 +614,29 @@ private void setOnlineData() {

@Override
protected void afterShowCurrentPage(PageChangedEvent event) {
// TODO need reset when select different target connection
wizard = getMigrationWizard();
config = wizard.getMigrationConfig();

if (firstVisible) {
setTitle(wizard.getStepNoMsg(this) + Messages.schemaMappingPageTitle);
if ((config.targetIsOnline() && !wizard.getTargetCatalog().isDBAGroup())
|| (!config.targetIsOnline()) && !config.isAddUserSchema()) {
setDescription(Messages.schemaMappingPageDescriptionUncorrectable);
} else {
setDescription(Messages.schemaMappingPageDescription);
}

if (!config.targetIsOnline()) {
setOfflineSchemaMappingPage();
} else {
setOnlineSchemaMappingPage();
}

srcTableViewer.setInput(srcTableList);

firstVisible = false;

if (srcTableList != null) {
srcTableList.clear();
}

setTitle(wizard.getStepNoMsg(this) + Messages.schemaMappingPageTitle);
if ((config.targetIsOnline() && !wizard.getTargetCatalog().isDBAGroup())
|| (!config.targetIsOnline()) && !config.isAddUserSchema()) {
setDescription(Messages.schemaMappingPageDescriptionUncorrectable);
} else {
setDescription(Messages.schemaMappingPageDescription);
}

if (!config.targetIsOnline()) {
setOfflineSchemaMappingPage();
} else {
setOnlineSchemaMappingPage();
}

srcTableViewer.setInput(srcTableList);
firstVisible = firstVisible ? false : true;
}

@Override
Expand Down Expand Up @@ -675,7 +674,7 @@ private boolean saveOnlineData() {
continue;
}

if (srcTable.getTarSchema().isEmpty() || isDefaultMessage(srcTable.getTarSchema())) {
if (srcTable.getTarSchema().isEmpty()) {
MessageDialog.openError(getShell(), Messages.msgError, Messages.msgErrEmptySchemaName);
return false;
}
Expand Down Expand Up @@ -741,10 +740,10 @@ private boolean saveOfflineData(boolean addUserSchema, boolean splitSchema) {
grantFileListFullName = new HashMap<String, String>();

for (SrcTable srcTable : srcTableList) {
if (addUserSchema && srcTable.isSelected() && (srcTable.getTarSchema().isEmpty() || srcTable.getTarSchema() == null
|| srcTable.getTarSchema().equals(Messages.msgTypeSchema))) {
String targetSchemaName = srcTable.getTarSchema();
if (addUserSchema && srcTable.isSelected()
&& (targetSchemaName == null || targetSchemaName.isEmpty() || StringUtils.trimToEmpty(targetSchemaName).equals(""))) {
MessageDialog.openError(getShell(), Messages.msgError, Messages.msgErrEmptySchemaName);

return false;
}

Expand Down Expand Up @@ -909,13 +908,4 @@ private boolean isSelectCheckbox() {
}
return false;
}

private boolean isDefaultMessage(String enterSchema) {
if (enterSchema.equals(Messages.msgDefaultSchema) ||
enterSchema.equals(Messages.msgTypeSchema)) {
return true;
}

return false;
}
}

0 comments on commit c7f11b0

Please sign in to comment.