sufia 4.0.0.rc1 → 4.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +2 -2
- data/Gemfile +9 -17
- data/README.md +18 -9
- data/Rakefile +10 -5
- data/SUFIA_VERSION +1 -1
- data/app/assets/javascripts/jquery.blacklightTagCloud.js +1 -1
- data/app/assets/javascripts/sufia.js +5 -22
- data/app/assets/javascripts/sufia/batch.js +8 -0
- data/app/assets/javascripts/sufia/batch_edit.js +19 -3
- data/app/assets/javascripts/sufia/dashboard_actions.js +23 -10
- data/app/assets/javascripts/sufia/multiForm.js +2 -2
- data/app/assets/javascripts/sufia/permissions.js +10 -9
- data/app/assets/javascripts/sufia/tabs.js +20 -0
- data/app/assets/stylesheets/catalog.css.scss +5 -0
- data/app/assets/stylesheets/collections.css.scss +40 -0
- data/app/assets/stylesheets/file-listing.css.scss +37 -13
- data/app/assets/stylesheets/generic_files.css.erb +5 -0
- data/app/assets/stylesheets/header.css.scss +1 -4
- data/app/assets/stylesheets/settings.css.scss +6 -0
- data/app/assets/stylesheets/styles.css.scss +4 -3
- data/app/assets/stylesheets/sufia-audio-overrides.css +2 -2
- data/app/assets/stylesheets/sufia.css.scss +27 -5
- data/app/assets/stylesheets/tagcloud.css +5 -1
- data/app/controllers/batch_controller.rb +3 -3
- data/app/controllers/concerns/sufia/batch_edits_controller_behavior.rb +14 -1
- data/app/controllers/concerns/sufia/catalog.rb +0 -1
- data/app/controllers/concerns/sufia/controller.rb +5 -0
- data/app/controllers/concerns/sufia/dashboard_controller_behavior.rb +2 -9
- data/app/controllers/concerns/sufia/files_controller/browse_everything.rb +3 -3
- data/app/controllers/concerns/sufia/files_controller_behavior.rb +5 -1
- data/app/controllers/concerns/sufia/homepage_controller.rb +1 -1
- data/app/controllers/concerns/sufia/users_controller_behavior.rb +3 -2
- data/app/helpers/batch_edits_helper.rb +6 -0
- data/app/helpers/generic_file_helper.rb +15 -0
- data/app/helpers/sufia/blacklight_override.rb +19 -3
- data/app/helpers/sufia/dashboard_helper_behavior.rb +25 -3
- data/app/helpers/sufia/records_helper_behavior.rb +13 -5
- data/app/helpers/sufia/sufia_helper_behavior.rb +15 -12
- data/app/models/concerns/sufia/solr_document_behavior.rb +5 -36
- data/app/views/_masthead.html.erb +1 -1
- data/app/views/_user_util_links.html.erb +6 -4
- data/app/views/advanced/_advanced_search_fields.html.erb +4 -4
- data/app/views/advanced/_advanced_search_form.html.erb +14 -17
- data/app/views/advanced/index.html.erb +3 -3
- data/app/views/batch/_metadata.html.erb +22 -24
- data/app/views/batch/_more_metadata.html.erb +1 -1
- data/app/views/batch/edit.html.erb +2 -2
- data/app/views/batch_edits/_check_all.html.erb +7 -9
- data/app/views/batch_edits/_delete_selected.html.erb +1 -0
- data/app/views/batch_edits/edit.html.erb +25 -26
- data/app/views/batch_edits/update_edit.js.erb +1 -1
- data/app/views/catalog/_facet_limit.html.erb +4 -12
- data/app/views/catalog/_search_form.html.erb +8 -13
- data/app/views/collections/_action_menu.html.erb +2 -2
- data/app/views/collections/_collection.html.erb +10 -31
- data/app/views/collections/_document_list.html.erb +1 -1
- data/app/views/collections/_edit_actions.html.erb +2 -2
- data/app/views/collections/_edit_descriptions.html.erb +3 -5
- data/app/views/collections/_form.html.erb +8 -10
- data/app/views/collections/_media_display.html.erb +1 -1
- data/app/views/collections/_show_actions.html.erb +5 -5
- data/app/views/collections/_show_descriptions.html.erb +13 -8
- data/app/views/collections/_show_document_list.html.erb +17 -0
- data/app/views/collections/_show_document_list_menu.html.erb +24 -0
- data/app/views/collections/_show_document_list_row.html.erb +63 -0
- data/app/views/collections/edit.html.erb +2 -2
- data/app/views/collections/show.html.erb +28 -19
- data/app/views/contact_form/new.html.erb +21 -29
- data/app/views/dashboard/_index_partials/_contents.html.erb +14 -0
- data/app/views/dashboard/_index_partials/_heading_actions.html.erb +18 -0
- data/app/views/dashboard/_index_partials/_heading_greetings.html.erb +8 -0
- data/app/views/dashboard/_index_partials/_stats.html.erb +6 -2
- data/app/views/dashboard/index.html.erb +5 -37
- data/app/views/generic_files/_breadcrumbs.html.erb +2 -0
- data/app/views/generic_files/_browse_everything.html.erb +2 -2
- data/app/views/generic_files/_descriptions.html.erb +4 -6
- data/app/views/generic_files/_field_form.html.erb +2 -2
- data/app/views/generic_files/_generic_file.html.erb +8 -29
- data/app/views/generic_files/_groups_description.html.erb +5 -4
- data/app/views/generic_files/_permission.html.erb +2 -2
- data/app/views/generic_files/_permission_form.html.erb +62 -77
- data/app/views/generic_files/_rights_modal.html.erb +0 -2
- data/app/views/generic_files/_share_with.html.erb +14 -0
- data/app/views/generic_files/_show_actions.html.erb +1 -1
- data/app/views/generic_files/_show_collections.html.erb +17 -0
- data/app/views/generic_files/_show_descriptions.html.erb +2 -2
- data/app/views/generic_files/_versioning.html.erb +2 -2
- data/app/views/generic_files/_visibility.html.erb +17 -0
- data/app/views/generic_files/show.html.erb +39 -2
- data/app/views/generic_files/stats.html.erb +1 -1
- data/app/views/generic_files/upload/_form_fields.html.erb +2 -2
- data/app/views/generic_files/upload/_local_file_import_chooser.html.erb +1 -1
- data/app/views/generic_files/upload/_script_templates.html.erb +2 -2
- data/app/views/generic_files/upload/_tos_checkbox.html.erb +3 -3
- data/app/views/homepage/_home_content.html.erb +0 -9
- data/app/views/homepage/_home_header.html.erb +1 -1
- data/app/views/homepage/_recent_document.html.erb +2 -2
- data/app/views/layouts/_head_tag_content.html.erb +7 -1
- data/app/views/layouts/sufia-dashboard.html.erb +4 -2
- data/app/views/layouts/sufia-one-column.html.erb +1 -1
- data/app/views/my/_action_menu.html.erb +1 -1
- data/app/views/my/_collection_action_menu.html.erb +3 -3
- data/app/views/my/_constraints.html.erb +11 -0
- data/app/views/my/_document_list.html.erb +1 -1
- data/app/views/my/_facet_limit.html.erb +4 -12
- data/app/views/my/_facets.html.erb +1 -3
- data/app/views/my/_index_partials/_default_group.html.erb +2 -3
- data/app/views/my/_index_partials/_list_collections.html.erb +17 -11
- data/app/views/my/_index_partials/_list_files.html.erb +20 -24
- data/app/views/my/_search_header.html.erb +5 -0
- data/app/views/my/_sort_and_per_page.html.erb +11 -7
- data/app/views/my/index.html.erb +9 -15
- data/app/views/records/_edit_field.html.erb +14 -10
- data/app/views/records/edit_fields/_default.html.erb +6 -0
- data/app/views/records/edit_fields/_description.html.erb +3 -7
- data/app/views/records/edit_fields/_resource_type.html.erb +4 -6
- data/app/views/records/edit_fields/_rights.html.erb +4 -5
- data/app/views/records/edit_fields/_suffix.html.erb +6 -3
- data/app/views/records/edit_fields/_type.html.erb +7 -12
- data/app/views/{generic_files → records}/show_fields/_based_near.html.erb +1 -1
- data/app/views/{generic_files → records}/show_fields/_contributor.html.erb +2 -2
- data/app/views/records/show_fields/_creator.html.erb +6 -0
- data/app/views/{generic_files → records}/show_fields/_date_created.html.erb +1 -1
- data/app/views/records/show_fields/_default.html.erb +6 -0
- data/app/views/records/show_fields/_description.html.erb +6 -0
- data/app/views/records/show_fields/_identifier.html.erb +4 -0
- data/app/views/{generic_files → records}/show_fields/_language.html.erb +1 -1
- data/app/views/{generic_files → records}/show_fields/_publisher.html.erb +1 -1
- data/app/views/records/show_fields/_related_url.html.erb +6 -0
- data/app/views/{generic_files → records}/show_fields/_resource_type.html.erb +1 -1
- data/app/views/{generic_files → records}/show_fields/_rights.html.erb +1 -1
- data/app/views/{generic_files → records}/show_fields/_subject.html.erb +1 -1
- data/app/views/{generic_files → records}/show_fields/_tag.html.erb +1 -1
- data/app/views/records/show_fields/_title.html.erb +6 -0
- data/app/views/shared/_attributes.html.erb +27 -0
- data/app/views/static/agreement.html.erb +1 -1
- data/app/views/users/_activity_log.html.erb +0 -2
- data/app/views/users/_follower_modal.html.erb +27 -23
- data/app/views/users/_following_modal.html.erb +27 -23
- data/app/views/users/_social_media_info.html.erb +4 -4
- data/app/views/users/_trophy_edit.html.erb +5 -7
- data/app/views/users/_user_info.html.erb +3 -3
- data/app/views/users/_user_util_links_extra.html.erb +4 -0
- data/app/views/users/edit.html.erb +28 -33
- data/app/views/users/index.html.erb +1 -1
- data/app/views/users/show.html.erb +0 -4
- data/config/jetty.yml +1 -1
- data/config/locales/sufia.en.yml +53 -12
- data/lib/generators/sufia/install_generator.rb +89 -0
- data/lib/generators/sufia/templates/catalog_controller.rb +1 -1
- data/lib/generators/sufia/upgrade400_generator.rb +4 -0
- data/lib/sufia.rb +1 -10
- data/lib/sufia/version.rb +1 -1
- data/solr_conf/conf/solrconfig.xml +31 -17
- data/spec/actors/generic_file/actor_spec.rb +17 -0
- data/spec/controllers/batch_controller_spec.rb +2 -2
- data/spec/controllers/batch_edits_controller_spec.rb +24 -19
- data/spec/controllers/catalog_controller_spec.rb +23 -12
- data/spec/controllers/collections_controller_spec.rb +19 -17
- data/spec/controllers/dashboard_controller_spec.rb +5 -19
- data/spec/controllers/generic_files_controller_spec.rb +35 -20
- data/spec/controllers/homepage_controller_spec.rb +25 -2
- data/spec/controllers/users_controller_spec.rb +99 -102
- data/spec/factories/generic_files.rb +2 -2
- data/spec/factories/users.rb +32 -2
- data/spec/features/browse_dashboard_files_spec.rb +14 -2
- data/spec/features/browse_files_spec.rb +5 -1
- data/spec/features/catalog_search_spec.rb +7 -6
- data/spec/features/collection_spec.rb +43 -33
- data/spec/features/display_dashboard_spec.rb +25 -22
- data/spec/features/notifications_spec.rb +9 -4
- data/spec/features/users_spec.rb +34 -25
- data/spec/fixtures/1.5mb-avatar.jpg +0 -0
- data/spec/helpers/batch_edits_helper_spec.rb +38 -0
- data/spec/helpers/dashboard_helper_spec.rb +16 -5
- data/spec/helpers/generic_file_helper_spec.rb +41 -0
- data/spec/helpers/records_helper_spec.rb +12 -0
- data/spec/jobs/active_fedora_pid_based_job_spec.rb +1 -1
- data/spec/jobs/audit_job_spec.rb +2 -3
- data/spec/jobs/batch_update_job_spec.rb +39 -24
- data/spec/jobs/event_jobs_spec.rb +1 -1
- data/spec/lib/sufia/id_service_spec.rb +25 -7
- data/spec/lib/sufia/messages_spec.rb +60 -0
- data/spec/lib/sufia/readable_permissions_spec.rb +56 -0
- data/spec/lib/sufia/writable_permissions_spec.rb +20 -0
- data/spec/models/batch_spec.rb +1 -1
- data/spec/models/collection_spec.rb +24 -2
- data/spec/models/featured_work_spec.rb +2 -2
- data/spec/models/file_content_datastream_spec.rb +5 -5
- data/spec/models/generic_file_spec.rb +149 -133
- data/spec/models/local_authority_spec.rb +1 -1
- data/spec/models/user_spec.rb +33 -6
- data/spec/spec_helper.rb +7 -10
- data/spec/{support → test_app_templates}/lib/generators/test_app_generator.rb +11 -6
- data/spec/views/batch/edit.html.erb_spec.rb +8 -2
- data/spec/views/catalog/index.html.erb_spec.rb +34 -0
- data/spec/views/catalog/{sort_and_per_pange.html.erb_spec.rb → sort_and_per_page.html.erb_spec.rb} +0 -0
- data/spec/views/collections/_form.html.erb_spec.rb +32 -0
- data/spec/views/collections/_show_descriptions.html.erb_spec.rb +25 -0
- data/spec/views/dashboard/index_spec.rb +33 -4
- data/spec/views/generic_file/_breadcrumbs.html.erb_spec.rb +32 -0
- data/spec/views/generic_file/show.html.erb_spec.rb +273 -8
- data/spec/views/users/_user_util_links.html.erb_spec.rb +25 -0
- data/sufia-models/app/actors/sufia/generic_file/actor.rb +14 -5
- data/sufia-models/{lib/sufia/models → app}/jobs/active_fedora_pid_based_job.rb +0 -0
- data/sufia-models/{lib/sufia/models → app}/jobs/audit_job.rb +4 -10
- data/sufia-models/{lib/sufia/models → app}/jobs/batch_update_job.rb +22 -18
- data/sufia-models/{lib/sufia/models → app}/jobs/characterize_job.rb +0 -0
- data/sufia-models/{lib/sufia/models → app}/jobs/create_derivatives_job.rb +0 -0
- data/sufia-models/{lib/sufia/models → app}/jobs/import_url_job.rb +0 -0
- data/sufia-models/{lib/sufia/models → app}/jobs/resolrize_job.rb +0 -0
- data/sufia-models/app/models/collection.rb +1 -39
- data/sufia-models/{lib → app/models/concerns}/sufia/ability.rb +0 -0
- data/sufia-models/app/models/concerns/sufia/collection.rb +55 -0
- data/sufia-models/app/models/concerns/sufia/generic_file.rb +5 -11
- data/sufia-models/app/models/concerns/sufia/generic_file/audit.rb +1 -2
- data/sufia-models/app/models/concerns/sufia/generic_file/characterization.rb +4 -2
- data/sufia-models/app/models/concerns/sufia/generic_file/full_text_indexing.rb +27 -0
- data/sufia-models/app/models/concerns/sufia/generic_file/mime_types.rb +1 -0
- data/sufia-models/app/models/concerns/sufia/generic_file/permissions.rb +2 -49
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/model_methods.rb +0 -0
- data/sufia-models/app/models/concerns/sufia/user.rb +8 -1
- data/sufia-models/app/models/sufia/avatar_uploader.rb +2 -3
- data/sufia-models/app/services/sufia/noid.rb +9 -0
- data/sufia-models/config/locales/sufia.en.yml +1 -0
- data/sufia-models/lib/generators/sufia/models/fulltext_generator.rb +27 -0
- data/sufia-models/lib/generators/sufia/models/install_generator.rb +7 -0
- data/sufia-models/lib/generators/sufia/models/templates/config/analytics.yml +5 -5
- data/sufia-models/lib/generators/sufia/models/templates/config/solrconfig.xml +177 -0
- data/sufia-models/lib/generators/sufia/models/templates/config/sufia.rb +3 -1
- data/sufia-models/lib/generators/sufia/models/upgrade400_generator.rb +7 -0
- data/sufia-models/lib/sufia/messages.rb +67 -0
- data/sufia-models/lib/sufia/models.rb +2 -0
- data/sufia-models/lib/sufia/models/active_fedora/redis.rb +0 -6
- data/sufia-models/lib/sufia/models/engine.rb +1 -3
- data/sufia-models/lib/sufia/models/resque.rb +1 -1
- data/sufia-models/lib/sufia/models/version.rb +1 -1
- data/sufia-models/lib/sufia/permissions.rb +9 -0
- data/sufia-models/lib/sufia/permissions/readable.rb +20 -0
- data/sufia-models/lib/sufia/permissions/writable.rb +56 -0
- data/sufia-models/lib/tasks/sufia-models_tasks.rake +58 -2
- data/sufia-models/sufia-models.gemspec +11 -11
- data/sufia.gemspec +19 -9
- data/tasks/jetty.rake +6 -5
- data/tasks/sufia-dev.rake +4 -77
- metadata +235 -72
- data/app/assets/images/folder.png +0 -0
- data/app/views/collections/show_fields/_creator.html.erb +0 -11
- data/app/views/collections/show_fields/_description.html.erb +0 -8
- data/app/views/collections/show_fields/_title.html.erb +0 -8
- data/app/views/generic_files/edit_fields/_default.html.erb +0 -6
- data/app/views/generic_files/edit_fields/_description.html.erb +0 -5
- data/app/views/generic_files/edit_fields/_resource_type.html.erb +0 -6
- data/app/views/generic_files/edit_fields/_rights.html.erb +0 -6
- data/app/views/generic_files/edit_fields/_suffix.html.erb +0 -9
- data/app/views/generic_files/show_fields/_creator.html.erb +0 -7
- data/app/views/generic_files/show_fields/_default.html.erb +0 -6
- data/app/views/generic_files/show_fields/_description.html.erb +0 -7
- data/app/views/generic_files/show_fields/_identifier.html.erb +0 -4
- data/app/views/generic_files/show_fields/_related_url.html.erb +0 -6
- data/app/views/generic_files/show_fields/_title.html.erb +0 -7
- data/lib/generators/sufia/sufia_generator.rb +0 -89
- data/spec/active_fedora/unsaved_digital_object_spec.rb +0 -35
File without changes
|
@@ -21,6 +21,7 @@ module Sufia::User
|
|
21
21
|
mount_uploader :avatar, AvatarUploader, mount_on: :avatar_file_name
|
22
22
|
validates_with AvatarValidator
|
23
23
|
has_many :trophies
|
24
|
+
attr_accessor :update_directory
|
24
25
|
end
|
25
26
|
|
26
27
|
# Format the json for select2 which requires just an id and a field called text.
|
@@ -63,13 +64,19 @@ module Sufia::User
|
|
63
64
|
@ability ||= ::Ability.new(self)
|
64
65
|
end
|
65
66
|
|
67
|
+
def get_all_user_activity( since = DateTime.now.to_i - 8640)
|
68
|
+
events = self.events.reverse.collect { |event| event if event[:timestamp].to_i > since }.compact
|
69
|
+
profile_events = self.profile_events.reverse.collect { |event| event if event[:timestamp].to_i > since }.compact
|
70
|
+
events.concat(profile_events).sort { |a, b| b[:timestamp].to_i <=> a[:timestamp].to_i }
|
71
|
+
end
|
72
|
+
|
66
73
|
module ClassMethods
|
67
74
|
|
68
75
|
def permitted_attributes
|
69
76
|
[:email, :login, :display_name, :address, :admin_area,
|
70
77
|
:department, :title, :office, :chat_id, :website, :affiliation,
|
71
78
|
:telephone, :avatar, :group_list, :groups_last_update, :facebook_handle,
|
72
|
-
:twitter_handle, :googleplus_handle, :linkedin_handle]
|
79
|
+
:twitter_handle, :googleplus_handle, :linkedin_handle, :remove_avatar]
|
73
80
|
end
|
74
81
|
|
75
82
|
def current
|
@@ -1,9 +1,7 @@
|
|
1
1
|
class Sufia::AvatarUploader < CarrierWave::Uploader::Base
|
2
2
|
include CarrierWave::MiniMagick
|
3
3
|
include CarrierWave::Compatibility::Paperclip
|
4
|
-
|
5
|
-
process convert: 'png'
|
6
|
-
|
4
|
+
|
7
5
|
version :medium do
|
8
6
|
process resize_to_limit: [300, 300]
|
9
7
|
end
|
@@ -19,4 +17,5 @@ class Sufia::AvatarUploader < CarrierWave::Uploader::Base
|
|
19
17
|
def extension_white_list
|
20
18
|
%w(jpg jpeg png gif bmp tif tiff)
|
21
19
|
end
|
20
|
+
|
22
21
|
end
|
@@ -1,5 +1,14 @@
|
|
1
1
|
module Sufia
|
2
2
|
module Noid
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
module ClassMethods
|
6
|
+
## This overrides the default behavior, which is to ask Fedora for a pid
|
7
|
+
# @see ActiveFedora::Sharding.assign_pid
|
8
|
+
def assign_pid(_)
|
9
|
+
Sufia::IdService.mint
|
10
|
+
end
|
11
|
+
end
|
3
12
|
|
4
13
|
def noid
|
5
14
|
Noid.noidify(self.pid)
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
require 'rails/generators'
|
3
|
+
|
4
|
+
class Sufia::Models::FulltextGenerator < Rails::Generators::Base
|
5
|
+
source_root File.expand_path('../templates', __FILE__)
|
6
|
+
|
7
|
+
desc """
|
8
|
+
This generator makes the following changes to your application:
|
9
|
+
1. Copies solrconfig.xml into solr_conf/conf/
|
10
|
+
2. Reconfigures jetty
|
11
|
+
"""
|
12
|
+
|
13
|
+
def banner
|
14
|
+
say_status("warning", "GENERATING SUFIA FULL-TEXT", :yellow)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Copy Sufia's solrconfig into the dir from which the jetty:config task pulls
|
18
|
+
# Sufia's solrconfig includes full-text extraction
|
19
|
+
def copy_solr_config
|
20
|
+
copy_file 'config/solrconfig.xml', 'solr_conf/conf/solrconfig.xml', force: true
|
21
|
+
end
|
22
|
+
|
23
|
+
# Copy config, schema, and jars into jetty dir if it exists
|
24
|
+
def reconfigure_jetty
|
25
|
+
rake "sufia:jetty:config" if File.directory?('jetty')
|
26
|
+
end
|
27
|
+
end
|
@@ -15,6 +15,8 @@ This generator makes the following changes to your application:
|
|
15
15
|
3. Creates the sufia.rb configuration file
|
16
16
|
4. Generates mailboxer
|
17
17
|
5. Generates usage stats config
|
18
|
+
6. Installs Blacklight gallery
|
19
|
+
7. Runs full-text generator
|
18
20
|
"""
|
19
21
|
|
20
22
|
# Implement the required interface for Rails::Generators::Migration.
|
@@ -94,6 +96,11 @@ This generator makes the following changes to your application:
|
|
94
96
|
generate "blacklight_gallery:install"
|
95
97
|
end
|
96
98
|
|
99
|
+
# Sets up full-text indexing (Solr config + jars)
|
100
|
+
def full_text_indexing
|
101
|
+
generate "sufia:models:fulltext"
|
102
|
+
end
|
103
|
+
|
97
104
|
private
|
98
105
|
|
99
106
|
def better_migration_template(file)
|
@@ -2,8 +2,8 @@
|
|
2
2
|
# To integrate your app with Google Analytics, uncomment the lines below and add your API key information.
|
3
3
|
#
|
4
4
|
# analytics:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
5
|
+
# app_name: GOOGLE_OAUTH_APP_NAME
|
6
|
+
# app_version: GOOGLE_OAUTH_APP_VERSION
|
7
|
+
# privkey_path: GOOGLE_OAUTH_PRIVATE_KEY_PATH
|
8
|
+
# privkey_secret: GOOGLE_OAUTH_PRIVATE_KEY_SECRET
|
9
|
+
# client_email: GOOGLE_OAUTH_CLIENT_EMAIL
|
@@ -0,0 +1,177 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<config>
|
3
|
+
<!-- NOTE: various comments and unused configuration possibilities have been purged
|
4
|
+
from this file. Please refer to http://wiki.apache.org/solr/SolrConfigXml,
|
5
|
+
as well as the default solrconfig file included with Solr -->
|
6
|
+
|
7
|
+
<abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
|
8
|
+
|
9
|
+
<luceneMatchVersion>LUCENE_40</luceneMatchVersion>
|
10
|
+
|
11
|
+
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
|
12
|
+
|
13
|
+
<!-- solr lib dirs -->
|
14
|
+
<lib dir="../lib/contrib/analysis-extras/lib" />
|
15
|
+
<lib dir="../lib/contrib/analysis-extras/lucene-libs" />
|
16
|
+
<!-- for full-text indexing -->
|
17
|
+
<lib dir="../lib/contrib/extraction/lib" regex=".*\.jar" />
|
18
|
+
|
19
|
+
<dataDir>${solr.data.dir:}</dataDir>
|
20
|
+
|
21
|
+
<requestHandler name="search" class="solr.SearchHandler" default="true">
|
22
|
+
<!-- default values for query parameters can be specified, these
|
23
|
+
will be overridden by parameters in the request
|
24
|
+
-->
|
25
|
+
<lst name="defaults">
|
26
|
+
<str name="defType">edismax</str>
|
27
|
+
<str name="echoParams">explicit</str>
|
28
|
+
<str name="q.alt">*:*</str>
|
29
|
+
<str name="mm">2<-1 5<-2 6<90%</str>
|
30
|
+
<int name="qs">1</int>
|
31
|
+
<int name="ps">2</int>
|
32
|
+
<float name="tie">0.01</float>
|
33
|
+
<!-- this qf and pf are used by default, if not otherwise specified by
|
34
|
+
client. The default blacklight_config will use these for the
|
35
|
+
"keywords" search. See the author_qf/author_pf, title_qf, etc
|
36
|
+
below, which the default blacklight_config will specify for
|
37
|
+
those searches. You may also be interested in:
|
38
|
+
http://wiki.apache.org/solr/LocalParams
|
39
|
+
-->
|
40
|
+
<str name="qf">
|
41
|
+
id
|
42
|
+
all_text_timv
|
43
|
+
active_fedora_model_ssi
|
44
|
+
object_type_si
|
45
|
+
</str>
|
46
|
+
<str name="pf">
|
47
|
+
all_text_timv^10
|
48
|
+
</str>
|
49
|
+
|
50
|
+
<str name="author_qf">
|
51
|
+
</str>
|
52
|
+
<str name="author_pf">
|
53
|
+
</str>
|
54
|
+
<str name="title_qf">
|
55
|
+
</str>
|
56
|
+
<str name="title_pf">
|
57
|
+
</str>
|
58
|
+
<str name="subject_qf">
|
59
|
+
</str>
|
60
|
+
<str name="subject_pf">
|
61
|
+
</str>
|
62
|
+
|
63
|
+
<str name="fl">
|
64
|
+
*,
|
65
|
+
score
|
66
|
+
</str>
|
67
|
+
|
68
|
+
<str name="facet">true</str>
|
69
|
+
<str name="facet.mincount">1</str>
|
70
|
+
<str name="facet.limit">10</str>
|
71
|
+
<str name="facet.field">active_fedora_model_ssi</str>
|
72
|
+
<str name="facet.field">object_type_si</str>
|
73
|
+
|
74
|
+
<str name="spellcheck">true</str>
|
75
|
+
<str name="spellcheck.dictionary">default</str>
|
76
|
+
<str name="spellcheck.onlyMorePopular">true</str>
|
77
|
+
<str name="spellcheck.extendedResults">true</str>
|
78
|
+
<str name="spellcheck.collate">false</str>
|
79
|
+
<str name="spellcheck.count">5</str>
|
80
|
+
|
81
|
+
</lst>
|
82
|
+
<arr name="last-components">
|
83
|
+
<str>spellcheck</str>
|
84
|
+
</arr>
|
85
|
+
</requestHandler>
|
86
|
+
|
87
|
+
<requestHandler name="permissions" class="solr.SearchHandler" >
|
88
|
+
<lst name="defaults">
|
89
|
+
<str name="facet">off</str>
|
90
|
+
<str name="echoParams">all</str>
|
91
|
+
<str name="rows">1</str>
|
92
|
+
<str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
|
93
|
+
<str name="fl">
|
94
|
+
id,
|
95
|
+
access_ssim,
|
96
|
+
discover_access_group_ssim,discover_access_person_ssim,
|
97
|
+
read_access_group_ssim,read_access_person_ssim,
|
98
|
+
edit_access_group_ssim,edit_access_person_ssim,
|
99
|
+
depositor_ti,
|
100
|
+
embargo_release_date_dtsi
|
101
|
+
inheritable_access_ssim,
|
102
|
+
inheritable_discover_access_group_ssim,inheritable_discover_access_person_ssim,
|
103
|
+
inheritable_read_access_group_ssim,inheritable_read_access_person_ssim,
|
104
|
+
inheritable_edit_access_group_ssim,inheritable_edit_access_person_ssim,
|
105
|
+
inheritable_embargo_release_date_dtsi
|
106
|
+
</str>
|
107
|
+
</lst>
|
108
|
+
</requestHandler>
|
109
|
+
|
110
|
+
<requestHandler name="/update/extract" startup="lazy" class="org.apache.solr.handler.extraction.ExtractingRequestHandler" >
|
111
|
+
<lst name="defaults">
|
112
|
+
<!-- All the main content goes into "text"... if you need to return the extracted text or do highlighting, use a stored field. -->
|
113
|
+
<str name="fmap.content">text</str>
|
114
|
+
<str name="lowernames">true</str>
|
115
|
+
<str name="uprefix">ignored_</str>
|
116
|
+
<!-- capture link hrefs but ignore div attributes -->
|
117
|
+
<str name="captureAttr">true</str>
|
118
|
+
<str name="fmap.a">links</str>
|
119
|
+
<str name="fmap.div">ignored_</str>
|
120
|
+
</lst>
|
121
|
+
</requestHandler>
|
122
|
+
|
123
|
+
<requestHandler name="standard" class="solr.SearchHandler">
|
124
|
+
<lst name="defaults">
|
125
|
+
<str name="echoParams">explicit</str>
|
126
|
+
<str name="defType">lucene</str>
|
127
|
+
</lst>
|
128
|
+
</requestHandler>
|
129
|
+
|
130
|
+
<!-- for requests to get a single document; use id=666 instead of q=id:666 -->
|
131
|
+
<requestHandler name="document" class="solr.SearchHandler" >
|
132
|
+
<lst name="defaults">
|
133
|
+
<str name="echoParams">all</str>
|
134
|
+
<str name="fl">*</str>
|
135
|
+
<str name="rows">1</str>
|
136
|
+
<str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
|
137
|
+
</lst>
|
138
|
+
</requestHandler>
|
139
|
+
|
140
|
+
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
|
141
|
+
<str name="queryAnalyzerFieldType">textSpell</str>
|
142
|
+
<!-- Multiple "Spell Checkers" can be declared and used by this component
|
143
|
+
(e.g. for title_spell field)
|
144
|
+
-->
|
145
|
+
<lst name="spellchecker">
|
146
|
+
<str name="name">default</str>
|
147
|
+
<str name="field">spell</str>
|
148
|
+
<str name="spellcheckIndexDir">./spell</str>
|
149
|
+
<str name="buildOnOptimize">true</str>
|
150
|
+
</lst>
|
151
|
+
</searchComponent>
|
152
|
+
|
153
|
+
<requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
|
154
|
+
|
155
|
+
<requestDispatcher handleSelect="true" >
|
156
|
+
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048" />
|
157
|
+
</requestDispatcher>
|
158
|
+
|
159
|
+
<requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
|
160
|
+
<requestHandler name="/update" class="solr.UpdateRequestHandler" />
|
161
|
+
<requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
|
162
|
+
|
163
|
+
<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
|
164
|
+
<lst name="invariants">
|
165
|
+
<str name="q">solrpingquery</str>
|
166
|
+
</lst>
|
167
|
+
<lst name="defaults">
|
168
|
+
<str name="echoParams">all</str>
|
169
|
+
</lst>
|
170
|
+
</requestHandler>
|
171
|
+
|
172
|
+
<!-- config for the admin interface -->
|
173
|
+
<admin>
|
174
|
+
<defaultQuery>search</defaultQuery>
|
175
|
+
</admin>
|
176
|
+
|
177
|
+
</config>
|
@@ -11,6 +11,8 @@ Sufia.config do |config|
|
|
11
11
|
|
12
12
|
config.max_days_between_audits = 7
|
13
13
|
|
14
|
+
config.max_notifications_for_dashboard = 5
|
15
|
+
|
14
16
|
config.cc_licenses = {
|
15
17
|
'Attribution 3.0 United States' => 'http://creativecommons.org/licenses/by/3.0/us/',
|
16
18
|
'Attribution-ShareAlike 3.0 United States' => 'http://creativecommons.org/licenses/by-sa/3.0/us/',
|
@@ -108,7 +110,7 @@ Sufia.config do |config|
|
|
108
110
|
if defined? BrowseEverything
|
109
111
|
config.browse_everything = BrowseEverything.config
|
110
112
|
else
|
111
|
-
logger.warn "BrowseEverything is not installed"
|
113
|
+
Rails.logger.warn "BrowseEverything is not installed"
|
112
114
|
end
|
113
115
|
rescue Errno::ENOENT
|
114
116
|
config.browse_everything = nil
|
@@ -13,6 +13,7 @@ This generator for upgrading sufia-models from 3.7.2 to 4.0 makes the following
|
|
13
13
|
1. Creates several database migrations if they do not exist in /db/migrate
|
14
14
|
2. Runs the mailboxer upgrade generator
|
15
15
|
3. Adds analytics to the sufia.rb configuration file
|
16
|
+
4. Runs full-text generator
|
16
17
|
"""
|
17
18
|
|
18
19
|
# Implement the required interface for Rails::Generators::Migration.
|
@@ -49,6 +50,7 @@ This generator for upgrading sufia-models from 3.7.2 to 4.0 makes the following
|
|
49
50
|
# Upgrade mailboxer
|
50
51
|
def install_mailboxer
|
51
52
|
generate "mailboxer:namespacing_compatibility"
|
53
|
+
generate "mailboxer:install -s"
|
52
54
|
end
|
53
55
|
|
54
56
|
# Add config file for Google Analytics
|
@@ -66,6 +68,11 @@ This generator for upgrading sufia-models from 3.7.2 to 4.0 makes the following
|
|
66
68
|
end
|
67
69
|
end
|
68
70
|
|
71
|
+
# Sets up full-text indexing (Solr config + jars)
|
72
|
+
def full_text_indexing
|
73
|
+
generate "sufia:models:fulltext"
|
74
|
+
end
|
75
|
+
|
69
76
|
private
|
70
77
|
|
71
78
|
def better_migration_template(file)
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module Sufia
|
2
|
+
module Messages
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
# Borrowed from AbstractController so we can render html content tags
|
6
|
+
attr_accessor :output_buffer
|
7
|
+
include ActionView::Helpers::TagHelper
|
8
|
+
include ActionView::Helpers::UrlHelper
|
9
|
+
|
10
|
+
def success_subject
|
11
|
+
I18n.t("sufia.messages.success.subject")
|
12
|
+
end
|
13
|
+
|
14
|
+
def failure_subject
|
15
|
+
I18n.t("sufia.messages.failure.subject")
|
16
|
+
end
|
17
|
+
|
18
|
+
def single_success id, file
|
19
|
+
content_tag :span, id: "ss-"+id do
|
20
|
+
[link_to_file(file), I18n.t("sufia.messages.success.single")].join(" ").html_safe
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def multiple_success id, files
|
25
|
+
content_tag :span, id: "ss-"+id do
|
26
|
+
[success_link(files), I18n.t("sufia.messages.success.multiple.tag")].join(" ").html_safe
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def single_failure id, file
|
31
|
+
content_tag :span, id: "ss-"+id do
|
32
|
+
[link_to_file(file), I18n.t("sufia.messages.failure.single")].join(" ").html_safe
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def multiple_failure id, files
|
37
|
+
content_tag :span, id: "ss-"+id do
|
38
|
+
[failure_link(files), I18n.t("sufia.messages.failure.multiple.tag")].join(" ").html_safe
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Double-quotes are replaced with single ones so this list can be included in a data block. Ex:
|
43
|
+
# <a href="#" data-content="<a href='#'>embedded link</a>" rel="popover">Click me</a>
|
44
|
+
def file_list files
|
45
|
+
files.map { |gf| link_to_file(gf) }.join(', ').gsub(/"/, "'")
|
46
|
+
end
|
47
|
+
|
48
|
+
def link_to_file file
|
49
|
+
link_to(file.to_s, Sufia::Engine.routes.url_helpers.generic_file_path(file.noid))
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def success_link files
|
55
|
+
link_to I18n.t("sufia.messages.success.multiple.link"), "#",
|
56
|
+
rel: "popover",
|
57
|
+
data: { content: file_list(files).html_safe, title: I18n.t("sufia.messages.success.title") }
|
58
|
+
end
|
59
|
+
|
60
|
+
def failure_link files
|
61
|
+
link_to I18n.t("sufia.messages.failure.multiple.link"), "#",
|
62
|
+
rel: "popover",
|
63
|
+
data: { content: file_list(files).html_safe, title: I18n.t("sufia.messages.failure.title") }
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|