use of com.thoughtworks.go.server.ui.plugins.PluginConfiguration 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);
}
use of com.thoughtworks.go.server.ui.plugins.PluginConfiguration in project gocd by gocd.
the class PackageRepositoryPluginInfoBuilder method configurations.
static List<PluginConfiguration> configurations(PackageConfigurations packageConfigurations) {
ArrayList<PluginConfiguration> pluginConfigurations = new ArrayList<>();
for (PackageConfiguration configuration : packageConfigurations.list()) {
Map<String, Object> metaData = new HashMap<>();
metaData.put("required", configuration.getOption(Property.REQUIRED));
metaData.put("secure", configuration.getOption(Property.SECURE));
metaData.put("part_of_identity", configuration.getOption(Property.PART_OF_IDENTITY));
metaData.put("display_name", configuration.getOption(Property.DISPLAY_NAME));
metaData.put("display_order", configuration.getOption(Property.DISPLAY_ORDER));
pluginConfigurations.add(new PluginConfiguration(configuration.getKey(), metaData));
}
return pluginConfigurations;
}
use of com.thoughtworks.go.server.ui.plugins.PluginConfiguration 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));
}
use of com.thoughtworks.go.server.ui.plugins.PluginConfiguration in project gocd by gocd.
the class PluggableTaskPluginInfoBuilder method configurations.
static List<PluginConfiguration> configurations(TaskConfig config) {
ArrayList<PluginConfiguration> pluginConfigurations = new ArrayList<>();
for (Property property : config.list()) {
Map<String, Object> metaData = new HashMap<>();
metaData.put("required", property.getOption(Property.REQUIRED));
metaData.put("secure", property.getOption(Property.SECURE));
pluginConfigurations.add(new PluginConfiguration(property.getKey(), metaData));
}
return pluginConfigurations;
}
use of com.thoughtworks.go.server.ui.plugins.PluginConfiguration in project gocd by gocd.
the class PluggableTaskPluginInfoBuilder method pluginInfoFor.
@Override
public PluggableTaskPluginInfo pluginInfoFor(String pluginId) {
if (!store.pluginIds().contains(pluginId)) {
return null;
}
GoPluginDescriptor plugin = pluginManager.getPluginDescriptorFor(pluginId);
TaskPreference taskPreference = store.preferenceFor(pluginId);
List<PluginConfiguration> pluginConfigurations = configurations(taskPreference.getConfig());
PluginView pluginView = new PluginView(taskPreference.getView().template());
return new PluggableTaskPluginInfo(plugin, taskPreference.getView().displayValue(), new PluggableInstanceSettings(pluginConfigurations, pluginView));
}
Aggregations