1 | """ |
---|
2 | Setup your Routes options here |
---|
3 | """ |
---|
4 | import os |
---|
5 | from routes import Mapper |
---|
6 | |
---|
7 | def make_map(global_conf={}, app_conf={}): |
---|
8 | root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
---|
9 | |
---|
10 | map = Mapper(directory=os.path.join(root_path, 'controllers')) |
---|
11 | |
---|
12 | # This route handles displaying the error page and graphics used in the 404/500 |
---|
13 | # error pages. It should likely stay at the top to ensure that the error page is |
---|
14 | # displayed properly. |
---|
15 | map.connect('error/:action/:id', controller='error') |
---|
16 | |
---|
17 | # Define your routes. The more specific and detailed routes should be defined first, |
---|
18 | # so they may take precedent over the more generic routes. For more information, refer |
---|
19 | # to the routes manual @ http://routes.groovie.org/docs/ |
---|
20 | #map.connect(':controller/:action/:id') |
---|
21 | #map.connect('*url', controller='template', action='view') |
---|
22 | |
---|
23 | ######################################################################################### |
---|
24 | ## NDG Configuration. Not being used in this application |
---|
25 | ######################################################################################### |
---|
26 | ## # These should conform to http://proj.badc.rl.ac.uk/ndg/wiki/PasteStack |
---|
27 | ## # ... but don't ... yet ... |
---|
28 | |
---|
29 | ## # the NDG OGC services |
---|
30 | ## # change these when security layer is present and not before |
---|
31 | ## #to |
---|
32 | ## #map.connect('wms/:uri',controller='csml_wms') |
---|
33 | ## #map.connect('wcs/:uri',controller='csml_wcs') |
---|
34 | |
---|
35 | ## |
---|
36 | ## map.connect(':file/wms', controller='csml_wms') |
---|
37 | ## map.connect('wcs/:fileoruri', controller='csml_wcs') |
---|
38 | ## map.connect(':fileoruri/wcs', controller='csml_wcs') |
---|
39 | ## map.connect(':file/status/:jobID', controller='status', action='getStatus') |
---|
40 | |
---|
41 | ## # following is the shell for the rest of the ndg |
---|
42 | ## map.connect('login', controller='login') |
---|
43 | ## map.connect('wayf', controller='login', action='wayf') |
---|
44 | ## map.connect('logout', controller='logout') |
---|
45 | ## map.connect('view/:uri', controller = 'retrieve', action='view') |
---|
46 | ## map.connect('askCorrect/:uri', controller='retrieve', action='askCorrect') |
---|
47 | ## map.connect('correct/:uri', controller='retrieve', action='correct') |
---|
48 | ## map.connect('retrieve/:uri', controller = 'retrieve') |
---|
49 | |
---|
50 | ## # This route doesn't match the controller's parameters. |
---|
51 | ## #map.connect('csml/:uri', controller='csml_api') |
---|
52 | ## # Below is the way it worked before with added |
---|
53 | ## # "csml" path component |
---|
54 | ## map.connect('csml/:file.:format', controller='csml_api', action='index', |
---|
55 | ## format='html') |
---|
56 | ## map.connect('csml/:file/:(feature).:format', action='getFeature', |
---|
57 | ## controller='csml_api', format='html') |
---|
58 | ## map.connect('csml/:file/:feature/:action', controller='csml_api') |
---|
59 | |
---|
60 | ## map.connect('trackback/:uri', controller='trackback') |
---|
61 | ## map.connect('discovery',controller='discovery') |
---|
62 | ## map.connect('updatetab/:value',controller='tabs',action='update') |
---|
63 | ## map.connect('addSelection/:uri/:name',controller='tabs',action='addSelection') |
---|
64 | ## map.connect('clear/:value',controller='tabs',action='clear') |
---|
65 | |
---|
66 | # Channel all WMS requests to one controller |
---|
67 | map.connect('wms', controller='ddp_wms') |
---|
68 | |
---|
69 | return map |
---|