/** * JRA-13728: If Issue Operations plugin is disabled, we will show a warning in the JSP informing the user that Log * Work operations will not be accessible * * @return true if the plugin is enabled, false otherwise */ public boolean isIssueOperationsPluginEnabled() { return pluginAccessor.isPluginEnabled("com.atlassian.jira.plugin.system.issueoperations"); }
private boolean isPluginEnabled(String pluginKey) { return pluginAccessor.isPluginEnabled(pluginKey); } }
/** * @return True if chart plugin is installed and enabled */ public boolean isChartInstalled() { return pluginAccessor.isPluginEnabled(CHART_PLUGIN_KEY); }
public boolean isShowDisableInlineEdit() { return pluginAccessor.isPluginEnabled("com.atlassian.jira.jira-issue-nav-plugin"); }
public boolean isShowDisableCriteriaAutoUpdate() { return pluginAccessor.isPluginEnabled("com.atlassian.jira.jira-issue-nav-plugin"); }
public boolean isPluginEnabled(final String key) throws IllegalArgumentException { return delegate.isPluginEnabled(key); }
@Override public boolean isPluginEnabled(final String key) throws IllegalArgumentException { return pluginAccessor.isPluginEnabled(key); }
public boolean shouldDisplay( Map<String, Object> stringObjectMap ) { return pluginAccessor.isPluginEnabled( pluginKey ); } }
public boolean isPluginEnabled(final Plugin plugin) { return pluginAccessor.isPluginEnabled(plugin.getKey()); }
@Override public boolean matches(Plugin plugin) { return plugin != null && !pluginAccessor.isPluginEnabled(plugin.getKey()); } });
private boolean isPluginEnabled(final Plugin plugin) { return (plugin != null) && pluginAccessor.isPluginEnabled(plugin.getKey()); }
/** * Run the healthcheck: get disabled plugin keys, except where we think they are meant to be disabled */ @Override List<String> getItemsFailingCheck() { return pluginAccessor.getPlugins((Predicate<Plugin>) plugin -> !pluginIsSupposedToBeDisabled(plugin) && !pluginAccessor.isPluginEnabled(plugin.getKey())) .stream() .map(Plugin::getKey) .sorted() .collect(toList()); }
/** * Run the healthcheck: get keys of disabled-by-default plugins that are actually enabled */ @Override List<String> getItemsFailingCheck() { return pluginAccessor.getPlugins((Predicate<Plugin>) plugin -> !plugin.isEnabledByDefault() && pluginAccessor.isPluginEnabled(plugin.getKey())) .stream() .map(Plugin::getKey) .sorted() .collect(toList()); } }
@Override protected boolean shouldDisplay(WebInterfaceContext webInterfaceContext) { Space space = webInterfaceContext.getSpace(); boolean pluginEnabled = pluginAccessor.isPluginEnabled(SIDEBAR_PLUGIN_KEY); boolean correctSpaceTheme = space != null && hasSpaceSideBar(space); return correctSpaceTheme && pluginEnabled; }
@Override protected boolean shouldDisplay(WebInterfaceContext webInterfaceContext) { Space space = webInterfaceContext.getSpace(); boolean pluginEnabled = pluginAccessor.isPluginEnabled(SIDEBAR_PLUGIN_KEY); boolean correctSpaceTheme = space != null && hasSpaceSideBar(space); return correctSpaceTheme && pluginEnabled; }
@Override public Collection<String> validate() { for (String key : requiredPluginProvider.getRequiredPluginKeys()) { if (!pluginAccessor.isPluginEnabled(key)) { log.error("Plugin Not Enabled: " + key); errors.add(key); } } for (String key : requiredPluginProvider.getRequiredModuleKeys()) { if (!pluginAccessor.isPluginModuleEnabled(key)) { log.error("Plugin Module Not Enabled: " + key); errors.add(key); } } return errors; } }
@Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { Map<String, Object> context = Maps.newHashMap(); Map<String, Object> condition = Maps.newHashMap(); context.put("navBarItems", webInterfaceManager.getDisplayableItems("dev-toolbar", condition)); context.put("navBarMenuItems", webInterfaceManager.getDisplayableItems("dev-toolbar-menu", condition)); context.put("app", applicationProperties); context.put("sdkVersion", System.getProperty("atlassian.sdk.version", "3.7 or earlier")); context.put("devToolboxVersion",pluginAccessor.getPlugin("com.atlassian.devrel.developer-toolbox-plugin").getPluginInformation().getVersion()); if (pluginAccessor.isPluginEnabled("com.atlassian.labs.fastdev-plugin")){ context.put("fastDevVersion",pluginAccessor.getPlugin("com.atlassian.labs.fastdev-plugin").getPluginInformation().getVersion()); } else { context.put("fastDevVersion", "disabled"); } resp.setContentType("text/html;charset=utf-8"); renderer.render(TOOLBAR_TEMPLATE, context, resp.getWriter()); }
/** * Scans, recursively, to build a set of plugin dependencies for the target plugin * * @param plugin The plugin to scan * @param requiredKeys The set of keys collected so far */ private void scanDependencies(final Plugin plugin, final Set<String> requiredKeys) { requiredKeys.add(plugin.getKey()); final PluginDependencies dependencies = plugin.getDependencies(); Set<String> dependencyKeys = new HashSet<>(dependencies.getMandatory()); // Ensure dependent plugins are enabled first for (String dependencyKey : dependencyKeys) { if (!requiredKeys.contains(dependencyKey) && (pluginAccessor.getPlugin(dependencyKey) != null) && !pluginAccessor.isPluginEnabled(dependencyKey)) { scanDependencies(pluginAccessor.getPlugin(dependencyKey), requiredKeys); } } }
public static PluginDetails getMinimalDetails(UriBuilder uriBuilder, PluginAccessor pluginAccessor, Plugin plugin) { return new PluginDetails(Link.self(uriBuilder.build(plugin.getKey())), plugin.getKey(), pluginAccessor.isPluginEnabled(plugin.getKey())); }
private void removeAdminTasks(final Map<String, SimpleLink> linkIdMap, final List<String> moduleIdList) { final Plugin selectedPlugin = pluginAccessor.getPlugin("jira.top.navigation.bar"); if (pluginAccessor.isPluginEnabled(selectedPlugin.getKey())) { Collection<ModuleDescriptor<?>> moduleDescriptors = selectedPlugin.getModuleDescriptors(); for (ModuleDescriptor<?> moduleDescriptor : moduleDescriptors) { if (pluginAccessor.isPluginModuleEnabled(moduleDescriptor.getCompleteKey())) { if (moduleDescriptor instanceof WebItemModuleDescriptor) { moduleIdList.add(((WebItemModuleDescriptor) moduleDescriptor).getLink().getId()); } } } linkIdMap.keySet().removeAll(moduleIdList); } }