Revision 52864
Added by Miriam Baglioni about 6 years ago
modules/dnet-openaireplus-workflows/branches/solr7/src/main/java/eu/dnetlib/msro/openaireplus/workflows/nodes/bulktag/ZenodoCommunity.java | ||
---|---|---|
1 |
package eu.dnetlib.msro.openaireplus.workflows.nodes.bulktag; |
|
2 |
|
|
3 |
import com.google.gson.Gson; |
|
4 |
|
|
5 |
/** |
|
6 |
* Created by miriam on 01/08/2018. |
|
7 |
*/ |
|
8 |
public class ZenodoCommunity { |
|
9 |
|
|
10 |
private String zenodoCommunityId; |
|
11 |
private String selCriteria; |
|
12 |
|
|
13 |
public String getZenodoCommunityId() { |
|
14 |
return zenodoCommunityId; |
|
15 |
} |
|
16 |
|
|
17 |
public void setZenodoCommunityId(String zenodoCommunityId) { |
|
18 |
this.zenodoCommunityId = zenodoCommunityId; |
|
19 |
} |
|
20 |
|
|
21 |
public String getSelCriteria() { |
|
22 |
return selCriteria; |
|
23 |
} |
|
24 |
|
|
25 |
public void setSelCriteria(String selCriteria) { |
|
26 |
this.selCriteria = selCriteria; |
|
27 |
} |
|
28 |
|
|
29 |
public String getZenodoCOmmunities(){ |
|
30 |
final Gson g = new Gson(); |
|
31 |
return g.toJson(this); |
|
32 |
} |
|
33 |
} |
modules/dnet-openaireplus-workflows/branches/solr7/src/main/java/eu/dnetlib/msro/openaireplus/workflows/nodes/bulktag/Community.java | ||
---|---|---|
1 |
package eu.dnetlib.msro.openaireplus.workflows.nodes.bulktag; |
|
2 |
|
|
3 |
import java.util.ArrayList; |
|
4 |
import java.util.List; |
|
5 |
import com.google.gson.Gson; |
|
6 |
|
|
7 |
/** |
|
8 |
* Created by miriam on 01/08/2018. |
|
9 |
*/ |
|
10 |
public class Community { |
|
11 |
|
|
12 |
private String id; |
|
13 |
private List<String> subjects; |
|
14 |
private List<Datasource> datasources; |
|
15 |
private List<ZenodoCommunity> zenodoCommunities; |
|
16 |
|
|
17 |
public String getId() { |
|
18 |
return id; |
|
19 |
} |
|
20 |
|
|
21 |
public void setId(String id) { |
|
22 |
this.id = id; |
|
23 |
} |
|
24 |
|
|
25 |
|
|
26 |
public List<String> getSubjects() { |
|
27 |
return subjects; |
|
28 |
} |
|
29 |
|
|
30 |
public void setSubjects(List<String> subjects) { |
|
31 |
this.subjects = subjects; |
|
32 |
} |
|
33 |
|
|
34 |
public List<Datasource> getDatasources() { |
|
35 |
return datasources; |
|
36 |
} |
|
37 |
|
|
38 |
public void setDatasources(List<Datasource> datasources) { |
|
39 |
this.datasources = datasources; |
|
40 |
} |
|
41 |
|
|
42 |
public List<ZenodoCommunity> getZenodoCommunities() { |
|
43 |
return zenodoCommunities; |
|
44 |
} |
|
45 |
|
|
46 |
public void setZenodoCommunities(List<ZenodoCommunity> zenodoCommunities) { |
|
47 |
this.zenodoCommunities = zenodoCommunities; |
|
48 |
} |
|
49 |
|
|
50 |
public String getCommunityConf(){ |
|
51 |
final Gson g = new Gson(); |
|
52 |
return g.toJson(this); |
|
53 |
} |
|
54 |
|
|
55 |
public void addSubject(String text) { |
|
56 |
if(subjects == null){ |
|
57 |
subjects = new ArrayList<>(); |
|
58 |
} |
|
59 |
if (!text.isEmpty()) |
|
60 |
subjects.add(text); |
|
61 |
} |
|
62 |
} |
modules/dnet-openaireplus-workflows/branches/solr7/src/main/java/eu/dnetlib/msro/openaireplus/workflows/nodes/bulktag/Configuration.java | ||
---|---|---|
1 |
package eu.dnetlib.msro.openaireplus.workflows.nodes.bulktag; |
|
2 |
|
|
3 |
import java.util.ArrayList; |
|
4 |
import java.util.List; |
|
5 |
import com.google.gson.Gson; |
|
6 |
|
|
7 |
/** |
|
8 |
* Created by miriam on 01/08/2018. |
|
9 |
*/ |
|
10 |
public class Configuration { |
|
11 |
private List<Community> community; |
|
12 |
|
|
13 |
|
|
14 |
public List<Community> getCommunity() { |
|
15 |
return community; |
|
16 |
} |
|
17 |
|
|
18 |
public void setCommunity(List<Community> community) { |
|
19 |
this.community = community; |
|
20 |
} |
|
21 |
|
|
22 |
public void addCommunity(Community c){ |
|
23 |
if(community == null){ |
|
24 |
community = new ArrayList<>(); |
|
25 |
} |
|
26 |
if(c != null) |
|
27 |
community.add(c); |
|
28 |
} |
|
29 |
|
|
30 |
public String getTaggingConfiguration(){ |
|
31 |
final Gson g = new Gson(); |
|
32 |
|
|
33 |
return g.toJson(this); |
|
34 |
} |
|
35 |
|
|
36 |
} |
modules/dnet-openaireplus-workflows/branches/solr7/src/main/java/eu/dnetlib/msro/openaireplus/workflows/nodes/bulktag/Datasource.java | ||
---|---|---|
1 |
package eu.dnetlib.msro.openaireplus.workflows.nodes.bulktag; |
|
2 |
|
|
3 |
import com.google.gson.Gson; |
|
4 |
|
|
5 |
/** |
|
6 |
* Created by miriam on 01/08/2018. |
|
7 |
*/ |
|
8 |
public class Datasource { |
|
9 |
|
|
10 |
private String openaireId; |
|
11 |
private String selCriteria; |
|
12 |
|
|
13 |
public String getOpenaireId() { |
|
14 |
return openaireId; |
|
15 |
} |
|
16 |
|
|
17 |
public void setOpenaireId(String openaireId) { |
|
18 |
this.openaireId = openaireId; |
|
19 |
} |
|
20 |
|
|
21 |
public String getSelCriteria() { |
|
22 |
return selCriteria; |
|
23 |
} |
|
24 |
|
|
25 |
public void setSelCriteria(String selCriteria) { |
|
26 |
this.selCriteria = selCriteria; |
|
27 |
} |
|
28 |
|
|
29 |
public String getDatasource(){ |
|
30 |
final Gson g= new Gson(); |
|
31 |
|
|
32 |
return g.toJson(this); |
|
33 |
} |
|
34 |
|
|
35 |
} |
Also available in: Unified diff
new classes to parse configuration