Revision 50334
Added by Stefania Martziou over 6 years ago
MonitorWidget.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import com.google.gwt.core.client.GWT; |
4 | 4 |
import com.google.gwt.dom.client.Document; |
5 |
import com.google.gwt.user.client.rpc.AsyncCallback; |
|
5 | 6 |
import com.google.gwt.user.client.ui.FlowPanel; |
6 | 7 |
import com.google.gwt.user.client.ui.HTML; |
7 | 8 |
import eu.dnetlib.gwt.client.help.HelpService; |
8 | 9 |
import eu.dnetlib.gwt.client.help.HelpServiceAsync; |
9 | 10 |
import eu.dnetlib.repo.manager.client.AbstractRepositoryManagerWidget; |
10 | 11 |
import eu.dnetlib.repo.manager.client.HelpCallback; |
12 |
import eu.dnetlib.repo.manager.client.RepositoryManager; |
|
11 | 13 |
import eu.dnetlib.repo.manager.client.RepositoryManagerWidget; |
12 | 14 |
import eu.dnetlib.repo.manager.client.services.RepositoryService; |
13 | 15 |
import eu.dnetlib.repo.manager.client.services.RepositoryServiceAsync; |
16 |
import eu.dnetlib.repo.manager.client.widgets.ListOrGridViewOfDatasourcesWidget; |
|
17 |
import eu.dnetlib.repo.manager.client.widgets.OpenAIRECompliantLogoDownloadWidget; |
|
18 |
import eu.dnetlib.repo.manager.shared.DatasourcesCollection; |
|
14 | 19 |
import org.gwtbootstrap3.client.ui.Alert; |
15 | 20 |
import org.gwtbootstrap3.client.ui.constants.AlertType; |
16 | 21 |
|
... | ... | |
61 | 66 |
|
62 | 67 |
helpService.getHelpById(parentToken, new HelpCallback(helpPanel, gridPanel)); |
63 | 68 |
|
64 |
HTML comingSoon = new HTML("Coming soon..."); |
|
65 |
monitorContent.add(comingSoon); |
|
69 |
final HTML loadingWheel = new HTML("<div class=\"loader-big\" style=\"text-align: center; padding-top: 170px; " + |
|
70 |
"color: rgb(47, 64, 80); font-weight: bold;\">Retrieving repositories...</div>" + |
|
71 |
"<div class=\"whiteFilm\"></div>"); |
|
72 |
monitorContent.addStyleName("loading-big"); |
|
73 |
monitorContent.add(loadingWheel); |
|
66 | 74 |
|
67 |
// final HTML loadingWheel = new HTML("<div class=\"loader-big\" style=\"text-align: center; padding-top: 170px; " + |
|
68 |
// "color: rgb(47, 64, 80); font-weight: bold;\">Retrieving repositories...</div>" + |
|
69 |
// "<div class=\"whiteFilm\"></div>"); |
|
70 |
// getImpactContent.addStyleName("loading-big"); |
|
71 |
// getImpactContent.add(loadingWheel); |
|
75 |
repositoryService.getRepositoriesOfUser(RepositoryManager.currentUser.getEmail(), true, false, |
|
76 |
new AsyncCallback<DatasourcesCollection>() { |
|
77 |
|
|
78 |
@Override |
|
79 |
public void onFailure(Throwable caught) { |
|
80 |
|
|
81 |
monitorContent.removeStyleName("loading-big"); |
|
82 |
monitorContent.remove(loadingWheel); |
|
83 |
|
|
84 |
Alert errorAlert = new Alert(); |
|
85 |
errorAlert.setType(AlertType.DANGER); |
|
86 |
errorAlert.setText("System error retrieving repositories."); |
|
87 |
errorAlert.setDismissable(false); |
|
88 |
monitorContent.add(errorAlert); |
|
89 |
} |
|
90 |
|
|
91 |
@Override |
|
92 |
public void onSuccess(DatasourcesCollection datasourcesCollection) { |
|
93 |
|
|
94 |
monitorContent.removeStyleName("loading-big"); |
|
95 |
monitorContent.remove(loadingWheel); |
|
96 |
|
|
97 |
ListOrGridViewOfDatasourcesWidget listOrGridViewOfDatasourcesWidget = |
|
98 |
new ListOrGridViewOfDatasourcesWidget(datasourcesCollection, "Choose the Datasource you would like to manage", |
|
99 |
parentToken, "<i class=\"fa fa-pencil\" aria-hidden=\"true\"></i>", false); |
|
100 |
|
|
101 |
monitorContent.add(listOrGridViewOfDatasourcesWidget.asWidget()); |
|
102 |
} |
|
103 |
}); |
|
72 | 104 |
} |
73 | 105 |
|
74 | 106 |
@Override |
Also available in: Unified diff
First version of the collection monitor page