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)));
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();
*/
}

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.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<ColumnMappingData> mapping) {
/**
*
* @param mapping
*/
protected void startTaskResume(ArrayList<ColumnMappingData> mapping, ColumnData column) {
TaskResumeSession taskResumeSession = new TaskResumeSession(trId,
taskId, mapping);
taskId, mapping, column, invocationS);
TDGWTServiceAsync.INSTANCE.startTaskResume(taskResumeSession,
new AsyncCallback<Void>() {
@ -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<ReplaceEntry> 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<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();
}
});
*/
startTaskResume(mapping, col);
}
/**
*
*/
protected void callChangeColumnTypeProgressDialog() {
ChangeColumnTypeProgressDialog changeColumnTypeProgressDialog = new ChangeColumnTypeProgressDialog(
eventBus);