<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Building your URLs in cubicweb (CubicWeb&#39;s Forge) RSS Feed</title>
    <description></description>
    <link>http://www.cubicweb.org/blogentry/2497043</link>
<item>
<guid isPermaLink="true">http://www.cubicweb.org/blogentry/2497043</guid>
  <title>Building your URLs in cubicweb</title>
  <link>http://www.cubicweb.org/blogentry/2497043</link>
  <description>&lt;h3 class=&quot;title&quot;&gt;Building your URLs in cubicweb&lt;/h3&gt;
&lt;div class=&quot;section&quot; id=&quot;aim&quot;&gt;
&lt;h3&gt;&lt;a&gt;Aim&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In &lt;a class=&quot;reference&quot; href=&quot;http://www.cubicweb.org/&quot;&gt;cubicweb&lt;/a&gt;, you often have to build url&#39;s that redirect the current view to
a specific entity view or allow the execution of a given action. Moreover, you
often want also to fallback to the previous view once the specific action or
edition is done, or redirect also to another entity&#39;s specific view.&lt;/p&gt;
&lt;p&gt;To do so, &lt;a class=&quot;reference&quot; href=&quot;http://www.cubicweb.org/&quot;&gt;cubicweb&lt;/a&gt; provides you with a set of powerful tools, however as
there is often &lt;em&gt;more than one way to do it&lt;/em&gt;, this blog entry is here to help
you in choosing the preferred way.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot; id=&quot;tools-at-your-disposal&quot;&gt;
&lt;h3&gt;&lt;a&gt;Tools at your disposal&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;section&quot; id=&quot;the-universal-url-builder-build-url&quot;&gt;
&lt;h4&gt;&lt;a&gt;The universal URL builder: &lt;tt class=&quot;docutils literal&quot;&gt;build_url()&lt;/tt&gt;&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;build_url&lt;/em&gt; is accessible in any context, so for instance in the rendering of a
given entity view you can call &lt;tt class=&quot;docutils literal&quot;&gt;self._cw.build_url&lt;/tt&gt; to build you URLs easily,
which is the most common case. In class methods (for instance, when declaring the
rendering methods of an &lt;em&gt;EntityTableView&lt;/em&gt;), you can access it through the context
of instantiated appobject which are usually given as argument,
e.g. &lt;tt class=&quot;docutils literal&quot;&gt;entity._cw.build_url&lt;/tt&gt;. For test purposes you can also call
&lt;tt class=&quot;docutils literal&quot;&gt;session.build_url&lt;/tt&gt; in cubicweb shells.&lt;/p&gt;
&lt;p&gt;&lt;tt class=&quot;docutils literal&quot;&gt;build_url&lt;/tt&gt; basically take a first optional, the &lt;em&gt;path&lt;/em&gt;, relative to the base
url of the site, and arbitrary named arguments that will be encoded as url
parameters. Unless you wish to direct to a custom controller, or to match
an URL rewrite url, you don&#39;t have to specify the &lt;em&gt;path&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Extra parameters given to &lt;em&gt;build_url&lt;/em&gt; will vary according to your needs, however
most common arguments understood by default cubicweb views are the followings:&lt;/p&gt;
&lt;ul class=&quot;simple&quot;&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;vid&lt;/tt&gt;: the built view &lt;tt class=&quot;docutils literal&quot;&gt;__regid__&lt;/tt&gt;;&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;rql&lt;/tt&gt;: the RQL query used to retreive data on which the view should be
applied;&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;eid&lt;/tt&gt;: the identifier of an entity, which you should use instead of &lt;tt class=&quot;docutils literal&quot;&gt;rql&lt;/tt&gt;
when the view apply to a single entity (most often);&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;__message&lt;/tt&gt;: an information message to display inside the view;&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;__linkto&lt;/tt&gt;: in case of an entity creation url, will allow to set some
specific relations between both entities;&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;__redirectpath&lt;/tt&gt;: the URL of the entity of the redirection;&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;__redirectvid&lt;/tt&gt;: the view id of the redirection.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;tt class=&quot;docutils literal&quot;&gt;__redirectvid&lt;/tt&gt; and &lt;tt class=&quot;docutils literal&quot;&gt;__redirectpath&lt;/tt&gt; are used to control redirection after
posting a form and are more detailed in the cubicweb documentation, chapter
related to the edition control
(&lt;a class=&quot;reference&quot; href=&quot;http://docs.cubicweb.org/devweb/edition/editcontroller.html&quot;&gt;http://docs.cubicweb.org/devweb/edition/editcontroller.html&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot; id=&quot;exploring-entities-associated-urls&quot;&gt;
&lt;h4&gt;&lt;a&gt;Exploring entities associated URLs&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Generally, an entity has two important methods that retrieve its absolute or
relative urls:&lt;/p&gt;
&lt;ul class=&quot;simple&quot;&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;entity.rest_path()&lt;/tt&gt; will return something like &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;&amp;lt;type&amp;gt;/&amp;lt;eid&amp;gt;&lt;/span&gt;&lt;/tt&gt; where
&amp;lt;type&amp;gt; corresponds to the entity type and &amp;lt;eid&amp;gt; the entity eid;&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;entity.absolute_url()&lt;/tt&gt; will return the full url of the entity
&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;http://&amp;lt;baseurl&amp;gt;/&amp;lt;type&amp;gt;/&amp;lt;eid&amp;gt;&lt;/span&gt;&lt;/tt&gt;. In case you want to access a specific view
of the entity, just pass the &lt;em&gt;vid=&#39;myviewid&#39;&lt;/em&gt; argument. You can give
arbitrary arguments to this method that will be encoded as url parameters.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot; id=&quot;getting-a-proper-rql&quot;&gt;
&lt;h4&gt;&lt;a&gt;Getting a proper RQL&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Passing the rql to the &lt;em&gt;build_url&lt;/em&gt; method requires to have a proper RQL
expression. To do so, there is a convenience method, &lt;em&gt;printable_rql()&lt;/em&gt;, that is
accessible in rset resulting from RQL queries. This allows to apply a view to the
same result set as the one currently process, simply using &lt;tt class=&quot;docutils literal&quot;&gt;rql =
self.cw_rset.printable_rql()&lt;/tt&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot; id=&quot;getting-urls-from-the-current-view&quot;&gt;
&lt;h4&gt;&lt;a&gt;Getting URLs from the current view&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;There are several ways to get URL of the current view, the canonical one being to
use &lt;tt class=&quot;docutils literal&quot;&gt;self._cw.relative_path(includeparams=True)&lt;/tt&gt; which will return the path of
the current view relative to the base url of the site (otherwise use
&lt;tt class=&quot;docutils literal&quot;&gt;self._cw.url()&lt;/tt&gt;, including parameters or not according to value given as
&lt;tt class=&quot;docutils literal&quot;&gt;includeparams&lt;/tt&gt;).&lt;/p&gt;
&lt;p&gt;You can also retrieve values given to individual parameters using &lt;tt class=&quot;docutils literal&quot;&gt;self._cw.form&lt;/tt&gt;, eg:&lt;/p&gt;
&lt;ul class=&quot;simple&quot;&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;self._cw.form.get(&#39;vid&#39;,&lt;/span&gt; &#39;&#39;)&lt;/tt&gt; will return only the view id;&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;self._cw.form.get(&#39;rql&#39;,&lt;/span&gt; &#39;&#39;)&lt;/tt&gt; will return only the RQL;&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;self._cw.form.get(&#39;__redirectvid&#39;,&lt;/span&gt; &#39;&#39;)&lt;/tt&gt; will return the redirection
view if defined;&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;self._cw.form.get(&#39;__redirectpath&#39;,&lt;/span&gt; &#39;&#39;)&lt;/tt&gt; will return the redirection
path if defined.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot; id=&quot;how-to-redirect-to-non-entity-view&quot;&gt;
&lt;h3&gt;&lt;a&gt;How to redirect to non-entity view?&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This case often appears when you want to create a link to a startup view or a
controller. It the first case, you simply build you URL like this:&lt;/p&gt;
&lt;pre class=&quot;literal-block&quot;&gt;
self._cw.build_url(&#39;view&#39;, vid=&#39;my_view_id&#39;)
&lt;/pre&gt;
&lt;p&gt;The latter case appears when you want to call a controller directly without
having to define a form in your view. This can happen for instance when you
want to create a URL that will set a relation between 2 objects and do not need
any confirmation for that. The URL construction is done like this:&lt;/p&gt;
&lt;pre class=&quot;literal-block&quot;&gt;
self._cw.build_url(&#39;my_controller_id&#39;, arg1=value1, arg2=value2, ...)
&lt;/pre&gt;
&lt;p&gt;Any extra arguments passed to the &lt;tt class=&quot;docutils literal&quot;&gt;build_url&lt;/tt&gt; method will be available in the
controller as key, values pairs of the &lt;tt class=&quot;docutils literal&quot;&gt;self._cw.forms&lt;/tt&gt; dictionary. This is
especially useful when you want to define some kind of hidden attributes
but there is not form to put them into.&lt;/p&gt;
&lt;p&gt;And, last but not least, a convenient way to get the root URL of the instance:&lt;/p&gt;
&lt;pre class=&quot;literal-block&quot;&gt;
self._cw.base_url()
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot; id=&quot;how-to-link-to-a-registered-action&quot;&gt;
&lt;h3&gt;&lt;a&gt;How to link to a registered action?&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;There are other ways to create a link to registered actions than using
&lt;em&gt;build_url&lt;/em&gt;, mostly by accessing them &lt;em&gt;via&lt;/em&gt; the registry &lt;em&gt;vreg&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;For instance, the action registry holds effectively all possible actions in a
given context: a specific action can be selected using the &lt;em&gt;select_or_none()&lt;/em&gt;
method, or even using the &lt;em&gt;possible_action()&lt;/em&gt; method which will return a list of
categorized actions. The url of the action is then available as
&lt;tt class=&quot;docutils literal&quot;&gt;action.url()&lt;/tt&gt;. For contextual components (e.g. boxes), you can even directly
get a link to the selected action(s) using the &lt;tt class=&quot;docutils literal&quot;&gt;self.action_link(this_action)&lt;/tt&gt;
method.&lt;/p&gt;
&lt;p&gt;If the action corresponds to the creation of a new entity, there is an even
faster and elegant way to do it, using the schema of your cube:&lt;/p&gt;
&lt;pre class=&quot;literal-block&quot;&gt;
url = self._cw.vreg[&amp;quot;etypes&amp;quot;].etype_class(&#39;MyEntity&#39;).cw_create_url(self._cw)
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot; id=&quot;some-concrete-cases&quot;&gt;
&lt;h3&gt;&lt;a&gt;Some concrete cases&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Get the URL of the &lt;em&gt;outofcontext&lt;/em&gt; view of an entity:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;n&quot;&gt;link&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;entity&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;absolute_url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;outofcontext&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Create a link to a given controller then fall back to the current view:&lt;/p&gt;
&lt;ul class=&quot;simple&quot;&gt;
&lt;li&gt;In your entity view:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;u&amp;#39;&amp;lt;a href=&amp;quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%s&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;gt;Click me&amp;lt;/a&amp;gt;&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;xml_escape&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_cw&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;build_url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;mycontrollerid&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;arg1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;arg2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;rql&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cw_rset&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;printable_rql&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;__redirectvid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_cw&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;vid&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))))&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;ul class=&quot;simple&quot;&gt;
&lt;li&gt;In your controller:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;publish&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
     &lt;span class=&quot;n&quot;&gt;value1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;value2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_cw&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;arg1&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_cw&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;arg2&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
     &lt;span class=&quot;c&quot;&gt;# do some stuff with value1 and value2 here...&lt;/span&gt;
     &lt;span class=&quot;k&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Redirect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_cw&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;build_url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rql&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_cw&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;rql&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;vid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_cw&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;__redirectvid&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;__message&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;you message&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Create a link to add a given entity and relate this entity to the current one
with a relation &lt;em&gt;&#39;child_of&#39;&lt;/em&gt;, then go back to the current entity&#39;s view:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;n&quot;&gt;entity&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cw_rset&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_entity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;u&amp;#39;&amp;lt;a href=&amp;quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%s&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;gt;Click me&amp;lt;/a&amp;gt;&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;xml_escape&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_cw&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;build_url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;add/Mychildentity&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;__linkto&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;child_of:&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%s&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:object&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;entity&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;eid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;__redirectpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;entity&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rest_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;__redirectvid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_cw&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;vid&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))))&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Same example, but we suppose that we are in a multiple rset entity view, and we
want to go back afterwards to this view:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;n&quot;&gt;entity&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cw_rset&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_entity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;u&amp;#39;&amp;lt;a href=&amp;quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%s&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;gt;Click me&amp;lt;/a&amp;gt;&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;xml_escape&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_cw&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;build_url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;add/Mychildentity&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;rql&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cw_rset&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;printable_rql&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;__linkto&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;child_of:&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%s&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:object&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;entity&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;eid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;__redirectvid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_cw&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;vid&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))))&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Create links to all &lt;em&gt;&#39;menuactions&#39;&lt;/em&gt; in a view:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;n&quot;&gt;actions&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_cw&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vreg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;actions&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;possible_actions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_cw&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rset&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cw_rset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;action_links&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;unicode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;action_link&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;actions&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;menuactions&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;())]&lt;/span&gt;
&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;u&amp;#39;  |  &amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;action_links&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
</description>
  <dc:date>2012-09-25T16:17-01:00</dc:date>
  <dc:creator>Stéphane Bugat</dc:creator>
</item>
  </channel>
</rss>