Changeset 4202 for TI05-delivery


Ignore:
Timestamp:
17/09/08 12:18:06 (11 years ago)
Author:
cbyrom
Message:

Fix handling of stubB config data + add logging info to stubB class
to make easier to follow.

Location:
TI05-delivery/ows_framework/trunk/ows_server/ows_server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/retrieve.py

    r4198 r4202  
    109109            elif viewFormat == ndgObject.MOLES_DOC_TYPE: 
    110110                renderTemplate = 'stubB' 
    111                 c.doc=stubB.stubB(x.tree,self.cf) 
     111                c.doc=stubB.stubB(x.tree,self.cf.config) 
    112112                c.tbinfo=self.__mytb(c.doc.name) 
    113113                name=c.doc.abbreviation 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/stubB.py

    r4177 r4202  
    1515from ndgUtils import ndgObject 
    1616from ows_server.models import Utilities 
     17import logging 
    1718 
    1819#from DeploymentHandling import * 
     
    7172        ''' Provides support for data granule structures ''' 
    7273        def __init__(self,helper,elem,config,name=''): 
     74            logging.info("Setting up data granule, %s" %name) 
    7375            self.elem=elem 
    7476            self.constraints=AccessControl(helper.find(elem,'accessControlPolicy')) 
     
    8284class ObservationStation: 
    8385    def __init__(self,h,e): 
     86        logging.info("Setting up stubB to represent observation station data") 
    8487        self.e=e   
    8588        self.hdg='Observation Station' 
    8689        if e is None: return 
     90         
    8791class DataProductionTool: 
    8892    def __init__(self,h,e): 
     93        logging.info("Setting up stubB to represent data production tool data") 
    8994        self.e=e 
    9095        i=h.find(e,'dgInstrument') 
     
    9499            self.hdg='Model' 
    95100        if e is None: return 
     101         
    96102class Activity: 
    97103    def __init__(self,h,e): 
     104        logging.info("Setting up stubB to represent activity data") 
    98105        self.e=e 
    99106        self.hdg='Activity' 
     
    102109def Deployments(elem,helper,config): 
    103110    ''' This is the late June 2007 version ''' 
     111    logging.info("Setting up deployments data") 
    104112    if elem is None: return None 
    105113    types={'dptList':'dataproductiontool','activityList':'activity','obsStnList':'observationstation','dataEntityList':'dataentity'} 
     
    107115    result={} 
    108116    for alist in types: 
     117        logging.debug("Looking for --%s-" %alist) 
    109118        blist=helper.find(elem,alist) 
    110119        collection=[] 
    111120        if blist is not None: 
    112121            for object in blist: 
     122                logging.debug(object) 
    113123                uri=idconvert(helper,object,config=config) 
    114124                name=helper.getText(object,'name') 
     
    116126                collection.append((uri,name,shortName)) 
    117127            result[names[alist]]=collection 
     128    logging.info("Deployments data set up") 
    118129    return result 
    119130             
     
    164175    def __init__(self,helper,element): 
    165176        ''' Attempt to instantiate this stubB as a data entity''' 
     177        logging.info("Setting up stubB to represent data entity") 
    166178        self.elem=element 
    167179        self.helper=helper 
     
    183195    def getGranules(self): 
    184196        ''' Load up the granule content within the entity ''' 
     197        logging.info("Adding data granule data") 
    185198        granList=self.elem.findall('dgDataGranule') 
    186199        self.granules=[] 
     
    192205            if name=='': name='Granule %s'%i 
    193206            self.granules.append(dataGranule(self.helper,item,self.config,name=name)) 
     207        logging.info("Granule data added") 
    194208 
    195209class dgMetadataDescription: 
     
    237251         
    238252        def __init__(self,elem,config): 
    239                  
     253                logging.info("Setting up stubB object with moles data") 
    240254                '''Instantiate with an element tree elem ''' 
    241255                 
     
    274288                for i in ('dgDataEntity','dgActivity','dgDataProductionTool','dgObservationStation'): 
    275289                    elem=helper.find(self.tree,i) 
    276                     if elem is not None: break 
     290                    if elem is not None: 
     291                        logging.info("- moles data represents: %s" %i)  
     292                        break 
    277293                if elem is None: 
    278294                    raise ValueError('StubB record does not contain an Activity, DE, DPT, ObsStn') 
     
    294310                 
    295311                # now go get all the related links 
    296                  
    297312                self.related=Deployments(helper.find(elem,'DeploymentSummary'),helper,self.config) 
    298313 
Note: See TracChangeset for help on using the changeset viewer.