deposition field management

This commit is contained in:
Michele Artini 2024-02-27 10:36:55 +01:00
parent a623c7be39
commit b79677475b
7 changed files with 259 additions and 326 deletions

View File

@ -18,10 +18,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@ -53,9 +54,7 @@ public class CommunityApiController extends AbstractExporterController {
@Autowired
private CommunityService communityService;
@RequestMapping(value = "/community/communities", produces = {
"application/json"
}, method = RequestMethod.GET)
@GetMapping("/community/communities")
@Operation(summary = "get all community profiles", description = "get all community profiles", tags = {
C, R
})
@ -73,9 +72,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/")
@Operation(summary = "add a new community profile", description = "add a new community profile", tags = {
C, W
})
@ -94,9 +91,10 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}", produces = {
"application/json"
}, method = RequestMethod.GET)
@GetMapping("/community/{id}"
)
@Operation(summary = "get community profile", description = "get community profile", tags = {
C, R
})
@ -115,9 +113,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/{id}")
@Operation(summary = "update community details", description = "update community details", tags = {
C, W
})
@ -138,9 +134,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}", produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping("/community/{id}")
@Operation(summary = "delete a community", description = "delete a community", tags = {
C, W
})
@ -160,9 +154,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/projects/{page}/{size}", produces = {
"application/json"
}, method = RequestMethod.GET)
@GetMapping("/community/{id}/projects/{page}/{size}")
@Operation(summary = "get community projects", description = "get community projects", tags = {
C_PJ, R
})
@ -187,9 +179,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/projects", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/{id}/projects")
@Operation(summary = "associate a project to the community", description = "associate a project to the community", tags = {
C_PJ, W
})
@ -211,9 +201,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/projects", produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping("/community/{id}/projects")
@Operation(summary = "remove a project from the community", description = "remove a project from the community", tags = {
C_PJ, W
})
@ -234,9 +222,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/projectList", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/{id}/projectList")
@Operation(summary = "associate a list of project to the community", description = "associate a list of project to the community", tags = {
C_PJ, W
})
@ -258,9 +244,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/projectList", produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping("/community/{id}/projectList")
@Operation(summary = "remove a list of projects from the community", description = "remove a list of projects from the community", tags = {
C_PJ, W
})
@ -281,9 +265,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/funders", produces = {
"application/json"
}, method = RequestMethod.GET)
@GetMapping("/community/{id}/funders")
@Operation(summary = "get the funders of the projects of a community", description = "get the funders of the projects of a community", tags = {
C_PJ, R
})
@ -303,11 +285,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = {
"/community/{id}/contentproviders", "/community/{id}/datasources"
}, produces = {
"application/json"
}, method = RequestMethod.GET)
@GetMapping({ "/community/{id}/contentproviders", "/community/{id}/datasources" })
@Operation(summary = "get the list of content providers associated to a given community", description = "get the list of content providers associated to a given community", tags = {
C_CP, R
})
@ -316,9 +294,10 @@ public class CommunityApiController extends AbstractExporterController {
@ApiResponse(responseCode = "404", description = "not found"),
@ApiResponse(responseCode = "500", description = "unexpected error")
})
public List<CommunityContentprovider> getCommunityContentproviders(@PathVariable final String id) throws CommunityException {
public List<CommunityContentprovider> getCommunityContentproviders(@PathVariable final String id, @RequestParam(required = false) final Boolean deposit)
throws CommunityException {
try {
return communityService.getCommunityContentproviders(id);
return deposit == null ? communityService.getCommunityDatasources(id) : communityService.getCommunityDatasourcesWithDeposit(id, deposit);
} catch (final ResourceNotFoundException e) {
throw e;
} catch (final Throwable e) {
@ -326,11 +305,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = {
"/community/{id}/contentproviders", "/community/{id}/datasources"
}, produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping({ "/community/{id}/contentproviders", "/community/{id}/datasources" })
@Operation(summary = "associate a content provider to the community", description = "associate a content provider to the community", tags = {
C_CP, W
})
@ -344,7 +319,7 @@ public class CommunityApiController extends AbstractExporterController {
@RequestBody final CommunityContentprovider contentprovider) throws CommunityException {
try {
communityService.addCommunityContentProviders(id, contentprovider);
communityService.addCommunityDatasources(id, contentprovider);
return contentprovider;
} catch (final ResourceNotFoundException e) {
throw e;
@ -353,11 +328,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = {
"/community/{id}/contentproviders", "/community/{id}/datasources"
}, produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping({ "/community/{id}/contentproviders", "/community/{id}/datasources" })
@Operation(summary = "remove the association between a content provider and the community", description = "remove the association between a content provider and the community", tags = {
C_CP, W
})
@ -370,7 +341,7 @@ public class CommunityApiController extends AbstractExporterController {
@PathVariable final String id,
@RequestParam final String contentproviderId) throws CommunityException {
try {
communityService.removeCommunityContentProviders(id, contentproviderId);
communityService.removeCommunityDatasources(id, contentproviderId);
} catch (final ResourceNotFoundException e) {
throw e;
} catch (final Throwable e) {
@ -378,11 +349,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = {
"/community/{id}/contentprovidersList", "/community/{id}/datasourcesList"
}, produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping({ "/community/{id}/contentprovidersList", "/community/{id}/datasourcesList" })
@Operation(summary = "associate a list of content providers to the community", description = "associate a list of content providers to the community", tags = {
C_CP, W
})
@ -396,7 +363,7 @@ public class CommunityApiController extends AbstractExporterController {
@RequestBody final CommunityContentprovider[] contentprovidersList) throws CommunityException {
try {
communityService.addCommunityContentProviders(id, contentprovidersList);
communityService.addCommunityDatasources(id, contentprovidersList);
return contentprovidersList;
} catch (final ResourceNotFoundException e) {
throw e;
@ -405,11 +372,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = {
"/community/{id}/contentprovidersList", "/community/{id}/datasourcesList"
}, produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping({ "/community/{id}/contentprovidersList", "/community/{id}/datasourcesList" })
@Operation(summary = "remove a list of content providers from the community", description = "remove a list of content providers from the community", tags = {
C_CP, W
})
@ -422,7 +385,7 @@ public class CommunityApiController extends AbstractExporterController {
@PathVariable final String id,
@RequestBody final String[] contentProviderIdList) throws CommunityException {
try {
communityService.removeCommunityContentProviders(id, contentProviderIdList);
communityService.removeCommunityDatasources(id, contentProviderIdList);
} catch (final ResourceNotFoundException e) {
throw e;
} catch (final Throwable e) {
@ -432,9 +395,7 @@ public class CommunityApiController extends AbstractExporterController {
// ADDING CODE FOR COMMUNITY ORGANIZATIONS
@RequestMapping(value = "/community/{id}/organizations", produces = {
"application/json"
}, method = RequestMethod.GET)
@GetMapping("/community/{id}/organizations")
@Operation(summary = "get the list of organizations for a given community", description = "get the list of organizations for a given community", tags = {
C_O, R
})
@ -453,9 +414,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/organizations", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/{id}/organizations")
@Operation(summary = "associate an organization to the community", description = "associate an organization to the community", tags = {
C_O, W
})
@ -477,9 +436,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/organizationList", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/{id}/organizationList")
@Operation(summary = "associate a list of organizations to the community", description = "associate a list of organizations to the community", tags = {
C_O, W
})
@ -502,9 +459,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/organizations", produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping("/community/{id}/organizations")
@Operation(summary = "remove the association between an organization and the community", description = "remove the association between an organization and the community", tags = {
C_O, W
})
@ -525,9 +480,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/organizationList", produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping("/community/{id}/organizationList")
@Operation(summary = "remove a list of associations between some organizations and the community", description = "remove a list of associations between some organizations and the community", tags = {
C_O, W
})
@ -550,9 +503,7 @@ public class CommunityApiController extends AbstractExporterController {
// **********************
@RequestMapping(value = "/community/{id}/subjects", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/{id}/subjects")
@Operation(summary = "associate a subject to the community", description = "associate a subject to the community", tags = {
C, W
})
@ -574,9 +525,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/subjects", produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping("/community/{id}/subjects")
@Operation(summary = "remove subjects from a community", description = "remove subjects from a community", tags = {
C, W
})
@ -598,9 +547,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/fos", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/{id}/fos")
@Operation(summary = "associate a fos to the community", description = "associate a fos to the community", tags = {
C, W
})
@ -622,9 +569,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/fos", produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping("/community/{id}/fos")
@Operation(summary = "remove fos from a community", description = "remove fos from a community", tags = {
C, W
})
@ -646,9 +591,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/sdg", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/{id}/sdg")
@Operation(summary = "associate a sdg to the community", description = "associate a sdg to the community", tags = {
C, W
})
@ -670,9 +613,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/sdg", produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping("/community/{id}/sdg")
@Operation(summary = "remove sdg from a community", description = "remove sdg from a community", tags = {
C, W
})
@ -694,9 +635,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/advancedConstraint", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/{id}/advancedConstraint")
@Operation(summary = "the set of constraints to be used to extend the association between result and community", description = "the set of constraints to be used to extend the association between result and community", tags = {
C, W
})
@ -718,9 +657,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/advancedConstraint", produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping("/community/{id}/advancedConstraint")
@Operation(summary = "remove the constraints to extend the association result community from a community", description = "remove the constraints to extend the association result community from a community", tags = {
C, W
})
@ -741,9 +678,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/removeConstraint", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/{id}/removeConstraint")
@Operation(summary = "the set of constraints to be used to remove the association between result and community", description = "the set of constraints to be used to remove the association between result and community", tags = {
C, W
})
@ -765,9 +700,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/removeConstraint", produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping("/community/{id}/removeConstraint")
@Operation(summary = "remove the constraints to remove the association beetween result and community", description = "remove the constraints to remove the association beetween result and community", tags = {
C, W
})
@ -787,9 +720,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/zenodocommunities", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/{id}/zenodocommunities")
@Operation(summary = "associate a Zenodo community to the community", description = "associate a Zenodo community to the community", tags = {
C_ZC, W
})
@ -813,9 +744,7 @@ public class CommunityApiController extends AbstractExporterController {
}
@RequestMapping(value = "/community/{id}/zenodocommunities", produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping("/community/{id}/zenodocommunities")
@Operation(summary = "remove a Zenodo community from a community", description = "remove a Zenodo community from a community", tags = {
C_ZC, W
})
@ -837,9 +766,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{zenodoId}/openairecommunities", produces = {
"application/json"
}, method = RequestMethod.GET)
@GetMapping("/community/{zenodoId}/openairecommunities")
@Operation(summary = "get the list of OpenAIRE communities associated to a given Zenodo community", description = "get the list of OpenAIRE communities associated to a given Zenodo community", tags = {
C_ZC, R
})
@ -862,9 +789,7 @@ public class CommunityApiController extends AbstractExporterController {
}
// APIs to manage the propagationOrganizationCommunityMap
@RequestMapping(value = "/propagationOrganizationCommunityMap", produces = {
"application/json"
}, method = RequestMethod.GET)
@GetMapping("/propagationOrganizationCommunityMap")
@Operation(summary = "Get the propagationOrganizationCommunityMap", description = "propagationOrganizationCommunityMap", tags = {
C_O, R
})
@ -883,9 +808,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/propagationOrganizations", produces = {
"application/json"
}, method = RequestMethod.GET)
@GetMapping("/community/{id}/propagationOrganizations")
@Operation(summary = "try { return the propagation organizations of a community", description = "try { return the propagation organizations of a community", tags = {
C_O, R
})
@ -904,9 +827,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/propagationOrganizations", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/{id}/propagationOrganizations")
@Operation(summary = "add an organization to the propagationOrganizationCommunityMap", description = "add an organization to the propagationOrganizationCommunityMap", tags = {
C_O, W
})
@ -927,9 +848,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/propagationOrganizations", produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping("/community/{id}/propagationOrganizations")
@Operation(summary = "delete an organization to the propagationOrganizationCommunityMap", description = "delete an organization to the propagationOrganizationCommunityMap", tags = {
C_O, W
})
@ -952,9 +871,7 @@ public class CommunityApiController extends AbstractExporterController {
// APIs to manage the sub communities
@RequestMapping(value = "/community/{id}/subcommunities", produces = {
"application/json"
}, method = RequestMethod.GET)
@GetMapping("/community/{id}/subcommunities")
@Operation(summary = "get the list of subcommunities for a given community", description = "get the list of subcommunities for a given community", tags = {
C_SUB, R
})
@ -977,9 +894,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/subcommunities", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/{id}/subcommunities")
@Operation(summary = "associate a subcommunity to the community", description = "associate a subcommunity to the community", tags = {
C_SUB, W
})
@ -1001,9 +916,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/subcommunitiesList", produces = {
"application/json"
}, method = RequestMethod.POST)
@PostMapping("/community/{id}/subcommunitiesList")
@Operation(summary = "associate a list of subcommunities to the community", description = "associate a list of subcommunities to the community", tags = {
C_SUB, W
})
@ -1026,9 +939,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/subcommunities", produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping("/community/{id}/subcommunities")
@Operation(summary = "remove the association between a subcommunity and the community", description = "remove the association between a subcommunity and the community", tags = {
C_SUB, W
})
@ -1049,9 +960,7 @@ public class CommunityApiController extends AbstractExporterController {
}
}
@RequestMapping(value = "/community/{id}/subcommunitiesList", produces = {
"application/json"
}, method = RequestMethod.DELETE)
@DeleteMapping("/community/{id}/subcommunitiesList")
@Operation(summary = "remove a list of associations between some subcommunities and the community", description = "remove a list of associations between some subcommunities and the community", tags = {
C_SUB, W
})

