mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 00:45:44 +01:00
introduce Plugin interface
This commit is contained in:
@@ -77,7 +77,7 @@ public class InstalledPluginResource {
|
||||
PluginPermissions.read().check();
|
||||
Optional<PluginDto> pluginDto = pluginLoader.getInstalledPlugins()
|
||||
.stream()
|
||||
.filter(plugin -> name.equals(plugin.getPlugin().getInformation().getName()))
|
||||
.filter(plugin -> name.equals(plugin.getDescriptor().getInformation().getName()))
|
||||
.map(mapper::map)
|
||||
.findFirst();
|
||||
if (pluginDto.isPresent()) {
|
||||
|
||||
@@ -21,7 +21,7 @@ public abstract class PluginDtoMapper {
|
||||
private ResourceLinks resourceLinks;
|
||||
|
||||
public PluginDto map(InstalledPlugin plugin) {
|
||||
return map(plugin.getPlugin().getInformation());
|
||||
return map(plugin.getDescriptor().getInformation());
|
||||
}
|
||||
|
||||
public abstract PluginDto map(PluginInformation plugin);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class UIPluginDtoMapper {
|
||||
|
||||
public UIPluginDto map(InstalledPlugin plugin) {
|
||||
UIPluginDto dto = new UIPluginDto(
|
||||
plugin.getPlugin().getInformation().getName(),
|
||||
plugin.getDescriptor().getInformation().getName(),
|
||||
getScriptResources(plugin)
|
||||
);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class UIPluginDtoMapper {
|
||||
}
|
||||
|
||||
private Set<String> getScriptResources(InstalledPlugin wrapper) {
|
||||
Set<String> scriptResources = wrapper.getPlugin().getResources().getScriptResources();
|
||||
Set<String> scriptResources = wrapper.getDescriptor().getResources().getScriptResources();
|
||||
if (scriptResources != null) {
|
||||
return scriptResources.stream()
|
||||
.map(this::addContextPath)
|
||||
|
||||
@@ -86,7 +86,7 @@ public class UIPluginResource {
|
||||
}
|
||||
|
||||
private boolean filter(InstalledPlugin plugin) {
|
||||
return plugin.getPlugin().getResources() != null;
|
||||
return plugin.getDescriptor().getResources() != null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public class DefaultPluginManager implements PluginManager
|
||||
|
||||
for (InstalledPlugin wrapper : pluginLoader.getInstalledPlugins())
|
||||
{
|
||||
InstalledPluginDescriptor plugin = wrapper.getPlugin();
|
||||
InstalledPluginDescriptor plugin = wrapper.getDescriptor();
|
||||
PluginInformation info = plugin.getInformation();
|
||||
|
||||
if ((info != null) && info.isValid())
|
||||
|
||||
@@ -202,7 +202,7 @@ public final class PluginsInternal
|
||||
@Override
|
||||
public InstalledPluginDescriptor apply(InstalledPlugin wrapper)
|
||||
{
|
||||
return wrapper.getPlugin();
|
||||
return wrapper.getDescriptor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user