nwo projects import

This commit is contained in:
Michele Artini 2023-07-07 11:53:25 +02:00
parent dde8e1c564
commit 15118e2f18
5 changed files with 16 additions and 1 deletions

View File

@ -27,7 +27,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
@CrossOrigin(origins = {
"*"
})
@ConditionalOnProperty(value = "openaire.exporter.enable.community", havingValue = "true")
@ConditionalOnProperty(value = "openaire.exporter.enable.community.import", havingValue = "true")
@Tag(name = "OpenAIRE Communities: Migration API", description = "OpenAIRE Communities: Migration API")
public class CommunityImporterController {

View File

@ -16,6 +16,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dom4j.DocumentHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -45,6 +46,7 @@ import eu.dnetlib.openaire.exporter.model.context.Context;
import eu.dnetlib.openaire.exporter.model.context.Param;
@Service
@ConditionalOnProperty(value = "openaire.exporter.enable.community.import", havingValue = "true")
public class CommunityImporterService {
// common

View File

@ -25,6 +25,7 @@ management.endpoints.web.path-mapping.health = health
# ENABLE / DISABLE CONTROLLERS
openaire.exporter.enable.dsm = true
openaire.exporter.enable.community = true
openaire.exporter.enable.community.import = false
openaire.exporter.enable.context = true
openaire.exporter.enable.funders = false
openaire.exporter.enable.project = true

View File

@ -0,0 +1,11 @@
\copy (
SELECT
'netherlands' AS community,
'nwo_________::'||md5(substr(id, 15)) AS project_id,
code AS project_code,
title AS project_name,
acronym AS project_acronym,
'NWO' AS project_funder
FROM projects
WHERE id LIKE 'nwo\_\_\_\_\_\_\_\_\_::%'
) TO '/tmp/nwo_community_projects.csv' CSV HEADER;

View File

@ -0,0 +1 @@
\copy community_projects FROM '/tmp/nwo_community_projects.csv' CSV HEADER;