WebConsoleConstants

struct cppmicroservices::WebConsoleConstants

WebConsoleConstants provides some common constants that are used by plugin developers.

Public Static Attributes

std::string SERVICE_NAME

The name of the service to register as to be used as a “plugin” for the web console (value is “cppmicroservices::HttpServlet”).

std::string PLUGIN_LABEL

The URI address label under which the Web Console plugin is called (value is “org.cppmicroservices.webconsole.label”).

This service registration property must be set to a single non-empty string value. Otherwise the Servlet services will be ignored by the Web Console and not be used as a plugin.

std::string PLUGIN_TITLE

The title under which the Web Console plugin is called (value is “org.cppmicroservices.webconsole.title”).

For Servlet services not extending the AbstractWebConsolePlugin this property is required for the service to be used as a plugin. Otherwise the service is just ignored by the Web Console.

For Servlet services extending from the AbstractWebConsolePlugin abstract class this property is not technically required. To support lazy service access, e.g. for plugins implemented using the Service Factory pattern, the use of this service registration property is encouraged.

std::string PLUGIN_CATEGORY

The category under which the Web Console plugin is listed in the top navigation (value is “org.cppmicroservices.webconsole.category”).

For Servlet services not extending the AbstractWebConsolePlugin this property is required to declare a specific category. Otherwise the plugin is put into the default category.

For Servlet services extending from the AbstractWebConsolePlugin abstract class this property is not technically required. To support lazy service access with categorization, e.g. for plugins implemented using the Service Factory pattern, the use of this service registration property is strongly encouraged. If the property is missing the AbstractWebConsolePlugin::GetCategory() is called which should be overwritten.

std::string PLUGIN_CSS_REFERENCES

The name of the service registration properties providing references to addition CSS files that should be loaded when rendering the header for a registered plugin.

This property is expected to be a single string value or a vector of string values.

This service registration property is only used for plugins registered as SERVICE_NAME services which do not extend the AbstractWebConsolePlugin. Extensions of the AbstractWebConsolePlugin should overwrite the AbstractWebConsolePlugin::GetCssReferences() method to provide additional CSS resources.

std::string ATTR_APP_ROOT

The name of the request attribute providing the absolute path of the Web Console root (value is “org.cppmicroservices.webconsole.appRoot”).

This consists of the servlet context path (from HttpServletRequest::GetContextPath()) and the Web Console servlet path (from HttpServletRequest::GetServletPath(), /us/console by default).

The type of this request attribute is std::string.

std::string ATTR_PLUGIN_ROOT

The name of the request attribute providing the absolute path of the current plugin (value is “org.cppmicroservices.webconsole.pluginRoot”).

This consists of the servlet context path (from HttpServletRequest::GetContextPath()), the configured path of the web console root (/us/console by default) and the plugin label PLUGIN_LABEL.

The type of this request attribute is std::string.

std::string ATTR_LABEL_MAP

The name of the request attribute providing a mapping of labels to page titles of registered console plugins (value is “org.cppmicroservices.webconsole.labelMap”).

This map may be used to render a navigation of the console plugins as the AbstractWebConsolePlugin::RenderTopNavigation(HttpServletRequest&, std::ostream&) method does.

The type of this request attribute is AnyMap.

std::string ATTR_CONSOLE_VARIABLE_RESOLVER

The name of the request attribute holding the WebConsoleVariableResolver for the request (value is “org.cppmicroservices.webconsole.variable.resolver”).

See
WebConsoleVariableResolver
See
AbstractWebConsolePlugin::GetVariableResolver
See
AbstractWebConsolePlugin::SetVariableResolver