Project

General

Profile

« Previous | Next » 

Revision 6996

generate SystemMetadata during D1 registration (not 2.0.0 upgrade). This process runs in a thread and updates a metacat.properties value when it is complete.

View differences:

src/edu/ucsb/nceas/metacat/dataone/SystemMetadataFactory.java
594 594
        
595 595
        for (String localId : idList) { 
596 596
            //for each id, add a system metadata doc
597
        	generateSystemMetadata(localId, includeOre, downloadData);
597
        	createAndInsertSystemMetadata(localId, includeOre, downloadData);
598 598
        }
599 599
        logMetacat.info("done generating system metadata for given list");
600 600
    }
......
623 623
     * @throws AccessException 
624 624
     * @throws AccessControlException 
625 625
     */
626
    protected static void generateSystemMetadata(String localId, boolean includeOre, boolean downloadData) 
626
    private static void createAndInsertSystemMetadata(String localId, boolean includeOre, boolean downloadData) 
627 627
    throws PropertyNotFoundException, NoSuchAlgorithmException, AccessionNumberException, SQLException, AccessControlException, AccessException, McdbException, IOException, ClassNotFoundException, InsufficientKarmaException, ParseLSIDException, BaseException, JiBXException, HandlerException, SAXException 
628 628
    {
629 629
    	logMetacat.debug("Creating SystemMetadata for localId " + localId);
src/edu/ucsb/nceas/metacat/admin/upgrade/Upgrade2_0_0.java
43 43
        UpgradeNodeDataDatetime dateTimeUpgrade = new UpgradeNodeDataDatetime();
44 44
        success = success && dateTimeUpgrade.upgrade();
45 45
        
46
        // dataone system metadata generation
47
        GenerateSystemMetadata systemMetadataUpgrade = new GenerateSystemMetadata();
48
        success = success && systemMetadataUpgrade.upgrade();
49
        
50 46
        // Optionally upgrade GUIDs to use DOI syntax if configured
51 47
        GenerateGlobalIdentifiers globalIDUpgrade = new GenerateGlobalIdentifiers();
52 48
        success = success && globalIDUpgrade.upgrade();
src/edu/ucsb/nceas/metacat/admin/D1Admin.java
42 42

  
43 43
import edu.ucsb.nceas.metacat.IdentifierManager;
44 44
import edu.ucsb.nceas.metacat.admin.upgrade.GenerateORE;
45
import edu.ucsb.nceas.metacat.admin.upgrade.GenerateSystemMetadata;
45 46
import edu.ucsb.nceas.metacat.dataone.MNodeService;
46 47
import edu.ucsb.nceas.metacat.properties.PropertyService;
47 48
import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
......
329 330
			        // Register/update as a DataONE Member Node					
330 331
					registerDataONEMemberNode();
331 332

  
333
					// dataone system metadata generation
334
					boolean smGenerated = Boolean.parseBoolean(PropertyService.getProperty("dataone.systemmetadata.generated"));
335
					if (!smGenerated) {
336
						GenerateSystemMetadata systemMetadataUpgrade = new GenerateSystemMetadata();
337
				        systemMetadataUpgrade.upgrade();
338
				        // NOTE: this runs in a thread and marks SM generated when thatthread completes
339
					}
340

  
332 341
					// Generate ORE, if we haven't
333 342
					boolean oreGenerated = Boolean.parseBoolean(PropertyService.getProperty("dataone.ore.generated"));
334 343
					if (!oreGenerated) {
335 344
						GenerateORE gore = new GenerateORE();
336 345
						gore.upgrade();
337 346
						PropertyService.setProperty("dataone.ore.generated", Boolean.TRUE.toString());
338

  
339 347
					}
340 348
					
341 349
					// write the backup properties to a location outside the

Also available in: Unified diff