Added Static Filter

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@98693 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-07-16 14:50:55 +00:00
parent 56c0ced40e
commit 4fed851023
4 changed files with 187 additions and 70 deletions

View File

@ -5274,3 +5274,35 @@ Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
30% complete (ETR: 8 seconds)
30% complete (ETR: 8 seconds)
30% complete (ETR: 8 seconds)
30% complete (ETR: 8 seconds)
40% complete (ETR: 8 seconds)
50% complete (ETR: 6 seconds)
60% complete (ETR: 4 seconds)
70% complete (ETR: 3 seconds)
80% complete (ETR: 2 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 12.18 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes

View File

@ -102,8 +102,8 @@ public class ReplaceBatchPanel extends FramedPanel implements
protected RefColumn refColumn;
protected String columnId;
protected ConditionCode conditionCode; //For Curation
protected String validationColumnColumnId; //For Curation
protected ConditionCode conditionCode; // For Curation
protected String validationColumnColumnId; // For Curation
protected RequestProperties requestProperties;
protected boolean curation;
protected ColumnData column;
@ -133,7 +133,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
protected Grid<ReplaceEntry> grid;
protected ListStore<ReplaceEntry> store;
protected HTML info;
private boolean simpleReplace;
public ReplaceBatchPanel(ReplaceBatchDialog parent, TRId trId,
@ -143,19 +143,19 @@ public class ReplaceBatchPanel extends FramedPanel implements
this.trId = trId;
this.requestProperties = requestProperties;
this.eventBus = eventBus;
InvocationS invocationS=(InvocationS) requestProperties.getMap().get(
InvocationS invocationS = (InvocationS) requestProperties.getMap().get(
Constants.REQUEST_PROPERTIES_INVOCATIONS);
columnId = invocationS.getColumnId();
refColumn = invocationS.getRefColumn();
conditionCode = (ConditionCode) requestProperties.getMap().get(
Constants.REQUEST_PROPERTIES_CONDITIONCODE);
validationColumnColumnId = (String) requestProperties.getMap().get(
Constants.REQUEST_PROPERTIES_VALIDATIONCOLUMNCOLUMNID);
connection = null;
hasValidationColumns = false;
Log.debug("Create BatchReplacePanel(): [" + trId.toString()
@ -172,9 +172,9 @@ public class ReplaceBatchPanel extends FramedPanel implements
this.trId = trId;
this.columnName = columnName;
this.eventBus = eventBus;
this.conditionCode=null;
this.validationColumnColumnId=null;
this.conditionCode = null;
this.validationColumnColumnId = null;
connection = null;
hasValidationColumns = false;
Log.debug("Create BatchReplacePanel(): [" + trId.toString()
@ -576,9 +576,10 @@ public class ReplaceBatchPanel extends FramedPanel implements
protected void loadData(ListLoadConfig loadConfig,
final AsyncCallback<ListLoadResult<ReplaceEntry>> callback) {
OccurrencesForReplaceBatchColumnSession occurrencesSession = new OccurrencesForReplaceBatchColumnSession(
column, showOccurencesType, hasValidationColumns, conditionCode, validationColumnColumnId);
column, showOccurencesType, hasValidationColumns,
conditionCode, validationColumnColumnId);
TDGWTServiceAsync.INSTANCE.getOccurrencesForBatchReplace(
occurrencesSession,
@ -652,7 +653,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
return records;
}
//
protected ReplaceEntry getRecord(Occurrences entry) {
ReplaceEntry data = null;
@ -661,8 +662,8 @@ public class ReplaceBatchPanel extends FramedPanel implements
data = new ReplaceEntry(entry.getValue(), entry.getRowId(),
entry.getNumber(), null, null);
} else {
data = new ReplaceEntry(entry.getValue(), entry.getNumber(), null,
null);
data = new ReplaceEntry(entry.getValue(), entry.getNumber(),
null, null);
}
} else {
switch (conditionCode) {
@ -691,8 +692,8 @@ public class ReplaceBatchPanel extends FramedPanel implements
data = new ReplaceEntry(entry.getValue(), entry.getRowId(),
entry.getNumber(), null, null);
} else {
data = new ReplaceEntry(entry.getValue(), entry.getNumber(), null,
null);
data = new ReplaceEntry(entry.getValue(),
entry.getNumber(), null, null);
}
break;
case MustContainAtLeastOneDimension:
@ -712,14 +713,14 @@ public class ReplaceBatchPanel extends FramedPanel implements
data = new ReplaceEntry(entry.getValue(), entry.getRowId(),
entry.getNumber(), null, null);
} else {
data = new ReplaceEntry(entry.getValue(), entry.getNumber(), null,
null);
data = new ReplaceEntry(entry.getValue(),
entry.getNumber(), null, null);
}
break;
}
}
return data;
}
@ -738,10 +739,10 @@ public class ReplaceBatchPanel extends FramedPanel implements
}
} else {
Log.debug("In curation from validation");
if(connection!=null){
if (connection != null) {
callDimensionRowSelectionDialog();
} else {
}
}
}
@ -767,7 +768,8 @@ public class ReplaceBatchPanel extends FramedPanel implements
protected void startReplaceBatch(
ArrayList<ReplaceEntry> effectiveReplaceList) {
ReplaceBatchColumnSession replaceBatchColumnSession = new ReplaceBatchColumnSession(
trId, column, effectiveReplaceList, column.isViewColumn(),connection);
trId, column, effectiveReplaceList, column.isViewColumn(),
connection);
parent.startBatchReplace(replaceBatchColumnSession);
}
@ -800,32 +802,87 @@ public class ReplaceBatchPanel extends FramedPanel implements
protected void callDimensionRowSelectionDialog() {
simpleReplace = false;
Log.debug("callDimensionRowSelectionDialog");
CellData cellData=null;
ColumnData col=null;
boolean workOnTable=false;
if(curation){
if(connection!=null){
CellData cellData = null;
ColumnData col = null;
boolean workOnTable = false;
if (curation) {
if (connection != null) {
cellData = new CellData(currentReplaceEntry.getValue(),
connection.getName(), connection.getColumnId(), connection.getLabel(),
currentReplaceEntry.getRowId(), 0, 0);
col=connection;
workOnTable=true;
connection.getName(), connection.getColumnId(),
connection.getLabel(), currentReplaceEntry.getRowId(),
0, 0);
col = connection;
workOnTable = true;
} else {
Log.error("No connection retrieved");
}
Log.debug("Col: " + col + ", CellData:" + cellData);
DimensionRowSelectionDialog dialogDimensionRowSelection;
switch (conditionCode){
case AllowedColumnType:
break;
case AmbiguousValueOnExternalReference:
dialogDimensionRowSelection = new DimensionRowSelectionDialog(
col, cellData, workOnTable, true, true, true, false, eventBus);
dialogDimensionRowSelection.addListener(this);
dialogDimensionRowSelection.show();
break;
case CastValidation:
break;
case CodeNamePresence:
break;
case DuplicateTupleValidation:
break;
case DuplicateValueInColumn:
break;
case GenericTupleValidity:
break;
case GenericValidity:
break;
case MaxOneCodenameForDataLocale:
break;
case MissingValueOnExternalReference:
dialogDimensionRowSelection = new DimensionRowSelectionDialog(
col, cellData, workOnTable, eventBus);
dialogDimensionRowSelection.addListener(this);
dialogDimensionRowSelection.show();
break;
case MustContainAtLeastOneDimension:
break;
case MustContainAtLeastOneMeasure:
break;
case MustHaveDataLocaleMetadataAndAtLeastOneLabel:
break;
case OnlyOneCodeColumn:
break;
case OnlyOneCodenameColumn:
break;
case ValidPeriodFormat:
break;
default:
dialogDimensionRowSelection = new DimensionRowSelectionDialog(
col, cellData, workOnTable, eventBus);
dialogDimensionRowSelection.addListener(this);
dialogDimensionRowSelection.show();
break;
}
} else {
cellData = new CellData(currentReplaceEntry.getValue(),
column.getName(), column.getColumnId(), column.getLabel(),
currentReplaceEntry.getRowId(), 0, 0);
col=column;
workOnTable=false;
}
Log.debug("Col: "+col+", CellData:"+cellData);
DimensionRowSelectionDialog dialogDimensionRowSelection = new DimensionRowSelectionDialog(
col, cellData, workOnTable,eventBus);
dialogDimensionRowSelection.addListener(this);
dialogDimensionRowSelection.show();
column.getName(), column.getColumnId(), column.getLabel(),
currentReplaceEntry.getRowId(), 0, 0);
col = column;
workOnTable = false;
Log.debug("Col: " + col + ", CellData:" + cellData);
DimensionRowSelectionDialog dialogDimensionRowSelection = new DimensionRowSelectionDialog(
col, cellData, workOnTable, eventBus);
dialogDimensionRowSelection.addListener(this);
dialogDimensionRowSelection.show();
}
}
@Override

