new_model_for_communities #15
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
|
@ -0,0 +1 @@
|
|||
\copy community_projects FROM '/tmp/nwo_community_projects.csv' CSV HEADER;
|
Loading…
Reference in New Issue