Changeset 2517


Ignore:
Timestamp:
29/05/07 11:47:24 (12 years ago)
Author:
lawrence
Message:

Sundry browse bug fixes from PML experience, plus look-n-feel
in browse and discovery.

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

Legend:

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

    r2487 r2517  
    22 
    33headings = {'activity':'Activities', 
    4                    'dataproductiontool':'Data Production Tool', 
    5                    'observationstation':'Observation Station', 
     4                   'dataproductiontool':'Data Production Tools', 
     5                   'observationstation':'Observation Stations', 
    66                   'dataentity':'Data Entity'} 
    77others = { 'dgDataEntity':['activity','dataproductiontool','observationstation'], 
     
    3131    def toHTML(self): 
    3232        if self.links=={}: return '' 
    33         html='''<table cellspacing="0" cellpadding="3" border="0" width="100%"> 
     33        html='''<table cellspacing="0" cellpadding="3" border="0" width="100%" class="related"> 
    3434                <tbody> 
    3535                <tr><td class="lineHead" colspan="2"> 
     
    3838        for o in self.others: 
    3939            h=headings[o] 
    40             #could use a name if we have one, but meanwhile we'll use a numeric ... 
     40            hh='' 
    4141            for l in self.links[o]: 
    42                 a = '<a href="%s">%s</a>'%(l[0].URL,l[1]) 
    43                 html+='''<tr><td width="30%%">%s</td><td width="60%%">%s</td></tr>'''%(h,a) 
     42                print l 
     43                w=l[1].replace(' ','&nbsp;') 
     44                hh+='<a href="%s">%s</a>&nbsp;(%s) '%(l[0].URL,w,l[2]) 
     45            if hh<>'': 
     46                html+='<tr class="separated"><td width=20%%" class="line">%s</td><td width="80%%">%s</td></tr>'%(h,hh) 
     47        #    for l in self.links[o]: 
     48        #        a = '<a href="%s">%s</a>'%(l[0].URL,l[1]) 
     49        #        html+='''<tr><td width="20%%" class="line">%s</td><td width="80%%">%s</td></tr>'''%(h,a) 
    4450        html+='</tbody></table>' 
    4551        return html 
  • TI07-MOLES/trunk/PythonCode/wsgi/layout/ndg.css

    r2392 r2517  
    22@import url(/layout/metadata.css); 
    33 
     4 
     5DIV.metadata {PADDING-LEFT: 20px;} 
     6.title {FONT-WEIGHT:bold; FONT-SIZE:140%; FONT-STYLE:italic; } 
     7.keywords {COLOR: Blue; FONT-SIZE:120%; FONT-WEIGHT:bold;} 
     8.metaentry {COLOR: Black} 
     9.abstract {MARGIN-LEFT: 50px; MARGIN-RIGHT:50px; MARGIN-TOP:10px; MARGIN-BOTTOM:10px; font-style:italic; font-size:100%; border:thin solid black; padding: 8px} 
     10 
     11.key {BACKGROUND-IMAGE: url(keySm.gif); BACKGROUND-POSITION: right top;BACKGROUND-REPEAT: no-repeat} 
     12.lineHiLite {BORDER-TOP: #ddd 1px solid; BACKGROUND: #f4f4f4; MARGIN: 10px 0px 0px 0px;} 
     13.lineHead {FONT-WEIGHT: bold; FONT-SIZE: 120%; BACKGROUND-COLOR: #f2f2f2; 
     14        PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; COLOR: #666666;  
     15        PADDING-TOP: 3px; BORDER-BOTTOM: #666666 1px solid;} 
     16.lineHead A:link {COLOR: #ff6600; TEXT-DECORATION: none} 
     17.lineHead A:visited {COLOR: #ff6600; TEXT-DECORATION: none} 
     18.line  {COLOR: #666666; padding: 3px; FONT-SIZE:120%; border-bottom: 1px #ccc; FONT-WEIGHT:bold; } 
     19.line A:hover {COLOR: #336699; TEXT-DECORATION: none} 
     20.line A:active {COLOR: #336699; TEXT-DECORATION: none} 
     21.lineHiLite {PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; COLOR: #666666;  
     22             PADDING-TOP: 3px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #f2f2f2;} 
     23.headingO {FONT-WEIGHT: bold; COLOR: #ff6600; FONT-FAMILY: Arial, Verdana, serif, sans-serif} 
     24     
     25 
     26 
    427BODY { 
    5         PADDING-RIGHT: 10px; PADDING-LEFT: 10px; FONT-SIZE: 75%; BACKGROUND: #fff; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; FONT-FAMILY: tahoma, verdana, arial, sans-serif;  
     28        PADDING-RIGHT: 10px; PADDING-LEFT: 10px; FONT-SIZE: 75%; BACKGROUND: #fff; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; FONT-FAMILY: arial, tahoma, verdana, sans-serif;  
    629} 
    730FORM { 
     
    3154tr.rbgGrey  {BACKGROUND-COLOR: #F0F0F0; BORDER-BOTTOM: thin solid black;} 
    3255tr.rbgBeige {BACKGROUND-COLOR: #FDFFCC; BORDER-BOTTOM: thin solid black;} 
     56tr.separated{border-bottom:thin solid black;} 
    3357 
    3458#Header {color: black; background-color: white; text-align: center; margin-bottom: 10px; padding-top: 3px; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; clear: both; border-bottom: 2px solid red; font-size: medium; font-weight:bold;} 
     
    4367 
    4468div.AdvancedSearch{margin-top: 10px; margin-bottom: 10 px;} 
     69div.stridePosition{margin-top: 2px; margin-bottom: 2px; background-color: wheat;} 
    4570 
    4671div.searchMethod {margin-top: 7px; margin-bottom: 8px;} 
     72 
    4773table.SearchBox {margin-left:auto; margin-right:auto; padding-bottom: 10px; color: black; background-color: #FDFFCC; padding-left: 20px; padding-right: 20px; clear: both;} 
    4874 
     75table.related{} 
    4976.searchHdr {font-size: 120%; font-weight: bold;} 
    5077 
  • TI07-MOLES/trunk/PythonCode/wsgi/ndgDiscovery.config

    r2487 r2517  
    1919# this is the physical file location of the layout directory on this machine  
    2020#  
    21 layoutdir:      /home/bnl/sandboxes/ndg/TI07-MOLES/trunk/PythonCode/wsgi/layout/ 
     21layoutdir:      /home/bnl/sandboxes/ndg/TI07-MOLES/trunk/PythonCode/wsgi/ 
    2222# 
    2323# this should never be changed 
     
    5555 
    5656[HELP] 
    57 helpFile:       %(layoutdir)shelp.html 
     57helpFile:       %(layoutdir)s%(layout)shelp.html 
    5858 
    5959[NDG_A_SERVICE] 
     
    6565instance: datasetURI_%s 
    6666 
    67 [NDG_BROWSE_HOSTS] 
    68 #following is for testing, it should be glue for now otherwise. 
    69 badc.nerc.ac.uk: %(server)s 
    70  
    7167[NDG_B_SERVICE] 
    72 # following is a list of repository servers, actually only one is needed, 
    73 # and that is the one owned by  
    74 # http://badc.rl.ac.uk/browse?uri=badc.nerc.ac.uk__MOLES-B1__dataset 
    75 # needs to be mapped into a specific server ... 
    76 badc.nerc.ac.uk: chinook.badc.rl.ac.uk 
    77 neodc.nerc.ac.uk: chinook.badc.rl.ac.uk 
    78 bodc.nerc.ac.uk: BODC-dummyHost 
    79 grid.bodc.nerc.ac.uk: BODC-dumyHOST-G 
    80 nocs.soton.ac.uk: NOCS-dummyHost 
    81 neodc.soton.ac.uk: NEODC-dummyHost 
    82 pml.ac.uk: PML-dummyHost 
    83 icon: %(layout)s/B.gif 
     68# 
     69#These are the hosts which are publicly available on which the browse 
     70#service is running. The list should be of the form repository: hostname 
     71#where repository is the NDG identifier .... 
     72# 
     73badc.nerc.ac.uk: glue.badc.rl.ac.uk 
     74npm.ac.uk: wwwdev.npm.ac.uk/rsdas/projects/ndg 
     75grid.icon: %(layout)s/B.gif 
    8476icon_alt: B Service 
    8577icon_title: Links to a METADATA BROWSE view of this dataset 
    8678service_name: B 
    87 instance: %(server)s/retrieve&repository=REPOSITORY&format=NDG-B1&type=html&uri 
     79instance: http://SERVICEHOST/retrieve?repository=EXISTHOST&format=SCHEMA&type=html&uri= 
     80bodc.nerc.ac.uk: what 
     81neodc.nerc.ac.uk: glue.badc.rl.ac.uk 
     82nocs.soton.ac.uk: what 
     83 
     84[NDG_EXIST] 
     85# 
     86# following is a list of repository servers, actually only one is needed, 
     87# at any one location running browse, and that is the local one. The  
     88# entire purpose of the rest of the list is to simplify updates. These 
     89# hosts do not need to be visible outside of corporate firewalls. 
     90# The list should be of the form repositroy: hostname where repository 
     91# is the NDG identifier. 
     92#  
     93badc.nerc.ac.uk: chinook.badc.rl.ac.uk 
     94neodc.nerc.ac.uk: chinook.badc.rl.ac.uk 
     95grid.bodc.nerc.ac.uk: what 
     96nocs.soton.ac.uk: what 
     97npm.ac.uk: pgsql.npm.ac.uk 
     98 
    8899 
    89100[RELATED] 
  • TI07-MOLES/trunk/PythonCode/wsgi/ndgObject.py

    r2422 r2517  
    7474                # This is a mapping from the ndg repository id to an actual repository id 
    7575                # understood by the ndg exist interface 
    76                 repository=self.config.get('NDG_B_SERVICE',self.repository,'Unknown-B-Repository') 
    77                 url=self.discoveryURL.replace('ndg',repository) 
    78                 self.URL=url.replace('format=%s'%fmt,'format=%s'%self.schema) 
     76                blank=self.config.get('NDG_B_SERVICE','instance') 
     77                servicehost=self.config.get('NDG_B_SERVICE',self.repository,'unknown') 
     78                existhost=self.config.get('NDG_EXIST',self.repository,self.repository) 
     79                url=blank.replace('SERVICEHOST',servicehost) 
     80                url=url.replace('EXISTHOST',existhost) 
     81                self.URL=url.replace('SCHEMA',self.schema)+self.uri 
    7982                self.xmlURL=self.URL.replace('html','xml') 
    8083                self.printableURL=self.URL.replace('html','print') 
    81                 if repository!='Unknown-B-Repository': self.gettable=0 
     84                if servicehost!='unknown': self.gettable=0 
    8285            else: 
    8386                #currently we don't know how to get this one 
     
    156159        print n.printableURL 
    157160 
     161    def testPMLuri(self): 
     162        '''Make sure the pml uris work in ndg object ''' 
     163        uri='npm.ac.uk__NDG-B1__dataent.692' 
     164        n=ndgObject(uri,self.getConfig()) 
     165        print n.URL 
    158166 
    159167    def testHorribleURI(self): 
  • TI07-MOLES/trunk/PythonCode/wsgi/ndgRetrieve.py

    r2487 r2517  
    1010from ndgSearch import ndgSearch 
    1111import time 
     12import cgi 
    1213 
    1314# any class with a get method can be used here, and then only 
     
    167168                     ok=0 
    168169            except Exception,e: 
    169                  r='<p> Unable to retrieve [%s], reason was [%s]</p>'%(uri.uri,e) 
     170                 r='<p> Unable to retrieve [%s], reason was [%s]</p>'%(uri.uri,cgi.escape(str(e))) 
    170171                 ok=0 
    171172         
     
    180181                    r=self.shower.get(r,format,otype=outputType,ndgObj=self.uri) 
    181182                except Exception,e: 
    182                     r='<p> Unable to show document, reason was [%s]<p>'%e 
     183                    r='<p> Unable to show document, reason was [%s]<p>'%cgi.escape(str(e)) 
    183184        else: 
    184185            ctype='text/xml' 
  • TI07-MOLES/trunk/PythonCode/wsgi/stubB.py

    r2487 r2517  
    236236            xml=open(fname,'r').read() 
    237237            config=myConfig('ndgDiscovery.config') 
     238            layoutdir=config.get('layout','layoutdir') 
    238239            x=stubB(xml,config) 
    239240            y='''<?xml version="1.0" encoding="UTF-8"?> 
     
    243244                                <META http-equiv="Content-Type" content="text/xhtml; charset=iso-8859-1"/> 
    244245                                <title>stubB</title> 
    245                                 <LINK media="all, screen" href="../layout/style.css" type="text/css" rel="stylesheet"/> 
    246                         </head> '''+x.toHTML(config) 
     246                                <LINK media="all, screen" href="%s/layout/ndg.css" type="text/css" rel="stylesheet"/> 
     247                        </head> '''%layoutdir+x.toHTML(config) 
    247248            ff=fname+'-output.html' 
    248249            f=file(ff,'w') 
Note: See TracChangeset for help on using the changeset viewer.