2
|
1 '''
|
|
2 Created on 31.10.2012
|
|
3
|
|
4 @author: dwinter
|
|
5 '''
|
|
6 import web
|
9
|
7 import managePurls.manageIndexMetaPURLs as manageIndexMetaPURLs
|
3
|
8 from redirector import redirector
|
|
9 import logging
|
8
|
10 from searcher import searcher
|
2
|
11
|
|
12 urls = (
|
3
|
13 '/purl/(.+)','purl',
|
|
14 '/docuviewer/(.+)','redirector',
|
8
|
15 '/search','searcher',
|
2
|
16 )
|
|
17
|
|
18 app = web.application(urls, globals())
|
|
19
|
|
20
|
|
21 class purl:
|
|
22
|
|
23 def __init__(self):
|
|
24 self.md=manageIndexMetaPURLs.IndexMetaPURLManager()
|
|
25
|
|
26 def GET(self,purl):
|
|
27
|
|
28 path,validity=self.md.getPathValidity(purl)
|
|
29
|
|
30 if path is None:
|
|
31 raise web.notfound("Cannnot find a URL to this path")
|
|
32
|
|
33 if validity is manageIndexMetaPURLs.PERM_NON_VALID:
|
|
34 raise web.notfound("PURL NON VALID ANYMORE!")
|
|
35
|
|
36 if validity is manageIndexMetaPURLs.TEMP_NON_VALID:
|
|
37 return web.notfound("PURL currently not VALID try later!")
|
|
38
|
|
39
|
|
40 return path
|
|
41
|
|
42
|
|
43 if __name__ == "__main__":
|
|
44 app.run() |