Updated Curation

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@98708 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-07-16 17:51:54 +00:00
parent 4fed851023
commit 0a8dca0d4f
2 changed files with 68 additions and 60 deletions

View File

@ -397,8 +397,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
new Margins(1))); new Margins(1)));
v.add(comboColumnReferenceTypeLabel, new VerticalLayoutData(1, -1, v.add(comboColumnReferenceTypeLabel, new VerticalLayoutData(1, -1,
new Margins(1))); new Margins(1)));
v.add(comboColumnMappingLabel, new VerticalLayoutData(1, -1, /*v.add(comboColumnMappingLabel, new VerticalLayoutData(1, -1,
new Margins(1))); new Margins(1)));*/
v.add(comboTimeDimensionTypeLabel, new VerticalLayoutData(1, -1, v.add(comboTimeDimensionTypeLabel, new VerticalLayoutData(1, -1,
new Margins(1))); new Margins(1)));
v.add(change, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0))); 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: " Log.debug("ComboColumnReferenceType selected: "
+ event.getSelectedItem()); + event.getSelectedItem());
//TODO Mapping fix
/*
comboColumnMapping.reset(); comboColumnMapping.reset();
storeComboColumnMapping.clear(); storeComboColumnMapping.clear();
storeComboColumnMapping.commitChanges(); storeComboColumnMapping.commitChanges();
comboColumnMappingLabel.setVisible(true); comboColumnMappingLabel.setVisible(true);
forceLayout(); forceLayout();
*/
} }

View File

