Revision 60102
Added by Michele Artini over 3 years ago
modules/dnet-isti/trunk/src/main/java/eu/dnetlib/data/mdstore/plugins/EnrichOpenairePlugin.java | ||
---|---|---|
34 | 34 |
@Value("${plugin.enrich.publications.openaire.url}") |
35 | 35 |
private String baseUrl; |
36 | 36 |
|
37 |
@Value("${plugin.enrich.openaire.datasources.blacklist}") |
|
38 |
private String datasourceBlackList; |
|
39 |
|
|
37 | 40 |
private Map<String, Counter> counters = new HashMap<>(); |
38 | 41 |
|
39 | 42 |
@Override |
... | ... | |
141 | 144 |
private void updateUrls(final MdRecord doc, final Node n) { |
142 | 145 |
doc.getUrls().addAll(doc.getUrls()); |
143 | 146 |
|
147 |
final Set<String> blacklist = |
|
148 |
Arrays.stream(datasourceBlackList.split(",")).map(String::trim).filter(StringUtils::isNotBlank).collect(Collectors.toSet()); |
|
149 |
|
|
144 | 150 |
for (final Object oin : n.selectNodes(".//instance")) { |
145 |
final String rights = ((Element) oin).valueOf("./accessright/@classname").trim(); |
|
146 |
final String hostedBy = ((Element) oin).valueOf("./hostedby/@name").trim(); |
|
147 |
for (final Object ourl : ((Element) oin).selectNodes("./webresource/url")) { |
|
148 |
final MyURL u = new MyURL(((Node) ourl).getText().trim(), hostedBy, rights); |
|
149 |
doc.getUrls().remove(u); |
|
150 |
doc.getUrls().add(u); |
|
151 |
|
|
152 |
final String hostedByid = ((Element) oin).valueOf("./hostedby/@id").trim(); |
|
153 |
|
|
154 |
if (!blacklist.contains(hostedByid)) { |
|
155 |
final String hostedByName = ((Element) oin).valueOf("./hostedby/@name").trim(); |
|
156 |
final String rights = ((Element) oin).valueOf("./accessright/@classname").trim(); |
|
157 |
|
|
158 |
for (final Object ourl : ((Element) oin).selectNodes("./webresource/url")) { |
|
159 |
final MyURL u = new MyURL(((Node) ourl).getText().trim(), hostedByName, rights); |
|
160 |
doc.getUrls().remove(u); |
|
161 |
doc.getUrls().add(u); |
|
162 |
} |
|
151 | 163 |
} |
152 | 164 |
} |
153 | 165 |
} |
modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/isti/applicationContext-isti.properties | ||
---|---|---|
2 | 2 |
plugin.enrich.labs.pimpa.url = http://pimpa.isti.cnr.it/PERSONALE/web-services/iop/iop.webservice.php |
3 | 3 |
plugin.enrich.publications.openaire.url = http://api.openaire.eu/search/publications?doi=%s |
4 | 4 |
plugin.enrich.projects.openaire.url = http://api.openaire.eu/search/projects?funder=%s&fundingStream=%s&grantID=%s |
5 |
plugin.enrich.openaire.datasources.blacklist = opendoar____::81930c54e08b6d26d9638dd2e4656dc1 |
|
5 | 6 |
|
7 |
|
|
6 | 8 |
db.affiliations.url = jdbc:mysql://localhost:8889/isti_affiliations |
7 | 9 |
db.affiliations.username = dnet |
8 | 10 |
db.affiliations.password = dnetPwd |
Also available in: Unified diff
blacklist