Project

General

Profile

« Previous | Next » 

Revision 7112

double check "ecogrid" data urls for valid docid.rev - namely integer rev numbers - when parsing EML and also generating system metadata when necessary. Log the errors as warnings.

View differences:

SystemMetadataFactory.java
416 416
						logMetacat.debug("Data URL     : " + dataDocUrl);
417 417
						logMetacat.debug("Data mime    : " + dataDocMimeType);
418 418
						
419
						// check for valid docid.rev
420
						String dataDocid = null;
421
						int dataRev = 0;
422
						if (dataDocLocalId != null) {
423
							// look up the guid for the data
424
							try {
425
								dataDocid = DocumentUtil.getSmartDocId(dataDocLocalId);
426
								dataRev = DocumentUtil.getRevisionFromAccessionNumber(dataDocLocalId);
427
							} catch (Exception e) {
428
								logMetacat.warn(e.getClass().getName() + " - Problem parsing accession number for: " + dataDocLocalId + ". Message: " + e.getMessage());
429
								dataDocLocalId = null;
430
							}
431
						}
432
						
419 433
						// now we have a local id for the data
420 434
						if (dataDocLocalId != null) {
421
							
422
							// look up the guid for the data
423
							String dataDocid = DocumentUtil.getSmartDocId(dataDocLocalId);
424
							int dataRev = DocumentUtil.getRevisionFromAccessionNumber(dataDocLocalId);
425 435
	
426 436
							// check if data system metadata exists already
427 437
							SystemMetadata dataSysMeta = null;

Also available in: Unified diff