Ignore:
Timestamp:
19/11/08 11:57:16 (13 years ago)
Author:
cbyrom
Message:

Add code to display the associated deployments info for deployments data
+ store atom details in session variable to allow re-use to improve
load efficiency.

File:
1 edited

Legend:

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

    r4442 r4445  
    7777            response.status_code = 400 
    7878            return render('error') 
    79              
     79 
    8080        try: 
    81             status,x=interface.GetXML(uri,outputSchema=self.outputSchema, useCache=False) 
    82             c.xmlh=x 
    83             c.atom = Atom(xmlString=str(x), ndgObject = self.uri) 
     81            # NB, we should have stored the current atom data - so look this up now 
     82            atom = session.get('currentAtom') 
     83            if atom: 
     84                c.atom = atom 
     85            else: 
     86                status,x=interface.GetXML(uri,outputSchema=self.outputSchema, useCache=False) 
     87                c.xmlh=x 
     88                c.atom = Atom(xmlString=str(x), ndgObject = self.uri) 
     89             
     90            # NB, there are two routes through here - if we're viewing a data entity, 
     91            # the deployment links are available directly from the atom; if not we 
     92            # need to look them up 
     93            lookupIndirectReferences = False 
     94            if c.atom.isDeployable(): 
     95                lookupIndirectReferences = True 
    8496             
    8597            dr = DocumentRetrieve(self.cf.get('NDG_EXIST','local'), 
    8698                      pwfile=self.cf.get('NDG_EXIST','passwordFile')) 
    87             c.atom.lookupDeploymentsInfo(dr) 
     99            c.atom.lookupDeploymentsInfo(dr, lookupIndirectReferences = \ 
     100                                         lookupIndirectReferences) 
    88101            return render('genshi', 'deployments_data') 
    89102         
     
    154167                                             uri = self.uri) 
    155168                templateType = "genshi" 
     169                # store the atom for easy re-use by asynch calls 
     170                # - primarily for the viewDeployments() method here 
     171                session['currentAtom'] = c.atom 
     172                session.save() 
    156173 
    157174            elif viewFormat == ndgObject.MOLES_DOC_TYPE: 
Note: See TracChangeset for help on using the changeset viewer.