hydra-head 3.0.0pre1
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.
- 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
data/solr_conf/solr.xml
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<!--
|
|
3
|
+
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
4
|
+
contributor license agreements. See the NOTICE file distributed with
|
|
5
|
+
this work for additional information regarding copyright ownership.
|
|
6
|
+
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
7
|
+
(the "License"); you may not use this file except in compliance with
|
|
8
|
+
the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
See the License for the specific language governing permissions and
|
|
16
|
+
limitations under the License.
|
|
17
|
+
-->
|
|
18
|
+
|
|
19
|
+
<!--
|
|
20
|
+
All (relative) paths are relative to the installation path
|
|
21
|
+
|
|
22
|
+
persistent: Save changes made via the API to this file
|
|
23
|
+
sharedLib: path to a lib directory that will be shared across all cores
|
|
24
|
+
-->
|
|
25
|
+
<solr persistent="false">
|
|
26
|
+
|
|
27
|
+
<!--
|
|
28
|
+
adminPath: RequestHandler path to manage cores.
|
|
29
|
+
If 'null' (or absent), cores will not be manageable via REST
|
|
30
|
+
-->
|
|
31
|
+
<cores adminPath="/admin/cores">
|
|
32
|
+
<core name="core0" instanceDir="core0" />
|
|
33
|
+
<core name="core1" instanceDir="core1" />
|
|
34
|
+
</cores>
|
|
35
|
+
</solr>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#require 'rake/testtask'
|
|
2
|
+
require 'rspec/core'
|
|
3
|
+
require 'rspec/core/rake_task'
|
|
4
|
+
|
|
5
|
+
namespace :hyhead do
|
|
6
|
+
namespace :fixture do
|
|
7
|
+
desc "Call hydra:delete"
|
|
8
|
+
task :delete => ["hyhead:use_test_app"] do
|
|
9
|
+
puts %x[rake hydra:delete]
|
|
10
|
+
FileUtils.cd('../../')
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
desc "Call hydra:harvest_fixture"
|
|
14
|
+
task :harvest => ["hyhead:use_test_app"] do
|
|
15
|
+
puts %x[rake hydra:harvest_fixture]
|
|
16
|
+
FileUtils.cd('../../')
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
desc "Call hydra:import_fixture from within the test app"
|
|
20
|
+
task :import => ["hyhead:use_test_app"] do
|
|
21
|
+
puts %x[rake hydra:import_fixture]
|
|
22
|
+
FileUtils.cd('../../')
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
desc "Call hydra:refresh_fixture from within the test app"
|
|
27
|
+
task :refresh => ["hyhead:use_test_app"] do
|
|
28
|
+
puts %x[rake hydra:refresh_fixture]
|
|
29
|
+
FileUtils.cd('../../')
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
namespace :fixtures do
|
|
34
|
+
|
|
35
|
+
desc "Call hydra:fixtures:refresh from within the test app"
|
|
36
|
+
task :refresh => ["hyhead:use_test_app"] do
|
|
37
|
+
puts %x[rake hydra:fixtures:refresh]
|
|
38
|
+
FileUtils.cd('../../')
|
|
39
|
+
end
|
|
40
|
+
# task :load => ["hyhead:use_test_app"] do
|
|
41
|
+
# Rake::Task['hydra:default_fixtures:load'].invoke
|
|
42
|
+
# end
|
|
43
|
+
# task :delete do
|
|
44
|
+
# Rake::Task['hydra:default_fixtures:delete'].invoke
|
|
45
|
+
# end
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
desc "Call hydra:purge_range"
|
|
49
|
+
task :purge_range => ["hyhead:use_test_app"] do
|
|
50
|
+
puts %x[rake hydra:purge_range]
|
|
51
|
+
FileUtils.cd('../../')
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
#require 'rake/testtask'
|
|
2
|
+
require 'rspec/core'
|
|
3
|
+
require 'rspec/core/rake_task'
|
|
4
|
+
require 'thor/core_ext/file_binary_read'
|
|
5
|
+
|
|
6
|
+
namespace :hyhead do
|
|
7
|
+
|
|
8
|
+
desc "Execute Continuous Integration build (docs, tests with coverage)"
|
|
9
|
+
task :ci do
|
|
10
|
+
Rake::Task["hyhead:doc"].invoke
|
|
11
|
+
Rake::Task["hydra:jetty:config"].invoke
|
|
12
|
+
|
|
13
|
+
require 'jettywrapper'
|
|
14
|
+
jetty_params = {
|
|
15
|
+
:jetty_home => File.expand_path(File.dirname(__FILE__) + '/../jetty'),
|
|
16
|
+
:quiet => false,
|
|
17
|
+
:jetty_port => 8983,
|
|
18
|
+
:solr_home => File.expand_path(File.dirname(__FILE__) + '/../jetty/solr'),
|
|
19
|
+
:fedora_home => File.expand_path(File.dirname(__FILE__) + '/../jetty/fedora/default'),
|
|
20
|
+
:startup_wait => 30
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# does this make jetty run in TEST environment???
|
|
24
|
+
error = Jettywrapper.wrap(jetty_params) do
|
|
25
|
+
Rake::Task['hyhead:setup_test_app'].invoke
|
|
26
|
+
puts %x[rake hyhead:fixtures:refresh RAILS_ENV=test] # calling hydra:fixtures:refresh from the root of the test app
|
|
27
|
+
Rake::Task['hyhead:test'].invoke
|
|
28
|
+
end
|
|
29
|
+
raise "test failures: #{error}" if error
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
desc "Easiest way to run rspec tests. Copies code to host plugins dir, loads fixtures, then runs specs - need to have jetty running."
|
|
34
|
+
task :spec => "rspec:setup_and_run"
|
|
35
|
+
|
|
36
|
+
namespace :rspec do
|
|
37
|
+
|
|
38
|
+
desc "Run the hydra-head specs - need to have jetty running, test host set up and fixtures loaded."
|
|
39
|
+
task :run => :use_test_app do
|
|
40
|
+
puts "Running rspec tests"
|
|
41
|
+
puts %x[rake hyhead:spec:run]
|
|
42
|
+
FileUtils.cd('../../')
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
desc "Sets up test host, loads fixtures, then runs specs - need to have jetty running."
|
|
46
|
+
task :setup_and_run => ["hyhead:setup_test_app"] do
|
|
47
|
+
puts "Reloading fixtures"
|
|
48
|
+
puts %x[rake hyhead:fixtures:refresh RAILS_ENV=test] # calling hydra:fixtures:refresh from the root of the test app
|
|
49
|
+
Rake::Task["hyhead:rspec:run"].invoke
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# The following is a task named :doc which generates documentation using yard
|
|
56
|
+
begin
|
|
57
|
+
require 'yard'
|
|
58
|
+
require 'yard/rake/yardoc_task'
|
|
59
|
+
project_root = File.expand_path("#{File.dirname(__FILE__)}/../")
|
|
60
|
+
doc_destination = File.join(project_root, 'doc')
|
|
61
|
+
if !File.exists?(doc_destination)
|
|
62
|
+
FileUtils.mkdir_p(doc_destination)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
YARD::Rake::YardocTask.new(:doc) do |yt|
|
|
66
|
+
readme_filename = 'README.textile'
|
|
67
|
+
textile_docs = []
|
|
68
|
+
Dir[File.join(project_root, "*.textile")].each_with_index do |f, index|
|
|
69
|
+
unless f.include?("/#{readme_filename}") # Skip readme, which is already built by the --readme option
|
|
70
|
+
textile_docs << '-'
|
|
71
|
+
textile_docs << f
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
yt.files = Dir.glob(File.join(project_root, '*.rb')) +
|
|
75
|
+
Dir.glob(File.join(project_root, 'app', '**', '*.rb')) +
|
|
76
|
+
Dir.glob(File.join(project_root, 'lib', '**', '*.rb')) +
|
|
77
|
+
textile_docs
|
|
78
|
+
yt.options = ['--output-dir', doc_destination, '--readme', readme_filename]
|
|
79
|
+
end
|
|
80
|
+
rescue LoadError
|
|
81
|
+
desc "Generate YARD Documentation"
|
|
82
|
+
task :doc do
|
|
83
|
+
abort "Please install the YARD gem to generate rdoc."
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
#
|
|
88
|
+
# Cucumber
|
|
89
|
+
#
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
# desc "Easieset way to run cucumber tests. Sets up test host, refreshes fixtures and runs cucumber tests"
|
|
93
|
+
# task :cucumber => "cucumber:setup_and_run"
|
|
94
|
+
task :cucumber => "cucumber:run"
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
namespace :cucumber do
|
|
98
|
+
|
|
99
|
+
desc "Run cucumber tests for hyhead - need to have jetty running, test host set up and fixtures loaded."
|
|
100
|
+
task :run => :set_test_host_path do
|
|
101
|
+
Dir.chdir(TEST_HOST_PATH)
|
|
102
|
+
puts "Running cucumber features in test host app"
|
|
103
|
+
puts %x[rake hyhead:cucumber]
|
|
104
|
+
# puts %x[cucumber --color --tags ~@pending --tags ~@overwritten features]
|
|
105
|
+
raise "Cucumber tests failed" unless $?.success?
|
|
106
|
+
FileUtils.cd('../../')
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# desc "Sets up test host, loads fixtures, then runs cucumber features - need to have jetty running."
|
|
110
|
+
# task :setup_and_run => ["hyhead:setup_test_app", "hyhead:remove_features_from_host", "hyhead:copy_features_to_host"] do
|
|
111
|
+
# system("rake hydra:fixtures:refresh environment=test")
|
|
112
|
+
# Rake::Task["hyhead:cucumber:run"].invoke
|
|
113
|
+
# end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Not sure if these are necessary - MZ 09Jul2011
|
|
117
|
+
# desc "Copy current contents of the features directory into TEST_HOST_PATH/test_support/features"
|
|
118
|
+
# task :copy_features_to_host => [:set_test_host_path] do
|
|
119
|
+
# features_dir = "#{TEST_HOST_PATH}/test_support/features"
|
|
120
|
+
# excluded = [".", ".."]
|
|
121
|
+
# FileUtils.mkdir_p(features_dir)
|
|
122
|
+
# puts "Copying features to #{features_dir}"
|
|
123
|
+
# # puts %x[ls -l test_support/features/mods_asset_search_result.feature]
|
|
124
|
+
# %x[cp -R test_support/features/* #{features_dir}]
|
|
125
|
+
# end
|
|
126
|
+
#
|
|
127
|
+
# desc "Remove TEST_HOST_PATH/test_support/features"
|
|
128
|
+
# task :remove_features_from_host => [:set_test_host_path] do
|
|
129
|
+
# features_dir = "#{TEST_HOST_PATH}/test_support/features"
|
|
130
|
+
# puts "Emptying out #{features_dir}"
|
|
131
|
+
# %x[rm -rf #{features_dir}]
|
|
132
|
+
# end
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
#
|
|
136
|
+
# Misc Tasks
|
|
137
|
+
#
|
|
138
|
+
|
|
139
|
+
desc "Creates a new test app"
|
|
140
|
+
task :setup_test_app => [:set_test_host_path] do
|
|
141
|
+
# Thor::Util.load_thorfile('tasks/test_app_builder.thor', nil, nil)
|
|
142
|
+
# klass, task = Thor::Util.find_class_and_task_by_namespace("hydra:test_app_builder:build")
|
|
143
|
+
# klass.start([task])
|
|
144
|
+
path = TEST_HOST_PATH
|
|
145
|
+
errors = []
|
|
146
|
+
puts "Cleaning out test app path"
|
|
147
|
+
%x[rm -fr #{path}]
|
|
148
|
+
errors << 'Error removing test app' unless $?.success?
|
|
149
|
+
|
|
150
|
+
FileUtils.mkdir_p(path)
|
|
151
|
+
|
|
152
|
+
puts "Copying over .rvmrc file"
|
|
153
|
+
FileUtils.cp("./test_support/etc/rvmrc",File.join(path,".rvmrc"))
|
|
154
|
+
FileUtils.cd("tmp")
|
|
155
|
+
system("source ./test_app/.rvmrc")
|
|
156
|
+
|
|
157
|
+
puts "Installing rails, bundler and devise"
|
|
158
|
+
%x[gem install --no-rdoc --no-ri 'rails']
|
|
159
|
+
%x[gem install --no-rdoc --no-ri 'bundler']
|
|
160
|
+
%x[gem install --no-rdoc --no-ri 'devise']
|
|
161
|
+
|
|
162
|
+
puts "Generating new rails app"
|
|
163
|
+
%x[rails new test_app]
|
|
164
|
+
errors << 'Error generating new rails test app' unless $?.success?
|
|
165
|
+
FileUtils.cd('test_app')
|
|
166
|
+
|
|
167
|
+
FileUtils.rm('public/index.html')
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
after = 'TestApp::Application.configure do'
|
|
171
|
+
replace!( "#{path}/config/environments/test.rb", /#{after}/, "#{after}\n config.log_level = :warn\n")
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
puts "Copying Gemfile from test_support/etc"
|
|
175
|
+
FileUtils.cp('../../test_support/etc/Gemfile','./Gemfile')
|
|
176
|
+
|
|
177
|
+
puts "Creating local vendor/cache dir and copying gems from hyhead-rails3 gemset"
|
|
178
|
+
FileUtils.cp_r(File.join('..','..','vendor','cache'), './vendor')
|
|
179
|
+
|
|
180
|
+
puts "Copying fixtures into test app spec/fixtures directory"
|
|
181
|
+
FileUtils.mkdir_p( File.join('.','test_support') )
|
|
182
|
+
FileUtils.cp_r(File.join('..','..','test_support','fixtures'), File.join('.','test_support','fixtures'))
|
|
183
|
+
|
|
184
|
+
puts "Executing bundle install --local"
|
|
185
|
+
%x[bundle install --local]
|
|
186
|
+
errors << 'Error running bundle install in test app' unless $?.success?
|
|
187
|
+
|
|
188
|
+
puts "Installing cucumber in test app"
|
|
189
|
+
%x[rails g cucumber:install]
|
|
190
|
+
errors << 'Error installing cucumber in test app' unless $?.success?
|
|
191
|
+
|
|
192
|
+
puts "generating default blacklight install"
|
|
193
|
+
%x[rails generate blacklight --devise]
|
|
194
|
+
errors << 'Error generating default blacklight install' unless $?.success?
|
|
195
|
+
|
|
196
|
+
puts "generating default hydra-head install"
|
|
197
|
+
%x[rails generate hydra:head -df] # using -f to force overwriting of solr.yml
|
|
198
|
+
errors << 'Error generating default hydra-head install' unless $?.success?
|
|
199
|
+
|
|
200
|
+
puts "Running rake db:migrate"
|
|
201
|
+
%x[rake db:migrate]
|
|
202
|
+
%x[rake db:migrate RAILS_ENV=test]
|
|
203
|
+
raise "Errors: #{errors.join("; ")}" unless errors.empty?
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
FileUtils.cd('../../')
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
task :set_test_host_path do
|
|
213
|
+
TEST_HOST_PATH = File.join(File.expand_path(File.dirname(__FILE__)),'..','tmp','test_app')
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
#
|
|
217
|
+
# Test
|
|
218
|
+
#
|
|
219
|
+
|
|
220
|
+
desc "Run tests against test app"
|
|
221
|
+
task :test => [:use_test_app] do
|
|
222
|
+
|
|
223
|
+
puts "Running rspec tests"
|
|
224
|
+
puts %x[rake hyhead:spec:rcov]
|
|
225
|
+
|
|
226
|
+
puts "Running cucumber tests"
|
|
227
|
+
puts %x[rake hyhead:cucumber]
|
|
228
|
+
|
|
229
|
+
FileUtils.cd('../../')
|
|
230
|
+
puts "Completed test suite"
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
desc "Make sure the test app is installed, then run the tasks from its root directory"
|
|
234
|
+
task :use_test_app => [:set_test_host_path] do
|
|
235
|
+
Rake::Task['hyhead:setup_test_app'].invoke unless File.exist?(TEST_HOST_PATH)
|
|
236
|
+
FileUtils.cd(TEST_HOST_PATH)
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
# Adds the content to the file.
|
|
242
|
+
#
|
|
243
|
+
def replace!(destination, regexp, string)
|
|
244
|
+
content = File.binread(destination)
|
|
245
|
+
content.gsub!(regexp, string)
|
|
246
|
+
File.open(destination, 'wb') { |file| file.write(content) }
|
|
247
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
require "hydra/testing_server"
|
|
2
|
+
|
|
3
|
+
# if you would like to see solr startup messages on STDERR
|
|
4
|
+
# when starting solr test server during functional tests use:
|
|
5
|
+
#
|
|
6
|
+
# rake SOLR_CONSOLE=true
|
|
7
|
+
JETTY_PARAMS = {
|
|
8
|
+
:quiet => ENV['HYDRA_CONSOLE'] ? false : true,
|
|
9
|
+
:jetty_home => ENV['HYDRA_JETTY_HOME'],
|
|
10
|
+
:jetty_port => 8983,
|
|
11
|
+
:solr_home => ENV['HYDRA_SOLR_HOME'],
|
|
12
|
+
:fedora_home => ENV['HYDRA_SOLR_HOME']
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
#:jetty_port => ENV['HYDRA_JETTY_PORT'],
|
|
16
|
+
namespace :hydra do
|
|
17
|
+
namespace :jetty do
|
|
18
|
+
desc "Starts the bundled Hydra Testing Server"
|
|
19
|
+
task :start do
|
|
20
|
+
Hydra::TestingServer.configure(JETTY_PARAMS)
|
|
21
|
+
Hydra::TestingServer.instance.start
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
desc "Stops the bundled Hydra Testing Server"
|
|
25
|
+
task :stop do
|
|
26
|
+
Hydra::TestingServer.instance.stop
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
desc "Restarts the bundled Hydra Testing Server"
|
|
30
|
+
task :restart do
|
|
31
|
+
Hydra::TestingServer.instance.stop
|
|
32
|
+
Hydra::TestingServer.configure(JETTY_PARAMS)
|
|
33
|
+
Hydra::TestingServer.instance.start
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
desc "Copies the default Solr & Fedora configs into the bundled Hydra Testing Server"
|
|
37
|
+
task :config do
|
|
38
|
+
Rake::Task["hydra:jetty:config_fedora"].invoke
|
|
39
|
+
Rake::Task["hydra:jetty:config_solr"].invoke
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
desc "Copies the default SOLR config for the bundled Hydra Testing Server"
|
|
43
|
+
task :config_solr do
|
|
44
|
+
FileList['solr_conf/conf/*'].each do |f|
|
|
45
|
+
cp("#{f}", 'jetty/solr/development-core/conf/', :verbose => true)
|
|
46
|
+
cp("#{f}", 'jetty/solr/test-core/conf/', :verbose => true)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
desc "Copies a custom fedora config for the bundled Hydra Testing Server"
|
|
52
|
+
task :config_fedora do
|
|
53
|
+
# load a custom fedora.fcfg -
|
|
54
|
+
if defined?(Rails.root)
|
|
55
|
+
app_root = Rails.root
|
|
56
|
+
else
|
|
57
|
+
app_root = File.join(File.dirname(__FILE__),"..")
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
fcfg = File.join(app_root,"fedora_conf","conf","fedora.fcfg")
|
|
61
|
+
puts "PWD:: #{FileUtils.pwd}"
|
|
62
|
+
if File.exists?(fcfg)
|
|
63
|
+
puts "copying over fedora.fcfg"
|
|
64
|
+
cp("#{fcfg}", 'jetty/fedora/default/server/config/', :verbose => true)
|
|
65
|
+
else
|
|
66
|
+
puts "#{fcfg} file not found -- skipping fedora config"
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
desc "Copies the default SOLR config files and starts up the fedora instance."
|
|
71
|
+
task :load => [:config, :start]
|
|
72
|
+
|
|
73
|
+
desc "Returns the status of the Hydra::TestingServer."
|
|
74
|
+
task :status do
|
|
75
|
+
status = Hydra::TestingServer.instance.pid ? "Running: #{Hydra::TestingServer.instance.pid}" : "Not running"
|
|
76
|
+
puts status
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
namespace :replicator do
|
|
2
|
+
|
|
3
|
+
desc 'Copy a fedora object of the given pid.'
|
|
4
|
+
task :copy_object => :environment do
|
|
5
|
+
if ENV['PID']
|
|
6
|
+
replicator = Solrizer::Replicator.new
|
|
7
|
+
replicator.replicate_object(ENV['PID'])
|
|
8
|
+
else
|
|
9
|
+
puts "You must provide a pid using the format 'replicator::copy_object PID=sample:pid'."
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
desc 'Copy all objects in the repository.'
|
|
14
|
+
task :copy_objects => :environment do
|
|
15
|
+
|
|
16
|
+
if ENV['REPLICATOR_LIST']
|
|
17
|
+
REPLICATOR_LIST = ENV['REPLICATOR_LIST']
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
replicator = Solrizer::Replicator.new
|
|
21
|
+
puts "Source URL: #{ActiveFedora.fedora_config[:url]}"
|
|
22
|
+
puts "Destination URL: #{replicator.configs["destination"]["fedora"]["url"]}"
|
|
23
|
+
replicator.replicate_objects
|
|
24
|
+
puts "Replicator task complete."
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
namespace :solrizer do
|
|
2
|
+
|
|
3
|
+
namespace :fedora do
|
|
4
|
+
desc 'Index a fedora object of the given pid.'
|
|
5
|
+
task :solrize => [:init, :environment] do
|
|
6
|
+
index_full_text = ENV['FULL_TEXT'] == 'true'
|
|
7
|
+
if ENV['PID']
|
|
8
|
+
puts "indexing #{ENV['PID'].inspect}"
|
|
9
|
+
solrizer = Solrizer::Fedora::Solrizer.new :index_full_text=> index_full_text
|
|
10
|
+
solrizer.solrize(ENV['PID'])
|
|
11
|
+
puts "Finished shelving #{ENV['PID']}"
|
|
12
|
+
else
|
|
13
|
+
puts "You must provide a pid using the format 'solrizer::solrize_object PID=sample:pid'."
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
desc 'Index all objects in the repository.'
|
|
18
|
+
task :solrize_objects => [:init, :environment] do
|
|
19
|
+
index_full_text = ENV['FULL_TEXT'] == 'true'
|
|
20
|
+
if ENV['INDEX_LIST']
|
|
21
|
+
@@index_list = ENV['INDEX_LIST']
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
puts "Re-indexing Fedora Repository."
|
|
25
|
+
puts "Fedora URL: #{ActiveFedora.fedora_config[:url]}"
|
|
26
|
+
puts "Fedora Solr URL: #{ActiveFedora.solr_config[:url]}"
|
|
27
|
+
puts "Blacklight Solr Config: #{Blacklight.solr_config.inspect}"
|
|
28
|
+
puts "Doing full text index." if index_full_text
|
|
29
|
+
solrizer = Solrizer::Fedora::Solrizer.new :index_full_text=> index_full_text
|
|
30
|
+
solrizer.solrize_objects
|
|
31
|
+
puts "Solrizer task complete."
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
desc 'Remove fedora-system objects from index'
|
|
35
|
+
task :forget_system_objects => :init do
|
|
36
|
+
objects = ::Fedora::Repository.instance.find_objects("pid~fedora-system:*")
|
|
37
|
+
objects.each do |obj|
|
|
38
|
+
logger.debug "Deleting solr doc for #{obj.pid} from #{ActiveFedora.solr_config[:url]}"
|
|
39
|
+
ActiveFedora::SolrService.instance.conn.delete(obj.pid)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
desc "Init solrizer-fedora configuration"
|
|
44
|
+
task :init do
|
|
45
|
+
if !ENV["environment"].nil?
|
|
46
|
+
RAILS_ENV = ENV["environment"]
|
|
47
|
+
end
|
|
48
|
+
# Don't need to do anything. The gem handles loading all configurations for you.
|
|
49
|
+
# ActiveFedora.init
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|