Standard URL Format

Version 62.1 by Vincent Massol on 2015/07/04

The general format of XWiki URLs is <protocol>://<server>/<context path>/<type>/<path>, where:

  • <protocol>: by default it's http. It's possible to use https (See how to modify the wiki descriptor).
  • <server>: the XWiki instance address and port, e.g. localhost:8080, xwiki.org. In domain-mode the server also contains the subwiki name. See Accessing a wiki. In path-based mode, the server is the address of the main wiki.
  • <context path>: the name under which the XWiki web application is deployed in your Servlet Container, e.g. xwiki. See Short URLs if you wish to deploy XWiki as ROOT.
  • <type>: the type of URL depending on the XWiki subsystem accessed. The following types are supported:
    • bin: points to a dynamic resource. Examples: an Entity to display (wiki, page, space, attachment, object, property, etc), a dynamic skin resource (image, css, js), a dynamic template resource (image, js, css, icon, etc) and more. By dynamic we mean that some computation needs to happen to compute the resource (for example some Velocity needs to be evaluated).
    • wiki: this is similar to bin but specifying the subwiki to access, in path-based mode (See Accessing a wiki).
    • rest: points to a REST Resource
    • skins: points to a static filesystem skin resource (image, js, css, etc), i.e. a resource located inside a skin directory on the filesystem.
    • resources: points to a static template resource (image, js, css, etc) on the filesystem.
    • xmlrpc: points to the now deprecated XMLRPC API (see XMLRPC for more details).
    • webdav: points to a WebDAV resource (see Web DAV for more details).
  • <path>: the path completely depends on the <type> used. See below for more details.

If you're interested in configuring the XWiki URLs, check the URL Architecture page.

Type: bin

XWiki 7.2: Added support for Nested Spaces

There are various bin URLs. The generic format of bin URLs is bin/<action>/<path>. The full list of <action> is defined in the Strut Configuration file (located in WEB-INF/struts-config).

Here are some well-known actions:

  • skin: Dynamic Skin resource, e.g. http://<server>/xwiki/bin/skin/skins/flamingo/style.css?skin=XWiki.DefaultSkin&colorTheme=playground%3AFlamingoThemes.Charcoal or http://<server>/xwiki/bin/skin/resources/uicomponents/search/searchSuggest.css
  • jsx: Javascript Skin Extension URL, e.g. http://<server>/xwiki/bin/jsx/AnnotationCode/Settings?language=en
  • ssx: StyleSheet Skin Extension URL, e.g. http://<server>/xwiki/bin/ssx/AnnotationCode/Style?language=en
  • webjars: URL when accessing some resources located in a WebJar, e.g. http://<server>/xwiki/bin/webjars/resources/path?value=requirejs%2F2.1.15%2Frequire.min.js
  • download: URL to access an attachment from a wiki page, e.g. http://<server>/xwiki/bin/download/XWiki/JohnDoe/john.png?width=30&height=30&keepAspectRatio=true
  • view: Display Entity content (wiki, page, space, attachment, object, property, etc) with the skin applied, e.g. http://<server>/xwiki/bin/view/Sandbox/WebHome
  • edit: Edits wiki content (page, object, property, etc), e.g. http://<server>/xwiki/bin/edit/Sandbox/WebHome
  • get: Accessing Entity content (wiki, page, space, attachment, object, property, etc) without any skin applied, e.g. http://<server>/xwiki/bin/get/Main/WebHome?xpage=xpart&vm=commentsinline.vm. The get action should be used to render the content of the page and nothing else (mainly used for code pages). This action is similar to the view action, but without the UI and with "text/plain" mime type set by default for the response.
  • export: Exports wiki pages to various formats (PDF, HTML, etc). See Exports.
  • viewrev: This action is the same as the view action but allowing to address a given revision of the document asked.

Action: view

The additional URL paths for the view action is <space1>/.../<spaceN>/<page>?<query string> or <space1>/.../<spaceN>?<query string>

Examples:

  • http://<server>/xwiki/bin/view/Sandbox/WebHome: Views the Sandbox.WebHome page.
  • http://<server>/xwiki/bin/view/Sandbox: Views the Sandbox.WebHome page.
  • http://<server>/xwiki/bin/view/Space1/Space2: Views the Space1.Space2.WebHome page (if the Space2 page doesn't exist. If it exists then it views the Space1.Space2 page).

Here are some of the supported query string parameters.

Parameter: xpage

  • plain: this value indicates that only the content of the page is printed (no UI). With a document that's not using the XWiki 1.0 syntax you can control the output syntax using outputSyntax and outputSyntaxVersion. You can also pass another parameter named raw which allows you more control:
    • raw=1: Returns the page source as is without any formatting but XML-escaped
    • raw=2: Returns the page source as is without any formatting (without any escaping)
    • htmlHeaderAndFooter=true: Since 6.3RC1 Display the HTML headers (<html>,<head>,<body>, etc...) and footers (</body>, </html>, etc...).
  • xml: print the exported form of a document. This is what you can find in the xar for each document.
  • rev: when specified, redirects to the viewrev action (see below)

