Revision 48932
Added by Antonis Lempesis almost 7 years ago
GetImpactWidget.java | ||
---|---|---|
11 | 11 |
import eu.dnetlib.gwt.client.MyFormGroup; |
12 | 12 |
import eu.dnetlib.gwt.client.help.HelpService; |
13 | 13 |
import eu.dnetlib.gwt.client.help.HelpServiceAsync; |
14 |
import eu.dnetlib.repo.manager.client.AbstractRepositoryManagerWidget; |
|
14 | 15 |
import eu.dnetlib.repo.manager.client.HelpCallback; |
15 | 16 |
import eu.dnetlib.repo.manager.client.RepositoryManager; |
16 | 17 |
import eu.dnetlib.repo.manager.client.RepositoryManagerWidget; |
... | ... | |
24 | 25 |
/** |
25 | 26 |
* Created by stefania on 4/4/16. |
26 | 27 |
*/ |
27 |
public class GetImpactWidget implements RepositoryManagerWidget { |
|
28 |
public class GetImpactWidget extends AbstractRepositoryManagerWidget implements RepositoryManagerWidget {
|
|
28 | 29 |
|
29 | 30 |
private String parentToken = ""; |
30 | 31 |
private String restToken = ""; |
31 | 32 |
|
32 |
private FlowPanel getImpactPanel = new FlowPanel(); |
|
33 |
|
|
34 |
private FlowPanel getImpactColPanel = new FlowPanel(); |
|
35 |
private FlowPanel getImpactInnerPanel = new FlowPanel(); |
|
36 |
private FlowPanel getImpactBox = new FlowPanel(); |
|
37 |
private FlowPanel getImpactBoxContent = new FlowPanel(); |
|
38 |
|
|
39 | 33 |
private Alert errorAlert = new Alert(); |
40 | 34 |
|
41 |
private FlowPanel helpPanel = new FlowPanel();
|
|
35 |
private FlowPanel getImpactContent = new FlowPanel();
|
|
42 | 36 |
|
43 | 37 |
private static HelpServiceAsync helpService = GWT.create(HelpService.class); |
44 | 38 |
private RepositoryServiceAsync repositoryService = GWT.create(RepositoryService.class); |
45 | 39 |
|
46 | 40 |
public GetImpactWidget() { |
47 | 41 |
|
48 |
getImpactPanel.addStyleName("row");
|
|
42 |
super();
|
|
49 | 43 |
|
50 |
getImpactColPanel.addStyleName("col-lg-12"); |
|
51 |
getImpactColPanel.add(getImpactInnerPanel); |
|
44 |
HTML title = new HTML("<h1 class=\"uk-article-title\">Metrics</h1>"); |
|
45 |
title.addStyleName("uk-margin-medium-bottom"); |
|
46 |
contentPanel.add(title); |
|
52 | 47 |
|
53 |
getImpactInnerPanel.addStyleName("wrapper wrapper-content animated fadeInUp"); |
|
54 |
getImpactInnerPanel.add(getImpactBox); |
|
55 |
|
|
56 |
getImpactBox.addStyleName("ibox"); |
|
57 |
getImpactBox.add(getImpactBoxContent); |
|
58 |
|
|
59 |
getImpactBoxContent.addStyleName("ibox-content bigContent"); |
|
60 |
|
|
61 | 48 |
errorAlert.setType(AlertType.DANGER); |
62 | 49 |
errorAlert.setDismissable(false); |
63 | 50 |
errorAlert.setVisible(false); |
64 |
getImpactBoxContent.add(errorAlert);
|
|
51 |
contentPanel.add(errorAlert);
|
|
65 | 52 |
|
66 |
getImpactPanel.add(getImpactColPanel);
|
|
53 |
contentPanel.add(getImpactContent);
|
|
67 | 54 |
} |
68 | 55 |
|
69 | 56 |
@Override |
70 | 57 |
public void clear() { |
71 | 58 |
|
72 |
getImpactBoxContent.clear();
|
|
59 |
getImpactContent.clear(); |
|
73 | 60 |
errorAlert.setVisible(false); |
74 |
getImpactPanel.remove(helpPanel);
|
|
61 |
gridPanel.remove(helpPanel);
|
|
75 | 62 |
} |
76 | 63 |
|
77 | 64 |
@Override |
... | ... | |
79 | 66 |
|
80 | 67 |
errorAlert.setVisible(false); |
81 | 68 |
|
82 |
Document.get().getElementById("page-wrapper").removeClassName("sidebar-content"); |
|
83 |
getImpactBoxContent.add(errorAlert); |
|
69 |
Document.get().getElementById("headerNoTransparent").removeClassName("tm-header-transparent"); |
|
84 | 70 |
|
85 |
helpService.getHelpById(parentToken, new HelpCallback(getImpactColPanel, helpPanel, getImpactPanel));
|
|
71 |
helpService.getHelpById(parentToken, new HelpCallback(helpPanel, gridPanel));
|
|
86 | 72 |
|
87 | 73 |
final HTML loadingWheel = new HTML("<div class=\"loader-big\" style=\"text-align: center; padding-top: 170px; " + |
88 | 74 |
"color: rgb(47, 64, 80); font-weight: bold;\">Retrieving repositories...</div>" + |
89 | 75 |
"<div class=\"whiteFilm\"></div>"); |
90 |
getImpactBoxContent.addStyleName("loading-big");
|
|
91 |
getImpactBoxContent.add(loadingWheel);
|
|
76 |
getImpactContent.addStyleName("loading-big"); |
|
77 |
getImpactContent.add(loadingWheel); |
|
92 | 78 |
|
93 | 79 |
repositoryService.getRepositoriesOfUser(RepositoryManager.currentUser.getEmail(), true, false, |
94 | 80 |
new AsyncCallback<DatasourcesCollection>() { |
... | ... | |
96 | 82 |
@Override |
97 | 83 |
public void onFailure(Throwable caught) { |
98 | 84 |
|
99 |
getImpactBoxContent.removeStyleName("loading-big");
|
|
100 |
getImpactBoxContent.remove(loadingWheel);
|
|
85 |
getImpactContent.removeStyleName("loading-big"); |
|
86 |
getImpactContent.remove(loadingWheel); |
|
101 | 87 |
|
102 | 88 |
errorAlert.setText("System error retrieving repositories."); |
103 | 89 |
errorAlert.setVisible(true); |
... | ... | |
106 | 92 |
@Override |
107 | 93 |
public void onSuccess(DatasourcesCollection datasourcesCollection) { |
108 | 94 |
|
109 |
getImpactBoxContent.removeStyleName("loading-big");
|
|
110 |
getImpactBoxContent.remove(loadingWheel);
|
|
95 |
getImpactContent.removeStyleName("loading-big"); |
|
96 |
getImpactContent.remove(loadingWheel); |
|
111 | 97 |
|
112 | 98 |
ListOrGridViewOfDatasourcesWidget listOrGridViewOfDatasourcesWidget = |
113 | 99 |
new ListOrGridViewOfDatasourcesWidget(datasourcesCollection, "Choose the Datasource for which you would like to view or enable metrics", |
114 | 100 |
parentToken, "<i class=\"fa fa-eye\" aria-hidden=\"true\"></i>"); |
115 | 101 |
|
116 |
getImpactBoxContent.add(listOrGridViewOfDatasourcesWidget.asWidget());
|
|
102 |
getImpactContent.add(listOrGridViewOfDatasourcesWidget.asWidget()); |
|
117 | 103 |
} |
118 | 104 |
}); |
119 | 105 |
|
... | ... | |
163 | 149 |
public void afterAdditionToRootPanel() { |
164 | 150 |
|
165 | 151 |
} |
166 |
|
|
167 |
@Override |
|
168 |
public Widget asWidget() { |
|
169 |
return getImpactPanel; |
|
170 |
} |
|
171 | 152 |
} |
Also available in: Unified diff
merge -r47169:HEAD https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-repository-manager-gui/branches/newtheme .