|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2012-01-12 22:31:41
|
Revision: 443
http://sword-app.svn.sourceforge.net/sword-app/?rev=443&view=rev
Author: richard-jones
Date: 2012-01-12 22:31:35 +0000 (Thu, 12 Jan 2012)
Log Message:
-----------
add routing configuration documentation for pylons
Modified Paths:
--------------
sss/branches/sss-2/PYLONS.txt
Modified: sss/branches/sss-2/PYLONS.txt
===================================================================
--- sss/branches/sss-2/PYLONS.txt 2012-01-12 21:57:04 UTC (rev 442)
+++ sss/branches/sss-2/PYLONS.txt 2012-01-12 22:31:35 UTC (rev 443)
@@ -7,4 +7,43 @@
routing.py
-... document routes here ...
+"""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
+
+ # The ErrorController route (handles 404/500 error pages); it should
+ # likely stay at the top, ensuring it can always be resolved
+ map.connect('/error/{action}', controller='error')
+ map.connect('/error/{action}/{id}', controller='error')
+
+ # 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/{sub_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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|