use of com.thoughtworks.go.server.ui.plugins.PluginInfo 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.PluginInfo in project gocd by gocd.
the class PackageViewModelBuilder method allPluginInfos.
public List<PluginInfo> allPluginInfos() {
List<PluginInfo> pluginInfos = new ArrayList<>();
for (String pluginId : PackageMetadataStore.getInstance().pluginIds()) {
GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
pluginInfos.add(new PluginInfo(descriptor, PackageRepositoryExtension.EXTENSION_NAME, null, null, null));
}
return pluginInfos;
}
use of com.thoughtworks.go.server.ui.plugins.PluginInfo 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));
}
use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.
the class SCMViewModelBuilder method pluginInfoFor.
public PluginInfo pluginInfoFor(String pluginId) {
if (!SCMMetadataStore.getInstance().hasPreferenceFor(pluginId)) {
return null;
}
GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
SCMPreference scmPreference = SCMMetadataStore.getInstance().preferenceFor(pluginId);
List<PluginConfiguration> pluginConfigurations = configurations(scmPreference.getScmConfigurations());
PluginView pluginView = new PluginView(scmPreference.getScmView().template());
return new PluginInfo(descriptor, SCMExtension.EXTENSION_NAME, scmPreference.getScmView().displayValue(), new PluggableInstanceSettings(pluginConfigurations, pluginView));
}
use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.
the class PluggableTaskViewModelBuilderTest method shouldBeAbleToFetchAPluginInfoForAGivenIdWithView.
@Test
public void shouldBeAbleToFetchAPluginInfoForAGivenIdWithView() {
when(manager.getPluginDescriptorFor("xunit.convertor")).thenReturn(xunitConvertor);
PluginInfo pluginInfo = builder.pluginInfoFor("xunit.convertor");
PluginView view = pluginInfo.getPluggableInstanceSettings().getView();
assertThat(view.getTemplate(), is("pluggable task view template"));
}
Aggregations