source: MILK/trunk/milk_server/milk_server/config/routing.py @ 5299

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/MILK/trunk/milk_server/milk_server/config/routing.py@5931
Revision 5299, 4.2 KB checked in by cbyrom, 11 years ago (diff)

Add new controller, feeds, to centralise all feed creation code. Add
new template, feed_creator, to allow input form to directly create
atom feed entry. Add general feed to discovery search page - tieing
this to the feed created by feed_creator. Add icons for feed and
include these in the config set up.

Line 
1"""
2Setup your Routes options here
3"""
4import os
5from routes import Mapper
6
7def make_map():
8    root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
9
10    map = Mapper(directory=os.path.join(root_path, 'controllers'))#, explicit=True)
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   
21    # atom editor specific routing
22    map.connect('upload', 'upload/:uri', controller = 'atom_editor/editatom', action='upload', uri = None)
23    map.connect('delete', 'deleteAtom/:uri', controller = 'atom_editor/editatom', action='delete')
24    map.connect('edit', 'editAtom/:uri', controller = 'atom_editor/editatom', action='edit')
25    map.connect('save', 'saveAtom/:uri/:saveLevel', controller = 'atom_editor/editatom', \
26                action='saveAtom', saveLevel='0')
27    map.connect('create', 'createAtom/:saveData', controller = 'atom_editor/editatom', action='create', \
28                saveData = None)
29    map.connect('createGranule', 'createGranule', controller = 'atom_editor/editatom', action='createGranule')
30    map.connect('example', 'exampleGranulite', controller = 'atom_editor/listatom', action='showExampleGranulite')
31    map.connect('help', 'help', controller = 'atom_editor/listatom', action='showAtomHelp')
32    map.connect('atomHome', 'atomHome', controller = 'atom_editor/listatom', action='atomHome')
33    map.connect('list', 'listAtom/:searchData/:associatedAtomID/:associatedAtomType/:associationType', \
34                controller = 'atom_editor/listatom', action='list', searchData='', \
35                associatedAtomID='', associatedAtomType='', associationType='')
36   
37    map.connect('viewAssociatedData', 'viewAssociatedData/:type/:uri', controller = 'browse/retrieve', action='viewAssociatedData')
38
39    # routing for the browse/discovery server
40    map.connect('login', controller='login')
41    map.connect('getCredentials', controller='login', action='getCredentials')
42    map.connect('wayf', controller='wayf')
43    map.connect('logout', controller='logout')
44    map.connect('semantic',controller='browse/discovery', action='semantic')
45    map.connect('view/:uri', controller = 'browse/retrieve', action='view')
46    map.connect('browseHome', controller = 'browse/retrieve', action='home')
47    map.connect('retrive', 'retrieve/:uri', controller = 'browse/retrieve')
48    map.connect('selectedItems',controller='visualise/selectedItems',action='index')
49    map.connect('viewItems',controller='visualise/viewItems',action='index')
50    map.connect('addSelectedItem/:entryid/:divid',
51                controller='visualise/selectedItems',action='addSelectedItem')
52    map.connect('unSelectItem/:entryid/:divid', controller='visualise/selectedItems',action='unSelectItem')
53    map.connect('removeSelectedItem/:entryid',controller='visualise/selectedItems',action='removeSelectedItem')
54
55    map.connect('discovery',controller='browse/discovery')
56
57    # routing for trackback
58    map.connect('trackback/:uri', controller='trackback/trackback', action='ping')
59    map.connect('askCorrect/:uri', controller='trackback/trackback', action='askCorrect')
60    map.connect('correct/:uri', controller='trackback/trackback', action='correct')
61
62    # routing for the autocomplete vocab server search input
63    map.connect('doVocabSearch', controller = 'vocabsearch/vocabsearch', action='doVocabSearch')
64
65    # routing for retrieving and adding feeds
66    map.connect('getFeed', 'getFeed/:feedType', controller = 'feed', action='getFeed')
67    map.connect('createFeedEntry', 'createFeedEntry/:feedType', controller = 'feed', action='createFeedEntry')
68    map.connect('addFeedEntry', 'addFeedEntry', controller = 'feed', action='addFeedEntry')
69
70    #do this last or else you'll get bizarre behaviour
71    map.connect('default', '',controller='home',action='index')
72    map.connect('clearSession',controller='browse/discovery',action='clearSession')
73    return map
Note: See TracBrowser for help on using the repository browser.