Revision 7007
Added by ben leinfelder almost 13 years ago
src/edu/ucsb/nceas/metacat/admin/upgrade/dataone/GenerateORE.java | ||
---|---|---|
33 | 33 |
import org.apache.commons.logging.LogFactory; |
34 | 34 |
|
35 | 35 |
import edu.ucsb.nceas.metacat.DBUtil; |
36 |
import edu.ucsb.nceas.metacat.DocumentImpl; |
|
36 | 37 |
import edu.ucsb.nceas.metacat.admin.AdminException; |
37 | 38 |
import edu.ucsb.nceas.metacat.admin.upgrade.UpgradeUtilityInterface; |
38 | 39 |
import edu.ucsb.nceas.metacat.dataone.SystemMetadataFactory; |
... | ... | |
53 | 54 |
|
54 | 55 |
try { |
55 | 56 |
// get only local ids for this server |
56 |
List<String> idList = DBUtil.getAllDocidsByType(null, true, serverLocation);
|
|
57 |
List<String> idList = DBUtil.getAllDocidsByType(DocumentImpl.EML2_0_0NAMESPACE, true, serverLocation);
|
|
57 | 58 |
Collections.sort(idList); |
58 |
|
|
59 |
// generate based on this list |
|
60 | 59 |
SystemMetadataFactory.generateSystemMetadata(idList, includeOre, downloadData); |
60 |
|
|
61 |
idList = DBUtil.getAllDocidsByType(DocumentImpl.EML2_0_1NAMESPACE, true, serverLocation); |
|
62 |
Collections.sort(idList); |
|
63 |
SystemMetadataFactory.generateSystemMetadata(idList, includeOre, downloadData); |
|
64 |
|
|
65 |
idList = DBUtil.getAllDocidsByType(DocumentImpl.EML2_1_0NAMESPACE, true, serverLocation); |
|
66 |
Collections.sort(idList); |
|
67 |
SystemMetadataFactory.generateSystemMetadata(idList, includeOre, downloadData); |
|
68 |
|
|
69 |
idList = DBUtil.getAllDocidsByType(DocumentImpl.EML2_1_1NAMESPACE, true, serverLocation); |
|
70 |
Collections.sort(idList); |
|
71 |
SystemMetadataFactory.generateSystemMetadata(idList, includeOre, downloadData); |
|
72 |
|
|
61 | 73 |
} catch (Exception e) { |
62 | 74 |
String msg = "Problem generating missing system metadata: " + e.getMessage(); |
63 | 75 |
log.error(msg, e); |
Also available in: Unified diff
only run ORE generation for EML docs -- no need to run this for all documents (yikes!)