Changeset 4445


Ignore:
Timestamp:
19/11/08 11:57:16 (11 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.

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

Legend:

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

    r4420 r4445  
    244244        inputs = request.params 
    245245        c.atom = Atom(xmlString=str(x), ndgObject = self.ndgObject, **dict(inputs)) 
     246         
     247        # save the current atom - to avoid this needing be recreated by the  
     248        # asynch viewDeployments call 
     249        session['currentAtom'] = c.atom 
     250        session.save() 
    246251        logging.info("Data model set up") 
    247252 
  • 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: 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/public/js/queueDeployments.js

    r4283 r4445  
    55 
    66var MyApp = { 
    7     NAME : 'Deployments - loading', 
     7    NAME : 'Loading deployments info...', 
    88         
    99    q : new Y.Queue(), 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/atom_editor.html

    r4443 r4445  
    3434                        <div py:if="c.atom.isDE()" py:replace="Associations('Associated Data Granules', c.atom.getLinksOfType(g.vtd.GRANULE_TERM), c.addGranuleLink, c.saveAssoc)"/> 
    3535                        <div py:if="c.atom.isDE()" py:replace="Associations('Associated Deployments', c.atom.getLinksOfType(g.vtd.DEPLOYMENT_TERM), c.addDeploymentLink, c.saveAssoc)"/> 
     36                        <div class="metadataSection" py:if="c.atom.isDeployable()"> 
     37                                <div class="headingblock" id="deploymentsPlaceholder" /> 
     38                            </div> 
    3639                                <span py:if="not c.atom.isDeployment()" py:strip=""> 
    3740                                        <span py:if="not c.saveLink" py:strip=""> 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/atom_functions.html

    r4443 r4445  
    576576                        </table> 
    577577                </form> 
    578         <div class="headingblock" py:if="c.isDeployment and not editLink" id="deploymentsPlaceholder" /> 
     578        <div class="headingblock" py:if="c.atom.isDE() and c.isDeployment and not editLink" id="deploymentsPlaceholder" /> 
    579579                <table py:if="not links"><tr><td> 
    580580                        No data specified at present 
Note: See TracChangeset for help on using the changeset viewer.