You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

retrieve()

Usage

retrieve(key)

Description
Retrieves the value previously stored under the given key in the current request context. This method can be used to obtain the results of a previous computation step etc. and is often used to provide some sort of “variables” in the scripting context. See store() for the inverse operation.

Additionally, the retrieve() function can be used to retrieve the parameters supplied to the execution of a Custom Method.

Example

${retrieve('users')}

results in

[admin, user1, user2, user3]

Search results for "retrieve()"

retrieve()

Retrieves the value previously stored under the given key in the current request context. This method can be used to obtain the results of a previous computation step etc. and is often used to provide some sort of “variables” in the scripting context. See store() for the inverse operation.
Additionally, the retrieve() function is used to retrieve the parameters supplied to the execution of a custom method.

retrieve(key)

MessageSubscriber

MessageSubscriber is a generic abstraction of a subscriber included in the Messaging-Engine Module module.
It can attach to any kind of MessageClient and will subscribe on that client with the specified topic.
If the client receives a message on given topic, a callback will be made to the subscriber and the message will be evaluated in a scripting context that is specified in the subscribers callback attribute.

The following properties can be configured for the subscriber:

Name Type Description
clients Array of MessageClient A list of all related clients that will be subscribed on.
topic String The topic that will be subscribed
callback String Specifies a script that is evaluated upon the reception of a relevant message.

Note: Instead of using a specific topic, it is also possible to use * as a wildcard subscription.
The default scripting context is StructrScript and the message’s content is injected as well and available via retrieve() under the following attributes.

Key Description
topic The topic the message was sent in.
message The message’s content.