1
|
package eu.dnetlib.client.fundingrequest.stepinfo;
|
2
|
|
3
|
import com.google.gwt.i18n.client.DateTimeFormat;
|
4
|
import com.google.gwt.user.client.ui.HTML;
|
5
|
import com.google.gwt.user.client.ui.IsWidget;
|
6
|
import com.google.gwt.user.client.ui.Widget;
|
7
|
import eu.dnetlib.goldoa.domain.*;
|
8
|
|
9
|
/**
|
10
|
* Created by stefania on 3/27/15.
|
11
|
*/
|
12
|
public class PublicationFullInfo implements IsWidget {
|
13
|
|
14
|
private HTML publicationInfo = new HTML();
|
15
|
private String publicationInfoContents = "";
|
16
|
|
17
|
private DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy/MM/dd");
|
18
|
|
19
|
public PublicationFullInfo(Publication publication) {
|
20
|
|
21
|
publicationInfoContents = "<div>";
|
22
|
|
23
|
publicationInfoContents += "<dl><dt class=\"chronologySubTitle\">PUBLICATION</dt></dl>";
|
24
|
|
25
|
|
26
|
if(publication.getTitle()!=null && !publication.getTitle().trim().equals(""))
|
27
|
publicationInfoContents += "<dd>" + publication.getTitle() + "</dd>";
|
28
|
|
29
|
if(publication.getType().equals(PublicationType.CONFERENCE_PROCS)
|
30
|
&& publication.getEventdetails()!=null && !publication.getEventdetails().trim().isEmpty())
|
31
|
publicationInfoContents += "<dd>" + publication.getEventdetails() + "</dd>";
|
32
|
|
33
|
if(publication.getDoi()!=null && !publication.getDoi().trim().equals(""))
|
34
|
publicationInfoContents += "<dd>" + publication.getDoi() + "</dd>";
|
35
|
|
36
|
if(!publication.getAuthors().isEmpty()) {
|
37
|
|
38
|
for(Author author : publication.getAuthors()) {
|
39
|
publicationInfoContents += "<dd>" + author.getFirstname();
|
40
|
if(author.getInitials()!=null && !author.getInitials().trim().equals(""))
|
41
|
publicationInfoContents += " " + author.getInitials().trim();
|
42
|
publicationInfoContents += " " + author.getLastname() + "</dd>";
|
43
|
}
|
44
|
}
|
45
|
|
46
|
if(publication.getDate()!=null)
|
47
|
publicationInfoContents += "<dd>" + dtf.format(publication.getDate()) + "</dd>";
|
48
|
|
49
|
if(publication.getAcceptancedate()!=null)
|
50
|
publicationInfoContents += "<dd>" + dtf.format(publication.getAcceptancedate()) + "</dd>";
|
51
|
|
52
|
if(publication.getType().equals(PublicationType.ARTICLE))
|
53
|
publicationInfoContents += "<dd>Article</dd>";
|
54
|
else if(publication.getType().equals(PublicationType.MONOGRAPH))
|
55
|
publicationInfoContents += "<dd>Book</dd>";
|
56
|
else if(publication.getType().equals(PublicationType.CONFERENCE_PROCS))
|
57
|
publicationInfoContents += "<dd>Conference Procs</dd>";
|
58
|
else
|
59
|
publicationInfoContents += "<dd>Book chapter</dd>";
|
60
|
|
61
|
if(publication.getLanguages()!=null && !publication.getLanguages().trim().equals(""))
|
62
|
publicationInfoContents += "<dd>" + publication.getLanguages() + "</dd>";
|
63
|
|
64
|
if(publication.getSubjects()!=null && !publication.getSubjects().trim().equals(""))
|
65
|
publicationInfoContents += "<dd>" + publication.getSubjects() + "</dd>";
|
66
|
|
67
|
if(!publication.getPublicationIdentifiers().isEmpty()) {
|
68
|
|
69
|
for(Identifier publicationIdentifier : publication.getPublicationIdentifiers()) {
|
70
|
publicationInfoContents += "<dd>" + publicationIdentifier.getType() + " - " + publicationIdentifier.getValue() + "</dd>";
|
71
|
}
|
72
|
}
|
73
|
|
74
|
publicationInfoContents += "<dd>Deposited to: ";
|
75
|
if(publication.getRepository()!=null && !publication.getRepository().equals(""))
|
76
|
publicationInfoContents += publication.getRepository();
|
77
|
else
|
78
|
publicationInfoContents += "unknown";
|
79
|
publicationInfoContents += "</dd>";
|
80
|
|
81
|
publicationInfoContents += "</div>";
|
82
|
publicationInfo.setHTML(publicationInfoContents);
|
83
|
}
|
84
|
|
85
|
@Override
|
86
|
public Widget asWidget() {
|
87
|
return publicationInfo;
|
88
|
}
|
89
|
|
90
|
public void addStyleName(String styleName) {
|
91
|
publicationInfo.addStyleName(styleName);
|
92
|
}
|
93
|
}
|