use of org.glassfish.admingui.plugin.ConsolePluginService in project Payara by payara.
the class PluginHandlers method calculateHelpUrl.
@Handler(id = "calculateHelpUrl", input = { @HandlerInput(name = "pluginId", type = String.class, required = true), @HandlerInput(name = "helpKey", type = String.class, required = true) }, output = { @HandlerOutput(name = "url", type = String.class) })
public static void calculateHelpUrl(HandlerContext handlerCtx) {
String pluginId = (String) handlerCtx.getInputValue("pluginId");
String helpKey = (String) handlerCtx.getInputValue("helpKey");
ConsolePluginService cps = getPluginService(handlerCtx.getFacesContext());
ClassLoader cl = cps.getModuleClassLoader(pluginId);
// // Try the viewRoot locale first
// String path = getHelpPathForResource(helpKey, handlerCtx.getFacesContext().getViewRoot().getLocale(), cl);
// if (path == null) {
// // Try the default locale
// path = getHelpPathForResource(helpKey, Locale.getDefault(), cl);
//
// // Default to en
// if (path == null) {
// path = "/en/help/" + helpKey;
// }
// }
String path = "";
handlerCtx.setOutputValue("url", path);
}
Aggregations