Policy variables | HCL Digital Experience
You can use policy variables to resolve tokens of the form {$Variable_name} that can appear in the URL pattern setting of a proxy rule or in metadata.
Policy variables are used in the
urlPattern
setting
of a proxy rule item, or in a metadata section. There are two types
of policy variables: - Endpoint variables
- Endpoint variables define a single-value variable. They are typically
used to define a specific backend host. When application developers
use endpoint variables, they can write a policy rule so that it extracts
those parts of the URL pattern in a variable that are specific to
the current portal environment. Example:
- The portlet developer defines a proxy rule with the following
URL pattern setting:
{$my_server}/mymail*
. This means that the resulting URL pattern is the value of the policy variable, appended with the path/mymail
. - The portal system administrator defines the value
http://www.the-remote-system.com
for the variablemy_server
. Therefore, the URL pattern of the policy rule ishttp://www.the-remote-system.com/mymail
.
- The portlet developer defines a proxy rule with the following
URL pattern setting:
- Dynamic policy variables
- Dynamic policy variables can have more than one value. The purpose
of this variable type is to define dynamic parts of the URL pattern
without having to specify a policy rule more than once. Example:
- A policy rule URL pattern has the following URL pattern setting:
http://localhost/wps/{$my_dynamic_policy}/Main/*
. - The variable
my_dynamic_policy
is associated with the valuesportal
andmyportal
.
http://localhost/wps/portal/Main/
orhttp://localhost/wps/myportal/Main/
. The purpose of this technique is to make one policy rule available for multiple URL patterns that can contain dynamic parts. - A policy rule URL pattern has the following URL pattern setting: