URL structure, was Re: Quick rants about your BTS
Christian Robottom Reis
kiko at async.com.br
Tue Mar 28 16:22:10 BST 2006
On Tue, Mar 28, 2006 at 05:09:44PM +0900, Kai Hendry wrote:
> > https://launchpad.net/products/malone/+filebug
>
> I wonder why on earth there is a + sign in the URL.
The URL structure in Launchpad follows some rules which are pretty
simple but perhaps obscure to most people:
- A path component can have one or more literal components under it.
Examples are:
/products/+new
/products/malone/+filebug
/distros/ubuntu/+allpackages
In the first example above, the string "+new" is attached to the
/products component.
- A path component can be "traversed" using a custom function which
generally produces components based on data (I'm calling them
"data URL components"). Examples are:
/products/malone
There is a traversal function attached to the component
"/products"; the word "malone" identifies a product by its
unique name.
/distros/ubuntu
There is a traversal function attached to the component
"/distros"; the word "ubuntu" identifies a distribution by its
unique name.
/products/malone/+bugs/1
There is a traversal function attached to the component
"+bugs" (which itself is a literal component attached to the
product "malone"); the value "1" identifies a bug by its
unique ID.
The reason literal components have a plus is generally to disambiguate
the literal component in the URL from a "data URL component". For
instance, compare
/products/+new
with
/products/new
If we didn't use a plus to prefix the literal component, and someone
registered a product called "new", we'd have a pathname clash.
I don't like the plusses very much, myself, but I have grown used to
them. One alternative to them is blacklisting names (so creating a
product called "new" would be forbidden); that approach is not very
future-proof, however, and we haven't considered changing yet.
Note that we are not entirely consistent with the use of plusses when a
component has no data traversal under it; that's perhaps the reason why
we have launchpad.net/malone and launchpad.net/products but also
launchpad.net/+builds.
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3376 0125
More information about the launchpad-users
mailing list