-
Notifications
You must be signed in to change notification settings - Fork 20
/
routes.ini
161 lines (144 loc) · 8.75 KB
/
routes.ini
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
[routes]
; "Play" avoids to use the "show" of Omeka and the "view" of BookReader.
universalviewer_player.route = ":recordtype/play/:id"
universalviewer_player.defaults.module = "universal-viewer"
universalviewer_player.defaults.controller = "player"
universalviewer_player.defaults.action = "play"
universalviewer_player.reqs.recordtype = "collections|items"
universalviewer_player.reqs.id = "\d+"
; @todo It is recommended to use a true identifier (ark, urn…], not an internal id.
; @link http://iiif.io/api/presentation/2.0
; Collection {scheme}://{host}/{prefix}/collection/{name}
; Manifest {scheme}://{host}/{prefix}/{identifier}/manifest
; Sequence {scheme}://{host}/{prefix}/{identifier}/sequence/{name}
; Canvas {scheme}://{host}/{prefix}/{identifier}/canvas/{name}
; Annotation {scheme}://{host}/{prefix}/{identifier}/annotation/{name}
; AnnotationList {scheme}://{host}/{prefix}/{identifier}/list/{name}
; Range {scheme}://{host}/{prefix}/{identifier}/range/{name}
; Layer {scheme}://{host}/{prefix}/{identifier}/layer/{name}
; Content {scheme}://{host}/{prefix}/{identifier}/res/{name}.{format}
; @link http://iiif.io/api/image/2.0
; Image {scheme}://{server}{/prefix}/{identifier}
; Special route for the dynamic collections, search or browse pages.
; The first letter "c", "i", or "m" is used to distinct collections, items and
; media and are not required when the identifier is always unique for all of
; resources. The default letter is "i", so it is not required when all ids are
; items (the most common case). If the list contains only one id, the comma is
; required to avoid confusion with a normal collection.
; This route should be set before the "universalviewer_presentation_collection".
universalviewer_presentation_collection_list.route = "iiif/collection/:id"
universalviewer_presentation_collection_list.defaults.module = "universal-viewer"
universalviewer_presentation_collection_list.defaults.controller = "presentation"
universalviewer_presentation_collection_list.defaults.action = "list"
universalviewer_presentation_collection_list.reqs.id = "(?:[cim]?\-?\d+\,?)+"
; For collections, the spec doesn't specify a name for the manifest itself.
; Libraries use an empty name or "manifests", "manifest.json", "manifest",
; "{id}.json", etc. Here, an empty name is used, and a second route is added.
; Invert the names of the route to use the generic name for the manifest itself.
universalviewer_presentation_collection.route = "iiif/collection/:id"
universalviewer_presentation_collection.defaults.module = "universal-viewer"
universalviewer_presentation_collection.defaults.controller = "presentation"
universalviewer_presentation_collection.defaults.action = "collection"
universalviewer_presentation_collection.reqs.id = "\d+"
universalviewer_presentation_collection_redirect.route = "iiif/collection/:id/manifest"
universalviewer_presentation_collection_redirect.defaults.module = "universal-viewer"
universalviewer_presentation_collection_redirect.defaults.controller = "presentation"
universalviewer_presentation_collection_redirect.defaults.action = "collection"
universalviewer_presentation_collection_redirect.reqs.id = "\d+"
universalviewer_presentation_item.route = "iiif/:id/manifest"
universalviewer_presentation_item.defaults.module = "universal-viewer"
universalviewer_presentation_item.defaults.controller = "presentation"
universalviewer_presentation_item.defaults.action = "item"
universalviewer_presentation_item.reqs.id = "\d+"
; The redirection is not required for presentation, but a forward is possible.
universalviewer_presentation_item_redirect.route = "iiif/:id"
universalviewer_presentation_item_redirect.defaults.module = "universal-viewer"
universalviewer_presentation_item_redirect.defaults.controller = "presentation"
universalviewer_presentation_item_redirect.defaults.action = "item"
universalviewer_presentation_item_redirect.reqs.id = "\d+"
; A redirect to the info.json is required by the specification.
universalviewer_image.route = "iiif-img/:id"
universalviewer_image.defaults.module = "universal-viewer"
universalviewer_image.defaults.controller = "image"
universalviewer_image.defaults.action = "index"
; TODO Currently, the id for iiif is a file id.
universalviewer_image.reqs.id = "\d+"
universalviewer_image_info.route = "iiif-img/:id/info.json"
universalviewer_image_info.defaults.module = "universal-viewer"
universalviewer_image_info.defaults.controller = "image"
universalviewer_image_info.defaults.action = "info"
universalviewer_image_info.reqs.id = "\d+"
; This route is a garbage collector that allows to return an error 400 or 501 to
; invalid or not implemented requests, as required by specification.
; This route should be set before the universalviewer_image in order to be
; processed after it.
; TODO Simplify to any number of sub elements.
universalviewer_image_bad.type = "Zend_Controller_Router_Route_Regex"
universalviewer_image_bad.route = "iiif\-img/(\d+)/(.+)/(.+)/(.+)/(.+)\.(.+)"
universalviewer_image_bad.defaults.module = "universal-viewer"
universalviewer_image_bad.defaults.controller = "image"
universalviewer_image_bad.defaults.action = "bad"
universalviewer_image_bad.map.1 = "id"
universalviewer_image_bad.map.2 = "region"
universalviewer_image_bad.map.3 = "size"
universalviewer_image_bad.map.4 = "rotation"
universalviewer_image_bad.map.5 = "quality"
universalviewer_image_bad.map.6 = "format"
universalviewer_image_bad.reverse = "iiif-img/%d/%s/%s/%s/%s.%s"
; A regex is required, because the format is separated with a ".", not a "/".
universalviewer_image_url.type = "Zend_Controller_Router_Route_Regex"
universalviewer_image_url.route = "iiif\-img/(\d+)/(full|\d+,\d+,\d+,\d+|pct:\d+\.?\d*,\d+\.?\d*,\d+\.?\d*,\d+\.?\d*)/(full|\d+,\d*|\d*,\d+|pct:\d+\.?\d*|!\d+,\d+)/(\!?(?:(?:[0-2]?[0-9]?[0-9]|3[0-5][0-9])(?:\.\d*)?|360))/(default|color|gray|bitonal)\.(jpg|png|gif)"
universalviewer_image_url.defaults.module = "universal-viewer"
universalviewer_image_url.defaults.controller = "image"
universalviewer_image_url.defaults.action = "fetch"
universalviewer_image_url.map.1 = "id"
universalviewer_image_url.map.2 = "region"
universalviewer_image_url.map.3 = "size"
universalviewer_image_url.map.4 = "rotation"
universalviewer_image_url.map.5 = "quality"
universalviewer_image_url.map.6 = "format"
universalviewer_image_url.reverse = "iiif-img/%d/%s/%s/%s/%s.%s"
; A redirect to the info.json is required by the specification.
universalviewer_media.route = "ixif-media/:id"
universalviewer_media.defaults.module = "universal-viewer"
universalviewer_media.defaults.controller = "media"
universalviewer_media.defaults.action = "index"
universalviewer_media.reqs.id = "\d+"
universalviewer_media_info.route = "ixif-media/:id/info.json"
universalviewer_media_info.defaults.module = "universal-viewer"
universalviewer_media_info.defaults.controller = "media"
universalviewer_media_info.defaults.action = "info"
universalviewer_media_info.reqs.id = "\d+"
; This route is a garbage collector that allows to return an error 400 or 501 to
; invalid or not implemented requests, as required by specification.
; This route should be set before the universalviewer_media in order to be
; processed after it.
; TODO Simplify to any number of sub elements.
universalviewer_media_bad.type = "Zend_Controller_Router_Route_Regex"
universalviewer_media_bad.route = "ixif\-media/(\d+)\.(.+)"
universalviewer_media_bad.defaults.module = "universal-viewer"
universalviewer_media_bad.defaults.controller = "media"
universalviewer_media_bad.defaults.action = "bad"
universalviewer_media_bad.map.1 = "id"
universalviewer_media_bad.map.2 = "format"
universalviewer_media_bad.reverse = "ixif-media/%d.%s"
; A regex is required, because the format is separated with a ".", not a "/".
universalviewer_media_url.type = "Zend_Controller_Router_Route_Regex"
universalviewer_media_url.route = "ixif\-media/(\d+)\.(pdf|mp3|ogg|mp4|webm|ogv)"
universalviewer_media_url.defaults.module = "universal-viewer"
universalviewer_media_url.defaults.controller = "media"
universalviewer_media_url.defaults.action = "fetch"
universalviewer_media_url.map.1 = "id"
universalviewer_media_url.map.2 = "format"
universalviewer_media_url.reverse = "media/%d.%s"
; For IxIF, some json files should be available to describe media for context.
; This is not used currently: the Wellcome uris are kept because they are set
; for main purposes in UniversalViewer.
; @link https://gist.github.com/tomcrane/7f86ac08d3b009c8af7c
;universalviewer_media_ixif.type = "Zend_Controller_Router_Route_Regex"
;universalviewer_media_ixif.route = "ld/ixif/(.*)"
;universalviewer_media_ixif.defaults.module = "universal-viewer"
;universalviewer_media_ixif.defaults.controller = "media"
;universalviewer_media_ixif.defaults.action = "context"
;universalviewer_media_ixif.map.1 = "ixif"
;universalviewer_media_ixif.reverse = "ld/ixif/%s"