fix dependencies

This commit is contained in:
Michele Artini 2023-05-12 10:56:32 +02:00
commit 4104cfd586
31 changed files with 179 additions and 140 deletions

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId> <artifactId>apps</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId> <artifactId>apps</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId> <artifactId>apps</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId> <artifactId>apps</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId> <artifactId>apps</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
@ -136,7 +136,12 @@
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.3.8</version>
</dependency>
</dependencies>
<build> <build>
<plugins> <plugins>

View File

@ -329,11 +329,17 @@ public class ISClientImpl implements ISClient {
final List<String> res = Lists.newArrayList(); final List<String> res = Lists.newArrayList();
log.debug(String.format("running xquery:\n%s", xquery)); log.debug(String.format("running xquery:\n%s", xquery));
final List<String> list = isLookUpService.quickSearchProfile(xquery); try{
if (list != null) { final List<String> list = isLookUpService.quickSearchProfile(xquery);
res.addAll(list); if (list != null) {
res.addAll(list);
}
log.debug(String.format("query result size: %s", res.size()));
}catch(Exception ex){
log.error(ex.getMessage());
throw new ISLookUpException("");
} }
log.debug(String.format("query result size: %s", res.size()));
return res; return res;
} }

View File

@ -11,7 +11,7 @@ import static eu.dnetlib.openaire.common.ExporterConstants.W;
import java.util.List; import java.util.List;
import eu.dnetlib.openaire.exporter.exceptions.CommunityException; import eu.dnetlib.openaire.exporter.exceptions.CommunityException;
import eu.dnetlib.openaire.exporter.exceptions.CommunityNotFoundException; import eu.dnetlib.openaire.exporter.exceptions.ResourceNotFoundException;
import eu.dnetlib.openaire.exporter.model.community.CommunityContentprovider; import eu.dnetlib.openaire.exporter.model.community.CommunityContentprovider;
import eu.dnetlib.openaire.exporter.model.community.CommunityDetails; import eu.dnetlib.openaire.exporter.model.community.CommunityDetails;
import eu.dnetlib.openaire.exporter.model.community.CommunityOpenAIRECommunities; import eu.dnetlib.openaire.exporter.model.community.CommunityOpenAIRECommunities;
@ -72,7 +72,7 @@ public class CommunityApiController {
@ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "404", description = "not found"),
@ApiResponse(responseCode = "500", description = "unexpected error") @ApiResponse(responseCode = "500", description = "unexpected error")
}) })
public CommunityDetails getCommunity(@PathVariable final String id) throws CommunityException, CommunityNotFoundException { public CommunityDetails getCommunity(@PathVariable final String id) throws CommunityException, ResourceNotFoundException {
return communityApiCore.getCommunity(id); return communityApiCore.getCommunity(id);
} }
@ -89,7 +89,7 @@ public class CommunityApiController {
}) })
public void setCommunity( public void setCommunity(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final CommunityWritableProperties properties) throws CommunityException, CommunityNotFoundException { @RequestBody final CommunityWritableProperties properties) throws CommunityException, ResourceNotFoundException {
communityApiCore.setCommunity(id, properties); communityApiCore.setCommunity(id, properties);
} }
@ -105,7 +105,7 @@ public class CommunityApiController {
@ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "404", description = "not found"),
@ApiResponse(responseCode = "500", description = "unexpected error") @ApiResponse(responseCode = "500", description = "unexpected error")
}) })
public List<CommunityProject> getCommunityProjects(@PathVariable final String id) throws CommunityException, CommunityNotFoundException { public List<CommunityProject> getCommunityProjects(@PathVariable final String id) throws CommunityException, ResourceNotFoundException {
return communityApiCore.getCommunityProjects(id); return communityApiCore.getCommunityProjects(id);
} }
@ -122,7 +122,7 @@ public class CommunityApiController {
}) })
public CommunityProject addCommunityProject( public CommunityProject addCommunityProject(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final CommunityProject project) throws CommunityException, CommunityNotFoundException { @RequestBody final CommunityProject project) throws CommunityException, ResourceNotFoundException {
return communityApiCore.addCommunityProject(id, project); return communityApiCore.addCommunityProject(id, project);
} }
@ -140,7 +140,7 @@ public class CommunityApiController {
}) })
public void deleteCommunityProject( public void deleteCommunityProject(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final Integer projectId) throws CommunityException, CommunityNotFoundException { @RequestBody final Integer projectId) throws CommunityException, ResourceNotFoundException {
communityApiCore.removeCommunityProject(id, projectId); communityApiCore.removeCommunityProject(id, projectId);
} }
@ -159,7 +159,7 @@ public class CommunityApiController {
}) })
public List<CommunityProject> addCommunityProjectList( public List<CommunityProject> addCommunityProjectList(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final List<CommunityProject> projectList) throws CommunityException, CommunityNotFoundException { @RequestBody final List<CommunityProject> projectList) throws CommunityException, ResourceNotFoundException {
return communityApiCore.addCommunityProjectList(id, projectList); return communityApiCore.addCommunityProjectList(id, projectList);
} }
@ -178,7 +178,7 @@ public class CommunityApiController {
}) })
public void deleteCommunityProjectList( public void deleteCommunityProjectList(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final List<Integer> projectIdList) throws CommunityException, CommunityNotFoundException { @RequestBody final List<Integer> projectIdList) throws CommunityException, ResourceNotFoundException {
communityApiCore.removeCommunityProjectList(id, projectIdList); communityApiCore.removeCommunityProjectList(id, projectIdList);
} }
@ -194,7 +194,7 @@ public class CommunityApiController {
@ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "404", description = "not found"),
@ApiResponse(responseCode = "500", description = "unexpected error") @ApiResponse(responseCode = "500", description = "unexpected error")
}) })
public List<CommunityContentprovider> getCommunityContentproviders(@PathVariable final String id) throws CommunityException, CommunityNotFoundException { public List<CommunityContentprovider> getCommunityContentproviders(@PathVariable final String id) throws CommunityException, ResourceNotFoundException {
return communityApiCore.getCommunityContentproviders(id); return communityApiCore.getCommunityContentproviders(id);
} }
@ -211,7 +211,7 @@ public class CommunityApiController {
}) })
public CommunityContentprovider addCommunityContentprovider( public CommunityContentprovider addCommunityContentprovider(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final CommunityContentprovider contentprovider) throws CommunityException, CommunityNotFoundException { @RequestBody final CommunityContentprovider contentprovider) throws CommunityException, ResourceNotFoundException {
return communityApiCore.addCommunityContentprovider(id, contentprovider); return communityApiCore.addCommunityContentprovider(id, contentprovider);
} }
@ -229,7 +229,7 @@ public class CommunityApiController {
}) })
public void removeCommunityContentprovider( public void removeCommunityContentprovider(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final Integer contentproviderId) throws CommunityException, CommunityNotFoundException { @RequestBody final Integer contentproviderId) throws CommunityException, ResourceNotFoundException {
communityApiCore.removeCommunityContentProvider(id, contentproviderId); communityApiCore.removeCommunityContentProvider(id, contentproviderId);
} }
@ -248,7 +248,7 @@ public class CommunityApiController {
}) })
public List<CommunityContentprovider> addCommunityContentProvidersList( public List<CommunityContentprovider> addCommunityContentProvidersList(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final List<CommunityContentprovider> contentprovidersList) throws CommunityException, CommunityNotFoundException { @RequestBody final List<CommunityContentprovider> contentprovidersList) throws CommunityException, ResourceNotFoundException {
return communityApiCore.addCommunityContentProvidersList(id, contentprovidersList); return communityApiCore.addCommunityContentProvidersList(id, contentprovidersList);
} }
@ -267,7 +267,7 @@ public class CommunityApiController {
}) })
public void deleteCommunityContentProvidersList( public void deleteCommunityContentProvidersList(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final List<Integer> contentProviderIdList) throws CommunityException, CommunityNotFoundException { @RequestBody final List<Integer> contentProviderIdList) throws CommunityException, ResourceNotFoundException {
communityApiCore.removeCommunityContentProviderList(id, contentProviderIdList); communityApiCore.removeCommunityContentProviderList(id, contentProviderIdList);
} }
@ -285,7 +285,7 @@ public class CommunityApiController {
@ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "404", description = "not found"),
@ApiResponse(responseCode = "500", description = "unexpected error") @ApiResponse(responseCode = "500", description = "unexpected error")
}) })
public List<CommunityOrganization> getCommunityOrganizations(@PathVariable final String id) throws CommunityException, CommunityNotFoundException { public List<CommunityOrganization> getCommunityOrganizations(@PathVariable final String id) throws CommunityException, ResourceNotFoundException {
return communityApiCore.getCommunityOrganizations(id); return communityApiCore.getCommunityOrganizations(id);
} }
@ -302,7 +302,7 @@ public class CommunityApiController {
}) })
public CommunityOrganization addCommunityOrganization( public CommunityOrganization addCommunityOrganization(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final CommunityOrganization organization) throws CommunityException, CommunityNotFoundException { @RequestBody final CommunityOrganization organization) throws CommunityException, ResourceNotFoundException {
return communityApiCore.addCommunityOrganization(id, organization); return communityApiCore.addCommunityOrganization(id, organization);
} }
@ -320,7 +320,7 @@ public class CommunityApiController {
}) })
public void removeCommunityOrganization( public void removeCommunityOrganization(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final Integer organizationId) throws CommunityException, CommunityNotFoundException { @RequestBody final Integer organizationId) throws CommunityException, ResourceNotFoundException {
communityApiCore.removeCommunityOrganization(id, organizationId); communityApiCore.removeCommunityOrganization(id, organizationId);
} }
@ -339,7 +339,7 @@ public class CommunityApiController {
}) })
public CommunityDetails addCommunitySubjects( public CommunityDetails addCommunitySubjects(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final List<String> subjects) throws CommunityException, CommunityNotFoundException { @RequestBody final List<String> subjects) throws CommunityException, ResourceNotFoundException {
return communityApiCore.addCommunitySubjects(id, subjects); return communityApiCore.addCommunitySubjects(id, subjects);
} }
@ -357,7 +357,7 @@ public class CommunityApiController {
}) })
public CommunityDetails removeCommunitySubjects( public CommunityDetails removeCommunitySubjects(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final List<String> subjects) throws CommunityException, CommunityNotFoundException { @RequestBody final List<String> subjects) throws CommunityException, ResourceNotFoundException {
return communityApiCore.removeCommunitySubjects(id, subjects); return communityApiCore.removeCommunitySubjects(id, subjects);
} }
@ -372,7 +372,7 @@ public class CommunityApiController {
@ApiResponse(responseCode = "500", description = "unexpected error") }) @ApiResponse(responseCode = "500", description = "unexpected error") })
public CommunityDetails addCommunityFOS( public CommunityDetails addCommunityFOS(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final List<String> subjects) throws CommunityException, CommunityNotFoundException { @RequestBody final List<String> subjects) throws CommunityException, ResourceNotFoundException {
return communityApiCore.addCommunityFOS(id, subjects); return communityApiCore.addCommunityFOS(id, subjects);
} }
@ -388,7 +388,7 @@ public class CommunityApiController {
@ApiResponse(responseCode = "500", description = "unexpected error") }) @ApiResponse(responseCode = "500", description = "unexpected error") })
public CommunityDetails removeCommunityFOS( public CommunityDetails removeCommunityFOS(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final List<String> subjects) throws CommunityException, CommunityNotFoundException { @RequestBody final List<String> subjects) throws CommunityException, ResourceNotFoundException {
return communityApiCore.removeCommunityFOS(id, subjects); return communityApiCore.removeCommunityFOS(id, subjects);
} }
@ -405,7 +405,7 @@ public class CommunityApiController {
@ApiResponse(responseCode = "500", description = "unexpected error") }) @ApiResponse(responseCode = "500", description = "unexpected error") })
public CommunityDetails addCommunitySDG( public CommunityDetails addCommunitySDG(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final List<String> subjects) throws CommunityException, CommunityNotFoundException { @RequestBody final List<String> subjects) throws CommunityException, ResourceNotFoundException {
return communityApiCore.addCommunitySDG(id, subjects); return communityApiCore.addCommunitySDG(id, subjects);
} }
@ -421,7 +421,7 @@ public class CommunityApiController {
@ApiResponse(responseCode = "500", description = "unexpected error") }) @ApiResponse(responseCode = "500", description = "unexpected error") })
public CommunityDetails removeCommunitySDG( public CommunityDetails removeCommunitySDG(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final List<String> subjects) throws CommunityException, CommunityNotFoundException { @RequestBody final List<String> subjects) throws CommunityException, ResourceNotFoundException {
return communityApiCore.removeCommunitySDG(id, subjects); return communityApiCore.removeCommunitySDG(id, subjects);
} }
@ -437,7 +437,7 @@ public class CommunityApiController {
@ApiResponse(responseCode = "500", description = "unexpected error") }) @ApiResponse(responseCode = "500", description = "unexpected error") })
public CommunityDetails addAdvancedConstraint( public CommunityDetails addAdvancedConstraint(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final SelectionCriteria advancedConstraint) throws CommunityException, CommunityNotFoundException { @RequestBody final SelectionCriteria advancedConstraint) throws CommunityException, ResourceNotFoundException {
return communityApiCore.addCommunityAdvancedConstraint(id, advancedConstraint); return communityApiCore.addCommunityAdvancedConstraint(id, advancedConstraint);
} }
@ -452,7 +452,7 @@ public class CommunityApiController {
@ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "404", description = "not found"),
@ApiResponse(responseCode = "500", description = "unexpected error") }) @ApiResponse(responseCode = "500", description = "unexpected error") })
public CommunityDetails removeAdvancedConstraint( public CommunityDetails removeAdvancedConstraint(
@PathVariable final String id) throws CommunityException, CommunityNotFoundException { @PathVariable final String id) throws CommunityException, ResourceNotFoundException {
return communityApiCore.removeCommunityAdvancedConstraint(id); return communityApiCore.removeCommunityAdvancedConstraint(id);
} }
@ -468,7 +468,7 @@ public class CommunityApiController {
@ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "404", description = "not found"),
@ApiResponse(responseCode = "500", description = "unexpected error") @ApiResponse(responseCode = "500", description = "unexpected error")
}) })
public List<CommunityZenodoCommunity> getCommunityZenodoCommunities(@PathVariable final String id) throws CommunityException, CommunityNotFoundException { public List<CommunityZenodoCommunity> getCommunityZenodoCommunities(@PathVariable final String id) throws CommunityException, ResourceNotFoundException {
return communityApiCore.getCommunityZenodoCommunities(id); return communityApiCore.getCommunityZenodoCommunities(id);
} }
@ -485,7 +485,7 @@ public class CommunityApiController {
}) })
public CommunityZenodoCommunity addCommunityZenodoCommunity( public CommunityZenodoCommunity addCommunityZenodoCommunity(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final CommunityZenodoCommunity zenodocommunity) throws CommunityException, CommunityNotFoundException { @RequestBody final CommunityZenodoCommunity zenodocommunity) throws CommunityException, ResourceNotFoundException {
return communityApiCore.addCommunityZenodoCommunity(id, zenodocommunity); return communityApiCore.addCommunityZenodoCommunity(id, zenodocommunity);
@ -504,7 +504,7 @@ public class CommunityApiController {
}) })
public void removeCommunityZenodoCommunity( public void removeCommunityZenodoCommunity(
@PathVariable final String id, @PathVariable final String id,
@RequestBody final Integer zenodoCommId) throws CommunityException, CommunityNotFoundException { @RequestBody final Integer zenodoCommId) throws CommunityException, ResourceNotFoundException {
communityApiCore.removeCommunityZenodoCommunity(id, zenodoCommId); communityApiCore.removeCommunityZenodoCommunity(id, zenodoCommId);
@ -522,7 +522,7 @@ public class CommunityApiController {
@ApiResponse(responseCode = "500", description = "unexpected error") @ApiResponse(responseCode = "500", description = "unexpected error")
}) })
public CommunityOpenAIRECommunities getOpenAireCommunities( public CommunityOpenAIRECommunities getOpenAireCommunities(
@PathVariable final String zenodoId) throws CommunityException, CommunityNotFoundException { @PathVariable final String zenodoId) throws CommunityException, ResourceNotFoundException {
return communityApiCore.getOpenAIRECommunities(zenodoId); return communityApiCore.getOpenAIRECommunities(zenodoId);

View File

@ -6,7 +6,7 @@ import java.util.stream.Collectors;
import com.google.gson.Gson; import com.google.gson.Gson;
import eu.dnetlib.openaire.exporter.exceptions.CommunityException; import eu.dnetlib.openaire.exporter.exceptions.CommunityException;
import eu.dnetlib.openaire.exporter.exceptions.CommunityNotFoundException; import eu.dnetlib.openaire.exporter.exceptions.ResourceNotFoundException;
import eu.dnetlib.openaire.exporter.model.community.CommunityContentprovider; import eu.dnetlib.openaire.exporter.model.community.CommunityContentprovider;
import eu.dnetlib.openaire.exporter.model.community.CommunityDetails; import eu.dnetlib.openaire.exporter.model.community.CommunityDetails;
import eu.dnetlib.openaire.exporter.model.community.CommunityOpenAIRECommunities; import eu.dnetlib.openaire.exporter.model.community.CommunityOpenAIRECommunities;
@ -54,19 +54,19 @@ public class CommunityApiCore {// implements CommunityClient{
} }
public CommunityDetails getCommunity(final String id) throws CommunityException, CommunityNotFoundException { public CommunityDetails getCommunity(final String id) throws CommunityException, ResourceNotFoundException {
return cc.getCommunity(id); return cc.getCommunity(id);
} }
private void removeAdvancedConstraint(String id) throws CommunityNotFoundException, CommunityException { private void removeAdvancedConstraint(String id) throws ResourceNotFoundException, CommunityException {
cc.getCommunity(id); cc.getCommunity(id);
isClient.updateContextParam(id, CPROFILE_ADVANCED_CONSTRAINT, "", false); isClient.updateContextParam(id, CPROFILE_ADVANCED_CONSTRAINT, "", false);
cc.removeAdvancedConstraint(id); cc.removeAdvancedConstraint(id);
} }
public void setCommunity(final String id, final CommunityWritableProperties details) throws CommunityException, CommunityNotFoundException { public void setCommunity(final String id, final CommunityWritableProperties details) throws CommunityException, ResourceNotFoundException {
cc.getCommunity(id); // ensure the community exists. cc.getCommunity(id); // ensure the community exists.
@ -113,12 +113,12 @@ public class CommunityApiCore {// implements CommunityClient{
cc.updateCommunity(id, details); cc.updateCommunity(id, details);
} }
public List<CommunityProject> getCommunityProjects(final String id) throws CommunityException, CommunityNotFoundException { public List<CommunityProject> getCommunityProjects(final String id) throws CommunityException, ResourceNotFoundException {
cc.getCommunity(id); // ensure the community exists. cc.getCommunity(id); // ensure the community exists.
return cc.getCommunityInfo(id, PROJECTS_ID_SUFFIX, c -> CommunityMappingUtils.asCommunityProject(id, c)); return cc.getCommunityInfo(id, PROJECTS_ID_SUFFIX, c -> CommunityMappingUtils.asCommunityProject(id, c));
} }
public CommunityProject addCommunityProject(final String id, final CommunityProject project) throws CommunityException, CommunityNotFoundException { public CommunityProject addCommunityProject(final String id, final CommunityProject project) throws CommunityException, ResourceNotFoundException {
if (!StringUtils.equalsIgnoreCase(id, project.getCommunityId())) { if (!StringUtils.equalsIgnoreCase(id, project.getCommunityId())) {
throw new CommunityException("parameters 'id' and project.communityId must be coherent"); throw new CommunityException("parameters 'id' and project.communityId must be coherent");
} }
@ -127,7 +127,7 @@ public class CommunityApiCore {// implements CommunityClient{
} }
private CommunityProject updateProject(String id, CommunityProject project) throws CommunityException, CommunityNotFoundException { private CommunityProject updateProject(String id, CommunityProject project) throws CommunityException, ResourceNotFoundException {
final TreeMap<Integer, CommunityProject> projects = getCommunityProjectMap(id); final TreeMap<Integer, CommunityProject> projects = getCommunityProjectMap(id);
String project_id = project.getId(); String project_id = project.getId();
@ -162,7 +162,7 @@ public class CommunityApiCore {// implements CommunityClient{
return project; return project;
} }
public List<CommunityProject> addCommunityProjectList(final String id, final List<CommunityProject> projectList) throws CommunityException, CommunityNotFoundException { public List<CommunityProject> addCommunityProjectList(final String id, final List<CommunityProject> projectList) throws CommunityException, ResourceNotFoundException {
if(projectList == null || projectList.size() == 0){ if(projectList == null || projectList.size() == 0){
throw new CommunityException("parameter 'projectList' must be present and should contain at least one project"); throw new CommunityException("parameter 'projectList' must be present and should contain at least one project");
} }
@ -184,35 +184,35 @@ public class CommunityApiCore {// implements CommunityClient{
return String.valueOf(id + 1); return String.valueOf(id + 1);
} }
public void removeCommunityProject(final String id, final Integer projectId) throws CommunityException, CommunityNotFoundException { public void removeCommunityProject(final String id, final Integer projectId) throws CommunityException, ResourceNotFoundException {
final Map<Integer, CommunityProject> projects = getCommunityProjectMap(id); final Map<Integer, CommunityProject> projects = getCommunityProjectMap(id);
if (!projects.containsKey(projectId)) { if (!projects.containsKey(projectId)) {
throw new CommunityNotFoundException(String.format("project '%s' doesn't exist within context '%s'", projectId, id)); throw new ResourceNotFoundException(String.format("project '%s' doesn't exist within context '%s'", projectId, id));
} }
isClient.removeConcept(id, id + PROJECTS_ID_SUFFIX, id + PROJECTS_ID_SUFFIX + ID_SEPARATOR + projectId); isClient.removeConcept(id, id + PROJECTS_ID_SUFFIX, id + PROJECTS_ID_SUFFIX + ID_SEPARATOR + projectId);
cc.removeFromCategory(id, PROJECTS_ID_SUFFIX, String.valueOf(projectId)); cc.removeFromCategory(id, PROJECTS_ID_SUFFIX, String.valueOf(projectId));
} }
public void removeCommunityProjectList(final String id, final List<Integer> projectIdList) throws CommunityException, CommunityNotFoundException { public void removeCommunityProjectList(final String id, final List<Integer> projectIdList) throws CommunityException, ResourceNotFoundException {
for(Integer projectId: projectIdList){ for(Integer projectId: projectIdList){
removeCommunityProject(id, projectId); removeCommunityProject(id, projectId);
} }
} }
public List<CommunityContentprovider> getCommunityContentproviders(final String id) throws CommunityException, CommunityNotFoundException { public List<CommunityContentprovider> getCommunityContentproviders(final String id) throws CommunityException, ResourceNotFoundException {
cc.getCommunity(id); // ensure the community exists. cc.getCommunity(id); // ensure the community exists.
return cc.getCommunityInfo(id, CONTENTPROVIDERS_ID_SUFFIX, c -> CommunityMappingUtils.asCommunityDataprovider(id, c)); return cc.getCommunityInfo(id, CONTENTPROVIDERS_ID_SUFFIX, c -> CommunityMappingUtils.asCommunityDataprovider(id, c));
} }
public CommunityContentprovider addCommunityContentprovider(final String id, final CommunityContentprovider cp) public CommunityContentprovider addCommunityContentprovider(final String id, final CommunityContentprovider cp)
throws CommunityException, CommunityNotFoundException { throws CommunityException, ResourceNotFoundException {
log.info("content provider to add " + cp.toString()); log.info("content provider to add " + cp.toString());
if (!StringUtils.equalsIgnoreCase(id, cp.getCommunityId())) { throw new CommunityException("parameters 'id' and cp.communityId must be coherent"); } if (!StringUtils.equalsIgnoreCase(id, cp.getCommunityId())) { throw new CommunityException("parameters 'id' and cp.communityId must be coherent"); }
return updateContentprovider(id, cp); return updateContentprovider(id, cp);
} }
private CommunityContentprovider updateContentprovider(String id, CommunityContentprovider cp) throws CommunityException, CommunityNotFoundException { private CommunityContentprovider updateContentprovider(String id, CommunityContentprovider cp) throws CommunityException, ResourceNotFoundException {
final TreeMap<Integer, CommunityContentprovider> cps = getCommunityContentproviderMap(id); final TreeMap<Integer, CommunityContentprovider> cps = getCommunityContentproviderMap(id);
final String concept_id = cp.getId(); final String concept_id = cp.getId();
if (concept_id != null && cps.keySet().contains(Integer.valueOf(concept_id))) { if (concept_id != null && cps.keySet().contains(Integer.valueOf(concept_id))) {
@ -239,16 +239,16 @@ public class CommunityApiCore {// implements CommunityClient{
return cp; return cp;
} }
public void removeCommunityContentProvider(final String id, final Integer contentproviderId) throws CommunityException, CommunityNotFoundException { public void removeCommunityContentProvider(final String id, final Integer contentproviderId) throws CommunityException, ResourceNotFoundException {
final Map<Integer, CommunityContentprovider> providers = getCommunityContentproviderMap(id); final Map<Integer, CommunityContentprovider> providers = getCommunityContentproviderMap(id);
if (!providers.containsKey(contentproviderId)) { if (!providers.containsKey(contentproviderId)) {
throw new CommunityNotFoundException(String.format("content provider '%s' doesn't exist within context '%s'", contentproviderId, id)); throw new ResourceNotFoundException(String.format("content provider '%s' doesn't exist within context '%s'", contentproviderId, id));
} }
isClient.removeConcept(id, id + CONTENTPROVIDERS_ID_SUFFIX, id + CONTENTPROVIDERS_ID_SUFFIX + ID_SEPARATOR + contentproviderId); isClient.removeConcept(id, id + CONTENTPROVIDERS_ID_SUFFIX, id + CONTENTPROVIDERS_ID_SUFFIX + ID_SEPARATOR + contentproviderId);
cc.removeFromCategory(id, CONTENTPROVIDERS_ID_SUFFIX, String.valueOf(contentproviderId)); cc.removeFromCategory(id, CONTENTPROVIDERS_ID_SUFFIX, String.valueOf(contentproviderId));
} }
public List<CommunityContentprovider> addCommunityContentProvidersList(String id, List<CommunityContentprovider> contentprovidersList) throws CommunityException, CommunityNotFoundException { public List<CommunityContentprovider> addCommunityContentProvidersList(String id, List<CommunityContentprovider> contentprovidersList) throws CommunityException, ResourceNotFoundException {
if(contentprovidersList == null || contentprovidersList.size() == 0){ if(contentprovidersList == null || contentprovidersList.size() == 0){
throw new CommunityException("parameter 'contentprovidersList' must be present and should contain at least one content provider"); throw new CommunityException("parameter 'contentprovidersList' must be present and should contain at least one content provider");
} }
@ -266,32 +266,32 @@ public class CommunityApiCore {// implements CommunityClient{
return contentproviders; return contentproviders;
} }
public void removeCommunityContentProviderList(final String id, final List<Integer> contentProviderIdList) throws CommunityException, CommunityNotFoundException { public void removeCommunityContentProviderList(final String id, final List<Integer> contentProviderIdList) throws CommunityException, ResourceNotFoundException {
for(Integer contentProviderId: contentProviderIdList){ for(Integer contentProviderId: contentProviderIdList){
removeCommunityContentProvider(id, contentProviderId); removeCommunityContentProvider(id, contentProviderId);
} }
} }
public void removeCommunityOrganization(final String id, final Integer organizationId) throws CommunityException, CommunityNotFoundException { public void removeCommunityOrganization(final String id, final Integer organizationId) throws CommunityException, ResourceNotFoundException {
final Map<Integer, CommunityOrganization> organizations = getCommunityOrganizationMap(id); final Map<Integer, CommunityOrganization> organizations = getCommunityOrganizationMap(id);
if (!organizations.containsKey(organizationId)) { if (!organizations.containsKey(organizationId)) {
throw new CommunityNotFoundException(String.format("organization '%s' doesn't exist within context '%s'", organizationId, id)); throw new ResourceNotFoundException(String.format("organization '%s' doesn't exist within context '%s'", organizationId, id));
} }
isClient.removeConcept(id, id + ORGANIZATION_ID_SUFFIX, id + ORGANIZATION_ID_SUFFIX + ID_SEPARATOR + organizationId); isClient.removeConcept(id, id + ORGANIZATION_ID_SUFFIX, id + ORGANIZATION_ID_SUFFIX + ID_SEPARATOR + organizationId);
cc.removeFromCategory(id, ORGANIZATION_ID_SUFFIX, String.valueOf(organizationId)); cc.removeFromCategory(id, ORGANIZATION_ID_SUFFIX, String.valueOf(organizationId));
} }
public List<CommunityZenodoCommunity> getCommunityZenodoCommunities(final String id) throws CommunityException, CommunityNotFoundException { public List<CommunityZenodoCommunity> getCommunityZenodoCommunities(final String id) throws CommunityException, ResourceNotFoundException {
return cc.getCommunityZenodoCommunities(id); return cc.getCommunityZenodoCommunities(id);
} }
public List<CommunityOrganization> getCommunityOrganizations(final String id) throws CommunityException, CommunityNotFoundException { public List<CommunityOrganization> getCommunityOrganizations(final String id) throws CommunityException, ResourceNotFoundException {
cc.getCommunity(id); cc.getCommunity(id);
return cc.getCommunityInfo(id, ORGANIZATION_ID_SUFFIX, c -> CommunityMappingUtils.asCommunityOrganization(id, c)); return cc.getCommunityInfo(id, ORGANIZATION_ID_SUFFIX, c -> CommunityMappingUtils.asCommunityOrganization(id, c));
} }
public CommunityDetails addCommunitySubjects(final String id, final List<String> subjects) throws CommunityException, CommunityNotFoundException { public CommunityDetails addCommunitySubjects(final String id, final List<String> subjects) throws CommunityException, ResourceNotFoundException {
final CommunityDetails cd = new CommunityDetails(); final CommunityDetails cd = new CommunityDetails();
@ -306,7 +306,7 @@ public class CommunityApiCore {// implements CommunityClient{
return cd; return cd;
} }
public CommunityDetails removeCommunitySubjects(final String id, final List<String> subjects) throws CommunityException, CommunityNotFoundException { public CommunityDetails removeCommunitySubjects(final String id, final List<String> subjects) throws CommunityException, ResourceNotFoundException {
final CommunityDetails cd = new CommunityDetails(); final CommunityDetails cd = new CommunityDetails();
@ -321,7 +321,7 @@ public class CommunityApiCore {// implements CommunityClient{
return cd; return cd;
} }
public CommunityDetails addCommunityFOS(final String id, final List<String> foss) throws CommunityException, CommunityNotFoundException { public CommunityDetails addCommunityFOS(final String id, final List<String> foss) throws CommunityException, ResourceNotFoundException {
final CommunityDetails cd = new CommunityDetails(); final CommunityDetails cd = new CommunityDetails();
@ -339,7 +339,7 @@ public class CommunityApiCore {// implements CommunityClient{
return cd; return cd;
} }
public CommunityDetails removeCommunityFOS(final String id, final List<String> foss) throws CommunityException, CommunityNotFoundException { public CommunityDetails removeCommunityFOS(final String id, final List<String> foss) throws CommunityException, ResourceNotFoundException {
final CommunityDetails cd = new CommunityDetails(); final CommunityDetails cd = new CommunityDetails();
@ -354,7 +354,7 @@ public class CommunityApiCore {// implements CommunityClient{
return cd; return cd;
} }
public CommunityDetails addCommunitySDG(final String id, final List<String> sdgs) throws CommunityException, CommunityNotFoundException { public CommunityDetails addCommunitySDG(final String id, final List<String> sdgs) throws CommunityException, ResourceNotFoundException {
final CommunityDetails cd = new CommunityDetails(); final CommunityDetails cd = new CommunityDetails();
final Set<String> current = Sets.newHashSet(); final Set<String> current = Sets.newHashSet();
@ -371,7 +371,7 @@ public class CommunityApiCore {// implements CommunityClient{
return cd; return cd;
} }
public CommunityDetails removeCommunitySDG(final String id, final List<String> sdgs) throws CommunityException, CommunityNotFoundException { public CommunityDetails removeCommunitySDG(final String id, final List<String> sdgs) throws CommunityException, ResourceNotFoundException {
final CommunityDetails cd = new CommunityDetails(); final CommunityDetails cd = new CommunityDetails();
@ -386,7 +386,7 @@ public class CommunityApiCore {// implements CommunityClient{
return cd; return cd;
} }
public CommunityDetails addCommunityAdvancedConstraint(final String id, final SelectionCriteria advancedCosntraint) throws CommunityException, CommunityNotFoundException { public CommunityDetails addCommunityAdvancedConstraint(final String id, final SelectionCriteria advancedCosntraint) throws CommunityException, ResourceNotFoundException {
final CommunityDetails cd = new CommunityDetails(); final CommunityDetails cd = new CommunityDetails();
@ -397,7 +397,7 @@ public class CommunityApiCore {// implements CommunityClient{
return cd; return cd;
} }
public CommunityDetails removeCommunityAdvancedConstraint(final String id) throws CommunityNotFoundException, CommunityException { public CommunityDetails removeCommunityAdvancedConstraint(final String id) throws ResourceNotFoundException, CommunityException {
removeAdvancedConstraint(id); removeAdvancedConstraint(id);
@ -407,11 +407,11 @@ public class CommunityApiCore {// implements CommunityClient{
@CacheEvict(value = "community-cache", allEntries = true) @CacheEvict(value = "community-cache", allEntries = true)
public void removeCommunityZenodoCommunity(final String id, final Integer zenodoCommId) throws CommunityException, CommunityNotFoundException { public void removeCommunityZenodoCommunity(final String id, final Integer zenodoCommId) throws CommunityException, ResourceNotFoundException {
final Map<Integer, CommunityZenodoCommunity> zcomms = getZenodoCommunityMap(id); final Map<Integer, CommunityZenodoCommunity> zcomms = getZenodoCommunityMap(id);
if (!zcomms.containsKey(zenodoCommId)) { if (!zcomms.containsKey(zenodoCommId)) {
throw new CommunityNotFoundException(String.format("Zenodo community '%s' doesn't exist within context '%s'", zenodoCommId, id)); throw new ResourceNotFoundException(String.format("Zenodo community '%s' doesn't exist within context '%s'", zenodoCommId, id));
} }
isClient.removeConcept(id, id + ZENODOCOMMUNITY_ID_SUFFIX, id + ZENODOCOMMUNITY_ID_SUFFIX + ID_SEPARATOR + zenodoCommId); isClient.removeConcept(id, id + ZENODOCOMMUNITY_ID_SUFFIX, id + ZENODOCOMMUNITY_ID_SUFFIX + ID_SEPARATOR + zenodoCommId);
@ -421,7 +421,7 @@ public class CommunityApiCore {// implements CommunityClient{
@CacheEvict(value = "community-cache", allEntries = true) @CacheEvict(value = "community-cache", allEntries = true)
public CommunityZenodoCommunity addCommunityZenodoCommunity(final String id, final CommunityZenodoCommunity zc) public CommunityZenodoCommunity addCommunityZenodoCommunity(final String id, final CommunityZenodoCommunity zc)
throws CommunityException, CommunityNotFoundException { throws CommunityException, ResourceNotFoundException {
if (!StringUtils.equalsIgnoreCase(id, zc.getCommunityId())) { throw new CommunityException("parameters 'id' and zc.communityId must be coherent"); } if (!StringUtils.equalsIgnoreCase(id, zc.getCommunityId())) { throw new CommunityException("parameters 'id' and zc.communityId must be coherent"); }
if (!StringUtils.isNotBlank(zc.getZenodoid())) { throw new CommunityException("parameter zenodoid cannot be null or empty"); } if (!StringUtils.isNotBlank(zc.getZenodoid())) { throw new CommunityException("parameter zenodoid cannot be null or empty"); }
final TreeMap<Integer, CommunityZenodoCommunity> zcs = getZenodoCommunityMap(id); final TreeMap<Integer, CommunityZenodoCommunity> zcs = getZenodoCommunityMap(id);
@ -438,7 +438,7 @@ public class CommunityApiCore {// implements CommunityClient{
return zc; return zc;
} }
public CommunityOpenAIRECommunities getOpenAIRECommunities(final String zenodoId) throws CommunityException, CommunityNotFoundException { public CommunityOpenAIRECommunities getOpenAIRECommunities(final String zenodoId) throws CommunityException, ResourceNotFoundException {
if (cci.getInverseZenodoCommunityMap().containsKey(zenodoId)) { if (cci.getInverseZenodoCommunityMap().containsKey(zenodoId)) {
return new CommunityOpenAIRECommunities().setZenodoid(zenodoId) return new CommunityOpenAIRECommunities().setZenodoid(zenodoId)
@ -450,7 +450,7 @@ public class CommunityApiCore {// implements CommunityClient{
// HELPERS // HELPERS
private TreeMap<Integer, CommunityProject> getCommunityProjectMap(final String id) throws CommunityException, CommunityNotFoundException { private TreeMap<Integer, CommunityProject> getCommunityProjectMap(final String id) throws CommunityException, ResourceNotFoundException {
return getCommunityProjects(id).stream() return getCommunityProjects(id).stream()
.collect(Collectors.toMap(p -> Integer.valueOf(p.getId()), Functions.identity(), (p1, p2) -> { .collect(Collectors.toMap(p -> Integer.valueOf(p.getId()), Functions.identity(), (p1, p2) -> {
log.warn(String.format("duplicate project found: '%s'", p1.getId())); log.warn(String.format("duplicate project found: '%s'", p1.getId()));
@ -458,7 +458,7 @@ public class CommunityApiCore {// implements CommunityClient{
}, TreeMap::new)); }, TreeMap::new));
} }
private TreeMap<Integer, CommunityContentprovider> getCommunityContentproviderMap(final String id) throws CommunityException, CommunityNotFoundException { private TreeMap<Integer, CommunityContentprovider> getCommunityContentproviderMap(final String id) throws CommunityException, ResourceNotFoundException {
log.info("getting community content provider map"); log.info("getting community content provider map");
return getCommunityContentproviders(id).stream() return getCommunityContentproviders(id).stream()
.collect(Collectors.toMap(cp -> Integer.valueOf(cp.getId()), Functions.identity(), (cp1, cp2) -> { .collect(Collectors.toMap(cp -> Integer.valueOf(cp.getId()), Functions.identity(), (cp1, cp2) -> {
@ -467,7 +467,7 @@ public class CommunityApiCore {// implements CommunityClient{
}, TreeMap::new)); }, TreeMap::new));
} }
private TreeMap<Integer, CommunityZenodoCommunity> getZenodoCommunityMap(final String id) throws CommunityException, CommunityNotFoundException { private TreeMap<Integer, CommunityZenodoCommunity> getZenodoCommunityMap(final String id) throws CommunityException, ResourceNotFoundException {
return getCommunityZenodoCommunities(id).stream() return getCommunityZenodoCommunities(id).stream()
.collect(Collectors.toMap(cp -> Integer.valueOf(cp.getId()), Functions.identity(), (cp1, cp2) -> { .collect(Collectors.toMap(cp -> Integer.valueOf(cp.getId()), Functions.identity(), (cp1, cp2) -> {
log.warn(String.format("duplicate Zenodo community found: '%s'", cp1.getId())); log.warn(String.format("duplicate Zenodo community found: '%s'", cp1.getId()));
@ -475,7 +475,7 @@ public class CommunityApiCore {// implements CommunityClient{
}, TreeMap::new)); }, TreeMap::new));
} }
private TreeMap<Integer, CommunityOrganization> getCommunityOrganizationMap(final String id) throws CommunityException, CommunityNotFoundException { private TreeMap<Integer, CommunityOrganization> getCommunityOrganizationMap(final String id) throws CommunityException, ResourceNotFoundException {
return getCommunityOrganizations(id).stream() return getCommunityOrganizations(id).stream()
.collect(Collectors.toMap(o -> Integer.valueOf(o.getId()), Functions.identity(), (o1, o2) -> { .collect(Collectors.toMap(o -> Integer.valueOf(o.getId()), Functions.identity(), (o1, o2) -> {
log.warn(String.format("duplicate content provider found: '%s'", o1.getId())); log.warn(String.format("duplicate content provider found: '%s'", o1.getId()));
@ -484,7 +484,7 @@ public class CommunityApiCore {// implements CommunityClient{
} }
public CommunityOrganization addCommunityOrganization(final String id, final CommunityOrganization organization) public CommunityOrganization addCommunityOrganization(final String id, final CommunityOrganization organization)
throws CommunityException, CommunityNotFoundException { throws CommunityException, ResourceNotFoundException {
if (!StringUtils.equalsIgnoreCase(id, organization.getCommunityId())) { if (!StringUtils.equalsIgnoreCase(id, organization.getCommunityId())) {
throw new CommunityException("parameters 'id' and organization.communityId must be coherent"); throw new CommunityException("parameters 'id' and organization.communityId must be coherent");
} }

View File

@ -4,11 +4,11 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import eu.dnetlib.openaire.exporter.exceptions.CommunityException; import eu.dnetlib.openaire.exporter.exceptions.CommunityException;
import eu.dnetlib.openaire.exporter.exceptions.CommunityNotFoundException; import eu.dnetlib.openaire.exporter.exceptions.ResourceNotFoundException;
public interface CommunityClient { public interface CommunityClient {
Map<String, Set<String>> getInverseZenodoCommunityMap() throws CommunityException, CommunityNotFoundException; Map<String, Set<String>> getInverseZenodoCommunityMap() throws CommunityException, ResourceNotFoundException;
void dropCache(); void dropCache();

View File

@ -9,7 +9,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import eu.dnetlib.openaire.exporter.exceptions.CommunityException; import eu.dnetlib.openaire.exporter.exceptions.CommunityException;
import eu.dnetlib.openaire.exporter.exceptions.CommunityNotFoundException; import eu.dnetlib.openaire.exporter.exceptions.ResourceNotFoundException;
import eu.dnetlib.openaire.exporter.model.community.CommunitySummary; import eu.dnetlib.openaire.exporter.model.community.CommunitySummary;
import eu.dnetlib.openaire.exporter.model.community.CommunityZenodoCommunity; import eu.dnetlib.openaire.exporter.model.community.CommunityZenodoCommunity;
@ -25,7 +25,7 @@ public class CommunityClientImpl implements CommunityClient {
@Override @Override
@Cacheable("community-cache") @Cacheable("community-cache")
public Map<String, Set<String>> getInverseZenodoCommunityMap () throws CommunityException, CommunityNotFoundException { public Map<String, Set<String>> getInverseZenodoCommunityMap () throws CommunityException, ResourceNotFoundException {
log.info("Creating the data structure. Not using cache"); log.info("Creating the data structure. Not using cache");
final Map<String, Set<String>> inverseListMap = new HashMap<>(); final Map<String, Set<String>> inverseListMap = new HashMap<>();

View File

@ -5,7 +5,7 @@ import com.google.common.collect.Lists;
import com.google.gson.Gson; import com.google.gson.Gson;
import eu.dnetlib.openaire.common.ISClient; import eu.dnetlib.openaire.common.ISClient;
import eu.dnetlib.openaire.exporter.exceptions.CommunityException; import eu.dnetlib.openaire.exporter.exceptions.CommunityException;
import eu.dnetlib.openaire.exporter.exceptions.CommunityNotFoundException; import eu.dnetlib.openaire.exporter.exceptions.ResourceNotFoundException;
import eu.dnetlib.openaire.exporter.model.community.CommunityContentprovider; import eu.dnetlib.openaire.exporter.model.community.CommunityContentprovider;
import eu.dnetlib.openaire.exporter.model.community.CommunityDetails; import eu.dnetlib.openaire.exporter.model.community.CommunityDetails;
import eu.dnetlib.openaire.exporter.model.community.CommunityOrganization; import eu.dnetlib.openaire.exporter.model.community.CommunityOrganization;
@ -28,6 +28,7 @@ import java.util.stream.Collectors;
import static eu.dnetlib.openaire.community.CommunityConstants.*; import static eu.dnetlib.openaire.community.CommunityConstants.*;
@Component @Component
public class CommunityCommon { public class CommunityCommon {
@ -65,15 +66,16 @@ public class CommunityCommon {
return Lists.newArrayList(); return Lists.newArrayList();
} }
public CommunityDetails getCommunity(final String id) throws CommunityException, CommunityNotFoundException { public CommunityDetails getCommunity(final String id) throws CommunityException, ResourceNotFoundException {
final Context context = getContextMap().get(id); final Context context = getContextMap().get(id);
if (context == null || CommunityConstants.communityBlackList.contains(id)) { if (context == null || CommunityConstants.communityBlackList.contains(id)) {
throw new CommunityNotFoundException(String.format("community '%s' does not exist", id)); //ResponseStatusException(NOT_FOUND, "Unable to find resource");
throw new ResourceNotFoundException();
} }
return CommunityMappingUtils.asCommunityProfile(context); return CommunityMappingUtils.asCommunityProfile(context);
} }
public List<CommunityZenodoCommunity> getCommunityZenodoCommunities(final String id) throws CommunityException, CommunityNotFoundException { public List<CommunityZenodoCommunity> getCommunityZenodoCommunities(final String id) throws CommunityException, ResourceNotFoundException {
getCommunity(id); // ensure the community exists. getCommunity(id); // ensure the community exists.
return getCommunityInfo(id, ZENODOCOMMUNITY_ID_SUFFIX, c -> CommunityMappingUtils.asCommunityZenodoCommunity(id, c)); return getCommunityInfo(id, ZENODOCOMMUNITY_ID_SUFFIX, c -> CommunityMappingUtils.asCommunityZenodoCommunity(id, c));
} }

View File

@ -1,7 +1,12 @@
services.is.host = localhost #services.is.host = localhost
services.is.port = 8280 services.is.host = dev-openaire.d4science.org
services.is.protocol = http #services.is.port = 8280
services.is.context = app services.is.port = 443
#services.is.protocol = http
services.is.protocol = https
#services.is.context = app
services.is.context = is
#services.is.baseurl = ${services.is.protocol}://${services.is.host}:${services.is.port}/${services.is.context}/services
services.is.baseurl = ${services.is.protocol}://${services.is.host}:${services.is.port}/${services.is.context}/services services.is.baseurl = ${services.is.protocol}://${services.is.host}:${services.is.port}/${services.is.context}/services
openaire.exporter.isLookupUrl = ${services.is.baseurl}/isLookUp openaire.exporter.isLookupUrl = ${services.is.baseurl}/isLookUp
@ -15,7 +20,7 @@ openaire.exporter.cxfClientConnectTimeout = 60000
openaire.exporter.cxfClientReceiveTimeout = 120000 openaire.exporter.cxfClientReceiveTimeout = 120000
# JDBC # JDBC
#openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dnet_openaireplus #openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dnet_openaire
openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dev_openaire_8280 openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dev_openaire_8280
openaire.exporter.jdbc.user = dnetapi openaire.exporter.jdbc.user = dnetapi
openaire.exporter.jdbc.pwd = dnetPwd openaire.exporter.jdbc.pwd = dnetPwd
@ -46,9 +51,10 @@ openaire.exporter.findObjectStore = /eu/dnetlib/openaire/xquery/find
openaire.exporter.findFunderContexts = /eu/dnetlib/openaire/xquery/findFunderContexts.xquery openaire.exporter.findFunderContexts = /eu/dnetlib/openaire/xquery/findFunderContexts.xquery
openaire.exporter.findCommunityContexts = /eu/dnetlib/openaire/xquery/findCommunityContexts.xquery openaire.exporter.findCommunityContexts = /eu/dnetlib/openaire/xquery/findCommunityContexts.xquery
openaire.exporter.findContextProfiles = /eu/dnetlib/openaire/xquery/findContextProfiles.xquery openaire.exporter.findContextProfiles = /eu/dnetlib/openaire/xquery/findContextProfiles.xquery
openaire.exporter.findContextProfilesByType = /eu/dnetlib/openaire/xquery/findContextProfilesByType.xquery
openaire.exporter.getRepoProfile = /eu/dnetlib/openaire/xquery/getRepoProfile.xquery openaire.exporter.getRepoProfile = /eu/dnetlib/openaire/xquery/getRepoProfile.xquery
openaire.exporter.contentLoadQuery = { "$and" : [ { "system:profileName" : "Graph construction [PROD]" }, { "system:isCompletedSuccessfully" : "true" }, { "reuseContent" : "false" } ] }
# REST API CONFIGURATION # REST API CONFIGURATION
openaire.exporter.swaggerDsm.apiTitle = OpenAIRE aggregator REST API openaire.exporter.swaggerDsm.apiTitle = OpenAIRE aggregator REST API
openaire.exporter.swaggerDsm.apiDescription = The OpenAIRE data provision REST API allows developers to access the metadata information space of OpenAIRE programmatically. openaire.exporter.swaggerDsm.apiDescription = The OpenAIRE data provision REST API allows developers to access the metadata information space of OpenAIRE programmatically.
@ -101,4 +107,4 @@ openaire.exporter.swaggerInfo.apiContactEmail = ${openaire.exporter.swaggerD
# VOCABULARIES # VOCABULARIES
openaire.exporter.vocabularies.baseUrl = http://localhost:8980/provision/mvc/vocabularies openaire.exporter.vocabularies.baseUrl = http://localhost:8980/provision/mvc/vocabularies
openaire.exporter.vocabularies.countriesEndpoint = ${openaire.exporter.vocabularies.baseUrl}/dnet:countries.json openaire.exporter.vocabularies.countriesEndpoint = ${openaire.exporter.vocabularies.baseUrl}/dnet:countries.json
openaire.exporter.vocabularies.datasourceTypologiesEndpoint = ${openaire.exporter.vocabularies.baseUrl}/dnet:eosc_datasource_types.json openaire.exporter.vocabularies.datasourceTypologiesEndpoint = ${openaire.exporter.vocabularies.baseUrl}/dnet:datasource_typologies.json

View File

@ -1,12 +1,7 @@
#services.is.host = localhost services.is.host = localhost
services.is.host = dev-openaire.d4science.org services.is.port = 8280
#services.is.port = 8280 services.is.protocol = http
services.is.port = 443 services.is.context = app
#services.is.protocol = http
services.is.protocol = https
#services.is.context = app
services.is.context = is
#services.is.baseurl = ${services.is.protocol}://${services.is.host}:${services.is.port}/${services.is.context}/services
services.is.baseurl = ${services.is.protocol}://${services.is.host}:${services.is.port}/${services.is.context}/services services.is.baseurl = ${services.is.protocol}://${services.is.host}:${services.is.port}/${services.is.context}/services
openaire.exporter.isLookupUrl = ${services.is.baseurl}/isLookUp openaire.exporter.isLookupUrl = ${services.is.baseurl}/isLookUp
@ -20,7 +15,7 @@ openaire.exporter.cxfClientConnectTimeout = 60000
openaire.exporter.cxfClientReceiveTimeout = 120000 openaire.exporter.cxfClientReceiveTimeout = 120000
# JDBC # JDBC
#openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dnet_openaire #openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dnet_openaireplus
openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dev_openaire_8280 openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dev_openaire_8280
openaire.exporter.jdbc.user = dnetapi openaire.exporter.jdbc.user = dnetapi
openaire.exporter.jdbc.pwd = dnetPwd openaire.exporter.jdbc.pwd = dnetPwd
@ -51,10 +46,9 @@ openaire.exporter.findObjectStore = /eu/dnetlib/openaire/xquery/find
openaire.exporter.findFunderContexts = /eu/dnetlib/openaire/xquery/findFunderContexts.xquery openaire.exporter.findFunderContexts = /eu/dnetlib/openaire/xquery/findFunderContexts.xquery
openaire.exporter.findCommunityContexts = /eu/dnetlib/openaire/xquery/findCommunityContexts.xquery openaire.exporter.findCommunityContexts = /eu/dnetlib/openaire/xquery/findCommunityContexts.xquery
openaire.exporter.findContextProfiles = /eu/dnetlib/openaire/xquery/findContextProfiles.xquery openaire.exporter.findContextProfiles = /eu/dnetlib/openaire/xquery/findContextProfiles.xquery
openaire.exporter.findContextProfilesByType = /eu/dnetlib/openaire/xquery/findContextProfilesByType.xquery
openaire.exporter.getRepoProfile = /eu/dnetlib/openaire/xquery/getRepoProfile.xquery openaire.exporter.getRepoProfile = /eu/dnetlib/openaire/xquery/getRepoProfile.xquery
openaire.exporter.contentLoadQuery = { "$and" : [ { "system:profileName" : "Graph construction [PROD]" }, { "system:isCompletedSuccessfully" : "true" }, { "reuseContent" : "false" } ] }
# REST API CONFIGURATION # REST API CONFIGURATION
openaire.exporter.swaggerDsm.apiTitle = OpenAIRE aggregator REST API openaire.exporter.swaggerDsm.apiTitle = OpenAIRE aggregator REST API
openaire.exporter.swaggerDsm.apiDescription = The OpenAIRE data provision REST API allows developers to access the metadata information space of OpenAIRE programmatically. openaire.exporter.swaggerDsm.apiDescription = The OpenAIRE data provision REST API allows developers to access the metadata information space of OpenAIRE programmatically.
@ -107,4 +101,4 @@ openaire.exporter.swaggerInfo.apiContactEmail = ${openaire.exporter.swaggerD
# VOCABULARIES # VOCABULARIES
openaire.exporter.vocabularies.baseUrl = http://localhost:8980/provision/mvc/vocabularies openaire.exporter.vocabularies.baseUrl = http://localhost:8980/provision/mvc/vocabularies
openaire.exporter.vocabularies.countriesEndpoint = ${openaire.exporter.vocabularies.baseUrl}/dnet:countries.json openaire.exporter.vocabularies.countriesEndpoint = ${openaire.exporter.vocabularies.baseUrl}/dnet:countries.json
openaire.exporter.vocabularies.datasourceTypologiesEndpoint = ${openaire.exporter.vocabularies.baseUrl}/dnet:datasource_typologies.json openaire.exporter.vocabularies.datasourceTypologiesEndpoint = ${openaire.exporter.vocabularies.baseUrl}/dnet:eosc_datasource_types.json

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId> <artifactId>apps</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId> <artifactId>apps</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>dnet-applications</artifactId> <artifactId>dnet-applications</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId> <artifactId>apps</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>cmd-line-apps</artifactId> <artifactId>cmd-line-apps</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>dnet-applications</artifactId> <artifactId>dnet-applications</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>libs</artifactId> <artifactId>libs</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>libs</artifactId> <artifactId>libs</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>libs</artifactId> <artifactId>libs</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
@ -17,6 +17,12 @@
<artifactId>dnet-is-services</artifactId> <artifactId>dnet-is-services</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dnet-apps-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency> <dependency>
<groupId>commons-codec</groupId> <groupId>commons-codec</groupId>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>libs</artifactId> <artifactId>libs</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -1,18 +0,0 @@
package eu.dnetlib.openaire.exporter.exceptions;
public class CommunityNotFoundException extends Exception {
/**
*
*/
private static final long serialVersionUID = -5605421323034135778L;
public CommunityNotFoundException(final String msg) {
super(msg);
}
public CommunityNotFoundException(final Exception e) {
super(e);
}
}

View File

@ -0,0 +1,24 @@
package eu.dnetlib.openaire.exporter.exceptions;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.NOT_FOUND)
public class ResourceNotFoundException extends RuntimeException {
/**
*
*/
private static final long serialVersionUID = -5605421323034135778L;
public ResourceNotFoundException(final String msg) {
super(msg);
}
public ResourceNotFoundException(final Exception e) {
super(e);
}
public ResourceNotFoundException(){super();}
}

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>libs</artifactId> <artifactId>libs</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -3,8 +3,8 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId> <artifactId>libs</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
@ -30,6 +30,20 @@
<artifactId>spring-boot-starter-thymeleaf</artifactId> <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency> </dependency>
<!-- Mail -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
<!-- Swagger -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<scope>provided</scope>
</dependency>
<!-- Tests --> <!-- Tests -->
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>libs</artifactId> <artifactId>libs</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>libs</artifactId> <artifactId>libs</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>dnet-applications</artifactId> <artifactId>dnet-applications</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>dnet-applications</artifactId> <artifactId>dnet-applications</artifactId>
<version>3.4.2-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<licenses> <licenses>