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:
parent
0af85614f6
commit
aa845044ab
|
@ -102,15 +102,16 @@ public class ExtractCodelistDetailsCard extends WizardCard {
|
||||||
automaticallyAttachTrue = new Radio();
|
automaticallyAttachTrue = new Radio();
|
||||||
automaticallyAttachTrue.setBoxLabel("True");
|
automaticallyAttachTrue.setBoxLabel("True");
|
||||||
automaticallyAttachTrue.setValue(true);
|
automaticallyAttachTrue.setValue(true);
|
||||||
|
|
||||||
|
|
||||||
automaticallyAttachFalse = new Radio();
|
automaticallyAttachFalse = new Radio();
|
||||||
automaticallyAttachFalse.setBoxLabel("False");
|
automaticallyAttachFalse.setBoxLabel("False");
|
||||||
|
|
||||||
ToggleGroup automticallyAttachGroup = new ToggleGroup();
|
ToggleGroup automaticallyAttachGroup = new ToggleGroup();
|
||||||
automticallyAttachGroup.add(automaticallyAttachTrue);
|
automaticallyAttachGroup.add(automaticallyAttachTrue);
|
||||||
automticallyAttachGroup.add(automaticallyAttachFalse);
|
automaticallyAttachGroup.add(automaticallyAttachFalse);
|
||||||
|
|
||||||
automticallyAttachGroup
|
automaticallyAttachGroup
|
||||||
.addValueChangeHandler(new ValueChangeHandler<HasValue<Boolean>>() {
|
.addValueChangeHandler(new ValueChangeHandler<HasValue<Boolean>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -141,7 +142,7 @@ public class ExtractCodelistDetailsCard extends WizardCard {
|
||||||
"Automatically attach the generated codelist"));
|
"Automatically attach the generated codelist"));
|
||||||
FieldLabel fieldAttach = new FieldLabel(automaticallyAttachPanel,
|
FieldLabel fieldAttach = new FieldLabel(automaticallyAttachPanel,
|
||||||
"Attach");
|
"Attach");
|
||||||
p.add(fieldAttach, new VerticalLayoutData(1, -1, new Margins(0)));
|
p.add(fieldAttach, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||||
|
|
||||||
// //
|
// //
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,6 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
|
||||||
"Collateral id is null", new Throwable(
|
"Collateral id is null", new Throwable(
|
||||||
"Collateral id is null"));
|
"Collateral id is null"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TDGWTServiceAsync.INSTANCE.setTabResourceToFinal(collateralTRId,
|
TDGWTServiceAsync.INSTANCE.setTabResourceToFinal(collateralTRId,
|
||||||
new AsyncCallback<Void>() {
|
new AsyncCallback<Void>() {
|
||||||
|
@ -165,70 +164,82 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createChangeColumnSession(ArrayList<ColumnData> refColumns){
|
private void createChangeColumnSession(ArrayList<ColumnData> refColumns) {
|
||||||
ColumnData orig=extractCodelistSession.getAttachColumn();
|
ColumnData orig = extractCodelistSession.getAttachColumn();
|
||||||
ColumnTypeCode origColumnTypeCode= ColumnTypeMap.getColumnTypeCode(orig.getTypeCode());
|
ColumnTypeCode origColumnTypeCode = ColumnTypeMap
|
||||||
ColumnDataType origColumnDataType= ColumnTypeMap.getColumnDataType(orig.getDataTypeName());
|
.getColumnTypeCode(orig.getTypeCode());
|
||||||
|
ColumnDataType origColumnDataType = ColumnTypeMap
|
||||||
String labelOfAttachColumn=null;
|
.getColumnDataType(orig.getDataTypeName());
|
||||||
ColumnTypeCode typeCodeOfColumnAttach=null;
|
|
||||||
for(ExtractCodelistTargetColumn targetCol:extractCodelistSession.getTargetColumns()){
|
String labelOfAttachColumn = null;
|
||||||
if(targetCol.getSourceColumn().getColumnId().compareTo(orig.getColumnId())==0){
|
ColumnTypeCode typeCodeOfColumnAttach = null;
|
||||||
if(targetCol.isNewColumn()){
|
for (ExtractCodelistTargetColumn targetCol : extractCodelistSession
|
||||||
labelOfAttachColumn=targetCol.getDefColumn().getLabel();
|
.getTargetColumns()) {
|
||||||
typeCodeOfColumnAttach=targetCol.getDefColumn().getColumnType();
|
if (targetCol.getSourceColumn().getColumnId()
|
||||||
|
.compareTo(orig.getColumnId()) == 0) {
|
||||||
|
if (targetCol.isNewColumn()) {
|
||||||
|
labelOfAttachColumn = targetCol.getDefColumn().getLabel();
|
||||||
|
typeCodeOfColumnAttach = targetCol.getDefColumn()
|
||||||
|
.getColumnType();
|
||||||
} else {
|
} else {
|
||||||
labelOfAttachColumn=targetCol.getTargetColumn().getLabel();
|
labelOfAttachColumn = targetCol.getTargetColumn()
|
||||||
typeCodeOfColumnAttach=ColumnTypeMap.getColumnTypeCode(targetCol.getTargetColumn().getTypeCode());
|
.getLabel();
|
||||||
|
typeCodeOfColumnAttach = ColumnTypeMap
|
||||||
|
.getColumnTypeCode(targetCol.getTargetColumn()
|
||||||
|
.getTypeCode());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnData codelistColumnReference=null;
|
ColumnData codelistColumnReference = null;
|
||||||
|
|
||||||
if(labelOfAttachColumn==null){
|
if (labelOfAttachColumn == null) {
|
||||||
showErrorAndHide(
|
showErrorAndHide("Error in extract codelist",
|
||||||
"Error in extract codelist",
|
|
||||||
"An error occured no label retrieved for attach column",
|
"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;
|
return;
|
||||||
} else {
|
} else {
|
||||||
for(ColumnData refColumn:refColumns){
|
for (ColumnData refColumn : refColumns) {
|
||||||
if(refColumn.getLabel().compareTo(labelOfAttachColumn)==0){
|
if (refColumn.getLabel().compareTo(labelOfAttachColumn) == 0) {
|
||||||
if(ColumnTypeMap.getColumnTypeCode(refColumn.getTypeCode()).compareTo(typeCodeOfColumnAttach)==0){
|
if (ColumnTypeMap
|
||||||
codelistColumnReference=refColumn;
|
.getColumnTypeCode(refColumn.getTypeCode())
|
||||||
|
.compareTo(typeCodeOfColumnAttach) == 0) {
|
||||||
|
codelistColumnReference = refColumn;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(codelistColumnReference!=null){
|
if (codelistColumnReference != null) {
|
||||||
ColumnTypeCode columnTypeCodeTarget = ColumnTypeMap.getColumnTypeCode(codelistColumnReference.getTypeCode());
|
ColumnTypeCode columnTypeCodeTarget = ColumnTypeCode.DIMENSION;
|
||||||
ColumnDataType columnDataTypeTarget = ColumnTypeMap.getColumnDataType(codelistColumnReference.getDataTypeName());
|
|
||||||
|
ChangeColumnTypeSession changeColumnTypeSession = new ChangeColumnTypeSession(
|
||||||
ChangeColumnTypeSession changeColumnTypeSession=new
|
orig, origColumnTypeCode, origColumnDataType,
|
||||||
ChangeColumnTypeSession(orig, origColumnTypeCode, origColumnDataType, columnTypeCodeTarget, columnDataTypeTarget, codelistColumnReference);
|
columnTypeCodeTarget, null, codelistColumnReference);
|
||||||
callChangeColumnType(changeColumnTypeSession);
|
callChangeColumnType(changeColumnTypeSession);
|
||||||
} else {
|
} else {
|
||||||
showErrorAndHide(
|
showErrorAndHide("Error in extract codelist",
|
||||||
"Error in extract codelist",
|
|
||||||
"An error occured no attach column match",
|
"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(
|
private void callChangeColumnType(
|
||||||
ChangeColumnTypeSession changeColumnTypeSession) {
|
ChangeColumnTypeSession changeColumnTypeSession) {
|
||||||
TDGWTServiceAsync.INSTANCE.startChangeColumnType(
|
TDGWTServiceAsync.INSTANCE.startChangeColumnType(
|
||||||
changeColumnTypeSession, new AsyncCallback<String>() {
|
changeColumnTypeSession, new AsyncCallback<String>() {
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
if (caught instanceof TDGWTSessionExpiredException) {
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
getEventBus().fireEvent(new SessionExpiredEvent(
|
getEventBus()
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
.fireEvent(
|
||||||
|
new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
showErrorAndHide(
|
showErrorAndHide(
|
||||||
"Error in extract codelist",
|
"Error in extract codelist",
|
||||||
|
@ -238,7 +249,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSuccess(String taskId) {
|
public void onSuccess(String taskId) {
|
||||||
automaticallyAttached=true;
|
automaticallyAttached = true;
|
||||||
openMonitorDialog(taskId);
|
openMonitorDialog(taskId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue