1 |
40511
|
stefania.m
|
package eu.dnetlib.repo.manager.client.datasources.register;
|
2 |
40249
|
stefania.m
|
|
3 |
41625
|
stefania.m
|
import com.google.gwt.core.client.GWT;
|
4 |
40249
|
stefania.m
|
import com.google.gwt.dom.client.Document;
|
5 |
40511
|
stefania.m
|
import com.google.gwt.user.client.Window;
|
6 |
40249
|
stefania.m
|
import com.google.gwt.user.client.ui.FlowPanel;
|
7 |
|
|
import com.google.gwt.user.client.ui.HTML;
|
8 |
|
|
import com.google.gwt.user.client.ui.Widget;
|
9 |
41617
|
stefania.m
|
import eu.dnetlib.gwt.client.help.HelpHelper;
|
10 |
41625
|
stefania.m
|
import eu.dnetlib.gwt.client.help.HelpService;
|
11 |
|
|
import eu.dnetlib.gwt.client.help.HelpServiceAsync;
|
12 |
|
|
import eu.dnetlib.repo.manager.client.HelpCallback;
|
13 |
40511
|
stefania.m
|
import eu.dnetlib.repo.manager.client.RepositoryManagerWidget;
|
14 |
41614
|
stefania.m
|
import org.gwtbootstrap3.client.ui.Anchor;
|
15 |
40249
|
stefania.m
|
|
16 |
|
|
/**
|
17 |
|
|
* Created by stefania on 12/7/15.
|
18 |
|
|
*/
|
19 |
|
|
public class SelectRepositoryTypeWidget implements RepositoryManagerWidget {
|
20 |
|
|
|
21 |
|
|
private static SelectRepositoryTypeWidget instance = null;
|
22 |
|
|
|
23 |
40576
|
stefania.m
|
private String parentToken = "";
|
24 |
|
|
private String restToken = "";
|
25 |
|
|
|
26 |
40249
|
stefania.m
|
private FlowPanel selectRepositoryTypePanel = new FlowPanel();
|
27 |
|
|
|
28 |
41625
|
stefania.m
|
private FlowPanel colPanel = new FlowPanel();
|
29 |
|
|
private FlowPanel helpPanel = new FlowPanel();
|
30 |
|
|
|
31 |
|
|
private static HelpServiceAsync helpService = GWT.create(HelpService.class);
|
32 |
|
|
|
33 |
40249
|
stefania.m
|
private SelectRepositoryTypeWidget() {
|
34 |
|
|
|
35 |
|
|
selectRepositoryTypePanel.addStyleName("row");
|
36 |
|
|
|
37 |
41617
|
stefania.m
|
colPanel.addStyleName("col-lg-12");
|
38 |
41614
|
stefania.m
|
selectRepositoryTypePanel.add(colPanel);
|
39 |
40249
|
stefania.m
|
|
40 |
41614
|
stefania.m
|
FlowPanel wrapperPanel = new FlowPanel();
|
41 |
|
|
wrapperPanel.addStyleName("wrapper wrapper-content animated fadeInUp");
|
42 |
|
|
colPanel.add(wrapperPanel);
|
43 |
|
|
|
44 |
|
|
FlowPanel rowPanel = new FlowPanel();
|
45 |
|
|
rowPanel.addStyleName("row");
|
46 |
|
|
wrapperPanel.add(rowPanel);
|
47 |
|
|
|
48 |
|
|
Anchor literatureType = new Anchor();
|
49 |
|
|
literatureType.setHTML("<div class=\"col-md-3\"><div class=\"ibox\"><div class=\"ibox-content product-box\">" +
|
50 |
42123
|
stefania.m
|
"<div class=\"product-imitation\"><img width=\"100%\" height=\"100%\" src=\"img/Literature_repos_square.png\">" +
|
51 |
|
|
"</div><div class=\"product-desc\"><small class=\"text-muted\">" +
|
52 |
41614
|
stefania.m
|
"Add new</small><span class=\"product-name\"> Literature Repository</span>" +
|
53 |
41639
|
stefania.m
|
"<div class=\"small m-t-xs text-right\"><a href=\"http://www.opendoar.org\" target=\"_blank\">List provided " +
|
54 |
|
|
"by <br>OpenDOAR<i class=\"fa fa-external-link\" style=\"margin-left:3px\"></i></a></div>" +
|
55 |
41614
|
stefania.m
|
"</div></div></div></div>");
|
56 |
|
|
literatureType.addStyleName("linkBox");
|
57 |
|
|
literatureType.setHref("#registerDatasource/literature");
|
58 |
|
|
rowPanel.add(literatureType);
|
59 |
|
|
|
60 |
|
|
Anchor dataType = new Anchor();
|
61 |
|
|
dataType.setHTML("<div class=\"col-md-3\"><div class=\"ibox\"><div class=\"ibox-content product-box\">" +
|
62 |
42123
|
stefania.m
|
"<div class=\"product-imitation\"><img width=\"100%\" height=\"100%\" src=\"img/Data_repos_sqare.png\">" +
|
63 |
|
|
"</div><div class=\"product-desc\"><small class=\"text-muted\">" +
|
64 |
41614
|
stefania.m
|
"Add new</small><span class=\"product-name\"> Data Repository</span>" +
|
65 |
41639
|
stefania.m
|
"<div class=\"small m-t-xs text-right\"><a href=\"http://http://www.re3data.org\" target=\"_blank\">List provided " +
|
66 |
|
|
"by <br>Re3data<i class=\"fa fa-external-link\" style=\"margin-left:3px\"></i></a></div>" +
|
67 |
41614
|
stefania.m
|
"</div></div></div></div>");
|
68 |
|
|
dataType.addStyleName("linkBox");
|
69 |
|
|
dataType.setHref("#registerDatasource/data");
|
70 |
|
|
rowPanel.add(dataType);
|
71 |
|
|
|
72 |
|
|
Anchor journalType = new Anchor();
|
73 |
|
|
journalType.setHTML("<div class=\"col-md-3\"><div class=\"ibox\"><div class=\"ibox-content product-box\">" +
|
74 |
42123
|
stefania.m
|
"<div class=\"product-imitation\"><img width=\"100%\" height=\"100%\" src=\"img/OAJournals_square.png\">" +
|
75 |
|
|
"</div><div class=\"product-desc\"><small class=\"text-muted\">" +
|
76 |
41614
|
stefania.m
|
"Add new</small><span class=\"product-name\"> Journal</span>" +
|
77 |
|
|
"<div class=\"small m-t-xs\">Lorem ipsum dolor sit amet, consectetur adipiscing elit...</div>" +
|
78 |
|
|
"</div></div></div></div>");
|
79 |
|
|
journalType.addStyleName("linkBox");
|
80 |
|
|
journalType.setHref("#registerDatasource/journal");
|
81 |
|
|
rowPanel.add(journalType);
|
82 |
|
|
|
83 |
|
|
Anchor aggregatorType = new Anchor();
|
84 |
|
|
aggregatorType.setHTML("<div class=\"col-md-3\"><div class=\"ibox\"><div class=\"ibox-content product-box\">" +
|
85 |
42123
|
stefania.m
|
"<div class=\"product-imitation\"><img width=\"100%\" height=\"100%\" src=\"img/Icons_Aggregators_square.png\">" +
|
86 |
|
|
"</div><div class=\"product-desc\"><small class=\"text-muted\">" +
|
87 |
41614
|
stefania.m
|
"Add new</small><span class=\"product-name\"> Aggregator</span>" +
|
88 |
|
|
"<div class=\"small m-t-xs\">Lorem ipsum dolor sit amet, consectetur adipiscing elit...</div>" +
|
89 |
|
|
"</div></div></div></div>");
|
90 |
|
|
aggregatorType.addStyleName("linkBox");
|
91 |
|
|
aggregatorType.setHref("#registerDatasource/aggregator");
|
92 |
|
|
rowPanel.add(aggregatorType);
|
93 |
40249
|
stefania.m
|
}
|
94 |
|
|
|
95 |
|
|
public static final SelectRepositoryTypeWidget getInstance() {
|
96 |
|
|
|
97 |
|
|
if(instance==null)
|
98 |
|
|
instance = new SelectRepositoryTypeWidget();
|
99 |
|
|
|
100 |
|
|
return instance;
|
101 |
|
|
}
|
102 |
|
|
|
103 |
|
|
@Override
|
104 |
|
|
public void clear() {
|
105 |
41625
|
stefania.m
|
selectRepositoryTypePanel.remove(helpPanel);
|
106 |
40249
|
stefania.m
|
}
|
107 |
|
|
|
108 |
|
|
@Override
|
109 |
|
|
public void reload() {
|
110 |
|
|
Document.get().getElementById("page-wrapper").removeClassName("sidebar-content");
|
111 |
41625
|
stefania.m
|
helpService.getHelpById(parentToken, new HelpCallback(colPanel, helpPanel, selectRepositoryTypePanel));
|
112 |
40249
|
stefania.m
|
}
|
113 |
|
|
|
114 |
|
|
@Override
|
115 |
40511
|
stefania.m
|
public void setToken(String parentToken, String rest) {
|
116 |
40576
|
stefania.m
|
this.parentToken = parentToken;
|
117 |
|
|
this.restToken = rest;
|
118 |
40249
|
stefania.m
|
}
|
119 |
|
|
|
120 |
|
|
@Override
|
121 |
|
|
public void afterAdditionToRootPanel() {
|
122 |
|
|
|
123 |
|
|
}
|
124 |
|
|
|
125 |
|
|
@Override
|
126 |
|
|
public Widget asWidget() {
|
127 |
|
|
return selectRepositoryTypePanel;
|
128 |
|
|
}
|
129 |
|
|
}
|