View File

@ -11,6 +11,7 @@ import org.gcube.portlets.user.tdwx.client.TabularDataX;
import org.gcube.portlets.user.tdwx.client.TabularDataXGridPanel;
import org.gcube.portlets.user.tdwx.client.event.FailureEvent;
import org.gcube.portlets.user.tdwx.client.event.FailureEventHandler;
import org.gcube.portlets.user.tdwx.shared.StaticFilterInformation;
import org.gcube.portlets.user.tdwx.shared.model.TableId;
import com.allen_sauer.gwt.log.client.Log;
@ -43,6 +44,8 @@ public class DimensionRowSelectionDialog extends Window {
protected boolean workOnTable;
protected boolean showValue;
protected boolean errorNotColored;
protected boolean staticFilterBool;
protected boolean visibleOnlyColumn;
protected ArrayList<DimensionRowSelectionListener> listeners;
@ -55,7 +58,9 @@ public class DimensionRowSelectionDialog extends Window {
EventBus eventBus) {
this.workOnTable = false;
this.showValue = true;
this.errorNotColored=false;
this.errorNotColored = false;
this.staticFilterBool = false;
this.visibleOnlyColumn = true;
config(column, cellData, eventBus);
}
@ -63,7 +68,9 @@ public class DimensionRowSelectionDialog extends Window {
boolean workOnTable, EventBus eventBus) {
this.workOnTable = workOnTable;
this.showValue = true;
this.errorNotColored=false;
this.errorNotColored = false;
this.staticFilterBool = false;
this.visibleOnlyColumn = true;
config(column, cellData, eventBus);
}
@ -72,16 +79,22 @@ public class DimensionRowSelectionDialog extends Window {
boolean workOnTable, boolean showValue, EventBus eventBus) {
this.workOnTable = workOnTable;
this.showValue = showValue;
this.errorNotColored=false;
this.errorNotColored = false;
this.staticFilterBool = false;
this.visibleOnlyColumn = true;
config(column, cellData, eventBus);
}
public DimensionRowSelectionDialog(ColumnData column, CellData cellData,
boolean workOnTable, boolean showValue, boolean errorNotColored, EventBus eventBus) {
boolean workOnTable, boolean showValue, boolean errorNotColored,
boolean staticFilterBool, boolean visibleOnlyColumn,
EventBus eventBus) {
this.workOnTable = workOnTable;
this.showValue = showValue;
this.errorNotColored = errorNotColored;
this.staticFilterBool = staticFilterBool;
this.visibleOnlyColumn = visibleOnlyColumn;
config(column, cellData, eventBus);
}
@ -129,28 +142,43 @@ public class DimensionRowSelectionDialog extends Window {
gridPanel.setHeaderVisible(false);
gridPanel.setErrorNotColored(errorNotColored);
gridPanel.setSelectionModel(SelectionMode.SINGLE);
Log.debug("SetVisibleOnlyColumn: " + column);
if (workOnTable) {
Log.debug("Work on Table");
gridPanel.setVisibleOnlyColumn(column.getColumnId());
} else {
if (column.isViewColumn()) {
Log.debug("column Is View Column");
Log.debug("Set Static Filter: " + staticFilterBool);
if (staticFilterBool) {
StaticFilterInformation sfi = new StaticFilterInformation(
cellData.getColumnName(), cellData.getColumnId(),
cellData.getValue());
ArrayList<StaticFilterInformation> sfiList = new ArrayList<StaticFilterInformation>();
sfiList.add(sfi);
gridPanel.setStaticFilters(sfiList);
}
Log.debug("SetVisibleOnlyColumn: " + visibleOnlyColumn + " - " + column);
if (visibleOnlyColumn) {
if (workOnTable) {
Log.debug("Work on Table");
gridPanel.setVisibleOnlyColumn(column.getColumnId());
} else {
Log.debug("column Not Is View Column");
if (column.getRelationship() != null) {
// Used a Dimension Column
gridPanel.setVisibleOnlyColumn(column.getRelationship()
.getTargetColumnId());
if (column.isViewColumn()) {
Log.debug("column Is View Column");
gridPanel.setVisibleOnlyColumn(column.getColumnId());
} else {
UtilsGXT3
.alert("Attention",
"No valid view column associated with this column!");
return;
Log.debug("column Not Is View Column");
if (column.getRelationship() != null) {
// Used a Dimension Column
gridPanel.setVisibleOnlyColumn(column.getRelationship()
.getTargetColumnId());
} else {
UtilsGXT3
.alert("Attention",
"No valid view column associated with this column!");
return;
}
}
}
}
if (showValue) {
v.add(new FieldLabel(value, "Value"), new VerticalLayoutData(1, -1));
}

View File

@ -269,7 +269,7 @@ public class ColumnMappingPanel extends FramedPanel {
selectedColumn.getLabel(), null, 0, 0);
DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog(
selectedColumn, cellData, true, false, true, eventBus);
selectedColumn, cellData, true, false, true, false, true, eventBus);
dimensionRowSelectionDialog
.addListener(sourceValueSelectedListener);
dimensionRowSelectionDialog.show();
@ -330,7 +330,7 @@ public class ColumnMappingPanel extends FramedPanel {
.getLabel(), null, 0, 0);
DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog(
referenceColumn, cellData, true, false, true, eventBus);
referenceColumn, cellData, true, false, true, false, true, eventBus);
dimensionRowSelectionDialog
.addListener(targetValueSelectedListener);
dimensionRowSelectionDialog.show();
@ -440,7 +440,7 @@ public class ColumnMappingPanel extends FramedPanel {
selectedColumn.getLabel(), null, 0, 0);
DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog(
selectedColumn, cellData, true, false, true, eventBus);
selectedColumn, cellData, true, false, true, false, true, eventBus);
dimensionRowSelectionDialog
.addListener(sourceValueSelectedListener);
dimensionRowSelectionDialog.show();
@ -501,7 +501,7 @@ public class ColumnMappingPanel extends FramedPanel {
.getLabel(), null, 0, 0);
DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog(
referenceColumn, cellData, true, false, true, eventBus);
referenceColumn, cellData, true, false, true, false, true, eventBus);
dimensionRowSelectionDialog
.addListener(targetValueSelectedListener);
dimensionRowSelectionDialog.show();