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,10 @@
|
|
|
1
|
+
# Given that curate provides custom matchers, factories, etc.
|
|
2
|
+
# When someone makes use of curate in their Rails application
|
|
3
|
+
# Then we should expose those spec support files to that applications
|
|
4
|
+
spec_directory = File.expand_path('../../../spec', __FILE__)
|
|
5
|
+
|
|
6
|
+
# Dir["#{spec_directory}/factories/**/*.rb"].each { |f| require f }
|
|
7
|
+
Dir["#{spec_directory}/support/curation_concerns/*.rb"].each { |f| require f }
|
|
8
|
+
Dir["#{spec_directory}/support/shared/*.rb"].each { |f| require f }
|
|
9
|
+
|
|
10
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
require 'rails/generators'
|
|
2
|
+
|
|
3
|
+
module CurationConcerns
|
|
4
|
+
class Install < Rails::Generators::Base
|
|
5
|
+
|
|
6
|
+
source_root File.expand_path('../templates', __FILE__)
|
|
7
|
+
|
|
8
|
+
argument :model_name, type: :string , default: "user"
|
|
9
|
+
desc """
|
|
10
|
+
This generator makes the following changes to your application:
|
|
11
|
+
1. Runs installers for blacklight & hydra-head (which also install & configure devise)
|
|
12
|
+
2. Runs curation_concerns:models:install
|
|
13
|
+
3. Injects CurationConcerns routes
|
|
14
|
+
4. Adds CurationConcerns abilities into the Ability class
|
|
15
|
+
5. Adds controller behavior to the application controller
|
|
16
|
+
6. Copies the catalog controller into the local app
|
|
17
|
+
7. Adds CurationConcerns::SolrDocumentBehavior to app/models/solr_document.rb
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def run_required_generators
|
|
21
|
+
say_status("warning", "[CurationConcerns] GENERATING BLACKLIGHT", :yellow)
|
|
22
|
+
generate "blacklight:install --devise"
|
|
23
|
+
say_status("warning", "[CurationConcerns] GENERATING HYDRA-HEAD", :yellow)
|
|
24
|
+
generate "hydra:head -f"
|
|
25
|
+
say_status("warning", "[CurationConcerns] GENERATING CURATION_CONCERNS MODELS", :yellow)
|
|
26
|
+
generate "curation_concerns:models:install#{options[:force] ? ' -f' : ''}"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def remove_catalog_controller
|
|
30
|
+
say_status("warning", "Removing Blacklight's generated CatalogController...", :yellow)
|
|
31
|
+
remove_file('app/controllers/catalog_controller.rb')
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def inject_application_controller_behavior
|
|
35
|
+
inject_into_file 'app/controllers/application_controller.rb', :after => /Blacklight::Controller\s*\n/ do
|
|
36
|
+
"\n # Adds CurationConcerns behaviors to the application controller.\n" +
|
|
37
|
+
" include CurationConcerns::ApplicationControllerBehavior\n"
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def replace_blacklight_layout
|
|
42
|
+
gsub_file 'app/controllers/application_controller.rb', /layout 'blacklight'/,
|
|
43
|
+
"include CurationConcerns::ThemedLayoutController\n with_themed_layout '1_column'\n"
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# def insert_builder
|
|
47
|
+
# insert_into_file 'app/models/search_builder.rb', after: /include Blacklight::Solr::SearchBuilderBehavior/ do
|
|
48
|
+
# # First line should be generated by Hydra. projecthydra/hydra-head#255
|
|
49
|
+
# "\n include Hydra::AccessControlsEnforcement" +
|
|
50
|
+
# "\n include CurationConcerns::SearchBuilder\n"
|
|
51
|
+
# end
|
|
52
|
+
# end
|
|
53
|
+
|
|
54
|
+
def remove_blacklight_scss
|
|
55
|
+
remove_file 'app/assets/stylesheets/blacklight.css.scss'
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# END Blacklight stuff
|
|
59
|
+
|
|
60
|
+
def inject_routes
|
|
61
|
+
inject_into_file 'config/routes.rb', :after => /devise_for :users\s*\n/ do
|
|
62
|
+
" mount Hydra::Collections::Engine => '/'\n"\
|
|
63
|
+
" mount CurationConcerns::Engine, at: '/'\n"\
|
|
64
|
+
" curation_concerns_collections\n"\
|
|
65
|
+
" curation_concerns_basic_routes\n"\
|
|
66
|
+
" curation_concerns_embargo_management\n"\
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def inject_ability
|
|
71
|
+
inject_into_file 'app/models/ability.rb', :after => /Hydra::Ability\s*\n/ do
|
|
72
|
+
" include CurationConcerns::Ability\n"\
|
|
73
|
+
" self.ability_logic += [:everyone_can_create_curation_concerns]\n\n"
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Add behaviors to the SolrDocument model
|
|
78
|
+
def inject_solr_document_behavior
|
|
79
|
+
file_path = "app/models/solr_document.rb"
|
|
80
|
+
if File.exists?(file_path)
|
|
81
|
+
inject_into_file file_path, after: /include Blacklight::Solr::Document.*$/ do
|
|
82
|
+
"\n # Adds CurationConcerns behaviors to the SolrDocument.\n" +
|
|
83
|
+
" include CurationConcerns::SolrDocumentBehavior\n"
|
|
84
|
+
end
|
|
85
|
+
else
|
|
86
|
+
puts " \e[31mFailure\e[0m CurationConcerns requires a SolrDocument object. This generators assumes that the model is defined in the file #{file_path}, which does not exist."
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def assets
|
|
91
|
+
copy_file "curation_concerns.css.scss", "app/assets/stylesheets/curation_concerns.css.scss"
|
|
92
|
+
copy_file "curation_concerns.js", "app/assets/javascripts/curation_concerns.js"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def add_helper
|
|
96
|
+
copy_file "curation_concerns_helper.rb", "app/helpers/curation_concerns_helper.rb"
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def add_config_file
|
|
100
|
+
copy_file "curation_concerns_config.rb", "config/initializers/curation_concerns_config.rb"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//= require curation_concerns/application
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Description:
|
|
2
|
+
This generator creates the necessary files for work that extends
|
|
3
|
+
CurationConcerns's GenericWork.
|
|
4
|
+
|
|
5
|
+
Example:
|
|
6
|
+
rails generate curation_concerns:work ScholarlyPaper
|
|
7
|
+
|
|
8
|
+
This will create:
|
|
9
|
+
app/models/scholarly_paper.rb
|
|
10
|
+
app/actors/curation_concerns/scholarly_paper_actor.rb
|
|
11
|
+
app/controllers/curation_concerns/scholarly_papers_controller.rb
|
|
12
|
+
app/views/curation_concerns/scholarly_papers/.keep
|
|
13
|
+
spec/factories/scholarly_paper_factory.rb
|
|
14
|
+
spec/models/scholarly_paper_spec.rb
|
|
15
|
+
spec/actors/curation_concerns/scholarly_paper_actor_spec.rb
|
|
16
|
+
spec/controllers/curation_concerns/scholarly_papers_controller_spec.rb
|
|
17
|
+
|
|
18
|
+
This will also:
|
|
19
|
+
register ScholarlyPaper as a valid curation concern
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
===============================================================================
|
|
2
|
+
|
|
3
|
+
After creating your work you may wish to:
|
|
4
|
+
|
|
5
|
+
1. Add custom views:
|
|
6
|
+
|
|
7
|
+
Your newly created work's controller extends from
|
|
8
|
+
CurationConcerns::GenericWorksController; This means that it will use the
|
|
9
|
+
views found in CurationConcerns::Engine.root/app/views/curation_concerns/base.
|
|
10
|
+
|
|
11
|
+
2. Modify the model and datastreams
|
|
12
|
+
|
|
13
|
+
===============================================================================
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Generated via
|
|
2
|
+
# `rails generate curation_concerns:work <%= class_name %>`
|
|
3
|
+
|
|
4
|
+
class CurationConcerns::<%= class_name.pluralize %>Controller < ApplicationController
|
|
5
|
+
include CurationConcerns::CurationConcernController
|
|
6
|
+
set_curation_concern_type <%= class_name %>
|
|
7
|
+
end
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Generated via
|
|
2
|
+
# `rails generate curation_concerns:work <%= class_name %>`
|
|
3
|
+
class <%= class_name %> < ActiveFedora::Base
|
|
4
|
+
include ::CurationConcerns::GenericWorkBehavior
|
|
5
|
+
include ::CurationConcerns::BasicMetadata
|
|
6
|
+
validates_presence_of :title, message: 'Your work must have a title.'
|
|
7
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
require 'rails/generators'
|
|
3
|
+
|
|
4
|
+
class Rails::Generators::NamedBase
|
|
5
|
+
private
|
|
6
|
+
def destroy(what, *args)
|
|
7
|
+
log :destroy, what
|
|
8
|
+
argument = args.map {|arg| arg.to_s }.flatten.join(" ")
|
|
9
|
+
|
|
10
|
+
in_root {
|
|
11
|
+
run_ruby_script("bin/rails destroy #{what} #{argument}", verbose: true)
|
|
12
|
+
}
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class CurationConcerns::WorkGenerator < Rails::Generators::NamedBase
|
|
17
|
+
source_root File.expand_path("../templates", __FILE__)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
|
|
21
|
+
|
|
22
|
+
# Why all of these antics with defining individual methods?
|
|
23
|
+
# Because I want the output of CurationConcerns::WorkGenerator to include all the processed files.
|
|
24
|
+
def create_model_spec
|
|
25
|
+
return unless rspec_installed?
|
|
26
|
+
template "model_spec.rb.erb", "spec/models/#{file_name}_spec.rb"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def create_model
|
|
30
|
+
template("model.rb.erb", "app/models/#{file_name}.rb")
|
|
31
|
+
end
|
|
32
|
+
def create_controller_spec
|
|
33
|
+
return unless rspec_installed?
|
|
34
|
+
template("controller_spec.rb.erb", "spec/controllers/curation_concerns/#{plural_file_name}_controller_spec.rb")
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def create_actor_spec
|
|
38
|
+
return unless rspec_installed?
|
|
39
|
+
template("actor_spec.rb.erb", "spec/actors/curation_concerns/#{file_name}_actor_spec.rb")
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def create_controller
|
|
43
|
+
template("controller.rb.erb", "app/controllers/curation_concerns/#{plural_file_name}_controller.rb")
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def create_actor
|
|
47
|
+
template("actor.rb.erb", "app/actors/curation_concerns/#{file_name}_actor.rb")
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def register_work
|
|
51
|
+
inject_into_file 'config/initializers/curation_concerns_config.rb', after: "CurationConcerns.configure do |config|\n" do
|
|
52
|
+
data = ""
|
|
53
|
+
data << " # Injected via `rails g curation_concerns:work #{class_name}`\n"
|
|
54
|
+
data << " config.register_curation_concern :#{file_name}\n"
|
|
55
|
+
data
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def create_views
|
|
60
|
+
create_file "app/views/curation_concerns/#{plural_file_name}/_#{file_name}.html.erb" do
|
|
61
|
+
data = "<%# This is a search result view %>\n"
|
|
62
|
+
data << "<%= render 'catalog/document', document: #{file_name}, document_counter: #{file_name}_counter %>\n"
|
|
63
|
+
data
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def create_readme
|
|
68
|
+
readme 'README'
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
private
|
|
73
|
+
|
|
74
|
+
def rspec_installed?
|
|
75
|
+
defined?(RSpec) && defined?(RSpec::Rails)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
end
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<config>
|
|
3
|
+
<!-- NOTE: various comments and unused configuration possibilities have been purged
|
|
4
|
+
from this file. Please refer to http://wiki.apache.org/solr/SolrConfigXml,
|
|
5
|
+
as well as the default solrconfig file included with Solr -->
|
|
6
|
+
|
|
7
|
+
<abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
|
|
8
|
+
|
|
9
|
+
<luceneMatchVersion>LUCENE_40</luceneMatchVersion>
|
|
10
|
+
|
|
11
|
+
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
|
|
12
|
+
|
|
13
|
+
<!-- solr lib dirs -->
|
|
14
|
+
<lib dir="../lib/contrib/analysis-extras/lib" />
|
|
15
|
+
<lib dir="../lib/contrib/analysis-extras/lucene-libs" />
|
|
16
|
+
<!-- for full-text indexing -->
|
|
17
|
+
<lib dir="../lib/contrib/extraction/lib" regex=".*\.jar" />
|
|
18
|
+
|
|
19
|
+
<dataDir>${solr.data.dir:}</dataDir>
|
|
20
|
+
|
|
21
|
+
<!-- The default high-performance update handler -->
|
|
22
|
+
<updateHandler class="solr.DirectUpdateHandler2">
|
|
23
|
+
|
|
24
|
+
<!-- Enables a transaction log, used for real-time get, durability, and
|
|
25
|
+
and solr cloud replica recovery. The log can grow as big as
|
|
26
|
+
uncommitted changes to the index, so use of a hard autoCommit
|
|
27
|
+
is recommended (see below).
|
|
28
|
+
"dir" - the target directory for transaction logs, defaults to the
|
|
29
|
+
solr data directory. -->
|
|
30
|
+
<updateLog>
|
|
31
|
+
<str name="dir">${solr.ulog.dir:}</str>
|
|
32
|
+
</updateLog>
|
|
33
|
+
|
|
34
|
+
<!-- AutoCommit
|
|
35
|
+
Perform a hard commit automatically under certain conditions.
|
|
36
|
+
Instead of enabling autoCommit, consider using "commitWithin"
|
|
37
|
+
when adding documents.
|
|
38
|
+
http://wiki.apache.org/solr/UpdateXmlMessages
|
|
39
|
+
maxDocs - Maximum number of documents to add since the last
|
|
40
|
+
commit before automatically triggering a new commit.
|
|
41
|
+
maxTime - Maximum amount of time in ms that is allowed to pass
|
|
42
|
+
since a document was added before automatically
|
|
43
|
+
triggering a new commit.
|
|
44
|
+
openSearcher - if false, the commit causes recent index changes
|
|
45
|
+
to be flushed to stable storage, but does not cause a new
|
|
46
|
+
searcher to be opened to make those changes visible.
|
|
47
|
+
If the updateLog is enabled, then it's highly recommended to
|
|
48
|
+
have some sort of hard autoCommit to limit the log size.
|
|
49
|
+
-->
|
|
50
|
+
<autoCommit>
|
|
51
|
+
<maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
|
|
52
|
+
<openSearcher>false</openSearcher>
|
|
53
|
+
</autoCommit>
|
|
54
|
+
|
|
55
|
+
<!-- softAutoCommit is like autoCommit except it causes a
|
|
56
|
+
'soft' commit which only ensures that changes are visible
|
|
57
|
+
but does not ensure that data is synced to disk. This is
|
|
58
|
+
faster and more near-realtime friendly than a hard commit.
|
|
59
|
+
-->
|
|
60
|
+
|
|
61
|
+
<autoSoftCommit>
|
|
62
|
+
<maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
|
|
63
|
+
</autoSoftCommit>
|
|
64
|
+
|
|
65
|
+
</updateHandler>
|
|
66
|
+
|
|
67
|
+
<requestHandler name="search" class="solr.SearchHandler" default="true">
|
|
68
|
+
<!-- default values for query parameters can be specified, these
|
|
69
|
+
will be overridden by parameters in the request
|
|
70
|
+
-->
|
|
71
|
+
<lst name="defaults">
|
|
72
|
+
<str name="defType">edismax</str>
|
|
73
|
+
<str name="echoParams">explicit</str>
|
|
74
|
+
<str name="q.alt">*:*</str>
|
|
75
|
+
<str name="mm">2<-1 5<-2 6<90%</str>
|
|
76
|
+
<int name="qs">1</int>
|
|
77
|
+
<int name="ps">2</int>
|
|
78
|
+
<float name="tie">0.01</float>
|
|
79
|
+
<!-- this qf and pf are used by default, if not otherwise specified by
|
|
80
|
+
client. The default blacklight_config will use these for the
|
|
81
|
+
"keywords" search. See the author_qf/author_pf, title_qf, etc
|
|
82
|
+
below, which the default blacklight_config will specify for
|
|
83
|
+
those searches. You may also be interested in:
|
|
84
|
+
http://wiki.apache.org/solr/LocalParams
|
|
85
|
+
-->
|
|
86
|
+
<str name="qf">
|
|
87
|
+
id
|
|
88
|
+
all_text_timv
|
|
89
|
+
active_fedora_model_ssi
|
|
90
|
+
object_type_si
|
|
91
|
+
</str>
|
|
92
|
+
<str name="pf">
|
|
93
|
+
all_text_timv^10
|
|
94
|
+
</str>
|
|
95
|
+
|
|
96
|
+
<str name="author_qf">
|
|
97
|
+
</str>
|
|
98
|
+
<str name="author_pf">
|
|
99
|
+
</str>
|
|
100
|
+
<str name="title_qf">
|
|
101
|
+
</str>
|
|
102
|
+
<str name="title_pf">
|
|
103
|
+
</str>
|
|
104
|
+
<str name="subject_qf">
|
|
105
|
+
</str>
|
|
106
|
+
<str name="subject_pf">
|
|
107
|
+
</str>
|
|
108
|
+
|
|
109
|
+
<str name="fl">
|
|
110
|
+
*,
|
|
111
|
+
score
|
|
112
|
+
</str>
|
|
113
|
+
|
|
114
|
+
<str name="facet">true</str>
|
|
115
|
+
<str name="facet.mincount">1</str>
|
|
116
|
+
<str name="facet.limit">10</str>
|
|
117
|
+
<str name="facet.field">active_fedora_model_ssi</str>
|
|
118
|
+
<str name="facet.field">object_type_si</str>
|
|
119
|
+
|
|
120
|
+
<str name="spellcheck">true</str>
|
|
121
|
+
<str name="spellcheck.dictionary">default</str>
|
|
122
|
+
<str name="spellcheck.onlyMorePopular">true</str>
|
|
123
|
+
<str name="spellcheck.extendedResults">true</str>
|
|
124
|
+
<str name="spellcheck.collate">false</str>
|
|
125
|
+
<str name="spellcheck.count">5</str>
|
|
126
|
+
|
|
127
|
+
</lst>
|
|
128
|
+
<arr name="last-components">
|
|
129
|
+
<str>spellcheck</str>
|
|
130
|
+
</arr>
|
|
131
|
+
</requestHandler>
|
|
132
|
+
|
|
133
|
+
<requestHandler name="permissions" class="solr.SearchHandler" >
|
|
134
|
+
<lst name="defaults">
|
|
135
|
+
<str name="facet">off</str>
|
|
136
|
+
<str name="echoParams">all</str>
|
|
137
|
+
<str name="rows">1</str>
|
|
138
|
+
<str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
|
|
139
|
+
<str name="fl">
|
|
140
|
+
id,
|
|
141
|
+
access_ssim,
|
|
142
|
+
discover_access_group_ssim,discover_access_person_ssim,
|
|
143
|
+
read_access_group_ssim,read_access_person_ssim,
|
|
144
|
+
edit_access_group_ssim,edit_access_person_ssim,
|
|
145
|
+
depositor_ti,
|
|
146
|
+
embargo_release_date_dtsi
|
|
147
|
+
inheritable_access_ssim,
|
|
148
|
+
inheritable_discover_access_group_ssim,inheritable_discover_access_person_ssim,
|
|
149
|
+
inheritable_read_access_group_ssim,inheritable_read_access_person_ssim,
|
|
150
|
+
inheritable_edit_access_group_ssim,inheritable_edit_access_person_ssim,
|
|
151
|
+
inheritable_embargo_release_date_dtsi
|
|
152
|
+
</str>
|
|
153
|
+
</lst>
|
|
154
|
+
</requestHandler>
|
|
155
|
+
|
|
156
|
+
<requestHandler name="/update/extract" startup="lazy" class="org.apache.solr.handler.extraction.ExtractingRequestHandler" >
|
|
157
|
+
<lst name="defaults">
|
|
158
|
+
<!-- All the main content goes into "text"... if you need to return the extracted text or do highlighting, use a stored field. -->
|
|
159
|
+
<str name="fmap.content">text</str>
|
|
160
|
+
<str name="lowernames">true</str>
|
|
161
|
+
<str name="uprefix">ignored_</str>
|
|
162
|
+
<!-- capture link hrefs but ignore div attributes -->
|
|
163
|
+
<str name="captureAttr">true</str>
|
|
164
|
+
<str name="fmap.a">links</str>
|
|
165
|
+
<str name="fmap.div">ignored_</str>
|
|
166
|
+
</lst>
|
|
167
|
+
</requestHandler>
|
|
168
|
+
|
|
169
|
+
<requestHandler name="standard" class="solr.SearchHandler">
|
|
170
|
+
<lst name="defaults">
|
|
171
|
+
<str name="echoParams">explicit</str>
|
|
172
|
+
<str name="defType">lucene</str>
|
|
173
|
+
</lst>
|
|
174
|
+
</requestHandler>
|
|
175
|
+
|
|
176
|
+
<!-- for requests to get a single document; use id=666 instead of q=id:666 -->
|
|
177
|
+
<requestHandler name="document" class="solr.SearchHandler" >
|
|
178
|
+
<lst name="defaults">
|
|
179
|
+
<str name="echoParams">all</str>
|
|
180
|
+
<str name="fl">*</str>
|
|
181
|
+
<str name="rows">1</str>
|
|
182
|
+
<str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
|
|
183
|
+
</lst>
|
|
184
|
+
</requestHandler>
|
|
185
|
+
|
|
186
|
+
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
|
|
187
|
+
<str name="queryAnalyzerFieldType">textSpell</str>
|
|
188
|
+
<!-- Multiple "Spell Checkers" can be declared and used by this component
|
|
189
|
+
(e.g. for title_spell field)
|
|
190
|
+
-->
|
|
191
|
+
<lst name="spellchecker">
|
|
192
|
+
<str name="name">default</str>
|
|
193
|
+
<str name="field">spell</str>
|
|
194
|
+
<str name="spellcheckIndexDir">./spell</str>
|
|
195
|
+
<str name="buildOnOptimize">true</str>
|
|
196
|
+
</lst>
|
|
197
|
+
</searchComponent>
|
|
198
|
+
|
|
199
|
+
<requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
|
|
200
|
+
|
|
201
|
+
<requestDispatcher handleSelect="true" >
|
|
202
|
+
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048" />
|
|
203
|
+
</requestDispatcher>
|
|
204
|
+
|
|
205
|
+
<requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
|
|
206
|
+
<requestHandler name="/update" class="solr.UpdateRequestHandler" />
|
|
207
|
+
<requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
|
|
208
|
+
|
|
209
|
+
<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
|
|
210
|
+
<lst name="invariants">
|
|
211
|
+
<str name="q">solrpingquery</str>
|
|
212
|
+
</lst>
|
|
213
|
+
<lst name="defaults">
|
|
214
|
+
<str name="echoParams">all</str>
|
|
215
|
+
</lst>
|
|
216
|
+
</requestHandler>
|
|
217
|
+
|
|
218
|
+
<!-- config for the admin interface -->
|
|
219
|
+
<admin>
|
|
220
|
+
<defaultQuery>search</defaultQuery>
|
|
221
|
+
</admin>
|
|
222
|
+
|
|
223
|
+
</config>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require "cancan/matchers"
|
|
3
|
+
|
|
4
|
+
describe "User" do
|
|
5
|
+
describe "Abilities" do
|
|
6
|
+
subject { ability }
|
|
7
|
+
let(:ability) { Ability.new(current_user) }
|
|
8
|
+
let(:visibility) { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE }
|
|
9
|
+
let(:creating_user) { FactoryGirl.create(:user) }
|
|
10
|
+
let(:user) { FactoryGirl.create(:user) }
|
|
11
|
+
let(:current_user) { user }
|
|
12
|
+
let(:collection) { FactoryGirl.create(:collection, visibility: visibility, user: creating_user) }
|
|
13
|
+
before do
|
|
14
|
+
collection.visibility = visibility
|
|
15
|
+
collection.save
|
|
16
|
+
end
|
|
17
|
+
describe 'the collection creator' do
|
|
18
|
+
let(:current_user) { creating_user }
|
|
19
|
+
it {
|
|
20
|
+
should be_able_to(:create, ::Collection.new)
|
|
21
|
+
should be_able_to(:create, ::Collection)
|
|
22
|
+
should be_able_to(:read, collection)
|
|
23
|
+
should be_able_to(:update, collection)
|
|
24
|
+
should be_able_to(:destroy, collection)
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
describe 'another authenticated user' do
|
|
29
|
+
it {
|
|
30
|
+
should be_able_to(:create, ::Collection.new)
|
|
31
|
+
should be_able_to(:create, ::Collection)
|
|
32
|
+
should_not be_able_to(:read, collection)
|
|
33
|
+
should_not be_able_to(:update, collection)
|
|
34
|
+
should_not be_able_to(:destroy, collection)
|
|
35
|
+
}
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
describe 'a nil user' do
|
|
39
|
+
let(:current_user) { nil }
|
|
40
|
+
it {
|
|
41
|
+
should_not be_able_to(:create, GenericFile.new)
|
|
42
|
+
should_not be_able_to(:read, collection)
|
|
43
|
+
should_not be_able_to(:update, collection)
|
|
44
|
+
should_not be_able_to(:destroy, collection)
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require "cancan/matchers"
|
|
3
|
+
|
|
4
|
+
describe "User" do
|
|
5
|
+
describe "Abilities" do
|
|
6
|
+
subject { ability }
|
|
7
|
+
let(:ability) { Ability.new(current_user) }
|
|
8
|
+
let(:visibility) { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE }
|
|
9
|
+
let(:creating_user) { FactoryGirl.create(:user) }
|
|
10
|
+
let(:user) { FactoryGirl.create(:user) }
|
|
11
|
+
let(:current_user) { user }
|
|
12
|
+
let(:generic_work) { FactoryGirl.create(:generic_work, visibility: visibility, user:creating_user) }
|
|
13
|
+
let(:generic_file) { FactoryGirl.create(:generic_file, visibility: visibility, user:creating_user) }
|
|
14
|
+
|
|
15
|
+
describe 'without embargo' do
|
|
16
|
+
describe 'creator of object' do
|
|
17
|
+
let(:creating_user) { user }
|
|
18
|
+
let(:current_user) { user }
|
|
19
|
+
it {
|
|
20
|
+
should be_able_to(:create, GenericFile.new)
|
|
21
|
+
should be_able_to(:read, generic_file)
|
|
22
|
+
should be_able_to(:update, generic_file)
|
|
23
|
+
should_not be_able_to(:delete, generic_file)
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
describe 'as a repository manager' do
|
|
28
|
+
let(:manager_user) { FactoryGirl.create(:admin) }
|
|
29
|
+
let(:creating_user) { user }
|
|
30
|
+
let(:current_user) { manager_user }
|
|
31
|
+
it {
|
|
32
|
+
should be_able_to(:create, ::GenericFile.new)
|
|
33
|
+
should be_able_to(:read, generic_file)
|
|
34
|
+
should be_able_to(:update, generic_file)
|
|
35
|
+
should be_able_to(:destroy, generic_file)
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
describe 'another authenticated user' do
|
|
40
|
+
let(:creating_user) { FactoryGirl.create(:user) }
|
|
41
|
+
let(:current_user) { user }
|
|
42
|
+
it {
|
|
43
|
+
should be_able_to(:create, ::GenericFile.new)
|
|
44
|
+
should_not be_able_to(:read, generic_file)
|
|
45
|
+
should_not be_able_to(:update, generic_file)
|
|
46
|
+
should_not be_able_to(:delete, generic_file)
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
describe 'a nil user' do
|
|
51
|
+
let(:creating_user) { FactoryGirl.create(:user) }
|
|
52
|
+
let(:current_user) { nil }
|
|
53
|
+
it {
|
|
54
|
+
should_not be_able_to(:create, GenericFile.new)
|
|
55
|
+
should_not be_able_to(:read, generic_file)
|
|
56
|
+
should_not be_able_to(:update, generic_file)
|
|
57
|
+
should_not be_able_to(:delete, generic_file)
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|