WebConsoleVariableResolver

struct cppmicroservices::WebConsoleVariableResolver

The WebConsoleVariableResolver interface defines the API for an object which may be provided by plugins to provide replacement values for variables in the generated content.

Plugins should call the AbstractWebConsolePlugin::SetVariableResolver method to provide their implementation for variable resolution.

The main use of such a variable resolver is when a plugin is using a static template which provides slots to place dynamically generated content parts.

Note

The variable resolver must be set in the request before the response stream is retrieved calling the HttpServletResponse::GetOutputStream method. Otherwise the variable resolver will not be used for resolving variables.

See
AbstractWebConsolePlugin::GetVariableResolver(HttpServletRequest&)
See
AbstractWebConsolePlugin::SetVariableResolver

Subclassed by cppmicroservices::WebConsoleDefaultVariableResolver

Public Functions

virtual ~WebConsoleVariableResolver()
virtual std::string Resolve(const std::string &variable) const = 0

Returns a replacement value for the named variable.

Return
The replacement value.
Parameters
  • variable: The name of the variable for which to return a replacement.