-
Notifications
You must be signed in to change notification settings - Fork 11
/
PYLONS.txt
59 lines (42 loc) · 2.63 KB
/
PYLONS.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Controller:
To use the native pylons controller in your pylons app, you need to set up
a controller (which we assume to be called "sword.py" for the duration of this
document, with the content:
from sss.pylons_sword_controller import SwordController
__controller__ = "SwordController"
That is all.
middleware.py
You need to comment out the error handling code in middleware.py otherwise
it will bork the sword error messages, and authentication with http basic will
become impossible
routing.py
In order to make the routes work properly, you need to remove the public/index.html
to make the "/" route work properly
"""Routes configuration
The more specific and detailed routes should be defined first so they
may take precedent over the more generic routes. For more information
refer to the routes manual at http://routes.groovie.org/docs/
"""
from pylons import config
from routes import Mapper
def make_map():
"""Create, configure and return the routes Mapper"""
map = Mapper(directory=config['pylons.paths']['controllers'],
always_scan=config['debug'])
map.minimization = False
# CUSTOM ROUTES HERE
map.connect('/', controller="sword", action="webui") # Home page, with an intro and some handy links
map.connect('/sd-uri', controller="sword", action="service_document") # From which to retrieve the service document
map.connect('/sd-uri/{path:.*?}', controller="sword", action="service_document") # for sub-service documents
map.connect('/col-uri/{path:.*?}', controller="sword", action="collection") # Representing a Collection as listed in the service document
map.connect('/cont-uri/{path:.*?}', controller="sword", action="media_resource") # The URI used in atom:content@src
map.connect('/em-uri/{path:.*?}', controller="sword", action="media_resource") # The URI used in atom:link@rel=edit-media
map.connect('/edit-uri/{path:.*?}', controller="sword", action="container") # The URI used in atom:link@rel=edit
map.connect('/state-uri/{path:.*?}', controller="sword", action="statement") # The URI used in atom:link@rel=sword:statement
map.connect('/agg-uri/{path:.*?}', controller="sword", action="aggregation") # The URI used to represent the ORE aggregation
# NOT PART OF SWORD: sword says nothing about how components of the item are identified, but here we use the
# PART-URI prefix to denote parts of the object in the server
map.connect('/part-uri/{path:.*?}', controller="sword", action="part")
# NOT PART OF SWORD: for convenience to supply HTML pages of deposited content
map.connect('/html/{path:.*?}', controller="sword", action="webui")
return map