Wiki source code of Standard URL Format

Version 13.1 by Thomas Mortagne on 2008/12/10

Show last authors
1 1 URLs resolution
2
3 In a single instance of XWiki you have many sections and the URLs need to reflect all that. This documentation details the way URLs are parsed by XWiki and what means each part of it.
4
5 {image:url.png}
6
7 1.1 Protocol
8 By default "http" is used when generating an url in XWiki. You can set "secure" parameter to true in a wiki descriptor to generate urls with "https" in "http".
9
10 See [How to edit wiki descriptor>manager:AdminGuide.EditWiki].
11
12 1.1 Host
13 * The first thing XWiki do to find the right wiki the URL is pointing to is by trying to find <tt>wiki1.xwiki.org</tt> in the list of wiki descriptors. Comparing with the content of field <tt>server</tt> in objects of class XWiki.XWikiServerClass
14 * If no descriptor can be found:
15 ** if the host is an IP (127.0.0.1, 85.65.12.36, etc.) XWiki goes to main wiki
16 ** if the first part of the host name (what is before the first point) is "www" XWiki goes to main wiki
17 ** if the first part of the host name match a wiki identifier XWiki goes to this wiki
18
19 1.1 Application context (OPTIONAL)
20
21 It's what the web container (jetty, tomcat, glassfish, etc.) use to find XWiki in all the web applications it contains. To remove it mainly depends on the possibilities and configuration of your web container.
22
23 See [platform:Main.ShortURLs#HApplicationname] for more details on how to remove this part of the url.
24 1.1 Struts action (OPTIONAL)
25
26 This is used by struts to call the right servlet.
27
28 It can be:
29 * /bin/: it's the default action is none is specified. It calls the standard XWiki view to edit/view/delete wiki page etc.
30 * /wiki/wikialias: call the same servlet but will be use to determine the subwiki to acces if <tt>xwiki.virtiual.usepath</tt> is enabled in <tt>xwiki.cfg</tt>. Notes that you can change the "wiki" part with anything else using <tt>xwiki.virtual.usepath.servletpath</tt> and by modifying web.xml to reflect the new Struts action name. If the struts action name is the same that.
31 ** XWiki tries to match a wiki descriptor with the provided <tt>wikialias</tt> like it was a domain name
32 ** then if it can't find any wiki descriptor it search for it with <tt>wikialias</tt> as wiki name
33 * /xmlrpc/: call xmlrpc servlet.
34 * /webdav/: call webdav servlet. See [dev:Drafts.WebDAV] for more details.
35
36 See [platform:Main.ShortURLs#HStrutsactionname] more more details on how to remove this part of the url.
37 1.1 XWiki action (OPTIONAL)
38 When the struts action is <tt>bin</tt> or the value of <tt>xwiki.virtual.usepath.servletpath</tt>, XWiki use "action" identifiers to determine what is the goal of the user when going to a page.
39
40 For example if the action is "edit" XWiki will print an editor the user use to modify a page content but if the "view" action is used XWiki will execute the page content to print/render the content.
41
42 1.1 Space
43 All XWiki page are located in what is called a "space". You have only one level of space but you can indicate a "parent space" for a space.
44
45 1.1 Page
46 The page is what contains wiki contents and objects/classes and attachments.
47
48 1.1 Attachment
49 This part indicate the attachment you want to download from a particular page.
50
51 1.1 Query string
52 Actions can use URL parameters to modify there action depending of there value.
53
54 For example you can make a velocity script that print the content of this value with:
55 {code}
56 The value of the parameter is: $request.param1
57 {code}
58 if you have a parameter "param1=Hello World" the result will be
59 {code}
60 The value of the parameter is: Hello World
61 {code}

Get Connected