Parameter: outputSyntax and outputSyntaxVersion

With a document that's not using the XWiki 1.0 syntax it's possible to explicitly indicate the renderer to use for the page content. For example with outputSyntax=plain you will get the result in plain text. outputSyntaxVersion is an optional parameter, if it's not provided XWiki will search for the last version of the renderer for the given outputSyntax syntax name. Note that outputSyntax controls only the document content output syntax. If you only want the document content you can use xpage=plain.

See Rendering Module for more details on renderers.

Action: viewrev

Parameter: rev

The version to get, e.g. 2.3 in http://<server>/xwiki/bin/viewrev/MySpace/MyPage?rev=2.3 

Action: save

The additional URL paths for the save action is <space>/<page>?<query string>.

Examples:

  • http://<server>/xwiki/bin/save/Sandbox/WebHome: Save the Sandbox.WebHome page.

Here are some of the supported query string parameters.

Parameter: creator

Change the creator of the current page.  Should be a string as a Document Reference like JohnDoe, XWiki.JohnDoe or xwiki:XWiki.JohnDoe which is a page containing an XWiki.Users object.

Parameter: language

Will target a specific language.  You must use a specific 2-letters code (see I18N).

Parameter: objectPolicy

Since 7.1M1 The objectPolicy parameter is a request configuration parameter that will decide how to handle custom query string parameters (see Custom Parameters):

  • update
    • Each custom parameter will update a property in an existing object of the current page.
    • If the custom parameter refers to a property or an object that don't exist, it will simply ignore it.
  • updateOrCreate
    • Each custom parameter will update a property in an existing object of the current page.
    • If the custom parameter refers to a property that doesn't exist, it will ignore it.
    • If the custom parameter refers to an object that doesn't exist, it will create it (and pad will null objects if needed).

      Example: If there is already 2 objects XWiki.XWikiRights in the page, XWiki.XWikiRights_0_levels and XWiki.XWikiRights_1_levels will update these existing objects. XWiki.XWikiRights_2_levels and XWiki.XWikiRights_3_levels will create 2 new objects. XWiki.XWikiRights_42_levels will be created and 37 empty objects too (42 minus the 4 already existing and minus the 42th which will be created).
      Note: All this information about empty/null objects is currently an implementation detail of how we currently handle object numbers and it may be subject to future change so, as much as possible, do not rely on it and, instead, use the public available APIs to handle these things.

Parameter: parent

Allows you to set the parent of the page.  Should be a string as a Document Reference like WebHome, Main.WebHome or xwiki:Main.WebHome.

Parameter: syntaxId

Specify which syntax is used for the content of the current page (see Supported syntaxes).

Parameter: template

Allows you to have a specific template to apply for the current page.  Should be a string as a Document Reference like MyTemplate, Main.MyTemplate or xwiki:Main.MyTemplate.

Parameter: title

Allows you to modify the title of the page.

Custom Parameters

Custom parameters have the format <Space>.<ClassPage>_<number>_<propertyname> (e.g. XWiki.XWikiUsers_0_password or XWiki.WatchListClass_3_interval):

  • <Space> must refer to an existing space of the wiki
  • <ClassPage> must refer to a class
  • <number> is a positive number
  • <propertyname> is a name of a property of the class <Space>.<ClassPage>

Action: inline

The additional URL paths for the inline action is <space>/<page>?<query string>.

Examples:

  • http://<server>/xwiki/bin/inline/Sandbox/WebHome: Edit in inline mode the Sandbox.WebHome page.

For the supported query string parameters, you can refer to the save action.

Action: get

Parameter: htmlHeaderAndFooter

Since 6.3RC1 If htmlHeaderAndFooter=true is passed then display the HTML headers (<html>,<head>,<body>, etc...) and footers (</body>, </html>, etc...).

Action: download

Parameter: force-download

If set, force the attachment to be downloaded instead of being opened in the browser (it sets the Content-Disposition header to attachment instead of inline).

Type: wiki

XWiki 7.2: Added support for Nested Spaces

The format is wiki/<wiki name>/<bin subpath> where:

  • <wiki name>: the name of the subwiki, e.g. platform.
  • <bin spath>: the same path as for the bin action (see above). For example, if you use http://<main wiki server>/xwiki/bin/download/XWiki/JohnDoe/john.png you would use http://<main wiki server>/xwiki/wiki/<subwiki name>/download/XWiki/JohnDoe/john.png to access the same attachment but located in a subwiki named <subwiki>.

Type: resources

Static template resources, e.g. http://<server>/xwiki/resources/js/prototype/prototype.js.

Type: skins

Static skin resources, e.g. http://<server>/xwiki/skins/flamingo/logo.png.

Get Connected