Revision 6091
Added by Chris Jones almost 13 years ago
CrudService.java | ||
---|---|---|
109 | 109 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
110 | 110 |
import edu.ucsb.nceas.metacat.replication.ForceReplicationHandler; |
111 | 111 |
import edu.ucsb.nceas.metacat.service.SessionService; |
112 |
import edu.ucsb.nceas.metacat.service.ObjectFormatService; |
|
113 | 112 |
import edu.ucsb.nceas.metacat.util.DocumentUtil; |
114 | 113 |
import edu.ucsb.nceas.metacat.util.SessionData; |
115 | 114 |
|
... | ... | |
2070 | 2069 |
|
2071 | 2070 |
//set the default object format |
2072 | 2071 |
String doctype = (String) docInfo.get("doctype"); |
2073 |
ObjectFormat format = ObjectFormatService.getFormat(doctype);
|
|
2072 |
ObjectFormat format = ObjectFormat.convert(doctype);
|
|
2074 | 2073 |
if (format == null) { |
2075 | 2074 |
if (doctype.trim().equals("BIN")) { |
2076 |
format = ObjectFormatService.getFormat("application/octet-stream");
|
|
2075 |
format = ObjectFormat.OCTET_STREAM;
|
|
2077 | 2076 |
} else { |
2078 |
format = ObjectFormatService.getFormat("text/plain");
|
|
2077 |
format = ObjectFormat.convert("text/plain");
|
|
2079 | 2078 |
} |
2080 | 2079 |
} |
2081 | 2080 |
sm.setObjectFormat(format); |
... | ... | |
2083 | 2082 |
|
2084 | 2083 |
// further parse EML documents to get data object format, |
2085 | 2084 |
// describes and describedBy information |
2086 |
if ( format == ObjectFormatService.getFormat("eml://ecoinformatics.org/eml/2.0.0") ||
|
|
2087 |
format == ObjectFormatService.getFormat("eml://ecoinformatics.org/eml/2.0.1") ||
|
|
2088 |
format == ObjectFormatService.getFormat("eml://ecoinformatics.org/eml/2.1.0") ) {
|
|
2085 |
if ( format == ObjectFormat.EML_2_0_0 ||
|
|
2086 |
format == ObjectFormat.EML_2_0_1 ||
|
|
2087 |
format == ObjectFormat.EML_2_1_0 ) {
|
|
2089 | 2088 |
|
2090 | 2089 |
try { |
2091 | 2090 |
DataoneEMLParser emlParser = DataoneEMLParser.getInstance(); |
... | ... | |
2128 | 2127 |
logCrud.debug("Setting describedBy for " + dataDocId.getValue() + |
2129 | 2128 |
" to " + identifier.getValue()); |
2130 | 2129 |
dataSysMeta.addDescribedBy(identifier); |
2131 |
dataSysMeta.setObjectFormat(ObjectFormatService.getFormat(dataDocMimeType));
|
|
2130 |
dataSysMeta.setObjectFormat(ObjectFormat.convert(dataDocMimeType));
|
|
2132 | 2131 |
this.updateSystemMetadata(dataSysMeta, getSessionData(token)); |
2133 | 2132 |
|
2134 | 2133 |
} catch ( NotFound nf ) { |
... | ... | |
2141 | 2140 |
dataSysMeta.addDescribedBy(identifier); |
2142 | 2141 |
|
2143 | 2142 |
logCrud.debug("Setting mimeType for " + dataDocId.getValue() + " to " + dataDocMimeType); |
2144 |
dataSysMeta.setObjectFormat(ObjectFormatService.getFormat(dataDocMimeType));
|
|
2143 |
dataSysMeta.setObjectFormat(ObjectFormat.convert(dataDocMimeType));
|
|
2145 | 2144 |
|
2146 | 2145 |
logCrud.debug("Updating system metadata for " + dataDocId.getValue() + " to " + dataDocMimeType); |
2147 | 2146 |
this.updateSystemMetadata(dataSysMeta, getSessionData(token)); |
Also available in: Unified diff
In order to sync up with DataONE 0.6.1 changes, I'm backing out ObjectFormatService changes temporarily in Metacat. Most functionality will be rolled back in using the DataONE 0.6.2 tag, but some methods in ObjectFormatService (such as getListFromDisk()) will be moved into d1_libclient_java.