OpenWGA 7.1 - WebTML reference

WebTML tags

<tml:url>

Description :

Generates urls for different OpenWGA resources. The resource type depends on the attribute "type". The default type is "content".

You can use tag <tml:param> inside the content of <tml:url> to define parameters to add to the URL. <tml:url> supports var parameters, which add a WebTML variable to the called request as well as regular URL parameters. See URL parameters from the guide for a description.

<tml:url> also supports shortcut attributes to define parameters: v_variable for var parameters and u_urlparam for URL parameters

Derived from: Attributes:
show inherited attributes ...
Name Value(s) Purpose
absolute true | false Defines if the generated URL should be absolute or relative.
action id | tml-script-module-reference Defines the action for which an url is generated. The action can be specified by id or by tml script module reference. The type attribute is automatically set to "action".
db db-key Defines the target database for the url being generated
debounce true | false Only valid on type="action". Activates or deactivates the debounce feature of the action.
derivate derivate-query Lets the generated URL address a file derivate of the specified file instead of the original
doc filecontainer | documentkey Defines the document reference.
file filename Defines the file for which the URL is generated
keepparams true | false Adds all var and URL parameters to the URL that were available on the current request
layout tml-module-name Defines the tml layout for the referenced page.
medium media-key Valid on type="content" and type="tml": Specifies the media key of the tml module.
mode portlet-mode Deprecated: Use <tml:url action="$refresh" portletmode="<mode>"/> instead.
name design-resource-name Valid on type="css|js" and type="tml": Specifies the name of the design resource an url is generated for.
page page-number Defines the page number for the generated URL on type="selectpage".
pkey portletkey Deprecated: Use <tml:url action="$refresh" portletmode="<mode>"/> instead.
plainlink true | false

Only valid on type="action". Attribut plainlink='true' enforces to call the action via a GET request using a plain URL. No POST request will be used and no JavaScript called to call the action.

Depending on the current environment OpenWGA may choose to provide an action link in the form of a JavaScript call that ultimately uses a POST request to call the action. This attribute bypasses this choice and enforces a plain action URL.

Note that the some WebTML features rely on actions to be called via JavaScript / POST-Request:

  • Keeping WebTML form data
  • Managing the status of WebTML portlets
Using plainlink="true" in combination with one of these features will result in malfunctions.

protocol http | https | ... Forces to generate the URL with the specified protocol.
sourcetag tag-id Valid on type="nextpage|previouspage": Specifies the id of the foreach tag whose paging should be referenced.
type="action" action Defines an url which calls an tml action.
type="changelanguage" changelanguage Renders a link which will change the preferred language of the current user.
type="content" content Renders an URL to the document in context
type="css | js" css|js Creates an url to a java script or css resource which can be specified by the attribute "name".
type="file" file Creates an url to a file resource. The file can be contained within a file container or an attachment on a content document.
The attribute "doc" is used to refer the container. The attribute "file" specifies the filename.
type="homepage" Generates an URL to the homepage of an OpenWGA application
type="login" login Creates an url to the login page of the current database.
type="logout" logout Creates an url which allows the user to logout from an OpenWGA domain.
type="nextpage | previouspage | selectpage" nextpage | previouspage Creates an url which allows paging over the pages of a <tml:foreach> tag.
type="tml" tml Creates an url to a tml module which should be rendered without document context.
type="tmlform" Generates an URL to a file on the current WebTML form
u_urlparam value Shorthand for defining regular URL parameters
v_variable value Shorthand for defining WebTML variable parameters

Details:

Parameters can be added to generated URLs by using <tml:param> inside this tag. They can be used to parametrize the request to this URL. There are two types of parameters:

1. WebTML Variable parameters:

<tml:url><tml:param name="query">View</tml:param></tml:url>

These parameters are sent in an encrypted form and therefor safe from user modifications. On calling that URL the parameter will be available as normal WebTML variable on the following request. This type of parameter cannot be read in plain form from clientside Javascript.

2. Normal URL parameters, identified by type="url":

<tml:url><tml:param type="url" name="expand">true</tml:param></tml:url>

This parameter is added as normal, plaintext URL parameter to the URL.

See URL parameters from the guide for a more in-depth explanation.

There are also shortcut forms for specifying both types of parameters as attributes directly on the <tml:url>. These two are shortform equivalents of the code examples above:

<tml:url v_query="View"/>


<tml:url u_expand="true"/>

Note that using this parameter functionality is the only safe way to add parameters to URLs generated by <tml:url>. Simply extending the generated URL with parameter text right after the tag, like in the following example, is discouraged:

<a href="<tml:url>?expand=true">Link</a>

The tag <tml:url> may implicitly generate URL parameters which then will break the URL syntax.

This tag is derived from <tml:[All action calling tags]> as it is able to generate URLs for calling WebTML actions. The attributes inherited from there are only effective when type="action" is used.