From da7c66d29d9a2a6d29f7f206faf752861b3204f7 Mon Sep 17 00:00:00 2001 From: "michele.artini" Date: Thu, 21 Nov 2024 12:40:40 +0100 Subject: [PATCH] constants --- .../directindex/mapping/SolrRecordMapper.java | 32 ++++--------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/src/main/java/eu/dnetlib/app/directindex/mapping/SolrRecordMapper.java b/src/main/java/eu/dnetlib/app/directindex/mapping/SolrRecordMapper.java index a34f34f..b906337 100644 --- a/src/main/java/eu/dnetlib/app/directindex/mapping/SolrRecordMapper.java +++ b/src/main/java/eu/dnetlib/app/directindex/mapping/SolrRecordMapper.java @@ -23,6 +23,7 @@ import eu.dnetlib.app.directindex.errors.DirectIndexApiException; import eu.dnetlib.app.directindex.input.DatasourceEntry; import eu.dnetlib.app.directindex.input.PidEntry; import eu.dnetlib.app.directindex.input.ResultEntry; +import eu.dnetlib.dhp.schema.common.ModelConstants; import eu.dnetlib.dhp.schema.solr.AccessRight; import eu.dnetlib.dhp.schema.solr.Author; import eu.dnetlib.dhp.schema.solr.BestAccessRight; @@ -294,44 +295,23 @@ public class SolrRecordMapper { final RelatedRecordHeader head = new RelatedRecordHeader(); head.setRelatedIdentifier(calculateProjectId(arr[2], arr[3], arr[4])); - head.setRelationType(null); // TODO + head.setRelationType(ModelConstants.RESULT_PROJECT); head.setRelatedRecordType(RecordType.project); - head.setRelationClass("isProducedBy"); - head.setRelationProvenance("user:claim"); + head.setRelationClass(ModelConstants.IS_PRODUCED_BY); + head.setRelationProvenance(ModelConstants.USER_CLAIM); head.setTrust("0.9"); final RelatedRecord rel = new RelatedRecord(); rel.setHeader(head); rel.setProjectTitle(title); - rel.setAcronym(acronym); // TODO - rel.setCode(code); // TODO + rel.setAcronym(acronym); + rel.setCode(code); rel.setFunding(funding); if (StringUtils.isNotBlank(arr[3])) { info.put("fundingId", funderId + "::" + fundingName); } - // @formatter:off - /* - $!esc.evaluate($!info.id) - $!esc.evaluate($!info.code) - $!esc.evaluate($!info.acronym) - $!esc.evaluate($!info.title) - - - - - #if($!info.fundingId) - $!esc.evaluate($!info.fundingId) - #end - - - */ - // @formatter:on - return rel; } return null;