Open the menu

    Resources Available in EL

    The resources available for use in ELs (Expression Language) are presented below. Each resource is associated with a scope. In each scope, the resources from the scope it inherits are also available (which can be redefined in the more specific scope, in this case, there will also be another entry in the table below with the redefinition).

    • Layout File inherits from Global;
    • Request to Interface Instance inherits from Layout File;
    • Doui inherits from Request to Interface Instance;
    • Controls inherit from Doui;

    Variables

    Variable Description Scope
    system

    Maps to an object that has a properties property which is a Map<String, String> containing the system properties.

    Example: ${system.properties.myProperty}

    Global
    environment

    Maps to an object that has a properties property which is a Map<String, List<String>> containing the properties of the environment.

    Example: ${environment.properties.myProperty}

    Global
    param

    Maps the name of a request parameter to a single value.

    Layout File
    paramValues

    Maps the name of a request parameter to an array of values.

    Layout File
    header

    Maps the name of a request header to a single value.

    Layout File
    headerValues

    Maps the name of a request header to an array of values.

    Layout File
    cookie

    Maps the name of the cookie to a single cookie.

    Layout File
    requestScope

    Maps request scope variable names to their values.

    Layout File
    sessionScope

    Maps session scope variable names to their values. Corresponds to the application scope of PortletSession.

    Layout File
    applicationScope

    Maps application scope variable names to their values.

    Layout File
    initParam

    Maps the name of an initialization context parameter to a single value.

    Layout File
    pageWebResource

    Returns the Page Web Resource.

    Layout File
    businessContext

    Maps the properties of a business context.

    Layout File
    portletSessionScope

    Maps session scope variable names of the portlet to their values. Corresponds to the portlet scope of PortletSession.

    Request to Interface Instance
    portletMode

    Maps the current portlet mode for the EL to be evaluated. The mode is represented by a string in lowercase.

    Request to Interface Instance
    windowState

    Maps the current window states for the EL to be evaluated. The state is represented by a string in lowercase.

    Request to Interface Instance
    serviceInterfaceRequest

    Returns an instance of lumis.portal.serviceinterface.IServiceInterfaceRequest. It can be more specifically a lumis.portal.serviceinterface.IServiceInterfaceRenderRequest during a rendering, or lumis.portal.serviceinterface.IServiceInterfaceActionRequest during a processAction.

    Request to Interface Instance
    preference

    Maps the property of preferences of an instance of IServiceInterfaceRequest to a single value.

    Request to Interface Instance
    preferenceValues

    Maps the values of the preferences property of an instance of IServiceInterfaceRequest to an array of values.

    Request to Interface Instance
    douiContext

    Is the current instance of lumis.doui.DouiContext.

    Doui
    controls

    Returns the map of controls.

    Controls
    control

    Returns the current control.

    Controls
    sources

    Returns the map of sources.

    Controls
    source

    Returns the source of the current control, or the default source of the interface if the current control does not have an associated source.

    Controls
    <source field id>

    Returns the value of the field with the given identifier in the first row of the control's source.

    Controls

    Functions

    Function Signature Description Scope
    lum_concat(Object...)

    A utility method to concatenate several objects into strings. The toString method is called on the objects, and if the object is null, it is ignored.

    Parameters:

    • Object: one or more strings to be concatenated.
    Global
    lum_escapeXml(String)

    A utility method to escape a string using XML rules.

    Parameters:

    • String: the string to be escaped.

    Example: lum_escapeXml("<div class='divClass'>") would return &lt;div class=&apos;divClass&apos;&gt;

    Global
    lum_escapeJs(String)

    A utility method to escape a string to be used directly in JavaScript source code as a string literal. Useful when you want to assign a string value to a JavaScript variable, like for example: var myValue = "${lum_escapeJs(value)}".

    Parameters:

    • String: the string to be escaped.

    Example: lum_escapeJs("<div class='divClass'>\n</div>") would return <div class=\'divClass\'>\\n<\/div>

    Global
    lum_localize(String)

    Translates a string using the portal's standard string resource. If in the scope of a request to an interface instance, it uses the interface's string resource.

    Parameters:

    • String: the string to be translated.

    Example: lum_localize('STR_YES')

    Global
    lum_localize(String, String, String...)

    Translates a string using the defined string resources and localization parameters. If the string does not exist in the defined string resource, it will try to use the portal's default strings or, if in the scope of a request to an interface instance, the string resource of the interface.

    Parameters:

    • String: the string to be translated;
    • String: the path of the string resource to be used, multiple resources can be specified separated by ;. If the resource is null, and in the scope of a request to an interface instance, it will use the string resource of the interface.
    • String...: All parameters following the resource are considered localization parameters.

    Example: lum_localize('STR_YES', 'lumis/portal/strings/strings;lumis/service/news', userName) and in the string file <string id="STR_YES">Yes, %1</string>. Example: lum_localize('STR_YES', null, userName) and in the string file <string id="STR_YES">Yes, %1</string>.

    Global
    lum_url(String)

    Resolves the given URL into a portal URL. The portal will perform all necessary transformations on the provided URL.

    Parameters:

    • String: the URL to be resolved.

    Example: lum_url('path/to/my/image.gif')

    Layout File
    lum_beforeWrite(String, String)

    A utility method to write HTML fragments only once during a request. It uses a unique key to identify the HTML fragment. Returns an HTML fragment if the given key has not been used in the same request or null otherwise.

    Parameters:

    • String: the HTML fragment to write;
    • String: the unique key that identifies the HTML fragment.

    Example: lum_beforeWrite('<script src="path/my.js" type="text/javascript"></script>', 'my.js')

    Layout File
    lum_beforeWrite(String, String)

    A utility method to write HTML fragments only once during a request. It uses a unique key to identify the HTML fragment. It writes in the beforeWriter of the render request the HTML fragment using the unique key. If the request is not a render request, it does nothing.

    If the HTML fragment contains a <link> or <style> element, it will be written at the beginning of the <head> element of the page. Otherwise, it will be written at the end of the <head> element of the page.

    Parameters:

    • String: the HTML fragment to be written;
    • String: the unique key that identifies the HTML fragment.

    Example: lum_beforeWrite('<script src="path/my.js" type="text/javascript"></script>', 'my.js')

    Request to Interface Instance
    lum_beforeWrite(String, String, String)

    A utility method to write HTML fragments only once during a request. It uses a unique key to identify the HTML fragment. It writes in the beforeWriter of the render request the HTML fragment using the unique key. If the request is not a render request, it does nothing.

    Parameters:

    • String: the HTML fragment to be written;
    • String: the unique key that identifies the HTML fragment;
    • String: indicates where in the page the HTML fragment should be written. Allowed values are:
      • BODY: the fragment is written in the same location where the EL is being processed;
      • HEAD_START: the fragment is written at the beginning of the <head> element of the page;
      • HEAD_END: the fragment is written at the end of the <head> element of the page.

    Example: lum_beforeWrite('<script src="path/my.js" type="text/javascript"></script>', 'my.js', 'HEAD_END')

    Request to Interface Instance