Revision 49368
Added by Michele Artini over 6 years ago
EnrichProjectsPlugin.java | ||
---|---|---|
15 | 15 |
import org.dom4j.DocumentException; |
16 | 16 |
import org.dom4j.Element; |
17 | 17 |
import org.dom4j.io.SAXReader; |
18 |
import org.springframework.beans.factory.annotation.Value; |
|
18 | 19 |
|
19 | 20 |
import com.mongodb.BasicDBObject; |
20 | 21 |
import com.mongodb.DBObject; |
... | ... | |
28 | 29 |
|
29 | 30 |
private static final Log log = LogFactory.getLog(EnrichProjectsPlugin.class); |
30 | 31 |
|
32 |
@Value("${plugin.enrich.projects.openaire.url}") |
|
33 |
private String baseUrl; |
|
34 |
|
|
31 | 35 |
@Override |
32 | 36 |
public void process(final MongoMDStore store, final Map<String, String> params) throws MDStoreServiceException { |
33 | 37 |
log.info("*****************************************"); |
... | ... | |
118 | 122 |
private Project resolveProject(final String s) { |
119 | 123 |
try { |
120 | 124 |
final String[] arr = s.split("/"); |
121 |
final String url = String.format("http://api.openaire.eu/search/projects?funder=%s&fundingStream=%s&grantID=%s", arr[0], arr[1], arr[2]);
|
|
125 |
final String url = String.format(baseUrl, arr[0], arr[1], arr[2]);
|
|
122 | 126 |
return Project.newInstance(new URI(url)); |
123 | 127 |
} catch (final URISyntaxException e) { |
124 | 128 |
log.error("Error resolving project: " + s, e); |
Also available in: Unified diff
datasets