Revision 6097
Added by ben leinfelder almost 13 years ago
ResourceHandler.java | ||
---|---|---|
326 | 326 |
System.out.println("Using resource 'meta'"); |
327 | 327 |
if(params != null && params.get(FUNCTION_KEYWORD) != null && |
328 | 328 |
params.get(FUNCTION_KEYWORD)[0].equals(FUNCTION_NAME_GENERATE_MISSING_SYSTEM_METADATA)) |
329 |
{ //generate system metadata for any object that is |
|
330 |
//a) not system metadata itself |
|
331 |
//b) does not already have a system metadata id in the systemmetadata table |
|
332 |
//c) not a BIN object (data) |
|
333 |
//TODO: check if we need this anymore. Might be superceded |
|
334 |
//by MetacatPopulator |
|
335 |
generateMissingSystemMetadata(); |
|
329 |
{ |
|
336 | 330 |
status = true; |
337 | 331 |
} |
338 | 332 |
else |
... | ... | |
1026 | 1020 |
throw new Exception("Could not load the session data: " + e.getClass() + ": " + e.getMessage()); |
1027 | 1021 |
} |
1028 | 1022 |
} |
1029 |
|
|
1030 |
/** |
|
1031 |
* generate missing system metadata for any science metadata objects |
|
1032 |
* that don't already have it. https://trac.dataone.org/ticket/591 |
|
1033 |
* |
|
1034 |
* called with POST meta/?op=generatemissingsystemmetadata |
|
1035 |
* @throws SQLException |
|
1036 |
* @throws AccessionNumberException |
|
1037 |
* @throws NoSuchAlgorithmException |
|
1038 |
* @throws InvalidRequest |
|
1039 |
* @throws NotImplemented |
|
1040 |
* @throws NotFound |
|
1041 |
* @throws NotAuthorized |
|
1042 |
* @throws InvalidToken |
|
1043 |
* @throws PropertyNotFoundException |
|
1044 |
* @throws McdbDocNotFoundException |
|
1045 |
* @throws ServiceFailure |
|
1046 |
*/ |
|
1047 |
private void generateMissingSystemMetadata() throws ServiceFailure, McdbDocNotFoundException, PropertyNotFoundException, |
|
1048 |
InvalidToken, NotAuthorized, NotFound, NotImplemented, InvalidRequest, NoSuchAlgorithmException, |
|
1049 |
AccessionNumberException, SQLException |
|
1050 |
{ |
|
1051 |
AuthToken token = new AuthToken(sessionId); |
|
1052 |
CrudService.getInstance().generateMissingSystemMetadata(token); |
|
1053 |
} |
|
1054 | 1023 |
|
1055 | 1024 |
/** |
1056 | 1025 |
* Earthgrid API > Identifier Service > isRegistered Function : |
Also available in: Unified diff
do not use XML files for storing SystemMetadata - use DB tables only.