From: Julien Lancelot Date: Tue, 19 Feb 2013 15:24:32 +0000 (+0100) Subject: SONAR-2227 Display message for update plugins which dependencies needed sonar updgrade X-Git-Tag: 3.5~98 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=22e755ca4056d5dc653252048f9b2511120e8025;p=sonarqube.git SONAR-2227 Display message for update plugins which dependencies needed sonar updgrade --- diff --git a/sonar-server/src/main/java/org/sonar/server/plugins/InstalledPluginReferentialFactory.java b/sonar-server/src/main/java/org/sonar/server/plugins/InstalledPluginReferentialFactory.java index e84535eb189..44e76877a13 100644 --- a/sonar-server/src/main/java/org/sonar/server/plugins/InstalledPluginReferentialFactory.java +++ b/sonar-server/src/main/java/org/sonar/server/plugins/InstalledPluginReferentialFactory.java @@ -21,6 +21,7 @@ package org.sonar.server.plugins; 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 { @@ -34,15 +35,19 @@ 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()); } diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_dependencies.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_dependencies.html.erb deleted file mode 100644 index 111fa5bb4ed..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_dependencies.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<% if release %> - <% release.outgoingDependencies.each_with_index do |outgoing_release, index| %> - - <% if index == 0 %> - Require plugins: - <% else %> -   - <% end %> - <%= outgoing_release.artifact.name -%> version <%= outgoing_release.version.name -%> - - <% end %> - <% release.incomingDependencies.each_with_index do |incoming_release, index| %> - - <% if index == 0 %> - Incoming plugins: - <% else %> -   - <% end %> - <%= incoming_release.artifact.name -%> version <%= incoming_release.version.name -%> - - <% end %> -<% end %> \ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb index 2fc48c1365a..cd2a1abeb7c 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb @@ -45,14 +45,10 @@ function installPlugin(key) { <%= 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? %> - <% if index == 0 %> - - <% else %> - - <% end %> - + <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb index 5b8d5221454..d553ae5e15d 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb @@ -30,25 +30,18 @@
Installing this plugin will also install: <%= outgoing_release.artifact.name -%>Installing this plugin will also install: <%= release_dep_names.join(', ') -%>
<%= 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? %> - <% if index == 0 %> - - <% else %> - - <% end %> - + <% 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? %> - <% if index == 0 %> - - <% else %> - - <% end %> - + <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb index fc6f195a617..2095f0e0141 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb @@ -38,45 +38,41 @@ function upgradePlugin(key) { <% 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| %> - + release_dep_names = releases.collect { |dep| dep.artifact.name } %> + <% unless release_dep_names.empty? %> + - <% if index == 0 %> - - <% else %> - - <% end %> - + <% end %> - - - - + <% if @last_compatible[plugin.getKey()] %> + + + + <% end %> + <% end %>
Depends upon: <%= outgoing_release.artifact.name -%>Depends upon: <%= release_dep_names.join(', ') -%>
Uninstalling this plugin will also uninstall: <%= incoming_release.artifact.name -%>Uninstalling this plugin will also uninstall: <%= release_dep_names.join(', ') -%>
<%= release.getDescription() -%> <%= link_to 'Release Notes', release.getChangelogUrl(), :class => 'external' if release.getChangelogUrl() %> - <% 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 %>
Updating this plugin will also update:  - <%= outgoing_release.artifact.name -%> - Updating this plugin will also update: <%= release_dep_names.join(', ') -%>
-
- -
-
+
+ +
+