Merge branch 'develop' of code-repo.d4science.org:MaDgIK/uoa-repository-manager-service into develop

This commit is contained in:
Konstantinos Spyrou 2023-01-19 12:15:41 +02:00
commit 0ea91e909d
4 changed files with 12 additions and 5 deletions

View File

@ -274,7 +274,7 @@ public class EmailUtilsImpl implements EmailUtils {
"the compatibility test on " + "[" + repository.getOfficialname() + "]" +
" was successful and the datasource type \"" + repository.getEoscDatasourceType() + "\" will be prepared for aggregation in OpenAIRE." +
"\n\n" +
"Please note that it usually takes about 3-4 weeks until a data source is indexed and its metadata visible on openaire.eu.\n\n" +
"Please note that it usually takes about 3-4 weeks until a data source is indexed and it's metadata visible on openaire.eu.\n\n" +
"Registration identifier in OpenAIRE: " + repository.getNamespaceprefix() +
"\nOfficial Name:" + repository.getOfficialname() +
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
@ -303,7 +303,7 @@ public class EmailUtilsImpl implements EmailUtils {
"the compatibility test on " + "[" + repository.getOfficialname() + "]" +
" was successful and the datasource type \"" + repository.getEoscDatasourceType() + "\" will be prepared for aggregation in OpenAIRE." +
"\n\n" +
"Please note that it usually takes about 3-4 weeks until a data source is indexed and its metadata visible on openaire.eu.\n\n" +
"Please note that it usually takes about 3-4 weeks until a data source is indexed and it's metadata visible on openaire.eu.\n\n" +
"Registration identifier in OpenAIRE: " + repository.getNamespaceprefix() +
"\nOfficial Name:" + repository.getOfficialname() +
"\n\nBase URL: " + repositoryInterface.getBaseurl() +

View File

@ -141,7 +141,7 @@ public class RepositoryServiceImpl implements RepositoryService {
}
httpHeaders = new HttpHeaders();
httpHeaders.setContentType(MediaType.APPLICATION_JSON_UTF8);
httpHeaders.setContentType(MediaType.valueOf(MediaType.APPLICATION_JSON_VALUE));
for (String vocName : vocabularyNames) {
vocabularyMap.put(vocName, vocabularyLoader.getVocabulary(vocName, Locale.ENGLISH, Locale.ROOT));

View File

@ -55,7 +55,7 @@ public class ValidatorServiceImpl implements ValidatorService {
this.validatorServiceLocator = validatorServiceLocator;
}
private Map<String, List<RuleSet>> rulesetMap = new ConcurrentHashMap<String, List<RuleSet>>();
private final Map<String, List<RuleSet>> rulesetMap = new ConcurrentHashMap<String, List<RuleSet>>();
private static final Logger logger = LoggerFactory.getLogger(ValidatorServiceImpl.class);

View File

@ -3,6 +3,7 @@ package eu.dnetlib.repo.manager.service.aai.registry;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.nimbusds.jose.util.StandardCharset;
import eu.dnetlib.repo.manager.domain.dto.Role;
import eu.dnetlib.repo.manager.domain.dto.User;
import eu.dnetlib.repo.manager.service.aai.registry.utils.RegistryUtils;
@ -15,6 +16,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
@ -119,7 +121,12 @@ public class RegistryCalls implements AaiRegistryService {
Map<String, String> params = new HashMap<>();
params.put("coid", coid);
if (name != null) {
params.put("name", URLEncoder.encode(name).toLowerCase());
try {
params.put("name", URLEncoder.encode(name, StandardCharset.UTF_8.name()).toLowerCase());
} catch (UnsupportedEncodingException uee) {
logger.error(uee.getMessage());
return new JsonArray();
}
}
JsonElement response = httpUtils.get("cous.json", params);
return (response != null) ? response.getAsJsonObject().get("Cous").getAsJsonArray() : new JsonArray();