From 175d00adb6510e3aada5665b400373c91ae88fb0 Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Mon, 28 Mar 2016 15:23:16 -0700 Subject: [PATCH] Generate sufia using the installer --- .fcrepo_wrapper | 3 + .solr_wrapper | 5 + Gemfile | 10 + Gemfile.lock | 504 ++++++++++++++++++ Rakefile | 2 + .../curation_concerns/generic_work_actor.rb | 7 + app/assets/javascripts/application.js | 7 +- app/assets/javascripts/blacklight_gallery.js | 1 + app/assets/javascripts/curation_concerns.js | 1 + app/assets/javascripts/openseadragon.js | 2 + app/assets/stylesheets/application.css | 1 + .../stylesheets/blacklight_gallery.css.scss | 3 + app/assets/stylesheets/curation_concerns.scss | 3 + app/assets/stylesheets/openseadragon.css | 3 + app/controllers/application_controller.rb | 13 + app/controllers/catalog_controller.rb | 320 +++++++++++ .../generic_works_controller.rb | 10 + .../curation_concerns/generic_work_form.rb | 10 + app/helpers/curation_concerns_helper.rb | 4 + app/helpers/sufia_helper.rb | 5 + app/models/ability.rb | 23 + app/models/collection.rb | 7 + app/models/file_set.rb | 5 + app/models/generic_work.rb | 8 + app/models/search_builder.rb | 5 + app/models/solr_document.rb | 30 ++ app/models/user.rb | 24 + .../generic_works/_generic_work.html.erb | 2 + config/analytics.yml | 9 + config/application.rb | 6 + config/authorities/resource_types.yml | 41 ++ config/authorities/rights.yml | 19 + config/blacklight.yml | 10 + config/fedora.yml | 15 + config/initializers/clamav.rb | 1 + config/initializers/curation_concerns.rb | 63 +++ config/initializers/devise.rb | 265 +++++++++ config/initializers/hydra_config.rb | 22 + config/initializers/mailboxer.rb | 21 + config/initializers/mime_types.rb | 4 + config/initializers/mini_magick.rb | 5 + config/initializers/redis_config.rb | 29 + config/initializers/resque_config.rb | 6 + config/initializers/stats_admin.rb | 10 + config/initializers/sufia.rb | 140 +++++ config/locales/blacklight.en.yml | 3 + config/locales/devise.en.yml | 62 +++ config/redis.yml | 9 + config/resque-pool.yml | 1 + config/role_map.yml | 19 + config/routes.rb | 89 ++-- config/solr.yml | 7 + config/tinymce.yml | 7 + ...160328222140_create_searches.blacklight.rb | 19 + ...60328222141_create_bookmarks.blacklight.rb | 18 + ...olymorphic_type_to_bookmarks.blacklight.rb | 9 + .../20160328222150_devise_create_users.rb | 42 ++ ...160328222151_add_devise_guests_to_users.rb | 15 + ...0160328222152_create_version_committers.rb | 15 + ...160328222153_create_checksum_audit_logs.rb | 19 + .../20160328222154_create_single_use_links.rb | 12 + ...160328222155_acts_as_follower_migration.rb | 17 + .../20160328222156_add_social_to_users.rb | 13 + .../20160328222157_add_ldap_attrs_to_user.rb | 27 + .../20160328222158_add_avatars_to_users.rb | 15 + .../20160328222159_add_groups_to_users.rb | 11 + ...20160328222160_create_local_authorities.rb | 50 ++ db/migrate/20160328222161_create_trophies.rb | 10 + .../20160328222162_add_linkedin_to_users.rb | 5 + .../20160328222163_create_tinymce_assets.rb | 8 + .../20160328222164_create_content_blocks.rb | 10 + .../20160328222165_create_featured_works.rb | 12 + ...2166_add_external_key_to_content_blocks.rb | 6 + ...22223_create_mailboxer.mailboxer_engine.rb | 66 +++ ...dd_conversation_optout.mailboxer_engine.rb | 15 + ...25_add_missing_indices.mailboxer_engine.rb | 20 + ...60328222226_create_proxy_deposit_rights.rb | 11 + ...328222227_create_proxy_deposit_requests.rb | 16 + .../20160328222228_create_file_view_stats.rb | 12 + ...160328222229_create_file_download_stats.rb | 12 + .../20160328222230_add_orcid_to_users.rb | 5 + .../20160328222231_create_user_stats.rb | 19 + .../20160328222232_create_work_view_stats.rb | 12 + .../20160328222233_add_works_to_user_stats.rb | 13 + ...change_audit_log_pid_to_generic_file_id.rb | 5 + ..._deposit_request_pid_to_generic_file_id.rb | 5 + ...ophy_generic_file_id_to_generic_work_id.rb | 5 + ...osit_generic_file_id_to_generic_work_id.rb | 5 + ...udit_log_generic_file_id_to_file_set_id.rb | 5 + ...uest_generic_file_id_to_generic_work_id.rb | 5 + db/schema.rb | 315 +++++++++++ solr/config/_rest_managed.json | 3 + solr/config/admin-extra.html | 31 ++ solr/config/elevate.xml | 36 ++ solr/config/mapping-ISOLatin1Accent.txt | 246 +++++++++ solr/config/protwords.txt | 21 + solr/config/schema.xml | 372 +++++++++++++ solr/config/scripts.conf | 24 + solr/config/solrconfig.xml | 312 +++++++++++ solr/config/spellings.txt | 2 + solr/config/stopwords.txt | 58 ++ solr/config/stopwords_en.txt | 58 ++ solr/config/synonyms.txt | 31 ++ solr/config/xslt/example.xsl | 132 +++++ solr/config/xslt/example_atom.xsl | 67 +++ solr/config/xslt/example_rss.xsl | 66 +++ solr/config/xslt/luke.xsl | 337 ++++++++++++ .../generic_work_actor_spec.rb | 9 + .../generic_works_controller_spec.rb | 9 + .../generic_work_form_spec.rb | 9 + spec/models/generic_work_spec.rb | 9 + spec/models/user_spec.rb | 5 + 112 files changed, 4541 insertions(+), 56 deletions(-) create mode 100644 .fcrepo_wrapper create mode 100644 .solr_wrapper create mode 100644 app/actors/curation_concerns/generic_work_actor.rb create mode 100644 app/assets/javascripts/blacklight_gallery.js create mode 100644 app/assets/javascripts/curation_concerns.js create mode 100644 app/assets/javascripts/openseadragon.js create mode 100644 app/assets/stylesheets/blacklight_gallery.css.scss create mode 100644 app/assets/stylesheets/curation_concerns.scss create mode 100644 app/assets/stylesheets/openseadragon.css create mode 100644 app/controllers/catalog_controller.rb create mode 100644 app/controllers/curation_concerns/generic_works_controller.rb create mode 100644 app/forms/curation_concerns/generic_work_form.rb create mode 100644 app/helpers/curation_concerns_helper.rb create mode 100644 app/helpers/sufia_helper.rb create mode 100644 app/models/ability.rb create mode 100644 app/models/collection.rb create mode 100644 app/models/file_set.rb create mode 100644 app/models/generic_work.rb create mode 100644 app/models/search_builder.rb create mode 100644 app/models/solr_document.rb create mode 100644 app/models/user.rb create mode 100644 app/views/curation_concerns/generic_works/_generic_work.html.erb create mode 100644 config/analytics.yml create mode 100644 config/authorities/resource_types.yml create mode 100644 config/authorities/rights.yml create mode 100644 config/blacklight.yml create mode 100644 config/fedora.yml create mode 100644 config/initializers/clamav.rb create mode 100644 config/initializers/curation_concerns.rb create mode 100644 config/initializers/devise.rb create mode 100644 config/initializers/hydra_config.rb create mode 100644 config/initializers/mailboxer.rb create mode 100644 config/initializers/mini_magick.rb create mode 100644 config/initializers/redis_config.rb create mode 100644 config/initializers/resque_config.rb create mode 100644 config/initializers/stats_admin.rb create mode 100644 config/initializers/sufia.rb create mode 100644 config/locales/blacklight.en.yml create mode 100644 config/locales/devise.en.yml create mode 100644 config/redis.yml create mode 100644 config/resque-pool.yml create mode 100644 config/role_map.yml create mode 100644 config/solr.yml create mode 100644 config/tinymce.yml create mode 100644 db/migrate/20160328222140_create_searches.blacklight.rb create mode 100644 db/migrate/20160328222141_create_bookmarks.blacklight.rb create mode 100644 db/migrate/20160328222142_add_polymorphic_type_to_bookmarks.blacklight.rb create mode 100644 db/migrate/20160328222150_devise_create_users.rb create mode 100644 db/migrate/20160328222151_add_devise_guests_to_users.rb create mode 100644 db/migrate/20160328222152_create_version_committers.rb create mode 100644 db/migrate/20160328222153_create_checksum_audit_logs.rb create mode 100644 db/migrate/20160328222154_create_single_use_links.rb create mode 100644 db/migrate/20160328222155_acts_as_follower_migration.rb create mode 100644 db/migrate/20160328222156_add_social_to_users.rb create mode 100644 db/migrate/20160328222157_add_ldap_attrs_to_user.rb create mode 100644 db/migrate/20160328222158_add_avatars_to_users.rb create mode 100644 db/migrate/20160328222159_add_groups_to_users.rb create mode 100644 db/migrate/20160328222160_create_local_authorities.rb create mode 100644 db/migrate/20160328222161_create_trophies.rb create mode 100644 db/migrate/20160328222162_add_linkedin_to_users.rb create mode 100644 db/migrate/20160328222163_create_tinymce_assets.rb create mode 100644 db/migrate/20160328222164_create_content_blocks.rb create mode 100644 db/migrate/20160328222165_create_featured_works.rb create mode 100644 db/migrate/20160328222166_add_external_key_to_content_blocks.rb create mode 100644 db/migrate/20160328222223_create_mailboxer.mailboxer_engine.rb create mode 100644 db/migrate/20160328222224_add_conversation_optout.mailboxer_engine.rb create mode 100644 db/migrate/20160328222225_add_missing_indices.mailboxer_engine.rb create mode 100644 db/migrate/20160328222226_create_proxy_deposit_rights.rb create mode 100644 db/migrate/20160328222227_create_proxy_deposit_requests.rb create mode 100644 db/migrate/20160328222228_create_file_view_stats.rb create mode 100644 db/migrate/20160328222229_create_file_download_stats.rb create mode 100644 db/migrate/20160328222230_add_orcid_to_users.rb create mode 100644 db/migrate/20160328222231_create_user_stats.rb create mode 100644 db/migrate/20160328222232_create_work_view_stats.rb create mode 100644 db/migrate/20160328222233_add_works_to_user_stats.rb create mode 100644 db/migrate/20160328222234_change_audit_log_pid_to_generic_file_id.rb create mode 100644 db/migrate/20160328222235_change_proxy_deposit_request_pid_to_generic_file_id.rb create mode 100644 db/migrate/20160328222236_change_trophy_generic_file_id_to_generic_work_id.rb create mode 100644 db/migrate/20160328222237_change_proxy_deposit_generic_file_id_to_generic_work_id.rb create mode 100644 db/migrate/20160328222238_change_audit_log_generic_file_id_to_file_set_id.rb create mode 100644 db/migrate/20160328222239_change_proxy_deposit_request_generic_file_id_to_generic_work_id.rb create mode 100644 db/schema.rb create mode 100644 solr/config/_rest_managed.json create mode 100644 solr/config/admin-extra.html create mode 100644 solr/config/elevate.xml create mode 100644 solr/config/mapping-ISOLatin1Accent.txt create mode 100644 solr/config/protwords.txt create mode 100644 solr/config/schema.xml create mode 100644 solr/config/scripts.conf create mode 100644 solr/config/solrconfig.xml create mode 100644 solr/config/spellings.txt create mode 100644 solr/config/stopwords.txt create mode 100644 solr/config/stopwords_en.txt create mode 100644 solr/config/synonyms.txt create mode 100644 solr/config/xslt/example.xsl create mode 100644 solr/config/xslt/example_atom.xsl create mode 100644 solr/config/xslt/example_rss.xsl create mode 100644 solr/config/xslt/luke.xsl create mode 100644 spec/actors/curation_concerns/generic_work_actor_spec.rb create mode 100644 spec/controllers/curation_concerns/generic_works_controller_spec.rb create mode 100644 spec/forms/curation_concerns/generic_work_form_spec.rb create mode 100644 spec/models/generic_work_spec.rb create mode 100644 spec/models/user_spec.rb diff --git a/.fcrepo_wrapper b/.fcrepo_wrapper new file mode 100644 index 000000000..d2276ce7d --- /dev/null +++ b/.fcrepo_wrapper @@ -0,0 +1,3 @@ +# Place any default configuration for solr_wrapper here +port: 8984 +enable_jms: false diff --git a/.solr_wrapper b/.solr_wrapper new file mode 100644 index 000000000..b2ef59bad --- /dev/null +++ b/.solr_wrapper @@ -0,0 +1,5 @@ +# Place any default configuration for solr_wrapper here +# port: 8983 +collection: + dir: solr/config/ + name: hydra-development diff --git a/Gemfile b/Gemfile index e17c40f5e..99d180f24 100644 --- a/Gemfile +++ b/Gemfile @@ -40,6 +40,9 @@ group :development, :test do gem 'rspec-rails' gem 'coveralls', require: false + + gem 'solr_wrapper', '>= 0.3' + gem 'fcrepo_wrapper' end group :development do @@ -50,3 +53,10 @@ group :development do gem 'spring' end + +gem 'sufia', github: 'projecthydra/sufia' +gem 'rsolr', '~> 1.0.6' + +gem 'devise' +gem 'devise-guests', '~> 0.3' + diff --git a/Gemfile.lock b/Gemfile.lock index 6122899ed..2877f54d5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,35 @@ +GIT + remote: git://github.com/projecthydra/sufia.git + revision: 7635923d9fec0e61f3d0f70f4d4c213f4c6402c3 + specs: + sufia (7.0.0.beta1) + active-fedora (~> 9.10) + activerecord-import (~> 0.5) + activeresource (~> 4.0) + acts_as_follower (>= 0.1.1, < 0.3) + blacklight-gallery (~> 0.1) + browse-everything (~> 0.4) + carrierwave (~> 0.9) + curation_concerns (~> 0.10) + daemons (~> 1.1) + font-awesome-rails (~> 4.2) + google-api-client (~> 0.7, < 0.9) + hydra-batch-edit (~> 1.1) + hydra-works (~> 0.7) + json-schema + kaminari_route_prefix + legato (~> 0.3) + mail_form (~> 1.5) + mailboxer (~> 0.12) + nest (~> 1.1) + oauth + oauth2 (~> 0.9) + posix-spawn + select2-rails (~> 3.5.9) + tinymce-rails (~> 4.1) + tinymce-rails-imageupload (~> 4.0.16.beta) + yaml_db (~> 0.2) + GEM remote: https://rubygems.org/ specs: @@ -20,6 +52,35 @@ GEM erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) + active-fedora (9.10.4) + active-triples (~> 0.7.1) + activemodel (>= 4.2, < 6) + activesupport (>= 4.2.4, < 6) + deprecation + ldp (~> 0.5.0) + linkeddata + nom-xml (>= 0.5.1) + om (~> 3.1) + rdf-rdfxml (~> 1.1) + rsolr (~> 1.0, >= 1.0.10) + solrizer (~> 3.4) + active-triples (0.7.5) + activemodel (>= 3.0.0) + activesupport (>= 3.0.0) + deprecation (~> 0.1) + linkeddata (~> 1.1) + rdf (~> 1.1) + active_attr (0.9.0) + activemodel (>= 3.0.2, < 5.1) + activesupport (>= 3.0.2, < 5.1) + active_fedora-noid (1.0.3) + active-fedora (~> 9.7) + noid (~> 0.7) + activefedora-aggregation (0.10.0) + active-fedora (~> 9.10.1) + activesupport + rdf (~> 1.1, >= 1.1.17.1) + rdf-vocab (~> 0.8.1) activejob (4.2.6) activesupport (= 4.2.6) globalid (>= 0.3.0) @@ -30,17 +91,80 @@ GEM activemodel (= 4.2.6) activesupport (= 4.2.6) arel (~> 6.0) + activerecord-import (0.12.0) + activerecord (>= 3.0) + activeresource (4.0.0) + activemodel (~> 4.0) + activesupport (~> 4.0) + rails-observers (~> 0.1.1) activesupport (4.2.6) i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) + acts_as_follower (0.2.1) + addressable (2.3.8) arel (6.0.3) + autoparse (0.3.3) + addressable (>= 2.3.1) + extlib (>= 0.9.15) + multi_json (>= 1.0.0) + autoprefixer-rails (6.3.5) + execjs + babel-source (5.8.35) + babel-transpiler (0.7.0) + babel-source (>= 4.0, < 6) + execjs (~> 2.0) + bcp47 (0.3.3) + i18n + bcrypt (3.1.11) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) + blacklight (6.0.2) + bootstrap-sass (~> 3.2) + deprecation + globalid + kaminari (>= 0.15) + nokogiri (~> 1.6) + rails (>= 4.2, < 6) + rsolr (~> 1.0.11) + twitter-typeahead-rails (~> 0.11) + blacklight-access_controls (0.3.0) + blacklight (~> 6.0) + cancancan (~> 1.8) + blacklight-gallery (0.5.0) + blacklight (> 6.0.0.pre, < 7) + bootstrap-sass (~> 3.0) + openseadragon (>= 0.2.0) + rails + blacklight_advanced_search (6.0.1) + blacklight (~> 6.0.1) + parslet + blankslate (3.1.3) + bootstrap-sass (3.3.6) + autoprefixer-rails (>= 5.2.1) + sass (>= 3.3.4) + breadcrumbs_on_rails (2.3.1) + browse-everything (0.9.1) + bootstrap-sass + dropbox-sdk (>= 1.6.2) + font-awesome-rails + google-api-client + google_drive + httparty + rails (>= 3.1) + ruby-box + sass-rails + skydrive builder (3.2.2) byebug (8.2.2) + cancancan (1.13.1) + carrierwave (0.10.0) + activemodel (>= 3.2.0) + activesupport (>= 3.2.0) + json (>= 1.7) + mime-types (>= 1.16) coffee-rails (4.1.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.1.x) @@ -55,13 +179,143 @@ GEM term-ansicolor (~> 1.3) thor (~> 0.19.1) tins (~> 1.6.0) + curation_concerns (0.10.0) + blacklight (~> 6.0) + blacklight_advanced_search (~> 6.0) + breadcrumbs_on_rails (~> 2.3) + curation_concerns-models (= 0.10.0) + hydra-editor (~> 1.1) + hydra-head (~> 9.6) + jquery-ui-rails + rails_autolink + simple_form (~> 3.1) + sprockets-es6 + curation_concerns-models (0.10.0) + active_attr + active_fedora-noid (~> 1.0) + hydra-collections (~> 8.1) + hydra-head (~> 9.3) + hydra-works (~> 0.7) + qa (~> 0.5) + redlock (~> 0.1.2) + resque (~> 1.23) + resque-pool (~> 0.3) + daemons (1.2.3) debug_inspector (0.0.2) + deprecation (0.2.2) + activesupport + devise (3.5.6) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 3.2.6, < 5) + responders + thread_safe (~> 0.1) + warden (~> 1.2.3) + devise-guests (0.5.0) + devise diff-lcs (1.2.5) docile (1.1.5) + dropbox-sdk (1.6.5) + json + ebnf (1.0.0) + rdf (~> 1.1) + sxp (~> 0.1, >= 0.1.3) + equivalent-xml (0.6.0) + nokogiri (>= 1.4.3) erubis (2.7.0) execjs (2.6.0) + extlib (0.9.16) + faraday (0.9.2) + multipart-post (>= 1.2, < 3) + fcrepo_wrapper (0.3.4) + ruby-progressbar + font-awesome-rails (4.5.0.1) + railties (>= 3.2, < 5.1) + foreigner (1.7.4) + activerecord (>= 3.0.0) globalid (0.3.6) activesupport (>= 4.1.0) + google-api-client (0.8.6) + activesupport (>= 3.2) + addressable (~> 2.3) + autoparse (~> 0.3) + extlib (~> 0.9) + faraday (~> 0.9) + googleauth (~> 0.3) + launchy (~> 2.4) + multi_json (~> 1.10) + retriable (~> 1.4) + signet (~> 0.6) + google_drive (1.0.6) + google-api-client (>= 0.7.0, < 0.9) + nokogiri (>= 1.4.4, != 1.5.2, != 1.5.1) + oauth (>= 0.3.6) + oauth2 (>= 0.5.0) + googleauth (0.5.1) + faraday (~> 0.9) + jwt (~> 1.4) + logging (~> 2.0) + memoist (~> 0.12) + multi_json (~> 1.11) + os (~> 0.9) + signet (~> 0.7) + haml (4.0.7) + tilt + htmlentities (4.3.4) + httmultiparty (0.3.16) + httparty (>= 0.7.3) + mimemagic + multipart-post + http_logger (0.5.1) + httparty (0.13.7) + json (~> 1.8) + multi_xml (>= 0.5.2) + hydra-access-controls (9.9.0) + active-fedora (~> 9.10.0) + activesupport (~> 4.0) + blacklight (>= 5.16) + blacklight-access_controls (~> 0.1) + cancancan (~> 1.8) + deprecation (~> 0.2) + hydra-batch-edit (1.1.1) + blacklight + hydra-collections + hydra-collections (8.1.1) + active-fedora (~> 9.9) + blacklight (~> 6.0) + deprecation (~> 0.1) + hydra-head (~> 9.1) + hydra-works (~> 0.4) + rdf (~> 1.99) + rdf-vocab (~> 0) + hydra-core (9.9.0) + hydra-access-controls (= 9.9.0) + rails (~> 4.0) + hydra-derivatives (3.0.1) + active-fedora (~> 9.0) + activesupport (~> 4.0) + deprecation + mime-types (> 2.0, < 4.0) + mini_magick (>= 3.2, < 5) + hydra-editor (1.2.0) + active-fedora (>= 9.0.0) + cancancan (~> 1.8) + rails (~> 4.1) + simple_form (~> 3.1.0) + hydra-file_characterization (0.3.3) + activesupport (>= 3.0.0) + hydra-head (9.9.0) + hydra-access-controls (= 9.9.0) + hydra-core (= 9.9.0) + rails (>= 3.2.6) + hydra-pcdm (0.5.0) + active-fedora (~> 9.6) + activefedora-aggregation (~> 0.10) + mime-types (>= 1) + hydra-works (0.8.1) + hydra-derivatives (~> 3.0) + hydra-file_characterization (~> 0.3, >= 0.3.3) + hydra-pcdm (~> 0.5) i18n (0.7.0) jbuilder (2.4.1) activesupport (>= 3.0.0, < 5.1) @@ -70,20 +324,118 @@ GEM rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) + jquery-ui-rails (5.0.5) + railties (>= 3.2.16) json (1.8.3) + json-ld (1.99.2) + multi_json (~> 1.11) + rdf (~> 1.99) + json-schema (2.6.1) + addressable (~> 2.3.8) + jwt (1.5.4) + kaminari (0.16.3) + actionpack (>= 3.0.0) + activesupport (>= 3.0.0) + kaminari_route_prefix (0.0.1) + kaminari (>= 0.16, < 2) + launchy (2.4.3) + addressable (~> 2.3) + ldp (0.5.0) + deprecation + faraday + http_logger + linkeddata (>= 1.1) + rdf-vocab + slop + legato (0.7.0) + multi_json + link_header (0.0.8) + linkeddata (1.99.0) + equivalent-xml (~> 0.6) + json-ld (~> 1.99) + nokogiri (~> 1.6) + rdf (~> 1.99) + rdf-aggregate-repo (~> 1.99) + rdf-isomorphic (~> 1.99) + rdf-json (~> 1.1, >= 1.1.2) + rdf-microdata (~> 2.0, >= 2.0.2) + rdf-n3 (~> 1.99) + rdf-rdfa (~> 1.99) + rdf-rdfxml (~> 1.1, >= 1.1.5) + rdf-reasoner (~> 0.3) + rdf-tabular (~> 0.3) + rdf-trig (~> 1.99, >= 1.99.0.1) + rdf-trix (~> 1.99) + rdf-turtle (~> 1.99) + rdf-vocab (~> 0.8, >= 0.8.6) + rdf-xsd (~> 1.1, >= 1.1.5) + sparql (~> 1.99) + sparql-client (~> 1.99) + little-plugger (1.1.4) + logging (2.1.0) + little-plugger (~> 1.1) + multi_json (~> 1.10) loofah (2.0.3) nokogiri (>= 1.5.9) mail (2.6.4) mime-types (>= 1.16, < 4) + mail_form (1.5.1) + actionmailer (>= 3.2, < 5) + activemodel (>= 3.2, < 5) + mailboxer (0.13.0) + carrierwave (>= 0.5.8) + foreigner (>= 0.9.1) + rails (>= 3.2.0) + memoist (0.14.0) mime-types (3.0) mime-types-data (~> 3.2015) mime-types-data (3.2016.0221) + mimemagic (0.3.1) + mini_magick (4.5.1) mini_portile2 (2.0.0) minitest (5.8.4) + mono_logger (1.1.0) multi_json (1.11.2) + multi_xml (0.5.5) + multipart-post (2.0.0) + nest (1.1.2) + redis + net-http-persistent (2.9.4) + noid (0.8.0) nokogiri (1.6.7.2) mini_portile2 (~> 2.0.0.rc2) + nom-xml (0.5.4) + activesupport (>= 3.2.18) + i18n + nokogiri + oauth (0.5.1) + oauth2 (0.9.4) + faraday (>= 0.8, < 0.10) + jwt (~> 1.0) + multi_json (~> 1.3) + multi_xml (~> 0.5) + rack (~> 1.2) + om (3.1.0) + activemodel + activesupport + nokogiri (>= 1.4.2) + solrizer (~> 3.3) + openseadragon (0.2.1) + rails (> 3.2.0) + orm_adapter (0.5.0) + os (0.9.6) + parslet (1.7.1) + blankslate (>= 2.0, <= 4.0) + posix-spawn (0.3.11) + qa (0.5.0) + activerecord-import + deprecation + nokogiri (~> 1.6.0) + rails (>= 3.2.13, < 5.0) + rest-client rack (1.6.4) + rack-protection (1.5.3) + rack rack-test (0.6.3) rack (>= 1.0) rails (4.2.6) @@ -105,14 +457,90 @@ GEM rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.3) loofah (~> 2.0) + rails-observers (0.1.2) + activemodel (~> 4.0) + rails_autolink (1.1.6) + rails (> 3.1) railties (4.2.6) actionpack (= 4.2.6) activesupport (= 4.2.6) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (11.1.2) + rdf (1.99.1) + link_header (~> 0.0, >= 0.0.8) + rdf-aggregate-repo (1.99.0) + rdf (~> 1.99) + rdf-isomorphic (1.99.0) + rdf (~> 1.99) + rdf-json (1.99.0) + rdf (~> 1.99) + rdf-microdata (2.0.2) + htmlentities (~> 4.3) + nokogiri (~> 1.6) + rdf (~> 1.1) + rdf-xsd (~> 1.1) + rdf-n3 (1.99.0) + rdf (~> 1.99) + rdf-rdfa (1.99.0) + haml (~> 4.0) + htmlentities (~> 4.3) + rdf (~> 1.99) + rdf-aggregate-repo (~> 1.1) + rdf-xsd (~> 1.1) + rdf-rdfxml (1.99.0) + htmlentities (~> 4.3) + rdf (~> 1.99) + rdf-rdfa (~> 1.99) + rdf-xsd (~> 1.99) + rdf-reasoner (0.3.0) + rdf (~> 1.1, >= 1.1.4.2) + rdf-turtle (~> 1.1) + rdf-vocab (~> 0.8) + rdf-xsd (~> 1.1) + rdf-tabular (0.3.0) + addressable (~> 2.3) + bcp47 (~> 0.3, >= 0.3.3) + json-ld (~> 1.1) + rdf (~> 1.1, >= 1.1.7) + rdf-vocab (~> 0.8) + rdf-xsd (~> 1.1) + rdf-trig (1.99.0.1) + ebnf (~> 1.0) + rdf (~> 1.99) + rdf-turtle (~> 1.99) + rdf-trix (1.99.0) + rdf (~> 1.1) + rdf-turtle (1.99.0) + ebnf (~> 1.0) + rdf (~> 1.99) + rdf-vocab (0.8.7.1) + rdf (~> 1.1, >= 1.1.10) + rdf-xsd (1.99.0) + rdf (~> 1.99) rdoc (4.2.2) json (~> 1.4) + redis (3.2.2) + redis-namespace (1.5.2) + redis (~> 3.0, >= 3.0.4) + redlock (0.1.5) + redis (~> 3, >= 3.0.5) + responders (2.1.2) + railties (>= 4.2.0, < 5.1) + resque (1.26.0) + mono_logger (~> 1.0) + multi_json (~> 1.0) + redis-namespace (~> 1.3) + sinatra (>= 0.9.2) + vegas (~> 0.1.2) + resque-pool (0.6.0) + rake + resque (~> 1.22) + rest-client (1.6.7) + mime-types (>= 1.16) + retriable (1.4.1) + rsolr (1.0.13) + builder (>= 2.1.2) rspec (3.4.0) rspec-core (~> 3.4.0) rspec-expectations (~> 3.4.0) @@ -134,6 +562,13 @@ GEM rspec-mocks (~> 3.4.0) rspec-support (~> 3.4.0) rspec-support (3.4.1) + ruby-box (1.15.0) + addressable + json + multipart-post + oauth2 + ruby-progressbar (1.7.5) + rubyzip (1.2.0) sass (3.4.21) sass-rails (5.0.4) railties (>= 4.0.0, < 5.0) @@ -144,37 +579,100 @@ GEM sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) + select2-rails (3.5.10) + thor (~> 0.14) + signet (0.7.2) + addressable (~> 2.3) + faraday (~> 0.9) + jwt (~> 1.5) + multi_json (~> 1.10) + simple_form (3.1.1) + actionpack (~> 4.0) + activemodel (~> 4.0) simplecov (0.11.2) docile (~> 1.1.0) json (~> 1.8) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) + sinatra (1.4.7) + rack (~> 1.5) + rack-protection (~> 1.4) + tilt (>= 1.3, < 3) + skydrive (1.2.0) + activesupport + httmultiparty + httparty (>= 0.11.0) + oauth2 (>= 0.9.2) + slop (4.3.0) + solr_wrapper (0.7.3) + ruby-progressbar + rubyzip + solrizer (3.4.0) + activesupport + daemons + nokogiri + stomp + xml-simple + sparql (1.99.1) + builder (~> 3.2) + ebnf (~> 1.0) + rdf (~> 1.99) + rdf-aggregate-repo (~> 1.99) + rdf-xsd (~> 1.1) + sparql-client (~> 1.1) + sxp (~> 0.1) + sparql-client (1.99.0) + net-http-persistent (~> 2.9) + rdf (~> 1.1) spring (1.6.4) sprockets (3.5.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) + sprockets-es6 (0.9.0) + babel-source (>= 5.8.11) + babel-transpiler + sprockets (>= 3.0.0) sprockets-rails (3.0.4) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.3.11) + stomp (1.3.5) + sxp (0.1.5) term-ansicolor (1.3.2) tins (~> 1.0) thor (0.19.1) thread_safe (0.3.5) tilt (2.0.2) tins (1.6.0) + tinymce-rails (4.3.8) + railties (>= 3.1.1) + tinymce-rails-imageupload (4.0.16.beta) + railties (>= 3.2, < 5) + tinymce-rails (~> 4.0) turbolinks (2.5.3) coffee-rails + twitter-typeahead-rails (0.11.1) + actionpack (>= 3.1) + jquery-rails + railties (>= 3.1) tzinfo (1.2.2) thread_safe (~> 0.1) uglifier (3.0.0) execjs (>= 0.3.0, < 3) + vegas (0.1.11) + rack (>= 1.0.0) + warden (1.2.6) + rack (>= 1.0) web-console (2.3.0) activemodel (>= 4.0) binding_of_caller (>= 0.7.2) railties (>= 4.0) sprockets-rails (>= 2.0, < 4.0) + xml-simple (1.1.5) + yaml_db (0.3.0) + rails (>= 3.0, < 4.3) + rake (>= 0.8.7) PLATFORMS ruby @@ -183,15 +681,21 @@ DEPENDENCIES byebug coffee-rails (~> 4.1.0) coveralls + devise + devise-guests (~> 0.3) + fcrepo_wrapper jbuilder (~> 2.0) jquery-rails rails (= 4.2.6) + rsolr (~> 1.0.6) rspec rspec-rails sass-rails (~> 5.0) sdoc (~> 0.4.0) + solr_wrapper (>= 0.3) spring sqlite3 + sufia! turbolinks uglifier (>= 1.3.0) web-console (~> 2.0) diff --git a/Rakefile b/Rakefile index ba6b733dd..56ece0fb7 100644 --- a/Rakefile +++ b/Rakefile @@ -4,3 +4,5 @@ require File.expand_path('../config/application', __FILE__) Rails.application.load_tasks + +require 'solr_wrapper/rake_task' diff --git a/app/actors/curation_concerns/generic_work_actor.rb b/app/actors/curation_concerns/generic_work_actor.rb new file mode 100644 index 000000000..67add2aa2 --- /dev/null +++ b/app/actors/curation_concerns/generic_work_actor.rb @@ -0,0 +1,7 @@ +# Generated via +# `rails generate curation_concerns:work GenericWork` +module CurationConcerns + class GenericWorkActor < CurationConcerns::BaseActor + include ::CurationConcerns::WorkActorBehavior + end +end diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index e07c5a830..919b44579 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,5 +12,8 @@ // //= require jquery //= require jquery_ujs -//= require turbolinks -//= require_tree . +//= require turbolinks// +// Required by Blacklight +//= require blacklight/blacklight + +//= require sufia diff --git a/app/assets/javascripts/blacklight_gallery.js b/app/assets/javascripts/blacklight_gallery.js new file mode 100644 index 000000000..992a7d4df --- /dev/null +++ b/app/assets/javascripts/blacklight_gallery.js @@ -0,0 +1 @@ +//= require blacklight_gallery/default \ No newline at end of file diff --git a/app/assets/javascripts/curation_concerns.js b/app/assets/javascripts/curation_concerns.js new file mode 100644 index 000000000..e3caeadbd --- /dev/null +++ b/app/assets/javascripts/curation_concerns.js @@ -0,0 +1 @@ +//= require curation_concerns/application diff --git a/app/assets/javascripts/openseadragon.js b/app/assets/javascripts/openseadragon.js new file mode 100644 index 000000000..2ab91a9f1 --- /dev/null +++ b/app/assets/javascripts/openseadragon.js @@ -0,0 +1,2 @@ +//= require openseadragon/openseadragon +//= require openseadragon/rails \ No newline at end of file diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index f9cd5b348..5326370e5 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -12,4 +12,5 @@ * *= require_tree . *= require_self + *= require sufia */ diff --git a/app/assets/stylesheets/blacklight_gallery.css.scss b/app/assets/stylesheets/blacklight_gallery.css.scss new file mode 100644 index 000000000..19af6827d --- /dev/null +++ b/app/assets/stylesheets/blacklight_gallery.css.scss @@ -0,0 +1,3 @@ +/* + *= require blacklight_gallery/default + */ \ No newline at end of file diff --git a/app/assets/stylesheets/curation_concerns.scss b/app/assets/stylesheets/curation_concerns.scss new file mode 100644 index 000000000..ef02262de --- /dev/null +++ b/app/assets/stylesheets/curation_concerns.scss @@ -0,0 +1,3 @@ +//@import 'blacklight/blacklight'; +@import 'curation_concerns/curation_concerns'; + diff --git a/app/assets/stylesheets/openseadragon.css b/app/assets/stylesheets/openseadragon.css new file mode 100644 index 000000000..c1efc39f2 --- /dev/null +++ b/app/assets/stylesheets/openseadragon.css @@ -0,0 +1,3 @@ +/* + *= require openseadragon/openseadragon + */ \ No newline at end of file diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d83690e1b..f20ebf53a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,4 +1,17 @@ class ApplicationController < ActionController::Base + helper Openseadragon::OpenseadragonHelper + # Adds a few additional behaviors into the application controller + include Blacklight::Controller + include Hydra::Controller::ControllerBehavior + + # Adds CurationConcerns behaviors to the application controller. + include CurationConcerns::ApplicationControllerBehavior + # Adds Sufia behaviors into the application controller + include Sufia::Controller + + include CurationConcerns::ThemedLayoutController + layout 'sufia-one-column' + # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb new file mode 100644 index 000000000..be1385987 --- /dev/null +++ b/app/controllers/catalog_controller.rb @@ -0,0 +1,320 @@ +class CatalogController < ApplicationController + include Hydra::Catalog + include Hydra::Controller::ControllerBehavior + include Sufia::Catalog + include BlacklightAdvancedSearch::Controller + + # These before_filters apply the hydra access controls + before_action :enforce_show_permissions, only: :show + skip_before_action :default_html_head + + def self.uploaded_field + solr_name('system_create', :stored_sortable, type: :date) + end + + def self.modified_field + solr_name('system_modified', :stored_sortable, type: :date) + end + + configure_blacklight do |config| + config.view.gallery.partials = [:index_header, :index] + config.view.masonry.partials = [:index] + config.view.slideshow.partials = [:index] + + config.show.tile_source_field = :content_metadata_image_iiif_info_ssm + config.show.partials.insert(1, :openseadragon) + # default advanced config values + config.advanced_search ||= Blacklight::OpenStructWithHashAccess.new + # config.advanced_search[:qt] ||= 'advanced' + config.advanced_search[:url_key] ||= 'advanced' + config.advanced_search[:query_parser] ||= 'dismax' + config.advanced_search[:form_solr_parameters] ||= {} + + config.search_builder_class = Sufia::SearchBuilder + + # Show gallery view + config.view.gallery.partials = [:index_header, :index] + config.view.slideshow.partials = [:index] + + ## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params + config.default_solr_params = { + qt: "search", + rows: 10, + qf: "title_tesim name_tesim" + } + + # Specify which field to use in the tag cloud on the homepage. + # To disable the tag cloud, comment out this line. + config.tag_cloud_field_name = Solrizer.solr_name("tag", :facetable) + + # solr field configuration for document/show views + config.index.title_field = solr_name("title", :stored_searchable) + config.index.display_type_field = solr_name("has_model", :symbol) + config.index.thumbnail_field = 'thumbnail_path_ss' + + # solr fields that will be treated as facets by the blacklight application + # The ordering of the field names is the order of the display + config.add_facet_field solr_name("resource_type", :facetable), label: "Resource Type", limit: 5 + config.add_facet_field solr_name("creator", :facetable), label: "Creator", limit: 5 + config.add_facet_field solr_name("tag", :facetable), label: "Keyword", limit: 5 + config.add_facet_field solr_name("subject", :facetable), label: "Subject", limit: 5 + config.add_facet_field solr_name("language", :facetable), label: "Language", limit: 5 + config.add_facet_field solr_name("based_near", :facetable), label: "Location", limit: 5 + config.add_facet_field solr_name("publisher", :facetable), label: "Publisher", limit: 5 + config.add_facet_field solr_name("file_format", :facetable), label: "File Format", limit: 5 + + # Have BL send all facet field names to Solr, which has been the default + # previously. Simply remove these lines if you'd rather use Solr request + # handler defaults, or have no facets. + config.add_facet_fields_to_solr_request! + + # solr fields to be displayed in the index (search results) view + # The ordering of the field names is the order of the display + config.add_index_field solr_name("title", :stored_searchable), label: "Title", itemprop: 'name' + config.add_index_field solr_name("description", :stored_searchable), label: "Description", itemprop: 'description' + config.add_index_field solr_name("tag", :stored_searchable), label: "Keyword", itemprop: 'keywords' + config.add_index_field solr_name("subject", :stored_searchable), label: "Subject", itemprop: 'about' + config.add_index_field solr_name("creator", :stored_searchable), label: "Creator", itemprop: 'creator' + config.add_index_field solr_name("contributor", :stored_searchable), label: "Contributor", itemprop: 'contributor' + config.add_index_field solr_name("publisher", :stored_searchable), label: "Publisher", itemprop: 'publisher' + config.add_index_field solr_name("based_near", :stored_searchable), label: "Location", itemprop: 'contentLocation' + config.add_index_field solr_name("language", :stored_searchable), label: "Language", itemprop: 'inLanguage' + config.add_index_field solr_name("date_uploaded", :stored_searchable), label: "Date Uploaded", itemprop: 'datePublished' + config.add_index_field solr_name("date_modified", :stored_searchable), label: "Date Modified", itemprop: 'dateModified' + config.add_index_field solr_name("date_created", :stored_searchable), label: "Date Created", itemprop: 'dateCreated' + config.add_index_field solr_name("rights", :stored_searchable), label: "Rights" + config.add_index_field solr_name("resource_type", :stored_searchable), label: "Resource Type" + config.add_index_field solr_name("format", :stored_searchable), label: "File Format" + config.add_index_field solr_name("identifier", :stored_searchable), label: "Identifier" + + # solr fields to be displayed in the show (single result) view + # The ordering of the field names is the order of the display + config.add_show_field solr_name("title", :stored_searchable), label: "Title" + config.add_show_field solr_name("description", :stored_searchable), label: "Description" + config.add_show_field solr_name("tag", :stored_searchable), label: "Keyword" + config.add_show_field solr_name("subject", :stored_searchable), label: "Subject" + config.add_show_field solr_name("creator", :stored_searchable), label: "Creator" + config.add_show_field solr_name("contributor", :stored_searchable), label: "Contributor" + config.add_show_field solr_name("publisher", :stored_searchable), label: "Publisher" + config.add_show_field solr_name("based_near", :stored_searchable), label: "Location" + config.add_show_field solr_name("language", :stored_searchable), label: "Language" + config.add_show_field solr_name("date_uploaded", :stored_searchable), label: "Date Uploaded" + config.add_show_field solr_name("date_modified", :stored_searchable), label: "Date Modified" + config.add_show_field solr_name("date_created", :stored_searchable), label: "Date Created" + config.add_show_field solr_name("rights", :stored_searchable), label: "Rights" + config.add_show_field solr_name("resource_type", :stored_searchable), label: "Resource Type" + config.add_show_field solr_name("format", :stored_searchable), label: "File Format" + config.add_show_field solr_name("identifier", :stored_searchable), label: "Identifier" + + # "fielded" search configuration. Used by pulldown among other places. + # For supported keys in hash, see rdoc for Blacklight::SearchFields + # + # Search fields will inherit the :qt solr request handler from + # config[:default_solr_parameters], OR can specify a different one + # with a :qt key/value. Below examples inherit, except for subject + # that specifies the same :qt as default for our own internal + # testing purposes. + # + # The :key is what will be used to identify this BL search field internally, + # as well as in URLs -- so changing it after deployment may break bookmarked + # urls. A display label will be automatically calculated from the :key, + # or can be specified manually to be different. + # + # This one uses all the defaults set by the solr request handler. Which + # solr request handler? The one set in config[:default_solr_parameters][:qt], + # since we aren't specifying it otherwise. + config.add_search_field('all_fields', label: 'All Fields', include_in_advanced_search: false) do |field| + all_names = config.show_fields.values.map(&:field).join(" ") + title_name = solr_name("title", :stored_searchable) + field.solr_parameters = { + qf: "#{all_names} file_format_tesim all_text_timv", + pf: title_name.to_s + } + end + + # Now we see how to over-ride Solr request handler defaults, in this + # case for a BL "search field", which is really a dismax aggregate + # of Solr search fields. + # creator, title, description, publisher, date_created, + # subject, language, resource_type, format, identifier, based_near, + config.add_search_field('contributor') do |field| + # solr_parameters hash are sent to Solr as ordinary url query params. + field.solr_parameters = { "spellcheck.dictionary": "contributor" } + + # :solr_local_parameters will be sent using Solr LocalParams + # syntax, as eg {! qf=$title_qf }. This is neccesary to use + # Solr parameter de-referencing like $title_qf. + # See: http://wiki.apache.org/solr/LocalParams + solr_name = solr_name("contributor", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + config.add_search_field('creator') do |field| + field.solr_parameters = { "spellcheck.dictionary": "creator" } + solr_name = solr_name("creator", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + config.add_search_field('title') do |field| + field.solr_parameters = { + "spellcheck.dictionary": "title" + } + solr_name = solr_name("title", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + config.add_search_field('description') do |field| + field.label = "Abstract or Summary" + field.solr_parameters = { + "spellcheck.dictionary": "description" + } + solr_name = solr_name("description", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + config.add_search_field('publisher') do |field| + field.solr_parameters = { + "spellcheck.dictionary": "publisher" + } + solr_name = solr_name("publisher", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + config.add_search_field('date_created') do |field| + field.solr_parameters = { + "spellcheck.dictionary": "date_created" + } + solr_name = solr_name("created", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + config.add_search_field('subject') do |field| + field.solr_parameters = { + "spellcheck.dictionary": "subject" + } + solr_name = solr_name("subject", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + config.add_search_field('language') do |field| + field.solr_parameters = { + "spellcheck.dictionary": "language" + } + solr_name = solr_name("language", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + config.add_search_field('resource_type') do |field| + field.solr_parameters = { + "spellcheck.dictionary": "resource_type" + } + solr_name = solr_name("resource_type", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + config.add_search_field('format') do |field| + field.include_in_advanced_search = false + field.solr_parameters = { + "spellcheck.dictionary": "format" + } + solr_name = solr_name("format", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + config.add_search_field('identifier') do |field| + field.include_in_advanced_search = false + field.solr_parameters = { + "spellcheck.dictionary": "identifier" + } + solr_name = solr_name("id", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + config.add_search_field('based_near') do |field| + field.label = "Location" + field.solr_parameters = { + "spellcheck.dictionary": "based_near" + } + solr_name = solr_name("based_near", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + config.add_search_field('tag') do |field| + field.solr_parameters = { + "spellcheck.dictionary": "tag" + } + solr_name = solr_name("tag", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + config.add_search_field('depositor') do |field| + solr_name = solr_name("depositor", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + config.add_search_field('rights') do |field| + solr_name = solr_name("rights", :stored_searchable) + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + + # "sort results by" select (pulldown) + # label in pulldown is followed by the name of the SOLR field to sort by and + # whether the sort is ascending or descending (it must be asc or desc + # except in the relevancy case). + # label is key, solr field is value + config.add_sort_field "score desc, #{uploaded_field} desc", label: "relevance" + config.add_sort_field "#{uploaded_field} desc", label: "date uploaded \u25BC" + config.add_sort_field "#{uploaded_field} asc", label: "date uploaded \u25B2" + config.add_sort_field "#{modified_field} desc", label: "date modified \u25BC" + config.add_sort_field "#{modified_field} asc", label: "date modified \u25B2" + + # If there are more than this many search results, no spelling ("did you + # mean") suggestion is offered. + config.spell_max = 5 + end +end diff --git a/app/controllers/curation_concerns/generic_works_controller.rb b/app/controllers/curation_concerns/generic_works_controller.rb new file mode 100644 index 000000000..0f281d4ec --- /dev/null +++ b/app/controllers/curation_concerns/generic_works_controller.rb @@ -0,0 +1,10 @@ +# Generated via +# `rails generate curation_concerns:work GenericWork` + +class CurationConcerns::GenericWorksController < ApplicationController + include CurationConcerns::CurationConcernController + # Adds Sufia behaviors to the controller. + include Sufia::WorksControllerBehavior + + set_curation_concern_type GenericWork +end diff --git a/app/forms/curation_concerns/generic_work_form.rb b/app/forms/curation_concerns/generic_work_form.rb new file mode 100644 index 000000000..4fd0715c7 --- /dev/null +++ b/app/forms/curation_concerns/generic_work_form.rb @@ -0,0 +1,10 @@ +# Generated via +# `rails generate curation_concerns:work GenericWork` +module CurationConcerns + class GenericWorkForm < Sufia::Forms::WorkForm + self.model_class = ::GenericWork + include HydraEditor::Form::Permissions + self.terms += [:resource_type] + + end +end diff --git a/app/helpers/curation_concerns_helper.rb b/app/helpers/curation_concerns_helper.rb new file mode 100644 index 000000000..3807e3427 --- /dev/null +++ b/app/helpers/curation_concerns_helper.rb @@ -0,0 +1,4 @@ +module CurationConcernsHelper + include ::BlacklightHelper + include CurationConcerns::MainAppHelpers +end diff --git a/app/helpers/sufia_helper.rb b/app/helpers/sufia_helper.rb new file mode 100644 index 000000000..b02c5d71b --- /dev/null +++ b/app/helpers/sufia_helper.rb @@ -0,0 +1,5 @@ +module SufiaHelper + include ::BlacklightHelper + include Sufia::BlacklightOverride + include Sufia::SufiaHelperBehavior +end diff --git a/app/models/ability.rb b/app/models/ability.rb new file mode 100644 index 000000000..1eb28b518 --- /dev/null +++ b/app/models/ability.rb @@ -0,0 +1,23 @@ +class Ability + include Hydra::Ability + + include CurationConcerns::Ability + include Sufia::Ability + + self.ability_logic += [:everyone_can_create_curation_concerns] + + # Define any customized permissions here. + def custom_permissions + # Limits deleting objects to a the admin user + # + # if current_user.admin? + # can [:destroy], ActiveFedora::Base + # end + + # Limits creating new objects to a specific group + # + # if user_groups.include? 'special_group' + # can [:create], ActiveFedora::Base + # end + end +end diff --git a/app/models/collection.rb b/app/models/collection.rb new file mode 100644 index 000000000..54e566b53 --- /dev/null +++ b/app/models/collection.rb @@ -0,0 +1,7 @@ +# Generated by curation_concerns:models:install +class Collection < ActiveFedora::Base + include ::CurationConcerns::CollectionBehavior + include Sufia::CollectionBehavior + # You can replace these metadata if they're not suitable + include Hydra::Collections::BasicMetadata +end diff --git a/app/models/file_set.rb b/app/models/file_set.rb new file mode 100644 index 000000000..59bec913e --- /dev/null +++ b/app/models/file_set.rb @@ -0,0 +1,5 @@ +# Generated by curation_concerns:models:install +class FileSet < ActiveFedora::Base + include ::CurationConcerns::FileSetBehavior + include Sufia::FileSetBehavior +end diff --git a/app/models/generic_work.rb b/app/models/generic_work.rb new file mode 100644 index 000000000..83564ee5f --- /dev/null +++ b/app/models/generic_work.rb @@ -0,0 +1,8 @@ +# Generated via +# `rails generate curation_concerns:work GenericWork` +class GenericWork < ActiveFedora::Base + include ::CurationConcerns::WorkBehavior + include ::CurationConcerns::BasicMetadata + include Sufia::WorkBehavior + validates :title, presence: { message: 'Your work must have a title.' } +end diff --git a/app/models/search_builder.rb b/app/models/search_builder.rb new file mode 100644 index 000000000..f68afc285 --- /dev/null +++ b/app/models/search_builder.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true +class SearchBuilder < Blacklight::SearchBuilder + include Blacklight::Solr::SearchBuilderBehavior + include Hydra::AccessControlsEnforcement +end diff --git a/app/models/solr_document.rb b/app/models/solr_document.rb new file mode 100644 index 000000000..ca4a16604 --- /dev/null +++ b/app/models/solr_document.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +class SolrDocument + + include Blacklight::Solr::Document + include Blacklight::Gallery::OpenseadragonSolrDocument + + # Adds CurationConcerns behaviors to the SolrDocument. + include CurationConcerns::SolrDocumentBehavior + # Adds Sufia behaviors to the SolrDocument. + include Sufia::SolrDocumentBehavior + + # self.unique_key = 'id' + + # Email uses the semantic field mappings below to generate the body of an email. + SolrDocument.use_extension(Blacklight::Document::Email) + + # SMS uses the semantic field mappings below to generate the body of an SMS email. + SolrDocument.use_extension(Blacklight::Document::Sms) + + # DublinCore uses the semantic field mappings below to assemble an OAI-compliant Dublin Core document + # Semantic mappings of solr stored fields. Fields may be multi or + # single valued. See Blacklight::Document::SemanticFields#field_semantics + # and Blacklight::Document::SemanticFields#to_semantic_values + # Recommendation: Use field names from Dublin Core + use_extension(Blacklight::Document::DublinCore) + + # Do content negotiation for AF models. + + use_extension(Hydra::ContentNegotiation) +end diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 000000000..f934bf9bc --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,24 @@ +class User < ActiveRecord::Base + # Connects this user object to Hydra behaviors. + include Hydra::User + # Connects this user object to Curation Concerns behaviors. + include CurationConcerns::User + # Connects this user object to Sufia behaviors. + include Sufia::User + include Sufia::UserUsageStats + + attr_accessible :email, :password, :password_confirmation if Blacklight::Utils.needs_attr_accessible? + # Connects this user object to Blacklights Bookmarks. + include Blacklight::User + # Include default devise modules. Others available are: + # :confirmable, :lockable, :timeoutable and :omniauthable + devise :database_authenticatable, :registerable, + :recoverable, :rememberable, :trackable, :validatable + + # Method added by Blacklight; Blacklight uses #to_s on your + # user class to get a user-displayable login/identifier for + # the account. + def to_s + email + end +end diff --git a/app/views/curation_concerns/generic_works/_generic_work.html.erb b/app/views/curation_concerns/generic_works/_generic_work.html.erb new file mode 100644 index 000000000..b343e9e8c --- /dev/null +++ b/app/views/curation_concerns/generic_works/_generic_work.html.erb @@ -0,0 +1,2 @@ +<%# This is a search result view %> +<%= render 'catalog/document', document: generic_work, document_counter: generic_work_counter %> diff --git a/config/analytics.yml b/config/analytics.yml new file mode 100644 index 000000000..9abe577c1 --- /dev/null +++ b/config/analytics.yml @@ -0,0 +1,9 @@ +# +# To integrate your app with Google Analytics, uncomment the lines below and add your API key information. +# +# analytics: +# app_name: GOOGLE_OAUTH_APP_NAME +# app_version: GOOGLE_OAUTH_APP_VERSION +# privkey_path: GOOGLE_OAUTH_PRIVATE_KEY_PATH +# privkey_secret: GOOGLE_OAUTH_PRIVATE_KEY_SECRET +# client_email: GOOGLE_OAUTH_CLIENT_EMAIL diff --git a/config/application.rb b/config/application.rb index d6acd78e8..c8fb0c289 100644 --- a/config/application.rb +++ b/config/application.rb @@ -17,6 +17,12 @@ module Lerna class Application < Rails::Application + + config.generators do |g| + g.test_framework :rspec, :spec => true + end + + # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. diff --git a/config/authorities/resource_types.yml b/config/authorities/resource_types.yml new file mode 100644 index 000000000..69c22256a --- /dev/null +++ b/config/authorities/resource_types.yml @@ -0,0 +1,41 @@ +terms: + - id: Article + term: Article + - id: Audio + term: Audio + - id: Book + term: Book + - id: Capstone Project + term: Capstone Project + - id: Conference Proceeding + term: Conference Proceeding + - id: Dataset + term: Dataset + - id: Dissertation + term: Dissertation + - id: Image + term: Image + - id: Journal + term: Journal + - id: Map or Cartographic Material + term: Map or Cartographic Material + - id: Masters Thesis + term: Masters Thesis + - id: Part of Book + term: Part of Book + - id: Poster + term: Poster + - id: Presentation + term: Presentation + - id: Project + term: Project + - id: Report + term: Report + - id: Research Paper + term: Research Paper + - id: Software or Program Code + term: Software or Program Code + - id: Video + term: Video + - id: Other + term: Other diff --git a/config/authorities/rights.yml b/config/authorities/rights.yml new file mode 100644 index 000000000..22467c887 --- /dev/null +++ b/config/authorities/rights.yml @@ -0,0 +1,19 @@ +terms: + - id: http://creativecommons.org/licenses/by/3.0/us/ + term: Attribution 3.0 United States + - id: http://creativecommons.org/licenses/by-sa/3.0/us/ + term: Attribution-ShareAlike 3.0 United States + - id: http://creativecommons.org/licenses/by-nc/3.0/us/ + term: Attribution-NonCommercial 3.0 United States + - id: http://creativecommons.org/licenses/by-nd/3.0/us/ + term: Attribution-NoDerivs 3.0 United States + - id: http://creativecommons.org/licenses/by-nc-nd/3.0/us/ + term: Attribution-NonCommercial-NoDerivs 3.0 United States + - id: http://creativecommons.org/licenses/by-nc-sa/3.0/us/ + term: Attribution-NonCommercial-ShareAlike 3.0 United States + - id: http://creativecommons.org/publicdomain/mark/1.0/ + term: Public Domain Mark 1.0 + - id: http://creativecommons.org/publicdomain/zero/1.0/ + term: CC0 1.0 Universal + - id: http://www.europeana.eu/portal/rights/rr-r.html + term: All rights reserved diff --git a/config/blacklight.yml b/config/blacklight.yml new file mode 100644 index 000000000..d0ec9f442 --- /dev/null +++ b/config/blacklight.yml @@ -0,0 +1,10 @@ +development: + adapter: solr + url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_DEVELOPMENT_PORT', 8983)}/solr/hydra-development" %> +test: &test + adapter: solr + url: http://localhost:<%= ENV['SOLR_TEST_PORT'] || 8985 %>/solr/hydra-test +production: + adapter: solr + url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/blacklight-core" %> + diff --git a/config/fedora.yml b/config/fedora.yml new file mode 100644 index 000000000..10c488e1c --- /dev/null +++ b/config/fedora.yml @@ -0,0 +1,15 @@ +development: + user: fedoraAdmin + password: fedoraAdmin + url: http://127.0.0.1:<%= ENV['FCREPO_DEVELOPMENT_PORT'] || 8984 %>/rest + base_path: /dev +test: + user: fedoraAdmin + password: fedoraAdmin + url: http://127.0.0.1:<%= ENV['FCREPO_TEST_PORT'] || 8986 %>/rest + base_path: /test +production: + user: fedoraAdmin + password: fedoraAdmin + url: http://127.0.0.1:8983/fedora/rest + base_path: /prod diff --git a/config/initializers/clamav.rb b/config/initializers/clamav.rb new file mode 100644 index 000000000..7cd26d6a2 --- /dev/null +++ b/config/initializers/clamav.rb @@ -0,0 +1 @@ +ClamAV.instance.loaddb if defined? ClamAV diff --git a/config/initializers/curation_concerns.rb b/config/initializers/curation_concerns.rb new file mode 100644 index 000000000..6c97b3054 --- /dev/null +++ b/config/initializers/curation_concerns.rb @@ -0,0 +1,63 @@ +CurationConcerns.configure do |config| + # Injected via `rails g curation_concerns:work GenericWork` + config.register_curation_concern :generic_work + # Should schema.org microdata be displayed? + # config.display_microdata = true + + # What default microdata type should be used if a more appropriate + # type can not be found in the locale file? + # config.microdata_default_type = 'http://schema.org/CreativeWork' + + # How frequently should a file be audited. + # Note: In CurationConcerns you must trigger the FileSetAuditService manually. + # config.max_days_between_audits = 7 + + # Enable displaying usage statistics in the UI + # Requires a Google Analytics id and OAuth2 keyfile. See README for more info + # config.analytics = false + + # Specify a Google Analytics tracking ID to gather usage statistics + # config.google_analytics_id = 'UA-99999999-1' + + # Specify a date you wish to start collecting Google Analytic statistics for. + # config.analytic_start_date = DateTime.new(2014,9,10) + + # Where to store tempfiles, leave blank for the system temp directory (e.g. /tmp) + # config.temp_file_base = '/home/developer1' + + # Location on local file system where derivatives will be stored. + # If you use a multi-server architecture, this MUST be a shared volume. + # config.derivatives_path = File.join(Rails.root, 'tmp', 'derivatives') + + # Location on local file system where uploaded files will be staged + # prior to being ingested into the repository or having derivatives generated. + # If you use a multi-server architecture, this MUST be a shared volume. + # config.working_path = File.join(Rails.root, 'tmp', 'uploads') + + # If you have ffmpeg installed and want to transcode audio and video uncomment this line + # config.enable_ffmpeg = true + + # CurationConcerns uses NOIDs for files and collections instead of Fedora UUIDs + # where NOID = 10-character string and UUID = 32-character string w/ hyphens + # config.enable_noids = true + + # Specify a different template for your repository's NOID IDs + # config.noid_template = ".reeddeeddk" + + # Store identifier minter's state in a file for later replayability + # If you use a multi-server architecture, this MUST be on a shared volume. + # config.minter_statefile = '/tmp/minter-state' + + # Specify the prefix for Redis keys: + # config.redis_namespace = "curation_concerns" + + # Specify the path to the file characterization tool: + # config.fits_path = "fits.sh" + + # Specify a date you wish to start collecting Google Analytic statistics for. + # Leaving it blank will set the start date to when ever the file was uploaded by + # NOTE: if you have always sent analytics to GA for downloads and page views leave this commented out + # config.analytic_start_date = DateTime.new(2014,9,10) +end + +Date::DATE_FORMATS[:standard] = '%m/%d/%Y' diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb new file mode 100644 index 000000000..2c4cca20c --- /dev/null +++ b/config/initializers/devise.rb @@ -0,0 +1,265 @@ +# Use this hook to configure devise mailer, warden hooks and so forth. +# Many of these configuration options can be set straight in your model. +Devise.setup do |config| + # The secret key used by Devise. Devise uses this key to generate + # random tokens. Changing this key will render invalid all existing + # confirmation, reset password and unlock tokens in the database. + # Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key` + # by default. You can change it below and use your own secret key. + # config.secret_key = '***REMOVED***' + + # ==> Mailer Configuration + # Configure the e-mail address which will be shown in Devise::Mailer, + # note that it will be overwritten if you use your own mailer class + # with default "from" parameter. + config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' + + # Configure the class responsible to send e-mails. + # config.mailer = 'Devise::Mailer' + + # ==> ORM configuration + # Load and configure the ORM. Supports :active_record (default) and + # :mongoid (bson_ext recommended) by default. Other ORMs may be + # available as additional gems. + require 'devise/orm/active_record' + + # ==> Configuration for any authentication mechanism + # Configure which keys are used when authenticating a user. The default is + # just :email. You can configure it to use [:username, :subdomain], so for + # authenticating a user, both parameters are required. Remember that those + # parameters are used only when authenticating and not when retrieving from + # session. If you need permissions, you should implement that in a before filter. + # You can also supply a hash where the value is a boolean determining whether + # or not authentication should be aborted when the value is not present. + # config.authentication_keys = [:email] + + # Configure parameters from the request object used for authentication. Each entry + # given should be a request method and it will automatically be passed to the + # find_for_authentication method and considered in your model lookup. For instance, + # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. + # The same considerations mentioned for authentication_keys also apply to request_keys. + # config.request_keys = [] + + # Configure which authentication keys should be case-insensitive. + # These keys will be downcased upon creating or modifying a user and when used + # to authenticate or find a user. Default is :email. + config.case_insensitive_keys = [:email] + + # Configure which authentication keys should have whitespace stripped. + # These keys will have whitespace before and after removed upon creating or + # modifying a user and when used to authenticate or find a user. Default is :email. + config.strip_whitespace_keys = [:email] + + # Tell if authentication through request.params is enabled. True by default. + # It can be set to an array that will enable params authentication only for the + # given strategies, for example, `config.params_authenticatable = [:database]` will + # enable it only for database (email + password) authentication. + # config.params_authenticatable = true + + # Tell if authentication through HTTP Auth is enabled. False by default. + # It can be set to an array that will enable http authentication only for the + # given strategies, for example, `config.http_authenticatable = [:database]` will + # enable it only for database authentication. The supported strategies are: + # :database = Support basic authentication with authentication key + password + # config.http_authenticatable = false + + # If 401 status code should be returned for AJAX requests. True by default. + # config.http_authenticatable_on_xhr = true + + # The realm used in Http Basic Authentication. 'Application' by default. + # config.http_authentication_realm = 'Application' + + # It will change confirmation, password recovery and other workflows + # to behave the same regardless if the e-mail provided was right or wrong. + # Does not affect registerable. + # config.paranoid = true + + # By default Devise will store the user in session. You can skip storage for + # particular strategies by setting this option. + # Notice that if you are skipping storage for all authentication paths, you + # may want to disable generating routes to Devise's sessions controller by + # passing skip: :sessions to `devise_for` in your config/routes.rb + config.skip_session_storage = [:http_auth] + + # By default, Devise cleans up the CSRF token on authentication to + # avoid CSRF token fixation attacks. This means that, when using AJAX + # requests for sign in and sign up, you need to get a new CSRF token + # from the server. You can disable this option at your own risk. + # config.clean_up_csrf_token_on_authentication = true + + # ==> Configuration for :database_authenticatable + # For bcrypt, this is the cost for hashing the password and defaults to 10. If + # using other encryptors, it sets how many times you want the password re-encrypted. + # + # Limiting the stretches to just one in testing will increase the performance of + # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use + # a value less than 10 in other environments. Note that, for bcrypt (the default + # encryptor), the cost increases exponentially with the number of stretches (e.g. + # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation). + config.stretches = Rails.env.test? ? 1 : 10 + + # Setup a pepper to generate the encrypted password. + # config.pepper = '70defcd162929be0944c596d453635a22fae1fef85791d4157fab3c11039e5369c14aa73c571052424f6a25f4e67883a5e108cd06d7c8ba938f6f20e6ad4539f' + + # Send a notification email when the user's password is changed + # config.send_password_change_notification = false + + # ==> Configuration for :confirmable + # A period that the user is allowed to access the website even without + # confirming their account. For instance, if set to 2.days, the user will be + # able to access the website for two days without confirming their account, + # access will be blocked just in the third day. Default is 0.days, meaning + # the user cannot access the website without confirming their account. + # config.allow_unconfirmed_access_for = 2.days + + # A period that the user is allowed to confirm their account before their + # token becomes invalid. For example, if set to 3.days, the user can confirm + # their account within 3 days after the mail was sent, but on the fourth day + # their account can't be confirmed with the token any more. + # Default is nil, meaning there is no restriction on how long a user can take + # before confirming their account. + # config.confirm_within = 3.days + + # If true, requires any email changes to be confirmed (exactly the same way as + # initial account confirmation) to be applied. Requires additional unconfirmed_email + # db field (see migrations). Until confirmed, new email is stored in + # unconfirmed_email column, and copied to email column on successful confirmation. + config.reconfirmable = true + + # Defines which key will be used when confirming an account + # config.confirmation_keys = [:email] + + # ==> Configuration for :rememberable + # The time the user will be remembered without asking for credentials again. + # config.remember_for = 2.weeks + + # Invalidates all the remember me tokens when the user signs out. + config.expire_all_remember_me_on_sign_out = true + + # If true, extends the user's remember period when remembered via cookie. + # config.extend_remember_period = false + + # Options to be passed to the created cookie. For instance, you can set + # secure: true in order to force SSL only cookies. + # config.rememberable_options = {} + + # ==> Configuration for :validatable + # Range for password length. + config.password_length = 8..72 + + # Email regex used to validate email formats. It simply asserts that + # one (and only one) @ exists in the given string. This is mainly + # to give user feedback and not to assert the e-mail validity. + # config.email_regexp = /\A[^@]+@[^@]+\z/ + + # ==> Configuration for :timeoutable + # The time you want to timeout the user session without activity. After this + # time the user will be asked for credentials again. Default is 30 minutes. + # config.timeout_in = 30.minutes + + # ==> Configuration for :lockable + # Defines which strategy will be used to lock an account. + # :failed_attempts = Locks an account after a number of failed attempts to sign in. + # :none = No lock strategy. You should handle locking by yourself. + # config.lock_strategy = :failed_attempts + + # Defines which key will be used when locking and unlocking an account + # config.unlock_keys = [:email] + + # Defines which strategy will be used to unlock an account. + # :email = Sends an unlock link to the user email + # :time = Re-enables login after a certain amount of time (see :unlock_in below) + # :both = Enables both strategies + # :none = No unlock strategy. You should handle unlocking by yourself. + # config.unlock_strategy = :both + + # Number of authentication tries before locking an account if lock_strategy + # is failed attempts. + # config.maximum_attempts = 20 + + # Time interval to unlock the account if :time is enabled as unlock_strategy. + # config.unlock_in = 1.hour + + # Warn on the last attempt before the account is locked. + # config.last_attempt_warning = true + + # ==> Configuration for :recoverable + # + # Defines which key will be used when recovering the password for an account + # config.reset_password_keys = [:email] + + # Time interval you can reset your password with a reset password key. + # Don't put a too small interval or your users won't have the time to + # change their passwords. + config.reset_password_within = 6.hours + + # When set to false, does not sign a user in automatically after their password is + # reset. Defaults to true, so a user is signed in automatically after a reset. + # config.sign_in_after_reset_password = true + + # ==> Configuration for :encryptable + # Allow you to use another encryption algorithm besides bcrypt (default). You can use + # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, + # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) + # and :restful_authentication_sha1 (then you should set stretches to 10, and copy + # REST_AUTH_SITE_KEY to pepper). + # + # Require the `devise-encryptable` gem when using anything other than bcrypt + # config.encryptor = :sha512 + + # ==> Scopes configuration + # Turn scoped views on. Before rendering "sessions/new", it will first check for + # "users/sessions/new". It's turned off by default because it's slower if you + # are using only default views. + # config.scoped_views = false + + # Configure the default scope given to Warden. By default it's the first + # devise role declared in your routes (usually :user). + # config.default_scope = :user + + # Set this configuration to false if you want /users/sign_out to sign out + # only the current scope. By default, Devise signs out all scopes. + # config.sign_out_all_scopes = true + + # ==> Navigation configuration + # Lists the formats that should be treated as navigational. Formats like + # :html, should redirect to the sign in page when the user does not have + # access, but formats like :xml or :json, should return 401. + # + # If you have any extra navigational formats, like :iphone or :mobile, you + # should add them to the navigational formats lists. + # + # The "*/*" below is required to match Internet Explorer requests. + # config.navigational_formats = ['*/*', :html] + + # The default HTTP method used to sign out a resource. Default is :delete. + config.sign_out_via = :get + + # ==> OmniAuth + # Add a new OmniAuth provider. Check the wiki for more information on setting + # up on your models and hooks. + # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo' + + # ==> Warden configuration + # If you want to use other strategies, that are not supported by Devise, or + # change the failure app, you can configure them inside the config.warden block. + # + # config.warden do |manager| + # manager.intercept_401 = false + # manager.default_strategies(scope: :user).unshift :some_external_strategy + # end + + # ==> Mountable engine configurations + # When using Devise inside an engine, let's call it `MyEngine`, and this engine + # is mountable, there are some extra configurations to be taken into account. + # The following options are available, assuming the engine is mounted as: + # + # mount MyEngine, at: '/my_engine' + # + # The router that invoked `devise_for`, in the example above, would be: + # config.router_name = :my_engine + # + # When using OmniAuth, Devise cannot automatically set OmniAuth path, + # so you need to do it manually. For the users scope, it would be: + # config.omniauth_path_prefix = '/my_engine/users/auth' +end diff --git a/config/initializers/hydra_config.rb b/config/initializers/hydra_config.rb new file mode 100644 index 000000000..44df30700 --- /dev/null +++ b/config/initializers/hydra_config.rb @@ -0,0 +1,22 @@ +# windows doesn't properly require hydra-head (from the gemfile), so we need to require it explicitly here: +require 'hydra/head' unless defined? Hydra + +Hydra.configure do |config| + # This specifies the solr field names of permissions-related fields. + # You only need to change these values if you've indexed permissions by some means other than the Hydra's built-in tooling. + # If you change these, you must also update the permissions request handler in your solrconfig.xml to return those values + # + # config.permissions.discover.group = ActiveFedora::SolrQueryBuilder.solr_name("discover_access_group", :symbol) + # config.permissions.discover.individual = ActiveFedora::SolrQueryBuilder.solr_name("discover_access_person", :symbol) + # config.permissions.read.group = ActiveFedora::SolrQueryBuilder.solr_name("read_access_group", :symbol) + # config.permissions.read.individual = ActiveFedora::SolrQueryBuilder.solr_name("read_access_person", :symbol) + # config.permissions.edit.group = ActiveFedora::SolrQueryBuilder.solr_name("edit_access_group", :symbol) + # config.permissions.edit.individual = ActiveFedora::SolrQueryBuilder.solr_name("edit_access_person", :symbol) + # + # config.permissions.embargo.release_date = ActiveFedora::SolrQueryBuilder.solr_name("embargo_release_date", :stored_sortable, type: :date) + # config.permissions.lease.expiration_date = ActiveFedora::SolrQueryBuilder.solr_name("lease_expiration_date", :stored_sortable, type: :date) + # + # + # Specify the user model + # config.user_model = 'User' +end diff --git a/config/initializers/mailboxer.rb b/config/initializers/mailboxer.rb new file mode 100644 index 000000000..39bcf7b7d --- /dev/null +++ b/config/initializers/mailboxer.rb @@ -0,0 +1,21 @@ +Mailboxer.setup do |config| + + #Configures if you application uses or not email sending for Notifications and Messages + config.uses_emails = true + + #Configures the default from for emails sent for Messages and Notifications + config.default_from = "no-reply@mailboxer.com" + + #Configures the methods needed by mailboxer + config.email_method = :mailboxer_email + config.name_method = :name + + #Configures if you use or not a search engine and which one you are using + #Supported engines: [:solr,:sphinx] + config.search_enabled = false + config.search_engine = :solr + + #Configures maximum length of the message subject and body + config.subject_max_length = 255 + config.body_max_length = 32000 +end diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index dc1899682..5894028a1 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -2,3 +2,7 @@ # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf +Mime::Type.register "application/n-triples", :nt +Mime::Type.register "application/ld+json", :jsonld +Mime::Type.register "text/turtle", :ttl +Mime::Type.register 'application/x-endnote-refer', :endnote \ No newline at end of file diff --git a/config/initializers/mini_magick.rb b/config/initializers/mini_magick.rb new file mode 100644 index 000000000..4d73ff079 --- /dev/null +++ b/config/initializers/mini_magick.rb @@ -0,0 +1,5 @@ +require 'mini_magick' + +MiniMagick.configure do |config| + config.shell_api = "posix-spawn" +end diff --git a/config/initializers/redis_config.rb b/config/initializers/redis_config.rb new file mode 100644 index 000000000..17ba9be96 --- /dev/null +++ b/config/initializers/redis_config.rb @@ -0,0 +1,29 @@ +if defined?(PhusionPassenger) + PhusionPassenger.on_event(:starting_worker_process) do |forked| + # We're in smart spawning mode. + if forked + # Re-establish redis connection + require 'redis' + config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access + + # The important two lines + Redis.current.disconnect! + Redis.current = begin + Redis.new(config.merge(thread_safe: true)) + rescue + nil + end + Resque.redis = Redis.current + Resque.redis.namespace = "#{CurationConcerns.config.redis_namespace}:#{Rails.env}" + Resque.redis.client.reconnect if Resque.redis + end + end +else + config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access + require 'redis' + Redis.current = begin + Redis.new(config.merge(thread_safe: true)) + rescue + nil + end +end diff --git a/config/initializers/resque_config.rb b/config/initializers/resque_config.rb new file mode 100644 index 000000000..ca7b9dce0 --- /dev/null +++ b/config/initializers/resque_config.rb @@ -0,0 +1,6 @@ +require 'resque' +config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access +Resque.redis = Redis.new(host: config[:host], port: config[:port], thread_safe: true) + +Resque.inline = Rails.env.test? +Resque.redis.namespace = "#{CurationConcerns.config.redis_namespace}:#{Rails.env}" diff --git a/config/initializers/stats_admin.rb b/config/initializers/stats_admin.rb new file mode 100644 index 000000000..63bcdc8df --- /dev/null +++ b/config/initializers/stats_admin.rb @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +module Sufia + class StatsAdmin + def self.matches?(request) + current_user = request.env['warden'].user + return false if current_user.blank? + current_user.groups.include? 'admin' + end + end +end diff --git a/config/initializers/sufia.rb b/config/initializers/sufia.rb new file mode 100644 index 000000000..bc91e7a9e --- /dev/null +++ b/config/initializers/sufia.rb @@ -0,0 +1,140 @@ +Sufia.config do |config| + config.fits_to_desc_mapping = { + file_title: :title, + file_author: :creator + } + + config.max_days_between_audits = 7 + + config.max_notifications_for_dashboard = 5 + + config.resource_types = { + "Article" => "Article", + "Audio" => "Audio", + "Book" => "Book", + "Capstone Project" => "Capstone Project", + "Conference Proceeding" => "Conference Proceeding", + "Dataset" => "Dataset", + "Dissertation" => "Dissertation", + "Image" => "Image", + "Journal" => "Journal", + "Map or Cartographic Material" => "Map or Cartographic Material", + "Masters Thesis" => "Masters Thesis", + "Part of Book" => "Part of Book", + "Poster" => "Poster", + "Presentation" => "Presentation", + "Project" => "Project", + "Report" => "Report", + "Research Paper" => "Research Paper", + "Software or Program Code" => "Software or Program Code", + "Video" => "Video", + "Other" => "Other" + } + + config.resource_types_to_schema = { + "Article" => "http://schema.org/Article", + "Audio" => "http://schema.org/AudioObject", + "Book" => "http://schema.org/Book", + "Capstone Project" => "http://schema.org/CreativeWork", + "Conference Proceeding" => "http://schema.org/ScholarlyArticle", + "Dataset" => "http://schema.org/Dataset", + "Dissertation" => "http://schema.org/ScholarlyArticle", + "Image" => "http://schema.org/ImageObject", + "Journal" => "http://schema.org/CreativeWork", + "Map or Cartographic Material" => "http://schema.org/Map", + "Masters Thesis" => "http://schema.org/ScholarlyArticle", + "Part of Book" => "http://schema.org/Book", + "Poster" => "http://schema.org/CreativeWork", + "Presentation" => "http://schema.org/CreativeWork", + "Project" => "http://schema.org/CreativeWork", + "Report" => "http://schema.org/CreativeWork", + "Research Paper" => "http://schema.org/ScholarlyArticle", + "Software or Program Code" => "http://schema.org/Code", + "Video" => "http://schema.org/VideoObject", + "Other" => "http://schema.org/CreativeWork" + } + + config.permission_levels = { + "Choose Access" => "none", + "View/Download" => "read", + "Edit" => "edit" + } + + config.owner_permission_levels = { + "Edit" => "edit" + } + + # Enable displaying usage statistics in the UI + # Defaults to FALSE + # Requires a Google Analytics id and OAuth2 keyfile. See README for more info + config.analytics = false + + # Specify a Google Analytics tracking ID to gather usage statistics + # config.google_analytics_id = 'UA-99999999-1' + + # Specify a date you wish to start collecting Google Analytic statistics for. + # config.analytic_start_date = DateTime.new(2014,9,10) + + # Enables a link to the citations page for a generic_file. + # Default is false + # config.citations = false + + # Enables a link to the citations page for a generic_file. +# Default is false +# config.citations = false +# Where to store tempfiles, leave blank for the system temp directory (e.g. /tmp) + # config.temp_file_base = '/home/developer1' + + # Specify the form of hostpath to be used in Endnote exports + # config.persistent_hostpath = 'http://localhost/files/' + + # If you have ffmpeg installed and want to transcode audio and video uncomment this line + # config.enable_ffmpeg = true + + # Sufia uses NOIDs for files and collections instead of Fedora UUIDs + # where NOID = 10-character string and UUID = 32-character string w/ hyphens + # config.enable_noids = true + + # Specify a different template for your repository's NOID IDs + # config.noid_template = ".reeddeeddk" + + # Store identifier minter's state in a file for later replayability + # config.minter_statefile = '/tmp/minter-state' + + # Process for translating Fedora URIs to identifiers and vice versa + # config.translate_uri_to_id = ActiveFedora::Noid.config.translate_uri_to_id + # config.translate_id_to_uri = ActiveFedora::Noid.config.translate_id_to_uri + + # Specify the prefix for Redis keys: + # config.redis_namespace = "sufia" + + # Specify the path to the file characterization tool: + # config.fits_path = "fits.sh" + + # Specify how many seconds back from the current time that we should show by default of the user's activity on the user's dashboard + # config.activity_to_show_default_seconds_since_now = 24*60*60 + + # Sufia can integrate with Zotero's Arkivo service for automatic deposit + # of Zotero-managed research items. + # config.arkivo_api = false + + # Specify a date you wish to start collecting Google Analytic statistics for. + # Leaving it blank will set the start date to when ever the file was uploaded by + # NOTE: if you have always sent analytics to GA for downloads and page views leave this commented out + # config.analytic_start_date = DateTime.new(2014,9,10) + + config.geonames_username = '' + + # If browse-everything has been configured, load the configs. Otherwise, set to nil. + begin + if defined? BrowseEverything + config.browse_everything = BrowseEverything.config + else + Rails.logger.warn "BrowseEverything is not installed" + end + rescue Errno::ENOENT + config.browse_everything = nil + end +end + +Date::DATE_FORMATS[:standard] = "%m/%d/%Y" diff --git a/config/locales/blacklight.en.yml b/config/locales/blacklight.en.yml new file mode 100644 index 000000000..ff834b2f0 --- /dev/null +++ b/config/locales/blacklight.en.yml @@ -0,0 +1,3 @@ +en: + blacklight: + application_name: 'Blacklight' \ No newline at end of file diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml new file mode 100644 index 000000000..bd4c3ebc6 --- /dev/null +++ b/config/locales/devise.en.yml @@ -0,0 +1,62 @@ +# Additional translations at https://github.com/plataformatec/devise/wiki/I18n + +en: + devise: + confirmations: + confirmed: "Your email address has been successfully confirmed." + send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes." + send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes." + failure: + already_authenticated: "You are already signed in." + inactive: "Your account is not activated yet." + invalid: "Invalid %{authentication_keys} or password." + locked: "Your account is locked." + last_attempt: "You have one more attempt before your account is locked." + not_found_in_database: "Invalid %{authentication_keys} or password." + timeout: "Your session expired. Please sign in again to continue." + unauthenticated: "You need to sign in or sign up before continuing." + unconfirmed: "You have to confirm your email address before continuing." + mailer: + confirmation_instructions: + subject: "Confirmation instructions" + reset_password_instructions: + subject: "Reset password instructions" + unlock_instructions: + subject: "Unlock instructions" + password_change: + subject: "Password Changed" + omniauth_callbacks: + failure: "Could not authenticate you from %{kind} because \"%{reason}\"." + success: "Successfully authenticated from %{kind} account." + passwords: + no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." + send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes." + send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." + updated: "Your password has been changed successfully. You are now signed in." + updated_not_active: "Your password has been changed successfully." + registrations: + destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon." + signed_up: "Welcome! You have signed up successfully." + signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." + signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." + signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account." + update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address." + updated: "Your account has been updated successfully." + sessions: + signed_in: "Signed in successfully." + signed_out: "Signed out successfully." + already_signed_out: "Signed out successfully." + unlocks: + send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes." + send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes." + unlocked: "Your account has been unlocked successfully. Please sign in to continue." + errors: + messages: + already_confirmed: "was already confirmed, please try signing in" + confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" + expired: "has expired, please request a new one" + not_found: "not found" + not_locked: "was not locked" + not_saved: + one: "1 error prohibited this %{resource} from being saved:" + other: "%{count} errors prohibited this %{resource} from being saved:" diff --git a/config/redis.yml b/config/redis.yml new file mode 100644 index 000000000..3888eaf44 --- /dev/null +++ b/config/redis.yml @@ -0,0 +1,9 @@ +development: + host: localhost + port: 6379 +test: + host: localhost + port: 6379 +production: + host: localhost + port: 6379 diff --git a/config/resque-pool.yml b/config/resque-pool.yml new file mode 100644 index 000000000..21f76bfca --- /dev/null +++ b/config/resque-pool.yml @@ -0,0 +1 @@ + "*": 1 \ No newline at end of file diff --git a/config/role_map.yml b/config/role_map.yml new file mode 100644 index 000000000..fc74dccd3 --- /dev/null +++ b/config/role_map.yml @@ -0,0 +1,19 @@ +development: + archivist: + - archivist1@example.com +test: + archivist: + - archivist1@example.com + - archivist2@example.com + - leland_himself@example.com + admin_policy_object_editor: + - archivist1@example.com + donor: + - donor1@example.com + - leland_himself@example.com + researcher: + - archivist1@example.com + - researcher1@example.com + patron: + - patron1@example.com + - leland_himself@example.com diff --git a/config/routes.rb b/config/routes.rb index 3f66539d5..bf470ebeb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,56 +1,37 @@ Rails.application.routes.draw do - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end + root 'sufia/homepage#index' + + mount Blacklight::Engine => '/' + mount Hydra::Collections::Engine => '/' + mount CurationConcerns::Engine, at: '/' + + concern :searchable, Blacklight::Routes::Searchable.new + concern :exportable, Blacklight::Routes::Exportable.new + + devise_for :users + Hydra::BatchEdit.add_routes(self) + + curation_concerns_collections + curation_concerns_basic_routes + curation_concerns_embargo_management + + resource :catalog, only: [:index], as: 'catalog', path: '/catalog', controller: 'catalog' do + concerns :searchable + end + + resources :solr_documents, only: [:show], path: '/catalog', controller: 'catalog' do + concerns :exportable + end + + resources :bookmarks do + concerns :exportable + + collection do + delete 'clear' + end + end + + # This must be the very last route in the file because it has a catch-all route for 404 errors. + # This behavior seems to show up only in production mode. + mount Sufia::Engine => '/' end diff --git a/config/solr.yml b/config/solr.yml new file mode 100644 index 000000000..4cb35238b --- /dev/null +++ b/config/solr.yml @@ -0,0 +1,7 @@ +# This is a sample config file that points to a solr server for each environment +development: + url: http://127.0.0.1:<%= ENV['SOLR_TEST_PORT'] || 8983 %>/solr/hydra-development +test: + url: http://127.0.0.1:<%= ENV['SOLR_TEST_PORT'] || 8985 %>/solr/hydra-test +production: + url: http://your.production.server:8080/bl_solr/core0 diff --git a/config/tinymce.yml b/config/tinymce.yml new file mode 100644 index 000000000..31087bb5d --- /dev/null +++ b/config/tinymce.yml @@ -0,0 +1,7 @@ +menubar: false +toolbar1: styleselect | bold italic | link image | undo redo +toolbar2: table | fullscreen | uploadimage +plugins: + - table + - fullscreen + - uploadimage diff --git a/db/migrate/20160328222140_create_searches.blacklight.rb b/db/migrate/20160328222140_create_searches.blacklight.rb new file mode 100644 index 000000000..f2c9bfbf5 --- /dev/null +++ b/db/migrate/20160328222140_create_searches.blacklight.rb @@ -0,0 +1,19 @@ +# This migration comes from blacklight (originally 20140202020201) +# frozen_string_literal: true +class CreateSearches < ActiveRecord::Migration + def self.up + create_table :searches do |t| + t.text :query_params + t.integer :user_id + t.string :user_type + + t.timestamps null: false + end + + add_index :searches, :user_id + end + + def self.down + drop_table :searches + end +end diff --git a/db/migrate/20160328222141_create_bookmarks.blacklight.rb b/db/migrate/20160328222141_create_bookmarks.blacklight.rb new file mode 100644 index 000000000..4d7c1d7b5 --- /dev/null +++ b/db/migrate/20160328222141_create_bookmarks.blacklight.rb @@ -0,0 +1,18 @@ +# This migration comes from blacklight (originally 20140202020202) +# frozen_string_literal: true +class CreateBookmarks < ActiveRecord::Migration + def self.up + create_table :bookmarks do |t| + t.integer :user_id, :null=>false + t.string :user_type + t.string :document_id + t.string :title + t.timestamps null: false + end + end + + def self.down + drop_table :bookmarks + end + +end diff --git a/db/migrate/20160328222142_add_polymorphic_type_to_bookmarks.blacklight.rb b/db/migrate/20160328222142_add_polymorphic_type_to_bookmarks.blacklight.rb new file mode 100644 index 000000000..34f198b34 --- /dev/null +++ b/db/migrate/20160328222142_add_polymorphic_type_to_bookmarks.blacklight.rb @@ -0,0 +1,9 @@ +# This migration comes from blacklight (originally 20140320000000) +# frozen_string_literal: true +class AddPolymorphicTypeToBookmarks < ActiveRecord::Migration + def change + add_column(:bookmarks, :document_type, :string) + + add_index :bookmarks, :user_id + end +end diff --git a/db/migrate/20160328222150_devise_create_users.rb b/db/migrate/20160328222150_devise_create_users.rb new file mode 100644 index 000000000..74adf30cd --- /dev/null +++ b/db/migrate/20160328222150_devise_create_users.rb @@ -0,0 +1,42 @@ +class DeviseCreateUsers < ActiveRecord::Migration + def change + create_table(:users) do |t| + ## Database authenticatable + t.string :email, null: false, default: "" + t.string :encrypted_password, null: false, default: "" + + ## Recoverable + t.string :reset_password_token + t.datetime :reset_password_sent_at + + ## Rememberable + t.datetime :remember_created_at + + ## Trackable + t.integer :sign_in_count, default: 0, null: false + t.datetime :current_sign_in_at + t.datetime :last_sign_in_at + t.string :current_sign_in_ip + t.string :last_sign_in_ip + + ## Confirmable + # t.string :confirmation_token + # t.datetime :confirmed_at + # t.datetime :confirmation_sent_at + # t.string :unconfirmed_email # Only if using reconfirmable + + ## Lockable + # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts + # t.string :unlock_token # Only if unlock strategy is :email or :both + # t.datetime :locked_at + + + t.timestamps null: false + end + + add_index :users, :email, unique: true + add_index :users, :reset_password_token, unique: true + # add_index :users, :confirmation_token, unique: true + # add_index :users, :unlock_token, unique: true + end +end diff --git a/db/migrate/20160328222151_add_devise_guests_to_users.rb b/db/migrate/20160328222151_add_devise_guests_to_users.rb new file mode 100644 index 000000000..445a7d1b6 --- /dev/null +++ b/db/migrate/20160328222151_add_devise_guests_to_users.rb @@ -0,0 +1,15 @@ +class AddDeviseGuestsToUsers < ActiveRecord::Migration + def self.up + change_table(:users) do |t| + ## Database authenticatable + t.boolean :guest, :default => false + end + + end + + def self.down + # By default, we don't want to make any assumption about how to roll back a migration when your + # model already existed. Please edit below which fields you would like to remove in this migration. + raise ActiveRecord::IrreversibleMigration + end +end \ No newline at end of file diff --git a/db/migrate/20160328222152_create_version_committers.rb b/db/migrate/20160328222152_create_version_committers.rb new file mode 100644 index 000000000..7c23fb91f --- /dev/null +++ b/db/migrate/20160328222152_create_version_committers.rb @@ -0,0 +1,15 @@ +class CreateVersionCommitters < ActiveRecord::Migration + def self.up + create_table :version_committers do |t| + t.string :obj_id + t.string :datastream_id + t.string :version_id + t.string :committer_login + t.timestamps + end + end + + def self.down + drop_table :version_committers + end +end diff --git a/db/migrate/20160328222153_create_checksum_audit_logs.rb b/db/migrate/20160328222153_create_checksum_audit_logs.rb new file mode 100644 index 000000000..00c9ea7a9 --- /dev/null +++ b/db/migrate/20160328222153_create_checksum_audit_logs.rb @@ -0,0 +1,19 @@ +class CreateChecksumAuditLogs < ActiveRecord::Migration + def self.up + create_table :checksum_audit_logs do |t| + t.string :file_set_id + t.string :file_id + t.string :version + t.integer :pass + t.string :expected_result + t.string :actual_result + t.timestamps + end + add_index :checksum_audit_logs, [:file_set_id, :file_id], name: 'by_file_set_id_and_file_id', order: { created_at: 'DESC' } + end + + def self.down + remove_index(:checksum_audit_logs, name: 'by_file_set_id_and_file_id') + drop_table :checksum_audit_logs + end +end diff --git a/db/migrate/20160328222154_create_single_use_links.rb b/db/migrate/20160328222154_create_single_use_links.rb new file mode 100644 index 000000000..3c1c3067a --- /dev/null +++ b/db/migrate/20160328222154_create_single_use_links.rb @@ -0,0 +1,12 @@ +class CreateSingleUseLinks < ActiveRecord::Migration + def change + create_table :single_use_links do |t| + t.string :downloadKey + t.string :path + t.string :itemId + t.datetime :expires + + t.timestamps + end + end +end diff --git a/db/migrate/20160328222155_acts_as_follower_migration.rb b/db/migrate/20160328222155_acts_as_follower_migration.rb new file mode 100644 index 000000000..164a70971 --- /dev/null +++ b/db/migrate/20160328222155_acts_as_follower_migration.rb @@ -0,0 +1,17 @@ +class ActsAsFollowerMigration < ActiveRecord::Migration + def self.up + create_table :follows, force: true do |t| + t.references :followable, polymorphic: true, null: false + t.references :follower, polymorphic: true, null: false + t.boolean :blocked, default: false, null: false + t.timestamps null: false + end + + add_index :follows, ["follower_id", "follower_type"], name: "fk_follows" + add_index :follows, ["followable_id", "followable_type"], name: "fk_followables" + end + + def self.down + drop_table :follows + end +end diff --git a/db/migrate/20160328222156_add_social_to_users.rb b/db/migrate/20160328222156_add_social_to_users.rb new file mode 100644 index 000000000..33d277949 --- /dev/null +++ b/db/migrate/20160328222156_add_social_to_users.rb @@ -0,0 +1,13 @@ +class AddSocialToUsers < ActiveRecord::Migration + def self.up + add_column :users, :facebook_handle, :string + add_column :users, :twitter_handle, :string + add_column :users, :googleplus_handle, :string + end + + def self.down + remove_column :users, :facebook_handle, :string + remove_column :users, :twitter_handle, :string + remove_column :users, :googleplus_handle, :string + end +end diff --git a/db/migrate/20160328222157_add_ldap_attrs_to_user.rb b/db/migrate/20160328222157_add_ldap_attrs_to_user.rb new file mode 100644 index 000000000..66be26cb8 --- /dev/null +++ b/db/migrate/20160328222157_add_ldap_attrs_to_user.rb @@ -0,0 +1,27 @@ +class AddLdapAttrsToUser < ActiveRecord::Migration + def self.up + add_column :users, :display_name, :string + add_column :users, :address, :string + add_column :users, :admin_area, :string + add_column :users, :department, :string + add_column :users, :title, :string + add_column :users, :office, :string + add_column :users, :chat_id, :string + add_column :users, :website, :string + add_column :users, :affiliation, :string + add_column :users, :telephone, :string + end + + def self.down + remove_column :users, :display_name + remove_column :users, :address + remove_column :users, :admin_area + remove_column :users, :department + remove_column :users, :title + remove_column :users, :office + remove_column :users, :chat_id + remove_column :users, :website + remove_column :users, :affiliation + remove_column :users, :telephone + end +end diff --git a/db/migrate/20160328222158_add_avatars_to_users.rb b/db/migrate/20160328222158_add_avatars_to_users.rb new file mode 100644 index 000000000..d8100fdc8 --- /dev/null +++ b/db/migrate/20160328222158_add_avatars_to_users.rb @@ -0,0 +1,15 @@ +class AddAvatarsToUsers < ActiveRecord::Migration + def self.up + add_column :users, "avatar_file_name", :string + add_column :users, "avatar_content_type", :string + add_column :users, "avatar_file_size", :integer + add_column :users, "avatar_updated_at", :datetime + end + + def self.down + remove_column :users, "avatar_file_name" + remove_column :users, "avatar_content_type" + remove_column :users, "avatar_file_size" + remove_column :users, "avatar_updated_at" + end +end diff --git a/db/migrate/20160328222159_add_groups_to_users.rb b/db/migrate/20160328222159_add_groups_to_users.rb new file mode 100644 index 000000000..2cb388767 --- /dev/null +++ b/db/migrate/20160328222159_add_groups_to_users.rb @@ -0,0 +1,11 @@ +class AddGroupsToUsers < ActiveRecord::Migration + def self.up + add_column :users, :group_list, :text + add_column :users, :groups_last_update, :datetime + end + + def self.down + remove_column :users, :group_list + remove_column :users, :groups_last_update + end +end diff --git a/db/migrate/20160328222160_create_local_authorities.rb b/db/migrate/20160328222160_create_local_authorities.rb new file mode 100644 index 000000000..490a45c28 --- /dev/null +++ b/db/migrate/20160328222160_create_local_authorities.rb @@ -0,0 +1,50 @@ +class CreateLocalAuthorities < ActiveRecord::Migration + def self.up + create_table :local_authority_entries, force: true do |t| + t.integer :local_authority_id + t.string :label + t.string :uri + end + + create_table :local_authorities, force: true do |t| + t.string :name, unique: true + end + + create_table :domain_terms, force: true do |t| + t.string :model + t.string :term + end + + create_table :domain_terms_local_authorities, id: false do |t| + t.integer :domain_term_id, foreign_key: true + t.integer :local_authority_id, foreign_key: true + end + + create_table :subject_local_authority_entries, force: true do |t| + t.string :label + t.string :lowerLabel + t.string :url + end + + add_index :local_authority_entries, [:local_authority_id, :label], name: 'entries_by_term_and_label' + add_index :local_authority_entries, [:local_authority_id, :uri], name: 'entries_by_term_and_uri' + add_index :domain_terms, [:model, :term], name: 'terms_by_model_and_term' + add_index :domain_terms_local_authorities, [:local_authority_id, :domain_term_id], name: 'dtla_by_ids1' + add_index :domain_terms_local_authorities, [:domain_term_id, :local_authority_id], name: 'dtla_by_ids2' + add_index :subject_local_authority_entries, [:lowerLabel], name: 'entries_by_lower_label' + end + + def self.down + drop_table :local_authority_entries + drop_table :local_authorities + drop_table :domain_terms + drop_table :domain_terms_local_authorities + drop_table :subject_local_authority_entries + remove_index :local_authority_entries, name: "entries_by_term_and_label" + remove_index :local_authority_entries, name: "entries_by_term_and_uri" + remove_index :domain_terms, name: "terms_by_model_and_term" + remove_index :subject_local_authority_entries, name: 'entries_by_lower_label' + remove_index :domain_terms_local_authorities, name: 'dtla_by_ids1' + remove_index :domain_terms_local_authorities, name: 'dtla_by_ids2' + end +end diff --git a/db/migrate/20160328222161_create_trophies.rb b/db/migrate/20160328222161_create_trophies.rb new file mode 100644 index 000000000..9dfc3747a --- /dev/null +++ b/db/migrate/20160328222161_create_trophies.rb @@ -0,0 +1,10 @@ +class CreateTrophies < ActiveRecord::Migration + def change + create_table :trophies do |t| + t.integer :user_id + t.string :generic_file_id + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20160328222162_add_linkedin_to_users.rb b/db/migrate/20160328222162_add_linkedin_to_users.rb new file mode 100644 index 000000000..0f8ddf876 --- /dev/null +++ b/db/migrate/20160328222162_add_linkedin_to_users.rb @@ -0,0 +1,5 @@ +class AddLinkedinToUsers < ActiveRecord::Migration + def change + add_column :users, :linkedin_handle, :string + end +end diff --git a/db/migrate/20160328222163_create_tinymce_assets.rb b/db/migrate/20160328222163_create_tinymce_assets.rb new file mode 100644 index 000000000..fca16466e --- /dev/null +++ b/db/migrate/20160328222163_create_tinymce_assets.rb @@ -0,0 +1,8 @@ +class CreateTinymceAssets < ActiveRecord::Migration + def change + create_table :tinymce_assets do |t| + t.string :file + t.timestamps null: false + end + end +end diff --git a/db/migrate/20160328222164_create_content_blocks.rb b/db/migrate/20160328222164_create_content_blocks.rb new file mode 100644 index 000000000..1b4eac2fc --- /dev/null +++ b/db/migrate/20160328222164_create_content_blocks.rb @@ -0,0 +1,10 @@ +class CreateContentBlocks < ActiveRecord::Migration + def change + create_table :content_blocks do |t| + t.string :name + t.text :value + t.timestamps null: false + end + add_index :content_blocks, :name, unique: true + end +end diff --git a/db/migrate/20160328222165_create_featured_works.rb b/db/migrate/20160328222165_create_featured_works.rb new file mode 100644 index 000000000..60aaf53e8 --- /dev/null +++ b/db/migrate/20160328222165_create_featured_works.rb @@ -0,0 +1,12 @@ +class CreateFeaturedWorks < ActiveRecord::Migration + def change + create_table :featured_works do |t| + t.integer :order, default: 5 + t.string :generic_work_id + + t.timestamps null: false + end + add_index :featured_works, :generic_work_id + add_index :featured_works, :order + end +end diff --git a/db/migrate/20160328222166_add_external_key_to_content_blocks.rb b/db/migrate/20160328222166_add_external_key_to_content_blocks.rb new file mode 100644 index 000000000..4fc7b0632 --- /dev/null +++ b/db/migrate/20160328222166_add_external_key_to_content_blocks.rb @@ -0,0 +1,6 @@ +class AddExternalKeyToContentBlocks < ActiveRecord::Migration + def change + add_column :content_blocks, :external_key, :string + remove_index :content_blocks, :name + end +end diff --git a/db/migrate/20160328222223_create_mailboxer.mailboxer_engine.rb b/db/migrate/20160328222223_create_mailboxer.mailboxer_engine.rb new file mode 100644 index 000000000..f1153f82e --- /dev/null +++ b/db/migrate/20160328222223_create_mailboxer.mailboxer_engine.rb @@ -0,0 +1,66 @@ +# This migration comes from mailboxer_engine (originally 20110511145103) +class CreateMailboxer < ActiveRecord::Migration + def self.up + #Tables + #Conversations + create_table :mailboxer_conversations do |t| + t.column :subject, :string, :default => "" + t.column :created_at, :datetime, :null => false + t.column :updated_at, :datetime, :null => false + end + #Receipts + create_table :mailboxer_receipts do |t| + t.references :receiver, :polymorphic => true + t.column :notification_id, :integer, :null => false + t.column :is_read, :boolean, :default => false + t.column :trashed, :boolean, :default => false + t.column :deleted, :boolean, :default => false + t.column :mailbox_type, :string, :limit => 25 + t.column :created_at, :datetime, :null => false + t.column :updated_at, :datetime, :null => false + end + #Notifications and Messages + create_table :mailboxer_notifications do |t| + t.column :type, :string + t.column :body, :text + t.column :subject, :string, :default => "" + t.references :sender, :polymorphic => true + t.column :conversation_id, :integer + t.column :draft, :boolean, :default => false + t.string :notification_code, :default => nil + t.references :notified_object, :polymorphic => true + t.column :attachment, :string + t.column :updated_at, :datetime, :null => false + t.column :created_at, :datetime, :null => false + t.boolean :global, default: false + t.datetime :expires + end + + + #Indexes + #Conversations + #Receipts + add_index "mailboxer_receipts","notification_id" + + #Messages + add_index "mailboxer_notifications","conversation_id" + + #Foreign keys + #Conversations + #Receipts + add_foreign_key "mailboxer_receipts", "mailboxer_notifications", :name => "receipts_on_notification_id", :column => "notification_id" + #Messages + add_foreign_key "mailboxer_notifications", "mailboxer_conversations", :name => "notifications_on_conversation_id", :column => "conversation_id" + end + + def self.down + #Tables + remove_foreign_key "mailboxer_receipts", :name => "receipts_on_notification_id" + remove_foreign_key "mailboxer_notifications", :name => "notifications_on_conversation_id" + + #Indexes + drop_table :mailboxer_receipts + drop_table :mailboxer_conversations + drop_table :mailboxer_notifications + end +end diff --git a/db/migrate/20160328222224_add_conversation_optout.mailboxer_engine.rb b/db/migrate/20160328222224_add_conversation_optout.mailboxer_engine.rb new file mode 100644 index 000000000..c4f4555a4 --- /dev/null +++ b/db/migrate/20160328222224_add_conversation_optout.mailboxer_engine.rb @@ -0,0 +1,15 @@ +# This migration comes from mailboxer_engine (originally 20131206080416) +class AddConversationOptout < ActiveRecord::Migration + def self.up + create_table :mailboxer_conversation_opt_outs do |t| + t.references :unsubscriber, :polymorphic => true + t.references :conversation + end + add_foreign_key "mailboxer_conversation_opt_outs", "mailboxer_conversations", :name => "mb_opt_outs_on_conversations_id", :column => "conversation_id" + end + + def self.down + remove_foreign_key "mailboxer_conversation_opt_outs", :name => "mb_opt_outs_on_conversations_id" + drop_table :mailboxer_conversation_opt_outs + end +end diff --git a/db/migrate/20160328222225_add_missing_indices.mailboxer_engine.rb b/db/migrate/20160328222225_add_missing_indices.mailboxer_engine.rb new file mode 100644 index 000000000..fde967187 --- /dev/null +++ b/db/migrate/20160328222225_add_missing_indices.mailboxer_engine.rb @@ -0,0 +1,20 @@ +# This migration comes from mailboxer_engine (originally 20131206080417) +class AddMissingIndices < ActiveRecord::Migration + def change + # We'll explicitly specify its name, as the auto-generated name is too long and exceeds 63 + # characters limitation. + add_index :mailboxer_conversation_opt_outs, [:unsubscriber_id, :unsubscriber_type], + name: 'index_mailboxer_conversation_opt_outs_on_unsubscriber_id_type' + add_index :mailboxer_conversation_opt_outs, :conversation_id + + add_index :mailboxer_notifications, :type + add_index :mailboxer_notifications, [:sender_id, :sender_type] + + # We'll explicitly specify its name, as the auto-generated name is too long and exceeds 63 + # characters limitation. + add_index :mailboxer_notifications, [:notified_object_id, :notified_object_type], + name: 'index_mailboxer_notifications_on_notified_object_id_and_type' + + add_index :mailboxer_receipts, [:receiver_id, :receiver_type] + end +end diff --git a/db/migrate/20160328222226_create_proxy_deposit_rights.rb b/db/migrate/20160328222226_create_proxy_deposit_rights.rb new file mode 100644 index 000000000..7dc249358 --- /dev/null +++ b/db/migrate/20160328222226_create_proxy_deposit_rights.rb @@ -0,0 +1,11 @@ +class CreateProxyDepositRights < ActiveRecord::Migration + def change + create_table :proxy_deposit_rights do |t| + t.references :grantor + t.references :grantee + t.timestamps null: false + end + add_index :proxy_deposit_rights, :grantor_id + add_index :proxy_deposit_rights, :grantee_id + end +end diff --git a/db/migrate/20160328222227_create_proxy_deposit_requests.rb b/db/migrate/20160328222227_create_proxy_deposit_requests.rb new file mode 100644 index 000000000..d61cb0ce0 --- /dev/null +++ b/db/migrate/20160328222227_create_proxy_deposit_requests.rb @@ -0,0 +1,16 @@ +class CreateProxyDepositRequests < ActiveRecord::Migration + def change + create_table :proxy_deposit_requests do |t| + t.string :pid, null: false + t.references :sending_user, null: false + t.references :receiving_user, null: false + t.datetime :fulfillment_date + t.string :status, null: false, default: 'pending' + t.text :sender_comment + t.text :receiver_comment + t.timestamps null: false + end + add_index :proxy_deposit_requests, :receiving_user_id + add_index :proxy_deposit_requests, :sending_user_id + end +end diff --git a/db/migrate/20160328222228_create_file_view_stats.rb b/db/migrate/20160328222228_create_file_view_stats.rb new file mode 100644 index 000000000..97c173e87 --- /dev/null +++ b/db/migrate/20160328222228_create_file_view_stats.rb @@ -0,0 +1,12 @@ +class CreateFileViewStats < ActiveRecord::Migration + def change + create_table :file_view_stats do |t| + t.datetime :date + t.integer :views + t.string :file_id + + t.timestamps null: false + end + add_index :file_view_stats, :file_id + end +end diff --git a/db/migrate/20160328222229_create_file_download_stats.rb b/db/migrate/20160328222229_create_file_download_stats.rb new file mode 100644 index 000000000..0466a3fd4 --- /dev/null +++ b/db/migrate/20160328222229_create_file_download_stats.rb @@ -0,0 +1,12 @@ +class CreateFileDownloadStats < ActiveRecord::Migration + def change + create_table :file_download_stats do |t| + t.datetime :date + t.integer :downloads + t.string :file_id + + t.timestamps null: false + end + add_index :file_download_stats, :file_id + end +end diff --git a/db/migrate/20160328222230_add_orcid_to_users.rb b/db/migrate/20160328222230_add_orcid_to_users.rb new file mode 100644 index 000000000..449a9f2bf --- /dev/null +++ b/db/migrate/20160328222230_add_orcid_to_users.rb @@ -0,0 +1,5 @@ +class AddOrcidToUsers < ActiveRecord::Migration + def change + add_column :users, :orcid, :string + end +end diff --git a/db/migrate/20160328222231_create_user_stats.rb b/db/migrate/20160328222231_create_user_stats.rb new file mode 100644 index 000000000..c567455c0 --- /dev/null +++ b/db/migrate/20160328222231_create_user_stats.rb @@ -0,0 +1,19 @@ +class CreateUserStats < ActiveRecord::Migration + def change + create_table :user_stats do |t| + t.integer :user_id + t.datetime :date + t.integer :file_views + t.integer :file_downloads + + t.timestamps null: false + end + + add_column :file_view_stats, :user_id, :integer + add_column :file_download_stats, :user_id, :integer + + add_index :user_stats, :user_id + add_index :file_view_stats, :user_id + add_index :file_download_stats, :user_id + end +end diff --git a/db/migrate/20160328222232_create_work_view_stats.rb b/db/migrate/20160328222232_create_work_view_stats.rb new file mode 100644 index 000000000..a4e6db560 --- /dev/null +++ b/db/migrate/20160328222232_create_work_view_stats.rb @@ -0,0 +1,12 @@ +class CreateWorkViewStats < ActiveRecord::Migration + def change + create_table :work_view_stats do |t| + t.datetime :date + t.integer :work_views + t.string :work_id + + t.timestamps null: false + end + add_index :work_view_stats, :work_id + end +end diff --git a/db/migrate/20160328222233_add_works_to_user_stats.rb b/db/migrate/20160328222233_add_works_to_user_stats.rb new file mode 100644 index 000000000..b3b61e6e6 --- /dev/null +++ b/db/migrate/20160328222233_add_works_to_user_stats.rb @@ -0,0 +1,13 @@ +class AddWorksToUserStats < ActiveRecord::Migration + def self.up + add_column :user_stats, :work_views, :integer + add_column :work_view_stats, :user_id, :integer + add_index :work_view_stats, :user_id + end + + def self.down + remove_column :user_stats, :work_views, :integer + remove_column :work_view_stats, :user_id, :integer + remove_index :work_view_stats, :user_id + end +end diff --git a/db/migrate/20160328222234_change_audit_log_pid_to_generic_file_id.rb b/db/migrate/20160328222234_change_audit_log_pid_to_generic_file_id.rb new file mode 100644 index 000000000..dda250179 --- /dev/null +++ b/db/migrate/20160328222234_change_audit_log_pid_to_generic_file_id.rb @@ -0,0 +1,5 @@ +class ChangeAuditLogPidToGenericFileId < ActiveRecord::Migration + def change + rename_column :checksum_audit_logs, :pid, :generic_file_id if ChecksumAuditLog.column_names.include?('pid') + end +end diff --git a/db/migrate/20160328222235_change_proxy_deposit_request_pid_to_generic_file_id.rb b/db/migrate/20160328222235_change_proxy_deposit_request_pid_to_generic_file_id.rb new file mode 100644 index 000000000..cff715860 --- /dev/null +++ b/db/migrate/20160328222235_change_proxy_deposit_request_pid_to_generic_file_id.rb @@ -0,0 +1,5 @@ +class ChangeProxyDepositRequestPidToGenericFileId < ActiveRecord::Migration + def change + rename_column :proxy_deposit_requests, :pid, :generic_file_id + end +end diff --git a/db/migrate/20160328222236_change_trophy_generic_file_id_to_generic_work_id.rb b/db/migrate/20160328222236_change_trophy_generic_file_id_to_generic_work_id.rb new file mode 100644 index 000000000..c7f3671e5 --- /dev/null +++ b/db/migrate/20160328222236_change_trophy_generic_file_id_to_generic_work_id.rb @@ -0,0 +1,5 @@ +class ChangeTrophyGenericFileIdToGenericWorkId < ActiveRecord::Migration + def change + rename_column :trophies, :generic_file_id, :generic_work_id + end +end diff --git a/db/migrate/20160328222237_change_proxy_deposit_generic_file_id_to_generic_work_id.rb b/db/migrate/20160328222237_change_proxy_deposit_generic_file_id_to_generic_work_id.rb new file mode 100644 index 000000000..a45630997 --- /dev/null +++ b/db/migrate/20160328222237_change_proxy_deposit_generic_file_id_to_generic_work_id.rb @@ -0,0 +1,5 @@ +class ChangeProxyDepositGenericFileIdToGenericWorkId < ActiveRecord::Migration + def change + rename_column :proxy_deposit_requests, :generic_file_id, :generic_work_id + end +end diff --git a/db/migrate/20160328222238_change_audit_log_generic_file_id_to_file_set_id.rb b/db/migrate/20160328222238_change_audit_log_generic_file_id_to_file_set_id.rb new file mode 100644 index 000000000..eef27229b --- /dev/null +++ b/db/migrate/20160328222238_change_audit_log_generic_file_id_to_file_set_id.rb @@ -0,0 +1,5 @@ +class ChangeAuditLogGenericFileIdToFileSetId < ActiveRecord::Migration + def change + rename_column :checksum_audit_logs, :generic_file_id, :file_set_id unless ChecksumAuditLog.column_names.include?('file_set_id') + end +end diff --git a/db/migrate/20160328222239_change_proxy_deposit_request_generic_file_id_to_generic_work_id.rb b/db/migrate/20160328222239_change_proxy_deposit_request_generic_file_id_to_generic_work_id.rb new file mode 100644 index 000000000..95011f756 --- /dev/null +++ b/db/migrate/20160328222239_change_proxy_deposit_request_generic_file_id_to_generic_work_id.rb @@ -0,0 +1,5 @@ +class ChangeProxyDepositRequestGenericFileIdToGenericWorkId < ActiveRecord::Migration + def change + rename_column :proxy_deposit_requests, :generic_file_id, :generic_work_id if ProxyDepositRequest.column_names.include?('generic_file_id') + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 000000000..bb1d2d977 --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,315 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20160328222239) do + + create_table "bookmarks", force: :cascade do |t| + t.integer "user_id", null: false + t.string "user_type" + t.string "document_id" + t.string "title" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "document_type" + end + + add_index "bookmarks", ["user_id"], name: "index_bookmarks_on_user_id" + + create_table "checksum_audit_logs", force: :cascade do |t| + t.string "file_set_id" + t.string "file_id" + t.string "version" + t.integer "pass" + t.string "expected_result" + t.string "actual_result" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "checksum_audit_logs", ["file_set_id", "file_id"], name: "by_file_set_id_and_file_id" + + create_table "content_blocks", force: :cascade do |t| + t.string "name" + t.text "value" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "external_key" + end + + create_table "domain_terms", force: :cascade do |t| + t.string "model" + t.string "term" + end + + add_index "domain_terms", ["model", "term"], name: "terms_by_model_and_term" + + create_table "domain_terms_local_authorities", id: false, force: :cascade do |t| + t.integer "domain_term_id" + t.integer "local_authority_id" + end + + add_index "domain_terms_local_authorities", ["domain_term_id", "local_authority_id"], name: "dtla_by_ids2" + add_index "domain_terms_local_authorities", ["local_authority_id", "domain_term_id"], name: "dtla_by_ids1" + + create_table "featured_works", force: :cascade do |t| + t.integer "order", default: 5 + t.string "generic_work_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "featured_works", ["generic_work_id"], name: "index_featured_works_on_generic_work_id" + add_index "featured_works", ["order"], name: "index_featured_works_on_order" + + create_table "file_download_stats", force: :cascade do |t| + t.datetime "date" + t.integer "downloads" + t.string "file_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "user_id" + end + + add_index "file_download_stats", ["file_id"], name: "index_file_download_stats_on_file_id" + add_index "file_download_stats", ["user_id"], name: "index_file_download_stats_on_user_id" + + create_table "file_view_stats", force: :cascade do |t| + t.datetime "date" + t.integer "views" + t.string "file_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "user_id" + end + + add_index "file_view_stats", ["file_id"], name: "index_file_view_stats_on_file_id" + add_index "file_view_stats", ["user_id"], name: "index_file_view_stats_on_user_id" + + create_table "follows", force: :cascade do |t| + t.integer "followable_id", null: false + t.string "followable_type", null: false + t.integer "follower_id", null: false + t.string "follower_type", null: false + t.boolean "blocked", default: false, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "follows", ["followable_id", "followable_type"], name: "fk_followables" + add_index "follows", ["follower_id", "follower_type"], name: "fk_follows" + + create_table "local_authorities", force: :cascade do |t| + t.string "name" + end + + create_table "local_authority_entries", force: :cascade do |t| + t.integer "local_authority_id" + t.string "label" + t.string "uri" + end + + add_index "local_authority_entries", ["local_authority_id", "label"], name: "entries_by_term_and_label" + add_index "local_authority_entries", ["local_authority_id", "uri"], name: "entries_by_term_and_uri" + + create_table "mailboxer_conversation_opt_outs", force: :cascade do |t| + t.integer "unsubscriber_id" + t.string "unsubscriber_type" + t.integer "conversation_id" + end + + add_index "mailboxer_conversation_opt_outs", ["conversation_id"], name: "index_mailboxer_conversation_opt_outs_on_conversation_id" + add_index "mailboxer_conversation_opt_outs", ["unsubscriber_id", "unsubscriber_type"], name: "index_mailboxer_conversation_opt_outs_on_unsubscriber_id_type" + + create_table "mailboxer_conversations", force: :cascade do |t| + t.string "subject", default: "" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "mailboxer_notifications", force: :cascade do |t| + t.string "type" + t.text "body" + t.string "subject", default: "" + t.integer "sender_id" + t.string "sender_type" + t.integer "conversation_id" + t.boolean "draft", default: false + t.string "notification_code" + t.integer "notified_object_id" + t.string "notified_object_type" + t.string "attachment" + t.datetime "updated_at", null: false + t.datetime "created_at", null: false + t.boolean "global", default: false + t.datetime "expires" + end + + add_index "mailboxer_notifications", ["conversation_id"], name: "index_mailboxer_notifications_on_conversation_id" + add_index "mailboxer_notifications", ["notified_object_id", "notified_object_type"], name: "index_mailboxer_notifications_on_notified_object_id_and_type" + add_index "mailboxer_notifications", ["sender_id", "sender_type"], name: "index_mailboxer_notifications_on_sender_id_and_sender_type" + add_index "mailboxer_notifications", ["type"], name: "index_mailboxer_notifications_on_type" + + create_table "mailboxer_receipts", force: :cascade do |t| + t.integer "receiver_id" + t.string "receiver_type" + t.integer "notification_id", null: false + t.boolean "is_read", default: false + t.boolean "trashed", default: false + t.boolean "deleted", default: false + t.string "mailbox_type", limit: 25 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "mailboxer_receipts", ["notification_id"], name: "index_mailboxer_receipts_on_notification_id" + add_index "mailboxer_receipts", ["receiver_id", "receiver_type"], name: "index_mailboxer_receipts_on_receiver_id_and_receiver_type" + + create_table "proxy_deposit_requests", force: :cascade do |t| + t.string "generic_work_id", null: false + t.integer "sending_user_id", null: false + t.integer "receiving_user_id", null: false + t.datetime "fulfillment_date" + t.string "status", default: "pending", null: false + t.text "sender_comment" + t.text "receiver_comment" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "proxy_deposit_requests", ["receiving_user_id"], name: "index_proxy_deposit_requests_on_receiving_user_id" + add_index "proxy_deposit_requests", ["sending_user_id"], name: "index_proxy_deposit_requests_on_sending_user_id" + + create_table "proxy_deposit_rights", force: :cascade do |t| + t.integer "grantor_id" + t.integer "grantee_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "proxy_deposit_rights", ["grantee_id"], name: "index_proxy_deposit_rights_on_grantee_id" + add_index "proxy_deposit_rights", ["grantor_id"], name: "index_proxy_deposit_rights_on_grantor_id" + + create_table "searches", force: :cascade do |t| + t.text "query_params" + t.integer "user_id" + t.string "user_type" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "searches", ["user_id"], name: "index_searches_on_user_id" + + create_table "single_use_links", force: :cascade do |t| + t.string "downloadKey" + t.string "path" + t.string "itemId" + t.datetime "expires" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "subject_local_authority_entries", force: :cascade do |t| + t.string "label" + t.string "lowerLabel" + t.string "url" + end + + add_index "subject_local_authority_entries", ["lowerLabel"], name: "entries_by_lower_label" + + create_table "tinymce_assets", force: :cascade do |t| + t.string "file" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "trophies", force: :cascade do |t| + t.integer "user_id" + t.string "generic_work_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "user_stats", force: :cascade do |t| + t.integer "user_id" + t.datetime "date" + t.integer "file_views" + t.integer "file_downloads" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "work_views" + end + + add_index "user_stats", ["user_id"], name: "index_user_stats_on_user_id" + + create_table "users", force: :cascade do |t| + t.string "email", default: "", null: false + t.string "encrypted_password", default: "", null: false + t.string "reset_password_token" + t.datetime "reset_password_sent_at" + t.datetime "remember_created_at" + t.integer "sign_in_count", default: 0, null: false + t.datetime "current_sign_in_at" + t.datetime "last_sign_in_at" + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "guest", default: false + t.string "facebook_handle" + t.string "twitter_handle" + t.string "googleplus_handle" + t.string "display_name" + t.string "address" + t.string "admin_area" + t.string "department" + t.string "title" + t.string "office" + t.string "chat_id" + t.string "website" + t.string "affiliation" + t.string "telephone" + t.string "avatar_file_name" + t.string "avatar_content_type" + t.integer "avatar_file_size" + t.datetime "avatar_updated_at" + t.text "group_list" + t.datetime "groups_last_update" + t.string "linkedin_handle" + t.string "orcid" + end + + add_index "users", ["email"], name: "index_users_on_email", unique: true + add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true + + create_table "version_committers", force: :cascade do |t| + t.string "obj_id" + t.string "datastream_id" + t.string "version_id" + t.string "committer_login" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "work_view_stats", force: :cascade do |t| + t.datetime "date" + t.integer "work_views" + t.string "work_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "user_id" + end + + add_index "work_view_stats", ["user_id"], name: "index_work_view_stats_on_user_id" + add_index "work_view_stats", ["work_id"], name: "index_work_view_stats_on_work_id" + +end diff --git a/solr/config/_rest_managed.json b/solr/config/_rest_managed.json new file mode 100644 index 000000000..e7ada3f6e --- /dev/null +++ b/solr/config/_rest_managed.json @@ -0,0 +1,3 @@ +{ + "initArgs":{}, + "managedList":[]} \ No newline at end of file diff --git a/solr/config/admin-extra.html b/solr/config/admin-extra.html new file mode 100644 index 000000000..21b50901c --- /dev/null +++ b/solr/config/admin-extra.html @@ -0,0 +1,31 @@ + + + diff --git a/solr/config/elevate.xml b/solr/config/elevate.xml new file mode 100644 index 000000000..b91e75cec --- /dev/null +++ b/solr/config/elevate.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + diff --git a/solr/config/mapping-ISOLatin1Accent.txt b/solr/config/mapping-ISOLatin1Accent.txt new file mode 100644 index 000000000..186ca313d --- /dev/null +++ b/solr/config/mapping-ISOLatin1Accent.txt @@ -0,0 +1,246 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Syntax: +# "source" => "target" +# "source".length() > 0 (source cannot be empty.) +# "target".length() >= 0 (target can be empty.) + +# example: +# "??" => "A" +# "\u00C0" => "A" +# "\u00C0" => "\u0041" +# "??" => "ss" +# "\t" => " " +# "\n" => "" + +# ?? => A +"\u00C0" => "A" + +# ?? => A +"\u00C1" => "A" + +# ?? => A +"\u00C2" => "A" + +# ?? => A +"\u00C3" => "A" + +# ?? => A +"\u00C4" => "A" + +# ?? => A +"\u00C5" => "A" + +# ?? => AE +"\u00C6" => "AE" + +# ?? => C +"\u00C7" => "C" + +# ?? => E +"\u00C8" => "E" + +# ?? => E +"\u00C9" => "E" + +# ?? => E +"\u00CA" => "E" + +# ?? => E +"\u00CB" => "E" + +# ?? => I +"\u00CC" => "I" + +# ?? => I +"\u00CD" => "I" + +# ?? => I +"\u00CE" => "I" + +# ?? => I +"\u00CF" => "I" + +# ?? => IJ +"\u0132" => "IJ" + +# ?? => D +"\u00D0" => "D" + +# ?? => N +"\u00D1" => "N" + +# ?? => O +"\u00D2" => "O" + +# ?? => O +"\u00D3" => "O" + +# ?? => O +"\u00D4" => "O" + +# ?? => O +"\u00D5" => "O" + +# ?? => O +"\u00D6" => "O" + +# ?? => O +"\u00D8" => "O" + +# ?? => OE +"\u0152" => "OE" + +# ?? +"\u00DE" => "TH" + +# ?? => U +"\u00D9" => "U" + +# ?? => U +"\u00DA" => "U" + +# ?? => U +"\u00DB" => "U" + +# ?? => U +"\u00DC" => "U" + +# ?? => Y +"\u00DD" => "Y" + +# ?? => Y +"\u0178" => "Y" + +# ?? => a +"\u00E0" => "a" + +# ?? => a +"\u00E1" => "a" + +# ?? => a +"\u00E2" => "a" + +# ?? => a +"\u00E3" => "a" + +# ?? => a +"\u00E4" => "a" + +# ?? => a +"\u00E5" => "a" + +# ?? => ae +"\u00E6" => "ae" + +# ?? => c +"\u00E7" => "c" + +# ?? => e +"\u00E8" => "e" + +# ?? => e +"\u00E9" => "e" + +# ?? => e +"\u00EA" => "e" + +# ?? => e +"\u00EB" => "e" + +# ?? => i +"\u00EC" => "i" + +# ?? => i +"\u00ED" => "i" + +# ?? => i +"\u00EE" => "i" + +# ?? => i +"\u00EF" => "i" + +# ?? => ij +"\u0133" => "ij" + +# ?? => d +"\u00F0" => "d" + +# ?? => n +"\u00F1" => "n" + +# ?? => o +"\u00F2" => "o" + +# ?? => o +"\u00F3" => "o" + +# ?? => o +"\u00F4" => "o" + +# ?? => o +"\u00F5" => "o" + +# ?? => o +"\u00F6" => "o" + +# ?? => o +"\u00F8" => "o" + +# ?? => oe +"\u0153" => "oe" + +# ?? => ss +"\u00DF" => "ss" + +# ?? => th +"\u00FE" => "th" + +# ?? => u +"\u00F9" => "u" + +# ?? => u +"\u00FA" => "u" + +# ?? => u +"\u00FB" => "u" + +# ?? => u +"\u00FC" => "u" + +# ?? => y +"\u00FD" => "y" + +# ?? => y +"\u00FF" => "y" + +# ??? => ff +"\uFB00" => "ff" + +# ??? => fi +"\uFB01" => "fi" + +# ??? => fl +"\uFB02" => "fl" + +# ??? => ffi +"\uFB03" => "ffi" + +# ??? => ffl +"\uFB04" => "ffl" + +# ??? => ft +"\uFB05" => "ft" + +# ??? => st +"\uFB06" => "st" diff --git a/solr/config/protwords.txt b/solr/config/protwords.txt new file mode 100644 index 000000000..5a32e5032 --- /dev/null +++ b/solr/config/protwords.txt @@ -0,0 +1,21 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# Use a protected word file to protect against the stemmer reducing two +# unrelated words to the same base word. + +# Some non-words that normally won't be encountered, +# just to test that they won't be stemmed. +dontstems +zwhacky + diff --git a/solr/config/schema.xml b/solr/config/schema.xml new file mode 100644 index 000000000..9fa17a9d0 --- /dev/null +++ b/solr/config/schema.xml @@ -0,0 +1,372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + + + + + + + + + + + + + + + + + + + + + + + diff --git a/solr/config/scripts.conf b/solr/config/scripts.conf new file mode 100644 index 000000000..f58b262ae --- /dev/null +++ b/solr/config/scripts.conf @@ -0,0 +1,24 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +user= +solr_hostname=localhost +solr_port=8983 +rsyncd_port=18983 +data_dir= +webapp_name=solr +master_host= +master_data_dir= +master_status_dir= diff --git a/solr/config/solrconfig.xml b/solr/config/solrconfig.xml new file mode 100644 index 000000000..9de12a0ad --- /dev/null +++ b/solr/config/solrconfig.xml @@ -0,0 +1,312 @@ + + + + + + + + 5.0.0 + + + + + + + + + + + + + + + ${solr.blacklight-core.data.dir:} + + + + + + + + + + *:* + + + + + ${solr.ulog.dir:} + + + + ${solr.autoCommit.maxTime:15000} + false + + + + ${solr.autoSoftCommit.maxTime:-1} + + + + + + + + edismax + explicit + *:* + 2<-1 5<-2 6<90% + 1 + 2 + 0.01 + + + id + active_fedora_model_ssi + title_tesim + author_tesim + subject_tesim + + + all_text_timv^10 + + + + author_tesim + + + + + title_tesim + + + + + subject_tesim + + + + + + *, + score + + + true + 1 + + true + default + true + true + false + 5 + + + + spellcheck + + + + + + off + all + 1 + {!raw f=id v=$id} + + id, + access_ssim, + discover_access_group_ssim,discover_access_person_ssim, + read_access_group_ssim,read_access_person_ssim, + edit_access_group_ssim,edit_access_person_ssim, + depositor_ti, + embargo_release_date_dtsi + inheritable_access_ssim, + inheritable_discover_access_group_ssim,inheritable_discover_access_person_ssim, + inheritable_read_access_group_ssim,inheritable_read_access_person_ssim, + inheritable_edit_access_group_ssim,inheritable_edit_access_person_ssim, + inheritable_embargo_release_date_dtsi + + + + + + + explicit + lucene + + + + + + + all + * + 1 + {!term f=id v=$id} + + + + + + + textSpell + + + + + + default + spell + ./spell + true + + + author + author_spell + ./spell_author + 0.7 + true + + + subject + subject_spell + ./spell_subject + 0.7 + true + + + title + title_spell + ./spell_title + 0.7 + true + + + + + + + + + + + + + + + mySuggester + FuzzyLookupFactory + textSuggest + true + suggest + + + + + + true + 5 + mySuggester + + + suggest + + + + + + last_modified + ignored_ + + + + + + + + + + diff --git a/solr/config/spellings.txt b/solr/config/spellings.txt new file mode 100644 index 000000000..765190ae5 --- /dev/null +++ b/solr/config/spellings.txt @@ -0,0 +1,2 @@ +pizza +history diff --git a/solr/config/stopwords.txt b/solr/config/stopwords.txt new file mode 100644 index 000000000..22f277fe0 --- /dev/null +++ b/solr/config/stopwords.txt @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# a couple of test stopwords to test that the words are really being +# configured from this file: +stopworda +stopwordb + +#Standard english stop words taken from Lucene's StopAnalyzer +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +s +such +t +that +the +their +then +there +these +they +this +to +was +will +with + diff --git a/solr/config/stopwords_en.txt b/solr/config/stopwords_en.txt new file mode 100644 index 000000000..22f277fe0 --- /dev/null +++ b/solr/config/stopwords_en.txt @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# a couple of test stopwords to test that the words are really being +# configured from this file: +stopworda +stopwordb + +#Standard english stop words taken from Lucene's StopAnalyzer +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +s +such +t +that +the +their +then +there +these +they +this +to +was +will +with + diff --git a/solr/config/synonyms.txt b/solr/config/synonyms.txt new file mode 100644 index 000000000..453eb3139 --- /dev/null +++ b/solr/config/synonyms.txt @@ -0,0 +1,31 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +#some test synonym mappings unlikely to appear in real input text +aaa => aaaa +bbb => bbbb1 bbbb2 +ccc => cccc1,cccc2 +a\=>a => b\=>b +a\,a => b\,b +fooaaa,baraaa,bazaaa + +# Some synonym groups specific to this example +GB,gib,gigabyte,gigabytes +MB,mib,megabyte,megabytes +Television, Televisions, TV, TVs +#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming +#after us won't split it into two words. + +# Synonym mappings can be used for spelling correction too +pixima => pixma + diff --git a/solr/config/xslt/example.xsl b/solr/config/xslt/example.xsl new file mode 100644 index 000000000..ff7cae746 --- /dev/null +++ b/solr/config/xslt/example.xsl @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + <xsl:value-of select="$title"/> + + + +

