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

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

Interim checkin supports "dummy" logging in and out,
provided pages inherit from ndgPage.kid

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.PageLogo=cf.get('layout','pageLogo',None)
24       
25        self.globals.server=cf.get('DEFAULT','server','')
26        self.globals.wayfuri='%s/wayf'%self.globals.server
27       
28        self.globals.logout='%s/logout'%self.globals.server
29       
30        self.config=cf
31       
32       
33    def __call__(self,environ,start_response):
34       
35        environ['ndgConfig']=self.config
36        return self.app(environ,start_response)
37   
Note: See TracBrowser for help on using the repository browser.