1
|
package eu.dnetlib.data.search.web.api;
|
2
|
|
3
|
import eu.dnetlib.data.search.web.utils.RequestResponseHandler;
|
4
|
|
5
|
/**
|
6
|
* Created by kiatrop on 20/12/2016.
|
7
|
*/
|
8
|
public class CSVResponseFormat {
|
9
|
|
10
|
public static final String organization = "Name,Projects,Country\n";
|
11
|
public static final String datasource = "Name,Type,Compatibility,OAI-PMH,website\n";
|
12
|
public static final String person = "Fullname\n";
|
13
|
public static final String project = "Title,Funder,Start Date,End Date,Participants\n";
|
14
|
public static final String result = "Title,Authors,Publication Year,DOI,Funder|Project Name (GA Number),Access\n";
|
15
|
|
16
|
//TODO SPECIAL
|
17
|
public static final String result_special = "Title,Authors,Publication Year,DOI,Download from,Type,Journal,Funder,Project Name (GA Number),Access\n";
|
18
|
|
19
|
|
20
|
public static final String response = "%s%s";
|
21
|
|
22
|
public static String appendTitle(RequestResponseHandler.Entity entity, boolean special) {
|
23
|
if(entity.equals(RequestResponseHandler.Entity.ORGANIZATION)) {
|
24
|
return organization;
|
25
|
|
26
|
} else if (entity.equals(RequestResponseHandler.Entity.DATASOURCE)) {
|
27
|
return datasource;
|
28
|
|
29
|
} else if (entity.equals(RequestResponseHandler.Entity.PERSON)) {
|
30
|
return person;
|
31
|
|
32
|
} else if (entity.equals(RequestResponseHandler.Entity.PROJECT)) {
|
33
|
return project;
|
34
|
|
35
|
} else if (entity.equals(RequestResponseHandler.Entity.PUBLICATION) || entity.equals(RequestResponseHandler.Entity.DATASET)) {
|
36
|
if (special) {
|
37
|
return result_special;
|
38
|
}
|
39
|
|
40
|
return result;
|
41
|
}
|
42
|
|
43
|
return "";
|
44
|
}
|
45
|
|
46
|
|
47
|
|
48
|
}
|