+
+ This has been formatted by the sample "example.xsl" transform - + use your own XSLT to get a nicer page +
+ + + +
+ + + +
+ + + + +
+
+
+ + + + + + + + + + + + + + javascript:toggle("");? +
+ + exp + + + + + +
+ + +
+ + + + + + + +
    + +
  • +
    +
+ + +
+ + + + + + + + + + + + + + + + + + + + +
diff --git a/solr/config/xslt/example_atom.xsl b/solr/config/xslt/example_atom.xsl new file mode 100644 index 000000000..dbc7afa3b --- /dev/null +++ b/solr/config/xslt/example_atom.xsl @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + Example Solr Atom 1.0 Feed + + This has been formatted by the sample "example_atom.xsl" transform - + use your own XSLT to get a nicer Atom feed. + + + Apache Solr + solr-user@lucene.apache.org + + + + + + tag:localhost,2007:example + + + + + + + + + <xsl:value-of select="str[@name='name']"/> + + tag:localhost,2007: + + + + + + diff --git a/solr/config/xslt/example_rss.xsl b/solr/config/xslt/example_rss.xsl new file mode 100644 index 000000000..b5bd0cf9f --- /dev/null +++ b/solr/config/xslt/example_rss.xsl @@ -0,0 +1,66 @@ + + + + + + + + + + + + + Example Solr RSS 2.0 Feed + http://localhost:8983/solr + + This has been formatted by the sample "example_rss.xsl" transform - + use your own XSLT to get a nicer RSS feed. + + en-us + http://localhost:8983/solr + + + + + + + + + + + <xsl:value-of select="str[@name='name']"/> + + http://localhost:8983/solr/select?q=id: + + + + + + + http://localhost:8983/solr/select?q=id: + + + + diff --git a/solr/config/xslt/luke.xsl b/solr/config/xslt/luke.xsl new file mode 100644 index 000000000..d3f71c6d8 --- /dev/null +++ b/solr/config/xslt/luke.xsl @@ -0,0 +1,337 @@ + + + + + + + + + Solr Luke Request Handler Response + + + + + + + + + <xsl:value-of select="$title"/> + + + + + +

