Revision 53908
Added by Miriam Baglioni over 5 years ago
modules/dnet-openaire-exporter/trunk/src/main/java/eu/dnetlib/openaire/community/CommunityApiController.java | ||
---|---|---|
210 | 210 |
@ApiResponse(code = 200, message = "OK"), |
211 | 211 |
@ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), |
212 | 212 |
@ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) |
213 |
public CommunityZenodoCommunity addCommunityZenodoCOmmunity(
|
|
213 |
public CommunityZenodoCommunity addCommunityZenodoCommunity(
|
|
214 | 214 |
@PathVariable final String id, |
215 | 215 |
@RequestBody final CommunityZenodoCommunity zenodocommunity) throws CommunityException, CommunityNotFoundException { |
216 | 216 |
|
modules/dnet-openaire-exporter/trunk/src/main/java/eu/dnetlib/openaire/community/CommunityApiCore.java | ||
---|---|---|
195 | 195 |
throw new CommunityException("parameter zenodoid cannot be null or empty"); |
196 | 196 |
} |
197 | 197 |
final TreeMap<Integer, CommunityZenodoCommunity> zcs = getZenodoCommunityMap(id); |
198 |
|
|
199 |
for(CommunityZenodoCommunity czc : zcs.values()){ |
|
200 |
if (czc.getZenodoid().equals(zc.getZenodoid())){ |
|
201 |
throw new CommunityException("Zenodo community already associated to the RCD"); |
|
202 |
} |
|
203 |
} |
|
204 |
|
|
198 | 205 |
zc.setId(nextId(MapUtils.isNotEmpty(zcs) ? zcs.lastKey() : 0)); |
199 | 206 |
|
200 | 207 |
isClient.addConcept(id, id + ZENODOCOMMUNITY_ID_SUFFIX, CommunityMappingUtils.asZenodoCommunityXML(id, zc)); |
modules/dnet-openaire-exporter/trunk/src/main/java/eu/dnetlib/openaire/community/CommunityZenodoCommunity.java | ||
---|---|---|
23 | 23 |
private String id; |
24 | 24 |
|
25 | 25 |
|
26 |
// @NotNull |
|
27 |
// @ApiModelProperty(value = "identifies the name of the zenodo community", required = false) |
|
28 |
// private String name =""; |
|
29 |
|
|
30 |
// @ApiModelProperty(value = "zenodo community selection criteria", required = false) |
|
31 |
// private SelectionCriteria selCrit; |
|
32 |
|
|
33 |
|
|
34 | 26 |
public String getZenodoid() { |
35 | 27 |
return zenodoid; |
36 | 28 |
} |
... | ... | |
55 | 47 |
this.communityId = communityId; |
56 | 48 |
} |
57 | 49 |
|
58 |
// public String getName() { |
|
59 |
// return name; |
|
60 |
// } |
|
61 |
// |
|
62 |
// public void setName(String name) { |
|
63 |
// this.name = name; |
|
64 |
// } |
|
50 |
|
|
65 | 51 |
} |
Also available in: Unified diff
disabled the possibility to add to a RCD a Zenodo community already in the list of the associated communities