import org.sonar.api.ServerComponent;
import org.sonar.api.platform.PluginRepository;
+import org.sonar.server.platform.ServerStartException;
import org.sonar.updatecenter.common.PluginReferential;
public class InstalledPluginReferentialFactory implements ServerComponent {
this.pluginReferentialMetadataConverter = pluginReferentialMetadataConverter;
}
- public void start(){
- init();
+ public void start() {
+ try {
+ init();
+ } catch (Exception e) {
+ throw new ServerStartException("Unable to load installed plugins", e);
+ }
}
public PluginReferential getInstalledPluginReferential() {
return installedPluginReferential;
}
- private void init(){
+ private void init() {
installedPluginReferential = pluginReferentialMetadataConverter.getInstalledPluginReferential(pluginRepository.getMetadata());
}
+++ /dev/null
-<% if release %>
- <% release.outgoingDependencies.each_with_index do |outgoing_release, index| %>
- <tr>
- <% if index == 0 %>
- <td class="thin nowrap"><b>Require plugins:</b></td>
- <% else %>
- <td> </td>
- <% end %>
- <td><span><%= outgoing_release.artifact.name -%> version <%= outgoing_release.version.name -%></span></td>
- </tr>
- <% end %>
- <% release.incomingDependencies.each_with_index do |incoming_release, index| %>
- <tr>
- <% if index == 0 %>
- <td class="thin nowrap"><b>Incoming plugins:</b></td>
- <% else %>
- <td> </td>
- <% end %>
- <td><span><%= incoming_release.artifact.name -%> version <%= incoming_release.version.name -%></span></td>
- </tr>
- <% end %>
-<% end %>
\ No newline at end of file
<table class="spaced width100">
<%= render :partial => 'updatecenter/children', :locals => {:children => children} %>
<% release = @update_plugin_center.findLatestCompatibleRelease(plugin.key) %>
- <% release.outgoingDependencies.each_with_index do |outgoing_release, index| %>
+ <% release_dep_names = release.outgoingDependencies.collect { |dep| dep.artifact.name } %>
+ <% unless release_dep_names.empty? %>
<tr>
- <% if index == 0 %>
- <td class="thin nowrap"><b>Installing this plugin will also install:</b></td>
- <% else %>
- <td> </td>
- <% end %>
- <td><span><%= outgoing_release.artifact.name -%></span></td>
+ <td class="thin nowrap" colspan="2"><b>Installing this plugin will also install: </b><%= release_dep_names.join(', ') -%></td>
</tr>
<% end %>
<table class="spaced width100">
<%= render :partial => 'updatecenter/children', :locals => {:children => plugin.children} %>
+
<% release = @installed_plugin_referential.findLatestRelease(plugin.key) %>
- <% release.outgoingDependencies.each_with_index do |outgoing_release, index| %>
+ <% release_dep_names = release.outgoingDependencies.collect { |dep| dep.artifact.name } %>
+ <% unless release_dep_names.empty? %>
<tr>
- <% if index == 0 %>
- <td class="thin nowrap"><b>Depends upon:</b></td>
- <% else %>
- <td> </td>
- <% end %>
- <td><span><%= outgoing_release.artifact.name -%></span></td>
+ <td class="thin nowrap" colspan="2"><b>Depends upon: </b><%= release_dep_names.join(', ') -%></td>
</tr>
<% end %>
- <% release.incomingDependencies.each_with_index do |incoming_release, index| %>
+ <% release_dep_names = release.incomingDependencies.collect { |dep| dep.artifact.name } %>
+ <% unless release_dep_names.empty? %>
<tr>
- <% if index == 0 %>
- <td class="thin nowrap"><b>Uninstalling this plugin will also uninstall:</b></td>
- <% else %>
- <td> </td>
- <% end %>
- <td><span><%= incoming_release.artifact.name -%></span></td>
+ <td class="thin nowrap" colspan="2"><b>Uninstalling this plugin will also uninstall: </b><%= release_dep_names.join(', ') -%></td>
</tr>
<% end %>
<td><%= release.getDescription() -%></td>
<td><%= link_to 'Release Notes', release.getChangelogUrl(), :class => 'external' if release.getChangelogUrl() %></td>
<td>
- <% if update.isIncompatible() %>
- <%= image_tag 'warning.png' -%> Incompatible
- <% elsif update.requiresSonarUpgrade %>
- <%= image_tag 'warning.png' -%> Incompatible, requires to upgrade system
- <% end %>
+ <% if update.isIncompatible() %>
+ <%= image_tag 'warning.png' -%> Incompatible
+ <% elsif update.requiresSonarUpgrade %>
+ <%= image_tag 'warning.png' -%> Incompatible, requires to upgrade system
+ <% elsif update.requiresSonarUpgradeForDependencies %>
+ <%= image_tag 'warning.png' -%> Incompatible, some dependencies requires Sonar upgrade
+ <% end %>
</td>
</tr>
<%
end
%>
- <% if @last_compatible[plugin.getKey()] %>
<% release = @update_plugin_center.findLatestCompatibleRelease(plugin.key)
releases = release.outgoingDependencies + release.incomingDependencies
- %>
- <% releases.each_with_index do |outgoing_release, index| %>
- <tr class="<%= css -%>">
+ release_dep_names = releases.collect { |dep| dep.artifact.name } %>
+ <% unless release_dep_names.empty? %>
+ <tr>
<td> </td>
<td> </td>
- <% if index == 0 %>
- <td class="thin nowrap"><b>Updating this plugin will also update:</b></td>
- <% else %>
- <td > </td>
- <% end %>
- <td colspan="4">
- <span><%= outgoing_release.artifact.name -%></span>
- </td>
+ <td class="thin nowrap" colspan="5"><b>Updating this plugin will also update: </b><%= release_dep_names.join(', ') -%></td>
</tr>
<% end %>
- <tr class="<%= css -%>">
- <td> </td>
- <td colspan="5">
- <form method="post" id="upgrade-form-<%= plugin.getKey() -%>" action="<%= ApplicationController.root_context -%>/updatecenter/install?from=updates&key=<%= plugin.getKey() -%>&version=<%= @last_compatible[plugin.getKey()] -%>" style="display: inline-block">
- <input type="submit" id="upgrade-submit-<%= plugin.getKey() -%>" value="Upgrade to <%= @last_compatible[plugin.getKey()] -%>" onClick="upgradePlugin('<%= plugin.getKey() -%>');return false;"/>
- </form>
- </td>
- </tr>
+ <% if @last_compatible[plugin.getKey()] %>
+ <tr class="<%= css -%>">
+ <td> </td>
+ <td colspan="5">
+ <form method="post" id="upgrade-form-<%= plugin.getKey() -%>" action="<%= ApplicationController.root_context -%>/updatecenter/install?from=updates&key=<%= plugin.getKey() -%>&version=<%= @last_compatible[plugin.getKey()] -%>" style="display: inline-block">
+ <input type="submit" id="upgrade-submit-<%= plugin.getKey() -%>" value="Upgrade to <%= @last_compatible[plugin.getKey()] -%>" onClick="upgradePlugin('<%= plugin.getKey() -%>');return false;"/>
+ </form>
+ </td>
+ </tr>
<% end %>
+
<%
end
%>