Substitution and Placeholders
To allow more flexibility in retrieving external list data, placeholders can be used when configuring the settings of the External Lists module, for example, in URLs.
A placeholder is substituted at run time with a value that you provide as a parameter of an external list property.
For example, you want to retrieve data from a web service that delivers lists of media types allowed for individual users. A URL for a particular media type list would then be:
http://my-web-service.com/ mediatypes?user=
<value>
where <value> is the name of a user.
Configuring separate settings for the External Lists module to cover each user individually would be tiresome, so you can use a placeholder in the following way:
- For the Web service’s URL parameter in the settings, you specify:
http://my-web-service.com/mediatypes?user=${0}
where${0}
is a placeholder for the first of the three parameters of the external list property you are using in a rule.
- For the first parameter of the external list property, you specify the Authentication.Username property.
This retrieves a list with the media types that are allowed for an individual user. The user name is the one that this user submitted when required to authenticate after sending a request to access media of a particular type.