diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/ChangeColumnTypePanel.java b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/ChangeColumnTypePanel.java index 2635c76..9f2478b 100644 --- a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/ChangeColumnTypePanel.java +++ b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/ChangeColumnTypePanel.java @@ -397,8 +397,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements new Margins(1))); v.add(comboColumnReferenceTypeLabel, new VerticalLayoutData(1, -1, new Margins(1))); - v.add(comboColumnMappingLabel, new VerticalLayoutData(1, -1, - new Margins(1))); + /*v.add(comboColumnMappingLabel, new VerticalLayoutData(1, -1, + new Margins(1)));*/ v.add(comboTimeDimensionTypeLabel, new VerticalLayoutData(1, -1, new Margins(1))); v.add(change, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0))); @@ -557,11 +557,15 @@ public class ChangeColumnTypePanel extends FramedPanel implements + "!")); Log.debug("ComboColumnReferenceType selected: " + event.getSelectedItem()); + + //TODO Mapping fix + /* comboColumnMapping.reset(); storeComboColumnMapping.clear(); storeComboColumnMapping.commitChanges(); comboColumnMappingLabel.setVisible(true); forceLayout(); + */ } diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchDialog.java b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchDialog.java index a46021a..a8aa382 100644 --- a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchDialog.java @@ -14,6 +14,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.Constants; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; import org.gcube.portlets.user.td.gwtservice.shared.task.InvocationS; import org.gcube.portlets.user.td.gwtservice.shared.task.TaskResumeSession; +import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; import org.gcube.portlets.user.td.gwtservice.shared.tr.ConditionCode; import org.gcube.portlets.user.td.gwtservice.shared.tr.DimensionRow; import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceBatchColumnSession; @@ -51,7 +52,13 @@ public class ReplaceBatchDialog extends Window implements protected String taskId; private InvocationS invocationS; private ConditionCode conditionCode; // For Curation - + + /** + * + * @param trId + * @param columnName + * @param eventBus + */ public ReplaceBatchDialog(TRId trId, String columnName, EventBus eventBus) { this.trId = trId; this.columnName = columnName; @@ -62,7 +69,13 @@ public class ReplaceBatchDialog extends Window implements columnName, eventBus); add(batchRepalcePanel); } - + + /** + * + * @param trId + * @param requestProperties + * @param eventBus + */ public ReplaceBatchDialog(TRId trId, RequestProperties requestProperties, EventBus eventBus) { Log.debug("ReplaceBatchDialog: " + trId + ", RequestProperties:" @@ -85,7 +98,10 @@ public class ReplaceBatchDialog extends Window implements requestProperties, eventBus); add(batchRepalcePanel); } - + + /** + * + */ protected void initWindow() { setWidth(WIDTH); setHeight(HEIGHT); @@ -158,12 +174,19 @@ public class ReplaceBatchDialog extends Window implements }); } - + + /** + * + */ protected void close() { hide(); } - + + /** + * + * @param replaceBatchColumnSession + */ protected void startBatchReplace( ReplaceBatchColumnSession replaceBatchColumnSession) { if (conditionCode == null) { @@ -173,7 +196,7 @@ public class ReplaceBatchDialog extends Window implements case AllowedColumnType: break; case AmbiguousValueOnExternalReference: - callChangeColumnType(replaceBatchColumnSession); + callResumeOnChangeColumnType(replaceBatchColumnSession); break; case CastValidation: break; @@ -211,7 +234,11 @@ public class ReplaceBatchDialog extends Window implements } } } - + + /** + * + * @param replaceBatchColumnSession + */ protected void callStartReplaceBatchColumn( ReplaceBatchColumnSession replaceBatchColumnSession) { TDGWTServiceAsync.INSTANCE.startReplaceBatchColumn( @@ -239,7 +266,10 @@ public class ReplaceBatchDialog extends Window implements }); } - + + /** + * + */ protected void callReplaceBatchColumnProgressDialog() { ReplaceBatchColumnProgressDialog dialog = new ReplaceBatchColumnProgressDialog( eventBus); @@ -327,7 +357,10 @@ public class ReplaceBatchDialog extends Window implements hide(); } - + + /** + * + */ protected void startTaskResume() { TaskResumeSession taskResumeSession = new TaskResumeSession(trId, taskId); @@ -358,9 +391,13 @@ public class ReplaceBatchDialog extends Window implements }); } - protected void startTaskResume(ArrayList mapping) { + /** + * + * @param mapping + */ + protected void startTaskResume(ArrayList mapping, ColumnData column) { TaskResumeSession taskResumeSession = new TaskResumeSession(trId, - taskId, mapping); + taskId, mapping, column, invocationS); TDGWTServiceAsync.INSTANCE.startTaskResume(taskResumeSession, new AsyncCallback() { @@ -388,7 +425,10 @@ public class ReplaceBatchDialog extends Window implements }); } - + + /** + * + */ protected void callForTaskResume() { TaskResumeProgressDialog dialog = new TaskResumeProgressDialog(eventBus); dialog.addResumeDialogListener(this); @@ -423,20 +463,15 @@ public class ReplaceBatchDialog extends Window implements } - private void callChangeColumnType( + /** + * + * @param replaceBatchColumnSession + */ + private void callResumeOnChangeColumnType( ReplaceBatchColumnSession replaceBatchColumnSession) { Log.debug("ReplaceBatchColumnSession: "+replaceBatchColumnSession.toString()); - /*TODO: Remove this lines - - ColumnData col = replaceBatchColumnSession.getColumnData(); - ColumnTypeCode colTypeCode = ColumnTypeMap.getColumnTypeCode(col - .getTypeCode()); - ColumnDataType colDataType = ColumnTypeMap.getColumnDataType(col - .getDataTypeName()); - ColumnData codelistColumnReference = replaceBatchColumnSession - .getConnection(); - */ + ColumnData col=replaceBatchColumnSession.getColumnData(); ArrayList replaceEntryList = replaceBatchColumnSession .getReplaceEntryList(); @@ -451,44 +486,13 @@ public class ReplaceBatchDialog extends Window implements mapping.add(columnMappingData); } - startTaskResume(mapping); - - /*TODO: Remove this lines - ColumnMappingList columnMappingList = new ColumnMappingList("1", "map", - mapping); - - ChangeColumnTypeSession changeColumnTypeSession = new ChangeColumnTypeSession( - col, colTypeCode, colDataType, ColumnTypeCode.DIMENSION, - ColumnDataType.Integer, codelistColumnReference, - columnMappingList); - - Log.debug("ChangeColumnTypeSession: "+changeColumnTypeSession.toString()); - - TDGWTServiceAsync.INSTANCE.startChangeColumnType( - changeColumnTypeSession, new AsyncCallback() { - public void onFailure(Throwable caught) { - if (caught instanceof TDGWTSessionExpiredException) { - eventBus.fireEvent(new SessionExpiredEvent( - SessionExpiredType.EXPIREDONSERVER)); - } else { - Log.debug("Change Column Type Error: " - + caught.getLocalizedMessage()); - UtilsGXT3 - .alert("Change Column Type Error ", - "Error in invocation of change column type operation!"); - } - } - - public void onSuccess(Void result) { - callChangeColumnTypeProgressDialog(); - - } - - }); - */ + startTaskResume(mapping, col); } + /** + * + */ protected void callChangeColumnTypeProgressDialog() { ChangeColumnTypeProgressDialog changeColumnTypeProgressDialog = new ChangeColumnTypeProgressDialog( eventBus);