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

View File

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

View File

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