+ +

+
+ +
+ +

Index Statistics

+ +
+ +

Field Statistics

+ + + +

Document statistics

+ + + + +
+ + + + + +
+ +
+ + +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
+

+ +

+ +
+ +
+
+
+ + +
+ + 50 + 800 + 160 + blue + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ background-color: ; width: px; height: px; +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
  • + +
  • +
    +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + + + + + + + + + + + + + + + + +
diff --git a/spec/actors/curation_concerns/generic_work_actor_spec.rb b/spec/actors/curation_concerns/generic_work_actor_spec.rb new file mode 100644 index 000000000..3e2065e61 --- /dev/null +++ b/spec/actors/curation_concerns/generic_work_actor_spec.rb @@ -0,0 +1,9 @@ +# Generated via +# `rails generate curation_concerns:work GenericWork` +require 'rails_helper' + +RSpec.describe CurationConcerns::GenericWorkActor do + it "has tests" do + skip "Add your tests here" + end +end diff --git a/spec/controllers/curation_concerns/generic_works_controller_spec.rb b/spec/controllers/curation_concerns/generic_works_controller_spec.rb new file mode 100644 index 000000000..90f9f2709 --- /dev/null +++ b/spec/controllers/curation_concerns/generic_works_controller_spec.rb @@ -0,0 +1,9 @@ +# Generated via +# `rails generate curation_concerns:work GenericWork` +require 'rails_helper' + +RSpec.describe CurationConcerns::GenericWorksController do + it "has tests" do + skip "Add your tests here" + end +end diff --git a/spec/forms/curation_concerns/generic_work_form_spec.rb b/spec/forms/curation_concerns/generic_work_form_spec.rb new file mode 100644 index 000000000..bde4b2c26 --- /dev/null +++ b/spec/forms/curation_concerns/generic_work_form_spec.rb @@ -0,0 +1,9 @@ +# Generated via +# `rails generate curation_concerns:work GenericWork` +require 'rails_helper' + +RSpec.describe CurationConcerns::GenericWorkForm do + it "has tests" do + skip "Add your tests here" + end +end diff --git a/spec/models/generic_work_spec.rb b/spec/models/generic_work_spec.rb new file mode 100644 index 000000000..a594161ab --- /dev/null +++ b/spec/models/generic_work_spec.rb @@ -0,0 +1,9 @@ +# Generated via +# `rails generate curation_concerns:work GenericWork` +require 'rails_helper' + +RSpec.describe GenericWork do + it "has tests" do + skip "Add your tests here" + end +end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb new file mode 100644 index 000000000..47a31bb43 --- /dev/null +++ b/spec/models/user_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe User, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end