Search in sources :

Example 1 with PluginInfo

use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.

the class AuthorizationViewModelBuilder method allPluginInfos.

@Override
public List<PluginInfo> allPluginInfos() {
    List<PluginInfo> pluginInfos = new ArrayList<>();
    for (PluginDescriptor descriptor : metadataStore.getPlugins()) {
        Image icon = metadataStore.getIcon(descriptor);
        pluginInfos.add(new PluginInfo(descriptor, AuthorizationPluginConstants.EXTENSION_NAME, null, null, icon));
    }
    return pluginInfos;
}
Also used : PluginDescriptor(com.thoughtworks.go.plugin.api.info.PluginDescriptor) ArrayList(java.util.ArrayList) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo) Image(com.thoughtworks.go.plugin.access.common.models.Image)

Example 2 with PluginInfo

use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.

the class ElasticAgentViewViewModelBuilder method allPluginInfos.

@Override
public List<PluginInfo> allPluginInfos() {
    List<PluginInfo> pluginInfos = new ArrayList<>();
    for (PluginDescriptor descriptor : metadataStore.getPlugins()) {
        Image icon = metadataStore.getIcon(descriptor);
        pluginInfos.add(new PluginInfo(descriptor, ElasticAgentPluginConstants.EXTENSION_NAME, null, null, icon));
    }
    return pluginInfos;
}
Also used : PluginDescriptor(com.thoughtworks.go.plugin.api.info.PluginDescriptor) ArrayList(java.util.ArrayList) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo) Image(com.thoughtworks.go.plugin.access.common.models.Image)

Example 3 with PluginInfo

use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.

the class ElasticAgentViewViewModelBuilder method pluginInfoFor.

@Override
public PluginInfo pluginInfoFor(String pluginId) {
    PluginDescriptor descriptor = metadataStore.find(pluginId);
    if (descriptor == null) {
        return null;
    }
    Image icon = metadataStore.getIcon(descriptor);
    ArrayList<PluginConfiguration> pluginConfigurations = PluginConfiguration.getPluginConfigurations(metadataStore.getProfileMetadata(descriptor));
    PluginView pluginView = new PluginView(metadataStore.getProfileView(descriptor));
    PluggableInstanceSettings settings = new PluggableInstanceSettings(pluginConfigurations, pluginView);
    return new PluginInfo(descriptor, ElasticAgentPluginConstants.EXTENSION_NAME, null, settings, icon);
}
Also used : PluginDescriptor(com.thoughtworks.go.plugin.api.info.PluginDescriptor) PluggableInstanceSettings(com.thoughtworks.go.server.ui.plugins.PluggableInstanceSettings) PluginConfiguration(com.thoughtworks.go.server.ui.plugins.PluginConfiguration) PluginView(com.thoughtworks.go.server.ui.plugins.PluginView) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo) Image(com.thoughtworks.go.plugin.access.common.models.Image)

Example 4 with PluginInfo

use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.

the class NotificationViewModelBuilder method allPluginInfos.

public List<PluginInfo> allPluginInfos() {
    List<PluginInfo> pluginInfos = new ArrayList<>();
    for (String pluginId : notificationPluginRegistry.getNotificationPlugins()) {
        GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
        pluginInfos.add(new PluginInfo(descriptor, NotificationExtension.EXTENSION_NAME, null, null, null));
    }
    return pluginInfos;
}
Also used : ArrayList(java.util.ArrayList) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo) GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor)

Example 5 with PluginInfo

use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.

the class PackageViewModelBuilder method pluginInfoFor.

public PluginInfo pluginInfoFor(String pluginId) {
    String PACKAGE_CONFIGRATION_TYPE = "package";
    String REPOSITORY_CONFIGRATION_TYPE = "repository";
    if (!PackageMetadataStore.getInstance().hasPreferenceFor(pluginId)) {
        return null;
    }
    GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
    ArrayList<PluginConfiguration> pluginConfigurations = new ArrayList<>();
    pluginConfigurations.addAll(configurations(PackageMetadataStore.getInstance().getMetadata(pluginId), PACKAGE_CONFIGRATION_TYPE));
    pluginConfigurations.addAll(configurations(RepositoryMetadataStore.getInstance().getMetadata(pluginId), REPOSITORY_CONFIGRATION_TYPE));
    return new PluginInfo(descriptor, PackageRepositoryExtension.EXTENSION_NAME, null, new PluggableInstanceSettings(pluginConfigurations));
}
Also used : PluggableInstanceSettings(com.thoughtworks.go.server.ui.plugins.PluggableInstanceSettings) ArrayList(java.util.ArrayList) PluginConfiguration(com.thoughtworks.go.server.ui.plugins.PluginConfiguration) GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo)

Aggregations

PluginInfo (com.thoughtworks.go.server.ui.plugins.PluginInfo)32 Test (org.junit.Test)20 GoPluginDescriptor (com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor)9 PluginConfiguration (com.thoughtworks.go.server.ui.plugins.PluginConfiguration)9 ArrayList (java.util.ArrayList)9 PluginView (com.thoughtworks.go.server.ui.plugins.PluginView)7 Image (com.thoughtworks.go.plugin.access.common.models.Image)5 PluggableInstanceSettings (com.thoughtworks.go.server.ui.plugins.PluggableInstanceSettings)5 PluginDescriptor (com.thoughtworks.go.plugin.api.info.PluginDescriptor)4 HashSet (java.util.HashSet)4 HashMap (java.util.HashMap)3 TaskPreference (com.thoughtworks.go.plugin.access.pluggabletask.TaskPreference)2 SCMPreference (com.thoughtworks.go.plugin.access.scm.SCMPreference)2 PluginProfileMetadata (com.thoughtworks.go.plugin.access.common.models.PluginProfileMetadata)1 PluginProfileMetadataKey (com.thoughtworks.go.plugin.access.common.models.PluginProfileMetadataKey)1 PluginProfileMetadataKeys (com.thoughtworks.go.plugin.access.common.models.PluginProfileMetadataKeys)1