web/views/urlpublishing.py
changeset 8039 1fe90d4ec307
parent 7828 749e1a67987f
child 8272 18893bb969d2
--- a/web/views/urlpublishing.py	Fri Oct 28 11:44:50 2011 +0200
+++ b/web/views/urlpublishing.py	Fri Oct 28 12:07:37 2011 +0200
@@ -17,21 +17,42 @@
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
 """Associate url's path to view identifier / rql queries.
 
-It currently handles url path with the forms:
+CubicWeb finds all registered URLPathEvaluators, orders them according
+to their ``priority`` attribute and calls their ``evaluate_path()``
+method. The first that returns something and doesn't raise a
+``PathDontMatch`` exception wins.
+
+Here is the default evaluator chain:
 
-* <publishing_method>
-* minimal REST publishing:
+1. :class:`cubicweb.web.views.urlpublishing.RawPathEvaluator` handles
+   unique url segments that match exactly one of the registered
+   controller's *__regid__*. Urls such as */view?*, */edit?*, */json?*
+   fall in that category;
+
+2. :class:`cubicweb.web.views.urlpublishing.EidPathEvaluator` handles
+   unique url segments that are eids (e.g. */1234*);
 
-  * <eid>
-  * <etype>[/<attribute name>/<attribute value>]*
-* folder navigation
+3. :class:`cubicweb.web.views.urlpublishing.URLRewriteEvaluator`
+   selects all urlrewriter components, sorts them according to their
+   priorty, call their ``rewrite()`` method, the first one that
+   doesn't raise a ``KeyError`` wins. This is where the
+   :mod:`cubicweb.web.views.urlrewrite` and
+   :class:`cubicweb.web.views.urlrewrite.SimpleReqRewriter` comes into
+   play;
 
-You can actually control URL (more exactly path) resolution using an
-URL path evaluator.
+4. :class:`cubicweb.web.views.urlpublishing.RestPathEvaluator` handles
+   urls based on entity types and attributes : <etype>((/<attribute
+   name>])?/<attribute value>)?  This is why ``cwuser/carlos`` works;
+
+5. :class:`cubicweb.web.views.urlpublishing.ActionPathEvaluator`
+   handles any of the previous paths with an additional trailing
+   "/<action>" segment, <action> being one of the registered actions'
+   __regid__.
+
 
 .. note::
 
- Actionpath and Folderpath execute a query whose results is lost
+ Actionpath executes a query whose results is lost
  because of redirecting instead of direct traversal.
 """
 __docformat__ = "restructuredtext en"