use of com.thoughtworks.go.server.ui.plugins.PluginConfiguration in project gocd by gocd.
the class AuthorizationPluginInfoBuilder method pluginInfoFor.
@Override
public AuthorizationPluginInfo pluginInfoFor(String pluginId) {
PluginDescriptor descriptor = store.find(pluginId);
if (descriptor == null) {
return null;
}
Image icon = store.getIcon(descriptor);
ArrayList<PluginConfiguration> pluginConfigurations = PluginConfiguration.getPluginConfigurations(store.getProfileMetadata(descriptor));
PluginView profileView = new PluginView(store.getProfileView(descriptor));
PluggableInstanceSettings profileSettings = new PluggableInstanceSettings(pluginConfigurations, profileView);
ArrayList<PluginConfiguration> roleConfigurations = PluginConfiguration.getPluginConfigurations(store.getRoleMetadata(descriptor));
PluginView roleView = new PluginView(store.getRoleView(descriptor));
PluggableInstanceSettings roleSettings = new PluggableInstanceSettings(roleConfigurations, roleView);
return new AuthorizationPluginInfo(descriptor, profileSettings, roleSettings, icon);
}
use of com.thoughtworks.go.server.ui.plugins.PluginConfiguration in project gocd by gocd.
the class AuthorizationViewModelBuilder 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 profileView = new PluginView(metadataStore.getProfileView(descriptor));
PluggableInstanceSettings profileSettings = new PluggableInstanceSettings(pluginConfigurations, profileView);
ArrayList<PluginConfiguration> roleConfigurations = PluginConfiguration.getPluginConfigurations(metadataStore.getRoleMetadata(descriptor));
PluginView roleView = new PluginView(metadataStore.getRoleView(descriptor));
PluggableInstanceSettings roleSettings = new PluggableInstanceSettings(roleConfigurations, roleView);
return new PluginInfo(descriptor, AuthorizationPluginConstants.EXTENSION_NAME, null, profileSettings, roleSettings, icon);
}
use of com.thoughtworks.go.server.ui.plugins.PluginConfiguration in project gocd by gocd.
the class ElasticAgentPluginInfoBuilder method pluginInfoFor.
@Override
public ElasticPluginInfo pluginInfoFor(String pluginId) {
PluginDescriptor descriptor = store.find(pluginId);
if (descriptor == null) {
return null;
}
Image icon = store.getIcon(descriptor);
ArrayList<PluginConfiguration> pluginConfigurations = PluginConfiguration.getPluginConfigurations(store.getProfileMetadata(descriptor));
PluginView pluginView = new PluginView(store.getProfileView(descriptor));
PluggableInstanceSettings settings = new PluggableInstanceSettings(pluginConfigurations, pluginView);
return new ElasticPluginInfo(descriptor, settings, icon);
}
use of com.thoughtworks.go.server.ui.plugins.PluginConfiguration in project gocd by gocd.
the class PackageViewModelBuilder method configurations.
private List<PluginConfiguration> configurations(PackageConfigurations packageConfigurations, String type) {
ArrayList<PluginConfiguration> pluginConfigurations = new ArrayList<>();
for (PackageConfiguration configuration : packageConfigurations.list()) {
Map<String, Object> metaData = new HashMap<>();
metaData.put(REQUIRED_OPTION, configuration.getOption(Property.REQUIRED));
metaData.put(SECURE_OPTION, configuration.getOption(Property.SECURE));
metaData.put(PART_OF_IDENTITY_OPTION, configuration.getOption(Property.PART_OF_IDENTITY));
metaData.put(DISPLAY_NAME_OPTION, configuration.getOption(Property.DISPLAY_NAME));
metaData.put(DISPLAY_ORDER_OPTION, configuration.getOption(Property.DISPLAY_ORDER));
pluginConfigurations.add(new PluginConfiguration(configuration.getKey(), metaData, type));
}
return pluginConfigurations;
}
use of com.thoughtworks.go.server.ui.plugins.PluginConfiguration in project gocd by gocd.
the class PluggableTaskViewModelBuilder method pluginInfoFor.
public PluginInfo pluginInfoFor(String pluginId) {
if (!PluggableTaskConfigStore.store().hasPreferenceFor(pluginId)) {
return null;
}
GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
TaskPreference taskPreference = PluggableTaskConfigStore.store().preferenceFor(pluginId);
List<PluginConfiguration> pluginConfigurations = configurations(taskPreference.getConfig());
PluginView pluginView = new PluginView(taskPreference.getView().template());
return new PluginInfo(descriptor, TaskExtension.TASK_EXTENSION, taskPreference.getView().displayValue(), new PluggableInstanceSettings(pluginConfigurations, pluginView));
}
Aggregations