Revision 6561
Added by ben leinfelder over 12 years ago
MetacatHandler.java | ||
---|---|---|
3526 | 3526 |
|
3527 | 3527 |
// create system metadata for the document |
3528 | 3528 |
SystemMetadata sysMeta = new SystemMetadata(); |
3529 |
sysMeta.setSerialVersion(BigInteger.valueOf(1)); |
|
3529 | 3530 |
int rev = IdentifierManager.getInstance().getLatestRevForLocalId(localId); |
3530 | 3531 |
AccessionNumber accNum = new AccessionNumber(localId, "NONE"); |
3531 | 3532 |
String guid = null; |
... | ... | |
3592 | 3593 |
|
3593 | 3594 |
// set the object format, fall back to defaults |
3594 | 3595 |
try { |
3595 |
fmtid = ObjectFormatCache.getInstance().getFormat(doctype).getFmtid();
|
|
3596 |
fmtid = ObjectFormatCache.getInstance().getFormat(doctype).getFormatId();
|
|
3596 | 3597 |
|
3597 | 3598 |
} catch (NotFound nfe) { |
3598 | 3599 |
|
... | ... | |
3600 | 3601 |
// format is not registered, use default |
3601 | 3602 |
if (doctype.trim().equals("BIN")) { |
3602 | 3603 |
fmtid = ObjectFormatCache.getInstance().getFormat( |
3603 |
"application/octet-stream").getFmtid();
|
|
3604 |
"application/octet-stream").getFormatId();
|
|
3604 | 3605 |
|
3605 | 3606 |
} else { |
3606 |
fmtid = ObjectFormatCache.getInstance().getFormat("text/plain").getFmtid();
|
|
3607 |
fmtid = ObjectFormatCache.getInstance().getFormat("text/plain").getFormatId();
|
|
3607 | 3608 |
} |
3608 | 3609 |
|
3609 | 3610 |
} catch (NotFound nf) { |
... | ... | |
3614 | 3615 |
|
3615 | 3616 |
} |
3616 | 3617 |
|
3617 |
sysMeta.setFmtid(fmtid);
|
|
3618 |
sysMeta.setFormatId(fmtid);
|
|
3618 | 3619 |
logMetacat.debug("The ObjectFormat for " + localId + " is " + fmtid.getValue()); |
3619 | 3620 |
|
3620 | 3621 |
// further parse EML documents to get data object format, |
3621 | 3622 |
// describes and describedBy information |
3622 |
if ( fmtid == ObjectFormatCache.getInstance().getFormat("eml://ecoinformatics.org/eml-2.0.0").getFmtid() ||
|
|
3623 |
fmtid == ObjectFormatCache.getInstance().getFormat("eml://ecoinformatics.org/eml-2.0.1").getFmtid() ||
|
|
3624 |
fmtid == ObjectFormatCache.getInstance().getFormat("eml://ecoinformatics.org/eml-2.1.0").getFmtid() ||
|
|
3625 |
fmtid == ObjectFormatCache.getInstance().getFormat("eml://ecoinformatics.org/eml-2.1.1").getFmtid() ) {
|
|
3623 |
if ( fmtid == ObjectFormatCache.getInstance().getFormat("eml://ecoinformatics.org/eml-2.0.0").getFormatId() ||
|
|
3624 |
fmtid == ObjectFormatCache.getInstance().getFormat("eml://ecoinformatics.org/eml-2.0.1").getFormatId() ||
|
|
3625 |
fmtid == ObjectFormatCache.getInstance().getFormat("eml://ecoinformatics.org/eml-2.1.0").getFormatId() ||
|
|
3626 |
fmtid == ObjectFormatCache.getInstance().getFormat("eml://ecoinformatics.org/eml-2.1.1").getFormatId() ) {
|
|
3626 | 3627 |
|
3627 | 3628 |
try { |
3628 | 3629 |
|
... | ... | |
3643 | 3644 |
// default to binary |
3644 | 3645 |
if (dataDocMimeType == null) { |
3645 | 3646 |
dataDocMimeType = |
3646 |
ObjectFormatCache.getInstance().getFormat("application/octet-stream").getFmtid().getValue();
|
|
3647 |
ObjectFormatCache.getInstance().getFormat("application/octet-stream").getFormatId().getValue();
|
|
3647 | 3648 |
} |
3648 | 3649 |
String dataDocLocalId = ""; |
3649 | 3650 |
logMetacat.debug("Data local ID: " + dataDocLocalId); |
... | ... | |
3684 | 3685 |
logMetacat.debug("Updating system metadata for " + dataGuid.getValue() + " to " + dataDocMimeType); |
3685 | 3686 |
try { |
3686 | 3687 |
ObjectFormatIdentifier fmt = |
3687 |
ObjectFormatCache.getInstance().getFormat(dataDocMimeType).getFmtid();
|
|
3688 |
dataSysMeta.setFmtid(fmt);
|
|
3688 |
ObjectFormatCache.getInstance().getFormat(dataDocMimeType).getFormatId();
|
|
3689 |
dataSysMeta.setFormatId(fmt);
|
|
3689 | 3690 |
|
3690 | 3691 |
} catch (NotFound nfe) { |
3691 | 3692 |
logMetacat.debug("Couldn't find format identifier for: " + |
Also available in: Unified diff
move the DataONE 1.0.0-SNAPSHOT