Changeset 2295 for TI07-MOLES/trunk


Ignore:
Timestamp:
19/03/07 14:37:25 (13 years ago)
Author:
lawrence
Message:

Cleaning up edge cases in discovery so that while NDG browse isn't
enabled, what you see still makes sense :-).

Location:
TI07-MOLES/trunk/PythonCode/wsgi
Files:
5 edited

Legend:

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

    r2293 r2295  
    88from ETxmlView import loadET, nsdumb 
    99from renderEntity import renderEntity 
     10from ServiceBinding import DIFService 
    1011try: #python 2.5 
    1112    from xml.etree import ElementTree as ET 
     
    1819        from elementtree import ElementTree as ET 
    1920debug=1 
    20 class DIFService: 
    21     ''' A DIF only knows about a related URL ''' 
    22     def __init__(self,c,u,d): 
    23         ''' Take a related url tuple (content_type,url,description) and store it, using 
    24         an ndgModifier if necessary ''' 
    25         self.contentType,self.url,self.description=c,u,d 
    26     def __str__(self): 
    27         return '<a href="%s" title="%s">%s</a>'%self.contentType,self.url,self.description 
    2821     
    2922class DIF: 
     
    109102        #Data curator information 
    110103        self.centre=DIFcontact(helper.find(self.tree,'Data_Center'),ctype='centre',helper=helper) 
    111         self.curator=DIFcontact(self.tree) 
    112  
     104        self.curator=DIFcontact(helper.find(self.tree,'Data_Curator'),ctype='centre',helper=helper) 
     105        if self.curator is None:self.curator=self.centre  
     106        
    113107        #Data Creators 
    114108        self.creators=[] 
     
    128122            self.services.append( 
    129123                DIFService( 
    130                  helper.getText(item,'URL_Content_type'), 
     124                 helper.getText(item,'URL_Content_Type'), 
    131125                 helper.getText(item,'URL'), 
    132126                 helper.getText(item,'Description') )) 
  • TI07-MOLES/trunk/PythonCode/wsgi/People.py

    r2097 r2295  
    3434        def toHTML(self,prefix=''): 
    3535            #print self.data 
    36             if self.elem is None: return '' 
     36            if self.elem is None: return 'Unknown' 
    3737            html=prefix #para start? 
    3838            if self.data['personName'].name!='': 
  • TI07-MOLES/trunk/PythonCode/wsgi/ServiceBinding.py

    r1905 r2295  
    1515from htmlUtilities import hyperlink,image 
    1616from ETxmlView import nsdumb,et2text 
     17 
     18class DIFService: 
     19    ''' A DIF only knows about a related URL ''' 
     20    def __init__(self,c,u,d): 
     21        ''' Take a related url tuple (content_type,url,description) and store it, using 
     22        an ndgModifier if necessary ''' 
     23        self.contentType,self.url,self.description=c,u,d 
     24    def __str__(self): 
     25        return '<a href="%s" title="%s">%s</a>'%(self.url,self.contentType,self.description) 
     26 
    1727 
    1828def idconvert(e,helper=None): 
  • TI07-MOLES/trunk/PythonCode/wsgi/renderEntity.py

    r2293 r2295  
    6969        s=renderService(self.config) 
    7070        for item in entity.services: 
    71             html+='<tr><td>%s</td><td>%s</td></tr>'%(s.get(item),item.description) 
     71            html+='<tr><td>%s</td><td>%s</td></tr>'%(s.get(item)) 
    7272         
    7373        if entity.ndgObject is not None: 
  • TI07-MOLES/trunk/PythonCode/wsgi/renderParameters.py

    r2293 r2295  
    33    to the BODC vocabulary service ''' 
    44    #well the vocab bit is still to do :-) 
    5     print keywords 
    65    k=collapse(keywords) 
    7     print k 
    86    return htmlList(k) 
    97 
Note: See TracChangeset for help on using the changeset viewer.