8. Portal Property Paths

Portal Property Paths can be used to access properties in areas like View definitions or Velocity template files.

8.1. Portal

The portal property is the root for all other properties. All other property root paths are only shortcuts which refer to an element within the portal.* tree.

Table 4.156. Portal Property Path

NameTypeDescription
portal.imps.*ListList of all imps provided by the portal. See Chapter 3, Administration and Configuration and Section 1, “Imps”
portal.i18n(String)Methodused to display internationalized texts. syntax: $portal.i18n("welcome")
portal.i18n(String, String)Methodused to display internationalized texts in a given language. syntax: $portal.i18n("welcome", "de"). Only operable under templateengine2 but not in expressions.
portal.user.*PropertiesThe userproperties, as provided by the authmanager used.
portal.user.useridStringUserID of the current user.
portal.user.isloggedinBooleanWhether the user is currently logged in.
portal.user.[authenticationid].*Properties Properties of a primary or secondary AuthenticationManager may be accessed directly by specifying the according <authentication>-id. This mechanism enables you to use a non-writeable authentication system as your primary AuthenticationManager whilst having a writable secondary AuthenticationManager to store additional data.
portal.modules.*ListAll portlet instances defined in the Portal Template, identified by their pnode id.
portal.portlets.*ListAlias for portal.modules.*
portal.pboxes.*ListAll pboxes defined in the Portal Template, identified by their id.
portal.pboxes.*.moduleidStringThe portlet instance currently loaded in this pbox, identified by it's pnode id.
portal.vars.timeStringCurrent time as String. e.g. 19:20
portal.vars.dateStringCurrent date as String. e.g. 25.12.2006
portal.vars.nowDateCurrent date as 'Date' object.
portal.vars.timestampIntegerCurrent date as timestamp. (Seconds since midnight, January 1, 1970 UTC.)
portal.languageStringThe current language, and a synonym for portal.language.name
portal.language.nameStringThe display name, including the defined locales, of the language.
portal.language.idStringThe id of the language
portal.language.languageStringThe language of the languages' locale.
portal.language.countryStringThe country of the languages' locale.
portal.language.variantStringThe variant of the language's locale.
portal.languagesListA list of all configured languages. See portal.language for their properties.
portal.languages.[id]ObjectLanguage with the specified id. See portal.language for its properties.
portal.defaultLanguageObject The global default language as configured in the portal configuration.
portal.request.pathStringAny extra path information associated with the URL the client sent when it made this request.
portal.request.portIntegerThe port number on which this request was received
portal.request.queryStringStringThe query string that is contained in the request URL after the path.
portal.request.hostStringThe host name of the server that received the request.
portal.request.parameters.*Object(s)Parameters of the request.
portal.request.remoteAddressStringThe Internet Protocol (IP) address of the client that sent the request.
portal.request.remoteHostStringThe fully qualified name of the client that sent the request.
portal.request.servletPathStringReturns the part of this request's URL that calls the servlet. This includes either the servlet name or a path to the servlet, but does not include any extra path information or a query string. Typically, this will return either "/portal" or "/secure".
portal.request.contextPathStringReturns the portion of the request URI that indicates the context of the request. The context path always comes first in a request URI. The path starts with a "/" character but does not end with a "/" character. Normally this will return "/Portal.Node".
portal.request.protocolStringReturns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1.
portal.request.requestURIStringReturns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request. Typically the requestURI is something like "/Portal.Node/portal".
portal.request.requestURLStringReconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.
portal.request.schemeStringReturns the name of the scheme used to make this request, for example, http, https.
portal.request.secureBooleanReturns a boolean indicating whether this request was made using a secure channel, such as HTTPS.
portal.request.methodStringReturns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
portal.request.*ObjectReturns the return value of the corresponding bean getter method from the request object. See the Servlet API for available properties. (e.g. portal.request.localAddr)
portal.session.tmpdirString Path of the directory for temporary (session) files. Files stored in this path will only be available to this session and will be automatically removed when the session is invalidated or during startup and shutdown of Gentics Portal.Node
portal.session.idStringId of the current session.
portal.properties.*Object(s)Access (readable and writeable) to the portal properties.
portal.pagesettingString String containing the current page setting of the user, if portal pages are used (for storing user defined setting). See “General Parameters for portal pages” (Section 8.9.2) for details about storing the user settings.
portal.pagesMap Map of portal pages, contains only the portal pages that have no rule defined or have a rule that currently matches.
portal.pages.[pageid]Object Portal page with id pageid.
portal.pages.[pageid].positionsMap Map of positions in the portal page of the given id.
portal.pages.[pageid].positions.[positionid] Object Position with id positionid in the portal page with id pageid .
portal.pages.[pageid].positions.[positionid].portlets List List of portlet ids from portlets currently placed in the referenced position. This can be modified to change the positioning of portlets on the portal page.
portal.pages.[pageid].resetN/ASet this attribute to any value (e.g. true) to reset the current user settings of a portal page.
portal.pageObject