@ -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.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.task.InvocationS; 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.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.ConditionCode;
import org.gcube.portlets.user.td.gwtservice.shared.tr.DimensionRow; import org.gcube.portlets.user.td.gwtservice.shared.tr.DimensionRow;
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceBatchColumnSession; import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceBatchColumnSession;
@ -51,7 +52,13 @@ public class ReplaceBatchDialog extends Window implements
protected String taskId; protected String taskId;
private InvocationS invocationS; private InvocationS invocationS;
private ConditionCode conditionCode; // For Curation private ConditionCode conditionCode; // For Curation
/**
*
* @param trId
* @param columnName
* @param eventBus
*/
public ReplaceBatchDialog(TRId trId, String columnName, EventBus eventBus) { public ReplaceBatchDialog(TRId trId, String columnName, EventBus eventBus) {
this.trId = trId; this.trId = trId;
this.columnName = columnName; this.columnName = columnName;
@ -62,7 +69,13 @@ public class ReplaceBatchDialog extends Window implements
columnName, eventBus); columnName, eventBus);
add(batchRepalcePanel); add(batchRepalcePanel);
} }
/**
*
* @param trId
* @param requestProperties
* @param eventBus
*/
public ReplaceBatchDialog(TRId trId, RequestProperties requestProperties, public ReplaceBatchDialog(TRId trId, RequestProperties requestProperties,
EventBus eventBus) { EventBus eventBus) {
Log.debug("ReplaceBatchDialog: " + trId + ", RequestProperties:" Log.debug("ReplaceBatchDialog: " + trId + ", RequestProperties:"
@ -85,7 +98,10 @@ public class ReplaceBatchDialog extends Window implements
requestProperties, eventBus); requestProperties, eventBus);
add(batchRepalcePanel); add(batchRepalcePanel);
} }
/**
*
*/
protected void initWindow() { protected void initWindow() {
setWidth(WIDTH); setWidth(WIDTH);
setHeight(HEIGHT); setHeight(HEIGHT);
@ -158,12 +174,19 @@ public class ReplaceBatchDialog extends Window implements
}); });
} }
/**
*
*/
protected void close() { protected void close() {
hide(); hide();
} }
/**
*
* @param replaceBatchColumnSession
*/
protected void startBatchReplace( protected void startBatchReplace(
ReplaceBatchColumnSession replaceBatchColumnSession) { ReplaceBatchColumnSession replaceBatchColumnSession) {
if (conditionCode == null) { if (conditionCode == null) {
@ -173,7 +196,7 @@ public class ReplaceBatchDialog extends Window implements
case AllowedColumnType: case AllowedColumnType:
break; break;
case AmbiguousValueOnExternalReference: case AmbiguousValueOnExternalReference:
callChangeColumnType(replaceBatchColumnSession); callResumeOnChangeColumnType(replaceBatchColumnSession);
break; break;
case CastValidation: case CastValidation:
break; break;
@ -211,7 +234,11 @@ public class ReplaceBatchDialog extends Window implements
} }
} }
} }
/**
*
* @param replaceBatchColumnSession
*/
protected void callStartReplaceBatchColumn( protected void callStartReplaceBatchColumn(
ReplaceBatchColumnSession replaceBatchColumnSession) { ReplaceBatchColumnSession replaceBatchColumnSession) {
TDGWTServiceAsync.INSTANCE.startReplaceBatchColumn( TDGWTServiceAsync.INSTANCE.startReplaceBatchColumn(
@ -239,7 +266,10 @@ public class ReplaceBatchDialog extends Window implements
}); });
} }
/**
*
*/
protected void callReplaceBatchColumnProgressDialog() { protected void callReplaceBatchColumnProgressDialog() {
ReplaceBatchColumnProgressDialog dialog = new ReplaceBatchColumnProgressDialog( ReplaceBatchColumnProgressDialog dialog = new ReplaceBatchColumnProgressDialog(
eventBus); eventBus);
@ -327,7 +357,10 @@ public class ReplaceBatchDialog extends Window implements
hide(); hide();
} }
/**
*
*/
protected void startTaskResume() { protected void startTaskResume() {
TaskResumeSession taskResumeSession = new TaskResumeSession(trId, TaskResumeSession taskResumeSession = new TaskResumeSession(trId,
taskId); taskId);
@ -358,9 +391,13 @@ public class ReplaceBatchDialog extends Window implements
}); });
} }
protected void startTaskResume(ArrayList<ColumnMappingData> mapping) { /**
*
* @param mapping
*/
protected void startTaskResume(ArrayList<ColumnMappingData> mapping, ColumnData column) {
TaskResumeSession taskResumeSession = new TaskResumeSession(trId, TaskResumeSession taskResumeSession = new TaskResumeSession(trId,
taskId, mapping); taskId, mapping, column, invocationS);
TDGWTServiceAsync.INSTANCE.startTaskResume(taskResumeSession, TDGWTServiceAsync.INSTANCE.startTaskResume(taskResumeSession,
new AsyncCallback<Void>() { new AsyncCallback<Void>() {
@ -388,7 +425,10 @@ public class ReplaceBatchDialog extends Window implements
}); });
} }
/**
*
*/
protected void callForTaskResume() { protected void callForTaskResume() {
TaskResumeProgressDialog dialog = new TaskResumeProgressDialog(eventBus); TaskResumeProgressDialog dialog = new TaskResumeProgressDialog(eventBus);
dialog.addResumeDialogListener(this); dialog.addResumeDialogListener(this);
@ -423,20 +463,15 @@ public class ReplaceBatchDialog extends Window implements
} }
private void callChangeColumnType( /**
*
* @param replaceBatchColumnSession
*/
private void callResumeOnChangeColumnType(
ReplaceBatchColumnSession replaceBatchColumnSession) { ReplaceBatchColumnSession replaceBatchColumnSession) {
Log.debug("ReplaceBatchColumnSession: "+replaceBatchColumnSession.toString()); Log.debug("ReplaceBatchColumnSession: "+replaceBatchColumnSession.toString());
/*TODO: Remove this lines ColumnData col=replaceBatchColumnSession.getColumnData();
ColumnData col = replaceBatchColumnSession.getColumnData();
ColumnTypeCode colTypeCode = ColumnTypeMap.getColumnTypeCode(col
.getTypeCode());
ColumnDataType colDataType = ColumnTypeMap.getColumnDataType(col
.getDataTypeName());
ColumnData codelistColumnReference = replaceBatchColumnSession
.getConnection();
*/
ArrayList<ReplaceEntry> replaceEntryList = replaceBatchColumnSession ArrayList<ReplaceEntry> replaceEntryList = replaceBatchColumnSession
.getReplaceEntryList(); .getReplaceEntryList();
@ -451,44 +486,13 @@ public class ReplaceBatchDialog extends Window implements
mapping.add(columnMappingData); mapping.add(columnMappingData);
} }
startTaskResume(mapping); startTaskResume(mapping, col);
/*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<Void>() {
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();
}
});
*/
} }
/**
*
*/
protected void callChangeColumnTypeProgressDialog() { protected void callChangeColumnTypeProgressDialog() {
ChangeColumnTypeProgressDialog changeColumnTypeProgressDialog = new ChangeColumnTypeProgressDialog( ChangeColumnTypeProgressDialog changeColumnTypeProgressDialog = new ChangeColumnTypeProgressDialog(
eventBus); eventBus);