Content Application Developer Manual / Version 2107
Table Of ContentsIt is possible to use placeholder tokens in External Link content and external links within a Rich Text editor in Studio. For example: an external link that contains a hostname for an external shop which is linked from the corporate site can be written as follows:
http://{aurora.host}/webapp/wcs/stores/servlet/en/auroraesite
The tokens are enclosed with curly braces. The TokenReplacingLinkTransformer
class acts as a
LinkTransformer
class to replace these tokens in URLs.
A list of token resolvers can be registered and each resolver is called per token.
The first token Resolver that returns a replacement (value != null)
wins. After that no other
token resolver will be asked anymore for the current token.
The following token resolvers are preconfigured in the given order:
SettingsTokenResolver
This token resolver is used to resolve tokens with values coming from setting documents.
For example: the following URL
http://localhost?connectionId={livecontext.connectionId}
will be transformed to the URL
http://localhost?connectionId=wcs1
The
SettingsTokenResolver
resolves the token of the URL to the value "wcs1" because the propertylivecontext.connectionId
is defined aswcs1
in a Setting document, which is accessible via the settings service starting from the current External Link content.SpringPropertyTokenResolver
This token resolver is used to resolve tokens with values coming from Spring properties.
The placeholder and their values can be defined by using the prefix "
urlToken.
" in a properties file as follows:urlToken.aurora.host=${livecontext.apache.wcs.host} urlToken.aurorab2b.host=${livecontext.apache.wcs.host}
Within the URL attribute of an External Link content the token will be defined without the "
urlToken.
" prefix. It will be replaced with the defined value.