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,70 @@
|
|
|
1
|
+
require_relative 'abstract_migration_generator'
|
|
2
|
+
|
|
3
|
+
class CurationConcerns::Models::InstallGenerator < CurationConcerns::Models::AbstractMigrationGenerator
|
|
4
|
+
source_root File.expand_path('../templates', __FILE__)
|
|
5
|
+
argument :model_name, type: :string , default: "user"
|
|
6
|
+
desc """
|
|
7
|
+
This generator makes the following changes to your application:
|
|
8
|
+
1. Creates several database migrations if they do not exist in /db/migrate
|
|
9
|
+
2. Creates the curation_concerns.rb configuration file and several others
|
|
10
|
+
3. Creates the generic_file.rb, generic_work.rb and collection.rb models
|
|
11
|
+
4. Runs full-text generator
|
|
12
|
+
"""
|
|
13
|
+
def banner
|
|
14
|
+
say_status("warning", "GENERATING CURATION_CONCERNS MODELS", :yellow)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Setup the database migrations
|
|
18
|
+
def copy_migrations
|
|
19
|
+
[
|
|
20
|
+
"create_version_committers.rb",
|
|
21
|
+
"create_checksum_audit_logs.rb"#,
|
|
22
|
+
].each do |file|
|
|
23
|
+
better_migration_template file
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Add behaviors to the user model
|
|
28
|
+
def inject_curation_concerns_user_behavior
|
|
29
|
+
file_path = "app/models/#{model_name.underscore}.rb"
|
|
30
|
+
if File.exists?(file_path)
|
|
31
|
+
inject_into_file file_path, after: /include Hydra\:\:User.*$/ do
|
|
32
|
+
"\n # Connects this user object to Curation Concerns behaviors." +
|
|
33
|
+
"\n include CurationConcerns::User\n"
|
|
34
|
+
end
|
|
35
|
+
else
|
|
36
|
+
puts " \e[31mFailure\e[0m CurationConcerns requires a user object. This generators assumes that the model is defined in the file #{file_path}, which does not exist. If you used a different name, please re-run the generator and provide that name as an argument. Such as \b rails -g curation_concerns client"
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def create_configuration_files
|
|
41
|
+
append_file 'config/initializers/mime_types.rb',
|
|
42
|
+
"\nMime::Type.register 'application/x-endnote-refer', :endnote", {verbose: false }
|
|
43
|
+
copy_file 'config/curation_concerns.rb', 'config/initializers/curation_concerns.rb'
|
|
44
|
+
copy_file 'config/redis.yml', 'config/redis.yml'
|
|
45
|
+
copy_file 'config/resque-pool.yml', 'config/resque-pool.yml'
|
|
46
|
+
copy_file 'config/redis_config.rb', 'config/initializers/redis_config.rb'
|
|
47
|
+
copy_file 'config/resque_admin.rb', 'config/initializers/resque_admin.rb'
|
|
48
|
+
copy_file 'config/resque_config.rb', 'config/initializers/resque_config.rb'
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def create_collection
|
|
52
|
+
copy_file 'app/models/collection.rb', 'app/models/collection.rb'
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def create_generic_file
|
|
56
|
+
copy_file 'app/models/generic_file.rb', 'app/models/generic_file.rb'
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Sets up full-text indexing (Solr config + jars)
|
|
60
|
+
def full_text_indexing
|
|
61
|
+
generate "curation_concerns:models:fulltext"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Adds clamav initializtion
|
|
65
|
+
def clamav
|
|
66
|
+
generate 'curation_concerns:models:clamav'
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
end
|
data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/clamav.rb
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ClamAV.instance.loaddb() if defined? ClamAV
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
CurationConcerns.config do |config|
|
|
2
|
+
config.fits_to_desc_mapping = {
|
|
3
|
+
file_title: :title,
|
|
4
|
+
file_author: :creator
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
config.max_days_between_audits = 7
|
|
8
|
+
|
|
9
|
+
config.cc_licenses = {
|
|
10
|
+
'Attribution 3.0 United States' => 'http://creativecommons.org/licenses/by/3.0/us/',
|
|
11
|
+
'Attribution-ShareAlike 3.0 United States' => 'http://creativecommons.org/licenses/by-sa/3.0/us/',
|
|
12
|
+
'Attribution-NonCommercial 3.0 United States' => 'http://creativecommons.org/licenses/by-nc/3.0/us/',
|
|
13
|
+
'Attribution-NoDerivs 3.0 United States' => 'http://creativecommons.org/licenses/by-nd/3.0/us/',
|
|
14
|
+
'Attribution-NonCommercial-NoDerivs 3.0 United States' => 'http://creativecommons.org/licenses/by-nc-nd/3.0/us/',
|
|
15
|
+
'Attribution-NonCommercial-ShareAlike 3.0 United States' => 'http://creativecommons.org/licenses/by-nc-sa/3.0/us/',
|
|
16
|
+
'Public Domain Mark 1.0' => 'http://creativecommons.org/publicdomain/mark/1.0/',
|
|
17
|
+
'CC0 1.0 Universal' => 'http://creativecommons.org/publicdomain/zero/1.0/',
|
|
18
|
+
'All rights reserved' => 'All rights reserved'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
config.cc_licenses_reverse = Hash[*config.cc_licenses.to_a.flatten.reverse]
|
|
22
|
+
|
|
23
|
+
config.resource_types = {
|
|
24
|
+
"Article" => "Article",
|
|
25
|
+
"Audio" => "Audio",
|
|
26
|
+
"Book" => "Book",
|
|
27
|
+
"Capstone Project" => "Capstone Project",
|
|
28
|
+
"Conference Proceeding" => "Conference Proceeding",
|
|
29
|
+
"Dataset" => "Dataset",
|
|
30
|
+
"Dissertation" => "Dissertation",
|
|
31
|
+
"Image" => "Image",
|
|
32
|
+
"Journal" => "Journal",
|
|
33
|
+
"Map or Cartographic Material" => "Map or Cartographic Material",
|
|
34
|
+
"Masters Thesis" => "Masters Thesis",
|
|
35
|
+
"Part of Book" => "Part of Book",
|
|
36
|
+
"Poster" => "Poster",
|
|
37
|
+
"Presentation" => "Presentation",
|
|
38
|
+
"Project" => "Project",
|
|
39
|
+
"Report" => "Report",
|
|
40
|
+
"Research Paper" => "Research Paper",
|
|
41
|
+
"Software or Program Code" => "Software or Program Code",
|
|
42
|
+
"Video" => "Video",
|
|
43
|
+
"Other" => "Other",
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
config.resource_types_to_schema = {
|
|
47
|
+
"Article" => "http://schema.org/Article",
|
|
48
|
+
"Audio" => "http://schema.org/AudioObject",
|
|
49
|
+
"Book" => "http://schema.org/Book",
|
|
50
|
+
"Capstone Project" => "http://schema.org/CreativeWork",
|
|
51
|
+
"Conference Proceeding" => "http://schema.org/ScholarlyArticle",
|
|
52
|
+
"Dataset" => "http://schema.org/Dataset",
|
|
53
|
+
"Dissertation" => "http://schema.org/ScholarlyArticle",
|
|
54
|
+
"Image" => "http://schema.org/ImageObject",
|
|
55
|
+
"Journal" => "http://schema.org/CreativeWork",
|
|
56
|
+
"Map or Cartographic Material" => "http://schema.org/Map",
|
|
57
|
+
"Masters Thesis" => "http://schema.org/ScholarlyArticle",
|
|
58
|
+
"Part of Book" => "http://schema.org/Book",
|
|
59
|
+
"Poster" => "http://schema.org/CreativeWork",
|
|
60
|
+
"Presentation" => "http://schema.org/CreativeWork",
|
|
61
|
+
"Project" => "http://schema.org/CreativeWork",
|
|
62
|
+
"Report" => "http://schema.org/CreativeWork",
|
|
63
|
+
"Research Paper" => "http://schema.org/ScholarlyArticle",
|
|
64
|
+
"Software or Program Code" => "http://schema.org/Code",
|
|
65
|
+
"Video" => "http://schema.org/VideoObject",
|
|
66
|
+
"Other" => "http://schema.org/CreativeWork",
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
config.permission_levels = {
|
|
70
|
+
"Choose Access"=>"none",
|
|
71
|
+
"View/Download" => "read",
|
|
72
|
+
"Edit" => "edit"
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
config.owner_permission_levels = {
|
|
76
|
+
"Edit" => "edit"
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
config.queue = CurationConcerns::Resque::Queue
|
|
80
|
+
|
|
81
|
+
# Enable displaying usage statistics in the UI
|
|
82
|
+
# Defaults to FALSE
|
|
83
|
+
# Requires a Google Analytics id and OAuth2 keyfile. See README for more info
|
|
84
|
+
config.analytics = false
|
|
85
|
+
|
|
86
|
+
# Specify a Google Analytics tracking ID to gather usage statistics
|
|
87
|
+
# config.google_analytics_id = 'UA-99999999-1'
|
|
88
|
+
|
|
89
|
+
# Specify a date you wish to start collecting Google Analytic statistics for.
|
|
90
|
+
# config.analytic_start_date = DateTime.new(2014,9,10)
|
|
91
|
+
|
|
92
|
+
# Where to store tempfiles, leave blank for the system temp directory (e.g. /tmp)
|
|
93
|
+
# config.temp_file_base = '/home/developer1'
|
|
94
|
+
|
|
95
|
+
# Specify the form of hostpath to be used in Endnote exports
|
|
96
|
+
# config.persistent_hostpath = 'http://localhost/files/'
|
|
97
|
+
|
|
98
|
+
# If you have ffmpeg installed and want to transcode audio and video uncomment this line
|
|
99
|
+
# config.enable_ffmpeg = true
|
|
100
|
+
|
|
101
|
+
# CurationConcerns uses NOIDs for files and collections instead of Fedora UUIDs
|
|
102
|
+
# where NOID = 10-character string and UUID = 32-character string w/ hyphens
|
|
103
|
+
# config.enable_noids = true
|
|
104
|
+
|
|
105
|
+
# Specify a different template for your repository's NOID IDs
|
|
106
|
+
# config.noid_template = ".reeddeeddk"
|
|
107
|
+
|
|
108
|
+
# Specify the prefix for Redis keys:
|
|
109
|
+
# config.redis_namespace = "curation_concerns"
|
|
110
|
+
|
|
111
|
+
# Specify the path to the file characterization tool:
|
|
112
|
+
# config.fits_path = "fits.sh"
|
|
113
|
+
|
|
114
|
+
# Specify a date you wish to start collecting Google Analytic statistics for.
|
|
115
|
+
# Leaving it blank will set the start date to when ever the file was uploaded by
|
|
116
|
+
# NOTE: if you have always sent analytics to GA for downloads and page views leave this commented out
|
|
117
|
+
# config.analytic_start_date = DateTime.new(2014,9,10)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
Date::DATE_FORMATS[:standard] = "%m/%d/%Y"
|
data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/mime_types.rb
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
|
|
3
|
+
# Add new mime types for use in respond_to blocks:
|
|
4
|
+
# Mime::Type.register "text/richtext", :rtf
|
|
5
|
+
# Mime::Type.register_alias "text/html", :iphone
|
|
6
|
+
Mime::Type.register 'application/x-endnote-refer', :endnote
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
if defined?(PhusionPassenger)
|
|
2
|
+
PhusionPassenger.on_event(:starting_worker_process) do |forked|
|
|
3
|
+
# We're in smart spawning mode.
|
|
4
|
+
if forked
|
|
5
|
+
# Re-establish redis connection
|
|
6
|
+
require 'redis'
|
|
7
|
+
config = YAML::load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
|
|
8
|
+
|
|
9
|
+
# The important two lines
|
|
10
|
+
$redis.client.disconnect if $redis
|
|
11
|
+
$redis = Redis.new(host: config[:host], port: config[:port], thread_safe: true) rescue nil
|
|
12
|
+
Resque.redis = $redis
|
|
13
|
+
Resque.redis.client.reconnect if Resque.redis
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
else
|
|
17
|
+
config = YAML::load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
|
|
18
|
+
$redis = Redis.new(host: config[:host], port: config[:port], thread_safe: true) rescue nil
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# Code borrowed from Obie's Redis patterns talk at RailsConf'12
|
|
23
|
+
Nest.class_eval do
|
|
24
|
+
def initialize(key, redis=$redis)
|
|
25
|
+
super(key.to_param)
|
|
26
|
+
@redis = redis
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def [](key)
|
|
30
|
+
self.class.new("#{self}:#{key.to_param}", @redis)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"*": 1
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module CurationConcerns
|
|
2
|
+
class ResqueAdmin
|
|
3
|
+
def self.matches?(request)
|
|
4
|
+
current_user = request.env['warden'].user
|
|
5
|
+
return false if current_user.blank?
|
|
6
|
+
# TODO code a group here that makes sense
|
|
7
|
+
#current_user.groups.include? 'umg/up.dlt.scholarsphere-admin'
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
config = YAML::load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
|
|
2
|
+
Resque.redis = Redis.new(host: config[:host], port: config[:port], thread_safe: true)
|
|
3
|
+
|
|
4
|
+
Resque.inline = Rails.env.test?
|
|
5
|
+
Resque.redis.namespace = "#{CurationConcerns.config.redis_namespace}:#{Rails.env}"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
class CreateChecksumAuditLogs < ActiveRecord::Migration
|
|
2
|
+
def self.up
|
|
3
|
+
create_table :checksum_audit_logs do |t|
|
|
4
|
+
t.string :generic_file_id
|
|
5
|
+
t.string :file_id
|
|
6
|
+
t.string :version
|
|
7
|
+
t.integer :pass
|
|
8
|
+
t.string :expected_result
|
|
9
|
+
t.string :actual_result
|
|
10
|
+
t.timestamps
|
|
11
|
+
end
|
|
12
|
+
add_index :checksum_audit_logs, [:generic_file_id, :file_id], name: 'by_generic_file_id_and_file_id', order: {created_at: "DESC" }
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def self.down
|
|
16
|
+
remove_index(:checksum_audit_logs, name: 'by_generic_file_id_and_file_id')
|
|
17
|
+
drop_table :checksum_audit_logs
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class CreateVersionCommitters < ActiveRecord::Migration
|
|
2
|
+
def self.up
|
|
3
|
+
create_table :version_committers do |t|
|
|
4
|
+
t.string :obj_id
|
|
5
|
+
t.string :datastream_id
|
|
6
|
+
t.string :version_id
|
|
7
|
+
t.string :committer_login
|
|
8
|
+
t.timestamps
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.down
|
|
13
|
+
drop_table :version_committers
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
require 'net/http'
|
|
2
|
+
|
|
3
|
+
namespace :curation_concerns do
|
|
4
|
+
namespace :jetty do
|
|
5
|
+
|
|
6
|
+
FULLTEXT_JARS = %w(
|
|
7
|
+
org/apache/james/apache-mime4j-core/0.7.2/apache-mime4j-core-0.7.2.jar
|
|
8
|
+
org/apache/james/apache-mime4j-dom/0.7.2/apache-mime4j-dom-0.7.2.jar
|
|
9
|
+
org/apache/solr/solr-cell/4.0.0/solr-cell-4.0.0.jar
|
|
10
|
+
org/bouncycastle/bcmail-jdk15/1.45/bcmail-jdk15-1.45.jar
|
|
11
|
+
org/bouncycastle/bcprov-jdk15/1.45/bcprov-jdk15-1.45.jar
|
|
12
|
+
de/l3s/boilerpipe/boilerpipe/1.1.0/boilerpipe-1.1.0.jar
|
|
13
|
+
org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1.jar
|
|
14
|
+
dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
|
|
15
|
+
org/apache/pdfbox/fontbox/1.7.0/fontbox-1.7.0.jar
|
|
16
|
+
com/ibm/icu/icu4j/49.1/icu4j-49.1.jar
|
|
17
|
+
com/googlecode/mp4parser/isoparser/1.0-RC-1/isoparser-1.0-RC-1.jar
|
|
18
|
+
jdom/jdom/1.0/jdom-1.0.jar
|
|
19
|
+
org/apache/pdfbox/jempbox/1.7.0/jempbox-1.7.0.jar
|
|
20
|
+
com/googlecode/juniversalchardet/juniversalchardet/1.0.3/juniversalchardet-1.0.3.jar
|
|
21
|
+
com/drewnoakes/metadata-extractor/2.4.0-beta-1/metadata-extractor-2.4.0-beta-1.jar
|
|
22
|
+
edu/ucar/netcdf/4.2-min/netcdf-4.2-min.jar
|
|
23
|
+
org/apache/pdfbox/pdfbox/1.7.0/pdfbox-1.7.0.jar
|
|
24
|
+
org/apache/poi/poi/3.8/poi-3.8.jar
|
|
25
|
+
org/apache/poi/poi-ooxml/3.8/poi-ooxml-3.8.jar
|
|
26
|
+
org/apache/poi/poi-ooxml-schemas/3.8/poi-ooxml-schemas-3.8.jar
|
|
27
|
+
org/apache/poi/poi-scratchpad/3.8/poi-scratchpad-3.8.jar
|
|
28
|
+
rome/rome/0.9/rome-0.9.jar
|
|
29
|
+
org/ccil/cowan/tagsoup/tagsoup/1.2.1/tagsoup-1.2.1.jar
|
|
30
|
+
org/apache/tika/tika-core/1.2/tika-core-1.2.jar
|
|
31
|
+
org/apache/tika/tika-parsers/1.2/tika-parsers-1.2.jar
|
|
32
|
+
org/gagravarr/vorbis-java-core/0.1/vorbis-java-core-0.1.jar
|
|
33
|
+
org/gagravarr/vorbis-java-tika/0.1/vorbis-java-tika-0.1.jar
|
|
34
|
+
xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar
|
|
35
|
+
org/apache/xmlbeans/xmlbeans/2.3.0/xmlbeans-2.3.0.jar
|
|
36
|
+
org/tukaani/xz/1.0/xz-1.0.jar
|
|
37
|
+
org/aspectj/aspectjrt/1.8.5/aspectjrt-1.8.5.jar
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
desc 'Configure jetty with full-text indexing'
|
|
41
|
+
task config: :download_jars do
|
|
42
|
+
Rake::Task['jetty:config'].invoke
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
desc 'Download Solr full-text extraction jars'
|
|
46
|
+
task :download_jars do
|
|
47
|
+
puts "Downloading full-text jars from maven.org ..."
|
|
48
|
+
fulltext_dir = 'jetty/solr/lib/contrib/extraction/lib'
|
|
49
|
+
FileUtils.mkdir_p(fulltext_dir) unless File.directory?(fulltext_dir)
|
|
50
|
+
Dir.chdir(fulltext_dir) do
|
|
51
|
+
FULLTEXT_JARS.each do |jar|
|
|
52
|
+
destination = jar.split('/').last
|
|
53
|
+
download_from_maven(jar, destination) unless File.exists?(destination)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def download_from_maven url, dst
|
|
61
|
+
full_url = '/remotecontent?filepath=' + url
|
|
62
|
+
file = File.open(dst, "wb")
|
|
63
|
+
endpoint = Net::HTTP.new('search.maven.org', 443)
|
|
64
|
+
endpoint.use_ssl = true
|
|
65
|
+
endpoint.start do |http|
|
|
66
|
+
puts "Fetching #{full_url}"
|
|
67
|
+
begin
|
|
68
|
+
http.request_get(full_url) do |resp|
|
|
69
|
+
resp.read_body { |segment| file.write(segment) }
|
|
70
|
+
end
|
|
71
|
+
ensure
|
|
72
|
+
file.close
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
namespace :curation_concerns do
|
|
2
|
+
namespace :migrate do
|
|
3
|
+
|
|
4
|
+
desc "Migrate audit logs"
|
|
5
|
+
task audit_logs: :environment do
|
|
6
|
+
ChecksumAuditLog.all.each do |cs|
|
|
7
|
+
cs.generic_file_id = cs.generic_file_id.delete "#{CurationConcerns.config.redis_namespace}:"
|
|
8
|
+
cs.save
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'resque/pool/tasks'
|
|
2
|
+
|
|
3
|
+
# This provides access to the Rails env within all Resque workers
|
|
4
|
+
task 'resque:setup' => :environment
|
|
5
|
+
|
|
6
|
+
# Set up resque-pool
|
|
7
|
+
task 'resque:pool:setup' do
|
|
8
|
+
ActiveRecord::Base.connection.disconnect!
|
|
9
|
+
Resque::Pool.after_prefork do |job|
|
|
10
|
+
ActiveRecord::Base.establish_connection
|
|
11
|
+
Resque.redis.client.reconnect
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
version = File.read(File.expand_path("../VERSION",__FILE__)).strip
|
|
3
|
+
|
|
4
|
+
# lib = File.expand_path('../lib', __FILE__)
|
|
5
|
+
# $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
6
|
+
|
|
7
|
+
Gem::Specification.new do |spec|
|
|
8
|
+
spec.name = "curation_concerns"
|
|
9
|
+
spec.version = version
|
|
10
|
+
spec.authors = ["Matt Zumwalt", "Justin Coyne", "Jeremy Friesen"]
|
|
11
|
+
spec.email = ["justin@curationexperts.com"]
|
|
12
|
+
spec.summary = %q{A Rails Engine that allows an application to CRUD CurationConcern objects (a.k.a. "Works") }
|
|
13
|
+
spec.description = %q{A Rails Engine that allows an application to CRUD CurationConcern objects (a.k.a. "Works") }
|
|
14
|
+
spec.homepage = ""
|
|
15
|
+
spec.license = "APACHE2"
|
|
16
|
+
|
|
17
|
+
spec.files = `git ls-files -z`.split("\x0")
|
|
18
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
19
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
20
|
+
spec.require_paths = ["lib"]
|
|
21
|
+
|
|
22
|
+
spec.add_dependency 'hydra-head', '~> 9.0'
|
|
23
|
+
spec.add_dependency "breadcrumbs_on_rails", "~> 2.3.0"
|
|
24
|
+
spec.add_dependency "active_attr"
|
|
25
|
+
spec.add_dependency "simple_form", '~> 3.1.0'
|
|
26
|
+
spec.add_dependency 'curation_concerns-models', version
|
|
27
|
+
spec.add_dependency 'hydra-collections' # allow curation_concerns-models to specify the version
|
|
28
|
+
spec.add_dependency 'hydra-derivatives' # allow hydra-works to specify the version
|
|
29
|
+
spec.add_dependency 'hydra-editor'
|
|
30
|
+
spec.add_dependency 'blacklight_advanced_search', ['>= 5.1.4', '< 6.0']
|
|
31
|
+
|
|
32
|
+
spec.add_development_dependency "devise", "~> 3.0"
|
|
33
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
|
34
|
+
spec.add_development_dependency "rake"
|
|
35
|
+
spec.add_development_dependency "engine_cart", "~> 0.7"
|
|
36
|
+
spec.add_development_dependency "sqlite3"
|
|
37
|
+
spec.add_development_dependency "rspec-its"
|
|
38
|
+
spec.add_development_dependency "rspec-rails"
|
|
39
|
+
spec.add_development_dependency 'rspec-html-matchers'
|
|
40
|
+
spec.add_development_dependency 'rspec-activemodel-mocks', '~> 1.0'
|
|
41
|
+
spec.add_development_dependency "capybara"
|
|
42
|
+
spec.add_development_dependency "poltergeist", ">= 1.5.0"
|
|
43
|
+
spec.add_development_dependency "factory_girl"
|
|
44
|
+
spec.add_development_dependency "database_cleaner", "< 1.1.0"
|
|
45
|
+
|
|
46
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
module CurationConcerns
|
|
2
|
+
|
|
3
|
+
class << self
|
|
4
|
+
attr_accessor :configuration
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def self.configure
|
|
8
|
+
self.configuration ||= Configuration.new
|
|
9
|
+
yield(configuration)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class Configuration
|
|
13
|
+
# An anonymous function that receives a path to a file
|
|
14
|
+
# and returns AntiVirusScanner::NO_VIRUS_FOUND_RETURN_VALUE if no
|
|
15
|
+
# virus is found; Any other returned value means a virus was found
|
|
16
|
+
attr_writer :default_antivirus_instance
|
|
17
|
+
def default_antivirus_instance
|
|
18
|
+
@default_antivirus_instance ||= lambda {|file_path|
|
|
19
|
+
AntiVirusScanner::NO_VIRUS_FOUND_RETURN_VALUE
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Configure default search options from config/search_config.yml
|
|
24
|
+
attr_writer :search_config
|
|
25
|
+
def search_config
|
|
26
|
+
@search_config ||= "search_config not set"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Configure the application root url.
|
|
30
|
+
attr_writer :application_root_url
|
|
31
|
+
def application_root_url
|
|
32
|
+
@application_root_url || (raise RuntimeError.new("Make sure to set your CurationConcerns.configuration.application_root_url"))
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# When was this last built/deployed
|
|
36
|
+
attr_writer :build_identifier
|
|
37
|
+
def build_identifier
|
|
38
|
+
# If you restart the server, this could be out of sync; A better
|
|
39
|
+
# implementation is to read something from the file system. However
|
|
40
|
+
# that detail is an exercise for the developer.
|
|
41
|
+
@build_identifier ||= Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Override characterization runner
|
|
45
|
+
attr_accessor :characterization_runner
|
|
46
|
+
|
|
47
|
+
def register_curation_concern(*curation_concern_types)
|
|
48
|
+
Array(curation_concern_types).flatten.compact.each do |cc_type|
|
|
49
|
+
class_name = normalize_concern_name(cc_type)
|
|
50
|
+
if ! registered_curation_concern_types.include?(class_name)
|
|
51
|
+
self.registered_curation_concern_types << class_name
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Returns the class names (strings) of the registered curation concerns
|
|
57
|
+
def registered_curation_concern_types
|
|
58
|
+
@registered_curation_concern_types ||= []
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns the classes of the registered curation concerns
|
|
62
|
+
def curation_concerns
|
|
63
|
+
registered_curation_concern_types.map(&:constantize)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
private
|
|
67
|
+
|
|
68
|
+
def normalize_concern_name(c)
|
|
69
|
+
c.to_s.camelize
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
configure {}
|
|
74
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#Load blacklight which will give curation_concerns views a higher preference than those in blacklight
|
|
2
|
+
require 'blacklight'
|
|
3
|
+
require 'curation_concerns/models'
|
|
4
|
+
require 'hydra-collections'
|
|
5
|
+
require 'hydra-editor'
|
|
6
|
+
|
|
7
|
+
module CurationConcerns
|
|
8
|
+
class Engine < ::Rails::Engine
|
|
9
|
+
isolate_namespace CurationConcerns
|
|
10
|
+
require 'breadcrumbs_on_rails'
|
|
11
|
+
|
|
12
|
+
config.autoload_paths += %W(
|
|
13
|
+
#{config.root}/lib
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
initializer 'curation_concerns.initialize' do
|
|
17
|
+
require 'curation_concerns/rails/routes'
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
module ActionDispatch::Routing
|
|
2
|
+
class Mapper
|
|
3
|
+
|
|
4
|
+
def curation_concerns_basic_routes
|
|
5
|
+
resources :downloads, only: :show
|
|
6
|
+
namespace :curation_concerns, path: :concern do
|
|
7
|
+
CurationConcerns.configuration.registered_curation_concern_types.map(&:tableize).each do |curation_concern_name|
|
|
8
|
+
namespaced_resources curation_concern_name, except: [:index]
|
|
9
|
+
end
|
|
10
|
+
resources :permissions, only: [] do
|
|
11
|
+
member do
|
|
12
|
+
get :confirm
|
|
13
|
+
post :copy
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
resources :generic_files, only: [:new, :create], path: 'container/:parent_id/generic_files'
|
|
17
|
+
resources :generic_files, only: [:show, :edit, :update, :destroy] do
|
|
18
|
+
member do
|
|
19
|
+
get :versions
|
|
20
|
+
put :rollback
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Used in conjunction with Hydra::Collections::Engine routes.
|
|
27
|
+
# Adds routes for doing paginated searches within a collection's contents
|
|
28
|
+
# @example in routes.rb:
|
|
29
|
+
# mount Hydra::Collections::Engine => '/'
|
|
30
|
+
# curation_concerns_collections
|
|
31
|
+
def curation_concerns_collections
|
|
32
|
+
resources :collections, only: :show do
|
|
33
|
+
member do
|
|
34
|
+
get 'page/:page', action: :index
|
|
35
|
+
get 'facet/:id', action: :facet, as: :dashboard_facet
|
|
36
|
+
end
|
|
37
|
+
collection do
|
|
38
|
+
put '', action: :update
|
|
39
|
+
put :remove_member
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# kmr added :show to make tests pass
|
|
45
|
+
def curation_concerns_embargo_management
|
|
46
|
+
resources :embargoes, only: [:index, :edit, :destroy] do
|
|
47
|
+
collection do
|
|
48
|
+
patch :update
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
resources :leases, only: [:index, :edit, :destroy] do
|
|
52
|
+
collection do
|
|
53
|
+
patch :update
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
private
|
|
59
|
+
# Namespaces routes appropriately
|
|
60
|
+
# @example route_namespaced_target("curation_concerns/generic_work") is equivalent to
|
|
61
|
+
# namespace "curation_concerns" do
|
|
62
|
+
# resources "generic_work", except: [:index]
|
|
63
|
+
# end
|
|
64
|
+
def namespaced_resources(target, opts={})
|
|
65
|
+
if target.include?("/")
|
|
66
|
+
the_namespace = target[0..target.index("/")-1]
|
|
67
|
+
new_target = target[target.index("/")+1..-1]
|
|
68
|
+
namespace the_namespace do
|
|
69
|
+
namespaced_resources(new_target, opts)
|
|
70
|
+
end
|
|
71
|
+
else
|
|
72
|
+
resources target, opts
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|