Changeset 5746


Ignore:
Timestamp:
22/09/09 12:48:50 (10 years ago)
Author:
sdonegan
Message:

Adjusted so as to provide discovery service API url to the methods called in ndgRetrieve.py and discoveryServiceClient.py - optional, replacing hardcoded uri

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ndgCommon/trunk/ndg/common/src/models/ndgObject.py

    r5608 r5746  
    8181        ok=1 
    8282        if len(bits)==3: 
     83             
    8384            repository,schema,localID=bits 
    8485            self.uri=uri.replace(':','__') 
    8586        elif len(bits2)==3: 
     87             
    8688            repository,schema,localID=bits2 
    8789            self.uri=uri 
    8890        elif len(bits2)>3: 
     91             
    8992            repository,schema,localID=bits2[0],bits2[1],'__'.join(bits2[2:]) 
    9093            self.uri=uri 
     
    114117        Set up the configuration for retrieving this document  
    115118        ''' 
     119         
     120         
    116121        logging.debug("Setting up configuration for retrieving document") 
     122         
     123         
     124         
    117125        self.config=config 
    118         if not config: 
     126        if not config:             
    119127            return 
     128         
     129        self.discoveryServiceURL = self.config.get('DISCOVERY','discoveryServiceURL')         
     130         
    120131         
    121132        self.server=self.config.get('DISCOVERY','default') 
     
    127138        self.viewService='%s/view/'%server 
    128139        discoveryBASE='%s%s__%s__%s'%(self.viewService,self.repository,self.schema,self.localID) 
    129  
     140         
    130141        # set default return format - if not set, just return in original format 
    131142        fmt = self.config.get('DISCOVERY','formatDefault') 
    132143        logging.info("Default discovery format set to: %s" %fmt) 
    133              
     144         
    134145        # We'll build the following even if it can't be used (as would be the case for 
    135146        # a non data entity B record or an A record) because it's a useful template. 
     
    138149 
    139150        self.discoveryURL=self.__buildURL(discoveryBASE,[qs]) 
    140  
     151         
    141152        # config file should have details on the service to use for the repository 
    142153        # - if not, default to 'unknown' 
Note: See TracChangeset for help on using the changeset viewer.