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 Compilation completed in 0.00 seconds
Removing invalidated units Removing invalidated units
Finding entry point classes 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 RefColumn refColumn;
protected String columnId; protected String columnId;
protected ConditionCode conditionCode; //For Curation protected ConditionCode conditionCode; // For Curation
protected String validationColumnColumnId; //For Curation protected String validationColumnColumnId; // For Curation
protected RequestProperties requestProperties; protected RequestProperties requestProperties;
protected boolean curation; protected boolean curation;
protected ColumnData column; protected ColumnData column;
@ -133,7 +133,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
protected Grid<ReplaceEntry> grid; protected Grid<ReplaceEntry> grid;
protected ListStore<ReplaceEntry> store; protected ListStore<ReplaceEntry> store;
protected HTML info; protected HTML info;
private boolean simpleReplace; private boolean simpleReplace;
public ReplaceBatchPanel(ReplaceBatchDialog parent, TRId trId, public ReplaceBatchPanel(ReplaceBatchDialog parent, TRId trId,
@ -143,19 +143,19 @@ public class ReplaceBatchPanel extends FramedPanel implements
this.trId = trId; this.trId = trId;
this.requestProperties = requestProperties; this.requestProperties = requestProperties;
this.eventBus = eventBus; this.eventBus = eventBus;
InvocationS invocationS=(InvocationS) requestProperties.getMap().get( InvocationS invocationS = (InvocationS) requestProperties.getMap().get(
Constants.REQUEST_PROPERTIES_INVOCATIONS); Constants.REQUEST_PROPERTIES_INVOCATIONS);
columnId = invocationS.getColumnId(); columnId = invocationS.getColumnId();
refColumn = invocationS.getRefColumn(); refColumn = invocationS.getRefColumn();
conditionCode = (ConditionCode) requestProperties.getMap().get( conditionCode = (ConditionCode) requestProperties.getMap().get(
Constants.REQUEST_PROPERTIES_CONDITIONCODE); Constants.REQUEST_PROPERTIES_CONDITIONCODE);
validationColumnColumnId = (String) requestProperties.getMap().get( validationColumnColumnId = (String) requestProperties.getMap().get(
Constants.REQUEST_PROPERTIES_VALIDATIONCOLUMNCOLUMNID); Constants.REQUEST_PROPERTIES_VALIDATIONCOLUMNCOLUMNID);
connection = null; connection = null;
hasValidationColumns = false; hasValidationColumns = false;
Log.debug("Create BatchReplacePanel(): [" + trId.toString() Log.debug("Create BatchReplacePanel(): [" + trId.toString()
@ -172,9 +172,9 @@ public class ReplaceBatchPanel extends FramedPanel implements
this.trId = trId; this.trId = trId;
this.columnName = columnName; this.columnName = columnName;
this.eventBus = eventBus; this.eventBus = eventBus;
this.conditionCode=null; this.conditionCode = null;
this.validationColumnColumnId=null; this.validationColumnColumnId = null;
connection = null; connection = null;
hasValidationColumns = false; hasValidationColumns = false;
Log.debug("Create BatchReplacePanel(): [" + trId.toString() Log.debug("Create BatchReplacePanel(): [" + trId.toString()
@ -576,9 +576,10 @@ public class ReplaceBatchPanel extends FramedPanel implements
protected void loadData(ListLoadConfig loadConfig, protected void loadData(ListLoadConfig loadConfig,
final AsyncCallback<ListLoadResult<ReplaceEntry>> callback) { final AsyncCallback<ListLoadResult<ReplaceEntry>> callback) {
OccurrencesForReplaceBatchColumnSession occurrencesSession = new OccurrencesForReplaceBatchColumnSession( OccurrencesForReplaceBatchColumnSession occurrencesSession = new OccurrencesForReplaceBatchColumnSession(
column, showOccurencesType, hasValidationColumns, conditionCode, validationColumnColumnId); column, showOccurencesType, hasValidationColumns,
conditionCode, validationColumnColumnId);
TDGWTServiceAsync.INSTANCE.getOccurrencesForBatchReplace( TDGWTServiceAsync.INSTANCE.getOccurrencesForBatchReplace(
occurrencesSession, occurrencesSession,
@ -652,7 +653,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
return records; return records;
} }
// //
protected ReplaceEntry getRecord(Occurrences entry) { protected ReplaceEntry getRecord(Occurrences entry) {
ReplaceEntry data = null; ReplaceEntry data = null;
@ -661,8 +662,8 @@ public class ReplaceBatchPanel extends FramedPanel implements
data = new ReplaceEntry(entry.getValue(), entry.getRowId(), data = new ReplaceEntry(entry.getValue(), entry.getRowId(),
entry.getNumber(), null, null); entry.getNumber(), null, null);
} else { } else {
data = new ReplaceEntry(entry.getValue(), entry.getNumber(), null, data = new ReplaceEntry(entry.getValue(), entry.getNumber(),
null); null, null);
} }
} else { } else {
switch (conditionCode) { switch (conditionCode) {
@ -691,8 +692,8 @@ public class ReplaceBatchPanel extends FramedPanel implements
data = new ReplaceEntry(entry.getValue(), entry.getRowId(), data = new ReplaceEntry(entry.getValue(), entry.getRowId(),
entry.getNumber(), null, null); entry.getNumber(), null, null);
} else { } else {
data = new ReplaceEntry(entry.getValue(), entry.getNumber(), null, data = new ReplaceEntry(entry.getValue(),
null); entry.getNumber(), null, null);
} }
break; break;
case MustContainAtLeastOneDimension: case MustContainAtLeastOneDimension:
@ -712,14 +713,14 @@ public class ReplaceBatchPanel extends FramedPanel implements
data = new ReplaceEntry(entry.getValue(), entry.getRowId(), data = new ReplaceEntry(entry.getValue(), entry.getRowId(),
entry.getNumber(), null, null); entry.getNumber(), null, null);
} else { } else {
data = new ReplaceEntry(entry.getValue(), entry.getNumber(), null, data = new ReplaceEntry(entry.getValue(),
null); entry.getNumber(), null, null);
} }
break; break;
} }
} }
return data; return data;
} }
@ -738,10 +739,10 @@ public class ReplaceBatchPanel extends FramedPanel implements
} }
} else { } else {
Log.debug("In curation from validation"); Log.debug("In curation from validation");
if(connection!=null){ if (connection != null) {
callDimensionRowSelectionDialog(); callDimensionRowSelectionDialog();
} else { } else {
} }
} }
} }
@ -767,7 +768,8 @@ public class ReplaceBatchPanel extends FramedPanel implements
protected void startReplaceBatch( protected void startReplaceBatch(
ArrayList<ReplaceEntry> effectiveReplaceList) { ArrayList<ReplaceEntry> effectiveReplaceList) {
ReplaceBatchColumnSession replaceBatchColumnSession = new ReplaceBatchColumnSession( ReplaceBatchColumnSession replaceBatchColumnSession = new ReplaceBatchColumnSession(
trId, column, effectiveReplaceList, column.isViewColumn(),connection); trId, column, effectiveReplaceList, column.isViewColumn(),
connection);
parent.startBatchReplace(replaceBatchColumnSession); parent.startBatchReplace(replaceBatchColumnSession);
} }
@ -800,32 +802,87 @@ public class ReplaceBatchPanel extends FramedPanel implements
protected void callDimensionRowSelectionDialog() { protected void callDimensionRowSelectionDialog() {
simpleReplace = false; simpleReplace = false;
Log.debug("callDimensionRowSelectionDialog"); Log.debug("callDimensionRowSelectionDialog");
CellData cellData=null; CellData cellData = null;
ColumnData col=null; ColumnData col = null;
boolean workOnTable=false; boolean workOnTable = false;
if(curation){ if (curation) {
if(connection!=null){ if (connection != null) {
cellData = new CellData(currentReplaceEntry.getValue(), cellData = new CellData(currentReplaceEntry.getValue(),
connection.getName(), connection.getColumnId(), connection.getLabel(), connection.getName(), connection.getColumnId(),
currentReplaceEntry.getRowId(), 0, 0); connection.getLabel(), currentReplaceEntry.getRowId(),
col=connection; 0, 0);
workOnTable=true; col = connection;
workOnTable = true;
} else { } else {
Log.error("No connection retrieved"); 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 { } else {
cellData = new CellData(currentReplaceEntry.getValue(), cellData = new CellData(currentReplaceEntry.getValue(),
column.getName(), column.getColumnId(), column.getLabel(), column.getName(), column.getColumnId(), column.getLabel(),
currentReplaceEntry.getRowId(), 0, 0); currentReplaceEntry.getRowId(), 0, 0);
col=column; col = column;
workOnTable=false; workOnTable = false;
}
Log.debug("Col: "+col+", CellData:"+cellData);
DimensionRowSelectionDialog dialogDimensionRowSelection = new DimensionRowSelectionDialog(
col, cellData, workOnTable,eventBus);
dialogDimensionRowSelection.addListener(this);
dialogDimensionRowSelection.show();
Log.debug("Col: " + col + ", CellData:" + cellData);
DimensionRowSelectionDialog dialogDimensionRowSelection = new DimensionRowSelectionDialog(
col, cellData, workOnTable, eventBus);
dialogDimensionRowSelection.addListener(this);
dialogDimensionRowSelection.show();
}
} }
@Override @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.TabularDataXGridPanel;
import org.gcube.portlets.user.tdwx.client.event.FailureEvent; import org.gcube.portlets.user.tdwx.client.event.FailureEvent;
import org.gcube.portlets.user.tdwx.client.event.FailureEventHandler; 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 org.gcube.portlets.user.tdwx.shared.model.TableId;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
@ -43,6 +44,8 @@ public class DimensionRowSelectionDialog extends Window {
protected boolean workOnTable; protected boolean workOnTable;
protected boolean showValue; protected boolean showValue;
protected boolean errorNotColored; protected boolean errorNotColored;
protected boolean staticFilterBool;
protected boolean visibleOnlyColumn;
protected ArrayList<DimensionRowSelectionListener> listeners; protected ArrayList<DimensionRowSelectionListener> listeners;
@ -55,7 +58,9 @@ public class DimensionRowSelectionDialog extends Window {
EventBus eventBus) { EventBus eventBus) {
this.workOnTable = false; this.workOnTable = false;
this.showValue = true; this.showValue = true;
this.errorNotColored=false; this.errorNotColored = false;
this.staticFilterBool = false;
this.visibleOnlyColumn = true;
config(column, cellData, eventBus); config(column, cellData, eventBus);
} }
@ -63,7 +68,9 @@ public class DimensionRowSelectionDialog extends Window {
boolean workOnTable, EventBus eventBus) { boolean workOnTable, EventBus eventBus) {
this.workOnTable = workOnTable; this.workOnTable = workOnTable;
this.showValue = true; this.showValue = true;
this.errorNotColored=false; this.errorNotColored = false;
this.staticFilterBool = false;
this.visibleOnlyColumn = true;
config(column, cellData, eventBus); config(column, cellData, eventBus);
} }
@ -72,16 +79,22 @@ public class DimensionRowSelectionDialog extends Window {
boolean workOnTable, boolean showValue, EventBus eventBus) { boolean workOnTable, boolean showValue, EventBus eventBus) {
this.workOnTable = workOnTable; this.workOnTable = workOnTable;
this.showValue = showValue; this.showValue = showValue;
this.errorNotColored=false; this.errorNotColored = false;
this.staticFilterBool = false;
this.visibleOnlyColumn = true;
config(column, cellData, eventBus); config(column, cellData, eventBus);
} }
public DimensionRowSelectionDialog(ColumnData column, CellData cellData, 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.workOnTable = workOnTable;
this.showValue = showValue; this.showValue = showValue;
this.errorNotColored = errorNotColored; this.errorNotColored = errorNotColored;
this.staticFilterBool = staticFilterBool;
this.visibleOnlyColumn = visibleOnlyColumn;
config(column, cellData, eventBus); config(column, cellData, eventBus);
} }
@ -129,28 +142,43 @@ public class DimensionRowSelectionDialog extends Window {
gridPanel.setHeaderVisible(false); gridPanel.setHeaderVisible(false);
gridPanel.setErrorNotColored(errorNotColored); gridPanel.setErrorNotColored(errorNotColored);
gridPanel.setSelectionModel(SelectionMode.SINGLE); gridPanel.setSelectionModel(SelectionMode.SINGLE);
Log.debug("SetVisibleOnlyColumn: " + column);
if (workOnTable) { Log.debug("Set Static Filter: " + staticFilterBool);
Log.debug("Work on Table"); if (staticFilterBool) {
gridPanel.setVisibleOnlyColumn(column.getColumnId()); StaticFilterInformation sfi = new StaticFilterInformation(
} else { cellData.getColumnName(), cellData.getColumnId(),
if (column.isViewColumn()) { cellData.getValue());
Log.debug("column Is View Column"); 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()); gridPanel.setVisibleOnlyColumn(column.getColumnId());
} else { } else {
Log.debug("column Not Is View Column"); if (column.isViewColumn()) {
if (column.getRelationship() != null) { Log.debug("column Is View Column");
// Used a Dimension Column gridPanel.setVisibleOnlyColumn(column.getColumnId());
gridPanel.setVisibleOnlyColumn(column.getRelationship()
.getTargetColumnId());
} else { } else {
UtilsGXT3 Log.debug("column Not Is View Column");
.alert("Attention", if (column.getRelationship() != null) {
"No valid view column associated with this column!"); // Used a Dimension Column
return; gridPanel.setVisibleOnlyColumn(column.getRelationship()
.getTargetColumnId());
} else {
UtilsGXT3
.alert("Attention",
"No valid view column associated with this column!");
return;
}
} }
} }
} }
if (showValue) { if (showValue) {
v.add(new FieldLabel(value, "Value"), new VerticalLayoutData(1, -1)); 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); selectedColumn.getLabel(), null, 0, 0);
DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog( DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog(
selectedColumn, cellData, true, false, true, eventBus); selectedColumn, cellData, true, false, true, false, true, eventBus);
dimensionRowSelectionDialog dimensionRowSelectionDialog
.addListener(sourceValueSelectedListener); .addListener(sourceValueSelectedListener);
dimensionRowSelectionDialog.show(); dimensionRowSelectionDialog.show();
@ -330,7 +330,7 @@ public class ColumnMappingPanel extends FramedPanel {
.getLabel(), null, 0, 0); .getLabel(), null, 0, 0);
DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog( DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog(
referenceColumn, cellData, true, false, true, eventBus); referenceColumn, cellData, true, false, true, false, true, eventBus);
dimensionRowSelectionDialog dimensionRowSelectionDialog
.addListener(targetValueSelectedListener); .addListener(targetValueSelectedListener);
dimensionRowSelectionDialog.show(); dimensionRowSelectionDialog.show();
@ -440,7 +440,7 @@ public class ColumnMappingPanel extends FramedPanel {
selectedColumn.getLabel(), null, 0, 0); selectedColumn.getLabel(), null, 0, 0);
DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog( DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog(
selectedColumn, cellData, true, false, true, eventBus); selectedColumn, cellData, true, false, true, false, true, eventBus);
dimensionRowSelectionDialog dimensionRowSelectionDialog
.addListener(sourceValueSelectedListener); .addListener(sourceValueSelectedListener);
dimensionRowSelectionDialog.show(); dimensionRowSelectionDialog.show();
@ -501,7 +501,7 @@ public class ColumnMappingPanel extends FramedPanel {
.getLabel(), null, 0, 0); .getLabel(), null, 0, 0);
DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog( DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog(
referenceColumn, cellData, true, false, true, eventBus); referenceColumn, cellData, true, false, true, false, true, eventBus);
dimensionRowSelectionDialog dimensionRowSelectionDialog
.addListener(targetValueSelectedListener); .addListener(targetValueSelectedListener);
dimensionRowSelectionDialog.show(); dimensionRowSelectionDialog.show();