209: TDM - Show the resources through a ListView widget

Task-Url: https://support.d4science.org/issues/209

Updated UI behaviour

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@115282 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-06-09 17:08:37 +00:00
parent 00861a8f98
commit 5d2ac9ebad
4 changed files with 72 additions and 64 deletions

View File

@ -185,11 +185,10 @@
<version>[2.13.1-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<!-- <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> -->
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>

View File

@ -75,6 +75,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.RequestProperties;
import org.gcube.portlets.user.td.widgetcommonevent.shared.RequestPropertiesParameterType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.DataView;
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.DataViewType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.TabularResourceDataView;
import org.gcube.portlets.user.td.widgetcommonevent.shared.geospatial.GeospatialCoordinatesType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.grid.model.RowRaw;
@ -132,6 +133,8 @@ public class TabularDataController {
*/
private TRId openTRIdAfterServerUpdate;
public TabularDataController() {
eventBus = new SimpleEventBus();
callHello();
@ -439,31 +442,31 @@ public class TabularDataController {
eventBus.fireEvent(new UIStateEvent(UIStateType.START));
break;
case TABLECURATION:
uiStateEvent = new UIStateEvent(UIStateType.TABLECURATION);
uiStateEvent.setTrId(trId);
uiStateEvent = new UIStateEvent(UIStateType.TABLECURATION,
trId, DataViewType.GRID);
Log.debug("ResumeUIState Fire: " + uiStateEvent);
eventBus.fireEvent(uiStateEvent);
break;
case TABLEUPDATE:
uiStateEvent = new UIStateEvent(UIStateType.TABLEUPDATE);
uiStateEvent.setTrId(trId);
uiStateEvent = new UIStateEvent(UIStateType.TABLEUPDATE, trId,
DataViewType.GRID);
Log.debug("ResumeUIState Fire: " + uiStateEvent);
eventBus.fireEvent(uiStateEvent);
break;
case TR_CLOSE:
uiStateEvent = new UIStateEvent(UIStateType.TR_CLOSE);
uiStateEvent.setTrId(trId);
uiStateEvent = new UIStateEvent(UIStateType.TR_CLOSE, trId,
DataViewType.GRID);
eventBus.fireEvent(uiStateEvent);
break;
case TR_OPEN:
uiStateEvent = new UIStateEvent(UIStateType.TR_OPEN);
uiStateEvent.setTrId(trId);
uiStateEvent = new UIStateEvent(UIStateType.TR_OPEN, trId,
DataViewType.GRID);
Log.debug("ResumeUIState Fire: " + uiStateEvent);
eventBus.fireEvent(uiStateEvent);
break;
case TR_READONLY:
uiStateEvent = new UIStateEvent(UIStateType.TR_READONLY);
uiStateEvent.setTrId(trId);
uiStateEvent = new UIStateEvent(UIStateType.TR_READONLY, trId,
DataViewType.GRID);
eventBus.fireEvent(uiStateEvent);
break;
case WIZARD_OPEN:
@ -482,12 +485,9 @@ public class TabularDataController {
private void openTable(TRId tabularResourceId) {
Log.debug("openTable: " + tabularResourceId);
trId = tabularResourceId;
// tableOpening = new TableId(Constants.TDX_DATASOURCE_FACTORY_ID,
// trId.getTableId());
// tabularData.openTable(tableOpening);
uiState = UIStateType.TR_OPEN;
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TR_OPEN);
uiStateEvent.setTrId(tabularResourceId);
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TR_OPEN,
tabularResourceId, DataViewType.GRID);
eventBus.fireEvent(uiStateEvent);
}
@ -495,12 +495,9 @@ public class TabularDataController {
private void updateTable(TRId tabularResourceId) {
Log.debug("updateTable: " + tabularResourceId);
trId = tabularResourceId;
// tableOpening = new TableId(Constants.TDX_DATASOURCE_FACTORY_ID,
// trId.getTableId());
// tabularData.openTable(tableOpening);
uiState = UIStateType.TABLEUPDATE;
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TABLEUPDATE);
uiStateEvent.setTrId(tabularResourceId);
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TABLEUPDATE,
tabularResourceId, DataViewType.GRID);
Log.debug("UpdateTable Fire: " + uiStateEvent);
eventBus.fireEvent(uiStateEvent);
}
@ -509,12 +506,9 @@ public class TabularDataController {
private void updateTableForCuration(TRId tabularResourceId) {
Log.debug("updateTableForCuration: " + tabularResourceId);
trId = tabularResourceId;
// tableOpening = new TableId(Constants.TDX_DATASOURCE_FACTORY_ID,
// trId.getTableId());
// tabularData.openTable(tableOpening);
uiState = UIStateType.TABLECURATION;
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TABLECURATION);
uiStateEvent.setTrId(tabularResourceId);
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TABLECURATION,
tabularResourceId, DataViewType.GRID);
Log.debug("UpdateTableForCuration Fire: " + uiStateEvent);
eventBus.fireEvent(uiStateEvent);
}
@ -530,15 +524,13 @@ public class TabularDataController {
case TR_READONLY:
case WIZARD_OPEN:
Log.debug("CloseTabularResource");
// tabularData.closeTable();
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TR_CLOSE);
uiStateEvent.setTrId(trId);
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TR_CLOSE,
trId, DataViewType.GRID);
trId = null;
// tableOpening = null;
uiState = UIStateType.TR_CLOSE;
Log.debug("fireEvent TR_CLOSE");
try {
eventBus.fireEvent(new UIStateEvent(UIStateType.TR_CLOSE));
eventBus.fireEvent(uiStateEvent);
} catch (Exception e) {
Log.debug("Bus Error: " + e.getMessage());
}
@ -800,7 +792,6 @@ public class TabularDataController {
case LOGS:
openLogsWindow();
break;
case DUPLICATE_DETECTION:
openDuplicatesRowsDetection();
break;
@ -1435,7 +1426,11 @@ public class TabularDataController {
}
public void completed(TRId id) {
openTable(id);
trId=id;
uiState = UIStateType.TR_OPEN;
UIStateEvent uiStateEvent = new UIStateEvent(
UIStateType.TR_OPEN, trId, DataViewType.RESOURCES);
eventBus.fireEvent(uiStateEvent);
}
@ -1475,7 +1470,11 @@ public class TabularDataController {
}
public void completed(TRId id) {
openTable(id);
trId=id;
uiState = UIStateType.TR_OPEN;
UIStateEvent uiStateEvent = new UIStateEvent(
UIStateType.TR_OPEN, trId, DataViewType.RESOURCES);
eventBus.fireEvent(uiStateEvent);
}
@ -1723,10 +1722,6 @@ public class TabularDataController {
});
}
private void openModifyRule() {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
@ -1734,6 +1729,7 @@ public class TabularDataController {
RuleOpenDialog cfDialog = new RuleOpenDialog(eventBus);
cfDialog.show();
}
public void onFailure(Throwable reason) {
asyncCodeLoadingFailed(reason);
}
@ -1748,6 +1744,7 @@ public class TabularDataController {
RuleDeleteDialog cfDialog = new RuleDeleteDialog(eventBus);
cfDialog.show();
}
public void onFailure(Throwable reason) {
asyncCodeLoadingFailed(reason);
}
@ -1759,13 +1756,16 @@ public class TabularDataController {
public void onSuccess() {
Log.debug("Request Open Rules Active on TabularResource Dialog");
if (trId != null) {
RuleActiveDialog raDialog = new RuleActiveDialog(trId, eventBus);
RuleActiveDialog raDialog = new RuleActiveDialog(trId,
eventBus);
raDialog.show();
} else {
Log.error("TRId is null");
UtilsGXT3.alert("Error", "No current tabular resource present");
UtilsGXT3.alert("Error",
"No current tabular resource present");
}
}
public void onFailure(Throwable reason) {
asyncCodeLoadingFailed(reason);
}
@ -1779,6 +1779,7 @@ public class TabularDataController {
RuleShareDialog cfDialog = new RuleShareDialog(eventBus);
cfDialog.show();
}
public void onFailure(Throwable reason) {
asyncCodeLoadingFailed(reason);
}
@ -1793,6 +1794,7 @@ public class TabularDataController {
eventBus);
cfDialog.show();
}
public void onFailure(Throwable reason) {
asyncCodeLoadingFailed(reason);
}
@ -1804,13 +1806,16 @@ public class TabularDataController {
public void onSuccess() {
Log.debug("Request Open On Column Apply Rule Dialog");
if (trId != null) {
RuleApplyDialog raDialog = new RuleApplyDialog(trId, eventBus);
RuleApplyDialog raDialog = new RuleApplyDialog(trId,
eventBus);
raDialog.show();
} else {
Log.error("TRId is null");
UtilsGXT3.alert("Error", "No current tabular resource present");
UtilsGXT3.alert("Error",
"No current tabular resource present");
}
}
public void onFailure(Throwable reason) {
asyncCodeLoadingFailed(reason);
}
@ -1906,34 +1911,37 @@ public class TabularDataController {
}
}
//TODO
// TODO
private void testFeauture() {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
Log.debug("ResourceListView call");
if (trId != null) {
/*
ResourcesListViewDialog resourcesListViewDialog = new ResourcesListViewDialog(eventBus);
resourcesListViewDialog.show();
resourcesListViewDialog.open(trId);*/
TDXTabPanelDialog d=new TDXTabPanelDialog(eventBus);
* ResourcesListViewDialog resourcesListViewDialog = new
* ResourcesListViewDialog(eventBus);
* resourcesListViewDialog.show();
* resourcesListViewDialog.open(trId);
*/
TDXTabPanelDialog d = new TDXTabPanelDialog(eventBus);
d.show();
d.open(trId);
} else {
Log.error("TRId is null");
UtilsGXT3.alert("Error", "No current tabular resource present");
UtilsGXT3.alert("Error",
"No current tabular resource present");
}
}
public void onFailure(Throwable reason) {
asyncCodeLoadingFailed(reason);
}
});
}
private void callDiscard() {
HistoryDiscard historyDiscard = new HistoryDiscard(eventBus);
historyDiscard.discard();

View File

@ -65,7 +65,7 @@ public class FileToolBar {
private TextButton helpButton;
//private TextButton languageButton;
//private TextButton logsButton;
private TextButton testButton;
//private TextButton testButton;
//Language Menu
@ -476,7 +476,8 @@ public class FileToolBar {
helpLayout.setWidget(0, 1, logsButton);
helpLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
*/
/*
testButton = new TextButton("Test",
TabularDataResources.INSTANCE.test32());
testButton.disable();
@ -493,7 +494,7 @@ public class FileToolBar {
helpLayout.setWidget(0, 2, testButton);
helpLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
*/
cleanCells(helpLayout.getElement());
@ -590,7 +591,7 @@ public class FileToolBar {
backgroundButton.enable();
historyButton.disable();
undoButton.disable();
testButton.disable();
//testButton.disable();
break;
case TR_CLOSE:
case TR_READONLY:
@ -610,7 +611,7 @@ public class FileToolBar {
backgroundButton.enable();
historyButton.disable();
undoButton.disable();
testButton.disable();
//testButton.disable();
break;
case TR_OPEN:
case TABLEUPDATE:
@ -636,7 +637,7 @@ public class FileToolBar {
backgroundButton.enable();
historyButton.enable();
undoButton.enable();
testButton.enable();
//testButton.enable();
break;
case WIZARD_OPEN:
openButton.disable();
@ -655,7 +656,7 @@ public class FileToolBar {
backgroundButton.disable();
historyButton.disable();
undoButton.disable();
testButton.disable();
//testButton.disable();
break;
default:
break;

View File

@ -95,19 +95,19 @@
name="locale" values="es" /> <set-property name="locale" value="en, it, es"
/> <set-property-fallback name="locale" value="en" /> -->
<!--
<set-property name="log_ConsoleLogger" value="ENABLED" />
<set-property name="log_DivLogger" value="ENABLED" />
<set-property name="log_GWTLogger" value="ENABLED" />
<set-property name="log_SystemLogger" value="ENABLED" />
<set-property name="log_SystemLogger" value="ENABLED" /> -->
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="ENABLED"
/> -->
<!--
<set-property name="log_ConsoleLogger" value="DISABLED" />
<set-property name="log_DivLogger" value="DISABLED" />
<set-property name="log_GWTLogger" value="DISABLED" />
<set-property name="log_SystemLogger" value="DISABLED" /> -->
<set-property name="log_SystemLogger" value="DISABLED" />
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="DISABLED"
/> -->