The currently set portal page. It is possible to switch the current portal page by setting this property to the id of the desired portal page. When no portal page exists with the given id, or the requested portal page is invisible due to the given portal page rule, the current portal page is not changed.

This object also provides access to information of the current portal page.

portal.request.hostString Hostname included in the http request to the portal.
portal.request.portInteger Port to which the http request was directed.
portal.request.pathString Path information included to the request to the portal. This does not contain the path of the portal (usually /Portal.Node ) and the path to the servlet (usually /portal , /public or /secure ).
portal.request.queryStringString Query String contained in the http request.
portal.request.parametersMapMap of parameters included in the http request.
portal.response.redirectStringThis property can be used in reactions (ie. BEFORE the render phase) to force a HTTP redirect to another URL.
portal.createPortalURL()Portal URL

Returns a portal URL which you can use (for example) to create a custom event. Can only be used in Velocity code.

## Create a triggerEvent URL
#set( $eventurl = $portal.createPortalURL("triggerEvent") )
## Set the event name
$eventurl.setParameter("event", "simpletest")
## add some various arguments
$eventurl.setParameter("someargument", "somevalue")
## output the event url
<a href="$eventurl">My Event URL</a>

## this example will trigger an event called: "portal.events.simpletest"
## it will also contain 'somevalue' at event.properties.someargument

8.2. Views

This PortalPropertyPaths are provided by the ViewPlugin in all View Rules and Component Templates.

Table 4.157. View PortalPropertyPaths

NameTypeDescription
viewsListList of all views. A single view can be accessed by either resolving it by its id (see below), or by iterating over the views List.
views.[id]ObjectA view object, see view
viewObjectThe current view
view.labelStringLabel of the view.
view.linkStringURL that activates this view.
view.componentsListAll components of the current view, visible and invisible.
view.components.[id]ObjectA component. See Section 2.2.7.1, “All Components”.
view.components.[id].[property]ObjectA component property.
view.components.[id].[property].dataObjectThe value of a component property.
view.propertiesMapAll custom view properties, which can be read and/or set with this path.
view.properties.[id]ObjectValue of the custom view property [id] or null if the property is not set.
dataObjectData provided by the Pluggable Action container.
actionsListList of actions
actions.[id]ObjectAction object
actions.[id].[property]ObjectAction response properties.
module.*ObjectThe portlet that contains this view. See Section 8.3, “Modules” for more details.

8.3. Modules

Generic Properties provided by AbstractGenticsPortlet. (Usually available as portal.modules.<module id>)

Table 4.158. AbstractGenticsPortlet - Property Paths

NameTypeDescription
parametersResolvablePortlet Parameters
propertiesResolvablePortlet Properties
pluginsResolvableResolves all used plugins. (plugins.<plugin id> would resolve the plugin with the given id)
sessionResolvableResolves information about the portlet's session.
session.idStringCurrent session id.
session.portletscope.*Object(s) Access (readable and writeable) to the session attributes in portlet scope (attributes are only visible to this portlet).
session.appscope.*Object(s) Access (readable and writeable) to the session attributes in application scope (attributes are visible to all portlets in the same portlet application).
[Note]Note

Attribute data stored in the application scope of a portlet's session is not visible to portlets of another portlet application. If you need to store session specific data portal wide, you can use the portal properties. See Section 8.1, “Portal” for details on the portal properties.

8.4. Positions (in Portal Page)

The property path starting with "position" is only available in velocity templates (starting with the portletframe template) and only if portal pages are used.

Table 4.159. Positions - Property Paths

NameTypeDescription
position.idStringId of the currently rendered position
position.indexStringIndex of the currently rendered portlet in its position (starting with 0)

8.5. javax.portlet

Details on the objects can be found in the API documentation.

Table 4.160. Portlet PortalPropertyPaths

NameTypeDescription
javax.portlet.configObjectPortlet configuration
javax.portlet.contextObjectPortlet context
javax.portlet.requestObjectPortlet request
javax.portlet.request.preferences.*ObjectPortlet Preferences
javax.portlet.request.parameters.*ObjectParameters
javax.portlet.request.portletModeStringThe current portlet mode in which this portlet is rendered.
javax.portlet.request.windowStateStringThe current window state in which this portlet is rendered.
javax.portlet.responseObjectPortlet response