sufia 6.0.0 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -5
- data/CONTRIBUTING.md +4 -4
- data/Gemfile +2 -1
- data/History.md +69 -0
- data/README.md +84 -4
- data/SUFIA_VERSION +1 -1
- data/app/assets/images/zotero.png +0 -0
- data/app/assets/javascripts/sufia/featured_works.js +20 -3
- data/app/assets/stylesheets/generic_files.css.erb +2 -2
- data/app/assets/stylesheets/sufia.css.scss +2 -2
- data/app/assets/stylesheets/sufia/_buttons.scss +2 -2
- data/app/assets/stylesheets/sufia/_collections.scss +4 -4
- data/app/assets/stylesheets/sufia/_dashboard.scss +1 -1
- data/app/assets/stylesheets/sufia/_file-listing.scss +3 -0
- data/app/assets/stylesheets/sufia/_modal.scss +4 -0
- data/app/assets/stylesheets/sufia/_settings.scss +4 -3
- data/app/assets/stylesheets/sufia/_styles.scss +4 -0
- data/app/controllers/admin/stats_controller.rb +68 -0
- data/app/controllers/api/items_controller.rb +78 -0
- data/app/controllers/api/zotero_controller.rb +70 -0
- data/app/controllers/authorities_controller.rb +6 -5
- data/app/controllers/concerns/sufia/batch_edits_controller_behavior.rb +2 -1
- data/app/controllers/concerns/sufia/breadcrumbs.rb +1 -1
- data/app/controllers/concerns/sufia/depositors_controller_behavior.rb +11 -0
- data/app/controllers/concerns/sufia/files_controller/browse_everything.rb +1 -1
- data/app/controllers/concerns/sufia/files_controller/local_ingest_behavior.rb +1 -1
- data/app/controllers/concerns/sufia/files_controller_behavior.rb +23 -11
- data/app/controllers/concerns/sufia/my_controller_behavior.rb +1 -7
- data/app/controllers/concerns/sufia/users_controller_behavior.rb +1 -2
- data/app/controllers/my/collections_controller.rb +1 -0
- data/app/controllers/my/files_controller.rb +1 -1
- data/app/helpers/sufia/sufia_helper_behavior.rb +28 -16
- data/app/models/my_search_builder.rb +4 -0
- data/app/search_builders/sufia/my_search_builder_behavior.rb +20 -0
- data/app/search_builders/sufia/search_builder.rb +1 -1
- data/app/views/admin/stats/index.html.erb +68 -0
- data/app/views/collections/_action_menu.html.erb +22 -20
- data/app/views/collections/_collection.html.erb +1 -1
- data/app/views/collections/_form_for_select_collection.html.erb +5 -3
- data/app/views/generic_files/_show_actions.html.erb +4 -2
- data/app/views/generic_files/show.html.erb +1 -1
- data/app/views/layouts/sufia-dashboard.html.erb +5 -4
- data/app/views/layouts/sufia-one-column.html.erb +2 -0
- data/app/views/layouts/sufia-two-column.html.erb +6 -4
- data/app/views/my/_facet_layout.html.erb +2 -2
- data/app/views/my/_facets.html.erb +4 -6
- data/app/views/my/index.html.erb +4 -3
- data/app/views/users/_edit_primary.html.erb +18 -17
- data/app/views/users/_follower_modal.html.erb +5 -1
- data/app/views/users/_following_modal.html.erb +5 -1
- data/app/views/users/_user_info.html.erb +6 -1
- data/app/views/users/_zotero.html.erb +12 -0
- data/config/locales/sufia.en.yml +10 -1
- data/config/routes.rb +23 -1
- data/lib/generators/sufia/admin_stat_generator.rb +17 -0
- data/lib/generators/sufia/install_generator.rb +8 -3
- data/{sufia-models/lib/generators/sufia/models/templates/config/resque_admin.rb → lib/generators/sufia/templates/sufia/stats_admin.rb} +3 -3
- data/lib/generators/sufia/upgrade400_generator.rb +2 -2
- data/lib/sufia.rb +3 -0
- data/lib/sufia/arkivo.rb +11 -0
- data/lib/sufia/arkivo/actor.rb +95 -0
- data/lib/sufia/arkivo/config.rb +11 -0
- data/lib/sufia/arkivo/create_subscription_job.rb +67 -0
- data/lib/sufia/arkivo/metadata_munger.rb +51 -0
- data/lib/sufia/arkivo/schema_validator.rb +55 -0
- data/lib/sufia/form_builder.rb +1 -1
- data/lib/sufia/inflections.rb +3 -0
- data/lib/sufia/version.rb +1 -1
- data/lib/sufia/zotero.rb +6 -0
- data/lib/sufia/zotero/config.rb +15 -0
- data/solr_conf/conf/solrconfig.xml +11 -0
- data/spec/controllers/admin_stats_controller_spec.rb +73 -0
- data/spec/controllers/api/items_controller_spec.rb +476 -0
- data/spec/controllers/api/zotero_controller_spec.rb +178 -0
- data/spec/controllers/batch_edits_controller_spec.rb +7 -0
- data/spec/controllers/collections_controller_spec.rb +1 -1
- data/spec/controllers/dashboard_controller_spec.rb +1 -1
- data/spec/controllers/depositors_controller_spec.rb +9 -5
- data/spec/controllers/generic_files_controller_spec.rb +5 -4
- data/spec/controllers/mailbox_controller_spec.rb +2 -2
- data/spec/controllers/my/collections_controller_spec.rb +1 -2
- data/spec/controllers/my/files_controller_spec.rb +5 -5
- data/spec/controllers/my/shares_controller_spec.rb +15 -3
- data/spec/controllers/pages_controller_spec.rb +1 -1
- data/spec/controllers/users_controller_spec.rb +10 -9
- data/spec/factories/api_items.rb +91 -0
- data/spec/factories/generic_files.rb +4 -0
- data/spec/factories/users.rb +4 -4
- data/spec/features/featured_item_spec.rb +26 -0
- data/spec/features/ingest_upload_files_spec.rb +2 -3
- data/spec/features/proxy_spec.rb +0 -1
- data/spec/helpers/permissions_helper_spec.rb +2 -2
- data/spec/helpers/sufia_helper_spec.rb +11 -5
- data/spec/inputs/select_with_help_input_spec.rb +2 -2
- data/spec/javascripts/helpers/.gitkeep +0 -0
- data/spec/javascripts/helpers/jasmine-jquery.js +832 -0
- data/spec/javascripts/jasmine_spec.rb +31 -0
- data/spec/javascripts/notify_update_link_spec.js +8 -0
- data/spec/javascripts/single_use_link_spec.js.coffee +23 -0
- data/spec/javascripts/support/jasmine.yml +124 -0
- data/spec/javascripts/support/jasmine_helper.rb +15 -0
- data/spec/javascripts/terms_of_service_spec.js.coffee +32 -0
- data/spec/javascripts/toggle_icon_spec.js +11 -0
- data/spec/jobs/active_fedora_id_based_job_spec.rb +3 -3
- data/spec/jobs/import_url_job_spec.rb +0 -2
- data/spec/lib/sufia/arkivo/actor_spec.rb +139 -0
- data/spec/lib/sufia/arkivo/create_subscription_job_spec.rb +54 -0
- data/spec/lib/sufia/arkivo/metadata_munger_spec.rb +48 -0
- data/spec/lib/sufia/arkivo/schema_validator_spec.rb +65 -0
- data/spec/lib/sufia/upload_complete_behavior_spec.rb +1 -1
- data/spec/lib/sufia/user_stat_importer_spec.rb +60 -0
- data/spec/lib/sufia/zotero/config_spec.rb +30 -0
- data/spec/models/collection_spec.rb +36 -7
- data/spec/models/file_download_stat_spec.rb +5 -5
- data/spec/models/file_usage_spec.rb +23 -0
- data/spec/models/file_view_stat_spec.rb +6 -6
- data/spec/models/fits_datastream_spec.rb +0 -5
- data/spec/models/generic_file_spec.rb +49 -14
- data/spec/models/local_authority_spec.rb +1 -1
- data/spec/models/proxy_deposit_request_spec.rb +1 -1
- data/spec/models/trophy_spec.rb +8 -8
- data/spec/models/user_spec.rb +33 -0
- data/spec/presenters/sufia/collection_presenter_spec.rb +1 -1
- data/spec/routing/api_route_spec.rb +91 -0
- data/spec/routing/route_spec.rb +1 -1
- data/spec/services/generic_file_audit_service_spec.rb +44 -8
- data/spec/spec_helper.rb +18 -3
- data/spec/support/features.rb +0 -2
- data/spec/support/locations.rb +0 -21
- data/spec/support/rake.rb +41 -0
- data/spec/support/selectors.rb +0 -50
- data/spec/tasks/rake_spec.rb +33 -12
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +12 -0
- data/spec/views/admin/stats/index.html.erb_spec.rb +45 -0
- data/spec/views/catalog/sort_and_per_page.html.erb_spec.rb +0 -1
- data/spec/views/dashboard/index_spec.rb +1 -1
- data/spec/views/generic_file/edit.html.erb_spec.rb +1 -1
- data/spec/views/generic_file/show.html.erb_spec.rb +1 -3
- data/spec/views/users/_follower_modal.html.erb_spec.rb +44 -7
- data/spec/views/users/_following_modal.html.erb_spec.rb +49 -7
- data/spec/views/users/edit.html.erb_spec.rb +72 -0
- data/spec/views/users/show.html.erb_spec.rb +1 -1
- data/sufia.gemspec +6 -2
- data/tasks/sufia-user.rake +14 -0
- metadata +130 -156
- data/spec/lib/sufia/id_service_spec.rb +0 -32
- data/spec/services/noid_spec.rb +0 -9
- data/spec/support/poltergeist.rb +0 -11
- data/spec/support/rake_output.rb +0 -20
- data/sufia-models/.gitignore +0 -17
- data/sufia-models/Gemfile +0 -4
- data/sufia-models/LICENSE.md +0 -177
- data/sufia-models/README.md +0 -39
- data/sufia-models/Rakefile +0 -1
- data/sufia-models/app/actors/sufia/generic_file/actor.rb +0 -137
- data/sufia-models/app/jobs/active_fedora_id_based_job.rb +0 -22
- data/sufia-models/app/jobs/active_fedora_pid_based_job.rb +0 -7
- data/sufia-models/app/jobs/audit_job.rb +0 -62
- data/sufia-models/app/jobs/batch_update_job.rb +0 -72
- data/sufia-models/app/jobs/characterize_job.rb +0 -10
- data/sufia-models/app/jobs/create_derivatives_job.rb +0 -14
- data/sufia-models/app/jobs/import_url_job.rb +0 -52
- data/sufia-models/app/jobs/ingest_local_file_job.rb +0 -46
- data/sufia-models/app/jobs/resolrize_job.rb +0 -9
- data/sufia-models/app/models/batch.rb +0 -36
- data/sufia-models/app/models/checksum_audit_log.rb +0 -21
- data/sufia-models/app/models/concerns/sufia/ability.rb +0 -61
- data/sufia-models/app/models/concerns/sufia/collection_behavior.rb +0 -24
- data/sufia-models/app/models/concerns/sufia/file_stat_utils.rb +0 -35
- data/sufia-models/app/models/concerns/sufia/generic_file.rb +0 -25
- data/sufia-models/app/models/concerns/sufia/generic_file/batches.rb +0 -28
- data/sufia-models/app/models/concerns/sufia/generic_file/characterization.rb +0 -89
- data/sufia-models/app/models/concerns/sufia/generic_file/content.rb +0 -13
- data/sufia-models/app/models/concerns/sufia/generic_file/derivatives.rb +0 -26
- data/sufia-models/app/models/concerns/sufia/generic_file/export.rb +0 -343
- data/sufia-models/app/models/concerns/sufia/generic_file/featured.rb +0 -11
- data/sufia-models/app/models/concerns/sufia/generic_file/full_text_indexing.rb +0 -43
- data/sufia-models/app/models/concerns/sufia/generic_file/indexing.rb +0 -14
- data/sufia-models/app/models/concerns/sufia/generic_file/metadata.rb +0 -98
- data/sufia-models/app/models/concerns/sufia/generic_file/mime_types.rb +0 -69
- data/sufia-models/app/models/concerns/sufia/generic_file/permissions.rb +0 -11
- data/sufia-models/app/models/concerns/sufia/generic_file/proxy_deposit.rb +0 -31
- data/sufia-models/app/models/concerns/sufia/generic_file/trophies.rb +0 -14
- data/sufia-models/app/models/concerns/sufia/generic_file/versions.rb +0 -16
- data/sufia-models/app/models/concerns/sufia/generic_file/virus_check.rb +0 -37
- data/sufia-models/app/models/concerns/sufia/model_methods.rb +0 -20
- data/sufia-models/app/models/concerns/sufia/user.rb +0 -137
- data/sufia-models/app/models/concerns/sufia/user_usage_stats.rb +0 -15
- data/sufia-models/app/models/datastreams/file_content_datastream.rb +0 -4
- data/sufia-models/app/models/datastreams/fits_datastream.rb +0 -152
- data/sufia-models/app/models/domain_term.rb +0 -5
- data/sufia-models/app/models/featured_work.rb +0 -22
- data/sufia-models/app/models/file_download_stat.rb +0 -18
- data/sufia-models/app/models/file_usage.rb +0 -34
- data/sufia-models/app/models/file_view_stat.rb +0 -18
- data/sufia-models/app/models/follow.rb +0 -12
- data/sufia-models/app/models/generic_file.rb +0 -3
- data/sufia-models/app/models/geo_names_resource.rb +0 -18
- data/sufia-models/app/models/group.rb +0 -8
- data/sufia-models/app/models/local_authority.rb +0 -86
- data/sufia-models/app/models/local_authority_entry.rb +0 -3
- data/sufia-models/app/models/proxy_deposit_request.rb +0 -85
- data/sufia-models/app/models/proxy_deposit_rights.rb +0 -4
- data/sufia-models/app/models/single_use_link.rb +0 -42
- data/sufia-models/app/models/subject_local_authority_entry.rb +0 -2
- data/sufia-models/app/models/sufia/avatar_uploader.rb +0 -20
- data/sufia-models/app/models/sufia/avatar_validator.rb +0 -8
- data/sufia-models/app/models/sufia/collection.rb +0 -5
- data/sufia-models/app/models/sufia/download.rb +0 -9
- data/sufia-models/app/models/sufia/orcid_validator.rb +0 -12
- data/sufia-models/app/models/sufia/pageview.rb +0 -9
- data/sufia-models/app/models/trophy.rb +0 -10
- data/sufia-models/app/models/user_stat.rb +0 -2
- data/sufia-models/app/models/version_committer.rb +0 -2
- data/sufia-models/app/services/sufia/analytics.rb +0 -50
- data/sufia-models/app/services/sufia/generic_file_audit_service.rb +0 -83
- data/sufia-models/app/services/sufia/generic_file_indexing_service.rb +0 -12
- data/sufia-models/app/services/sufia/id_service.rb +0 -45
- data/sufia-models/app/services/sufia/noid.rb +0 -22
- data/sufia-models/app/services/sufia/repository_audit_service.rb +0 -9
- data/sufia-models/config/locales/sufia.en.yml +0 -6
- data/sufia-models/lib/generators/sufia/models/abstract_migration_generator.rb +0 -30
- data/sufia-models/lib/generators/sufia/models/cached_stats_generator.rb +0 -24
- data/sufia-models/lib/generators/sufia/models/fulltext_generator.rb +0 -27
- data/sufia-models/lib/generators/sufia/models/install_generator.rb +0 -106
- data/sufia-models/lib/generators/sufia/models/orcid_field_generator.rb +0 -19
- data/sufia-models/lib/generators/sufia/models/proxies_generator.rb +0 -24
- data/sufia-models/lib/generators/sufia/models/templates/app/models/collection.rb +0 -2
- data/sufia-models/lib/generators/sufia/models/templates/config/analytics.yml +0 -9
- data/sufia-models/lib/generators/sufia/models/templates/config/clamav.rb +0 -1
- data/sufia-models/lib/generators/sufia/models/templates/config/mailboxer.rb +0 -17
- data/sufia-models/lib/generators/sufia/models/templates/config/mime_types.rb +0 -6
- data/sufia-models/lib/generators/sufia/models/templates/config/redis.yml +0 -9
- data/sufia-models/lib/generators/sufia/models/templates/config/redis_config.rb +0 -32
- data/sufia-models/lib/generators/sufia/models/templates/config/resque-pool.yml +0 -1
- data/sufia-models/lib/generators/sufia/models/templates/config/resque_config.rb +0 -5
- data/sufia-models/lib/generators/sufia/models/templates/config/setup_mail.rb +0 -3
- data/sufia-models/lib/generators/sufia/models/templates/config/solrconfig.xml +0 -223
- data/sufia-models/lib/generators/sufia/models/templates/config/sufia.rb +0 -144
- data/sufia-models/lib/generators/sufia/models/templates/migrations/acts_as_follower_migration.rb +0 -17
- data/sufia-models/lib/generators/sufia/models/templates/migrations/add_avatars_to_users.rb +0 -15
- data/sufia-models/lib/generators/sufia/models/templates/migrations/add_external_key_to_content_blocks.rb +0 -6
- data/sufia-models/lib/generators/sufia/models/templates/migrations/add_groups_to_users.rb +0 -11
- data/sufia-models/lib/generators/sufia/models/templates/migrations/add_ldap_attrs_to_user.rb +0 -27
- data/sufia-models/lib/generators/sufia/models/templates/migrations/add_linkedin_to_users.rb +0 -5
- data/sufia-models/lib/generators/sufia/models/templates/migrations/add_orcid_to_users.rb +0 -5
- data/sufia-models/lib/generators/sufia/models/templates/migrations/add_social_to_users.rb +0 -13
- data/sufia-models/lib/generators/sufia/models/templates/migrations/change_audit_log_pid_to_generic_file_id.rb +0 -5
- data/sufia-models/lib/generators/sufia/models/templates/migrations/change_proxy_deposit_request_pid_to_generic_file_id.rb +0 -5
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_checksum_audit_logs.rb +0 -19
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_content_blocks.rb +0 -10
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_featured_works.rb +0 -12
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_file_download_stats.rb +0 -12
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_file_view_stats.rb +0 -12
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_local_authorities.rb +0 -50
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_proxy_deposit_requests.rb +0 -16
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_proxy_deposit_rights.rb +0 -11
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_single_use_links.rb +0 -12
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_tinymce_assets.rb +0 -8
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_trophies.rb +0 -10
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_user_stats.rb +0 -19
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_version_committers.rb +0 -15
- data/sufia-models/lib/generators/sufia/models/update_content_blocks_generator.rb +0 -18
- data/sufia-models/lib/generators/sufia/models/upgrade400_generator.rb +0 -54
- data/sufia-models/lib/generators/sufia/models/upgrade600_generator.rb +0 -21
- data/sufia-models/lib/generators/sufia/models/usagestats_generator.rb +0 -19
- data/sufia-models/lib/generators/sufia/models/user_stats_generator.rb +0 -31
- data/sufia-models/lib/sufia/messages.rb +0 -66
- data/sufia-models/lib/sufia/models.rb +0 -34
- data/sufia-models/lib/sufia/models/active_fedora/redis.rb +0 -43
- data/sufia-models/lib/sufia/models/active_record/redis.rb +0 -56
- data/sufia-models/lib/sufia/models/engine.rb +0 -79
- data/sufia-models/lib/sufia/models/file_content.rb +0 -6
- data/sufia-models/lib/sufia/models/file_content/versions.rb +0 -21
- data/sufia-models/lib/sufia/models/resque.rb +0 -36
- data/sufia-models/lib/sufia/models/stats/user_stat_importer.rb +0 -108
- data/sufia-models/lib/sufia/models/user_local_directory_behavior.rb +0 -29
- data/sufia-models/lib/sufia/models/utils.rb +0 -22
- data/sufia-models/lib/sufia/models/version.rb +0 -5
- data/sufia-models/lib/sufia/models/virus_found_error.rb +0 -4
- data/sufia-models/lib/sufia/permissions.rb +0 -9
- data/sufia-models/lib/sufia/permissions/readable.rb +0 -20
- data/sufia-models/lib/sufia/permissions/writable.rb +0 -74
- data/sufia-models/lib/tasks/batch_cleanup.rake +0 -19
- data/sufia-models/lib/tasks/migrate.rake +0 -21
- data/sufia-models/lib/tasks/resque.rake +0 -13
- data/sufia-models/lib/tasks/stats_tasks.rake +0 -12
- data/sufia-models/lib/tasks/sufia-models_tasks.rake +0 -80
- data/sufia-models/sufia-models.gemspec +0 -52
@@ -1,106 +0,0 @@
|
|
1
|
-
require_relative 'abstract_migration_generator'
|
2
|
-
|
3
|
-
class Sufia::Models::InstallGenerator < Sufia::Models::AbstractMigrationGenerator
|
4
|
-
source_root File.expand_path('../templates', __FILE__)
|
5
|
-
argument :model_name, type: :string , default: "user"
|
6
|
-
desc """
|
7
|
-
This generator makes the following changes to your application:
|
8
|
-
1. Creates several database migrations if they do not exist in /db/migrate
|
9
|
-
2. Adds user behavior to the user model
|
10
|
-
3. Creates the sufia.rb configuration file
|
11
|
-
4. Generates mailboxer
|
12
|
-
5. Generates usage stats config
|
13
|
-
6. Runs full-text generator
|
14
|
-
7. Runs proxies generator
|
15
|
-
8. Runs cached stats generator
|
16
|
-
9. Runs ORCID field generator
|
17
|
-
10. Runs user stats generator
|
18
|
-
"""
|
19
|
-
def banner
|
20
|
-
say_status("warning", "GENERATING SUFIA MODELS", :yellow)
|
21
|
-
end
|
22
|
-
|
23
|
-
# Setup the database migrations
|
24
|
-
def copy_migrations
|
25
|
-
[
|
26
|
-
"acts_as_follower_migration.rb",
|
27
|
-
"add_social_to_users.rb",
|
28
|
-
"create_single_use_links.rb",
|
29
|
-
"add_ldap_attrs_to_user.rb",
|
30
|
-
"add_avatars_to_users.rb",
|
31
|
-
"create_checksum_audit_logs.rb",
|
32
|
-
"create_version_committers.rb",
|
33
|
-
"add_groups_to_users.rb",
|
34
|
-
"create_local_authorities.rb",
|
35
|
-
"create_trophies.rb",
|
36
|
-
'add_linkedin_to_users.rb',
|
37
|
-
'create_tinymce_assets.rb',
|
38
|
-
'create_content_blocks.rb',
|
39
|
-
'create_featured_works.rb',
|
40
|
-
'add_external_key_to_content_blocks.rb'
|
41
|
-
].each do |file|
|
42
|
-
better_migration_template file
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
# Add behaviors to the user model
|
47
|
-
def inject_sufia_user_behavior
|
48
|
-
file_path = "app/models/#{model_name.underscore}.rb"
|
49
|
-
if File.exists?(file_path)
|
50
|
-
inject_into_file file_path, after: /include Hydra\:\:User.*$/ do
|
51
|
-
"# Connects this user object to Sufia behaviors. " +
|
52
|
-
"\n include Sufia::User\n"
|
53
|
-
end
|
54
|
-
else
|
55
|
-
puts " \e[31mFailure\e[0m Sufia requires a user object. This generators assumes that the model is defined in the file #{file_path}, which does not exist. If you used a different name, please re-run the generator and provide that name as an argument. Such as \b rails -g sufia client"
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
def create_configuration_files
|
60
|
-
append_file 'config/initializers/mime_types.rb',
|
61
|
-
"\nMime::Type.register 'application/x-endnote-refer', :endnote", {verbose: false }
|
62
|
-
copy_file 'config/sufia.rb', 'config/initializers/sufia.rb'
|
63
|
-
copy_file 'config/redis.yml', 'config/redis.yml'
|
64
|
-
copy_file 'config/resque-pool.yml', 'config/resque-pool.yml'
|
65
|
-
copy_file 'config/redis_config.rb', 'config/initializers/redis_config.rb'
|
66
|
-
copy_file 'config/resque_admin.rb', 'config/initializers/resque_admin.rb'
|
67
|
-
copy_file 'config/resque_config.rb', 'config/initializers/resque_config.rb'
|
68
|
-
end
|
69
|
-
|
70
|
-
def create_collection
|
71
|
-
copy_file 'app/models/collection.rb', 'app/models/collection.rb'
|
72
|
-
end
|
73
|
-
|
74
|
-
def install_mailboxer
|
75
|
-
generate "mailboxer:install"
|
76
|
-
end
|
77
|
-
|
78
|
-
def configure_usage_stats
|
79
|
-
generate 'sufia:models:usagestats'
|
80
|
-
end
|
81
|
-
|
82
|
-
# Sets up full-text indexing (Solr config + jars)
|
83
|
-
def full_text_indexing
|
84
|
-
generate "sufia:models:fulltext"
|
85
|
-
end
|
86
|
-
|
87
|
-
# Sets up proxies and transfers
|
88
|
-
def proxies
|
89
|
-
generate "sufia:models:proxies"
|
90
|
-
end
|
91
|
-
|
92
|
-
# Sets up cached usage stats
|
93
|
-
def cached_stats
|
94
|
-
generate 'sufia:models:cached_stats'
|
95
|
-
end
|
96
|
-
|
97
|
-
# Adds orcid field to user model
|
98
|
-
def orcid_field
|
99
|
-
generate 'sufia:models:orcid_field'
|
100
|
-
end
|
101
|
-
|
102
|
-
# Adds user stats-related migration & methods
|
103
|
-
def user_stats
|
104
|
-
generate 'sufia:models:user_stats'
|
105
|
-
end
|
106
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require_relative 'abstract_migration_generator'
|
2
|
-
|
3
|
-
class Sufia::Models::OrcidFieldGenerator < Sufia::Models::AbstractMigrationGenerator
|
4
|
-
source_root File.expand_path('../templates', __FILE__)
|
5
|
-
|
6
|
-
desc """
|
7
|
-
This generator adds a field to hold users' ORCIDs to your application:
|
8
|
-
1. Creates a database migration if they do not exist in /db/migrate
|
9
|
-
"""
|
10
|
-
|
11
|
-
def banner
|
12
|
-
say_status("warning", "ADDING ORCID FIELD TO USER MODEL", :yellow)
|
13
|
-
end
|
14
|
-
|
15
|
-
# Setup the database migration
|
16
|
-
def copy_migrations
|
17
|
-
better_migration_template 'add_orcid_to_users.rb'
|
18
|
-
end
|
19
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require_relative 'abstract_migration_generator'
|
2
|
-
|
3
|
-
class Sufia::Models::ProxiesGenerator < Sufia::Models::AbstractMigrationGenerator
|
4
|
-
source_root File.expand_path('../templates', __FILE__)
|
5
|
-
|
6
|
-
desc """
|
7
|
-
This generator adds proxies and transfers to your application:
|
8
|
-
1. Creates several database migrations if they do not exist in /db/migrate
|
9
|
-
"""
|
10
|
-
|
11
|
-
def banner
|
12
|
-
say_status("warning", "ADDING PROXY/TRANSFER-RELATED SUFIA MODELS", :yellow)
|
13
|
-
end
|
14
|
-
|
15
|
-
# Setup the database migrations
|
16
|
-
def copy_migrations
|
17
|
-
[
|
18
|
-
'create_proxy_deposit_rights.rb',
|
19
|
-
'create_proxy_deposit_requests.rb'
|
20
|
-
].each do |file|
|
21
|
-
better_migration_template file
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# To integrate your app with Google Analytics, uncomment the lines below and add your API key information.
|
3
|
-
#
|
4
|
-
# analytics:
|
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
|
@@ -1 +0,0 @@
|
|
1
|
-
ClamAV.instance.loaddb() if defined? ClamAV
|
@@ -1,17 +0,0 @@
|
|
1
|
-
Mailboxer.setup do |config|
|
2
|
-
|
3
|
-
#Configures if you applications uses or no the email sending for Notifications and Messages
|
4
|
-
config.uses_emails = true
|
5
|
-
|
6
|
-
#Configures the default from for the email sent for Messages and Notifications of Mailboxer
|
7
|
-
config.default_from = "no-reply@mailboxer.com"
|
8
|
-
|
9
|
-
#Configures the methods needed by mailboxer
|
10
|
-
config.email_method = :mailboxer_email
|
11
|
-
config.name_method = :name
|
12
|
-
|
13
|
-
#Configures if you use or not a search engine and wich one are you using
|
14
|
-
#Supported enignes: [:solr,:sphinx]
|
15
|
-
config.search_enabled = false
|
16
|
-
config.search_engine = :solr
|
17
|
-
end
|
@@ -1,6 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Add new mime types for use in respond_to blocks:
|
4
|
-
# Mime::Type.register "text/richtext", :rtf
|
5
|
-
# Mime::Type.register_alias "text/html", :iphone
|
6
|
-
Mime::Type.register 'application/x-endnote-refer', :endnote
|
@@ -1,32 +0,0 @@
|
|
1
|
-
if defined?(PhusionPassenger)
|
2
|
-
PhusionPassenger.on_event(:starting_worker_process) do |forked|
|
3
|
-
# We're in smart spawning mode.
|
4
|
-
if forked
|
5
|
-
# Re-establish redis connection
|
6
|
-
require 'redis'
|
7
|
-
config = YAML::load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
|
8
|
-
|
9
|
-
# The important two lines
|
10
|
-
$redis.client.disconnect if $redis
|
11
|
-
$redis = Redis.new(host: config[:host], port: config[:port], thread_safe: true) rescue nil
|
12
|
-
Resque.redis = $redis
|
13
|
-
Resque.redis.client.reconnect if Resque.redis
|
14
|
-
end
|
15
|
-
end
|
16
|
-
else
|
17
|
-
config = YAML::load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
|
18
|
-
$redis = Redis.new(host: config[:host], port: config[:port], thread_safe: true) rescue nil
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
# Code borrowed from Obie's Redis patterns talk at RailsConf'12
|
23
|
-
Nest.class_eval do
|
24
|
-
def initialize(key, redis=$redis)
|
25
|
-
super(key.to_param)
|
26
|
-
@redis = redis
|
27
|
-
end
|
28
|
-
|
29
|
-
def [](key)
|
30
|
-
self.class.new("#{self}:#{key.to_param}", @redis)
|
31
|
-
end
|
32
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
"*": 1
|
@@ -1,5 +0,0 @@
|
|
1
|
-
config = YAML::load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
|
2
|
-
Resque.redis = Redis.new(host: config[:host], port: config[:port], thread_safe: true)
|
3
|
-
|
4
|
-
Resque.inline = Rails.env.test?
|
5
|
-
Resque.redis.namespace = "#{Sufia.config.redis_namespace}:#{Rails.env}"
|
@@ -1,223 +0,0 @@
|
|
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
|
-
<!-- The default high-performance update handler -->
|
22
|
-
<updateHandler class="solr.DirectUpdateHandler2">
|
23
|
-
|
24
|
-
<!-- Enables a transaction log, used for real-time get, durability, and
|
25
|
-
and solr cloud replica recovery. The log can grow as big as
|
26
|
-
uncommitted changes to the index, so use of a hard autoCommit
|
27
|
-
is recommended (see below).
|
28
|
-
"dir" - the target directory for transaction logs, defaults to the
|
29
|
-
solr data directory. -->
|
30
|
-
<updateLog>
|
31
|
-
<str name="dir">${solr.ulog.dir:}</str>
|
32
|
-
</updateLog>
|
33
|
-
|
34
|
-
<!-- AutoCommit
|
35
|
-
Perform a hard commit automatically under certain conditions.
|
36
|
-
Instead of enabling autoCommit, consider using "commitWithin"
|
37
|
-
when adding documents.
|
38
|
-
http://wiki.apache.org/solr/UpdateXmlMessages
|
39
|
-
maxDocs - Maximum number of documents to add since the last
|
40
|
-
commit before automatically triggering a new commit.
|
41
|
-
maxTime - Maximum amount of time in ms that is allowed to pass
|
42
|
-
since a document was added before automatically
|
43
|
-
triggering a new commit.
|
44
|
-
openSearcher - if false, the commit causes recent index changes
|
45
|
-
to be flushed to stable storage, but does not cause a new
|
46
|
-
searcher to be opened to make those changes visible.
|
47
|
-
If the updateLog is enabled, then it's highly recommended to
|
48
|
-
have some sort of hard autoCommit to limit the log size.
|
49
|
-
-->
|
50
|
-
<autoCommit>
|
51
|
-
<maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
|
52
|
-
<openSearcher>false</openSearcher>
|
53
|
-
</autoCommit>
|
54
|
-
|
55
|
-
<!-- softAutoCommit is like autoCommit except it causes a
|
56
|
-
'soft' commit which only ensures that changes are visible
|
57
|
-
but does not ensure that data is synced to disk. This is
|
58
|
-
faster and more near-realtime friendly than a hard commit.
|
59
|
-
-->
|
60
|
-
|
61
|
-
<autoSoftCommit>
|
62
|
-
<maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
|
63
|
-
</autoSoftCommit>
|
64
|
-
|
65
|
-
</updateHandler>
|
66
|
-
|
67
|
-
<requestHandler name="search" class="solr.SearchHandler" default="true">
|
68
|
-
<!-- default values for query parameters can be specified, these
|
69
|
-
will be overridden by parameters in the request
|
70
|
-
-->
|
71
|
-
<lst name="defaults">
|
72
|
-
<str name="defType">edismax</str>
|
73
|
-
<str name="echoParams">explicit</str>
|
74
|
-
<str name="q.alt">*:*</str>
|
75
|
-
<str name="mm">2<-1 5<-2 6<90%</str>
|
76
|
-
<int name="qs">1</int>
|
77
|
-
<int name="ps">2</int>
|
78
|
-
<float name="tie">0.01</float>
|
79
|
-
<!-- this qf and pf are used by default, if not otherwise specified by
|
80
|
-
client. The default blacklight_config will use these for the
|
81
|
-
"keywords" search. See the author_qf/author_pf, title_qf, etc
|
82
|
-
below, which the default blacklight_config will specify for
|
83
|
-
those searches. You may also be interested in:
|
84
|
-
http://wiki.apache.org/solr/LocalParams
|
85
|
-
-->
|
86
|
-
<str name="qf">
|
87
|
-
id
|
88
|
-
all_text_timv
|
89
|
-
active_fedora_model_ssi
|
90
|
-
object_type_si
|
91
|
-
</str>
|
92
|
-
<str name="pf">
|
93
|
-
all_text_timv^10
|
94
|
-
</str>
|
95
|
-
|
96
|
-
<str name="author_qf">
|
97
|
-
</str>
|
98
|
-
<str name="author_pf">
|
99
|
-
</str>
|
100
|
-
<str name="title_qf">
|
101
|
-
</str>
|
102
|
-
<str name="title_pf">
|
103
|
-
</str>
|
104
|
-
<str name="subject_qf">
|
105
|
-
</str>
|
106
|
-
<str name="subject_pf">
|
107
|
-
</str>
|
108
|
-
|
109
|
-
<str name="fl">
|
110
|
-
*,
|
111
|
-
score
|
112
|
-
</str>
|
113
|
-
|
114
|
-
<str name="facet">true</str>
|
115
|
-
<str name="facet.mincount">1</str>
|
116
|
-
<str name="facet.limit">10</str>
|
117
|
-
<str name="facet.field">active_fedora_model_ssi</str>
|
118
|
-
<str name="facet.field">object_type_si</str>
|
119
|
-
|
120
|
-
<str name="spellcheck">true</str>
|
121
|
-
<str name="spellcheck.dictionary">default</str>
|
122
|
-
<str name="spellcheck.onlyMorePopular">true</str>
|
123
|
-
<str name="spellcheck.extendedResults">true</str>
|
124
|
-
<str name="spellcheck.collate">false</str>
|
125
|
-
<str name="spellcheck.count">5</str>
|
126
|
-
|
127
|
-
</lst>
|
128
|
-
<arr name="last-components">
|
129
|
-
<str>spellcheck</str>
|
130
|
-
</arr>
|
131
|
-
</requestHandler>
|
132
|
-
|
133
|
-
<requestHandler name="permissions" class="solr.SearchHandler" >
|
134
|
-
<lst name="defaults">
|
135
|
-
<str name="facet">off</str>
|
136
|
-
<str name="echoParams">all</str>
|
137
|
-
<str name="rows">1</str>
|
138
|
-
<str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
|
139
|
-
<str name="fl">
|
140
|
-
id,
|
141
|
-
access_ssim,
|
142
|
-
discover_access_group_ssim,discover_access_person_ssim,
|
143
|
-
read_access_group_ssim,read_access_person_ssim,
|
144
|
-
edit_access_group_ssim,edit_access_person_ssim,
|
145
|
-
depositor_ti,
|
146
|
-
embargo_release_date_dtsi
|
147
|
-
inheritable_access_ssim,
|
148
|
-
inheritable_discover_access_group_ssim,inheritable_discover_access_person_ssim,
|
149
|
-
inheritable_read_access_group_ssim,inheritable_read_access_person_ssim,
|
150
|
-
inheritable_edit_access_group_ssim,inheritable_edit_access_person_ssim,
|
151
|
-
inheritable_embargo_release_date_dtsi
|
152
|
-
</str>
|
153
|
-
</lst>
|
154
|
-
</requestHandler>
|
155
|
-
|
156
|
-
<requestHandler name="/update/extract" startup="lazy" class="org.apache.solr.handler.extraction.ExtractingRequestHandler" >
|
157
|
-
<lst name="defaults">
|
158
|
-
<!-- All the main content goes into "text"... if you need to return the extracted text or do highlighting, use a stored field. -->
|
159
|
-
<str name="fmap.content">text</str>
|
160
|
-
<str name="lowernames">true</str>
|
161
|
-
<str name="uprefix">ignored_</str>
|
162
|
-
<!-- capture link hrefs but ignore div attributes -->
|
163
|
-
<str name="captureAttr">true</str>
|
164
|
-
<str name="fmap.a">links</str>
|
165
|
-
<str name="fmap.div">ignored_</str>
|
166
|
-
</lst>
|
167
|
-
</requestHandler>
|
168
|
-
|
169
|
-
<requestHandler name="standard" class="solr.SearchHandler">
|
170
|
-
<lst name="defaults">
|
171
|
-
<str name="echoParams">explicit</str>
|
172
|
-
<str name="defType">lucene</str>
|
173
|
-
</lst>
|
174
|
-
</requestHandler>
|
175
|
-
|
176
|
-
<!-- for requests to get a single document; use id=666 instead of q=id:666 -->
|
177
|
-
<requestHandler name="document" class="solr.SearchHandler" >
|
178
|
-
<lst name="defaults">
|
179
|
-
<str name="echoParams">all</str>
|
180
|
-
<str name="fl">*</str>
|
181
|
-
<str name="rows">1</str>
|
182
|
-
<str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
|
183
|
-
</lst>
|
184
|
-
</requestHandler>
|
185
|
-
|
186
|
-
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
|
187
|
-
<str name="queryAnalyzerFieldType">textSpell</str>
|
188
|
-
<!-- Multiple "Spell Checkers" can be declared and used by this component
|
189
|
-
(e.g. for title_spell field)
|
190
|
-
-->
|
191
|
-
<lst name="spellchecker">
|
192
|
-
<str name="name">default</str>
|
193
|
-
<str name="field">spell</str>
|
194
|
-
<str name="spellcheckIndexDir">./spell</str>
|
195
|
-
<str name="buildOnOptimize">true</str>
|
196
|
-
</lst>
|
197
|
-
</searchComponent>
|
198
|
-
|
199
|
-
<requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
|
200
|
-
|
201
|
-
<requestDispatcher handleSelect="true" >
|
202
|
-
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048" />
|
203
|
-
</requestDispatcher>
|
204
|
-
|
205
|
-
<requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
|
206
|
-
<requestHandler name="/update" class="solr.UpdateRequestHandler" />
|
207
|
-
<requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
|
208
|
-
|
209
|
-
<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
|
210
|
-
<lst name="invariants">
|
211
|
-
<str name="q">solrpingquery</str>
|
212
|
-
</lst>
|
213
|
-
<lst name="defaults">
|
214
|
-
<str name="echoParams">all</str>
|
215
|
-
</lst>
|
216
|
-
</requestHandler>
|
217
|
-
|
218
|
-
<!-- config for the admin interface -->
|
219
|
-
<admin>
|
220
|
-
<defaultQuery>search</defaultQuery>
|
221
|
-
</admin>
|
222
|
-
|
223
|
-
</config>
|