source: TI05-delivery/ows_framework/trunk/ows_server/ows_server/config/ndgMiddleware.py @ 2703

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/trunk/ows_server/ows_server/config/ndgMiddleware.py@2703
Revision 2703, 1.9 KB checked in by lawrence, 12 years ago (diff)

Look and feel of result set is now close to Kay's concepts.

Line 
1# ndg middleware
2from paste.deploy import CONFIG
3from ows_server.models.Utilities import myConfig
4
5class ndgMiddleware:
6   
7    def __init__(self,app,g):
8       
9        #this is the next application in the wsgi stack
10        self.app=app
11       
12        #set up the ndg configuration file
13        cf=CONFIG.get('configfile')
14        cf=myConfig(cf)
15     
16        self.globals=g
17        self.globals.localLink=cf.get('layout','localLink',None)
18        self.globals.localImage=cf.get('layout','localImage',None)
19        self.globals.localAlt=cf.get('layout','localAlt','Visit Local Site')
20        self.globals.ndgLink=cf.get('layout','ndgLink','http://ndg.nerc.ac.uk')
21        self.globals.ndgImage=cf.get('layout','ndgImage',None)
22        self.globals.ndgAlt=cf.get('layout','ndgAlt','Visit NDG')
23        self.globals.stfcLink=cf.get('layout','stfcLink')
24        self.globals.stfcImage=cf.get('layout','stfcImage')
25        self.globals.helpIcon=cf.get('layout','helpIcon')
26        self.globals.LeftAlt=cf.get('layout','HdrLeftAlt')
27        self.globals.LeftLogo=cf.get('layout','HdrLeftLogo')
28        self.globals.pageLogo="bodcHdr"
29        self.globals.icons_xml=cf.get('layout','Xicon')
30        self.globals.icons_prn=cf.get('layout','printer')
31        self.globals.icons_A=cf.get('NDG_A_SERVICE','icon')
32        self.globals.icons_B=cf.get('NDG_B_SERVICE','icon')
33        self.globals.icons_D=cf.get('DISCOVERY','icon')
34        self.globals.icons_R=cf.get('RELATED','icon')
35       
36        self.globals.discoveryURL=cf.get('SEARCH','discoveryURL')
37       
38        self.globals.server=cf.get('DEFAULT','server','')
39        self.globals.wayfuri='%s/wayf'%self.globals.server
40       
41        self.globals.logout='%s/logout'%self.globals.server
42       
43        self.config=cf
44       
45       
46    def __call__(self,environ,start_response):
47       
48        environ['ndgConfig']=self.config
49        return self.app(environ,start_response)
50   
Note: See TracBrowser for help on using the repository browser.