Revision 55912
Added by Miriam Baglioni almost 5 years ago
CommunityConfigurationFactory.java | ||
---|---|---|
3 | 3 |
import com.google.common.collect.Lists; |
4 | 4 |
import com.google.common.collect.Maps; |
5 | 5 |
import com.google.gson.Gson; |
6 |
import eu.dnetlib.data.bulktag.selectioncriteria.VerbResolver; |
|
7 |
import eu.dnetlib.data.bulktag.selectioncriteria.VerbResolverFactory; |
|
6 | 8 |
import org.apache.commons.lang3.StringUtils; |
7 | 9 |
import org.apache.commons.logging.Log; |
8 | 10 |
import org.apache.commons.logging.LogFactory; |
... | ... | |
23 | 25 |
|
24 | 26 |
private static final Log log = LogFactory.getLog(CommunityConfigurationFactory.class); |
25 | 27 |
|
28 |
private static VerbResolver resolver = VerbResolverFactory.newInstance(); |
|
29 |
|
|
26 | 30 |
public static CommunityConfiguration newInstance(final String xml) throws DocumentException { |
27 | 31 |
|
28 | 32 |
log.debug(String.format("parsing community configuration from:\n%s", xml)); |
... | ... | |
91 | 95 |
for(Node n : list){ |
92 | 96 |
Datasource d = new Datasource(); |
93 | 97 |
d.setOpenaireId(n.selectSingleNode("./openaireId").getText()); |
94 |
d.setSelCriteria(new SelectionCriteria(n.selectSingleNode("./selcriteria")));
|
|
98 |
d.setSelCriteria(n.selectSingleNode("./selcriteria"),resolver);
|
|
95 | 99 |
datasourceList.add(d); |
96 | 100 |
} |
97 | 101 |
log.info("size of the datasource list " + datasourceList.size()); |
... | ... | |
113 | 117 |
for(Node n : list){ |
114 | 118 |
ZenodoCommunity zc = new ZenodoCommunity(); |
115 | 119 |
zc.setZenodoCommunityId(n.selectSingleNode("./zenodoid").getText()); |
116 |
zc.setSelCriteria(new SelectionCriteria(n.selectSingleNode("./selcriteria")));
|
|
120 |
zc.setSelCriteria(n.selectSingleNode("./selcriteria"));
|
|
117 | 121 |
|
118 | 122 |
zenodoCommunityList.add(zc); |
119 | 123 |
} |
Also available in: Unified diff
Update for the addition of selection criteria in the community context configuration