Revision 6708
Added by ben leinfelder over 12 years ago
SystemMetadataFactory.java | ||
---|---|---|
62 | 62 |
import edu.ucsb.nceas.metacat.McdbDocNotFoundException; |
63 | 63 |
import edu.ucsb.nceas.metacat.McdbException; |
64 | 64 |
import edu.ucsb.nceas.metacat.MetacatHandler; |
65 |
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlException; |
|
65 | 66 |
import edu.ucsb.nceas.metacat.client.InsufficientKarmaException; |
66 | 67 |
import edu.ucsb.nceas.metacat.dataone.hazelcast.HazelcastService; |
67 | 68 |
import edu.ucsb.nceas.metacat.dataquery.MetacatDatabaseConnectionPoolFactory; |
68 | 69 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
70 |
import edu.ucsb.nceas.metacat.replication.ReplicationService; |
|
71 |
import edu.ucsb.nceas.metacat.shared.HandlerException; |
|
69 | 72 |
import edu.ucsb.nceas.metacat.util.DocumentUtil; |
70 | 73 |
import edu.ucsb.nceas.utilities.ParseLSIDException; |
71 | 74 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
... | ... | |
85 | 88 |
* The groups the user belongs to |
86 | 89 |
* |
87 | 90 |
* @return sysMeta The system metadata object created |
91 |
* @throws SAXException |
|
92 |
* @throws HandlerException |
|
93 |
* @throws AccessControlException |
|
88 | 94 |
*/ |
89 | 95 |
public static SystemMetadata createSystemMetadata(String localId) |
90 | 96 |
throws McdbException, McdbDocNotFoundException, SQLException, |
91 | 97 |
IOException, AccessionNumberException, ClassNotFoundException, |
92 | 98 |
InsufficientKarmaException, ParseLSIDException, |
93 | 99 |
PropertyNotFoundException, BaseException, NoSuchAlgorithmException, |
94 |
JiBXException { |
|
100 |
JiBXException, AccessControlException, HandlerException, SAXException {
|
|
95 | 101 |
|
96 | 102 |
logMetacat.debug("MetacatHandler.createSystemMetadata() called."); |
97 | 103 |
logMetacat.debug("provided localId: " + localId); |
... | ... | |
159 | 165 |
} // end try() |
160 | 166 |
|
161 | 167 |
// get additional docinfo |
162 |
Hashtable<String, Object> docInfo = IdentifierManager.getInstance().getDocumentInfo(localId);
|
|
168 |
Hashtable<String, String> docInfo = ReplicationService.getDocumentInfoMap(localId);
|
|
163 | 169 |
// set the default object format |
164 |
String doctype = (String) docInfo.get("doctype");
|
|
170 |
String doctype = docInfo.get("doctype"); |
|
165 | 171 |
ObjectFormatIdentifier fmtid = null; |
166 | 172 |
|
167 | 173 |
// set the object format, fall back to defaults |
... | ... | |
347 | 353 |
sysMeta.setSize(new BigInteger(sizeStr)); |
348 | 354 |
|
349 | 355 |
// submitter |
350 |
Subject subject = new Subject(); |
|
351 |
subject.setValue((String) docInfo.get("user_owner")); |
|
352 |
sysMeta.setSubmitter(subject); |
|
353 |
sysMeta.setRightsHolder(subject); |
|
356 |
Subject submitter = new Subject(); |
|
357 |
submitter.setValue((String) docInfo.get("user_updated")); |
|
358 |
sysMeta.setSubmitter(submitter); |
|
359 |
// rights holder |
|
360 |
Subject owner = new Subject(); |
|
361 |
owner.setValue((String) docInfo.get("user_owner")); |
|
362 |
sysMeta.setRightsHolder(owner); |
|
354 | 363 |
|
355 | 364 |
try { |
356 | 365 |
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-DD"); |
Also available in: Unified diff
use shared method for looking up "docInfo" map -- both in Metacat replication and in D1 system metadata generation