/** * A plugin is determined to be non-user if * {@link com.atlassian.plugin.Plugin#isBundledPlugin()} is true or if the * host application has indicated to the plugins system that a plugin was * provided by it. * <p> * <strong>NOTE:</strong> If a user has upgraded a bundled plugin then the * decision of whether it is user installed plugin is determined by if the * application has indicated to the plugins system that a plugin was * provided or not. */ public boolean isUserInstalled(final Plugin plugin) { checkNotNull(plugin, "plugin"); // It is user installed if it has not been marked as provided by the // application and it was not bundled. return !plugin.isBundledPlugin() && !metadata.applicationProvided(plugin); }
private void loadPluginPropertiesIntoStore(final PropertyStore pluginPropertiesStore, final Collection<Plugin> pluginsCollection) { for (final Plugin plugin : pluginsCollection) { final PluginInformation pluginInformation = plugin.getPluginInformation(); final PropertyStore pluginStore = pluginPropertiesStore.addCategory(PLUGINS_PLUGIN); pluginStore.setValue(PLUGIN_KEY, plugin.getKey()); pluginStore.setValue(PLUGIN_NAME, plugin.getName()); // this is important for the SysInfo page pluginStore.setValue(PLUGIN_VERSION, pluginInformation.getVersion()); pluginStore.setValue(PLUGIN_VENDOR, pluginInformation.getVendorName()); pluginStore.setValue(PLUGIN_STATUS, plugin.getPluginState().toString()); pluginStore.setValue(PLUGIN_VENDOR_URL, pluginInformation.getVendorUrl()); pluginStore.setValue(PLUGIN_FRAMEWORK_VERSION, String.valueOf(plugin.getPluginsVersion())); pluginStore.setValue(PLUGIN_BUNDLED, plugin.isBundledPlugin() ? getText(PLUGIN_BUNDLED) : getText(PLUGIN_USER_INSTALLED)); } }
private void addPluginInfo(final PropertyStore store) { callAndLogExceptions((Callable<Void>) () -> { Collection<Plugin> plugins = utils.getPlugins(); PluginMetadataManager pluginMetadataManager = ComponentManager.getComponent(PluginMetadataManager.class); PropertyStore pluginProperties = store.addCategory(AbstractSupportApplicationInfo.ENABLED_PLUGINS); for (Plugin plugin : plugins) { PluginInformation pluginInformation = plugin.getPluginInformation(); PropertyStore pluginStore = pluginProperties.addCategory(PLUGINS_PLUGIN); pluginStore.setValue(PLUGIN_KEY, plugin.getKey()); pluginStore.setValue(PLUGIN_NAME, plugin.getName()); pluginStore.setValue(PLUGIN_VERSION, pluginInformation.getVersion()); pluginStore.setValue(PLUGIN_VENDOR, pluginInformation.getVendorName()); pluginStore.setValue(PLUGIN_STATUS, plugin.getPluginState().toString()); pluginStore.setValue(PLUGIN_VENDOR_URL, pluginInformation.getVendorUrl()); pluginStore.setValue(PLUGIN_FRAMEWORK_VERSION, String.valueOf(plugin.getPluginsVersion())); pluginStore.setValue(PLUGIN_USER_INSTALLED, pluginMetadataManager.isUserInstalled(plugin) ? "true" : "false"); pluginStore.setValue(PLUGIN_BUNDLED, plugin.isBundledPlugin() ? getText(PLUGIN_BUNDLED) : getText(PLUGIN_USER_INSTALLED)); } return null; }); }
pluginStore.setValue(PLUGIN_VENDOR, info.getVendorName()); pluginStore.setValue(PLUGIN_STATUS, plugin.getPluginState().toString()); pluginStore.setValue(PLUGIN_BUNDLED, plugin.isBundledPlugin() ? getText(PLUGIN_BUNDLED) : getText(PLUGIN_USER_INSTALLED));