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

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

Interim commit of discovery/browse in ows stack.

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       
30        self.globals.discoveryURL=cf.get('SEARCH','discoveryURL')
31       
32        self.globals.server=cf.get('DEFAULT','server','')
33        self.globals.wayfuri='%s/wayf'%self.globals.server
34       
35        self.globals.logout='%s/logout'%self.globals.server
36       
37        self.config=cf
38       
39       
40    def __call__(self,environ,start_response):
41       
42        environ['ndgConfig']=self.config
43        return self.app(environ,start_response)
44   
Note: See TracBrowser for help on using the repository browser.