Added Resume UI state

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@100397 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-10-02 17:07:33 +00:00
parent 6ac6504e5e
commit 30fa7774fb
4 changed files with 165 additions and 114 deletions

View File

@ -528,3 +528,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...
10% complete (ETR: 34 seconds)
10% complete (ETR: 34 seconds)
20% complete (ETR: 24 seconds)
30% complete (ETR: 18 seconds)
40% complete (ETR: 13 seconds)
50% complete (ETR: 10 seconds)
60% complete (ETR: 7 seconds)
70% complete (ETR: 5 seconds)
80% complete (ETR: 3 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 31.57 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

@ -13,6 +13,12 @@
<dependent-module archiveName="tabular-data-json-export-widget-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-json-export-widget/tabular-data-json-export-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="tabular-data-information-widget-2.4.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-information-widget/tabular-data-information-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="tabular-data-metadata-widget-1.4.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-metadata-widget/tabular-data-metadata-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/tabular-data-portlet/target/tabular-data-portlet-2.4.0-SNAPSHOT/WEB-INF/classes"/>
<property name="context-root" value="tabular-data-manager"/>
</wb-module>

View File

@ -185,8 +185,6 @@ public class TabularDataController {
}
// Bind Controller to events on bus
protected void bindToEvents() {
eventBus.addHandler(SessionExpiredEvent.TYPE,
@ -263,7 +261,6 @@ public class TabularDataController {
Log.debug("Catch Event WidgetRequestEvent");
doWidgetRequestCommand(event);
}
});
@ -276,7 +273,6 @@ public class TabularDataController {
Log.debug("Catch Event BackgroundRequestEvent");
doBackgroundRequestCommand(event);
}
});
@ -285,10 +281,32 @@ public class TabularDataController {
}
protected void putInBackgroundUIState(){
//
public void restoreUISession() {
TDGWTServiceAsync.INSTANCE
.getCurrentTRId(new AsyncCallback<TRId>() {
public void onFailure(Throwable caught) {
}
public void onSuccess(TRId trId) {
if(trId!=null){
if(trId.getId()!=null && !trId.getId().isEmpty()){
openTable(trId);
}
}
}
});
}
//
protected void putInBackgroundUIState() {
try {
closeTabularResource();
//TODO Open monitor background and change TR
openBackgroundMonitor();
openTabularResource(true);
@ -297,7 +315,6 @@ public class TabularDataController {
}
}
// Resume state of user interface
protected void resumeUIState() {
try {
@ -401,6 +418,7 @@ public class TabularDataController {
} catch (Exception e) {
Log.debug("Bus Error: " + e.getMessage());
}
closeTabularResourceOnServer();
break;
case TR_CLOSE:
break;
@ -411,6 +429,23 @@ public class TabularDataController {
}
protected void closeTabularResourceOnServer() {
TDGWTServiceAsync.INSTANCE
.closeTabularResource(new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
UtilsGXT3.alert("Error closing tabular resource",
caught.getLocalizedMessage());
}
public void onSuccess(Void result) {
}
});
}
protected void deleteTabularResource() {
final ConfirmMessageBox mb = new ConfirmMessageBox("Confirm",
@ -643,16 +678,17 @@ public class TabularDataController {
break;
}
}
//TODO
protected void doWidgetRequestCommand(WidgetRequestEvent event){
WidgetRequestType widgetRequestType=event.getWidgetRequestType();
switch(widgetRequestType){
// TODO
protected void doWidgetRequestCommand(WidgetRequestEvent event) {
WidgetRequestType widgetRequestType = event.getWidgetRequestType();
switch (widgetRequestType) {
case CHANGECOLUMNTYPEPANEL:
break;
case CHANGETABLETYPEPANEL:
break;
case CURATIONBYREPLACEBATCHDIALOG:
openBatchReplace(event.getTrId(),event.getRequestProperties());
openBatchReplace(event.getTrId(), event.getRequestProperties());
break;
case DELETECOLUMNPANEL:
break;
@ -667,10 +703,9 @@ public class TabularDataController {
}
}
//TODO
// TODO
public void doBackgroundRequestCommand(BackgroundRequestEvent event) {
BackgroundRequestType type = event.getBackgroundRequestType();
Log.trace("doBackgroundRequestEvent BackgroundRequestType: " + type);
@ -683,20 +718,22 @@ public class TabularDataController {
break;
}
} catch (Throwable e) {
Log.error("doBackgroundRequestCommand Error : " + e.getLocalizedMessage());
Log.error("doBackgroundRequestCommand Error : "
+ e.getLocalizedMessage());
e.printStackTrace();
}
}
protected void openLogsWindow(){
protected void openLogsWindow() {
Log.debug("Request Open Logs Window");
TDMLogs tdmLogs=new TDMLogs(eventBus);
TDMLogs tdmLogs = new TDMLogs(eventBus);
tdmLogs.show();
}
protected void openBatchReplace(TRId trId, RequestProperties requestProperties){
Log.debug("Request Open Batch Replace Dialog: "+trId+" "+requestProperties);
protected void openBatchReplace(TRId trId,
RequestProperties requestProperties) {
Log.debug("Request Open Batch Replace Dialog: " + trId + " "
+ requestProperties);
if (trId != null) {
ReplaceBatchDialog dialog = new ReplaceBatchDialog(trId,
requestProperties, eventBus);
@ -707,7 +744,6 @@ public class TabularDataController {
}
}
protected void openSDMXImportWizard() {
GWT.runAsync(new RunAsyncCallback() {
@ -739,7 +775,6 @@ public class TabularDataController {
resumeUIState();
}
});
importWizard.show();
@ -842,11 +877,6 @@ public class TabularDataController {
}
protected void openSDMXExportWizard() {
GWT.runAsync(new RunAsyncCallback() {
@ -893,12 +923,12 @@ public class TabularDataController {
public void onSuccess() {
openWizard();
ExtractCodelistWizardTD extractCodelistWizard = new ExtractCodelistWizardTD(
trId,"Extract Codelist", eventBus);
trId, "Extract Codelist", eventBus);
extractCodelistWizard.addListener(new WizardListener() {
public void failed(String title, String message,
Throwable throwable) {
UtilsGXT3.alert(title,message);
UtilsGXT3.alert(title, message);
resumeUIState();
}
@ -927,15 +957,13 @@ public class TabularDataController {
}
protected void openCodelistMappingWizard() {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
openWizard();
CodelistMappingImportWizardTD codelistMappingWizard = new CodelistMappingImportWizardTD(
trId,"Codelist Mapping Import", eventBus);
trId, "Codelist Mapping Import", eventBus);
codelistMappingWizard.addListener(new WizardListener() {
public void failed(String title, String message,
@ -974,8 +1002,8 @@ public class TabularDataController {
public void onSuccess() {
openWizard();
UnionWizardTD unionWizard = new UnionWizardTD(
trId,"Union", eventBus);
UnionWizardTD unionWizard = new UnionWizardTD(trId, "Union",
eventBus);
unionWizard.addListener(new WizardListener() {
public void failed(String title, String message,
@ -994,7 +1022,6 @@ public class TabularDataController {
Log.debug("PutInBakground");
}
public void aborted() {
resumeUIState();
}
@ -1010,7 +1037,6 @@ public class TabularDataController {
}
/**
* @param switchState
*
@ -1023,16 +1049,14 @@ public class TabularDataController {
public void onSuccess() {
openWizard();
String title;
if(switchState){
title="Switches Tabular Resource";
if (switchState) {
title = "Switches Tabular Resource";
} else {
title="Open Tabular Resource";
title = "Open Tabular Resource";
}
TDOpen tdOpen=new TDOpen(trId,title, eventBus);
TDOpen tdOpen = new TDOpen(trId, title, eventBus);
tdOpen.addListener(new WizardListener() {
@Override
public void putInBackground() {
Log.debug("PutInBakground");
@ -1153,8 +1177,6 @@ public class TabularDataController {
TRShare trShare = new TRShare(trId, eventBus);
}
protected void callDiscard() {
HistoryDiscard historyDiscard = new HistoryDiscard(eventBus);
historyDiscard.discard();
@ -1200,8 +1222,8 @@ public class TabularDataController {
protected void openReplaceColumnByExpression(String columnName) {
Log.debug("Request Open Replace Column By Expression Dialog");
if (trId != null) {
ReplaceColumnByExpressionDialog rceDialog = new ReplaceColumnByExpressionDialog(trId,
columnName, eventBus);
ReplaceColumnByExpressionDialog rceDialog = new ReplaceColumnByExpressionDialog(
trId, columnName, eventBus);
rceDialog.show();
} else {
Log.error("TRId is null");
@ -1209,7 +1231,6 @@ public class TabularDataController {
}
}
protected void openColumnType() {
openColumnType(null);
}
@ -1264,7 +1285,6 @@ public class TabularDataController {
}
}
protected void cloneTabularResource() {
CloneTabularResource cloneTR = new CloneTabularResource(trId, eventBus);
cloneTR.cloneTR();
@ -1303,7 +1323,6 @@ public class TabularDataController {
}
}
protected void openColumnDelete() {
openColumnDelete(null);
}
@ -1340,7 +1359,6 @@ public class TabularDataController {
}
}
protected void openColumnMerge() {
openColumnMerge(null);
}
@ -1359,9 +1377,6 @@ public class TabularDataController {
}
}
protected void openGroupBy() {
openGroupBy(null);
}
@ -1427,12 +1442,11 @@ public class TabularDataController {
protected void openBackgroundMonitor() {
Log.debug("Request Open Monitor Background Tab");
WidgetRequestEvent e = new WidgetRequestEvent(
WidgetRequestType.MONITORBACKGROUNDPANEL);
WidgetRequestType.MONITORBACKGROUNDPANEL);
eventBus.fireEvent(e);
}
protected void doChangeTableRequestEventCommand(
ChangeTableRequestEvent event) {
Log.debug("Change Table Request: " + event);
@ -1593,7 +1607,7 @@ public class TabularDataController {
} else {
if (opId.compareTo(GridHeaderOperationId.COLUMNREPLACEBYEXPRESSION
.toString()) == 0) {
//TODO
// TODO
openReplaceColumnByExpression(columnName);
} else {
@ -1624,5 +1638,4 @@ public class TabularDataController {
}
}

View File

@ -154,7 +154,7 @@ public class TabularDataPortlet implements EntryPoint {
bind(mainPanelLayout);
// menu(gridPanel);
controller.restoreUISession();
}
protected void bind(BorderLayoutContainer mainWidget) {