develop #1

Merged
antonis.lempesis merged 36 commits from develop into master 2023-01-19 12:41:45 +01:00
4 changed files with 12 additions and 5 deletions
Showing only changes of commit df14f5eaab - Show all commits

View File

@ -274,7 +274,7 @@ public class EmailUtilsImpl implements EmailUtils {
"the compatibility test on " + "[" + repository.getOfficialname() + "]" + "the compatibility test on " + "[" + repository.getOfficialname() + "]" +
" was successful and the datasource type \"" + repository.getEoscDatasourceType() + "\" will be prepared for aggregation in OpenAIRE." + " was successful and the datasource type \"" + repository.getEoscDatasourceType() + "\" will be prepared for aggregation in OpenAIRE." +
"\n\n" + "\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() + "Registration identifier in OpenAIRE: " + repository.getNamespaceprefix() +
"\nOfficial Name:" + repository.getOfficialname() + "\nOfficial Name:" + repository.getOfficialname() +
"\n\nBase URL: " + repositoryInterface.getBaseurl() + "\n\nBase URL: " + repositoryInterface.getBaseurl() +
@ -303,7 +303,7 @@ public class EmailUtilsImpl implements EmailUtils {
"the compatibility test on " + "[" + repository.getOfficialname() + "]" + "the compatibility test on " + "[" + repository.getOfficialname() + "]" +
" was successful and the datasource type \"" + repository.getEoscDatasourceType() + "\" will be prepared for aggregation in OpenAIRE." + " was successful and the datasource type \"" + repository.getEoscDatasourceType() + "\" will be prepared for aggregation in OpenAIRE." +
"\n\n" + "\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() + "Registration identifier in OpenAIRE: " + repository.getNamespaceprefix() +
"\nOfficial Name:" + repository.getOfficialname() + "\nOfficial Name:" + repository.getOfficialname() +
"\n\nBase URL: " + repositoryInterface.getBaseurl() + "\n\nBase URL: " + repositoryInterface.getBaseurl() +

View File

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

View File

@ -55,7 +55,7 @@ public class ValidatorServiceImpl implements ValidatorService {
this.validatorServiceLocator = validatorServiceLocator; 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); 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.JsonArray;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; 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.Role;
import eu.dnetlib.repo.manager.domain.dto.User; import eu.dnetlib.repo.manager.domain.dto.User;
import eu.dnetlib.repo.manager.service.aai.registry.utils.RegistryUtils; 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.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@ -119,7 +121,12 @@ public class RegistryCalls implements AaiRegistryService {
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
params.put("coid", coid); params.put("coid", coid);
if (name != null) { 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); JsonElement response = httpUtils.get("cous.json", params);
return (response != null) ? response.getAsJsonObject().get("Cous").getAsJsonArray() : new JsonArray(); return (response != null) ? response.getAsJsonObject().get("Cous").getAsJsonArray() : new JsonArray();