Ignore:
Timestamp:
05/01/07 14:46:31 (13 years ago)
Author:
lawrence
Message:

Refactoring discovery wsgi for cleaner service binding. (Done, but
there will be implications for wsgi browse which may now be broken,
but I can't test it til the database is updated).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/PythonCode/wsgi/renderDiscoverySet.py

    r1955 r1958  
    33from DIF import DIF 
    44from htmlUtilities import * 
     5from renderService import * 
    56 
    6 def renderDiscoverySet(difSet,state,summary=0,services=0,spatial=0,temporal=0, 
     7def renderDiscoverySet(difSet,state,config,summary=0,services=0,spatial=0,temporal=0, 
    78    linkto='NDG_B_SERVICE',selector=None): 
    89    '''Takes a set of xml DIFS from a discovery search (difSet) and renders a  
     
    4142        ll=span(' Links: ','ndgem') 
    4243        ndg=0 
    43         ll+=d.binding.icon() 
     44        serviceRenderer=renderService(config) 
     45        if d.binding is not None: ll+=serviceRenderer.get(d.binding) 
    4446        for item in d.services: 
    4547            ll+=', ' 
    4648            #s=0 
    47             if item.serviceType == 'NDG_A_SERVICE':  
    48                 ll+=item.icon() 
     49            if item.contentType == 'NDG_A_SERVICE':  
    4950                ndg+=1 
    50             elif item.serviceType == 'NDG_B_SERVICE': 
     51            elif item.contentType == 'NDG_B_SERVICE': 
    5152                ndg+=1 
    52                 ll+=item.icon() 
    53             else: 
    54                 ll+=item.icon() 
     53            ll+=serviceRenderer.get(item) 
    5554         
    5655        if ndg<2: ndg=0 
     
    9291                    rlist[0]='%s: %s'%(span('Title','ndgem'),abbreviate(d.name,60)) 
    9392                rlist[0]+='<br/>%s: %s'%(span('Summary','ndgem'),abbreviate(d.abstract,200)) 
    94                 rlist[0]+=' '+hyperlink('(more)',d.binding.url) 
     93                if d.binding is not None: rlist[0]+=' '+hyperlink('(more)',d.binding.url) 
    9594            rlist[0]+='<br/>%s: %s.'%(span('Repository','ndgem'),d.centre.toHTML()) 
    96             if not summary: 
     95            if not summary and d.binding is not None: 
    9796                rlist[0]+=' '+hyperlink('(more)',d.binding.url) 
    9897            if services:rlist[0]+=slist 
Note: See TracChangeset for help on using the changeset viewer.