@Override
public void injectHtml(HtmlInjector.InjectArguments injectArguments) {
final List<String> pathsOfWidgetTabPlugins = new ArrayList<String>();
for (String path : Stagemonitor.getPathsOfWidgetTabPlugins()) {
pathsOfWidgetTabPlugins.add(contextPath + path);
}
final List<String> pathsOfWidgetMetricTabPlugins = new ArrayList<String>();
for (String path : Stagemonitor.getPathsOfWidgetMetricTabPlugins()) {
pathsOfWidgetMetricTabPlugins.add(contextPath + path);
}
final SpanWrapper span = injectArguments.getSpanWrapper();
injectArguments.setContentToInjectBeforeClosingBody(widgetTemplate
.replace("@@JSON_REQUEST_TRACE_PLACEHOLDER@@", span != null ? JsonUtils.toJson(span, SpanUtils.CALL_TREE_ASCII) : "null")
.replace("@@CONFIGURATION_OPTIONS@@", JsonUtils.toJson(configuration.getConfigurationOptionsByCategory()))
.replace("@@CONFIGURATION_PWD_SET@@", Boolean.toString(servletPlugin.getConfigurationPasswordChecker().isPasswordSet()))
.replace("@@CONFIGURATION_SOURCES@@", JsonUtils.toJson(configuration.getNamesOfConfigurationSources()))
.replace("@@MEASUREMENT_SESSION@@", JsonUtils.toJson(Stagemonitor.getMeasurementSession()))
.replace("@@PATHS_OF_TAB_PLUGINS@@", JsonUtils.toJson(pathsOfWidgetTabPlugins))
.replace("@@PATHS_OF_WIDGET_METRIC_TAB_PLUGINS@@", JsonUtils.toJson(pathsOfWidgetMetricTabPlugins))
.replace("@@CONNECTION_ID@@", UUID.randomUUID().toString()));
}
}