Revision 53031
Added by Argiro Kokogiannaki over 5 years ago
ClaimHandler.java | ||
---|---|---|
29 | 29 |
DMFContextHandler dmfContextHandler = null; |
30 | 30 |
ProjectHandler projectHandler = null; |
31 | 31 |
ClaimValidation claimValidation = null; |
32 |
Boolean useProductionIndex = false;
|
|
32 |
Boolean useProductionIndex = null;
|
|
33 | 33 |
|
34 | 34 |
private static final Logger logger = Logger.getLogger(ClaimHandler.class); |
35 | 35 |
|
... | ... | |
182 | 182 |
* @throws Exception |
183 | 183 |
*/ |
184 | 184 |
private OpenaireEntity buildOpenaireEntity(String id, String type, String collectedFrom, String accessRights, String embargoDate) throws Exception { |
185 |
logger.info("HEEEEREEE"); |
|
186 | 185 |
if(type==null){ |
187 | 186 |
return null; |
188 | 187 |
} |
189 | 188 |
else if(type.equals(ClaimUtils.CONTEXT)){ |
190 |
return DMFContextHandler.fetchContextById(id); |
|
189 |
return DMFContextHandler.fetchContextById(id, useProductionIndex);
|
|
191 | 190 |
}else if (type.equals(ClaimUtils.PROJECT)){ |
192 | 191 |
Project project = projectHandler.fetchProjectByID(id, false); |
193 | 192 |
if(project == null){ |
... | ... | |
294 | 293 |
} |
295 | 294 |
|
296 | 295 |
public void checkRecordFile(String type, String id) throws SQLStoreException, SQLException { |
297 |
if(type.equals("publication") || type.equals("dataset")){ |
|
296 |
if(type.equals("publication") || type.equals("dataset")|| type.equals("other")|| type.equals("software")){
|
|
298 | 297 |
this.resultHandler.deleteRecordFile(type,id); |
299 | 298 |
} |
300 | 299 |
} |
... | ... | |
309 | 308 |
String targetType =rs.getString(4); |
310 | 309 |
String targetId =rs.getString(5); |
311 | 310 |
String user =rs.getString(6); |
311 |
this.checkRecordFile(sourceType, sourceId); |
|
312 |
this.checkRecordFile(targetType, targetId); |
|
312 | 313 |
ArrayList<Object> params2 = new ArrayList<>(); |
313 | 314 |
String query2 = queryGenerator.generateDeleteFullClaimQuery(claimId,user,sourceType,sourceId,targetType,targetId, params2); |
314 | 315 |
sqlDAO.executeUpdateQuery(query2, params2); |
Also available in: Unified diff
Parameterize context utils methods with a boolean parameter for productionIndex, add production url
In delete claims method add check for deleting record