Diff
Modified: branches/apace/app/controllers/application.rb (2151 => 2152)
--- branches/apace/app/controllers/application.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/controllers/application.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -72,7 +72,7 @@
# check if the current viewing/download is to be logged
# (i.e. request is sent not by a bot and is legitimate)
allow_logging = true
- BOT_IGNORE_LIST.each do |pattern|
+ Conf.bot_ignore_list.each do |pattern|
if request.env['HTTP_USER_AGENT'] and request.env['HTTP_USER_AGENT'].match(pattern)
allow_logging = false
break
Modified: branches/apace/app/controllers/blobs_controller.rb (2151 => 2152)
--- branches/apace/app/controllers/blobs_controller.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/controllers/blobs_controller.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -28,8 +28,8 @@
@query = params[:query] || ''
@query.strip!
- @blobs = (SOLR_ENABLE && address@hidden) ? Blob.find_by_solr(@query, :limit => 100).results : []
- @blobs_found_total_count = (SOLR_ENABLE && address@hidden) ? Blob.count_by_solr(@query) : 0
+ @blobs = (Conf.solr_enable && address@hidden) ? Blob.find_by_solr(@query, :limit => 100).results : []
+ @blobs_found_total_count = (Conf.solr_enable && address@hidden) ? Blob.count_by_solr(@query) : 0
respond_to do |format|
format.html # search.rhtml
Modified: branches/apace/app/controllers/networks_controller.rb (2151 => 2152)
--- branches/apace/app/controllers/networks_controller.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/controllers/networks_controller.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -21,8 +21,8 @@
@query = params[:query] || ''
@query.strip!
- @networks = (SOLR_ENABLE && address@hidden) ? Network.find_by_solr(@query, :limit => 100).results : []
- @networks_found_total_count = (SOLR_ENABLE && address@hidden) ? Network.count_by_solr(@query) : 0
+ @networks = (Conf.solr_enable && address@hidden) ? Network.find_by_solr(@query, :limit => 100).results : []
+ @networks_found_total_count = (Conf.solr_enable && address@hidden) ? Network.count_by_solr(@query) : 0
respond_to do |format|
format.html # search.rhtml
@@ -119,7 +119,7 @@
existing_invitation_emails << email_addr
else
if ActivityLimit.check_limit(current_user, "group_invite")[0]
- token_code = Digest::SHA1.hexdigest( email_addr.reverse + SECRET_WORD )
+ token_code = Digest::SHA1.hexdigest( email_addr.reverse + Conf.secret_word )
valid_addresses_tokens[email_addr] = token_code
invitation = PendingInvitation.new(:email => email_addr, :request_type => "membership", :requested_by => current_user.id, :request_for => params[:id], :message => params[:invitations][:msg_text], :token => token_code)
invitation.save
Modified: branches/apace/app/controllers/packs_controller.rb (2151 => 2152)
--- branches/apace/app/controllers/packs_controller.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/controllers/packs_controller.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -26,8 +26,8 @@
@query = params[:query] || ''
@query.strip!
- @packs = (SOLR_ENABLE && address@hidden) ? Pack.find_by_solr(@query, :limit => 100).results : []
- @packs_found_total_count = (SOLR_ENABLE && address@hidden) ? Pack.count_by_solr(@query) : 0
+ @packs = (Conf.solr_enable && address@hidden) ? Pack.find_by_solr(@query, :limit => 100).results : []
+ @packs_found_total_count = (Conf.solr_enable && address@hidden) ? Pack.count_by_solr(@query) : 0
respond_to do |format|
format.html # search.rhtml
Modified: branches/apace/app/controllers/search_controller.rb (2151 => 2152)
--- branches/apace/app/controllers/search_controller.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/controllers/search_controller.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -134,7 +134,7 @@
@results = []
- if SOLR_ENABLE && address@hidden
+ if Conf.solr_enable && address@hidden
categories = (Conf.search_categories - ['all']).map do |category|
if Conf.model_aliases.key?(category.camelize.singularize)
Modified: branches/apace/app/controllers/users_controller.rb (2151 => 2152)
--- branches/apace/app/controllers/users_controller.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/controllers/users_controller.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -22,11 +22,11 @@
@query = params[:query] || ''
@query.strip!
- results = (SOLR_ENABLE && address@hidden) ? User.find_by_solr(@query, :limit => 100).results : []
+ results = (Conf.solr_enable && address@hidden) ? User.find_by_solr(@query, :limit => 100).results : []
# Only show activated users!
@users = results.select { |u| u.activated? }
- @users_found_total_count = (SOLR_ENABLE && address@hidden) ? User.count_by_solr(@query) : 0
+ @users_found_total_count = (Conf.solr_enable && address@hidden) ? User.count_by_solr(@query) : 0
respond_to do |format|
format.html # search.rhtml
@@ -420,7 +420,7 @@
existing_invitation_emails << email_addr
else
if ActivityLimit.check_limit(current_user, "user_invite")[0]
- token_code = Digest::SHA1.hexdigest( email_addr.reverse + SECRET_WORD )
+ token_code = Digest::SHA1.hexdigest( email_addr.reverse + Conf.secret_word )
valid_addresses_tokens[email_addr] = token_code
invitation = PendingInvitation.new(:email => email_addr, :request_type => "friendship", :requested_by => params[:invitations_user_id], :request_for => params[:invitations_user_id], :message => params[:invitations][:msg_text], :token => token_code)
invitation.save
@@ -599,7 +599,7 @@
end
def confirmation_hash(string)
- Digest::SHA1.hexdigest(string + SECRET_WORD)
+ Digest::SHA1.hexdigest(string + Conf.secret_word)
end
end
Modified: branches/apace/app/controllers/workflows_controller.rb (2151 => 2152)
--- branches/apace/app/controllers/workflows_controller.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/controllers/workflows_controller.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -37,8 +37,8 @@
@query = params[:query] || ''
@query.strip!
- @workflows = (SOLR_ENABLE && address@hidden) ? Workflow.find_by_solr(@query, :limit => 100).results : []
- @workflows_found_total_count = (SOLR_ENABLE && address@hidden) ? Workflow.count_by_solr(@query) : 0
+ @workflows = (Conf.solr_enable && address@hidden) ? Workflow.find_by_solr(@query, :limit => 100).results : []
+ @workflows_found_total_count = (Conf.solr_enable && address@hidden) ? Workflow.count_by_solr(@query) : 0
respond_to do |format|
format.html # search.rhtml
@@ -726,9 +726,9 @@
end
return false
# Check that the size of the workflow file doesn't exceed the max size
- elsif params[:workflow][:file].size > WORKFLOW_UPLOAD_MAX_BYTES
+ elsif params[:workflow][:file].size > Conf.max_upload_size
respond_to do |format|
- flash.now[:error] = "The workflow file/script uploaded is too big. The maximum upload size for workflows is #{number_to_human_size(WORKFLOW_UPLOAD_MAX_BYTES)}."
+ flash.now[:error] = "The workflow file/script uploaded is too big. The maximum upload size for workflows is #{number_to_human_size(Conf.max_upload_size)}."
format.html { render :action ="" view_to_render_on_fail }
end
return false
Modified: branches/apace/app/models/activity_limit.rb (2151 => 2152)
--- branches/apace/app/models/activity_limit.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/models/activity_limit.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -20,9 +20,9 @@
# e.g. in the first month of membership on myExperiment one can send 10 messages daily,
# but after that can send 15 (because the user becomes more "trusted")
if (limit.promote_after && time_now > limit.promote_after)
- absolute_max_limit_value = eval("#{limit_feature.upcase}_LIMIT_MAX_VALUE")
- limit_increment_value = eval("#{limit_feature.upcase}_LIMIT_PROMOTE_INCREMENT")
- promote_every = eval("#{limit_feature.upcase}_LIMIT_PROMOTE_EVERY")
+ absolute_max_limit_value = Conf.activity_limits[limit_feature]["max_value"]
+ limit_increment_value = Conf.activity_limits[limit_feature]["promote_increment"]
+ promote_every = Conf.activity_limits[limit_feature]["promote_every"]
if limit_increment_value
if absolute_max_limit_value
@@ -65,12 +65,12 @@
else
# limit doesn't exist yet - create it, then proceed to validation and saving
- limit_frequency = eval("#{limit_feature.upcase}_LIMIT_FREQUENCY")
- promote_every = eval("#{limit_feature.upcase}_LIMIT_PROMOTE_EVERY")
+ limit_frequency = Conf.activity_limits[limit_feature]["frequency"]
+ promote_every = Conf.activity_limits[limit_feature]["promote_every"]
limit = ActivityLimit.new(:contributor_type => contributor.class.name, :contributor_id => contributor.id,
:limit_feature => limit_feature,
- :limit_max => eval("#{limit_feature.upcase}_LIMIT_START_VALUE"),
+ :limit_max => Conf.activity_limits[limit_feature]["start_value"],
:limit_frequency => limit_frequency,
:reset_after => (limit_frequency ? (time_now + limit_frequency.hours) : nil),
:promote_after => (promote_every ? (time_now + promote_every.days) : nil),
Modified: branches/apace/app/models/blob.rb (2151 => 2152)
--- branches/apace/app/models/blob.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/models/blob.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -26,7 +26,7 @@
acts_as_attributable
acts_as_solr(:fields => [:title, :local_name, :body, :content_type, :uploader],
- :include => [ :comments ]) if SOLR_ENABLE
+ :include => [ :comments ]) if Conf.solr_enable
belongs_to :content_blob
# :dependent => :destroy is not supported in belongs_to in rails 1.2.6
Modified: branches/apace/app/models/comment.rb (2151 => 2152)
--- branches/apace/app/models/comment.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/models/comment.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -13,7 +13,7 @@
# NOTE: Comments belong to a user
belongs_to :user
- acts_as_solr :fields => [ :comment ] if SOLR_ENABLE
+ acts_as_solr :fields => [ :comment ] if Conf.solr_enable
acts_as_simile_timeline_event(
:fields => {
Modified: branches/apace/app/models/network.rb (2151 => 2152)
--- branches/apace/app/models/network.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/models/network.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -21,7 +21,7 @@
has_many :workflows, :as => :contributor
acts_as_solr(:fields => [ :title, :unique_name, :owner_name, :description, :tag_list ],
- :include => [ :comments ]) if SOLR_ENABLE
+ :include => [ :comments ]) if Conf.solr_enable
format_attribute :description
Modified: branches/apace/app/models/pack.rb (2151 => 2152)
--- branches/apace/app/models/pack.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/models/pack.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -27,7 +27,7 @@
format_attribute :description
acts_as_solr(:fields => [ :title, :description, :contributor_name, :tag_list ],
- :include => [ :comments ]) if SOLR_ENABLE
+ :include => [ :comments ]) if Conf.solr_enable
has_many :contributable_entries,
:class_name => "PackContributableEntry",
Modified: branches/apace/app/models/profile.rb (2151 => 2152)
--- branches/apace/app/models/profile.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/models/profile.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -48,7 +48,7 @@
:location_city,
:location_country,
:interests,
- :contact_details ] if SOLR_ENABLE
+ :contact_details ] if Conf.solr_enable
def avatar?
not (picture_id.nil? or picture_id.zero?)
Modified: branches/apace/app/models/review.rb (2151 => 2152)
--- branches/apace/app/models/review.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/models/review.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -12,7 +12,7 @@
before_create :check_multiple
- acts_as_solr :fields => [ :title, :review ] if SOLR_ENABLE
+ acts_as_solr :fields => [ :title, :review ] if Conf.solr_enable
# returns the 'last created' Reviews
# the maximum number of results is set by #limit#
Modified: branches/apace/app/models/taverna_enactor.rb (2151 => 2152)
--- branches/apace/app/models/taverna_enactor.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/models/taverna_enactor.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -20,7 +20,7 @@
validates_presence_of :url
validates_presence_of :title
- encrypts :password, :mode => :symmetric, :key => SYM_ENCRYPTION_KEY
+ encrypts :password, :mode => :symmetric, :key => Conf.sym_encryption_key
def self.find_by_contributor(contributor_type, contributor_id)
TavernaEnactor.find(:all, :conditions => ["contributor_type = ? AND contributor_id = ?", contributor_type, contributor_id])
Modified: branches/apace/app/models/user.rb (2151 => 2152)
--- branches/apace/app/models/user.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/models/user.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -284,7 +284,7 @@
acts_as_creditor
- acts_as_solr(:fields => [ :name, :tag_list ], :include => [ :profile ]) if SOLR_ENABLE
+ acts_as_solr(:fields => [ :name, :tag_list ], :include => [ :profile ]) if Conf.solr_enable
validates_presence_of :name
Modified: branches/apace/app/models/workflow.rb (2151 => 2152)
--- branches/apace/app/models/workflow.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/models/workflow.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -81,7 +81,7 @@
# acts_as_solr(:fields => [ :title, :body, :tag_list, :contributor_name, { :rating => :integer } ],
acts_as_solr(:fields => [ :title, :body, :tag_list, :contributor_name, :type_display_name, :get_all_search_terms ],
- :include => [ :comments ]) if SOLR_ENABLE
+ :include => [ :comments ]) if Conf.solr_enable
acts_as_runnable
Deleted: branches/apace/app/views/blobs/_license.rhtml (2151 => 2152)
--- branches/apace/app/views/blobs/_license.rhtml 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/views/blobs/_license.rhtml 2009-03-31 14:21:28 UTC (rev 2152)
@@ -1,108 +0,0 @@
-<% case (blob.license.to_s); when "by-nd" %>
-
-<!--
-
-<rdf:RDF xmlns="http://web.resource.org/cc/"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
-<Work rdf:about="">
- <dc:title><%= blob.title %></dc:title>
- <dc:date><%= blob.created_at %></dc:date>
- <dc:description><%= blob.body_html %></dc:description>
- <dc:creator><Agent>
- <dc:title><%= contributor(blob.contribution.contributor_id, blob.contribution.contributor_type, link=false) %></dc:title>
- </Agent></dc:creator>
- <dc:rights><Agent>
- <dc:title><%= contributor(blob.contribution.contributor_id, blob.contribution.contributor_type, link=false) %></dc:title>
- </Agent></dc:rights>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/Data" />
- <dc:source rdf:resource="<%= Conf.base_uri %><%= request.request_uri %>"/>
- <license rdf:resource="http://creativecommons.org/licenses/by-nd/3.0/" />
-</Work>
-
-<License rdf:about="http://creativecommons.org/licenses/by-nd/3.0/">
- <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
- <permits rdf:resource="http://web.resource.org/cc/Distribution" />
- <requires rdf:resource="http://web.resource.org/cc/Notice" />
- <requires rdf:resource="http://web.resource.org/cc/Attribution" />
- <prohibits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
-</License>
-
-</rdf:RDF>
-
--->
-
-<% when "by-sa" %>
-
-<!--
-
-<rdf:RDF xmlns="http://web.resource.org/cc/"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
-<Work rdf:about="">
- <dc:title><%= blob.title %></dc:title>
- <dc:date><%= blob.created_at %></dc:date>
- <dc:description><%= blob.body_html %></dc:description>
- <dc:creator><Agent>
- <dc:title><%= contributor(blob.contribution.contributor_id, blob.contribution.contributor_type, link=false) %></dc:title>
- </Agent></dc:creator>
- <dc:rights><Agent>
- <dc:title><%= contributor(blob.contribution.contributor_id, blob.contribution.contributor_type, link=false) %></dc:title>
- </Agent></dc:rights>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/Data" />
- <dc:source rdf:resource="<%= Conf.base_uri %><%= request.request_uri %>"/>
- <license rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" />
-</Work>
-
-<License rdf:about="http://creativecommons.org/licenses/by-sa/3.0/">
- <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
- <permits rdf:resource="http://web.resource.org/cc/Distribution" />
- <requires rdf:resource="http://web.resource.org/cc/Notice" />
- <requires rdf:resource="http://web.resource.org/cc/Attribution" />
- <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
- <requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
-</License>
-
-</rdf:RDF>
-
--->
-
-<% when "by" %>
-
-<!--
-
-<rdf:RDF xmlns="http://web.resource.org/cc/"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
-<Work rdf:about="">
- <dc:title><%= blob.title %></dc:title>
- <dc:date><%= blob.created_at %></dc:date>
- <dc:description><%= blob.body_html %></dc:description>
- <dc:creator><Agent>
- <dc:title><%= contributor(blob.contribution.contributor_id, blob.contribution.contributor_type, link=false) %></dc:title>
- </Agent></dc:creator>
- <dc:rights><Agent>
- <dc:title><%= contributor(blob.contribution.contributor_id, blob.contribution.contributor_type, link=false) %></dc:title>
- </Agent></dc:rights>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/Data" />
- <dc:source rdf:resource="<%= Conf.base_uri %><%= request.request_uri %>"/>
- <license rdf:resource="http://creativecommons.org/licenses/by/3.0/" />
-</Work>
-
-<License rdf:about="http://creativecommons.org/licenses/by/3.0/">
- <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
- <permits rdf:resource="http://web.resource.org/cc/Distribution" />
- <requires rdf:resource="http://web.resource.org/cc/Notice" />
- <requires rdf:resource="http://web.resource.org/cc/Attribution" />
- <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
-</License>
-
-</rdf:RDF>
-
--->
-
-<% end %>
-
-<p>
- All versions of this File are licensed under the <%= license_link blob.license.to_s %>.
-</p>
Modified: branches/apace/app/views/contributions/_license_box.rhtml (2151 => 2152)
--- branches/apace/app/views/contributions/_license_box.rhtml 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/views/contributions/_license_box.rhtml 2009-03-31 14:21:28 UTC (rev 2152)
@@ -6,12 +6,129 @@
License
<a name="license"></a>
</p>
+
+
+<% dc_title = contributable.title %>
+<% dc_description = contributable.respond_to?('description_html') ? contributable.description_html : contributable.body_html %>
+<% dc_date = contributable.created_at %>
+<% dc_creator = contributor(contributable.contribution.contributor_id, contributable.contribution.contributor_type, link=false) %>
+<% dc_source = Conf.base_uri + request.request_uri %>
+
+
+<% case (contributable.license.to_s); when "by-nd" %>
+
+<!--
+
+<rdf:RDF xmlns="http://web.resource.org/cc/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+<Work rdf:about="">
+ <dc:title><%= dc_title %></dc:title>
+ <dc:date><%= dc_date %></dc:date>
+ <dc:description><%= dc_description %></dc:description>
+ <dc:creator><Agent>
+ <dc:title><%= dc_creator %></dc:title>
+ </Agent></dc:creator>
+ <dc:rights><Agent>
+ <dc:title><%= dc_creator %></dc:title>
+ </Agent></dc:rights>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/Data" />
+ <dc:source rdf:resource="<%= dc_source -%>"/>
+ <license rdf:resource="http://creativecommons.org/licenses/by-nd/3.0/" />
+</Work>
+
+<License rdf:about="http://creativecommons.org/licenses/by-nd/3.0/">
+ <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
+ <permits rdf:resource="http://web.resource.org/cc/Distribution" />
+ <requires rdf:resource="http://web.resource.org/cc/Notice" />
+ <requires rdf:resource="http://web.resource.org/cc/Attribution" />
+ <prohibits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
+</License>
+
+</rdf:RDF>
+
+-->
+
+<% when "by-sa" %>
+
+<!--
+
+<rdf:RDF xmlns="http://web.resource.org/cc/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+<Work rdf:about="">
+ <dc:title><%= dc_title %></dc:title>
+ <dc:date><%= dc_date %></dc:date>
+ <dc:description><%= dc_description %></dc:description>
+ <dc:creator><Agent>
+ <dc:title><%= dc_creator %></dc:title>
+ </Agent></dc:creator>
+ <dc:rights><Agent>
+ <dc:title><%= dc_creator %></dc:title>
+ </Agent></dc:rights>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/Data" />
+ <dc:source rdf:resource="<%= dc_source -%>"/>
+ <license rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" />
+</Work>
+
+<License rdf:about="http://creativecommons.org/licenses/by-sa/3.0/">
+ <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
+ <permits rdf:resource="http://web.resource.org/cc/Distribution" />
+ <requires rdf:resource="http://web.resource.org/cc/Notice" />
+ <requires rdf:resource="http://web.resource.org/cc/Attribution" />
+ <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
+ <requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
+</License>
+
+</rdf:RDF>
+
+-->
+
+<% when "by" %>
+
+<!--
+
+<rdf:RDF xmlns="http://web.resource.org/cc/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+<Work rdf:about="">
+ <dc:title><%= dc_title %></dc:title>
+ <dc:date><%= dc_date %></dc:date>
+ <dc:description><%= dc_description %></dc:description>
+ <dc:creator><Agent>
+ <dc:title><%= dc_creator %></dc:title>
+ </Agent></dc:creator>
+ <dc:rights><Agent>
+ <dc:title><%= dc_creator %></dc:title>
+ </Agent></dc:rights>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/Data" />
+ <dc:source rdf:resource="<%= dc_source -%>"/>
+ <license rdf:resource="http://creativecommons.org/licenses/by/3.0/" />
+</Work>
+
+<License rdf:about="http://creativecommons.org/licenses/by/3.0/">
+ <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
+ <permits rdf:resource="http://web.resource.org/cc/Distribution" />
+ <requires rdf:resource="http://web.resource.org/cc/Notice" />
+ <requires rdf:resource="http://web.resource.org/cc/Attribution" />
+ <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
+</License>
+
+</rdf:RDF>
+
+-->
+
+<% end %>
+
+ <div class="contribution_currentlicense">
+ <p>
+ <% if contributable.respond_to?('versions') %>
+ All versions of this <%= visible_name(contributable) -%> are
+ <% else %>
+ This <%= visible_name(contributable) -%> is
+ <% end %>
+ licensed under the <%= license_link contributable.license.to_s %>.
+ </p>
+ </div>
- <div class="contribution_currentlicense">
- <% if contributable.class.to_s.downcase == "workflow" %>
- <%= render :partial => "workflows/license", :locals => { :workflow => contributable } %>
- <% elsif contributable.class.to_s.downcase == "blob" %>
- <%= render :partial => "blobs/license", :locals => { :blob => contributable } %>
- <% end %>
- </div>
-</div>
\ No newline at end of file
+</div>
Modified: branches/apace/app/views/layouts/_bookmark_widget.rhtml (2151 => 2152)
--- branches/apace/app/views/layouts/_bookmark_widget.rhtml 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/views/layouts/_bookmark_widget.rhtml 2009-03-31 14:21:28 UTC (rev 2152)
@@ -2,6 +2,6 @@
<script type="text/_javascript_">
addthis_url = location.href;
addthis_title = document.title;
- addthis_pub = "<%= ADDTHIS_WIDGET_USERNAME %>";
+ addthis_pub = "<%= Conf.bookmark_widget["addthis_username"] %>";
</script><script type="text/_javascript_" src="" ></script>
<!-- AddThis Bookmark Button END -->
Modified: branches/apace/app/views/layouts/_breadcrumbs_bar.rhtml (2151 => 2152)
--- branches/apace/app/views/layouts/_breadcrumbs_bar.rhtml 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/views/layouts/_breadcrumbs_bar.rhtml 2009-03-31 14:21:28 UTC (rev 2152)
@@ -8,7 +8,7 @@
</ul>
</td>
<td style="text-align: right; padding-left: 1em;">
- <%= render :partial => "layouts/bookmark_widget" if USE_BOOKMARK_WIDGET %>
+ <%= render :partial => "layouts/bookmark_widget" if Conf.bookmark_widget["enable"] %>
</td>
</tr>
</table>
Modified: branches/apace/app/views/layouts/_web_analytics.rhtml (2151 => 2152)
--- branches/apace/app/views/layouts/_web_analytics.rhtml 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/views/layouts/_web_analytics.rhtml 2009-03-31 14:21:28 UTC (rev 2152)
@@ -3,7 +3,7 @@
document.write(unescape("%3Cscript src='' type='text/_javascript_'%3E%3C/script%3E"));
</script>
<script type="text/_javascript_">
-var pageTracker = _gat._getTracker("<%= GOOGLEANALYTICS_TRACKER_CODE -%>");
+var pageTracker = _gat._getTracker("<%= Conf.google_web_analytics["tracker_code"] -%>");
pageTracker._initData();
pageTracker._trackPageview();
-</script>
\ No newline at end of file
+</script>
Modified: branches/apace/app/views/layouts/application.rhtml (2151 => 2152)
--- branches/apace/app/views/layouts/application.rhtml 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/views/layouts/application.rhtml 2009-03-31 14:21:28 UTC (rev 2152)
@@ -104,12 +104,12 @@
</div>
<% end -%>
- <%= render :partial => "layouts/debug" if SHOW_DEBUG %>
+ <%= render :partial => "layouts/debug" if Conf.show_debug %>
</div>
<%= _javascript__include_tag "tabs.js" %>
<%= _javascript__include_tag "folds.js" %>
- <%= render :partial => "layouts/web_analytics" if USE_WEBANALYTICS %>
+ <%= render :partial => "layouts/web_analytics" if Conf.google_web_analytics["enable"] %>
</body>
</html>
Deleted: branches/apace/app/views/workflows/_license.rhtml (2151 => 2152)
--- branches/apace/app/views/workflows/_license.rhtml 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/app/views/workflows/_license.rhtml 2009-03-31 14:21:28 UTC (rev 2152)
@@ -1,108 +0,0 @@
-<% case (workflow.license.to_s); when "by-nd" %>
-
-<!--
-
-<rdf:RDF xmlns="http://web.resource.org/cc/"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
-<Work rdf:about="">
- <dc:title><%= workflow.title %></dc:title>
- <dc:date><%= workflow.created_at %></dc:date>
- <dc:description><%= workflow.body_html %></dc:description>
- <dc:creator><Agent>
- <dc:title><%= contributor(workflow.contribution.contributor_id, workflow.contribution.contributor_type, link=false) %></dc:title>
- </Agent></dc:creator>
- <dc:rights><Agent>
- <dc:title><%= contributor(workflow.contribution.contributor_id, workflow.contribution.contributor_type, link=false) %></dc:title>
- </Agent></dc:rights>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/Data" />
- <dc:source rdf:resource="<%= Conf.base_uri %><%= request.request_uri %>"/>
- <license rdf:resource="http://creativecommons.org/licenses/by-nd/3.0/" />
-</Work>
-
-<License rdf:about="http://creativecommons.org/licenses/by-nd/3.0/">
- <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
- <permits rdf:resource="http://web.resource.org/cc/Distribution" />
- <requires rdf:resource="http://web.resource.org/cc/Notice" />
- <requires rdf:resource="http://web.resource.org/cc/Attribution" />
- <prohibits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
-</License>
-
-</rdf:RDF>
-
--->
-
-<% when "by-sa" %>
-
-<!--
-
-<rdf:RDF xmlns="http://web.resource.org/cc/"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
-<Work rdf:about="">
- <dc:title><%= workflow.title %></dc:title>
- <dc:date><%= workflow.created_at %></dc:date>
- <dc:description><%= workflow.body_html %></dc:description>
- <dc:creator><Agent>
- <dc:title><%= contributor(workflow.contribution.contributor_id, workflow.contribution.contributor_type, link=false) %></dc:title>
- </Agent></dc:creator>
- <dc:rights><Agent>
- <dc:title><%= contributor(workflow.contribution.contributor_id, workflow.contribution.contributor_type, link=false) %></dc:title>
- </Agent></dc:rights>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/Data" />
- <dc:source rdf:resource="<%= Conf.base_uri %><%= request.request_uri %>"/>
- <license rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" />
-</Work>
-
-<License rdf:about="http://creativecommons.org/licenses/by-sa/3.0/">
- <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
- <permits rdf:resource="http://web.resource.org/cc/Distribution" />
- <requires rdf:resource="http://web.resource.org/cc/Notice" />
- <requires rdf:resource="http://web.resource.org/cc/Attribution" />
- <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
- <requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
-</License>
-
-</rdf:RDF>
-
--->
-
-<% when "by" %>
-
-<!--
-
-<rdf:RDF xmlns="http://web.resource.org/cc/"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
-<Work rdf:about="">
- <dc:title><%= workflow.title %></dc:title>
- <dc:date><%= workflow.created_at %></dc:date>
- <dc:description><%= workflow.body_html %></dc:description>
- <dc:creator><Agent>
- <dc:title><%= contributor(workflow.contribution.contributor_id, workflow.contribution.contributor_type, link=false) %></dc:title>
- </Agent></dc:creator>
- <dc:rights><Agent>
- <dc:title><%= contributor(workflow.contribution.contributor_id, workflow.contribution.contributor_type, link=false) %></dc:title>
- </Agent></dc:rights>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/Data" />
- <dc:source rdf:resource="<%= Conf.base_uri %><%= request.request_uri %>"/>
- <license rdf:resource="http://creativecommons.org/licenses/by/3.0/" />
-</Work>
-
-<License rdf:about="http://creativecommons.org/licenses/by/3.0/">
- <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
- <permits rdf:resource="http://web.resource.org/cc/Distribution" />
- <requires rdf:resource="http://web.resource.org/cc/Notice" />
- <requires rdf:resource="http://web.resource.org/cc/Attribution" />
- <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
-</License>
-
-</rdf:RDF>
-
--->
-
-<% end %>
-
-<p>
- All versions of this Workflow are licensed under the <%= license_link workflow.license.to_s %>.
-</p>
Copied: branches/apace/config/default_settings.yml (from rev 2151, trunk/config/default_settings.yml) (0 => 2152)
--- branches/apace/config/default_settings.yml (rev 0)
+++ branches/apace/config/default_settings.yml 2009-03-31 14:21:28 UTC (rev 2152)
@@ -0,0 +1,330 @@
+# myExperiment: config/settings.yml.pre
+#
+# Copyright (c) 2009 University of Manchester and the University of Southampton.
+# See license.txt for details.
+
+# ------------------------------------------------------------------------------
+# | myExperiment server configuration |
+# ------------------------------------------------------------------------------
+# | |
+# | NOTE: Don't make changes to this file. Instead, copy it to |
+# | config/settings.yml and change that copy instead. Both the |
+# | default_settings.yml and settings.yml configuration files are |
+# | loaded and configuration entries in settings.yml take precedence. |
+# | |
+# ------------------------------------------------------------------------------
+
+# site_name - Set "site_name" to the name of this myExperiment installation.
+# This is used by the myExperiment codebase to refer to service by
+# name.
+#
+# Example:
+#
+# site_name: mySite
+
+site_name: mySite
+
+# site_logo - set "site_logo" to the name of the logo used at the top left of
+# the web pages.
+#
+# Example:
+#
+# site_logo: logo.png
+
+site_logo: logo.png
+
+# base_uri - Set "base_uri" to the main entry point to this installation of
+# myExperiment. If you use a load balancing solution to proxy
+# incoming requests to a cluster, then this is the external address.
+#
+# Examples:
+#
+# base_uri: http://www.example.com
+#
+# or
+#
+# base_uri: http://www.example.com:3000
+#
+# NOTE: No trailing slash.
+
+base_uri: http://www.example.com
+
+# admins - Set "admins" to the list of usernames of people that are
+# administrators of this installation. This is "Username" that is set
+# when you manage your account, not the "Display Name".
+#
+# Example:
+#
+# admins: [dgc, jits, dtm]
+
+admins: []
+
+# main_tabs - These are the main tabs of the website. Each entry requires at
+# least a label and a link. If you specify a controller in a tab,
+# then the tab is shown as selected when the page has been served by
+# a controller that matches.
+#
+# The controller entry is a regular _expression_, so you can make a tab
+# show as selected in multiple controllers.
+#
+# Example:
+#
+# main_tabs:
+#
+# - label: Home
+# link: /home
+# controller: home
+#
+# - label: Users
+# link: /users
+# controller: (users|profiles|userhistory|friendships|memberships|pictures)
+#
+# - label: Groups
+# link: /groups
+# controller: networks
+#
+# - label: Wiki
+# link: http://wiki.example.com/
+
+main_tabs:
+
+ - label: Home
+ link: /home
+ controller: home
+
+ - label: Users
+ link: /users
+ controller: (users|profiles|userhistory|friendships|memberships|pictures)
+
+ - label: Groups
+ link: /groups
+ controller: networks
+
+ - label: Workflows
+ link: /workflows
+ controller: workflows
+
+ - label: Files
+ link: /files
+ controller: blobs
+
+ - label: Packs
+ link: /packs
+ controller: packs
+
+# new_menu - Set "new_menu" with the details of each kind of thing to appear in
+# the New/Upload gadget.
+#
+# Each entry must have at least a label and link. You may specify
+# controller, in which case it is intepreted as a pattern against
+# that is matched with the current controller in use. If it
+# matches, it becomes the pre selected option in the new/upload
+# combo box.
+#
+# You may also specify a condition which is eval'd to determine if
+# the item should be included.
+#
+# Example:
+#
+# new_menu:
+#
+# - label: Workflow
+# link: /workflows/new
+# controller: workflows
+#
+# - label: File
+# link: /files/new
+# controller: blobs
+#
+# - label: Message
+# link: /messages/new
+# controller: messages
+# condition: logged_in?
+
+new_menu:
+
+ - label: Workflow
+ link: /workflows/new
+ controller: workflows
+
+ - label: File
+ link: /files/new
+ controller: blobs
+
+ - label: Pack
+ link: /packs/new
+ controller: packs
+
+ - label: Group
+ link: /groups/new
+ controller: networks
+
+ - label: Message
+ link: /messages/new
+ controller: messages
+ condition: logged_in?
+
+ - label: Runner
+ link: /runners/new
+ controller: runners
+ condition: logged_in? && !TavernaEnactor.for_user(current_user).empty?
+
+ - label: Experiment
+ link: /experiments/new
+ controller: experiments
+ condition: logged_in? && !TavernaEnactor.for_user(current_user).empty?
+
+ - label: Job
+ link: /jobs/new
+ controller: jobs
+ condition: logged_in? && !TavernaEnactor.for_user(current_user).empty?
+
+# search_categories - These are the search categories shown in the search bar
+# just under the main tabs.
+
+search_categories: [all, users, groups, workflows, files, packs]
+
+# email - These are the email addresses used for sending notifications and the
+# email address to send feedback entered from the web site.
+#
+# Example:
+#
+# notifications_email_address: address@hidden
+#
+# feedback_email_address: address@hidden
+
+notifications_email_address: address@hidden
+
+feedback_email_address: address@hidden
+
+# model_aliases - These are visible names for models where the desired visible
+# name might conflict with existing classes (e.g. "File" or
+# "Application")
+
+model_aliases:
+
+ File: Blob
+ Group: Network
+
+# bot_ignore_list - Patterns in this list will be used to be checked against
+# "user-agent" in HTTP request headers to filter out bots
+# from usage statistics.
+
+bot_ignore_list:
+
+ - Googlebot
+ - Slurp
+ - msnbot
+ - crawler
+ - bot
+ - heritrix
+ - spider
+ - Nutch
+
+# max_upload_size - The maximum file size allowed for workflows, etc.
+
+max_upload_size: 20971520
+
+# solr_enable - Set solr_enable to true to enable the search facility - this
+# requires a running solr server.
+
+solr_enable: false
+
+# smtp - Email configuration. These details are used to connect to a SMTP
+# server instead of sendmail.
+
+smtp:
+
+ :address: "smtp.example.com"
+ :port: 25,
+ :domain: ""
+ :authentication: :login
+ :user_name: "username"
+ :password: "password"
+
+# show_debug - Shows query statistics in the footer: "Queries in Controller",
+# "Queries in View" and "Query Time".
+
+show_debug: false
+
+# sym_encryption_key - This is the encyption key used to encrypt the passwords
+# for the workflow runners.
+
+sym_encryption_key: your_symmetric_encryption_key
+
+# secret_word - This word is used as salt for email confirmation hashes.
+
+secret_word: our_secret_word_that_no_one_knows
+
+# google_web_analytics - Enable this to enable Google web analytics.
+
+google_web_analytics:
+
+ enable: false
+ tracker_code: "enter_tracker_code_here"
+
+# bookmark_widget - Enable this to show the bookmark widget
+
+bookmark_widget:
+
+ enable: false
+ addthis_username: "addthis.com username"
+
+# =========== Settings for Activity Limits ===========
+
+# Each limited feature will require a set of 5 settings; meanings of each
+# described below. First part of every setting is the name of the feature
+# being limited.
+#
+# start_value - The initial maximum allowance for the feature (used when the
+# new limit is created)
+#
+# max_value - Absolute maximum allowance for the feature (this can't be
+# exceeded after any promotions); 'nil' for always increasing
+# allowance
+#
+# frequency (in hours) - The time period over which the allowance is given; for
+# example 5 messages (allowance) for 24 hours
+# (frequency) 'nil' for non-periodic limits (i.e. limits
+# which won't have their counters reset every
+# <frequency> hours)
+#
+# promote_every (in days) - Every <X> days the user will be promoted to the
+# new level, where the allowance per frequency
+# period will be adjusted by promote_increment;
+# 'nil' to indicate that promotion should never
+# happen
+#
+# promote_increment - Should be positive; 0 to indicate that promotion
+# shouldn't expand the allowance (why would this be
+# useful?) 'nil' to perform a one-time promotion by setting
+# the limit to whatever the value of max_value is; 'nil'
+# when the max_value is also 'nil' makes the feature
+# unlimited.
+
+activity_limits:
+
+ internal_message:
+
+ start_value: 10
+ max_value: 200
+ frequency: 24 # hours
+ promote_every: 10 # days
+ promote_increment: 10
+
+ user_invite:
+
+ start_value: 20
+ max_value: nil
+ frequency: 24 # hours
+ promote_every: nil # days
+ promote_increment: nil
+
+ group_invite:
+
+ start_value: 10
+ max_value: 100
+ frequency: 24 # hours
+ promote_every: 20 # days
+ promote_increment: 10
+
Modified: branches/apace/config/environment.rb (2151 => 2152)
--- branches/apace/config/environment.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/config/environment.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -71,5 +71,7 @@
require 'smtp_tls'
require 'authorization'
+ActionMailer::Base.smtp_settings = Conf.smtp
+
load 'config/environment_private.rb' if FileTest.exist?('config/environment_private.rb')
Deleted: branches/apace/config/environment_private.rb.pre (2151 => 2152)
--- branches/apace/config/environment_private.rb.pre 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/config/environment_private.rb.pre 2009-03-31 14:21:28 UTC (rev 2152)
@@ -1,109 +0,0 @@
-
-# Mailer configuration
-
-ActionMailer::Base.smtp_settings = {
- :address => "smtp.example.com",
- :port => 25,
- :domain => "",
- :user_name => "username",
- :password => "password",
- :authentication => :login
-}
-
-ActionMailer::Base.server_settings = {
- :address => "smtp.example.com",
- :port => "587",
- :domain => "",
- :authentication => :plain,
- :user_name => "username",
- :password => "password"
-}
-
-SHOW_DEBUG = false
-
-# Key used for Symmetric Encryption
-SYM_ENCRYPTION_KEY = "your_symmetric_encryption_key"
-
-# Secret word used for email confirmation hashes (and possibly other things)
-SECRET_WORD = "our_secret_word_that_no_one_knows"
-
-# Set SOLR_ENABLE to true to enable the search facility - this requires a solr
-# server
-SOLR_ENABLE = false
-
-
-# ---
-# BEGIN web analytics settings
-
-# Switch web analytics on or off
-USE_WEBANALYTICS = false
-
-# Tracker code for Google Analytics
-GOOGLEANALYTICS_TRACKER_CODE = "enter_tracker_code_here"
-
-# END web analytics settings
-# ---
-
-
-# ---
-# BEGIN addthis.com bookmarking widget settings
-
-USE_BOOKMARK_WIDGET = false
-
-# addthis.com username
-ADDTHIS_WIDGET_USERNAME = "addthis.com username"
-
-# END addthis.com bookmarking widget settings
-# ---
-
-# The number of seconds for the cache timeout
-CACHE_TIMEOUT_SECS = 120
-
-# The maximum file size allowed for workflows
-WORKFLOW_UPLOAD_MAX_BYTES = 20971520
-
-
-# =========== Settings for Download and Viewing Logging ===========
-
-# Patterns in this list will be used to be checked against "user-agent" in http request headers
-# to filter out bots from usage statistics.
-#
-# It is essential to put patterns into the ignore list in a single quotes - this will enable the
-# patterns to be treated as regular expressions, not just strings
-BOT_IGNORE_LIST = ['Googlebot', 'Slurp', 'msnbot', 'crawler', 'bot', 'heritrix', 'spider', 'Nutch']
-
-
-# =========== Settings for Activity Limits ===========
-
-# Each limited feature will require a set of 5 settings; meanings of each described below.
-# First part of every setting is the name of the feature being limited.
-# <feature_name>_LIMIT_START_VALUE - the initial maximum allowance for the feature (used when the new limit is created)
-# <feature_name>_LIMIT_MAX_VALUE - absolute maximum allowance for the feature (this can't be exceeded after any promotions);
-# NULL for always increasing allowance
-# <feature_name>_LIMIT_FREQUENCY -- in hours -- the time period over which the allowance is given; for example 5 messages (allowance) for 24 hours (frequency)
-# NULL for non-periodic limits (i.e. limits which won't have their counters reset every <frequency> hours)
-# <feature_name>_LIMIT_PROMOTE_EVERY -- in days -- every <X> days the user will be promoted to the new level,
-# where the allowance per frequency period will be adjusted by <feature_name>_LIMIT_PROMOTE_INCREMENT;
-# NULL to indicate that promotion should never happen
-# <feature_name>_LIMIT_PROMOTE_INCREMENT - should be positive;
-# 0 to indicate that promotion shouldn't expand the allowance (why would this be useful?)
-# NULL to perform a one-time promotion by setting the limit to whatever the value of <feature_name>_LIMIT_MAX_VALUE is;
-# NULL when the <feature_name>_LIMIT_MAX_VALUE is also NULL makes the feature unlimited.
-
-INTERNAL_MESSAGE_LIMIT_START_VALUE = 10
-INTERNAL_MESSAGE_LIMIT_MAX_VALUE = 200
-INTERNAL_MESSAGE_LIMIT_FREQUENCY = 24 # hours
-INTERNAL_MESSAGE_LIMIT_PROMOTE_EVERY = 10 # days
-INTERNAL_MESSAGE_LIMIT_PROMOTE_INCREMENT = 10
-
-USER_INVITE_LIMIT_START_VALUE = 20
-USER_INVITE_LIMIT_MAX_VALUE = nil
-USER_INVITE_LIMIT_FREQUENCY = 24 # hours
-USER_INVITE_LIMIT_PROMOTE_EVERY = nil # days
-USER_INVITE_LIMIT_PROMOTE_INCREMENT = nil
-
-GROUP_INVITE_LIMIT_START_VALUE = 10
-GROUP_INVITE_LIMIT_MAX_VALUE = 100
-GROUP_INVITE_LIMIT_FREQUENCY = 24 # hours
-GROUP_INVITE_LIMIT_PROMOTE_EVERY = 20 # days
-GROUP_INVITE_LIMIT_PROMOTE_INCREMENT = 10
Deleted: branches/apace/config/settings.yml.pre (2151 => 2152)
--- branches/apace/config/settings.yml.pre 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/config/settings.yml.pre 2009-03-31 14:21:28 UTC (rev 2152)
@@ -1,201 +0,0 @@
-# myExperiment: config/settings.yml.pre
-#
-# Copyright (c) 2009 University of Manchester and the University of Southampton.
-# See license.txt for details.
-
-# ------------------------------------------------------------------------------
-# myExperiment server configuration
-# ------------------------------------------------------------------------------
-#
-# site_name - Set "site_name" to the name of this myExperiment installation.
-# This is used by the myExperiment codebase to refer to service by
-# name.
-#
-# Example:
-#
-# site_name: mySite
-
-site_name: mySite
-
-# site_logo - set "site_logo" to the name of the logo used at the top left of
-# the web pages.
-#
-# Example:
-#
-# site_logo: logo.png
-
-site_logo: logo.png
-
-# base_uri - Set "base_uri" to the main entry point to this installation of
-# myExperiment. If you use a load balancing solution to proxy
-# incoming requests to a cluster, then this is the external address.
-#
-# Examples:
-#
-# base_uri: http://www.example.com
-#
-# or
-#
-# base_uri: http://www.example.com:3000
-#
-# NOTE: No trailing slash.
-
-base_uri: http://www.example.com
-
-# admins - Set "admins" to the list of usernames of people that are
-# administrators of this installation. This is "Username" that is set
-# when you manage your account, not the "Display Name".
-#
-# Example:
-#
-# admins: [dgc, jits, dtm]
-
-admins: []
-
-# main_tabs - These are the main tabs of the website. Each entry requires at
-# least a label and a link. If you specify a controller in a tab,
-# then the tab is shown as selected when the page has been served by
-# a controller that matches.
-#
-# The controller entry is a regular _expression_, so you can make a tab
-# show as selected in multiple controllers.
-#
-# Example:
-#
-# main_tabs:
-#
-# - label: Home
-# link: /home
-# controller: home
-#
-# - label: Users
-# link: /users
-# controller: (users|profiles|userhistory|friendships|memberships|pictures)
-#
-# - label: Groups
-# link: /groups
-# controller: networks
-#
-# - label: Wiki
-# link: http://wiki.example.com/
-
-main_tabs:
-
- - label: Home
- link: /home
- controller: home
-
- - label: Users
- link: /users
- controller: (users|profiles|userhistory|friendships|memberships|pictures)
-
- - label: Groups
- link: /groups
- controller: networks
-
- - label: Workflows
- link: /workflows
- controller: workflows
-
- - label: Files
- link: /files
- controller: blobs
-
- - label: Packs
- link: /packs
- controller: packs
-
-# new_menu - Set "new_menu" with the details of each kind of thing to appear in
-# the New/Upload gadget.
-#
-# Each entry must have at least a label and link. You may specify
-# controller, in which case it is intepreted as a pattern against
-# that is matched with the current controller in use. If it
-# matches, it becomes the pre selected option in the new/upload
-# combo box.
-#
-# You may also specify a condition which is eval'd to determine if
-# the item should be included.
-#
-# Example:
-#
-# new_menu:
-#
-# - label: Workflow
-# link: /workflows/new
-# controller: workflows
-#
-# - label: File
-# link: /files/new
-# controller: blobs
-#
-# - label: Message
-# link: /messages/new
-# controller: messages
-# condition: logged_in?
-
-new_menu:
-
- - label: Workflow
- link: /workflows/new
- controller: workflows
-
- - label: File
- link: /files/new
- controller: blobs
-
- - label: Pack
- link: /packs/new
- controller: packs
-
- - label: Group
- link: /groups/new
- controller: networks
-
- - label: Message
- link: /messages/new
- controller: messages
- condition: logged_in?
-
- - label: Runner
- link: /runners/new
- controller: runners
- condition: logged_in? && !TavernaEnactor.for_user(current_user).empty?
-
- - label: Experiment
- link: /experiments/new
- controller: experiments
- condition: logged_in? && !TavernaEnactor.for_user(current_user).empty?
-
- - label: Job
- link: /jobs/new
- controller: jobs
- condition: logged_in? && !TavernaEnactor.for_user(current_user).empty?
-
-# search_categories - These are the search categories shown in the search bar
-# just under the main tabs.
-
-search_categories: [all, users, groups, workflows, files, packs]
-
-# email - These are the email addresses used for sending notifications and the
-# email address to send feedback entered from the web site.
-#
-# Example:
-#
-# notifications_email_address: address@hidden
-#
-# feedback_email_address: address@hidden
-
-notifications_email_address: address@hidden
-
-feedback_email_address: address@hidden
-
-# model_aliases - These are visible names for models where the desired visible
-# name might conflict with existing classes (e.g. "File" or
-# "Application")
-
-model_aliases:
-
- File: Blob
- Group: Network
-
Modified: branches/apace/lib/conf.rb (2151 => 2152)
--- branches/apace/lib/conf.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/lib/conf.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -9,53 +9,106 @@
class Conf
- @vars = YAML::load_file("config/settings.yml")
+ @defaults = YAML::load_file("config/default_settings.yml")
+ if File.exists?("config/settings.yml")
+ @settings = YAML::load_file("config/settings.yml")
+ else
+ @settings = {}
+ end
+
def self.sitename
- @vars['site_name']
+ self.fetch_entry('site_name')
end
def self.site_logo
- @vars['site_logo']
+ self.fetch_entry('site_logo')
end
def self.notifications_email_address
- @vars['notifications_email_address']
+ self.fetch_entry('notifications_email_address')
end
def self.feedback_email_address
- @vars['feedback_email_address']
+ self.fetch_entry('feedback_email_address')
end
def self.base_uri
- @vars['base_uri']
+ self.fetch_entry('base_uri')
end
def self.admins
- @vars['admins']
+ self.fetch_entry('admins')
end
def self.main_tabs
- @vars['main_tabs']
+ self.fetch_entry('main_tabs')
end
def self.new_menu
- @vars['new_menu']
+ self.fetch_entry('new_menu')
end
def self.search_categories
- @vars['search_categories']
+ self.fetch_entry('search_categories')
end
def self.model_aliases
- @vars['model_aliases']
+ self.fetch_entry('model_aliases')
end
+ def self.bot_ignore_list
+ self.fetch_entry('bot_ignore_list')
+ end
+
+ def self.max_upload_size
+ self.fetch_entry('max_upload_size')
+ end
+
+ def self.solr_enable
+ self.fetch_entry('solr_enable')
+ end
+
+ def self.smtp
+ self.fetch_entry('smtp')
+ end
+
+ def self.show_debug
+ self.fetch_entry('show_debug')
+ end
+
+ def self.sym_encryption_key
+ self.fetch_entry('sym_encryption_key')
+ end
+
+ def self.secret_word
+ self.fetch_entry('secret_word')
+ end
+
+ def self.google_web_analytics
+ self.fetch_entry('google_web_analytics')
+ end
+
+ def self.bookmark_widget
+ self.fetch_entry('bookmark_widget')
+ end
+
+ def self.activity_limits
+ self.fetch_entry('activity_limits')
+ end
+
# This method is required to create an administrator in the test fixtures
def self.admins=(value)
- @vars['admins'] = value
+ @settings['admins'] = value
end
+private
+
+ def self.fetch_entry(key)
+ return @settings[key] if @settings[key]
+ return @defaults[key] if @defaults[key]
+ end
+
end
Modified: branches/apace/lib/rest.rb (2151 => 2152)
--- branches/apace/lib/rest.rb 2009-03-31 14:03:28 UTC (rev 2151)
+++ branches/apace/lib/rest.rb 2009-03-31 14:21:28 UTC (rev 2152)
@@ -802,7 +802,7 @@
results = []
- if SOLR_ENABLE and not search_query.nil? and search_query != ""
+ if Conf.solr_enable and not search_query.nil? and search_query != ""
results = models[0].multi_solr_search(search_query, :limit => 100,
:models => models).results
end