hydra-head 3.0.0pre1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +71 -0
- data/.gitmodules +6 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +257 -0
- data/README.textile +150 -0
- data/README_RAILS3_CHANGES.textile +42 -0
- data/Rakefile +5 -0
- data/TESTING.textile +85 -0
- data/app/controllers/assets_controller.rb +117 -0
- data/app/controllers/contributors_controller.rb +54 -0
- data/app/controllers/file_assets_controller.rb +152 -0
- data/app/controllers/permissions_controller.rb +137 -0
- data/app/controllers/user_sessions_controller.rb +14 -0
- data/app/helpers/article_metadata_helper.rb +80 -0
- data/app/helpers/blacklight_helper.rb +192 -0
- data/app/helpers/downloads_helper.rb +19 -0
- data/app/helpers/generic_content_objects_helper.rb +16 -0
- data/app/helpers/hydra_assets_helper.rb +75 -0
- data/app/helpers/hydra_djatoka_helper.rb +23 -0
- data/app/helpers/hydra_fedora_metadata_helper.rb +365 -0
- data/app/helpers/hydra_helper.rb +155 -0
- data/app/helpers/hydra_uploader_helper.rb +18 -0
- data/app/helpers/inline_editable_metadata_helper.rb +15 -0
- data/app/helpers/javascript_includes_helper.rb +93 -0
- data/app/helpers/release_process_helper.rb +32 -0
- data/app/models/audio_asset.rb +8 -0
- data/app/models/file_asset.rb +111 -0
- data/app/models/generic_content.rb +21 -0
- data/app/models/generic_image.rb +62 -0
- data/app/models/image_asset.rb +8 -0
- data/app/models/mods_asset.rb +6 -0
- data/app/models/role_mapper.rb +22 -0
- data/app/models/superuser.rb +6 -0
- data/app/models/video_asset.rb +8 -0
- data/app/views/_add_assets_links.html.erb +13 -0
- data/app/views/_brown_sidebar.html +15 -0
- data/app/views/_user_util_links.html.erb +31 -0
- data/app/views/catalog/_citation.html.erb +11 -0
- data/app/views/catalog/_constraints_element.html.erb +34 -0
- data/app/views/catalog/_delete_partials/_default.html.erb +29 -0
- data/app/views/catalog/_document_list.html.erb +11 -0
- data/app/views/catalog/_edit_partials/_default.html.erb +64 -0
- data/app/views/catalog/_edit_partials/_default_details.html.erb +15 -0
- data/app/views/catalog/_email_form.html.erb +9 -0
- data/app/views/catalog/_facets.html.erb +37 -0
- data/app/views/catalog/_flash_msg.html.erb +17 -0
- data/app/views/catalog/_home.html.erb +6 -0
- data/app/views/catalog/_home_text.html.erb +10 -0
- data/app/views/catalog/_index_partials/_default.html.erb +20 -0
- data/app/views/catalog/_index_partials/_default_details.html.erb +11 -0
- data/app/views/catalog/_index_partials/_default_group.html.erb +15 -0
- data/app/views/catalog/_search_form.html.erb +12 -0
- data/app/views/catalog/_show_partials/_default.html.erb +23 -0
- data/app/views/catalog/_show_partials/_default_details.html.erb +12 -0
- data/app/views/catalog/_show_partials/_facets.html.erb +52 -0
- data/app/views/catalog/_sms_form.html.erb +21 -0
- data/app/views/catalog/_sort_and_per_page.html.erb +22 -0
- data/app/views/catalog/_uva_tabs.html.erb +10 -0
- data/app/views/catalog/about.html.erb +0 -0
- data/app/views/catalog/show.html.erb +48 -0
- data/app/views/contributors/_add_contributor_split_button.html.erb +10 -0
- data/app/views/contributors/_edit_conference.html.erb +29 -0
- data/app/views/contributors/_edit_organization.html.erb +29 -0
- data/app/views/contributors/_edit_person.html.erb +42 -0
- data/app/views/contributors/_index.html.erb +12 -0
- data/app/views/contributors/_new.html.erb +10 -0
- data/app/views/contributors/_show_conference.html.erb +22 -0
- data/app/views/contributors/_show_organization.html.erb +29 -0
- data/app/views/contributors/_show_person.html.erb +17 -0
- data/app/views/contributors/new.html.erb +13 -0
- data/app/views/downloads/index.html.erb +1 -0
- data/app/views/file_assets/_deletable_result.html.erb +5 -0
- data/app/views/file_assets/_index.html.erb +15 -0
- data/app/views/file_assets/_new.html.erb +2 -0
- data/app/views/file_assets/_result.html.erb +16 -0
- data/app/views/file_assets/index.html.erb +5 -0
- data/app/views/fluid_infusion/_uploader.html.erb +81 -0
- data/app/views/fluid_infusion/_uploader_generic_content_objects.js.erb +38 -0
- data/app/views/fluid_infusion/_uploader_js.erb +45 -0
- data/app/views/generic_content_objects/_edit_description.html.erb +50 -0
- data/app/views/generic_content_objects/_new.html.erb +0 -0
- data/app/views/generic_content_objects/_show_description.html.erb +68 -0
- data/app/views/generic_content_objects/contributors/_edit_conference.html.erb +29 -0
- data/app/views/generic_content_objects/contributors/_edit_organization.html.erb +29 -0
- data/app/views/generic_content_objects/contributors/_edit_person.html.erb +37 -0
- data/app/views/generic_content_objects/contributors/_new.html.erb +10 -0
- data/app/views/generic_content_objects/contributors/_show_conference.html.erb +22 -0
- data/app/views/generic_content_objects/contributors/_show_organization.html.erb +22 -0
- data/app/views/generic_content_objects/contributors/_show_person.html.erb +38 -0
- data/app/views/generic_contents/_edit.html.erb +59 -0
- data/app/views/generic_contents/_index.html.erb +23 -0
- data/app/views/generic_contents/_show.html.erb +18 -0
- data/app/views/generic_contents/_show_content.html.erb +4 -0
- data/app/views/generic_images/_edit.html.erb +59 -0
- data/app/views/generic_images/_index.html.erb +24 -0
- data/app/views/generic_images/_show.html.erb +18 -0
- data/app/views/generic_images/_show_all.html.erb +14 -0
- data/app/views/generic_images/_show_content.html.erb +7 -0
- data/app/views/layouts/application.html.erb +57 -0
- data/app/views/layouts/hydra-head.html.erb +12 -0
- data/app/views/mods_assets/_edit.html.erb +49 -0
- data/app/views/mods_assets/_edit_description.html.erb +82 -0
- data/app/views/mods_assets/_edit_journal.html.erb +72 -0
- data/app/views/mods_assets/_index.html.erb +1 -0
- data/app/views/mods_assets/_index_list.html.erb +37 -0
- data/app/views/mods_assets/_index_table.html.erb +7 -0
- data/app/views/mods_assets/_progress_box.html.erb +82 -0
- data/app/views/mods_assets/_show.html.erb +44 -0
- data/app/views/mods_assets/_show_description.html.erb +44 -0
- data/app/views/mods_assets/_show_journal.html.erb +42 -0
- data/app/views/mods_assets/_show_permissions.html.erb +14 -0
- data/app/views/permissions/_edit_person_permissions.html.erb +35 -0
- data/app/views/permissions/_index.html.erb +55 -0
- data/app/views/permissions/_new.html.erb +18 -0
- data/app/views/permissions/index.html.erb +1 -0
- data/app/views/permissions/new.html.erb +1 -0
- data/app/views/shared/_delete_asset_confirmation.html.erb +17 -0
- data/app/views/user_sessions/_login_form.html.erb +10 -0
- data/app/views/user_sessions/logged_out.html.erb +1 -0
- data/config/routes.rb +12 -0
- data/fedora_conf/conf/fedora.fcfg +1021 -0
- data/hydra-head.gemspec +70 -0
- data/lib/application_controller.rb +25 -0
- data/lib/application_helper.rb +2 -0
- data/lib/engine.rb +30 -0
- data/lib/generators/hydra/head_generator.rb +152 -0
- data/lib/generators/hydra/templates/config/fedora.yml +17 -0
- data/lib/generators/hydra/templates/config/initializers/blacklight_config.rb +246 -0
- data/lib/generators/hydra/templates/config/initializers/fedora_config.rb +23 -0
- data/lib/generators/hydra/templates/config/initializers/hydra_config.rb +29 -0
- data/lib/generators/hydra/templates/config/role_map_cucumber.yml +10 -0
- data/lib/generators/hydra/templates/config/role_map_development.yml +12 -0
- data/lib/generators/hydra/templates/config/role_map_production.yml +2 -0
- data/lib/generators/hydra/templates/config/role_map_test.yml +15 -0
- data/lib/generators/hydra/templates/config/solr.yml +10 -0
- data/lib/generators/hydra/templates/config/solr_mappings.yml +22 -0
- data/lib/generators/hydra/templates/fedora_conf/conf/fedora.fcfg +1021 -0
- data/lib/generators/hydra/templates/migrations/add_user_attributes_table.rb +15 -0
- data/lib/generators/hydra/templates/migrations/create_superusers.rb +12 -0
- data/lib/generators/hydra/templates/solr_conf/conf/schema.xml +118 -0
- data/lib/generators/hydra/templates/solr_conf/conf/solrconfig.xml +332 -0
- data/lib/generators/hydra/templates/solr_conf/solr.xml +35 -0
- data/lib/hydra-head.rb +29 -0
- data/lib/hydra-head/engine.rb +9 -0
- data/lib/hydra-head/routes.rb +87 -0
- data/lib/hydra-head/version.rb +4 -0
- data/lib/hydra.rb +22 -0
- data/lib/hydra/access_controls_enforcement.rb +236 -0
- data/lib/hydra/access_controls_evaluation.rb +97 -0
- data/lib/hydra/assets_controller_helper.rb +144 -0
- data/lib/hydra/catalog.rb +64 -0
- data/lib/hydra/common_mods_index_methods.rb +42 -0
- data/lib/hydra/controller.rb +7 -0
- data/lib/hydra/file_assets_helper.rb +144 -0
- data/lib/hydra/fixtures.rb +43 -0
- data/lib/hydra/generic_content.rb +113 -0
- data/lib/hydra/generic_image.rb +100 -0
- data/lib/hydra/image.rb +177 -0
- data/lib/hydra/model_methods.rb +95 -0
- data/lib/hydra/model_mixins.rb +2 -0
- data/lib/hydra/model_mixins/common_metadata.rb +24 -0
- data/lib/hydra/model_mixins/mods_object.rb +16 -0
- data/lib/hydra/mods_article.rb +505 -0
- data/lib/hydra/mods_dataset.rb +165 -0
- data/lib/hydra/mods_generic_content.rb +494 -0
- data/lib/hydra/mods_image.rb +494 -0
- data/lib/hydra/repository_controller.rb +102 -0
- data/lib/hydra/rights_metadata.rb +189 -0
- data/lib/hydra/superuser_attributes.rb +12 -0
- data/lib/hydra/testing_server.rb +183 -0
- data/lib/hydra/user.rb +22 -0
- data/lib/mediashelf/active_fedora_helper.rb +72 -0
- data/lib/railties/all_tests.rake +23 -0
- data/lib/railties/hydra-fixtures.rake +184 -0
- data/lib/railties/hydra_jetty.rake +79 -0
- data/lib/railties/hyhead_cucumber.rake +127 -0
- data/lib/railties/hyhead_rspec.rake +137 -0
- data/lib/stanford/searchworks_helper.rb +1338 -0
- data/lib/stanford/solr_helper.rb +108 -0
- data/lib/uva/mods_index_methods.rb +24 -0
- data/solr_conf/conf/schema.xml +122 -0
- data/solr_conf/conf/solrconfig.xml +332 -0
- data/solr_conf/solr.xml +35 -0
- data/tasks/hydra-head-fixtures.rake +54 -0
- data/tasks/hydra-head.rake +247 -0
- data/tasks/hydra_jetty.rake +79 -0
- data/tasks/replicator.rake +27 -0
- data/tasks/solrizer-fedora.rake +53 -0
- data/tasks/solrizer.rake +13 -0
- data/test_support/etc/Gemfile +29 -0
- data/test_support/etc/rvmrc +32 -0
- data/test_support/features/button_add_assets.feature +22 -0
- data/test_support/features/button_add_generic_content.feature +11 -0
- data/test_support/features/button_add_image.feature +11 -0
- data/test_support/features/button_add_mods_asset.feature +11 -0
- data/test_support/features/contributor_add.feature +39 -0
- data/test_support/features/file_assets_list.feature +32 -0
- data/test_support/features/file_upload.feature +40 -0
- data/test_support/features/home_page.feature +9 -0
- data/test_support/features/html_validity.feature +47 -0
- data/test_support/features/mods_asset_contributors_edit.feature +80 -0
- data/test_support/features/mods_asset_create.feature +12 -0
- data/test_support/features/mods_asset_edit.feature +33 -0
- data/test_support/features/mods_asset_edit_without_permission.feature +10 -0
- data/test_support/features/mods_asset_search_result.feature +13 -0
- data/test_support/features/mods_asset_show.feature +39 -0
- data/test_support/features/permissions_add.feature +15 -0
- data/test_support/features/permissions_edit.feature +63 -0
- data/test_support/features/step_definitions/catalog_index_steps.rb +14 -0
- data/test_support/features/step_definitions/create_asset_steps.rb +7 -0
- data/test_support/features/step_definitions/edit_metadata_steps.rb +73 -0
- data/test_support/features/step_definitions/file_list_steps.rb +28 -0
- data/test_support/features/step_definitions/hydra_metadata_steps.rb +3 -0
- data/test_support/features/step_definitions/hydra_steps.rb +8 -0
- data/test_support/features/step_definitions/inline_editable_edit_steps.rb +77 -0
- data/test_support/features/step_definitions/search_steps.rb +88 -0
- data/test_support/features/step_definitions/searching_steps.rb +22 -0
- data/test_support/features/step_definitions/show_document_steps.rb +85 -0
- data/test_support/features/step_definitions/user_steps.rb +36 -0
- data/test_support/features/step_definitions/web_steps.rb +219 -0
- data/test_support/features/support/env.rb +55 -0
- data/test_support/features/support/paths.rb +80 -0
- data/test_support/features/switch_users.feature +14 -0
- data/test_support/features/view_catalog_index.feature +18 -0
- data/test_support/fixtures/empty_file.txt +0 -0
- data/test_support/fixtures/hydrangea_fixture_archivist_only_mods_article.foxml.xml +1212 -0
- data/test_support/fixtures/hydrangea_fixture_file_asset1.foxml.xml +4946 -0
- data/test_support/fixtures/hydrangea_fixture_mods_article1.foxml.xml +234 -0
- data/test_support/fixtures/hydrangea_fixture_mods_article2.foxml.xml +177 -0
- data/test_support/fixtures/hydrangea_fixture_mods_article3.foxml.xml +170 -0
- data/test_support/fixtures/hydrangea_fixture_mods_dataset1.foxml.xml +187 -0
- data/test_support/fixtures/hydrangea_fixture_uploaded_svg1.foxml.xml +676 -0
- data/test_support/fixtures/image.jp2 +0 -0
- data/test_support/fixtures/libra-oa_1.foxml.xml +2324 -0
- data/test_support/fixtures/libra-oa_2.foxml.xml +2422 -0
- data/test_support/spec/controllers/assets_controller_spec.rb +113 -0
- data/test_support/spec/controllers/catalog_controller_spec.rb +148 -0
- data/test_support/spec/controllers/catalog_controller_viewing_context_spec.rb +62 -0
- data/test_support/spec/controllers/contributors_controller_spec.rb +47 -0
- data/test_support/spec/controllers/file_assets_controller_spec.rb +189 -0
- data/test_support/spec/controllers/hydra_controller_spec.rb +15 -0
- data/test_support/spec/controllers/permissions_controller_spec.rb +80 -0
- data/test_support/spec/controllers/user_sessions_controller_spec.rb +35 -0
- data/test_support/spec/generators/hydra-head_generator_spec.rb +14 -0
- data/test_support/spec/helpers/access_controls_enforcement_spec.rb +212 -0
- data/test_support/spec/helpers/access_controls_evaluation_spec.rb +35 -0
- data/test_support/spec/helpers/assets_controller_helper_spec.rb +71 -0
- data/test_support/spec/helpers/blacklight_helper_spec.rb +64 -0
- data/test_support/spec/helpers/file_assets_helper_spec.rb +107 -0
- data/test_support/spec/helpers/hydra-repository_controller_spec.rb +32 -0
- data/test_support/spec/helpers/hydra_assets_helper_spec.rb +195 -0
- data/test_support/spec/helpers/hydra_djatoka_helper_spec.rb +32 -0
- data/test_support/spec/helpers/hydra_fedora_metadata_helper_spec.rb +215 -0
- data/test_support/spec/helpers/hydra_helper_spec.rb +73 -0
- data/test_support/spec/helpers/hydra_model_methods_spec.rb +95 -0
- data/test_support/spec/helpers/hydra_uploader_helper_spec.rb +18 -0
- data/test_support/spec/helpers/javascript_includes_helper_spec.rb +43 -0
- data/test_support/spec/integration/file_asset_spec.rb +150 -0
- data/test_support/spec/lib/active_fedora_helper_spec.rb +56 -0
- data/test_support/spec/lib/catalog_spec.rb +16 -0
- data/test_support/spec/lib/common_mods_index_methods_spec.rb +28 -0
- data/test_support/spec/models/audio_asset_spec.rb +23 -0
- data/test_support/spec/models/file_asset_spec.rb +42 -0
- data/test_support/spec/models/generic_content_spec.rb +29 -0
- data/test_support/spec/models/generic_image_spec.rb +58 -0
- data/test_support/spec/models/hydra_rights_metadata_spec.rb +162 -0
- data/test_support/spec/models/image_asset_spec.rb +23 -0
- data/test_support/spec/models/mods_asset_spec.rb +29 -0
- data/test_support/spec/models/role_mapper_spec.rb +22 -0
- data/test_support/spec/models/user_spec.rb +52 -0
- data/test_support/spec/models/video_asset_spec.rb +23 -0
- data/test_support/spec/rcov.opts +3 -0
- data/test_support/spec/spec.opts +4 -0
- data/test_support/spec/spec_helper.rb +44 -0
- data/test_support/spec/support/matchers/helper_matcher.rb +14 -0
- data/test_support/spec/support/matchers/solr_matchers.rb +60 -0
- data/test_support/spec/unit/hydra-head-engine_spec.rb +8 -0
- data/test_support/spec/unit/hydra-head_spec.rb +8 -0
- data/test_support/spec/utilities/hydra_testing_server_spec.rb +49 -0
- data/test_support/spec/views/uploader.html.erb_spec.rb +30 -0
- data/vendor/cache/RedCloth-4.2.3.gem +0 -0
- data/vendor/cache/abstract-1.0.0.gem +0 -0
- data/vendor/cache/actionmailer-3.0.9.gem +0 -0
- data/vendor/cache/actionpack-3.0.9.gem +0 -0
- data/vendor/cache/active-fedora-2.3.3.gem +0 -0
- data/vendor/cache/activemodel-3.0.9.gem +0 -0
- data/vendor/cache/activerecord-3.0.9.gem +0 -0
- data/vendor/cache/activeresource-3.0.9.gem +0 -0
- data/vendor/cache/activesupport-3.0.9.gem +0 -0
- data/vendor/cache/arel-2.0.10.gem +0 -0
- data/vendor/cache/blacklight-3.0.0.gem +0 -0
- data/vendor/cache/block_helpers-0.3.3.gem +0 -0
- data/vendor/cache/builder-2.1.2.gem +0 -0
- data/vendor/cache/capybara-1.0.0.gem +0 -0
- data/vendor/cache/childprocess-0.2.0.gem +0 -0
- data/vendor/cache/columnize-0.3.4.gem +0 -0
- data/vendor/cache/crack-0.1.8.gem +0 -0
- data/vendor/cache/cucumber-1.0.2.gem +0 -0
- data/vendor/cache/cucumber-rails-1.0.2.gem +0 -0
- data/vendor/cache/curb-0.7.15.gem +0 -0
- data/vendor/cache/daemons-1.1.4.gem +0 -0
- data/vendor/cache/database_cleaner-0.6.7.gem +0 -0
- data/vendor/cache/diff-lcs-1.1.2.gem +0 -0
- data/vendor/cache/equivalent-xml-0.2.7.gem +0 -0
- data/vendor/cache/erubis-2.6.6.gem +0 -0
- data/vendor/cache/facets-2.8.4.gem +0 -0
- data/vendor/cache/factory_girl-1.3.3.gem +0 -0
- data/vendor/cache/fastercsv-1.5.4.gem +0 -0
- data/vendor/cache/ffi-1.0.9.gem +0 -0
- data/vendor/cache/gherkin-2.4.5.gem +0 -0
- data/vendor/cache/haml-3.1.2.gem +0 -0
- data/vendor/cache/httparty-0.7.8.gem +0 -0
- data/vendor/cache/i18n-0.5.0.gem +0 -0
- data/vendor/cache/jettywrapper-0.0.10.gem +0 -0
- data/vendor/cache/json-1.5.3.gem +0 -0
- data/vendor/cache/json_pure-1.5.3.gem +0 -0
- data/vendor/cache/kaminari-0.12.4.gem +0 -0
- data/vendor/cache/launchy-2.0.3.gem +0 -0
- data/vendor/cache/linecache-0.46.gem +0 -0
- data/vendor/cache/logger-1.2.8.gem +0 -0
- data/vendor/cache/mail-2.2.19.gem +0 -0
- data/vendor/cache/marc-0.4.3.gem +0 -0
- data/vendor/cache/mediashelf-loggable-0.4.2.gem +0 -0
- data/vendor/cache/mime-types-1.16.gem +0 -0
- data/vendor/cache/mocha-0.9.12.gem +0 -0
- data/vendor/cache/multipart-post-1.1.2.gem +0 -0
- data/vendor/cache/nokogiri-1.5.0.gem +0 -0
- data/vendor/cache/om-1.2.5.gem +0 -0
- data/vendor/cache/polyglot-0.3.1.gem +0 -0
- data/vendor/cache/rack-1.2.3.gem +0 -0
- data/vendor/cache/rack-mount-0.6.14.gem +0 -0
- data/vendor/cache/rack-test-0.5.7.gem +0 -0
- data/vendor/cache/rails-3.0.9.gem +0 -0
- data/vendor/cache/railties-3.0.9.gem +0 -0
- data/vendor/cache/rake-0.9.2.gem +0 -0
- data/vendor/cache/rbx-require-relative-0.0.5.gem +0 -0
- data/vendor/cache/rcov-0.9.9.gem +0 -0
- data/vendor/cache/rdoc-3.8.gem +0 -0
- data/vendor/cache/rsolr-1.0.2.gem +0 -0
- data/vendor/cache/rsolr-ext-1.0.3.gem +0 -0
- data/vendor/cache/rspec-2.6.0.gem +0 -0
- data/vendor/cache/rspec-core-2.6.4.gem +0 -0
- data/vendor/cache/rspec-expectations-2.6.0.gem +0 -0
- data/vendor/cache/rspec-mocks-2.6.0.gem +0 -0
- data/vendor/cache/rspec-rails-2.6.1.gem +0 -0
- data/vendor/cache/ruby-debug-0.10.4.gem +0 -0
- data/vendor/cache/ruby-debug-base-0.10.4.gem +0 -0
- data/vendor/cache/rubyzip-0.9.4.gem +0 -0
- data/vendor/cache/sanitize-2.0.3.gem +0 -0
- data/vendor/cache/selenium-webdriver-0.2.2.gem +0 -0
- data/vendor/cache/solr-ruby-0.0.8.gem +0 -0
- data/vendor/cache/solrizer-1.1.0.gem +0 -0
- data/vendor/cache/solrizer-fedora-1.1.0.gem +0 -0
- data/vendor/cache/sqlite3-ruby-1.2.5.gem +0 -0
- data/vendor/cache/stomp-1.1.9.gem +0 -0
- data/vendor/cache/term-ansicolor-1.0.5.gem +0 -0
- data/vendor/cache/thor-0.14.6.gem +0 -0
- data/vendor/cache/treetop-1.4.9.gem +0 -0
- data/vendor/cache/trollop-1.16.2.gem +0 -0
- data/vendor/cache/tzinfo-0.3.29.gem +0 -0
- data/vendor/cache/unicode-0.4.0.gem +0 -0
- data/vendor/cache/will_paginate-2.3.15.gem +0 -0
- data/vendor/cache/xml-simple-1.1.0.gem +0 -0
- data/vendor/cache/xpath-0.1.4.gem +0 -0
- data/vendor/cache/yard-0.7.2.gem +0 -0
- metadata +1110 -0
@@ -0,0 +1,42 @@
|
|
1
|
+
|
2
|
+
h2. Fixtures
|
3
|
+
|
4
|
+
Fixtures are loaded from a directory _within the test app_, which is updated when you run rake hyhead:setup_test_app so in order to update a fixture, you must change it in test_support/fixtures and then either re-run rake hyhead:setup_test_app or copy the fixture into tmp/test_app/test_support/fixtures
|
5
|
+
|
6
|
+
h2. User objects
|
7
|
+
|
8
|
+
Blacklight has switched to using devise instead of authlogic as its default user/authentication system. As part of this switch, no longer have a "login" attribute as their unique identifier. Instead, you must use email as the unique identifier.
|
9
|
+
|
10
|
+
h2. User Attributes
|
11
|
+
|
12
|
+
User attributes (first_name, last_name, full_name, affiliation and photo) have been removed from HydraHead.
|
13
|
+
|
14
|
+
h2. Controllers
|
15
|
+
|
16
|
+
* Removed Djatoka (JPEG 2000) support and the GetController
|
17
|
+
|
18
|
+
h2. Views
|
19
|
+
|
20
|
+
* removed fluid infusion javascript
|
21
|
+
* moved javascripts from the plugin directory. Update your views to remove ":plugin=>:hydra_repository"
|
22
|
+
|
23
|
+
h3. What this means:
|
24
|
+
|
25
|
+
* Our sample user "archivist1" is now "archivist1@example.com".
|
26
|
+
* Your cucumber features and rspec tests must use email addresses as the unique identifier for Users
|
27
|
+
|
28
|
+
Change your features and role_map YAML files accordingly.
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
h2. How to upgrade
|
34
|
+
|
35
|
+
* Create a new rails 3 project
|
36
|
+
* Add ```gem 'blacklight'``` and ```gem 'hydra-head'``` to the Gemfile
|
37
|
+
* run ```bundle install```
|
38
|
+
* cp -r old_project/vendor/plugin/old_project_plugin/app/* new_project/app
|
39
|
+
* cp -r old_project/vendor/plugin/old_project_plugin/lib/* new_project/lib
|
40
|
+
* copy any tests (test, spec, feature, etc) from the old_project_plugin directory to the new project
|
41
|
+
|
42
|
+
|
data/Rakefile
ADDED
data/TESTING.textile
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
h1. Directions to Clone and Test the Rails 3 hydra-head Code
|
2
|
+
|
3
|
+
h2. For the Impatient
|
4
|
+
|
5
|
+
# clone the hydra-head code (to a fresh working copy) <pre>git clone git@github.com:projecthydra/hydra-head.git</pre>
|
6
|
+
# switch tot he hydra-head directory <pre>cd hydra-head</pre>
|
7
|
+
# checkout the rails3 branch <pre>git checkout rails3</pre>
|
8
|
+
# install bundler gem <pre>gem install bundler</pre>
|
9
|
+
# Get the project dependencies <pre>bundle install</pre>
|
10
|
+
# grab the jetty submodule <pre>git submodule init; git submodule update</pre>
|
11
|
+
# test <pre>rake hyhead:ci</pre> This command:
|
12
|
+
## creates the test app in tmp/test_app
|
13
|
+
## spins up jetty (in jettywrapper)
|
14
|
+
## imports fixtures
|
15
|
+
## runs rspec & cucumber tests
|
16
|
+
|
17
|
+
h2. More Detailed Instructions & Notes
|
18
|
+
|
19
|
+
h3. The Hydra Jetty
|
20
|
+
|
21
|
+
In order to test the gem during development, the hydra-jetty is included as a submodule to provide both a fedora and solr instance. Once you have cloned the github repository,
|
22
|
+
run the following commands to load the jetty:
|
23
|
+
|
24
|
+
<pre>
|
25
|
+
git submodule init
|
26
|
+
git submodule update
|
27
|
+
</pre>
|
28
|
+
|
29
|
+
To start the jetty:
|
30
|
+
|
31
|
+
<pre>
|
32
|
+
rake hydra:jetty:start
|
33
|
+
</pre>
|
34
|
+
|
35
|
+
Note: the first time you start the jetty, you must use the following command in order to properly configure the jetty:
|
36
|
+
|
37
|
+
<pre>
|
38
|
+
rake hydra:jetty:load
|
39
|
+
</pre>
|
40
|
+
|
41
|
+
|
42
|
+
h3. Testing the gem
|
43
|
+
|
44
|
+
The specs and features for testing the gem within the context of a rails 3 app are all contained within the test_support directory. Once you have
|
45
|
+
installed the test app, you will be able to run the specs/features from within that app via the provided rake tasks.
|
46
|
+
|
47
|
+
A rake task is provided for setting up a rails 3 test app in the tmp/test_app directory. To generate the app, run:
|
48
|
+
|
49
|
+
<pre>
|
50
|
+
rake hyhead:setup_test_app
|
51
|
+
</pre>
|
52
|
+
|
53
|
+
Once you have done this and have a jetty running, you are ready to run the specs and cucumbers:
|
54
|
+
|
55
|
+
<pre>
|
56
|
+
rake hyhead:test
|
57
|
+
</pre>
|
58
|
+
|
59
|
+
This will run the specs and cucumber features from within the test application.
|
60
|
+
|
61
|
+
In order to run a single spec or cucumber feature, use the following from the command line:
|
62
|
+
|
63
|
+
<pre>
|
64
|
+
export RAILS_ROOT="tmp/test_app"
|
65
|
+
rspec test_support/spec/controllers/catalog_controller_spec.rb # path to the spec file you wish to run
|
66
|
+
cucumber test_support/features/mods_asset_show.feature # path to the feature file you wish to run
|
67
|
+
</pre>
|
68
|
+
|
69
|
+
h2. Note about vendor/cache directory
|
70
|
+
|
71
|
+
In order to more quickly install the required gems, the gems have been cached and are stored in the vendor/cache directory. Initially this was done to avoid the
|
72
|
+
excessive amount of time bundler was taking to install all the gems and their dependencies. To get all the requisite gems, simply run:
|
73
|
+
|
74
|
+
<pre>
|
75
|
+
bundle install --local
|
76
|
+
</pre>
|
77
|
+
|
78
|
+
The cached gems also provide a quick means for generating a gemset for the test_app.
|
79
|
+
|
80
|
+
When developing the hydra-head gem, be sure to commit changes to the vendor/cache directory when you update or install a new gem.
|
81
|
+
|
82
|
+
h2. Note about solr and fedora config files
|
83
|
+
|
84
|
+
When you change the solr and fedora config files, you must update them in the generator templates directory (lib/generators/hydra-head) as well as root of the hydra_head code.
|
85
|
+
|
@@ -0,0 +1,117 @@
|
|
1
|
+
require 'mediashelf/active_fedora_helper'
|
2
|
+
|
3
|
+
class AssetsController < ApplicationController
|
4
|
+
include MediaShelf::ActiveFedoraHelper
|
5
|
+
include Blacklight::SolrHelper
|
6
|
+
include Hydra::RepositoryController
|
7
|
+
include Hydra::AssetsControllerHelper
|
8
|
+
# include WhiteListHelper
|
9
|
+
include ReleaseProcessHelper
|
10
|
+
|
11
|
+
|
12
|
+
include Blacklight::Catalog
|
13
|
+
helper :hydra
|
14
|
+
|
15
|
+
before_filter :search_session, :history_session
|
16
|
+
before_filter :require_solr, :require_fedora
|
17
|
+
|
18
|
+
prepend_before_filter :sanitize_update_params, :only=>:update
|
19
|
+
before_filter :check_embargo_date_format, :only=>:update
|
20
|
+
|
21
|
+
def show
|
22
|
+
if params.has_key?("field")
|
23
|
+
|
24
|
+
@response, @document = get_solr_response_for_doc_id
|
25
|
+
# @document = SolrDocument.new(@response.docs.first)
|
26
|
+
result = @document["#{params["field"]}_t"]
|
27
|
+
# document_fedora = SaltDocument.load_instance(params[:id])
|
28
|
+
# result = document_fedora.datastreams_in_memory[params["datastream"]].send("#{params[:field]}_values")
|
29
|
+
unless result.nil?
|
30
|
+
if params.has_key?("field_index")
|
31
|
+
result = result[params["field_index"].to_i-1]
|
32
|
+
elsif result.kind_of?(Array)
|
33
|
+
result = result.first
|
34
|
+
end
|
35
|
+
end
|
36
|
+
respond_to do |format|
|
37
|
+
format.html { render :text=>result }
|
38
|
+
format.textile { render :text=> RedCloth.new(result, [:sanitize_html]).to_html }
|
39
|
+
end
|
40
|
+
else
|
41
|
+
redirect_to :controller=>"catalog", :action=>"show"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# Uses the update_indexed_attributes method provided by ActiveFedora::Base
|
46
|
+
# This should behave pretty much like the ActiveRecord update_indexed_attributes method
|
47
|
+
# For more information, see the ActiveFedora docs.
|
48
|
+
#
|
49
|
+
# @example Appends a new "subject" value of "My Topic" to on the descMetadata datastream in in the _PID_ document.
|
50
|
+
# put :update, :id=>"_PID_", "asset"=>{"descMetadata"=>{"subject"=>{"-1"=>"My Topic"}}
|
51
|
+
# @example Sets the 1st and 2nd "medium" values on the descMetadata datastream in the _PID_ document, overwriting any existing values.
|
52
|
+
# put :update, :id=>"_PID_", "asset"=>{"descMetadata"=>{"medium"=>{"0"=>"Paper Document", "1"=>"Image"}}
|
53
|
+
def update
|
54
|
+
@document = load_document_from_params
|
55
|
+
|
56
|
+
logger.debug("attributes submitted: #{@sanitized_params.inspect}")
|
57
|
+
|
58
|
+
@response = update_document(@document, @sanitized_params)
|
59
|
+
|
60
|
+
@document.save
|
61
|
+
flash[:notice] = "Your changes have been saved."
|
62
|
+
|
63
|
+
logger.debug("returning #{response.inspect}")
|
64
|
+
|
65
|
+
respond_to do |want|
|
66
|
+
want.html {
|
67
|
+
redirect_to :controller=>"catalog", :action=>"edit"
|
68
|
+
}
|
69
|
+
want.js {
|
70
|
+
render :json=> tidy_response_from_update(@response)
|
71
|
+
}
|
72
|
+
want.textile {
|
73
|
+
if @response.kind_of?(Hash)
|
74
|
+
textile_response = tidy_response_from_update(@response).values.first
|
75
|
+
end
|
76
|
+
render :text=> RedCloth.new(textile_response, [:sanitize_html]).to_html
|
77
|
+
}
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def new
|
82
|
+
af_model = retrieve_af_model(params[:content_type])
|
83
|
+
if af_model
|
84
|
+
@asset = af_model.new
|
85
|
+
apply_depositor_metadata(@asset)
|
86
|
+
set_collection_type(@asset, params[:content_type])
|
87
|
+
@asset.save
|
88
|
+
model_display_name = af_model.to_s.camelize.scan(/[A-Z][^A-Z]*/).join(" ")
|
89
|
+
msg = "Created a #{model_display_name} with pid #{@asset.pid}. Now it's ready to be edited."
|
90
|
+
flash[:notice]= msg
|
91
|
+
end
|
92
|
+
redirect_to url_for(:action=>"edit", :controller=>"catalog", :id=>@asset.pid)
|
93
|
+
end
|
94
|
+
|
95
|
+
def destroy
|
96
|
+
af = ActiveFedora::Base.load_instance_from_solr(params[:id])
|
97
|
+
the_model = ActiveFedora::ContentModel.known_models_for( af ).first
|
98
|
+
unless the_model.nil?
|
99
|
+
af = the_model.load_instance_from_solr(params[:id])
|
100
|
+
assets = af.destroy_child_assets
|
101
|
+
end
|
102
|
+
af.delete
|
103
|
+
msg = "Deleted #{params[:id]}"
|
104
|
+
msg.concat(" and associated file_asset(s): #{assets.join(", ")}") unless assets.empty?
|
105
|
+
flash[:notice]= msg
|
106
|
+
redirect_to url_for(:action => 'index', :controller => "catalog", :q => nil , :f => nil)
|
107
|
+
end
|
108
|
+
|
109
|
+
|
110
|
+
# This is a method to simply remove the item from SOLR but keep the object in fedora.
|
111
|
+
alias_method :withdraw, :destroy
|
112
|
+
|
113
|
+
#def withdraw
|
114
|
+
#
|
115
|
+
#end
|
116
|
+
|
117
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'mediashelf/active_fedora_helper'
|
2
|
+
|
3
|
+
class ContributorsController < ApplicationController
|
4
|
+
|
5
|
+
include MediaShelf::ActiveFedoraHelper
|
6
|
+
before_filter :require_solr, :require_fedora
|
7
|
+
|
8
|
+
# Display form for adding a new Contributor
|
9
|
+
# If contributor_type is provided, renders the appropriate "new" form
|
10
|
+
# If contributor_type is not provided, renders a form for selecting which type of contributor to add
|
11
|
+
# If format is .inline, this renders without layout so you can embed it in a page
|
12
|
+
def new
|
13
|
+
|
14
|
+
# Only load the document if you need to
|
15
|
+
if params.has_key?(:contributor_type)
|
16
|
+
@document_fedora = load_document_from_id(params[:asset_id])
|
17
|
+
@next_contributor_index = @document_fedora
|
18
|
+
end
|
19
|
+
|
20
|
+
respond_to do |format|
|
21
|
+
format.html { render :file=>"contributors/new.html" , :layout=>true}
|
22
|
+
format.inline { render :partial=>"contributors/new.html", :layout=>false }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def create
|
27
|
+
@document_fedora = load_document_from_id(params[:asset_id])
|
28
|
+
|
29
|
+
ct = params[:contributor_type]
|
30
|
+
inserted_node, new_node_index = @document_fedora.insert_contributor(ct)
|
31
|
+
@document_fedora.save
|
32
|
+
partial_name = "contributors/edit_#{ct}.html"
|
33
|
+
respond_to do |format|
|
34
|
+
format.html { redirect_to( url_for(:controller=>"catalog", :action=>"edit", :id=>params[:asset_id] )+"##{params[:contributor_type]}_#{new_node_index}" ) }
|
35
|
+
format.inline { render :partial=>partial_name, :locals=>{"edit_#{ct}".to_sym =>inserted_node, "edit_#{ct}_counter".to_sym =>new_node_index}, :layout=>false }
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
def destroy
|
41
|
+
af_model = retrieve_af_model(params[:content_type], :default=>ModsAsset)
|
42
|
+
@document_fedora = af_model.find(params[:asset_id])
|
43
|
+
@document_fedora.remove_contributor(params[:contributor_type], params[:index])
|
44
|
+
result = @document_fedora.save
|
45
|
+
render :text=>result.inspect
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def load_document_from_id(asset_id)
|
51
|
+
af_model = retrieve_af_model(params[:content_type], :default=>ModsAsset)
|
52
|
+
af_model.find(asset_id)
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,152 @@
|
|
1
|
+
|
2
|
+
class FileAssetsController < ApplicationController
|
3
|
+
|
4
|
+
include Hydra::AccessControlsEnforcement
|
5
|
+
include Hydra::AssetsControllerHelper
|
6
|
+
include Hydra::FileAssetsHelper
|
7
|
+
include Hydra::RepositoryController
|
8
|
+
include MediaShelf::ActiveFedoraHelper
|
9
|
+
include Blacklight::SolrHelper
|
10
|
+
|
11
|
+
before_filter :require_fedora
|
12
|
+
before_filter :require_solr, :only=>[:index, :create, :show, :destroy]
|
13
|
+
prepend_before_filter :sanitize_update_params
|
14
|
+
|
15
|
+
helper :hydra_uploader
|
16
|
+
|
17
|
+
def index
|
18
|
+
=begin
|
19
|
+
Removed from file_assets/index.html.haml
|
20
|
+
-# javascript_includes << infusion_javascripts(:inline_edit, :extras=>[:inline_editor_integrations], :debug=>true, :render_html=>false)
|
21
|
+
-# javascript_includes << ['../infusion/framework/core/js/ProgressiveEnhancement.js', '../infusion/InfusionAll.js', {:cache=>true, :plugin=>"fluid-infusion"}]
|
22
|
+
|
23
|
+
- javascript_includes << "jquery.jeditable.mini"
|
24
|
+
- javascript_includes << 'custom'
|
25
|
+
- javascript_includes << "catalog/edit"
|
26
|
+
- javascript_includes << "jquery.hydraMetadata.js"
|
27
|
+
- javascript_includes << "/plugin_assets/fluid-infusion/infusion/components/undo/js/Undo.js"
|
28
|
+
- javascript_includes << "jquery.form.js"
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
=end
|
34
|
+
|
35
|
+
if params[:layout] == "false"
|
36
|
+
# action = "index_embedded"
|
37
|
+
layout = false
|
38
|
+
end
|
39
|
+
|
40
|
+
if params[:asset_id].nil?
|
41
|
+
# @solr_result = ActiveFedora::SolrService.instance.conn.query('has_model_field:info\:fedora/afmodel\:FileAsset', @search_params)
|
42
|
+
@solr_result = FileAsset.find_by_solr(:all)
|
43
|
+
else
|
44
|
+
container_uri = "info:fedora/#{params[:asset_id]}"
|
45
|
+
escaped_uri = container_uri.gsub(/(:)/, '\\:')
|
46
|
+
extra_controller_params = {:q=>"is_part_of_s:#{escaped_uri}"}
|
47
|
+
@response, @document_list = get_search_results( extra_controller_params )
|
48
|
+
|
49
|
+
# Including this line so permissions tests can be run against the container
|
50
|
+
@container_response, @document = get_solr_response_for_doc_id(params[:asset_id])
|
51
|
+
|
52
|
+
# Including these lines for backwards compatibility (until we can use Rails3 callbacks)
|
53
|
+
@container = ActiveFedora::Base.load_instance(params[:asset_id])
|
54
|
+
@solr_result = @container.file_objects(:response_format=>:solr)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Load permissions_solr_doc based on params[:asset_id]
|
58
|
+
load_permissions_from_solr(params[:asset_id])
|
59
|
+
|
60
|
+
render :action=>params[:action], :layout=>layout
|
61
|
+
end
|
62
|
+
|
63
|
+
def new
|
64
|
+
=begin
|
65
|
+
From file_assets/_new.html.haml
|
66
|
+
=render :partial=>"fluid_infusion/uploader"
|
67
|
+
=render :partial=>"fluid_infusion/uploader_js"
|
68
|
+
=end
|
69
|
+
render :partial=>"new", :layout=>false
|
70
|
+
end
|
71
|
+
|
72
|
+
# Creates and Saves a File Asset to contain the the Uploaded file
|
73
|
+
# If container_id is provided:
|
74
|
+
# * the File Asset will use RELS-EXT to assert that it's a part of the specified container
|
75
|
+
# * the method will redirect to the container object's edit view after saving
|
76
|
+
def create
|
77
|
+
if params.has_key?(:Filedata)
|
78
|
+
@file_asset = create_and_save_file_asset_from_params
|
79
|
+
apply_depositor_metadata(@file_asset)
|
80
|
+
|
81
|
+
flash[:notice] = "The file #{params[:Filename]} has been saved in <a href=\"#{asset_url(@file_asset.pid)}\">#{@file_asset.pid}</a>."
|
82
|
+
|
83
|
+
if !params[:asset_id].nil?
|
84
|
+
associate_file_asset_with_container
|
85
|
+
end
|
86
|
+
|
87
|
+
## Apply any posted file metadata
|
88
|
+
unless params[:asset].nil?
|
89
|
+
logger.debug("applying submitted file metadata: #{@sanitized_params.inspect}")
|
90
|
+
apply_file_metadata
|
91
|
+
end
|
92
|
+
# If redirect_params has not been set, use {:action=>:index}
|
93
|
+
logger.debug "Created #{@file_asset.pid}."
|
94
|
+
else
|
95
|
+
flash[:notice] = "You must specify a file to upload."
|
96
|
+
end
|
97
|
+
|
98
|
+
if !params[:asset_id].nil?
|
99
|
+
redirect_params = {:controller=>"catalog", :id=>params[:asset_id], :action=>:edit}
|
100
|
+
end
|
101
|
+
|
102
|
+
redirect_params ||= {:action=>:index}
|
103
|
+
|
104
|
+
redirect_to redirect_params
|
105
|
+
end
|
106
|
+
|
107
|
+
# Common destroy method for all AssetsControllers
|
108
|
+
def destroy
|
109
|
+
# The correct implementation, with garbage collection:
|
110
|
+
# if params.has_key?(:container_id)
|
111
|
+
# container = ActiveFedora::Base.load_instance(params[:container_id])
|
112
|
+
# container.file_objects_remove(params[:id])
|
113
|
+
# FileAsset.garbage_collect(params[:id])
|
114
|
+
# else
|
115
|
+
|
116
|
+
# The dirty implementation (leaves relationship in container object, deletes regardless of whether the file object has other containers)
|
117
|
+
ActiveFedora::Base.load_instance(params[:id]).delete
|
118
|
+
render :text => "Deleted #{params[:id]} from #{params[:asset_id]}."
|
119
|
+
end
|
120
|
+
|
121
|
+
|
122
|
+
def show
|
123
|
+
@file_asset = FileAsset.find(params[:id])
|
124
|
+
if (@file_asset.nil?)
|
125
|
+
logger.warn("No such file asset: " + params[:id])
|
126
|
+
flash[:notice]= "No such file asset."
|
127
|
+
redirect_to(:action => 'index', :q => nil , :f => nil)
|
128
|
+
else
|
129
|
+
# get array of parent (container) objects for this FileAsset
|
130
|
+
@id_array = @file_asset.containers(:response_format => :id_array)
|
131
|
+
@downloadable = false
|
132
|
+
# A FileAsset is downloadable iff the user has read or higher access to a parent
|
133
|
+
@id_array.each do |pid|
|
134
|
+
@response, @document = get_solr_response_for_doc_id(pid)
|
135
|
+
if reader?
|
136
|
+
@downloadable = true
|
137
|
+
break
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
if @downloadable
|
142
|
+
if @file_asset.datastreams_in_memory.include?("DS1")
|
143
|
+
send_datastream @file_asset.datastreams_in_memory["DS1"]
|
144
|
+
end
|
145
|
+
else
|
146
|
+
flash[:notice]= "You do not have sufficient access privileges to download this document, which has been marked private."
|
147
|
+
redirect_to(:action => 'index', :q => nil , :f => nil)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
end
|