Ignore:
Timestamp:
17/05/06 13:35:11 (14 years ago)
Author:
lawrence
Message:

Some minor bug fixes in rendering DIFs and stubB

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/StubB/XSLT/browse/portal/cgi/renderDiscoveryResponses.py

    r938 r940  
    33from Utilities import cleanup 
    44 
    5 def render(results,summary=0,services=0,spatial=0,temporal=0): 
    6     '''Takes a set of results from a discovery search and renders a list of responses as a table ''' 
     5def render(difSet,summary=0,services=0,spatial=0,temporal=0,linkto='NDG_B_SERVICE'): 
     6    '''Takes a set of xml DIFS from a discovery search and renders a list of responses as a table, 
     7    with layout depending on a set of keywords: 
     8     ''' 
    79    columns=['name','centre'] 
    810    #next three lines not yet used in anger 
     
    1113    if services: columns.insert(-1,'Services') 
    1214    html='<table><tbody>' 
    13     i=1 
    14     for item in results: 
    15         d=DIF(cleanup(item)) 
     15    i=1#next three lines not yet used in anger 
     16    if spatial: columns.insert(-1,'Spatial') 
     17    if temporal: columns.insert(-1,'Temporal') 
     18    if services: columns.insert(-1,'Services') 
     19    for item in difSet: 
     20        d=DIF(item) 
    1621        bgc={1:'#FFFFFF',-1:'#EEEEEE'}[i] 
    1722        i=-1*i 
    1823        html+='<tr bgcolor=%s><td>%s</td><td>%s</td></tr>'%( 
    19                 bgc,d.name,d.centre) 
     24                bgc,d.name[0:60],d.centre.tohtml()) 
    2025    html+='</tbody></table>' 
    2126    return html 
     
    2530    ws.SearchFullText('acsoe') 
    2631    results=ws.GetResults(number=5) 
    27     html=render(results) 
     32    difs=[] 
     33    for result in results: 
     34        difs.append(cleanup(result)) 
     35    html=render(difs) 
    2836    print html 
    2937    ws.release() 
Note: See TracChangeset for help on using the changeset viewer.