curation_concerns 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +2 -0
- data/.travis.yml +18 -0
- data/Gemfile +31 -0
- data/LICENSE.txt +15 -0
- data/README.md +46 -0
- data/RELEASING.md +2 -0
- data/Rakefile +26 -0
- data/VERSION +1 -0
- data/app/assets/images/default.png +0 -0
- data/app/assets/images/nope.png +0 -0
- data/app/assets/javascripts/.gitkeep +0 -0
- data/app/assets/javascripts/curation_concerns/.gitkeep +0 -0
- data/app/assets/javascripts/curation_concerns/application.js +18 -0
- data/app/assets/javascripts/curation_concerns/browse_everything_implement.js +7 -0
- data/app/assets/javascripts/curation_concerns/curation_concerns.js +28 -0
- data/app/assets/javascripts/curation_concerns/embargoes.js +17 -0
- data/app/assets/javascripts/curation_concerns/facet_mine.js +22 -0
- data/app/assets/javascripts/curation_concerns/help_modal.js +36 -0
- data/app/assets/javascripts/curation_concerns/link_groups.js.coffee +123 -0
- data/app/assets/javascripts/curation_concerns/link_users.js.coffee +126 -0
- data/app/assets/javascripts/curation_concerns/proxy_rights.js.coffee +95 -0
- data/app/assets/javascripts/curation_concerns/proxy_submission.js +23 -0
- data/app/assets/javascripts/curation_concerns/select_works.js.coffee +20 -0
- data/app/assets/javascripts/modernizr.js +3 -0
- data/app/assets/stylesheets/curation_concerns/_curation_concerns.scss +9 -0
- data/app/assets/stylesheets/curation_concerns/_global-variables.scss +5 -0
- data/app/assets/stylesheets/curation_concerns/_modules.scss +13 -0
- data/app/assets/stylesheets/curation_concerns/_positioning.scss +138 -0
- data/app/assets/stylesheets/curation_concerns/_theme.scss +46 -0
- data/app/assets/stylesheets/curation_concerns/_typography.scss +137 -0
- data/app/assets/stylesheets/curation_concerns/_variables_bootstrap.scss +7 -0
- data/app/assets/stylesheets/curation_concerns/downloads.scss +3 -0
- data/app/assets/stylesheets/curation_concerns/help_requests.scss +3 -0
- data/app/assets/stylesheets/curation_concerns/modules/accessibility.scss +50 -0
- data/app/assets/stylesheets/curation_concerns/modules/accordion.scss +33 -0
- data/app/assets/stylesheets/curation_concerns/modules/attributes.scss +31 -0
- data/app/assets/stylesheets/curation_concerns/modules/classify_work.scss +100 -0
- data/app/assets/stylesheets/curation_concerns/modules/embargoes.scss +15 -0
- data/app/assets/stylesheets/curation_concerns/modules/emphatic_action_area.scss +14 -0
- data/app/assets/stylesheets/curation_concerns/modules/forms.scss +116 -0
- data/app/assets/stylesheets/curation_concerns/modules/multi_value_fields.scss +52 -0
- data/app/assets/stylesheets/curation_concerns/modules/pagination.scss +4 -0
- data/app/assets/stylesheets/curation_concerns/modules/search_results.scss +55 -0
- data/app/assets/stylesheets/curation_concerns/modules/site_actions.scss +53 -0
- data/app/assets/stylesheets/curation_concerns/modules/site_search.scss +46 -0
- data/app/controllers/catalog_controller.rb +3 -0
- data/app/controllers/collections_controller.rb +3 -0
- data/app/controllers/concerns/curation_concerns/application_controller_behavior.rb +28 -0
- data/app/controllers/concerns/curation_concerns/catalog_controller.rb +321 -0
- data/app/controllers/concerns/curation_concerns/collections_controller_behavior.rb +76 -0
- data/app/controllers/concerns/curation_concerns/curation_concern_controller.rb +125 -0
- data/app/controllers/concerns/curation_concerns/download_behavior.rb +60 -0
- data/app/controllers/concerns/curation_concerns/embargoes_controller_behavior.rb +44 -0
- data/app/controllers/concerns/curation_concerns/generic_files_controller_behavior.rb +149 -0
- data/app/controllers/concerns/curation_concerns/leases_controller_behavior.rb +36 -0
- data/app/controllers/concerns/curation_concerns/manages_embargoes.rb +26 -0
- data/app/controllers/concerns/curation_concerns/parent_container.rb +33 -0
- data/app/controllers/concerns/curation_concerns/themed_layout_controller.rb +31 -0
- data/app/controllers/concerns/curation_concerns/without_namespace.rb +15 -0
- data/app/controllers/curation_concerns/application_controller.rb +7 -0
- data/app/controllers/curation_concerns/classify_concerns_controller.rb +35 -0
- data/app/controllers/curation_concerns/generic_files_controller.rb +13 -0
- data/app/controllers/curation_concerns/permissions_controller.rb +19 -0
- data/app/controllers/downloads_controller.rb +4 -0
- data/app/controllers/embargoes_controller.rb +5 -0
- data/app/controllers/leases_controller.rb +5 -0
- data/app/controllers/registrations_controller.rb +20 -0
- data/app/controllers/sessions_controller.rb +4 -0
- data/app/datastreams/curation_concerns/generic_work_rdf_properties.rb +57 -0
- data/app/datastreams/generic_work_metadata.rb +3 -0
- data/app/forms/curation_concerns/forms/collection_edit_form.rb +17 -0
- data/app/forms/curation_concerns/forms/generic_file_edit_form.rb +15 -0
- data/app/forms/curation_concerns/forms/generic_work_edit_form.rb +9 -0
- data/app/helpers/curation_concerns/ability_helper.rb +46 -0
- data/app/helpers/curation_concerns/attribute_helper.rb +67 -0
- data/app/helpers/curation_concerns/catalog_helper.rb +38 -0
- data/app/helpers/curation_concerns/collections_helper.rb +63 -0
- data/app/helpers/curation_concerns/embargo_helper.rb +17 -0
- data/app/helpers/curation_concerns/generic_file_helper.rb +19 -0
- data/app/helpers/curation_concerns/lease_helper.rb +18 -0
- data/app/helpers/curation_concerns/main_app_helpers.rb +13 -0
- data/app/helpers/curation_concerns/render_constraints_helper.rb +42 -0
- data/app/helpers/curation_concerns/search_paths_helper.rb +13 -0
- data/app/helpers/curation_concerns/thumbnail_helper.rb +11 -0
- data/app/helpers/curation_concerns/title_helper.rb +23 -0
- data/app/helpers/curation_concerns/url_helper.rb +29 -0
- data/app/presenters/curation_concerns/collection_presenter.rb +40 -0
- data/app/presenters/curation_concerns/generic_file_presenter.rb +14 -0
- data/app/presenters/curation_concerns/generic_work_presenter.rb +13 -0
- data/app/search_builders/curation_concerns/search_builder.rb +49 -0
- data/app/services/curation_concerns/curation_concern.rb +14 -0
- data/app/services/curation_concerns/embargo_service.rb +26 -0
- data/app/services/curation_concerns/lease_service.rb +23 -0
- data/app/views/catalog/_action_menu_partials/_collection.html.erb +27 -0
- data/app/views/catalog/_action_menu_partials/_default.html.erb +27 -0
- data/app/views/catalog/_document.html.erb +3 -0
- data/app/views/catalog/_document_list.html.erb +5 -0
- data/app/views/catalog/_home_text.html.erb +8 -0
- data/app/views/catalog/_index_default.html.erb +17 -0
- data/app/views/catalog/_index_header_list_default.html.erb +8 -0
- data/app/views/catalog/_navbar.html.erb +12 -0
- data/app/views/catalog/_show_partials/_default.html.erb +22 -0
- data/app/views/catalog/_show_partials/_default_details.html.erb +15 -0
- data/app/views/catalog/_show_partials/_facets.html.erb +52 -0
- data/app/views/catalog/index.html.erb +47 -0
- data/app/views/collections/_add_to_collection_modal.html.erb +15 -0
- data/app/views/collections/_batch_edits_actions.html.erb +3 -0
- data/app/views/collections/_button_for_creating_empty_collection.html.erb +3 -0
- data/app/views/collections/_collection.html.erb +1 -0
- data/app/views/collections/_dashboard_document_list.html.erb +6 -0
- data/app/views/collections/_document_list.html.erb +7 -0
- data/app/views/collections/_edit_actions.html.erb +5 -0
- data/app/views/collections/_edit_descriptions.html.erb +20 -0
- data/app/views/collections/_form.html.erb +26 -0
- data/app/views/collections/_form_additional_information.html.erb +6 -0
- data/app/views/collections/_form_for_select_collection.html.erb +34 -0
- data/app/views/collections/_form_permission.html.erb +36 -0
- data/app/views/collections/_form_representative_image.html.erb +13 -0
- data/app/views/collections/_form_required_information.html.erb +11 -0
- data/app/views/collections/_form_to_add_member.html.erb +21 -0
- data/app/views/collections/_identifier_and_action.html.erb +15 -0
- data/app/views/collections/_media_display.html.erb +1 -0
- data/app/views/collections/_paginate.html.erb +6 -0
- data/app/views/collections/_search_collection_dashboard_form.html.erb +10 -0
- data/app/views/collections/_show_actions.html.erb +8 -0
- data/app/views/collections/_show_descriptions.html.erb +10 -0
- data/app/views/collections/_show_fields.html.erb +0 -0
- data/app/views/collections/_single_item_action_fields.html.erb +6 -0
- data/app/views/collections/_sort_and_per_page.html.erb +29 -0
- data/app/views/collections/_view_type_group.html.erb +13 -0
- data/app/views/collections/edit.html.erb +17 -0
- data/app/views/collections/show.html.erb +24 -0
- data/app/views/curation_concerns/base/_attributes.html.erb +25 -0
- data/app/views/curation_concerns/base/_collections.html.erb +26 -0
- data/app/views/curation_concerns/base/_form.html.erb +25 -0
- data/app/views/curation_concerns/base/_form_additional_information.html.erb +7 -0
- data/app/views/curation_concerns/base/_form_content_license.html.erb +16 -0
- data/app/views/curation_concerns/base/_form_descriptive_fields.erb +11 -0
- data/app/views/curation_concerns/base/_form_editors.html.erb +15 -0
- data/app/views/curation_concerns/base/_form_files_and_links.html.erb +23 -0
- data/app/views/curation_concerns/base/_form_permission.html.erb +52 -0
- data/app/views/curation_concerns/base/_form_permission_embargo.html.erb +6 -0
- data/app/views/curation_concerns/base/_form_permission_lease.html.erb +6 -0
- data/app/views/curation_concerns/base/_form_permission_under_embargo.html.erb +16 -0
- data/app/views/curation_concerns/base/_form_permission_under_lease.html.erb +18 -0
- data/app/views/curation_concerns/base/_form_representative_image.html.erb +13 -0
- data/app/views/curation_concerns/base/_form_required_information.html.erb +11 -0
- data/app/views/curation_concerns/base/_form_supplementary_fields.html.erb +15 -0
- data/app/views/curation_concerns/base/_legally_binding_text.html.erb +33 -0
- data/app/views/curation_concerns/base/_related_files.html.erb +24 -0
- data/app/views/curation_concerns/base/_representative_media.html.erb +8 -0
- data/app/views/curation_concerns/base/edit.html.erb +13 -0
- data/app/views/curation_concerns/base/new.html.erb +12 -0
- data/app/views/curation_concerns/base/show.html.erb +21 -0
- data/app/views/curation_concerns/base/unauthorized.html.erb +3 -0
- data/app/views/curation_concerns/classify_concerns/new.html.erb +25 -0
- data/app/views/curation_concerns/collections/_form_additional_information.html.erb +6 -0
- data/app/views/curation_concerns/generic_files/_actions.html.erb +16 -0
- data/app/views/curation_concerns/generic_files/_form.html.erb +35 -0
- data/app/views/curation_concerns/generic_files/_generic_file.html.erb +12 -0
- data/app/views/curation_concerns/generic_files/_media_display.html.erb +19 -0
- data/app/views/curation_concerns/generic_files/edit.html.erb +5 -0
- data/app/views/curation_concerns/generic_files/jq_upload.json.jbuilder +8 -0
- data/app/views/curation_concerns/generic_files/show.html.erb +15 -0
- data/app/views/curation_concerns/permissions/confirm.html.erb +21 -0
- data/app/views/embargoes/_embargo_history.html.erb +7 -0
- data/app/views/embargoes/_list_active_embargoes.html.erb +16 -0
- data/app/views/embargoes/_list_deactivated_embargoes.html.erb +10 -0
- data/app/views/embargoes/_list_expired_active_embargoes.html.erb +44 -0
- data/app/views/embargoes/edit.html.erb +43 -0
- data/app/views/embargoes/index.html.erb +18 -0
- data/app/views/layouts/boilerplate.html.erb +22 -0
- data/app/views/layouts/curation_concerns/1_column.html.erb +11 -0
- data/app/views/layouts/curation_concerns/catalog.html.erb +37 -0
- data/app/views/layouts/curation_concerns.html.erb +22 -0
- data/app/views/leases/_lease_history.html.erb +7 -0
- data/app/views/leases/_list_active_leases.html.erb +16 -0
- data/app/views/leases/_list_deactivated_leases.html.erb +4 -0
- data/app/views/leases/_list_expired_active_leases.html.erb +38 -0
- data/app/views/leases/edit.html.erb +43 -0
- data/app/views/leases/index.html.erb +18 -0
- data/app/views/shared/_add_content.html.erb +32 -0
- data/app/views/shared/_brand_bar.html.erb +10 -0
- data/app/views/shared/_flash_message.html.erb +17 -0
- data/app/views/shared/_footer.html.erb +10 -0
- data/app/views/shared/_ga.html.erb +6 -0
- data/app/views/shared/_header.html.erb +12 -0
- data/app/views/shared/_my_actions.html.erb +21 -0
- data/app/views/shared/_site_actions.html.erb +7 -0
- data/app/views/shared/_site_search.html.erb +12 -0
- data/app/views/shared/_title_bar.html.erb +16 -0
- data/app/workers/visibility_copy_worker.rb +30 -0
- data/config/initializers/simple_form.rb +31 -0
- data/config/locales/curation_concerns.en.yml +96 -0
- data/config/routes.rb +4 -0
- data/curation_concerns-models/.gitignore +17 -0
- data/curation_concerns-models/Gemfile +4 -0
- data/curation_concerns-models/LICENSE.md +177 -0
- data/curation_concerns-models/README.md +42 -0
- data/curation_concerns-models/Rakefile +1 -0
- data/curation_concerns-models/app/actors/concerns/curation_concerns/manages_embargoes_actor.rb +99 -0
- data/curation_concerns-models/app/actors/curation_concerns/base_actor.rb +90 -0
- data/curation_concerns-models/app/actors/curation_concerns/generic_file_actor.rb +150 -0
- data/curation_concerns-models/app/actors/curation_concerns/work_actor_behavior.rb +88 -0
- data/curation_concerns-models/app/jobs/active_fedora_id_based_job.rb +22 -0
- data/curation_concerns-models/app/jobs/active_fedora_pid_based_job.rb +6 -0
- data/curation_concerns-models/app/jobs/audit_job.rb +58 -0
- data/curation_concerns-models/app/jobs/characterize_job.rb +11 -0
- data/curation_concerns-models/app/jobs/copy_permissions_job.rb +24 -0
- data/curation_concerns-models/app/jobs/create_derivatives_job.rb +15 -0
- data/curation_concerns-models/app/jobs/import_url_job.rb +56 -0
- data/curation_concerns-models/app/jobs/ingest_local_file_job.rb +48 -0
- data/curation_concerns-models/app/jobs/resolrize_job.rb +9 -0
- data/curation_concerns-models/app/models/checksum_audit_log.rb +21 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/ability.rb +34 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/basic_metadata.rb +87 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/collection_behavior.rb +47 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/belongs_to_works.rb +53 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/characterization.rb +89 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/content.rb +8 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/export.rb +343 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/full_text_indexing.rb +12 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/indexing.rb +14 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/versions.rb +16 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file.rb +5 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file_behavior.rb +44 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/generic_work_behavior.rb +38 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/has_representative.rb +14 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/human_readable_type.rb +23 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/permissions/readable.rb +19 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/permissions/writable.rb +75 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/permissions.rb +7 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/serializers.rb +15 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/solr_document_behavior.rb +135 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/user.rb +65 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/with_basic_metadata.rb +98 -0
- data/curation_concerns-models/app/models/concerns/curation_concerns/with_generic_files.rb +29 -0
- data/curation_concerns-models/app/models/curation_concerns/classify_concern.rb +47 -0
- data/curation_concerns-models/app/models/curation_concerns/quick_classification_query.rb +31 -0
- data/curation_concerns-models/app/models/datastreams/fits_datastream.rb +148 -0
- data/curation_concerns-models/app/models/version_committer.rb +2 -0
- data/curation_concerns-models/app/services/curation_concerns/characterization_service.rb +71 -0
- data/curation_concerns-models/app/services/curation_concerns/full_text_extraction_service.rb +38 -0
- data/curation_concerns-models/app/services/curation_concerns/generic_file_audit_service.rb +85 -0
- data/curation_concerns-models/app/services/curation_concerns/generic_file_indexing_service.rb +14 -0
- data/curation_concerns-models/app/services/curation_concerns/generic_work_indexing_service.rb +16 -0
- data/curation_concerns-models/app/services/curation_concerns/noid.rb +23 -0
- data/curation_concerns-models/app/services/curation_concerns/repository_audit_service.rb +9 -0
- data/curation_concerns-models/app/services/curation_concerns/versioning_service.rb +27 -0
- data/curation_concerns-models/config/locales/curation_concerns.en.yml +6 -0
- data/curation_concerns-models/curation_concerns-models.gemspec +34 -0
- data/curation_concerns-models/lib/curation_concerns/messages.rb +66 -0
- data/curation_concerns-models/lib/curation_concerns/models/engine.rb +61 -0
- data/curation_concerns-models/lib/curation_concerns/models/resque.rb +36 -0
- data/curation_concerns-models/lib/curation_concerns/models/utils.rb +22 -0
- data/curation_concerns-models/lib/curation_concerns/models/version.rb +5 -0
- data/curation_concerns-models/lib/curation_concerns/models.rb +32 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/abstract_migration_generator.rb +30 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/clamav_generator.rb +19 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/fulltext_generator.rb +28 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/install_generator.rb +70 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/app/models/collection.rb +4 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/app/models/generic_file.rb +4 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/clamav.rb +1 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/curation_concerns.rb +123 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/mime_types.rb +6 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/redis.yml +9 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/redis_config.rb +32 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/resque-pool.yml +1 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/resque_admin.rb +10 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/resque_config.rb +5 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/migrations/create_checksum_audit_logs.rb +19 -0
- data/curation_concerns-models/lib/generators/curation_concerns/models/templates/migrations/create_version_committers.rb +15 -0
- data/curation_concerns-models/lib/tasks/curation_concerns-models_tasks.rake +75 -0
- data/curation_concerns-models/lib/tasks/migrate.rake +13 -0
- data/curation_concerns-models/lib/tasks/resque.rake +13 -0
- data/curation_concerns-models/lib/tasks/solr_reindex.rake +8 -0
- data/curation_concerns.gemspec +46 -0
- data/lib/curation_concerns/configuration.rb +74 -0
- data/lib/curation_concerns/controller_resource.rb +10 -0
- data/lib/curation_concerns/engine.rb +20 -0
- data/lib/curation_concerns/rails/routes.rb +76 -0
- data/lib/curation_concerns/spec_support.rb +10 -0
- data/lib/curation_concerns/version.rb +3 -0
- data/lib/curation_concerns.rb +8 -0
- data/lib/generators/curation_concerns/install_generator.rb +103 -0
- data/lib/generators/curation_concerns/templates/curation_concerns.css.scss +3 -0
- data/lib/generators/curation_concerns/templates/curation_concerns.js +1 -0
- data/lib/generators/curation_concerns/templates/curation_concerns_config.rb +2 -0
- data/lib/generators/curation_concerns/templates/curation_concerns_helper.rb +4 -0
- data/lib/generators/curation_concerns/work/USAGE +19 -0
- data/lib/generators/curation_concerns/work/templates/README +13 -0
- data/lib/generators/curation_concerns/work/templates/actor.rb.erb +7 -0
- data/lib/generators/curation_concerns/work/templates/actor_spec.rb.erb +9 -0
- data/lib/generators/curation_concerns/work/templates/controller.rb.erb +7 -0
- data/lib/generators/curation_concerns/work/templates/controller_spec.rb.erb +9 -0
- data/lib/generators/curation_concerns/work/templates/model.rb.erb +7 -0
- data/lib/generators/curation_concerns/work/templates/model_spec.rb.erb +9 -0
- data/lib/generators/curation_concerns/work/work_generator.rb +78 -0
- data/solr_conf/conf/solrconfig.xml +223 -0
- data/spec/abilities/collection_abilities_spec.rb +48 -0
- data/spec/abilities/generic_file_abilities_spec.rb +62 -0
- data/spec/abilities/generic_work_abilities_spec.rb +58 -0
- data/spec/actors/curation_concerns/generic_file_actor_spec.rb +116 -0
- data/spec/actors/curation_concerns/manages_embargoes_actor_spec.rb +95 -0
- data/spec/actors/curation_concerns/work_actor_spec.rb +203 -0
- data/spec/controllers/catalog_controller_spec.rb +115 -0
- data/spec/controllers/curation_concerns/classify_concerns_controller_spec.rb +43 -0
- data/spec/controllers/curation_concerns/collections_controller_spec.rb +171 -0
- data/spec/controllers/curation_concerns/generic_files_controller_spec.rb +251 -0
- data/spec/controllers/curation_concerns/generic_works_controller_spec.rb +167 -0
- data/spec/controllers/curation_concerns/permissions_controller_spec.rb +29 -0
- data/spec/controllers/downloads_controller_spec.rb +51 -0
- data/spec/controllers/embargoes_controller_spec.rb +114 -0
- data/spec/controllers/leases_controller_spec.rb +94 -0
- data/spec/factories/collections.rb +15 -0
- data/spec/factories/create_curation_concern.rb +3 -0
- data/spec/factories/generic_files.rb +31 -0
- data/spec/factories/generic_works.rb +54 -0
- data/spec/factories/users.rb +28 -0
- data/spec/features/add_file_spec.rb +30 -0
- data/spec/features/collection_spec.rb +222 -0
- data/spec/features/create_work_spec.rb +43 -0
- data/spec/features/embargo_spec.rb +51 -0
- data/spec/features/lease_spec.rb +49 -0
- data/spec/features/update_file_spec.rb +32 -0
- data/spec/features/work_generator_spec.rb +58 -0
- data/spec/fixtures/Example.ogg +0 -0
- data/spec/fixtures/charter.docx +0 -0
- data/spec/fixtures/countdown.avi +0 -0
- data/spec/fixtures/curation_concerns_generic_stub.txt +1 -0
- data/spec/fixtures/files/image.png +0 -0
- data/spec/fixtures/image.jp2 +0 -0
- data/spec/fixtures/image.jpg +0 -0
- data/spec/fixtures/piano_note.wav +0 -0
- data/spec/fixtures/sample_mpeg4.mp4 +0 -0
- data/spec/fixtures/small_file.txt +1 -0
- data/spec/fixtures/spoken-text.m4a +0 -0
- data/spec/fixtures/test4.pdf +0 -0
- data/spec/fixtures/test5.mp3 +0 -0
- data/spec/fixtures/world.png +0 -0
- data/spec/forms/collection_edit_form_spec.rb +20 -0
- data/spec/forms/generic_file_edit_form_spec.rb +33 -0
- data/spec/helpers/catalog_helper_spec.rb +58 -0
- data/spec/helpers/configuration_helper_spec.rb +13 -0
- data/spec/helpers/curation_concerns/.keep +0 -0
- data/spec/helpers/curation_concerns/collections_helper_spec.rb +49 -0
- data/spec/helpers/render_constraints_helper_spec.rb +19 -0
- data/spec/helpers/thumbnail_helper_spec.rb +21 -0
- data/spec/helpers/url_helper_spec.rb +22 -0
- data/spec/jobs/active_fedora_id_based_job_spec.rb +14 -0
- data/spec/jobs/audit_job_spec.rb +53 -0
- data/spec/jobs/characterize_job_spec.rb +23 -0
- data/spec/jobs/copy_permissions_job_spec.rb +49 -0
- data/spec/jobs/create_derivatives_job_spec.rb +23 -0
- data/spec/jobs/curation_concerns_resque_queue_spec.rb +49 -0
- data/spec/jobs/import_url_job_spec.rb +45 -0
- data/spec/jobs/ingest_local_file_job_spec.rb +25 -0
- data/spec/lib/curation_concerns/messages_spec.rb +70 -0
- data/spec/lib/curation_concerns/readable_permissions_spec.rb +56 -0
- data/spec/lib/curation_concerns/writable_permissions_spec.rb +16 -0
- data/spec/matchers/metadata_field_matchers.rb +28 -0
- data/spec/matchers/response_matchers.rb +7 -0
- data/spec/matchers.rb +24 -0
- data/spec/models/checksum_audit_log_spec.rb +66 -0
- data/spec/models/curation_concerns/collection_behavior_spec.rb +107 -0
- data/spec/models/curation_concerns/generic_file/derivatives_spec.rb +88 -0
- data/spec/models/curation_concerns/generic_work_behavior_spec.rb +35 -0
- data/spec/models/fits_datastream_spec.rb +127 -0
- data/spec/models/generic_file_spec.rb +619 -0
- data/spec/models/generic_work_spec.rb +43 -0
- data/spec/models/user_spec.rb +23 -0
- data/spec/presenters/curation_concerns/collection_presenter_spec.rb +34 -0
- data/spec/presenters/curation_concerns/generic_file_presenter_spec.rb +16 -0
- data/spec/routing/curation_concerns/routes_spec.rb +36 -0
- data/spec/routing/route_spec.rb +86 -0
- data/spec/services/characterization_service_spec.rb +30 -0
- data/spec/services/embargo_service_spec.rb +38 -0
- data/spec/services/full_text_extraction_service_spec.rb +5 -0
- data/spec/services/generic_file_audit_service_spec.rb +71 -0
- data/spec/services/generic_file_indexing_service_spec.rb +57 -0
- data/spec/services/generic_work_indexing_service_spec.rb +18 -0
- data/spec/services/lease_service_spec.rb +53 -0
- data/spec/services/repository_audit_service_spec.rb +18 -0
- data/spec/services/versioning_service_spec.rb +32 -0
- data/spec/spec_helper.rb +94 -0
- data/spec/support/controllers/engine_helpers.rb +7 -0
- data/spec/support/curation_concerns/factory_helpers.rb +14 -0
- data/spec/support/features/fixture_file_upload.rb +14 -0
- data/spec/support/features/session_helpers.rb +41 -0
- data/spec/support/features.rb +19 -0
- data/spec/support/shared/shared_examples_has_dc_metadata.rb +17 -0
- data/spec/support/shared/shared_examples_is_embargoable.rb +8 -0
- data/spec/support/shared/shared_examples_with_access_rights.rb +63 -0
- data/spec/tasks/rake_spec.rb +24 -0
- data/spec/test_app_templates/Gemfile.extra +1 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +55 -0
- data/spec/views/catalog/index.html.erb_spec.rb +59 -0
- data/spec/views/curation_concerns/base/_attributes.html.erb_spec.rb +25 -0
- data/spec/views/curation_concerns/base/show.html.erb_spec.rb +29 -0
- data/spec/views/curation_concerns/permissions/confirm.html.erb_spec.rb +33 -0
- data/spec/views/shared/_add_content.html.erb_spec.rb +42 -0
- data/spec/views/shared/_my_actions.html.erb_spec.rb +23 -0
- data/spec/workers/visibility_copy_worker_spec.rb +70 -0
- data/tasks/jetty.rake +15 -0
- data/tasks/release.rake +93 -0
- data/vendor/assets/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/vendor/assets/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/vendor/assets/javascripts/handlebars.js +2278 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.autocomplete.js +602 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.core.js +356 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.effect-highlight.js +50 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.effect.js +1276 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.menu.js +610 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.position.js +498 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.widget.js +528 -0
- data/vendor/assets/javascripts/jquery.tokeninput.js +1061 -0
- data/vendor/assets/stylesheets/jquery-ui-lightness.css +474 -0
- data/vendor/assets/stylesheets/token-input-facebook.css +122 -0
- data/vendor/assets/stylesheets/token-input-mac.css +204 -0
- data/vendor/assets/stylesheets/token-input.css +127 -0
- metadata +888 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
legend small {
|
|
2
|
+
margin-left:.5em;
|
|
3
|
+
color: #999999;
|
|
4
|
+
font-size: 15px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.label-large {
|
|
8
|
+
font-size: 110%;
|
|
9
|
+
line-height: 1.2;
|
|
10
|
+
padding: .3em .6em;
|
|
11
|
+
white-space: normal;
|
|
12
|
+
position: relative;
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
input[type="checkbox"]{
|
|
16
|
+
margin:-2px 0 0;
|
|
17
|
+
position: absolute;
|
|
18
|
+
left:.5em;
|
|
19
|
+
top:38%;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.label-checkbox .label-text {
|
|
24
|
+
display:block;
|
|
25
|
+
padding-left:1.2em;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.form-group.has-error input,
|
|
29
|
+
.form-group.has-error option,
|
|
30
|
+
.form-group.has-error textarea {
|
|
31
|
+
color:$gray-dark;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.form-actions .btn-link {
|
|
35
|
+
color: $blue;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.form-actions {
|
|
39
|
+
margin-top: 1em;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
form label.optional { font-weight: normal; }
|
|
43
|
+
form label.required { font-weight: bold; }
|
|
44
|
+
|
|
45
|
+
#set-access-controls {
|
|
46
|
+
label { font-weight: normal; }
|
|
47
|
+
& > .form-group { padding: 0 1.75em; }
|
|
48
|
+
|
|
49
|
+
.form-inline {
|
|
50
|
+
.control-label, label {
|
|
51
|
+
padding-left: 0;
|
|
52
|
+
display: inline;
|
|
53
|
+
&:after {
|
|
54
|
+
content: ' ';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
.help-block {
|
|
58
|
+
display: inline;
|
|
59
|
+
&:before {
|
|
60
|
+
content: ' ';
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.control-label.required {
|
|
67
|
+
abbr {
|
|
68
|
+
font-size: 1.25em;
|
|
69
|
+
font-weight: bold;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
.field-choice {
|
|
75
|
+
padding-bottom:1em;
|
|
76
|
+
padding-top:1em;
|
|
77
|
+
text-align:center;
|
|
78
|
+
font-size:1.3em;
|
|
79
|
+
line-height:1;
|
|
80
|
+
z-index: -1000; // Prevent padding from obscuring file upload button when window is narrow
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.accept-contributor-agreement {
|
|
84
|
+
padding: 1em 2.5em;
|
|
85
|
+
input, label {
|
|
86
|
+
font-size:1.3em;
|
|
87
|
+
font-weight: normal;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
#edit_related_works {
|
|
92
|
+
ul.token-input-list-facebook {
|
|
93
|
+
float:left;
|
|
94
|
+
}
|
|
95
|
+
.btn {
|
|
96
|
+
margin-left:1em;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
form.button-to {
|
|
101
|
+
margin:0 .3em;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
form.pull-right {
|
|
105
|
+
margin-right:0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.inline-checkbox {
|
|
109
|
+
display: inline-block;
|
|
110
|
+
padding-right:1em;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.help-inline {
|
|
114
|
+
color: $gray;
|
|
115
|
+
padding-left: 1em;
|
|
116
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.multi_value {
|
|
2
|
+
.field-wrapper {
|
|
3
|
+
list-style-type:none;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.listing {
|
|
7
|
+
margin-left: 0;
|
|
8
|
+
max-width: 40em;
|
|
9
|
+
padding-left: 0px;
|
|
10
|
+
.input-group {
|
|
11
|
+
margin-bottom: 1px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.field-controls span {
|
|
16
|
+
margin-left:.2em;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.field-controls {
|
|
20
|
+
margin-left: 2em;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.message{
|
|
24
|
+
background-size: 40px 40px;
|
|
25
|
+
background-image: linear-gradient(135deg, rgba(255, 255, 255, .05) 25%, transparent 25%,
|
|
26
|
+
transparent 50%, rgba(255, 255, 255, .05) 50%, rgba(255, 255, 255, .05) 75%,
|
|
27
|
+
transparent 75%, transparent);
|
|
28
|
+
box-shadow: inset 0 -1px 0 rgba(255,255,255,.4);
|
|
29
|
+
width: 100%;
|
|
30
|
+
border: 1px solid;
|
|
31
|
+
color: #fff;
|
|
32
|
+
padding: 10px;
|
|
33
|
+
text-shadow: 0 1px 0 rgba(0,0,0,.5);
|
|
34
|
+
animation: animate-bg 5s linear infinite;
|
|
35
|
+
border-radius: $border-radius-base;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.has-error{
|
|
39
|
+
background-color: #de4343;
|
|
40
|
+
border-color: #c43d3d;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.has-warning{
|
|
44
|
+
background-color: #eaaf51;
|
|
45
|
+
border-color: #d99a36;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// The contributor listing needs some normalization
|
|
50
|
+
#contributors .listing {
|
|
51
|
+
max-width:20em;
|
|
52
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.search-results-list {
|
|
2
|
+
}
|
|
3
|
+
|
|
4
|
+
#documents .document {
|
|
5
|
+
border-top: 1px solid $gray-lighter;
|
|
6
|
+
margin-top: 1em;
|
|
7
|
+
padding-top:.5em;
|
|
8
|
+
|
|
9
|
+
&:before {
|
|
10
|
+
//Overwrite blacklight
|
|
11
|
+
content: none;
|
|
12
|
+
}
|
|
13
|
+
&:first-child {
|
|
14
|
+
border-top:none;
|
|
15
|
+
margin-top:0;
|
|
16
|
+
padding-top:0;
|
|
17
|
+
}
|
|
18
|
+
.search-result-actions {
|
|
19
|
+
@include make-xs-column(8);
|
|
20
|
+
@include make-xs-column-offset(4);
|
|
21
|
+
@include make-sm-column(2);
|
|
22
|
+
@include make-sm-column-offset(0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.document-thumbnail {
|
|
26
|
+
@include make-xs-column(4);
|
|
27
|
+
@include make-sm-column(2);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.document-metadata {
|
|
31
|
+
@include make-xs-column(8);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.canonical-image {
|
|
35
|
+
width: 100%; // no bigger than the parent
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.resource-type {
|
|
39
|
+
margin-bottom:0;
|
|
40
|
+
position:absolute;
|
|
41
|
+
right:0;
|
|
42
|
+
text-align:center;
|
|
43
|
+
top:0;
|
|
44
|
+
width:80%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.modal {
|
|
48
|
+
text-align:left;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
.search-result-details {
|
|
54
|
+
}
|
|
55
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#site-actions {
|
|
2
|
+
.dropdown-menu {
|
|
3
|
+
text-align:left;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// Overriding default boostrap behavior
|
|
7
|
+
.btn-group + .btn-group {
|
|
8
|
+
margin-left:0;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.dropdown-menu {
|
|
13
|
+
.item-with-options,
|
|
14
|
+
.item-option {
|
|
15
|
+
display:block;
|
|
16
|
+
padding:3px 20px;
|
|
17
|
+
line-height:20px;
|
|
18
|
+
color:#333;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.item-options{
|
|
22
|
+
margin:0;
|
|
23
|
+
padding:0;
|
|
24
|
+
list-style-type:none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.item-option{
|
|
28
|
+
padding-left:30px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* TODO: convert this from compiled bootstrap styles to SASS mixins if available. */
|
|
32
|
+
.item-option:hover,
|
|
33
|
+
.item-option:focus {
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
color: white;
|
|
36
|
+
background-color: #0056b7;
|
|
37
|
+
background-image: -moz-linear-gradient(top, #005bc1, #004fa8);
|
|
38
|
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#005bc1), to(#004fa8));
|
|
39
|
+
background-image: -webkit-linear-gradient(top, #005bc1, #004fa8);
|
|
40
|
+
background-image: -o-linear-gradient(top, #005bc1, #004fa8);
|
|
41
|
+
background-image: linear-gradient(to bottom, #005bc1, #004fa8);
|
|
42
|
+
background-repeat: repeat-x;
|
|
43
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF005BC1', endColorstr='#FF004FA8', GradientType=0);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.menu-heading {
|
|
47
|
+
font-weight:bold;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.link-to-full-list {
|
|
51
|
+
font-style:italic;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.search-form {
|
|
2
|
+
position:relative;
|
|
3
|
+
|
|
4
|
+
.search-query,
|
|
5
|
+
.search-submit {
|
|
6
|
+
-moz-box-sizing: border-box;
|
|
7
|
+
box-sizing:border-box;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.search-query {
|
|
11
|
+
width:100%;
|
|
12
|
+
padding-left:.6em;
|
|
13
|
+
padding-right:12%;
|
|
14
|
+
height: 2.1em;
|
|
15
|
+
border-radius: $input-border-radius;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.search-submit {
|
|
19
|
+
padding:2px;
|
|
20
|
+
position:absolute;
|
|
21
|
+
right:2px;
|
|
22
|
+
text-align:center;
|
|
23
|
+
top:2px;
|
|
24
|
+
white-space:nowrap;
|
|
25
|
+
width:9%;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.search-query-form {
|
|
30
|
+
margin-bottom:.3em;
|
|
31
|
+
padding-left:1em;
|
|
32
|
+
|
|
33
|
+
.search-scope {
|
|
34
|
+
display:block;
|
|
35
|
+
line-height:1.5em;
|
|
36
|
+
margin-bottom:.3em;
|
|
37
|
+
|
|
38
|
+
input {
|
|
39
|
+
margin-top:0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.label-text {
|
|
44
|
+
padding-left:.3em;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module CurationConcerns
|
|
2
|
+
# Inherit from the host app's ApplicationController
|
|
3
|
+
# This will configure e.g. the layout used by the host
|
|
4
|
+
module ApplicationControllerBehavior
|
|
5
|
+
extend ActiveSupport::Concern
|
|
6
|
+
|
|
7
|
+
included do
|
|
8
|
+
helper CurationConcerns::MainAppHelpers
|
|
9
|
+
|
|
10
|
+
rescue_from CanCan::AccessDenied do |exception|
|
|
11
|
+
if [:show, :edit, :update, :destroy].include? exception.action
|
|
12
|
+
render 'unauthorized', status: :unauthorized
|
|
13
|
+
else
|
|
14
|
+
redirect_to main_app.root_url, alert: exception.message
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
rescue_from ActiveFedora::ObjectNotFoundError do |exception|
|
|
19
|
+
render file: "#{Rails.root}/public/404", format: :html, status: :not_found, layout: false
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def current_ability
|
|
24
|
+
user_signed_in? ? current_user.ability : super
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
module CurationConcerns::CatalogController
|
|
2
|
+
extend ActiveSupport::Concern
|
|
3
|
+
include Hydra::Catalog
|
|
4
|
+
# Extend Blacklight::Catalog with Hydra behaviors (primarily editing).
|
|
5
|
+
include Hydra::Controller::ControllerBehavior
|
|
6
|
+
include BreadcrumbsOnRails::ActionController
|
|
7
|
+
include CurationConcerns::ThemedLayoutController
|
|
8
|
+
|
|
9
|
+
included do
|
|
10
|
+
with_themed_layout 'catalog'
|
|
11
|
+
helper CurationConcerns::CatalogHelper
|
|
12
|
+
# These before_filters apply the hydra access controls
|
|
13
|
+
before_filter :enforce_show_permissions, only: :show
|
|
14
|
+
# This applies appropriate access controls to all solr queries
|
|
15
|
+
CatalogController.search_params_logic += [:add_access_controls_to_solr_params]
|
|
16
|
+
self.search_params_logic += [:filter_models]
|
|
17
|
+
self.search_params_logic += [:only_generic_files_and_curation_concerns]
|
|
18
|
+
|
|
19
|
+
configure_blacklight do |config|
|
|
20
|
+
|
|
21
|
+
config.search_builder_class = CurationConcerns::SearchBuilder
|
|
22
|
+
## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params
|
|
23
|
+
config.default_solr_params = {
|
|
24
|
+
qf: search_config['qf'],
|
|
25
|
+
qt: search_config['qt'],
|
|
26
|
+
rows: search_config['rows']
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
# solr field configuration for search results/index views
|
|
30
|
+
config.index.title_field = solr_name("title", :stored_searchable)
|
|
31
|
+
config.index.display_type_field = solr_name("has_model", :symbol)
|
|
32
|
+
|
|
33
|
+
config.index.thumbnail_method = :thumbnail_tag
|
|
34
|
+
config.index.partials.delete(:thumbnail) # we render this inside _index_default.html.erb
|
|
35
|
+
|
|
36
|
+
# solr field configuration for document/show views
|
|
37
|
+
# config.show.title_field = solr_name("title", :stored_searchable)
|
|
38
|
+
# config.show.display_type_field = solr_name("has_model", :symbol)
|
|
39
|
+
|
|
40
|
+
# solr fields that will be treated as facets by the blacklight application
|
|
41
|
+
# The ordering of the field names is the order of the display
|
|
42
|
+
config.add_facet_field solr_name("human_readable_type", :facetable)
|
|
43
|
+
config.add_facet_field solr_name('creator', :facetable), limit: 5
|
|
44
|
+
config.add_facet_field solr_name("tag", :facetable), limit: 5
|
|
45
|
+
config.add_facet_field solr_name("subject", :facetable), limit: 5
|
|
46
|
+
config.add_facet_field solr_name("language", :facetable), limit: 5
|
|
47
|
+
config.add_facet_field solr_name("based_near", :facetable), limit: 5
|
|
48
|
+
config.add_facet_field solr_name("publisher", :facetable), limit: 5
|
|
49
|
+
config.add_facet_field solr_name("file_format", :facetable), limit: 5
|
|
50
|
+
config.add_facet_field "generic_type_sim", show: false, single: true
|
|
51
|
+
|
|
52
|
+
# Have BL send all facet field names to Solr, which has been the default
|
|
53
|
+
# previously. Simply remove these lines if you'd rather use Solr request
|
|
54
|
+
# handler defaults, or have no facets.
|
|
55
|
+
config.add_facet_fields_to_solr_request!
|
|
56
|
+
|
|
57
|
+
# solr fields to be displayed in the index (search results) view
|
|
58
|
+
# The ordering of the field names is the order of the display
|
|
59
|
+
config.add_index_field solr_name("description", :stored_searchable)
|
|
60
|
+
config.add_index_field solr_name("tag", :stored_searchable)
|
|
61
|
+
config.add_index_field solr_name("subject", :stored_searchable)
|
|
62
|
+
config.add_index_field solr_name("creator", :stored_searchable)
|
|
63
|
+
config.add_index_field solr_name("contributor", :stored_searchable)
|
|
64
|
+
config.add_index_field solr_name("publisher", :stored_searchable)
|
|
65
|
+
config.add_index_field solr_name("based_near", :stored_searchable)
|
|
66
|
+
config.add_index_field solr_name("language", :stored_searchable)
|
|
67
|
+
config.add_index_field solr_name("date_uploaded", :stored_sortable)
|
|
68
|
+
config.add_index_field solr_name("date_modified", :stored_sortable)
|
|
69
|
+
config.add_index_field solr_name("date_created", :stored_searchable)
|
|
70
|
+
config.add_index_field solr_name("rights", :stored_searchable)
|
|
71
|
+
config.add_index_field solr_name("human_readable_type", :stored_searchable)
|
|
72
|
+
config.add_index_field solr_name("format", :stored_searchable)
|
|
73
|
+
config.add_index_field solr_name("identifier", :stored_searchable)
|
|
74
|
+
|
|
75
|
+
# solr fields to be displayed in the show (single result) view
|
|
76
|
+
# The ordering of the field names is the order of the display
|
|
77
|
+
config.add_show_field solr_name("title", :stored_searchable)
|
|
78
|
+
config.add_show_field solr_name("description", :stored_searchable)
|
|
79
|
+
config.add_show_field solr_name("tag", :stored_searchable)
|
|
80
|
+
config.add_show_field solr_name("subject", :stored_searchable)
|
|
81
|
+
config.add_show_field solr_name("creator", :stored_searchable)
|
|
82
|
+
config.add_show_field solr_name("contributor", :stored_searchable)
|
|
83
|
+
config.add_show_field solr_name("publisher", :stored_searchable)
|
|
84
|
+
config.add_show_field solr_name("based_near", :stored_searchable)
|
|
85
|
+
config.add_show_field solr_name("language", :stored_searchable)
|
|
86
|
+
config.add_show_field solr_name("date_uploaded", :stored_sortable)
|
|
87
|
+
config.add_show_field solr_name("date_modified", :stored_sortable)
|
|
88
|
+
config.add_show_field solr_name("date_created", :stored_searchable)
|
|
89
|
+
config.add_show_field solr_name("rights", :stored_searchable)
|
|
90
|
+
config.add_show_field solr_name("human_readable_type", :stored_searchable)
|
|
91
|
+
config.add_show_field solr_name("format", :stored_searchable)
|
|
92
|
+
config.add_show_field solr_name("identifier", :stored_searchable)
|
|
93
|
+
|
|
94
|
+
# "fielded" search configuration. Used by pulldown among other places.
|
|
95
|
+
# For supported keys in hash, see rdoc for Blacklight::SearchFields
|
|
96
|
+
#
|
|
97
|
+
# Search fields will inherit the :qt solr request handler from
|
|
98
|
+
# config[:default_solr_parameters], OR can specify a different one
|
|
99
|
+
# with a :qt key/value. Below examples inherit, except for subject
|
|
100
|
+
# that specifies the same :qt as default for our own internal
|
|
101
|
+
# testing purposes.
|
|
102
|
+
#
|
|
103
|
+
# The :key is what will be used to identify this BL search field internally,
|
|
104
|
+
# as well as in URLs -- so changing it after deployment may break bookmarked
|
|
105
|
+
# urls. A display label will be automatically calculated from the :key,
|
|
106
|
+
# or can be specified manually to be different.
|
|
107
|
+
#
|
|
108
|
+
# This one uses all the defaults set by the solr request handler. Which
|
|
109
|
+
# solr request handler? The one set in config[:default_solr_parameters][:qt],
|
|
110
|
+
# since we aren't specifying it otherwise.
|
|
111
|
+
config.add_search_field('all_fields', label: 'All Fields', :include_in_advanced_search => false) do |field|
|
|
112
|
+
title_name = solr_name("title", :stored_searchable, type: :string)
|
|
113
|
+
label_name = solr_name("title", :stored_searchable, type: :string)
|
|
114
|
+
contributor_name = solr_name("contributor", :stored_searchable, type: :string)
|
|
115
|
+
field.solr_parameters = {
|
|
116
|
+
:qf => "#{title_name} #{label_name} file_format_tesim #{contributor_name}",
|
|
117
|
+
:pf => "#{title_name}"
|
|
118
|
+
}
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
# Now we see how to over-ride Solr request handler defaults, in this
|
|
123
|
+
# case for a BL "search field", which is really a dismax aggregate
|
|
124
|
+
# of Solr search fields.
|
|
125
|
+
# creator, title, description, publisher, date_created,
|
|
126
|
+
# subject, language, resource_type, format, identifier, based_near,
|
|
127
|
+
config.add_search_field('contributor') do |field|
|
|
128
|
+
# solr_parameters hash are sent to Solr as ordinary url query params.
|
|
129
|
+
|
|
130
|
+
# :solr_local_parameters will be sent using Solr LocalParams
|
|
131
|
+
# syntax, as eg {! qf=$title_qf }. This is neccesary to use
|
|
132
|
+
# Solr parameter de-referencing like $title_qf.
|
|
133
|
+
# See: http://wiki.apache.org/solr/LocalParams
|
|
134
|
+
solr_name = solr_name("contributor", :stored_searchable, type: :string)
|
|
135
|
+
field.solr_local_parameters = {
|
|
136
|
+
:qf => solr_name,
|
|
137
|
+
:pf => solr_name
|
|
138
|
+
}
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
config.add_search_field('creator') do |field|
|
|
142
|
+
solr_name = solr_name("creator", :stored_searchable, type: :string)
|
|
143
|
+
field.solr_local_parameters = {
|
|
144
|
+
:qf => solr_name,
|
|
145
|
+
:pf => solr_name
|
|
146
|
+
}
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
config.add_search_field('title') do |field|
|
|
150
|
+
solr_name = solr_name("title", :stored_searchable, type: :string)
|
|
151
|
+
field.solr_local_parameters = {
|
|
152
|
+
:qf => solr_name,
|
|
153
|
+
:pf => solr_name
|
|
154
|
+
}
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
config.add_search_field('description') do |field|
|
|
158
|
+
field.label = "Abstract or Summary"
|
|
159
|
+
solr_name = solr_name("description", :stored_searchable, type: :string)
|
|
160
|
+
field.solr_local_parameters = {
|
|
161
|
+
:qf => solr_name,
|
|
162
|
+
:pf => solr_name
|
|
163
|
+
}
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
config.add_search_field('publisher') do |field|
|
|
167
|
+
solr_name = solr_name("publisher", :stored_searchable, type: :string)
|
|
168
|
+
field.solr_local_parameters = {
|
|
169
|
+
:qf => solr_name,
|
|
170
|
+
:pf => solr_name
|
|
171
|
+
}
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
config.add_search_field('date_created') do |field|
|
|
175
|
+
solr_name = solr_name("created", :stored_searchable, type: :string)
|
|
176
|
+
field.solr_local_parameters = {
|
|
177
|
+
:qf => solr_name,
|
|
178
|
+
:pf => solr_name
|
|
179
|
+
}
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
config.add_search_field('subject') do |field|
|
|
183
|
+
solr_name = solr_name("subject", :stored_searchable, type: :string)
|
|
184
|
+
field.solr_local_parameters = {
|
|
185
|
+
:qf => solr_name,
|
|
186
|
+
:pf => solr_name
|
|
187
|
+
}
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
config.add_search_field('language') do |field|
|
|
191
|
+
solr_name = solr_name("language", :stored_searchable, type: :string)
|
|
192
|
+
field.solr_local_parameters = {
|
|
193
|
+
:qf => solr_name,
|
|
194
|
+
:pf => solr_name
|
|
195
|
+
}
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
config.add_search_field('human_readable_type') do |field|
|
|
199
|
+
solr_name = solr_name("human_readable_type", :stored_searchable, type: :string)
|
|
200
|
+
field.solr_local_parameters = {
|
|
201
|
+
:qf => solr_name,
|
|
202
|
+
:pf => solr_name
|
|
203
|
+
}
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
config.add_search_field('format') do |field|
|
|
207
|
+
field.include_in_advanced_search = false
|
|
208
|
+
solr_name = solr_name("format", :stored_searchable, type: :string)
|
|
209
|
+
field.solr_local_parameters = {
|
|
210
|
+
:qf => solr_name,
|
|
211
|
+
:pf => solr_name
|
|
212
|
+
}
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
config.add_search_field('identifier') do |field|
|
|
216
|
+
field.include_in_advanced_search = false
|
|
217
|
+
solr_name = solr_name("id", :stored_searchable, type: :string)
|
|
218
|
+
field.solr_local_parameters = {
|
|
219
|
+
:qf => solr_name,
|
|
220
|
+
:pf => solr_name
|
|
221
|
+
}
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
config.add_search_field('based_near') do |field|
|
|
225
|
+
field.label = "Location"
|
|
226
|
+
solr_name = solr_name("based_near", :stored_searchable, type: :string)
|
|
227
|
+
field.solr_local_parameters = {
|
|
228
|
+
:qf => solr_name,
|
|
229
|
+
:pf => solr_name
|
|
230
|
+
}
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
config.add_search_field('tag') do |field|
|
|
234
|
+
solr_name = solr_name("tag", :stored_searchable, type: :string)
|
|
235
|
+
field.solr_local_parameters = {
|
|
236
|
+
:qf => solr_name,
|
|
237
|
+
:pf => solr_name
|
|
238
|
+
}
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
config.add_search_field('depositor') do |field|
|
|
242
|
+
solr_name = solr_name("depositor", :stored_searchable, type: :string)
|
|
243
|
+
field.solr_local_parameters = {
|
|
244
|
+
:qf => solr_name,
|
|
245
|
+
:pf => solr_name
|
|
246
|
+
}
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
config.add_search_field('rights') do |field|
|
|
250
|
+
solr_name = solr_name("rights", :stored_searchable, type: :string)
|
|
251
|
+
field.solr_local_parameters = {
|
|
252
|
+
:qf => solr_name,
|
|
253
|
+
:pf => solr_name
|
|
254
|
+
}
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
# "sort results by" select (pulldown)
|
|
259
|
+
# label in pulldown is followed by the name of the SOLR field to sort by and
|
|
260
|
+
# whether the sort is ascending or descending (it must be asc or desc
|
|
261
|
+
# except in the relevancy case).
|
|
262
|
+
# label is key, solr field is value
|
|
263
|
+
config.add_sort_field "score desc, #{uploaded_field} desc", label: "relevance \u25BC"
|
|
264
|
+
config.add_sort_field "#{uploaded_field} desc", label: "date uploaded \u25BC"
|
|
265
|
+
config.add_sort_field "#{uploaded_field} asc", label: "date uploaded \u25B2"
|
|
266
|
+
config.add_sort_field "#{modified_field} desc", label: "date modified \u25BC"
|
|
267
|
+
config.add_sort_field "#{modified_field} asc", label: "date modified \u25B2"
|
|
268
|
+
|
|
269
|
+
# If there are more than this many search results, no spelling ("did you
|
|
270
|
+
# mean") suggestion is offered.
|
|
271
|
+
config.spell_max = 5
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
module ClassMethods
|
|
276
|
+
def t *args
|
|
277
|
+
I18n.translate *args
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
def uploaded_field
|
|
281
|
+
# system_create_dtsi
|
|
282
|
+
solr_name('date_uploaded', :stored_sortable, type: :date)
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
def modified_field
|
|
286
|
+
solr_name('date_modified', :stored_sortable , type: :date)
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
def search_config
|
|
290
|
+
{'qf' => ['title_tesim','name_tesim'], 'qt' => 'search', 'rows' => 10}
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
protected
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
# Overriding Blacklight so that the search results can be displayed in a way compatible with
|
|
299
|
+
# tokenInput javascript library. This is used for suggesting "Related Works" to attach.
|
|
300
|
+
def render_search_results_as_json
|
|
301
|
+
{"docs" => @response["response"]["docs"].map {|solr_doc| serialize_work_from_solr(solr_doc) }}
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
def serialize_work_from_solr(solr_doc)
|
|
305
|
+
title = solr_doc["title_tesim"].first
|
|
306
|
+
title << " (#{solr_doc["human_readable_type_tesim"].first})" if solr_doc["human_readable_type_tesim"].present?
|
|
307
|
+
{
|
|
308
|
+
pid: solr_doc["id"],
|
|
309
|
+
title: title
|
|
310
|
+
}
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
def depositor
|
|
314
|
+
#Hydra.config[:permissions][:owner] maybe it should match this config variable, but it doesn't.
|
|
315
|
+
Solrizer.solr_name('depositor', :stored_searchable, type: :string)
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
def sort_field
|
|
319
|
+
"#{Solrizer.solr_name('system_create', :sortable)} desc"
|
|
320
|
+
end
|
|
321
|
+
end
|