Project

General

Profile

« Previous | Next » 

Revision 6088

Changes in the DataONE ObjectFormat class deprecate the convert() method, and we're now using Metacat's ObjectFormatService to look up object format attributes. The following changes replace ObjectFormat.convert() with ObjectFormatService.getFormat() in several classes.

Also added a few methods to ObjectFormatService where doRefresh() calls populateObjectFormatList(), which in turn calls either getCachedList() or falls back to getListFromDisk() in the case of a CN, or will call cn.listFormats() from the D1 libclient if the Metacat installation is an MN.

Added the ObjectFormatService.objectFormatMap as a static hash used for lookups of object formats based on their canonical identifier. This is populated from the ObjectFormatService.objectFormatList.

Added deserializeObjectFormatList(InputStream) to return the ObjectFormatList from the XML serialization (from Metacat or disk).

View differences:

MetaCatServlet.java
59 59
import edu.ucsb.nceas.metacat.properties.PropertyService;
60 60
import edu.ucsb.nceas.metacat.properties.SkinPropertyService;
61 61
import edu.ucsb.nceas.metacat.replication.ReplicationService;
62
import edu.ucsb.nceas.metacat.service.ObjectFormatService;
62 63
import edu.ucsb.nceas.metacat.service.ServiceService;
63 64
import edu.ucsb.nceas.metacat.service.SessionService;
64 65
import edu.ucsb.nceas.metacat.service.XMLSchemaService;
......
296 297
            ServiceService.registerService("PropertyService", PropertyService.getInstance(context));         
297 298
            ServiceService.registerService("SkinPropertyService", SkinPropertyService.getInstance());
298 299
            ServiceService.registerService("SessionService", SessionService.getInstance()); 
299
            
300
    		// Check to see if the user has requested to bypass configuration 
300
    		
301
            // Check to see if the user has requested to bypass configuration 
301 302
            // (dev option) and check see if metacat has been configured.
302 303
    		// If both are false then stop the initialization
303 304
            if (!ConfigurationUtil.bypassConfiguration() && !ConfigurationUtil.isMetacatConfigured()) {
......
340 341
			DBConnectionPool connPool = DBConnectionPool.getInstance();
341 342
			logMetacat.debug("MetaCatServlet.initSecondHalf - DBConnection pool initialized: " + connPool.toString());
342 343
			
344
			// register the XML schema service
343 345
			ServiceService.registerService("XMLSchemaService", XMLSchemaService.getInstance());
346
			
347
			// register the object format service
348
      ServiceService.registerService("ObjectFormatService", ObjectFormatService.getInstance());
344 349

  
345 350
			// check if eml201 document were corrected or not. if not, correct eml201 documents.
346 351
			// Before Metacat 1.8.1, metacat uses tag RELEASE_EML_2_0_1_UPDATE_6 as eml

Also available in: Unified diff