364 |
364 |
logMetacat.debug("Returning from CrudService.create()");
|
365 |
365 |
EventLog.getInstance().log(metacatUrl,
|
366 |
366 |
username, localId, "create");
|
367 |
|
logCrud.info("create localId:" + localId + " guid:" + guid.getValue());
|
|
367 |
logCrud.info("create D1GUID:" + guid.getValue() + ":D1SCIMETADATA:" + localId +
|
|
368 |
":D1SYSMETA:"+ sysMetaLocalId + ":");
|
368 |
369 |
return guid;
|
369 |
370 |
}
|
370 |
371 |
|
... | ... | |
393 |
394 |
//change the obsoletes field of the new systemMetadata (sm.new) to point to the id of the old one
|
394 |
395 |
sysmeta.addObsolete(obsoletedGuid);
|
395 |
396 |
//insert sm.new
|
396 |
|
insertSystemMetadata(sysmeta, sessionData);
|
|
397 |
String sysMetaLocalId = insertSystemMetadata(sysmeta, sessionData);
|
|
398 |
String localId;
|
397 |
399 |
|
398 |
400 |
boolean isScienceMetadata = isScienceMetadata(sysmeta);
|
399 |
401 |
if(isScienceMetadata)
|
400 |
402 |
{
|
401 |
403 |
//update the doc
|
402 |
|
updateDocument(object, obsoletedGuid, guid, sessionData, false);
|
|
404 |
localId = updateDocument(object, obsoletedGuid, guid, sessionData, false);
|
403 |
405 |
}
|
404 |
406 |
else
|
405 |
407 |
{
|
406 |
408 |
//update a data file, not xml
|
407 |
|
insertDataObject(object, guid, sessionData);
|
|
409 |
localId = insertDataObject(object, guid, sessionData);
|
408 |
410 |
}
|
409 |
411 |
|
410 |
412 |
IdentifierManager im = IdentifierManager.getInstance();
|
... | ... | |
415 |
417 |
}
|
416 |
418 |
EventLog.getInstance().log(metacatUrl,
|
417 |
419 |
username, im.getLocalId(guid.getValue()), "update");
|
418 |
|
logCrud.info("update localId:" + im.getLocalId(guid.getValue()) + " guid:" + guid.getValue());
|
|
420 |
logCrud.info("update D1GUID:" + guid.getValue() + ":D1SCIMETADATA:" + localId +
|
|
421 |
":D1SYSMETA:"+ sysMetaLocalId + ":");
|
419 |
422 |
return guid;
|
420 |
423 |
}
|
421 |
424 |
catch(Exception e)
|
... | ... | |
889 |
892 |
|
890 |
893 |
EventLog.getInstance().log(metacatUrl,
|
891 |
894 |
username, im.getLocalId(guid.getValue()), "read");
|
892 |
|
logCrud.info("get localId:" + localId + " guid:" + guid.getValue());
|
|
895 |
logCrud.info("get D1GUID:" + guid.getValue() + ":D1SCIMETADATA:" + localId +
|
|
896 |
":");
|
893 |
897 |
return objectStream;
|
894 |
898 |
|
895 |
899 |
} catch (McdbDocNotFoundException e) {
|
... | ... | |
1132 |
1136 |
}
|
1133 |
1137 |
EventLog.getInstance().log(metacatUrl,
|
1134 |
1138 |
username, im.getLocalId(guid.getValue()), "read");
|
1135 |
|
logCrud.info("getSystemMetadata localId: " + localId + " guid:" + guid.getValue());
|
|
1139 |
logCrud.info("getsystemmetadata D1GUID:" + guid.getValue() +
|
|
1140 |
":D1SYSMETA:"+ localId + ":");
|
1136 |
1141 |
return sysmeta;
|
1137 |
1142 |
|
1138 |
1143 |
} catch (McdbDocNotFoundException e) {
|
... | ... | |
1257 |
1262 |
* @param guid
|
1258 |
1263 |
* @param sessionData
|
1259 |
1264 |
* @throws ServiceFailure
|
|
1265 |
* @returns localId of the data object inserted
|
1260 |
1266 |
*/
|
1261 |
|
private void insertDataObject(InputStream object, Identifier guid,
|
|
1267 |
private String insertDataObject(InputStream object, Identifier guid,
|
1262 |
1268 |
SessionData sessionData) throws ServiceFailure {
|
1263 |
1269 |
|
1264 |
1270 |
String username = "public";
|
... | ... | |
1329 |
1335 |
} catch (PropertyNotFoundException e) {
|
1330 |
1336 |
throw new ServiceFailure("1190", "Could not lock file for writing:" + e.getMessage());
|
1331 |
1337 |
}
|
1332 |
|
|
1333 |
1338 |
}
|
|
1339 |
return localId;
|
1334 |
1340 |
} catch (Exception e) {
|
1335 |
1341 |
// Could not get a lock on the document, so we can not update the file now
|
1336 |
1342 |
throw new ServiceFailure("1190", "Failed to lock file: " + e.getMessage());
|
reformatting logs for robert