View File

@ -3,6 +3,7 @@ package eu.dnetlib.openaire.community;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@ -74,21 +75,17 @@ public class CommunityService {
public List<CommunitySummary> listCommunities() {
return dbCommunityRepository.findAll()
.stream()
.map(CommunityMappingUtils::toCommunitySummary)
.collect(Collectors.toList());
.stream()
.map(CommunityMappingUtils::toCommunitySummary)
.collect(Collectors.toList());
}
@Transactional
public CommunityDetails newCommunity(final CommunityDetails details) throws CommunityException {
if (StringUtils.isBlank(details.getId())) {
throw new CommunityException("Empty Id");
} else if (dbCommunityRepository.existsById(details.getId())) {
throw new CommunityException("Community already exists: " + details.getId());
} else {
details.setCreationDate(LocalDateTime.now());
return saveCommunity(details);
}
if (StringUtils.isBlank(details.getId())) { throw new CommunityException("Empty Id"); }
if (dbCommunityRepository.existsById(details.getId())) { throw new CommunityException("Community already exists: " + details.getId()); }
details.setCreationDate(LocalDateTime.now());
return saveCommunity(details);
}
@ -115,23 +112,23 @@ public class CommunityService {
@Transactional
public Page<CommunityProject> getCommunityProjects(final String id,
final String funder,
final String filter,
final int page,
final int size,
final String orderBy) throws CommunityException {
final String funder,
final String filter,
final int page,
final int size,
final String orderBy) throws CommunityException {
if (StringUtils.isBlank(id)) { throw new CommunityException("Empty ID"); }
try {
final Sort sort;
if (StringUtils.isBlank(orderBy)) {
sort = Sort.by("projectName");
} else if (orderBy.equalsIgnoreCase("funder")) {
} else if ("funder".equalsIgnoreCase(orderBy)) {
sort = Sort.by("projectFunder").and(Sort.by("projectName"));
} else if (orderBy.equalsIgnoreCase("grantId")) {
} else if ("grantId".equalsIgnoreCase(orderBy)) {
sort = Sort.by("projectCode");
} else if (orderBy.equalsIgnoreCase("acronym")) {
} else if ("acronym".equalsIgnoreCase(orderBy)) {
sort = Sort.by("projectAcronym");
} else if (orderBy.equalsIgnoreCase("openaireId")) {
} else if ("openaireId".equalsIgnoreCase(orderBy)) {
sort = Sort.by("projectId");
} else {
sort = Sort.by("projectName");
@ -140,10 +137,9 @@ public class CommunityService {
final PageRequest pageable = PageRequest.of(page, size, sort);
if (StringUtils.isAllBlank(filter, funder)) {
return dbProjectRepository.findByCommunity(id, pageable).map(CommunityMappingUtils::toCommunityProject);
} else {
final Specification<DbProject> projSpec = prepareProjectSpec(id, funder, filter);
return dbProjectRepository.findAll(projSpec, pageable).map(CommunityMappingUtils::toCommunityProject);
}
final Specification<DbProject> projSpec = prepareProjectSpec(id, funder, filter);
return dbProjectRepository.findAll(projSpec, pageable).map(CommunityMappingUtils::toCommunityProject);
} catch (final Throwable e) {
log.error(e);
throw new CommunityException(e);
@ -191,8 +187,8 @@ public class CommunityService {
public void addCommunityProjects(final String id, final CommunityProject... projects) throws CommunityException {
try {
final List<DbProject> list = Arrays.stream(projects)
.map(p -> CommunityMappingUtils.toDbProject(id, p))
.collect(Collectors.toList());
.map(p -> CommunityMappingUtils.toDbProject(id, p))
.collect(Collectors.toList());
dbProjectRepository.saveAll(list);
} catch (final Throwable e) {
@ -204,56 +200,63 @@ public class CommunityService {
@Transactional
public void removeCommunityProjects(final String id, final String... ids) {
final List<DbProjectPK> list = Arrays.stream(ids)
.map(projectId -> new DbProjectPK(id, projectId))
.collect(Collectors.toList());
.map(projectId -> new DbProjectPK(id, projectId))
.collect(Collectors.toList());
dbProjectRepository.deleteAllById(list);
}
public List<CommunityContentprovider> getCommunityContentproviders(final String id) {
public List<CommunityContentprovider> getCommunityDatasources(final String id) {
return dbDatasourceRepository.findByCommunity(id)
.stream()
.map(CommunityMappingUtils::toCommunityContentprovider)
.collect(Collectors.toList());
.stream()
.map(CommunityMappingUtils::toCommunityContentprovider)
.collect(Collectors.toList());
}
public List<CommunityContentprovider> getCommunityDatasourcesWithDeposit(final String id, final boolean deposit) {
return dbDatasourceRepository.findByCommunityAndDeposit(id, deposit)
.stream()
.map(CommunityMappingUtils::toCommunityContentprovider)
.collect(Collectors.toList());
}
@Transactional
public void addCommunityContentProviders(final String id, final CommunityContentprovider... contentproviders) {
public void addCommunityDatasources(final String id, final CommunityContentprovider... contentproviders) {
final List<DbDatasource> list = Arrays.stream(contentproviders)
.map(cp -> CommunityMappingUtils.toDbDatasource(id, cp))
.collect(Collectors.toList());
.map(cp -> CommunityMappingUtils.toDbDatasource(id, cp))
.collect(Collectors.toList());
dbDatasourceRepository.saveAll(list);
}
@Transactional
public void removeCommunityContentProviders(final String id, final String... ids) {
public void removeCommunityDatasources(final String id, final String... ids) {
final List<DbDatasourcePK> list = Arrays.stream(ids)
.map(dsId -> new DbDatasourcePK(id, dsId))
.collect(Collectors.toList());
.map(dsId -> new DbDatasourcePK(id, dsId))
.collect(Collectors.toList());
dbDatasourceRepository.deleteAllById(list);
}
@Transactional
public void removeCommunityOrganizations(final String id, final String... orgNames) {
final List<DbSupportOrgPK> list = Arrays.stream(orgNames)
.map(name -> new DbSupportOrgPK(id, name))
.collect(Collectors.toList());
.map(name -> new DbSupportOrgPK(id, name))
.collect(Collectors.toList());
dbSupportOrgRepository.deleteAllById(list);
}
@Transactional
public List<CommunityOrganization> getCommunityOrganizations(final String id) {
return dbSupportOrgRepository.findByCommunity(id)
.stream()
.map(CommunityMappingUtils::toCommunityOrganization)
.collect(Collectors.toList());
.stream()
.map(CommunityMappingUtils::toCommunityOrganization)
.collect(Collectors.toList());
}
@Transactional
public void addCommunityOrganizations(final String id, final CommunityOrganization... orgs) {
final List<DbSupportOrg> list = Arrays.stream(orgs)
.map(o -> CommunityMappingUtils.toDbSupportOrg(id, o))
.collect(Collectors.toList());
.map(o -> CommunityMappingUtils.toDbSupportOrg(id, o))
.collect(Collectors.toList());
dbSupportOrgRepository.saveAll(list);
}
@ -266,43 +269,43 @@ public class CommunityService {
@Transactional
public List<SubCommunity> getSubCommunities(final String id) {
return dbSubCommunityRepository.findByCommunity(id)
.stream()
.map(CommunityMappingUtils::toSubCommunity)
.collect(Collectors.toList());
.stream()
.map(CommunityMappingUtils::toSubCommunity)
.collect(Collectors.toList());
}
@Transactional
public void addSubCommunities(final String id, final SubCommunity... subs) {
final List<DbSubCommunity> list = Arrays.stream(subs)
.map(s -> CommunityMappingUtils.toDbSubCommunity(id, s))
.collect(Collectors.toList());
.map(s -> CommunityMappingUtils.toDbSubCommunity(id, s))
.collect(Collectors.toList());
dbSubCommunityRepository.saveAll(list);
}
@Transactional
public CommunityDetails addCommunitySubjects(final String id, final String... subjects) {
return modifyElementToArrayField(id, c -> c.getSubjects(), (c, subs) -> c.setSubjects(subs), false, subjects);
return modifyElementToArrayField(id, DbCommunity::getSubjects, DbCommunity::setSubjects, false, subjects);
}
public CommunityDetails removeCommunitySubjects(final String id, final String... subjects) {
return modifyElementToArrayField(id, c -> c.getSubjects(), (c, subs) -> c.setSubjects(subs), true, subjects);
return modifyElementToArrayField(id, DbCommunity::getSubjects, DbCommunity::setSubjects, true, subjects);
}
public CommunityDetails addCommunityFOS(final String id, final String... foss) {
return modifyElementToArrayField(id, c -> c.getFos(), (c, fos) -> c.setFos(fos), false, foss);
return modifyElementToArrayField(id, DbCommunity::getFos, DbCommunity::setFos, false, foss);
}
public CommunityDetails removeCommunityFOS(final String id, final String... foss) {
return modifyElementToArrayField(id, c -> c.getFos(), (c, fos) -> c.setFos(fos), true, foss);
return modifyElementToArrayField(id, DbCommunity::getFos, DbCommunity::setFos, true, foss);
}
public CommunityDetails addCommunitySDG(final String id, final String... sdgs) {
return modifyElementToArrayField(id, c -> c.getSdg(), (c, sdg) -> c.setSdg(sdg), false, sdgs);
return modifyElementToArrayField(id, DbCommunity::getSdg, DbCommunity::setSdg, false, sdgs);
}
public CommunityDetails removeCommunitySDG(final String id, final String... sdgs) {
return modifyElementToArrayField(id, c -> c.getSdg(), (c, sdg) -> c.setSdg(sdg), true, sdgs);
return modifyElementToArrayField(id, DbCommunity::getSdg, DbCommunity::setSdg, true, sdgs);
}
@Transactional
@ -342,25 +345,19 @@ public class CommunityService {
}
public CommunityDetails removeCommunityZenodoCommunity(final String id, final String zenodoCommunity, final boolean isMain) {
if (isMain) {
return updateElementToSimpleField(id, (c, val) -> c.setMainZenodoCommunity(val), null);
} else {
return modifyElementToArrayField(id, c -> c.getOtherZenodoCommunities(), (c, arr) -> c.setOtherZenodoCommunities(arr), true, zenodoCommunity);
}
if (isMain) { return updateElementToSimpleField(id, DbCommunity::setMainZenodoCommunity, null); }
return modifyElementToArrayField(id, DbCommunity::getOtherZenodoCommunities, DbCommunity::setOtherZenodoCommunities, true, zenodoCommunity);
}
public CommunityDetails addCommunityZenodoCommunity(final String id, final String zenodoCommunity, final boolean isMain) {
if (isMain) {
return updateElementToSimpleField(id, (c, val) -> c.setMainZenodoCommunity(val), zenodoCommunity);
} else {
return modifyElementToArrayField(id, c -> c.getOtherZenodoCommunities(), (c, arr) -> c.setOtherZenodoCommunities(arr), false, zenodoCommunity);
}
if (isMain) { return updateElementToSimpleField(id, DbCommunity::setMainZenodoCommunity, zenodoCommunity); }
return modifyElementToArrayField(id, DbCommunity::getOtherZenodoCommunities, DbCommunity::setOtherZenodoCommunities, false, zenodoCommunity);
}
@Transactional
private CommunityDetails updateElementToSimpleField(final String id,
final BiConsumer<DbCommunity, String> setter,
final String value) {
final BiConsumer<DbCommunity, String> setter,
final String value) {
final DbCommunity dbEntry = dbCommunityRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException("Community not found: " + id));
setter.accept(dbEntry, value);
dbEntry.setLastUpdateDate(LocalDateTime.now());
@ -370,19 +367,17 @@ public class CommunityService {
@Transactional
private CommunityDetails modifyElementToArrayField(final String id,
final Function<DbCommunity, String[]> getter,
final BiConsumer<DbCommunity, String[]> setter,
final boolean remove,
final String... values) {
final Function<DbCommunity, String[]> getter,
final BiConsumer<DbCommunity, String[]> setter,
final boolean remove,
final String... values) {
final DbCommunity dbEntry = dbCommunityRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException("Community not found: " + id));
final Set<String> tmpList = new LinkedHashSet<>();
final String[] oldValues = getter.apply(dbEntry);
if (oldValues != null) {
for (final String s : oldValues) {
tmpList.add(s);
}
Collections.addAll(tmpList, oldValues);
}
if (remove) {
tmpList.removeAll(Arrays.asList(values));
@ -407,16 +402,16 @@ public class CommunityService {
@Transactional
public Map<String, Set<String>> getPropagationOrganizationCommunityMap() {
return dbOrganizationRepository.findAll()
.stream()
.collect(Collectors.groupingBy(DbOrganization::getOrgId, Collectors.mapping(DbOrganization::getCommunity, Collectors.toSet())));
.stream()
.collect(Collectors.groupingBy(DbOrganization::getOrgId, Collectors.mapping(DbOrganization::getCommunity, Collectors.toSet())));
}
@Transactional
public Set<String> getPropagationOrganizationsForCommunity(final String communityId) {
return dbOrganizationRepository.findByCommunity(communityId)
.stream()
.map(DbOrganization::getOrgId)
.collect(Collectors.toSet());
.stream()
.map(DbOrganization::getOrgId)
.collect(Collectors.toSet());
}
@Transactional
@ -454,8 +449,8 @@ public class CommunityService {
final List<IISConfigurationEntry> res = new ArrayList<>();
res.add(dbCommunityRepository.findById(id)
.map(CommunityMappingUtils::asIISConfigurationEntry)
.orElseThrow(() -> new ResourceNotFoundException("Community not found: " + id)));
.map(CommunityMappingUtils::asIISConfigurationEntry)
.orElseThrow(() -> new ResourceNotFoundException("Community not found: " + id)));
for (final DbSubCommunity subc : dbSubCommunityRepository.findByCommunity(id)) {
res.add(CommunityMappingUtils.asIISConfigurationEntry(subc));

View File

@ -6,6 +6,7 @@ import java.util.Arrays;
import java.util.Base64;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -115,23 +116,20 @@ public class CommunityImporterService {
public List<DbOrganization> importPropagationOrganizationsFromProfile(final String xml, final boolean simulation) throws Exception {
final String json = DocumentHelper.parseText(xml)
.selectSingleNode("//NODE[@name='setPropagationOrganizationCommunityMap']//PARAM[@name='parameterValue']")
.getText();
.selectSingleNode("//NODE[@name='setPropagationOrganizationCommunityMap']//PARAM[@name='parameterValue']")
.getText();
final List<DbOrganization> list = new ObjectMapper()
.readValue(json, new TypeReference<Map<String, List<String>>>() {})
.entrySet()
.stream()
.flatMap(e -> e.getValue()
.readValue(json, new TypeReference<Map<String, List<String>>>() {})
.entrySet()
.stream()
.map(community -> {
if (e.getKey().contains("|")) {
return new DbOrganization(community, StringUtils.substringAfter(e.getKey(), "|"));
} else {
return new DbOrganization(community, e.getKey());
}
}))
.collect(Collectors.toList());
.flatMap(e -> e.getValue()
.stream()
.map(community -> {
if (e.getKey().contains("|")) { return new DbOrganization(community, StringUtils.substringAfter(e.getKey(), "|")); }
return new DbOrganization(community, e.getKey());
}))
.collect(Collectors.toList());
if (!simulation) {
list.forEach(o -> {
@ -153,69 +151,69 @@ public class CommunityImporterService {
final CommunityDetails community = asCommunityDetails(context);
final List<CommunityContentprovider> datasources =
getCommunityInfo(context, CONTENTPROVIDERS_ID_SUFFIX, c -> asCommunityDataprovider(context.getId(), c))
.stream()
.map(o -> {
if (o.getOpenaireId() == null) {
log.warn("Openaire ID is missing, organization: " + o.getOfficialname());
} else if (o.getOpenaireId().contains("|")) {
o.setOpenaireId(StringUtils.substringAfter(o.getOpenaireId(), "|"));
}
return o;
})
.filter(o -> o.getOpenaireId() != null)
.collect(Collectors.toList());
getCommunityInfo(context, CONTENTPROVIDERS_ID_SUFFIX, c -> asCommunityDataprovider(context.getId(), c))
.stream()
.map(o -> {
if (o.getOpenaireId() == null) {
log.warn("Openaire ID is missing, organization: " + o.getOfficialname());
} else if (o.getOpenaireId().contains("|")) {
o.setOpenaireId(StringUtils.substringAfter(o.getOpenaireId(), "|"));
}
return o;
})
.filter(o -> o.getOpenaireId() != null)
.collect(Collectors.toList());
final List<CommunityProject> projects =
getCommunityInfo(context, PROJECTS_ID_SUFFIX, c -> asCommunityProject(context.getId(), c))
.stream()
.map(p -> {
if (p.getOpenaireId() == null) {
if (p.getFunder().equalsIgnoreCase("EC")) {
final String ns = findNamespaceForECProject(p.getGrantId());
if (ns != null) {
p.setOpenaireId(ns + "::" + Hashing.md5(p.getGrantId()));
} else {
log.warn("EC project not in the db: " + p.getGrantId());
getCommunityInfo(context, PROJECTS_ID_SUFFIX, c -> asCommunityProject(context.getId(), c))
.stream()
.map(p -> {
if (p.getOpenaireId() == null) {
if ("EC".equalsIgnoreCase(p.getFunder())) {
final String ns = findNamespaceForECProject(p.getGrantId());
if (ns != null) {
p.setOpenaireId(ns + "::" + Hashing.md5(p.getGrantId()));
} else {
log.warn("EC project not in the db: " + p.getGrantId());
}
} else if ("NSF".equalsIgnoreCase(p.getFunder())) {
p.setOpenaireId("nsf_________::" + Hashing.md5(p.getGrantId()));
} else if ("NIH".equalsIgnoreCase(p.getFunder())) {
p.setOpenaireId("nih_________::" + Hashing.md5(p.getGrantId()));
} else {
log.warn("Openaire ID is missing, funder: " + p.getFunder());
}
} else if (p.getOpenaireId().contains("|")) {
p.setOpenaireId(StringUtils.substringAfter(p.getOpenaireId(), "|"));
}
} else if (p.getFunder().equalsIgnoreCase("NSF")) {
p.setOpenaireId("nsf_________::" + Hashing.md5(p.getGrantId()));
} else if (p.getFunder().equalsIgnoreCase("NIH")) {
p.setOpenaireId("nih_________::" + Hashing.md5(p.getGrantId()));
} else {
log.warn("Openaire ID is missing, funder: " + p.getFunder());
}
} else if (p.getOpenaireId().contains("|")) {
p.setOpenaireId(StringUtils.substringAfter(p.getOpenaireId(), "|"));
}
return p;
})
.filter(p -> p.getOpenaireId() != null)
.collect(Collectors.toList());
return p;
})
.filter(p -> p.getOpenaireId() != null)
.collect(Collectors.toList());
final List<CommunityOrganization> orgs =
getCommunityInfo(context, ORGANIZATION_ID_SUFFIX, c -> asCommunityOrganization(context.getId(), c));
getCommunityInfo(context, ORGANIZATION_ID_SUFFIX, c -> asCommunityOrganization(context.getId(), c));
final List<String> otherZenodoCommunities =
getCommunityInfo(context, ZENODOCOMMUNITY_ID_SUFFIX, c -> asZenodoCommunity(c));
getCommunityInfo(context, ZENODOCOMMUNITY_ID_SUFFIX, CommunityImporterService::asZenodoCommunity);
community.setOtherZenodoCommunities(otherZenodoCommunities);
final List<SubCommunity> subs = context.getCategories()
.entrySet()
.stream()
.filter(e -> !e.getKey().equals(context.getId() + CONTENTPROVIDERS_ID_SUFFIX))
.filter(e -> !e.getKey().equals(context.getId() + PROJECTS_ID_SUFFIX))
.filter(e -> !e.getKey().equals(context.getId() + ORGANIZATION_ID_SUFFIX))
.filter(e -> !e.getKey().equals(context.getId() + ZENODOCOMMUNITY_ID_SUFFIX))
.map(e -> e.getValue())
.map(cat -> asSubCommunities(context.getId(), null, cat.getLabel(), cat.getConcepts()))
.flatMap(List::stream)
.collect(Collectors.toList());
.entrySet()
.stream()
.filter(e -> !(context.getId() + CONTENTPROVIDERS_ID_SUFFIX).equals(e.getKey()))
.filter(e -> !(context.getId() + PROJECTS_ID_SUFFIX).equals(e.getKey()))
.filter(e -> !(context.getId() + ORGANIZATION_ID_SUFFIX).equals(e.getKey()))
.filter(e -> !(context.getId() + ZENODOCOMMUNITY_ID_SUFFIX).equals(e.getKey()))
.map(Entry::getValue)
.map(cat -> asSubCommunities(context.getId(), null, cat.getLabel(), cat.getConcepts()))
.flatMap(List::stream)
.collect(Collectors.toList());
service.saveCommunity(community);
service.addCommunityProjects(context.getId(), projects.toArray(new CommunityProject[projects.size()]));
service.addCommunityContentProviders(context.getId(), datasources.toArray(new CommunityContentprovider[datasources.size()]));
service.addCommunityDatasources(context.getId(), datasources.toArray(new CommunityContentprovider[datasources.size()]));
service.addCommunityOrganizations(context.getId(), orgs.toArray(new CommunityOrganization[orgs.size()]));
service.addSubCommunities(context.getId(), subs.toArray(new SubCommunity[subs.size()]));
} catch (
@ -226,14 +224,14 @@ public class CommunityImporterService {
}
private <R> List<R> getCommunityInfo(final Context context, final String idSuffix, final Function<Concept, R> mapping)
throws CommunityException {
throws CommunityException {
if (context != null) {
final Map<String, Category> categories = context.getCategories();
final Category category = categories.get(context.getId() + idSuffix);
if (category != null) { return category.getConcepts()
.stream()
.map(mapping)
.collect(Collectors.toList()); }
.stream()
.map(mapping)
.collect(Collectors.toList()); }
}
return Lists.newArrayList();
}
@ -302,6 +300,8 @@ public class CommunityImporterService {
d.setOfficialname(firstValue(CCONTENTPROVIDER_OFFICIALNAME, p));
d.setEnabled(BooleanUtils.toBoolean(firstValue(CCONTENTPROVIDER_ENABLED, p)));
d.setSelectioncriteria(SelectionCriteria.fromJson(firstValue(CCONTENTPROVIDER_SELCRITERIA, p)));
d.setDeposit(false);
d.setMessage(null);
return d;
}
@ -339,7 +339,7 @@ public class CommunityImporterService {
private String findNamespaceForECProject(final String code) {
final List<String> list =
jdbcTemplate.queryForList("SELECT substr(id, 1, 12) from projects where code = ? and id like 'corda%'", String.class, code);
jdbcTemplate.queryForList("SELECT substr(id, 1, 12) from projects where code = ? and id like 'corda%'", String.class, code);
return list.isEmpty() ? null : list.get(0);
}
@ -355,11 +355,11 @@ public class CommunityImporterService {
private static List<String> splitValues(final Stream<String> stream, final String separator) {
return stream.map(s -> s.split(separator))
.map(Arrays::asList)
.flatMap(List::stream)
.filter(StringUtils::isNotBlank)
.map(StringUtils::trim)
.collect(Collectors.toList());
.map(Arrays::asList)
.flatMap(List::stream)
.filter(StringUtils::isNotBlank)
.map(StringUtils::trim)
.collect(Collectors.toList());
}
private static String firstValue(final String name, final List<Param> params) {
@ -372,13 +372,13 @@ public class CommunityImporterService {
private static Stream<String> asValues(final String name, final List<Param> params) {
return params == null ? Stream.empty()
: params.stream()
.filter(p -> p != null)
.filter(p -> StringUtils.isNotBlank(p.getName()))
.filter(p -> p.getName().trim().equals(name.trim()))
.map(Param::getValue)
.map(StringUtils::trim)
.distinct();
: params.stream()
.filter(p -> p != null)
.filter(p -> StringUtils.isNotBlank(p.getName()))
.filter(p -> p.getName().trim().equals(name.trim()))
.map(Param::getValue)
.map(StringUtils::trim)
.distinct();
}
protected DbOrganizationRepository getDbOrganizationRepository() {

View File

@ -13,5 +13,8 @@ public interface DbDatasourceRepository extends JpaRepository<DbDatasource, DbDa
List<DbDatasource> findByCommunity(String community);
List<DbDatasource> findByCommunityAndDeposit(String community, boolean deposit);
void deleteByCommunity(String id);
}

View File

@ -189,6 +189,8 @@ public class CommunityMappingUtils {
ccp.setOfficialname(dbEntry.getDsOfficialName());
ccp.setSelectioncriteria(dbEntry.getConstraints());
ccp.setEnabled(dbEntry.getEnabled() != null ? dbEntry.getEnabled() : true);
ccp.setDeposit(dbEntry.getDeposit() != null ? dbEntry.getDeposit() : false);
ccp.setMessage(dbEntry.getMessage());
return ccp;
}
@ -200,6 +202,8 @@ public class CommunityMappingUtils {
ds.setDsOfficialName(provider.getOfficialname());
ds.setConstraints(provider.getSelectioncriteria());
ds.setEnabled(provider.isEnabled());
ds.setDeposit(provider.getDeposit() != null ? provider.getDeposit() : false);
ds.setMessage(provider.getMessage());
return ds;
}
@ -262,8 +266,8 @@ public class CommunityMappingUtils {
public static LocalDateTime asLocalDateTime(final Date date) {
return date.toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDateTime();
.atZone(ZoneId.systemDefault())
.toLocalDateTime();
}
private static String[] toStringArray(final List<String> list) {

View File

@ -60,9 +60,9 @@ class CommunityImporterServiceTest {
// list.forEach(System.out::println);
assertEquals(245, list.size());
assertEquals(1, list.stream().filter(o -> o.getOrgId().equals("openorgs____::9dd5545aacd3d8019e00c3f837269746")).count());
assertEquals(2, list.stream().filter(o -> o.getOrgId().equals("openorgs____::d11f981828c485cd23d93f7f24f24db1")).count());
assertEquals(14, list.stream().filter(o -> o.getCommunity().equals("beopen")).count());
assertEquals(1, list.stream().filter(o -> "openorgs____::9dd5545aacd3d8019e00c3f837269746".equals(o.getOrgId())).count());
assertEquals(2, list.stream().filter(o -> "openorgs____::d11f981828c485cd23d93f7f24f24db1".equals(o.getOrgId())).count());
assertEquals(14, list.stream().filter(o -> "beopen".equals(o.getCommunity())).count());
}
@SuppressWarnings("unchecked")
@ -85,7 +85,7 @@ class CommunityImporterServiceTest {
Mockito.verify(service, Mockito.times(1)).saveCommunity(detailsCapture.capture());
Mockito.verify(service, Mockito.times(1)).addCommunityProjects(Mockito.anyString(), projectsCapture.capture());
Mockito.verify(service, Mockito.times(1)).addCommunityContentProviders(Mockito.anyString(), datasourcesCapture.capture());
Mockito.verify(service, Mockito.times(1)).addCommunityDatasources(Mockito.anyString(), datasourcesCapture.capture());
Mockito.verify(service, Mockito.times(1)).addCommunityOrganizations(Mockito.anyString(), orgsCapture.capture());
Mockito.verify(service, Mockito.times(1)).addSubCommunities(Mockito.anyString(), subCommunitiesCapture.capture());
@ -132,7 +132,7 @@ class CommunityImporterServiceTest {
Mockito.verify(service, Mockito.times(1)).saveCommunity(detailsCapture.capture());
Mockito.verify(service, Mockito.times(1)).addCommunityProjects(Mockito.anyString(), projectsCapture.capture());
Mockito.verify(service, Mockito.times(1)).addCommunityContentProviders(Mockito.anyString(), datasourcesCapture.capture());
Mockito.verify(service, Mockito.times(1)).addCommunityDatasources(Mockito.anyString(), datasourcesCapture.capture());
Mockito.verify(service, Mockito.times(1)).addCommunityOrganizations(Mockito.anyString(), orgsCapture.capture());
Mockito.verify(service, Mockito.times(1)).addSubCommunities(Mockito.anyString(), subCommunitiesCapture.capture());

View File

@ -34,6 +34,12 @@ public class CommunityContentprovider {
@Schema(description = "content provider selection criteria", required = false)
private SelectionCriteria selectioncriteria;
@Schema(description = "suggested for deposition", required = false)
private Boolean deposit;
@Schema(description = "message for the deposition page", required = false)
private String message;
public String getOpenaireId() {
return openaireId;
}
@ -75,7 +81,7 @@ public class CommunityContentprovider {
}
public SelectionCriteria getSelectioncriteria() {
return this.selectioncriteria;
return selectioncriteria;
}
public void setSelectioncriteria(final SelectionCriteria selectioncriteria) {
@ -101,17 +107,33 @@ public class CommunityContentprovider {
public String toString() {
final StringBuilder builder = new StringBuilder();
builder.append("CommunityContentprovider [\n\topenaireId = ")
.append(openaireId)
.append(",\n\tcommunityId = ")
.append(communityId)
.append(",\n\tname = ")
.append(name)
.append(",\n\tofficialname = ")
.append(officialname)
.append(",\n\tselectioncriteria = ")
.append(selectioncriteria)
.append("\n]");
.append(openaireId)
.append(",\n\tcommunityId = ")
.append(communityId)
.append(",\n\tname = ")
.append(name)
.append(",\n\tofficialname = ")
.append(officialname)
.append(",\n\tselectioncriteria = ")
.append(selectioncriteria)
.append("\n]");
return builder.toString();
}
public Boolean getDeposit() {
return deposit;
}
public void setDeposit(final Boolean deposit) {
this.deposit = deposit;
}
public String getMessage() {
return message;
}
public void setMessage(final String message) {
this.message = message;
}
}