Revision 50324
Added by Stefania Martziou about 6 years ago
SelectTopicWidget.java | ||
---|---|---|
10 | 10 |
import eu.dnetlib.gwt.client.help.HelpServiceAsync; |
11 | 11 |
import eu.dnetlib.repo.manager.client.AbstractRepositoryManagerWidget; |
12 | 12 |
import eu.dnetlib.repo.manager.client.HelpCallback; |
13 |
import eu.dnetlib.repo.manager.client.RepositoryManager; |
|
13 | 14 |
import eu.dnetlib.repo.manager.client.RepositoryManagerWidget; |
14 | 15 |
import eu.dnetlib.repo.manager.client.services.BrokerService; |
15 | 16 |
import eu.dnetlib.repo.manager.client.services.BrokerServiceAsync; |
17 |
import eu.dnetlib.repo.manager.shared.Term; |
|
16 | 18 |
import eu.dnetlib.repo.manager.shared.Tuple; |
17 | 19 |
import eu.dnetlib.repo.manager.shared.broker.BrowseEntry; |
18 | 20 |
import org.gwtbootstrap3.client.ui.Alert; |
19 | 21 |
import org.gwtbootstrap3.client.ui.constants.AlertType; |
20 | 22 |
|
21 | 23 |
import java.util.ArrayList; |
24 |
import java.util.HashMap; |
|
22 | 25 |
import java.util.List; |
26 |
import java.util.Map; |
|
23 | 27 |
|
24 | 28 |
/** |
25 | 29 |
* Created by stefania on 10/31/16. |
... | ... | |
34 | 38 |
|
35 | 39 |
private Alert errorAlert = new Alert(); |
36 | 40 |
|
41 |
public static Map<String, Term> topicsVocabulary = new HashMap<>(); |
|
42 |
|
|
37 | 43 |
private static HelpServiceAsync helpService = GWT.create(HelpService.class); |
38 | 44 |
private static BrokerServiceAsync brokerService = GWT.create(BrokerService.class); |
39 | 45 |
|
... | ... | |
66 | 72 |
Document.get().getElementById("headerNoTransparent").removeClassName("tm-header-transparent"); |
67 | 73 |
selectTopicBoxContent.add(errorAlert); |
68 | 74 |
|
69 |
title.setHTML("<h1 class=\"uk-article-title\">Topics for " + restToken + "</h1>");
|
|
75 |
title.setHTML("<h1 class=\"uk-article-title\">Enrichments for " + restToken + "</h1>");
|
|
70 | 76 |
|
71 | 77 |
helpService.getHelpById(parentToken + "_selectTopic", new HelpCallback(helpPanel, gridPanel)); |
72 | 78 |
|
... | ... | |
89 | 95 |
} |
90 | 96 |
|
91 | 97 |
@Override |
92 |
public void onSuccess(List<BrowseEntry> browseEntries) { |
|
98 |
public void onSuccess(final List<BrowseEntry> browseEntries) {
|
|
93 | 99 |
|
94 |
selectTopicBoxContent.removeStyleName("loading-big"); |
|
95 |
selectTopicBoxContent.remove(loadingWheel); |
|
100 |
brokerService.getDnetTopics(new AsyncCallback<Map<String, Term>>() { |
|
96 | 101 |
|
97 |
final FlowPanel topicsList = new FlowPanel(); |
|
98 |
createTopicsList(browseEntries, topicsList); |
|
99 |
selectTopicBoxContent.add(topicsList); |
|
102 |
@Override |
|
103 |
public void onFailure(Throwable throwable) { |
|
104 |
|
|
105 |
selectTopicBoxContent.removeStyleName("loading-big"); |
|
106 |
selectTopicBoxContent.remove(loadingWheel); |
|
107 |
|
|
108 |
errorAlert.setText("System error retrieving topics vocabulary."); |
|
109 |
errorAlert.setVisible(true); |
|
110 |
} |
|
111 |
|
|
112 |
@Override |
|
113 |
public void onSuccess(Map<String, Term> stringTermMap) { |
|
114 |
|
|
115 |
topicsVocabulary.putAll(stringTermMap); |
|
116 |
|
|
117 |
selectTopicBoxContent.removeStyleName("loading-big"); |
|
118 |
selectTopicBoxContent.remove(loadingWheel); |
|
119 |
|
|
120 |
final FlowPanel topicsList = new FlowPanel(); |
|
121 |
createTopicsList(browseEntries, topicsList); |
|
122 |
selectTopicBoxContent.add(topicsList); |
|
123 |
} |
|
124 |
}); |
|
125 |
|
|
100 | 126 |
} |
101 | 127 |
}); |
102 | 128 |
} |
... | ... | |
171 | 197 |
for(BrowseEntry browseEntry : browseEntries) { |
172 | 198 |
|
173 | 199 |
content += "<tr class=\"el-item\">" + |
174 |
"<td class=\"uk-text-nowrap uk-table-shrink\">\n" +
|
|
200 |
"<td class=\"uk-table-shrink uk-width-4-5\">\n" +
|
|
175 | 201 |
"<a href=\"#" + parentToken + "/" + restToken + "/" + browseEntry.getValue() + "\" class=\"el-link\">" + |
176 |
browseEntry.getValue() + "</a>" + |
|
177 |
"</td>" + |
|
178 |
"<td class=\"uk-text-nowrap uk-table-shrink\">\n" + |
|
202 |
browseEntry.getValue() + "</a>"; |
|
203 |
|
|
204 |
if(this.topicsVocabulary.get(browseEntry.getValue())!=null) |
|
205 |
content += "<div class=\"uk-text uk-text-meta\">" + this.topicsVocabulary.get(browseEntry.getValue()).getEnglishName() + "</div>"; |
|
206 |
|
|
207 |
content += "</td>" + |
|
208 |
"<td class=\"uk-text-nowrap uk-table-shrink uk-width-1-5\">\n" + |
|
179 | 209 |
"<div class=\"el-title\">" + browseEntry.getSize() + "</div>" + |
180 | 210 |
"</td>" + |
181 | 211 |
"</tr>"; |
... | ... | |
184 | 214 |
} |
185 | 215 |
|
186 | 216 |
content += "<tr class=\"el-item footers\">" + |
187 |
"<td class=\"uk-text-nowrap uk-table-shrink\">\n" + |
|
217 |
"<td class=\"uk-text-nowrap uk-table-shrink uk-width-4-5\">\n" +
|
|
188 | 218 |
"<div class=\"el-title\">Total</div>" + |
189 | 219 |
"</td>" + |
190 |
"<td class=\"uk-text-nowrap uk-table-shrink\">\n" + |
|
220 |
"<td class=\"uk-text-nowrap uk-table-shrink uk-width-1-5\">\n" +
|
|
191 | 221 |
"<div class=\"el-title\">" + total + "</div>" + |
192 | 222 |
"</td>" + |
193 | 223 |
"</tr>"; |
Also available in: Unified diff
Various styling and design changes in the events pages