Fixed Layout

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-extractcodelist-widget@111611 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-02-03 11:55:16 +00:00
parent 0af85614f6
commit aa845044ab
2 changed files with 60 additions and 48 deletions

View File

@ -102,15 +102,16 @@ public class ExtractCodelistDetailsCard extends WizardCard {
automaticallyAttachTrue = new Radio();
automaticallyAttachTrue.setBoxLabel("True");
automaticallyAttachTrue.setValue(true);
automaticallyAttachFalse = new Radio();
automaticallyAttachFalse.setBoxLabel("False");
ToggleGroup automticallyAttachGroup = new ToggleGroup();
automticallyAttachGroup.add(automaticallyAttachTrue);
automticallyAttachGroup.add(automaticallyAttachFalse);
automticallyAttachGroup
ToggleGroup automaticallyAttachGroup = new ToggleGroup();
automaticallyAttachGroup.add(automaticallyAttachTrue);
automaticallyAttachGroup.add(automaticallyAttachFalse);
automaticallyAttachGroup
.addValueChangeHandler(new ValueChangeHandler<HasValue<Boolean>>() {
@Override
@ -141,7 +142,7 @@ public class ExtractCodelistDetailsCard extends WizardCard {
"Automatically attach the generated codelist"));
FieldLabel fieldAttach = new FieldLabel(automaticallyAttachPanel,
"Attach");
p.add(fieldAttach, new VerticalLayoutData(1, -1, new Margins(0)));
p.add(fieldAttach, new VerticalLayoutData(-1, -1, new Margins(0)));
// //

View File

@ -109,7 +109,6 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
"Collateral id is null", new Throwable(
"Collateral id is null"));
}
TDGWTServiceAsync.INSTANCE.setTabResourceToFinal(collateralTRId,
new AsyncCallback<Void>() {
@ -165,70 +164,82 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
}
private void createChangeColumnSession(ArrayList<ColumnData> refColumns){
ColumnData orig=extractCodelistSession.getAttachColumn();
ColumnTypeCode origColumnTypeCode= ColumnTypeMap.getColumnTypeCode(orig.getTypeCode());
ColumnDataType origColumnDataType= ColumnTypeMap.getColumnDataType(orig.getDataTypeName());
String labelOfAttachColumn=null;
ColumnTypeCode typeCodeOfColumnAttach=null;
for(ExtractCodelistTargetColumn targetCol:extractCodelistSession.getTargetColumns()){
if(targetCol.getSourceColumn().getColumnId().compareTo(orig.getColumnId())==0){
if(targetCol.isNewColumn()){
labelOfAttachColumn=targetCol.getDefColumn().getLabel();
typeCodeOfColumnAttach=targetCol.getDefColumn().getColumnType();
private void createChangeColumnSession(ArrayList<ColumnData> refColumns) {
ColumnData orig = extractCodelistSession.getAttachColumn();
ColumnTypeCode origColumnTypeCode = ColumnTypeMap
.getColumnTypeCode(orig.getTypeCode());
ColumnDataType origColumnDataType = ColumnTypeMap
.getColumnDataType(orig.getDataTypeName());
String labelOfAttachColumn = null;
ColumnTypeCode typeCodeOfColumnAttach = null;
for (ExtractCodelistTargetColumn targetCol : extractCodelistSession
.getTargetColumns()) {
if (targetCol.getSourceColumn().getColumnId()
.compareTo(orig.getColumnId()) == 0) {
if (targetCol.isNewColumn()) {
labelOfAttachColumn = targetCol.getDefColumn().getLabel();
typeCodeOfColumnAttach = targetCol.getDefColumn()
.getColumnType();
} else {
labelOfAttachColumn=targetCol.getTargetColumn().getLabel();
typeCodeOfColumnAttach=ColumnTypeMap.getColumnTypeCode(targetCol.getTargetColumn().getTypeCode());
labelOfAttachColumn = targetCol.getTargetColumn()
.getLabel();
typeCodeOfColumnAttach = ColumnTypeMap
.getColumnTypeCode(targetCol.getTargetColumn()
.getTypeCode());
}
break;
}
}
ColumnData codelistColumnReference=null;
if(labelOfAttachColumn==null){
showErrorAndHide(
"Error in extract codelist",
ColumnData codelistColumnReference = null;
if (labelOfAttachColumn == null) {
showErrorAndHide("Error in extract codelist",
"An error occured no label retrieved for attach column",
"No label retrieved for attach column", new Throwable("No label retrieved for attach column"));
"No label retrieved for attach column", new Throwable(
"No label retrieved for attach column"));
return;
} else {
for(ColumnData refColumn:refColumns){
if(refColumn.getLabel().compareTo(labelOfAttachColumn)==0){
if(ColumnTypeMap.getColumnTypeCode(refColumn.getTypeCode()).compareTo(typeCodeOfColumnAttach)==0){
codelistColumnReference=refColumn;
for (ColumnData refColumn : refColumns) {
if (refColumn.getLabel().compareTo(labelOfAttachColumn) == 0) {
if (ColumnTypeMap
.getColumnTypeCode(refColumn.getTypeCode())
.compareTo(typeCodeOfColumnAttach) == 0) {
codelistColumnReference = refColumn;
break;
} else {
}
}
}
}
if(codelistColumnReference!=null){
ColumnTypeCode columnTypeCodeTarget = ColumnTypeMap.getColumnTypeCode(codelistColumnReference.getTypeCode());
ColumnDataType columnDataTypeTarget = ColumnTypeMap.getColumnDataType(codelistColumnReference.getDataTypeName());
ChangeColumnTypeSession changeColumnTypeSession=new
ChangeColumnTypeSession(orig, origColumnTypeCode, origColumnDataType, columnTypeCodeTarget, columnDataTypeTarget, codelistColumnReference);
if (codelistColumnReference != null) {
ColumnTypeCode columnTypeCodeTarget = ColumnTypeCode.DIMENSION;
ChangeColumnTypeSession changeColumnTypeSession = new ChangeColumnTypeSession(
orig, origColumnTypeCode, origColumnDataType,
columnTypeCodeTarget, null, codelistColumnReference);
callChangeColumnType(changeColumnTypeSession);
} else {
showErrorAndHide(
"Error in extract codelist",
showErrorAndHide("Error in extract codelist",
"An error occured no attach column match",
"No attach column match", new Throwable("No attach column match"));
"No attach column match", new Throwable(
"No attach column match"));
}
}
private void callChangeColumnType(
ChangeColumnTypeSession changeColumnTypeSession) {
ChangeColumnTypeSession changeColumnTypeSession) {
TDGWTServiceAsync.INSTANCE.startChangeColumnType(
changeColumnTypeSession, new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
getEventBus().fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
getEventBus()
.fireEvent(
new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
showErrorAndHide(
"Error in extract codelist",
@ -238,7 +249,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
}
public void onSuccess(String taskId) {
automaticallyAttached=true;
automaticallyAttached = true;
openMonitorDialog(taskId);
}