Search in sources :

Example 1 with WebUiPlugin

use of com.google.gerrit.extensions.webui.WebUiPlugin in project gerrit by GerritCodeReview.

the class HostPageServlet method plugins.

private void plugins(StringWriter w) {
    List<String> urls = new ArrayList<>();
    for (WebUiPlugin u : plugins) {
        urls.add(String.format("plugins/%s/%s", u.getPluginName(), u.getJavaScriptResourcePath()));
    }
    if (!urls.isEmpty()) {
        w.write(HPD_ID + ".plugins=");
        json(urls, w);
        w.write(";");
    }
}
Also used : ArrayList(java.util.ArrayList) WebUiPlugin(com.google.gerrit.extensions.webui.WebUiPlugin)

Example 2 with WebUiPlugin

use of com.google.gerrit.extensions.webui.WebUiPlugin in project gerrit by GerritCodeReview.

the class GetServerInfo method getPluginInfo.

private PluginConfigInfo getPluginInfo() {
    PluginConfigInfo info = new PluginConfigInfo();
    info.hasAvatars = toBoolean(avatar.get() != null);
    info.jsResourcePaths = new ArrayList<>();
    info.htmlResourcePaths = new ArrayList<>();
    for (WebUiPlugin u : plugins) {
        String path = String.format("plugins/%s/%s", u.getPluginName(), u.getJavaScriptResourcePath());
        if (path.endsWith(".html")) {
            info.htmlResourcePaths.add(path);
        } else {
            info.jsResourcePaths.add(path);
        }
    }
    return info;
}
Also used : WebUiPlugin(com.google.gerrit.extensions.webui.WebUiPlugin) PluginConfigInfo(com.google.gerrit.extensions.common.PluginConfigInfo)

Aggregations

WebUiPlugin (com.google.gerrit.extensions.webui.WebUiPlugin)2 PluginConfigInfo (com.google.gerrit.extensions.common.PluginConfigInfo)1 ArrayList (java.util.ArrayList)1