Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@95889 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-05-21 10:48:16 +00:00
parent e9d0c40fff
commit 373b2ef012
4 changed files with 166 additions and 58 deletions

View File

@ -3546,3 +3546,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: 9 seconds)
30% complete (ETR: 9 seconds)
30% complete (ETR: 9 seconds)
30% complete (ETR: 9 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 15.23 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

@ -5,7 +5,6 @@ import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.RefColumn;
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceBatchColumnSession;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
@ -45,6 +44,7 @@ public class ReplaceBatchDialog extends Window {
public ReplaceBatchDialog(TRId trId,
RequestProperties requestProperties, EventBus eventBus) {
Log.debug("ReplaceBatchDialog: "+trId+", RequestProperties:"+requestProperties);
this.trId = trId;
this.requestProperties=requestProperties;
this.eventBus = eventBus;

View File

@ -101,7 +101,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
protected RefColumn refColumn;
protected String columnId;
protected RequestProperties requestProperties;
protected boolean curation;
protected ColumnData column;
protected boolean hasValidationColumns;
protected ShowOccurrencesType showOccurencesType;
@ -131,27 +131,31 @@ public class ReplaceBatchPanel extends FramedPanel implements
protected TextButton btnDisconnect;
private boolean simpleReplace;
public ReplaceBatchPanel(ReplaceBatchDialog parent, TRId trId,
RequestProperties requestProperties, EventBus eventBus){
RequestProperties requestProperties, EventBus eventBus) {
this.curation = true;
this.parent = parent;
this.trId = trId;
this.requestProperties=requestProperties;
this.requestProperties = requestProperties;
this.eventBus = eventBus;
columnId=(String)requestProperties.getMap().get(Constants.REQUEST_PROPERTIES_COLUMNID);
refColumn=(RefColumn)requestProperties.getMap().get(Constants.REQUEST_PROPERTIES_REFCOLUMN);
columnId = (String) requestProperties.getMap().get(
Constants.REQUEST_PROPERTIES_COLUMNID);
refColumn = (RefColumn) requestProperties.getMap().get(
Constants.REQUEST_PROPERTIES_REFCOLUMN);
connection = null;
hasValidationColumns = false;
Log.debug("Create BatchReplacePanel(): [" + trId.toString()
+ " , columnName:" + columnName + "]");
+ " , RequestProperties:" + requestProperties + "]");
init();
retrieveConnection();
}
public ReplaceBatchPanel(ReplaceBatchDialog parent, TRId trId,
String columnName, EventBus eventBus) {
this.curation = false;
this.parent = parent;
this.trId = trId;
this.columnName = columnName;
@ -416,10 +420,17 @@ public class ReplaceBatchPanel extends FramedPanel implements
add(v);
if (!column.isViewColumn()) {
Log.debug("Not Is View Column");
connectionField.setVisible(false);
btnDisconnect.setVisible(false);
} else {
if(connection!=null){
Log.debug("Is View Column");
}
if (curation) {
if (connection != null) {
Log.debug("Selected connection: " + connection);
connectionField.setValue(connection.getLabel());
connectionField.setVisible(true);
@ -429,6 +440,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
toolBarHead.forceLayout();
}
}
}
protected void retrieveColumn() {
@ -455,9 +467,11 @@ public class ReplaceBatchPanel extends FramedPanel implements
});
}
protected void retrieveColumnByColumnId() {
TDGWTServiceAsync.INSTANCE.getColumn(columnId,trId,
Log.debug("Retrieve Column by ColumnId: columnId:" + columnId
+ ", trId:" + trId);
TDGWTServiceAsync.INSTANCE.getColumn(columnId, trId,
new AsyncCallback<ColumnData>() {
public void onFailure(Throwable caught) {
@ -475,14 +489,12 @@ public class ReplaceBatchPanel extends FramedPanel implements
public void onSuccess(ColumnData result) {
Log.debug("Column: " + result);
column = result;
columnName=result.getName();
columnName = result.getName();
retriveValidationColumn();
}
});
}
protected void retriveValidationColumn() {
TDGWTServiceAsync.INSTANCE.getValidationColumns(trId, columnName,
@ -643,10 +655,21 @@ public class ReplaceBatchPanel extends FramedPanel implements
currentReplaceEntry = store.get(rowIndex);
Log.debug(currentReplaceEntry.toString() + " was clicked.[rowIndex="
+ currentRowIndex + " ]");
if (column.isViewColumn()) {
callDimensionRowSelectionDialog();
if (!curation) {
Log.debug("Not in curation from validation");
if (column.isViewColumn()) {
callDimensionRowSelectionDialog();
} else {
callSingleValueReplaceDialog();
}
} else {
callSingleValueReplaceDialog();
Log.debug("In curation from validation");
if(connection!=null){
callDimensionRowSelectionDialog();
} else {
}
}
}
@ -704,11 +727,29 @@ public class ReplaceBatchPanel extends FramedPanel implements
protected void callDimensionRowSelectionDialog() {
simpleReplace = false;
Log.debug("callDimensionRowSelectionDialog");
CellData cellData = new CellData(currentReplaceEntry.getValue(),
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;
} else {
Log.error("No connection retrieved");
}
} 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(
column, cellData, eventBus);
col, cellData, workOnTable,eventBus);
dialogDimensionRowSelection.addListener(this);
dialogDimensionRowSelection.show();
@ -806,8 +847,9 @@ public class ReplaceBatchPanel extends FramedPanel implements
btnConnect.enable();
}
protected void retrieveConnection(){
protected void retrieveConnection() {
Log.debug("Retrieve Connection RefColumn:" + refColumn);
TDGWTServiceAsync.INSTANCE.getConnection(refColumn,
new AsyncCallback<ColumnData>() {
@ -830,7 +872,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
}
});
}
}

View File

@ -30,7 +30,7 @@ import com.sencha.gxt.widget.core.client.info.Info;
/**
*
* @author "Giancarlo Panichi"
*
*
*/
public class DimensionRowSelectionDialog extends Window {
protected static final int WIDTH = 550;
@ -40,6 +40,7 @@ public class DimensionRowSelectionDialog extends Window {
protected EventBus eventBus;
protected DimensionRow dimRow;
protected CellData cellData;
protected boolean workOnTable;
protected ArrayList<DimensionRowSelectionListener> listeners;
@ -50,6 +51,21 @@ public class DimensionRowSelectionDialog extends Window {
public DimensionRowSelectionDialog(ColumnData column, CellData cellData,
EventBus eventBus) {
this.workOnTable = false;
config(column, cellData, eventBus);
}
public DimensionRowSelectionDialog(ColumnData column, CellData cellData,
boolean workOnTable, EventBus eventBus) {
this.workOnTable = workOnTable;
config(column, cellData, eventBus);
}
protected void config(ColumnData column, CellData cellData,
EventBus eventBus) {
Log.debug("DimensionRowSelectionDialog: column:" + column + " cellData"
+ cellData);
this.column = column;
this.eventBus = eventBus;
this.cellData = cellData;
@ -58,9 +74,6 @@ public class DimensionRowSelectionDialog extends Window {
create();
open();
}
protected void create() {
final FramedPanel panel = new FramedPanel();
@ -70,7 +83,7 @@ public class DimensionRowSelectionDialog extends Window {
VerticalLayoutContainer v = new VerticalLayoutContainer();
value = new TextField();
if(cellData.getValue()!=null){
if (cellData.getValue() != null) {
value.setValue(cellData.getValue());
}
value.setReadOnly(true);
@ -85,22 +98,30 @@ public class DimensionRowSelectionDialog extends Window {
}
});
gridPanel = tabularData.getGridPanel();
gridPanel.setHeaderVisible(false);
gridPanel.setSelectionModel(SelectionMode.SINGLE);
Log.debug("SetVisibleOnlyColumn");
if(column.isViewColumn()){
Log.debug("SetVisibleOnlyColumn: " + column);
if (workOnTable) {
Log.debug("Work on Table");
gridPanel.setVisibleOnlyColumn(column.getColumnId());
} else {
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;
}
}
}
v.add(new FieldLabel(value, "Value"), new VerticalLayoutData(1, -1));
@ -132,17 +153,25 @@ public class DimensionRowSelectionDialog extends Window {
String rowId = rowsId.get(0);
Log.debug("Row selected: " + rowId);
ArrayList<String> cellValues;
if(column.isViewColumn()){
if (workOnTable) {
cellValues = gridPanel.getCellValue(column.getColumnId());
} else {
if(column.getRelationship()!=null){
//Used a Dimension Column
cellValues = gridPanel.getCellValue(column.getRelationship().getTargetColumnId());
if (column.isViewColumn()) {
cellValues = gridPanel.getCellValue(column.getColumnId());
} else {
UtilsGXT3.alert("Attention", "No valid view column associated with this column!");
return;
if (column.getRelationship() != null) {
// Used a Dimension Column
cellValues = gridPanel.getCellValue(column
.getRelationship().getTargetColumnId());
} else {
UtilsGXT3
.alert("Attention",
"No valid view column associated with this column!");
return;
}
}
}
if (cellValues == null || cellValues.size() == 0) {
Log.debug("No value retrieved");
UtilsGXT3.alert("Attention", "Select a row");
@ -157,26 +186,31 @@ public class DimensionRowSelectionDialog extends Window {
}
protected void open() {
long tableId=0;
if (column.isViewColumn()) {
tableId = column.getColumnViewData().getTargetTableId();
long tableId = 0;
if (workOnTable) {
tableId = Long.valueOf(column.getTrId().getTableId());
} else {
if(column.getRelationship()!=null){
//Used a Dimension Column
tableId = Long.valueOf(column.getRelationship().getTargetTableId());
if (column.isViewColumn()) {
tableId = column.getColumnViewData().getTargetTableId();
} else {
UtilsGXT3.alert("Attention", "No valid table associated with this column!");
return;
if (column.getRelationship() != null) {
// Used a Dimension Column
tableId = Long.valueOf(column.getRelationship()
.getTargetTableId());
} else {
UtilsGXT3.alert("Attention",
"No valid table associated with this column!");
return;
}
}
}
}
TableId tableOpening = new TableId(Constants.TDX_DATASOURCE_FACTORY_ID,
String.valueOf(tableId));
Log.debug("Open Table:"+tableId);
Log.debug("Open Table:" + tableId);
tabularData.openTable(tableOpening);
}
protected void initWindow() {
setWidth(WIDTH);