diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2011-09-27 18:28:20 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2011-09-27 18:28:20 +0200 |
commit | bc668fb7f2cc9e9f9d10125f64e740dc7af499c6 (patch) | |
tree | cf504f52fe63e8fc4e049096b240ce5d141567d8 | |
parent | c0010e9f44997d634123bd8e0423a2237736c379 (diff) | |
download | sonarqube-bc668fb7f2cc9e9f9d10125f64e740dc7af499c6.tar.gz sonarqube-bc668fb7f2cc9e9f9d10125f64e740dc7af499c6.zip |
SONAR-2727 Display a warning message in the footer when the Derby engine is used
6 files changed, 17 insertions, 6 deletions
diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties index 39bb4e1b10a..73e9f58573e 100644 --- a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -251,6 +251,7 @@ layout.powered_by=Powered by layout.documentation=Documentation layout.ask_a_questions=Ask a question layout.plugins=Plugins +layout.evaluation=Embedded database should be used for evaluation purpose only sidebar.project_settings=Configuration sidebar.security=Security diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/server_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/server_controller.rb index c777559cfc0..4ec1eab15ba 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/server_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/server_controller.rb @@ -66,7 +66,7 @@ class Api::ServerController < Api::ApiController def setup begin - if !DatabaseVersion.upgradable? + if !DatabaseVersion.production? raise "Upgrade is not supported. Please use a production-ready database." end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/setup_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/setup_controller.rb index 7f1eb4d9ef8..381e908e0cf 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/setup_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/setup_controller.rb @@ -28,7 +28,7 @@ class SetupController < ApplicationController if DatabaseVersion.uptodate? redirect_to home_path elsif ActiveRecord::Base.connected? - render :template => (DatabaseVersion.upgradable? ? 'setup/form' : 'setup/not_upgradable'), :layout => 'nonav' + render :template => (DatabaseVersion.production? ? 'setup/form' : 'setup/not_upgradable'), :layout => 'nonav' else render :template => 'setup/dbdown', :layout => 'nonav' end @@ -39,7 +39,7 @@ class SetupController < ApplicationController end def setup_database - if !DatabaseVersion.upgradable? + if !DatabaseVersion.production? render :text => 'Upgrade is not supported. Please use a production-ready database.', :status => 500 else # do not forget that this code is also in /api/server/setup (see api/server_controller.rb) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb index d196fb6cb0c..8832d05aec2 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb @@ -125,6 +125,7 @@ <% end %> <div id="ftlinks"> <%= message('layout.powered_by') -%> <a href="http://www.sonarsource.com" target="SonarSource" class="external">SonarSource</a> - Open Source <a href="http://www.sonarsource.org/documentation/license/" target="license" class="external">LGPL</a> - v.<%= sonar_version -%> - <a href="http://sonar-plugins.codehaus.org" class="external" target="plugins"><%= message('layout.plugins') -%></a> - <a href="http://sonar.codehaus.org/documentation" class="external" target="sonar_doc" class="external"><%= message('layout.documentation') -%></a> - <a href="http://sonar.codehaus.org/support/" target="support" class="external"><%= message('layout.ask_a_questions') -%></a> + <% unless DatabaseVersion.production? %><br/><span class="yellowHighlight" id="evaluation_warning"><%= message('layout.evaluation') -%></span><% end %> </div> </div> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/lib/database_version.rb b/sonar-server/src/main/webapp/WEB-INF/lib/database_version.rb index e40d012dda0..b4f518ec9c4 100644 --- a/sonar-server/src/main/webapp/WEB-INF/lib/database_version.rb +++ b/sonar-server/src/main/webapp/WEB-INF/lib/database_version.rb @@ -70,6 +70,9 @@ class DatabaseVersion end def self.automatic_setup + if !production? + puts 'Derby database should be used for evaluation purpose only' + end if current_version<=0 try_restore_structure_dump() if use_structure_dump? upgrade_and_start() @@ -77,7 +80,7 @@ class DatabaseVersion if uptodate? load_plugin_webservices() else - puts "Server must be upgraded. Please browse /setup" + puts 'Server must be upgraded. Please browse /setup' end uptodate? end @@ -120,7 +123,10 @@ class DatabaseVersion ::Java::OrgSonarServerUi::JRubyFacade.getInstance().getConfigurationValue('sonar.useStructureDump')!='false' end - def self.upgradable? - dialect()!='derby' + def self.production? + @@production ||= + begin + dialect()!='derby' + end end end
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css index 6ebe3749880..8b8ebd6585d 100644 --- a/sonar-server/src/main/webapp/stylesheets/style.css +++ b/sonar-server/src/main/webapp/stylesheets/style.css @@ -1936,3 +1936,6 @@ table.nowrap td, td.nowrap { .diffParam { font-family: 'Bitstream Vera Sans Mono','Courier',monospace; } +.yellowHighlight { + background:#FFFBCC; +} |