atrium 0.0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -1
- data/.rspec +2 -0
- data/.rvmrc +1 -1
- data/CONTRIBUTING.md +73 -0
- data/Gemfile +27 -2
- data/Gemfile.lock +122 -246
- data/Guardfile +40 -10
- data/LICENSE +14 -0
- data/README.mkd +23 -39
- data/ROADMAP.mkd +41 -9
- data/Rakefile +39 -4
- data/app/assets/images/atrium/remove.png +0 -0
- data/app/assets/images/atrium/white-arrow.png +0 -0
- data/app/assets/javascripts/{atrium/atrium.js → atrium.js} +8 -153
- data/app/assets/stylesheets/{atrium/atrium.css → atrium.css} +110 -37
- data/app/assets/stylesheets/atrium/collections.css +4 -0
- data/app/assets/stylesheets/atrium/descriptions.css +4 -0
- data/app/assets/stylesheets/atrium/exhibits.css +4 -0
- data/app/assets/stylesheets/atrium/reset.css +69 -0
- data/app/assets/stylesheets/atrium/showcases.css +4 -0
- data/app/assets/stylesheets/atrium/theme.css +248 -0
- data/app/controllers/atrium/application_controller.rb +12 -0
- data/app/controllers/atrium/browse_levels_controller.rb +22 -0
- data/app/controllers/atrium/collections_controller.rb +42 -138
- data/app/controllers/atrium/descriptions_controller.rb +27 -146
- data/app/controllers/atrium/exhibits_controller.rb +51 -77
- data/app/controllers/atrium/order_controller.rb +74 -0
- data/app/controllers/atrium/showcases_controller.rb +96 -117
- data/app/helpers/atrium/application_helper.rb +8 -0
- data/app/helpers/atrium/collections_helper.rb +44 -0
- data/app/helpers/atrium/descriptions_helper.rb +4 -0
- data/app/helpers/atrium/exhibits_helper.rb +4 -0
- data/app/helpers/atrium/showcases_helper.rb +34 -0
- data/app/models/atrium/browse_level.rb +21 -11
- data/app/models/atrium/collection.rb +70 -36
- data/app/models/atrium/configuration.rb +66 -0
- data/app/models/atrium/description.rb +39 -88
- data/app/models/atrium/essay.rb +4 -5
- data/app/models/atrium/exhibit.rb +28 -19
- data/app/models/atrium/is_showcased_mixin.rb +34 -0
- data/app/models/atrium/query_param_mixin.rb +105 -0
- data/app/models/atrium/search/facet.rb +14 -25
- data/app/models/atrium/search/facet_selection.rb +10 -12
- data/app/models/atrium/showcase.rb +105 -95
- data/app/models/atrium/showcase/facet_selection.rb +18 -18
- data/app/models/atrium/showcase/featured_selection.rb +15 -0
- data/app/services/browse_level_evaluation_service.rb +131 -0
- data/app/services/current_filter_query_params_extraction_service.rb +91 -0
- data/app/services/navigation_tree.rb +13 -0
- data/app/services/params_adaptor_for_filter.rb +18 -0
- data/app/views/atrium/collections/_form.html.erb +149 -72
- data/app/views/atrium/collections/_head.html.erb +3 -0
- data/app/views/atrium/collections/edit.html.erb +1 -4
- data/app/views/atrium/collections/index.html.erb +14 -0
- data/app/views/atrium/collections/new.html.erb +2 -5
- data/app/views/atrium/collections/show.html.erb +11 -29
- data/app/views/atrium/descriptions/_form.html.erb +47 -49
- data/app/views/atrium/descriptions/edit.html.erb +1 -2
- data/app/views/atrium/descriptions/index.html.erb +2 -8
- data/app/views/atrium/descriptions/new.html.erb +2 -1
- data/app/views/atrium/descriptions/show.html.erb +2 -20
- data/app/views/atrium/exhibits/_exhibit.html.erb +1 -0
- data/app/views/atrium/exhibits/_form.html.erb +143 -96
- data/app/views/atrium/exhibits/edit.html.erb +1 -8
- data/app/views/atrium/exhibits/index.html.erb +2 -0
- data/app/views/atrium/exhibits/new.html.erb +0 -5
- data/app/views/atrium/exhibits/show.html.erb +2 -34
- data/app/views/atrium/showcases/_configure_menu.html.erb +55 -0
- data/app/views/atrium/showcases/_form.html.erb +40 -0
- data/app/views/atrium/showcases/edit.html.erb +3 -0
- data/app/views/atrium/showcases/index.html.erb +32 -0
- data/app/views/atrium/showcases/new.html.erb +3 -0
- data/app/views/atrium/showcases/show.html.erb +2 -1
- data/app/views/layouts/atrium.html.erb +16 -24
- data/app/views/layouts/atrium/application.html.erb +49 -0
- data/app/views/layouts/atrium/themes/default.html.erb +15 -0
- data/app/views/shared/_list_searchs.html.erb +4 -0
- data/app/views/shared/_navigation.html.erb +19 -0
- data/atrium.gemspec +31 -64
- data/config/routes.rb +40 -10
- data/{lib/generators/atrium/templates/migrations/create_atrium_collections.rb → db/migrate/20120730170406_create_atrium_collections.rb} +2 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_showcases.rb → db/migrate/20120731134846_create_atrium_showcases.rb} +3 -4
- data/{lib/generators/atrium/templates/migrations/create_atrium_exhibits.rb → db/migrate/20120731134856_create_atrium_exhibits.rb} +2 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_descriptions.rb → db/migrate/20120731134904_create_atrium_descriptions.rb} +2 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_essays.rb → db/migrate/20120731135534_create_atrium_essays.rb} +3 -2
- data/{lib/generators/atrium/templates/migrations/create_atrium_search_facets.rb → db/migrate/20120731135721_create_atrium_search_facets.rb} +1 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_showcase_facet_selections.rb → db/migrate/20120731140621_create_atrium_showcase_facet_selections.rb} +6 -2
- data/{lib/generators/atrium/templates/migrations/create_atrium_browse_levels.rb → db/migrate/20120801145241_create_atrium_browse_levels.rb} +1 -1
- data/db/migrate/20120820183808_create_selected_items.rb +16 -0
- data/db/migrate/20120823135716_update_atrium_collection_indices.rb +13 -0
- data/db/migrate/20120823143315_add_lookup_indices_as_required.rb +11 -0
- data/lib/atrium.rb +40 -36
- data/lib/atrium/engine.rb +4 -8
- data/lib/atrium/exceptions.rb +10 -0
- data/lib/atrium/version.rb +2 -2
- data/lib/generators/atrium/install/USAGE +8 -0
- data/lib/generators/atrium/install/install_generator.rb +86 -0
- data/lib/generators/atrium/install/templates/atrium_initializer.rb +21 -0
- data/lib/generators/atrium/install/templates/controllers/atrium_base_controller.rb +18 -0
- data/lib/generators/atrium/install/templates/controllers/collections_controller.rb +40 -0
- data/lib/generators/atrium/install/templates/controllers/descriptions_controller.rb +36 -0
- data/lib/generators/atrium/install/templates/controllers/exhibits_controller.rb +47 -0
- data/lib/generators/atrium/install/templates/controllers/selected_items_controller.rb +26 -0
- data/lib/generators/atrium/install/templates/helpers/application_helper.rb +42 -0
- data/lib/generators/atrium/install/templates/helpers/collections_helper.rb +15 -0
- data/lib/generators/atrium/install/templates/helpers/navigation_helper.rb +62 -0
- data/lib/generators/atrium/install/templates/helpers/solr_helper.rb +138 -0
- data/lib/generators/atrium/install/templates/models/selected_item.rb +7 -0
- data/lib/generators/atrium/install/templates/views/collections/_document.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/collections/_exhibits.html.erb +3 -0
- data/lib/generators/atrium/install/templates/views/collections/_pagination.html.erb +6 -0
- data/lib/generators/atrium/install/templates/views/collections/browse.html.erb +16 -0
- data/lib/generators/atrium/install/templates/views/collections/show.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/descriptions/show.html.erb +8 -0
- data/lib/generators/atrium/install/templates/views/exhibits/_document.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/exhibits/_pagination.html.erb +6 -0
- data/lib/generators/atrium/install/templates/views/exhibits/show.html.erb +28 -0
- data/lib/generators/atrium/install/templates/views/folder/_selected_items_form.html.erb +8 -0
- data/lib/generators/atrium/install/templates/views/folder/index.html.erb +45 -0
- data/lib/generators/atrium/install/templates/views/shared/_document_list.html.erb +14 -0
- data/lib/generators/atrium/install/templates/views/shared/_featured_sources.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/shared/_list_descriptions.html.erb +25 -0
- data/lib/generators/atrium/install/templates/views/shared/_masthead.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/shared/_navigation_browse_level.html.erb +34 -0
- data/lib/generators/atrium/install/templates/views/shared/_showcases.html.erb +12 -0
- data/lib/generators/atrium/install/templates/views/shared/_side_bar_navigation.html.erb +20 -0
- data/lib/generators/atrium/service/USAGE +9 -0
- data/lib/generators/atrium/service/service_generator.rb +16 -0
- data/lib/generators/atrium/service/templates/service.rb.erb +2 -0
- data/lib/generators/atrium/service/templates/service_spec.rb.erb +4 -0
- data/lib/generators/atrium/theme/USAGE +8 -0
- data/lib/generators/atrium/theme/templates/theme.html.erb +14 -0
- data/lib/generators/atrium/theme/theme_generator.rb +11 -0
- data/lib/tasks/atrium_tasks.rake +4 -0
- data/script/rails +10 -0
- data/spec/atrium_spec.rb +10 -0
- data/spec/controllers/atrium/application_controller_spec.rb +7 -0
- data/spec/controllers/atrium/collections_controller_spec.rb +125 -0
- data/spec/controllers/atrium/descriptions_controller_spec.rb +142 -0
- data/spec/controllers/atrium/exhibits_controller_spec.rb +102 -0
- data/spec/controllers/atrium/order_controller_spec.rb +100 -0
- data/spec/controllers/atrium/showcases_controller_spec.rb +217 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/collection.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +59 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/db/schema.rb +124 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/test/fixtures/collections.yml +11 -0
- data/spec/dummy/test/unit/collection_test.rb +7 -0
- data/spec/factories/atrium_collections.rb +8 -0
- data/spec/factories/atrium_exhibits.rb +9 -0
- data/spec/factories/atrium_search_facets.rb +8 -0
- data/spec/factories/atrium_showcases.rb +25 -0
- data/spec/helpers/atrium/collections_helper_spec.rb +57 -0
- data/spec/helpers/atrium/showcases_helper_spec.rb +56 -0
- data/spec/models/atrium/browse_level_spec.rb +56 -0
- data/spec/models/atrium/collection_spec.rb +76 -0
- data/spec/models/atrium/configuration_spec.rb +114 -0
- data/spec/models/atrium/description_spec.rb +56 -0
- data/spec/models/atrium/essay_spec.rb +16 -0
- data/spec/models/atrium/exhibit_spec.rb +90 -0
- data/spec/models/atrium/search/facet_selection_spec.rb +23 -0
- data/{test_support/spec → spec}/models/atrium/search/facet_spec.rb +2 -4
- data/{test_support/spec → spec}/models/atrium/showcase/facet_selection_spec.rb +5 -5
- data/spec/models/atrium/showcase/featured_selection_spec.rb +18 -0
- data/spec/models/atrium/showcase_spec.rb +97 -0
- data/spec/services/browse_level_evaluation_service_spec.rb +33 -0
- data/spec/services/current_filter_query_params_extraction_service_spec.rb +34 -0
- data/spec/services/navigation_tree_spec.rb +18 -0
- data/spec/services/params_adaptor_for_filter_spec.rb +8 -0
- data/spec/spec_helper.rb +39 -0
- data/spec/support/accept_nested_attributes_for.rb +39 -0
- data/{test_support/spec → spec}/support/be_accessible_matcher.rb +0 -0
- data/{test_support/spec → spec}/support/be_routed_mixin.rb +0 -0
- data/spec/support/controller_hacks.rb +35 -0
- data/spec/support/routes.rb +5 -0
- data/spec/support/shared_examples/is_showcased_mixin.rb +20 -0
- data/spec/support/shared_examples/query_param_mixin.rb +179 -0
- data/{app/assets/stylesheets/atrium → vendor/assets/images}/chosen-sprite.png +0 -0
- data/{app → vendor}/assets/javascripts/chosen.jquery.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor.warning.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/config.js.coffee +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/jquery.generateId.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/jquery.jeditable.ckeditor.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/application_link.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/dialogs/linkItem.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/plugin.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/ui_toolbar_pencil.png +0 -0
- data/vendor/assets/javascripts/jquery-ui-1.8.23.custom.min.js +41 -0
- data/vendor/assets/javascripts/jquery-ui-build.txt +8 -0
- data/{app → vendor}/assets/javascripts/jquery.jeditable.js +0 -0
- data/{app/assets/stylesheets/atrium → vendor/assets/stylesheets}/chosen.css +4 -4
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/jquery-ui-1.8.23.custom.css +334 -0
- metadata +431 -949
- data/GETTING_STARTED.textile +0 -102
- data/app/assets/images/atrium/ajax-loader.gif +0 -0
- data/app/assets/images/atrium/lightbox-ico-loading.gif +0 -0
- data/app/assets/images/atrium/logo.png +0 -0
- data/app/assets/javascripts/jquery.colorbox.js +0 -864
- data/app/assets/stylesheets/colorbox.css +0 -42
- data/app/assets/stylesheets/controls.png +0 -0
- data/app/assets/stylesheets/loading.gif +0 -0
- data/app/controllers/atrium/base_controller.rb +0 -25
- data/app/controllers/atrium/collection_exhibit_order_controller.rb +0 -21
- data/app/controllers/atrium/customization_controller.rb +0 -41
- data/app/controllers/atrium/exhibit_facet_order_controller.rb +0 -19
- data/app/helpers/atrium/base_helper.rb +0 -6
- data/app/models/ability.rb +0 -14
- data/app/models/atrium/showcase/item.rb +0 -19
- data/app/models/role_mapper.rb +0 -23
- data/app/views/_user_util_links.html.erb +0 -25
- data/app/views/atrium/collections/_bookmark_control.html.erb +0 -25
- data/app/views/atrium/collections/_browse_index.html.erb +0 -20
- data/app/views/atrium/collections/_collection_items_index.html.erb +0 -10
- data/app/views/atrium/collections/_document.html.erb +0 -24
- data/app/views/atrium/collections/_document_list.html.erb +0 -6
- data/app/views/atrium/collections/_edit_navigation.html.erb +0 -20
- data/app/views/atrium/collections/_folder_control.html.erb +0 -12
- data/app/views/atrium/collections/_listing.html.erb +0 -18
- data/app/views/atrium/collections/_navigation.html.erb +0 -50
- data/app/views/atrium/collections/_results_pagination.html.erb +0 -9
- data/app/views/atrium/collections/_sort_and_per_page.html.erb +0 -23
- data/app/views/atrium/exhibits/_bookmark_control.html.erb +0 -25
- data/app/views/atrium/exhibits/_folder_control.html.erb +0 -12
- data/app/views/atrium/exhibits/_navigation.html.erb +0 -30
- data/app/views/atrium/showcases/_showcase_navigation.html.erb +0 -23
- data/app/views/catalog/_collection_home_text.html.erb +0 -6
- data/app/views/catalog/_constraints.html.erb +0 -9
- data/app/views/catalog/_default_collection_text.html.erb +0 -18
- data/app/views/catalog/_default_home_text.html.erb +0 -6
- data/app/views/catalog/_home_text.html.erb +0 -6
- data/app/views/catalog/_index_partials/_description.html.erb +0 -8
- data/app/views/catalog/_search_form.html.erb +0 -66
- data/app/views/catalog/_show_partials/_description.html.erb +0 -15
- data/app/views/catalog/browse_show.html.erb +0 -18
- data/app/views/catalog/index.html.erb +0 -41
- data/app/views/catalog/list_description.html.erb +0 -24
- data/app/views/catalog/list_item.html.erb +0 -3
- data/app/views/layouts/atrium_themes/default.html.erb +0 -4
- data/app/views/layouts/item_listing.html.erb +0 -36
- data/app/views/listing/_document.html.erb +0 -27
- data/app/views/listing/_document_list.html.erb +0 -3
- data/app/views/listing/_item_search.html.erb +0 -27
- data/app/views/shared/_banner.html.erb +0 -5
- data/app/views/shared/_collection_complete_list.html.erb +0 -33
- data/app/views/shared/_collection_search_form.html.erb +0 -12
- data/app/views/shared/_collection_title_header.html.erb +0 -3
- data/app/views/shared/_featured_sources.html.erb +0 -23
- data/app/views/shared/_list_descriptions.html.erb +0 -39
- data/app/views/shared/_navigation_browse_levels.html.erb +0 -34
- data/app/views/shared/_showcase_configure_menu.html.erb +0 -22
- data/app/views/shared/_top_navigation.html.erb +0 -9
- data/init.rb +0 -3
- data/lib/application_controller.rb +0 -24
- data/lib/atrium/application_helper.rb +0 -24
- data/lib/atrium/atrium_helper_behavior.rb +0 -159
- data/lib/atrium/catalog.rb +0 -203
- data/lib/atrium/collections_helper.rb +0 -172
- data/lib/atrium/controller.rb +0 -10
- data/lib/atrium/descriptions_helper.rb +0 -27
- data/lib/atrium/layout_helper.rb +0 -13
- data/lib/atrium/routes.rb +0 -100
- data/lib/atrium/solr_helper.rb +0 -440
- data/lib/generators/atrium/assets_generator.rb +0 -44
- data/lib/generators/atrium/atrium_generator.rb +0 -149
- data/lib/generators/atrium/cucumber_support_generator.rb +0 -29
- data/lib/generators/atrium/templates/config/role_map_cucumber.yml +0 -2
- data/lib/generators/atrium/templates/config/role_map_development.yml +0 -2
- data/lib/generators/atrium/templates/config/role_map_production.yml +0 -2
- data/lib/generators/atrium/templates/config/role_map_test.yml +0 -2
- data/lib/generators/atrium/templates/config/solr.yml +0 -10
- data/lib/generators/atrium/templates/db/seeds.rb +0 -87
- data/lib/generators/atrium/templates/migrations/create_atrium_showcase_items.rb +0 -17
- data/lib/generators/atrium/templates/themes/example.html.erb +0 -21
- data/lib/railties/all_tests.rake +0 -23
- data/lib/railties/atrium_cucumber.rake +0 -121
- data/lib/railties/index.rake +0 -37
- data/tasks/atrium.rake +0 -268
- data/tasks/atrium_rspec.rake +0 -91
- data/test_support/etc/Gemfile +0 -33
- data/test_support/etc/bundle_config +0 -3
- data/test_support/etc/rvmrc +0 -32
- data/test_support/features/atrium_collections.feature +0 -162
- data/test_support/features/atrium_exhibits.feature +0 -164
- data/test_support/features/step_definitions/atrium_collection_steps.rb +0 -102
- data/test_support/features/step_definitions/atrium_exhibit_steps.rb +0 -53
- data/test_support/features/step_definitions/bookmarks_steps.rb +0 -6
- data/test_support/features/step_definitions/error_steps.rb +0 -5
- data/test_support/features/step_definitions/folder_steps.rb +0 -27
- data/test_support/features/step_definitions/general_steps.rb +0 -50
- data/test_support/features/step_definitions/record_view_steps.rb +0 -12
- data/test_support/features/step_definitions/saved_searches_steps.rb +0 -22
- data/test_support/features/step_definitions/search_facets_steps.rb +0 -29
- data/test_support/features/step_definitions/search_history_steps.rb +0 -9
- data/test_support/features/step_definitions/search_result_steps.rb +0 -114
- data/test_support/features/step_definitions/search_steps.rb +0 -103
- data/test_support/features/step_definitions/user_steps.rb +0 -5
- data/test_support/features/step_definitions/web_steps.rb +0 -213
- data/test_support/features/support/env.rb +0 -67
- data/test_support/features/support/paths.rb +0 -76
- data/test_support/features/support/selectors.rb +0 -40
- data/test_support/fixtures/atrium_exhibits.yml +0 -3
- data/test_support/spec/controllers/atrium/base_controller_spec.rb +0 -13
- data/test_support/spec/controllers/atrium/collection_exhibit_order_controller_spec.rb +0 -29
- data/test_support/spec/controllers/atrium/collections_controller_spec.rb +0 -185
- data/test_support/spec/controllers/atrium/customization_controller_spec.rb +0 -38
- data/test_support/spec/controllers/atrium/descriptions_controller_spec.rb +0 -150
- data/test_support/spec/controllers/atrium/exhibit_facet_order_controller_spec.rb +0 -36
- data/test_support/spec/controllers/atrium/exhibits_controller_spec.rb +0 -192
- data/test_support/spec/controllers/atrium/showcases_controller_spec.rb +0 -219
- data/test_support/spec/helpers/atrium_collections_helper_spec.rb +0 -147
- data/test_support/spec/helpers/atrium_description_helper_spec.rb +0 -47
- data/test_support/spec/helpers/atrium_solr_helper_spec.rb +0 -522
- data/test_support/spec/models/atrium/browse_level_spec.rb +0 -31
- data/test_support/spec/models/atrium/collection_spec.rb +0 -30
- data/test_support/spec/models/atrium/description_spec.rb +0 -67
- data/test_support/spec/models/atrium/essay_spec.rb +0 -12
- data/test_support/spec/models/atrium/exhibit_spec.rb +0 -76
- data/test_support/spec/models/atrium/search/facet_selection_spec.rb +0 -24
- data/test_support/spec/models/atrium/search_facet_spec.rb +0 -54
- data/test_support/spec/models/atrium/showcase/item_spec.rb +0 -12
- data/test_support/spec/models/atrium/showcase_facet_selection_spec.rb +0 -65
- data/test_support/spec/models/atrium/showcase_spec.rb +0 -134
- data/test_support/spec/rcov.opts +0 -3
- data/test_support/spec/routing/atrium/collections_routing_spec.rb +0 -33
- data/test_support/spec/spec.opts +0 -4
- data/test_support/spec/spec_helper.rb +0 -47
- data/test_support/tmp/step_definitions/catalog_index_steps.rb +0 -14
- data/test_support/tmp/step_definitions/edit_document_steps.rb +0 -67
- data/test_support/tmp/step_definitions/hydra_metadata_steps.rb +0 -3
- data/test_support/tmp/step_definitions/hydra_steps.rb +0 -8
- data/test_support/tmp/step_definitions/search_steps.rb +0 -86
- data/test_support/tmp/step_definitions/searching_steps.rb +0 -22
- data/test_support/tmp/step_definitions/select_steps.rb +0 -8
- data/test_support/tmp/step_definitions/show_document_steps.rb +0 -73
- data/test_support/tmp/step_definitions/user_steps.rb +0 -15
- data/test_support/tmp/step_definitions/web_steps.rb +0 -273
- data/test_support/tmp/support/env.rb +0 -54
- data/test_support/tmp/support/paths.rb +0 -57
@@ -1,172 +0,0 @@
|
|
1
|
-
module Atrium::CollectionsHelper
|
2
|
-
|
3
|
-
# Standard display of a facet value in a list. Used in both _facets sidebar
|
4
|
-
# partial and catalog/facet expanded list. Will output facet value name as
|
5
|
-
# a link to add that to your restrictions, with count in parens.
|
6
|
-
# first arg item is a facet value item from rsolr-ext.
|
7
|
-
# options consist of:
|
8
|
-
# :suppress_link => true # do not make it a link, used for an already selected value for instance
|
9
|
-
def get_browse_facet_path(facet_solr_field, value, browse_facets, exhibit_number, exhibit_id, opts={})
|
10
|
-
p = HashWithIndifferentAccess.new
|
11
|
-
p.merge!(:f=>params[:f].dup) if params[:f]
|
12
|
-
if params[:collection_id]
|
13
|
-
#p.merge!(:id=>params[:collection_id])
|
14
|
-
p.merge!(:collection_id=>params[:collection_id])
|
15
|
-
elsif params[:id] && params[:controller] == "atrium_collections"
|
16
|
-
#p.merge!(:id=>params[:id])
|
17
|
-
p.merge!(:collection_id=>params[:id])
|
18
|
-
#p.merge!(:controller=>params[:controller])
|
19
|
-
end
|
20
|
-
#if params[:edit_showcase]
|
21
|
-
# p.merge!(:edit_showcase=>true)
|
22
|
-
#end
|
23
|
-
p.merge!(:id=>exhibit_id)
|
24
|
-
p = remove_related_facet_params(facet_solr_field, p, browse_facets, exhibit_number)
|
25
|
-
p = add_browse_facet_params(facet_solr_field,value,p)
|
26
|
-
#it should only return a path for current facet selection plus parent selected values so if generating for multiple levels, than need to ignore some potentially
|
27
|
-
#params[:action] == "edit" ? edit_atrium_collection_path(p.merge!({:class=>"browse_facet_select"})) : atrium_collection_path(p.merge!({:class=>"browse_facet_select"}))
|
28
|
-
atrium_exhibit_path(p.merge!({:class=>"browse_facet_select"}))
|
29
|
-
end
|
30
|
-
|
31
|
-
def add_browse_facet_params(field, value, p=HashWithIndifferentAccess.new)
|
32
|
-
p[:f]||={}
|
33
|
-
p[:f][field] ||= []
|
34
|
-
p[:f][field].push(value)
|
35
|
-
p
|
36
|
-
end
|
37
|
-
|
38
|
-
def get_exhibit_set_number(exhibit_id)
|
39
|
-
Atrium::Exhibit.find(exhibit_id).set_number
|
40
|
-
end
|
41
|
-
|
42
|
-
# Standard display of a SELECTED facet value, no link, special span
|
43
|
-
# with class, and 'remove' button.
|
44
|
-
def get_selected_browse_facet_path(facet_solr_field, value, browse_facets, exhibit_number, exhibit_id, opts={})
|
45
|
-
value = [value] unless value.is_a? Array
|
46
|
-
p = HashWithIndifferentAccess.new
|
47
|
-
p.merge!(:f=>params[:f].dup) if params[:f]
|
48
|
-
p = remove_related_facet_params(facet_solr_field, p, browse_facets, exhibit_number)
|
49
|
-
if params[:collection_id]
|
50
|
-
p.merge!(:id=>params[:collection_id])
|
51
|
-
p.merge!(:collection_id=>params[:collection_id])
|
52
|
-
elsif params[:id] && params[:controller] == "atrium_collections"
|
53
|
-
p.merge!(:id=>params[:id])
|
54
|
-
p.merge!(:collection_id=>params[:id])
|
55
|
-
p.merge!(:controller=>params[:controller])
|
56
|
-
end
|
57
|
-
#if params[:edit_showcase]
|
58
|
-
# p.merge!(:edit_showcase=>true)
|
59
|
-
#end
|
60
|
-
p.merge!(:id=>exhibit_id)
|
61
|
-
# params[:action] == "edit" ? edit_atrium_collection_path(p) : atrium_collection_path(p)
|
62
|
-
atrium_exhibit_path(p)
|
63
|
-
end
|
64
|
-
|
65
|
-
#Remove current selected facet plus any child facets selected
|
66
|
-
def remove_related_facet_params(solr_facet_field, p, browse_facets, exhibit_number)
|
67
|
-
if params[:exhibit_number] && params[:exhibit_number].to_i != exhibit_number.to_i
|
68
|
-
p.delete(:f) if p[:f]
|
69
|
-
elsif browse_facets.include?(solr_facet_field)
|
70
|
-
#iterate through browseable facets from current on down
|
71
|
-
index = browse_facets.index(solr_facet_field)
|
72
|
-
if p[:f]
|
73
|
-
browse_facets.slice(index, browse_facets.length - index).each do |f|
|
74
|
-
p[:f].delete(f)
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
p
|
79
|
-
end
|
80
|
-
|
81
|
-
def get_selected_browse_facets(browse_facets)
|
82
|
-
selected = {}
|
83
|
-
if params[:f]
|
84
|
-
browse_facets.each do |facet|
|
85
|
-
selected.merge!({facet.to_sym=>params[:f][facet].first}) if params[:f][facet]
|
86
|
-
end
|
87
|
-
end
|
88
|
-
selected
|
89
|
-
end
|
90
|
-
|
91
|
-
def grouped_result_count(response, facet_name=nil, facet_value=nil)
|
92
|
-
if facet_name && facet_value
|
93
|
-
facet = response.facets.detect {|f| f.name == facet_name}
|
94
|
-
facet_item = facet.items.detect {|i| i.value == facet_value} if facet
|
95
|
-
count = facet_item ? facet_item.hits : 0
|
96
|
-
else
|
97
|
-
count = response.docs.total
|
98
|
-
end
|
99
|
-
pluralize(count, 'document')
|
100
|
-
end
|
101
|
-
|
102
|
-
def get_collections_list
|
103
|
-
Atrium::Collection.find(:all)
|
104
|
-
end
|
105
|
-
|
106
|
-
# Return the link to browse an collection
|
107
|
-
# @return [String] a formatted url to be used in href's etc.
|
108
|
-
def browse_collection_link
|
109
|
-
atrium_collection_path(get_collection_id)
|
110
|
-
end
|
111
|
-
|
112
|
-
# Returns the current collection id in the parameters.
|
113
|
-
# If the current controller is atrium_collections it expects the collection id to be in params[:id]
|
114
|
-
# Otherwise, it expects it to be in params[:collection_id]
|
115
|
-
# @return [String] the collection id
|
116
|
-
def get_collection_id
|
117
|
-
params[:controller] == "atrium_collections" ? params[:id] : params[:collection_id]
|
118
|
-
end
|
119
|
-
|
120
|
-
# Return the link to edit an collection
|
121
|
-
# @param [String] a css class to use in the link if necessary
|
122
|
-
# @return [String] a formatted url to be used in href's etc.
|
123
|
-
def edit_collection_link(css_class=nil)
|
124
|
-
edit_atrium_collection_path(get_collection_id, :class => css_class, :render_search=>"false")
|
125
|
-
end
|
126
|
-
|
127
|
-
def get_customize_page_path
|
128
|
-
if params[:controller] == "atrium/exhibits"
|
129
|
-
exhibit=Atrium::Exhibit.find(params[:id])
|
130
|
-
path = new_atrium_exhibit_showcases_path(exhibit, :facet_selection => params[:f])
|
131
|
-
elsif params[:controller] == "atrium/collections"
|
132
|
-
collection=Atrium::Collection.find(params[:id])
|
133
|
-
path= new_atrium_collection_showcases_path(collection)
|
134
|
-
end
|
135
|
-
return path
|
136
|
-
end
|
137
|
-
|
138
|
-
def can_add_view_exhibit?
|
139
|
-
collection= @atrium_collection? @atrium_collection : Atrium::Collection.find(params[:id])
|
140
|
-
return !(collection && collection.filter_query_params && collection.filter_query_params[:solr_doc_ids])
|
141
|
-
end
|
142
|
-
|
143
|
-
def exhibit_scoped_to_items?(exhibit_id)
|
144
|
-
exhibit=Atrium::Exhibit.find(exhibit_id)
|
145
|
-
return exhibit && exhibit.filter_query_params && exhibit.filter_query_params[:solr_doc_ids]
|
146
|
-
end
|
147
|
-
|
148
|
-
def get_solr_documents_from_asset(asset)
|
149
|
-
p = params.dup
|
150
|
-
params.delete :f
|
151
|
-
params.delete :q
|
152
|
-
params.delete :page
|
153
|
-
logger.debug("Asset is: #{asset.class}")
|
154
|
-
if asset.is_a?(Atrium::Showcase)
|
155
|
-
if asset && !asset.showcase_items[:solr_doc_ids].nil?
|
156
|
-
selected_document_ids = @atrium_showcase.showcase_items[:solr_doc_ids].split(',')
|
157
|
-
response, documents = get_solr_response_for_field_values("id",selected_document_ids || [])
|
158
|
-
end
|
159
|
-
else
|
160
|
-
if asset && asset.filter_query_params && asset.filter_query_params[:solr_doc_ids]
|
161
|
-
document_ids = asset.filter_query_params[:solr_doc_ids].split(',')
|
162
|
-
response, documents = get_solr_response_for_field_values("id",document_ids || [])
|
163
|
-
end
|
164
|
-
end
|
165
|
-
params.merge!(:f=>p[:f])
|
166
|
-
params.merge!(:q=>p[:q])
|
167
|
-
params.merge!(:page=>p[:page])
|
168
|
-
return [response, documents]
|
169
|
-
end
|
170
|
-
|
171
|
-
end
|
172
|
-
|
data/lib/atrium/controller.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
module Atrium::DescriptionsHelper
|
2
|
-
|
3
|
-
def get_description_for_showcase(showcase)
|
4
|
-
solr_desc_arr=[]
|
5
|
-
showcase.descriptions.each do |desc|
|
6
|
-
solr_desc_arr<< desc.description_solr_id unless desc.description_solr_id.blank?
|
7
|
-
end
|
8
|
-
@description_hash={}
|
9
|
-
logger.debug("Desc Array: #{solr_desc_arr.inspect}")
|
10
|
-
unless solr_desc_arr.empty?
|
11
|
-
p = params.dup
|
12
|
-
params.delete :f
|
13
|
-
params.delete :q
|
14
|
-
params.delete :page
|
15
|
-
desc_response, desc_documents = get_solr_response_for_field_values("id",solr_desc_arr.uniq)
|
16
|
-
logger.debug("desc_documents Array: #{desc_documents.inspect}")
|
17
|
-
desc_documents.each do |doc|
|
18
|
-
@description_hash[doc["id"]]= doc["description_content_s"].blank? ? "" : doc["description_content_s"].first
|
19
|
-
end
|
20
|
-
params.merge!(:f=>p[:f])
|
21
|
-
params.merge!(:q=>p[:q])
|
22
|
-
params.merge!(:page=>p[:page])
|
23
|
-
end
|
24
|
-
return @description_hash
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
data/lib/atrium/layout_helper.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# This module is a controller level mixin that helps render the appropriate layout for the given context
|
2
|
-
module Atrium::LayoutHelper
|
3
|
-
def current_layout
|
4
|
-
@atrium_collection ? @atrium_collection.theme_path : 'atrium'
|
5
|
-
end
|
6
|
-
|
7
|
-
def collection_theme_if_present
|
8
|
-
unless params[:collection_id].blank?
|
9
|
-
@atrium_collection ||= Atrium::Collection.find(params[:collection_id])
|
10
|
-
end
|
11
|
-
current_layout
|
12
|
-
end
|
13
|
-
end
|
data/lib/atrium/routes.rb
DELETED
@@ -1,100 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
module Atrium
|
3
|
-
class Routes
|
4
|
-
|
5
|
-
def initialize(router, options)
|
6
|
-
@router = router
|
7
|
-
@options = options
|
8
|
-
end
|
9
|
-
|
10
|
-
def draw
|
11
|
-
route_sets.each do |r|
|
12
|
-
self.send(r)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
protected
|
17
|
-
|
18
|
-
def add_routes &blk
|
19
|
-
@router.instance_exec(@options, &blk)
|
20
|
-
end
|
21
|
-
|
22
|
-
def route_sets
|
23
|
-
(@options[:only] || default_route_sets) - (@options[:except] || [])
|
24
|
-
end
|
25
|
-
|
26
|
-
def default_route_sets
|
27
|
-
[:atrium_collections, :catalog, :get]
|
28
|
-
end
|
29
|
-
|
30
|
-
module RouteSets
|
31
|
-
|
32
|
-
def atrium_collections
|
33
|
-
add_routes do |options|
|
34
|
-
namespace :atrium do
|
35
|
-
resources :collections, :exhibits do
|
36
|
-
resource :showcases, :only => [:new]
|
37
|
-
end
|
38
|
-
resources :showcases, :only => [:show]
|
39
|
-
resources :descriptions do
|
40
|
-
resource :essays
|
41
|
-
end
|
42
|
-
end
|
43
|
-
match 'atrium_collections/:id/exhibit_order', :to => 'atrium/collection_exhibit_order#index', :as => 'atrium_collection_exhibit_order'
|
44
|
-
match 'atrium_collections/:id/exhibit_order/update', :to => 'atrium/collection_exhibit_order#update', :as => 'update_atrium_collection_exhibit_order', :via => :post
|
45
|
-
match 'atrium_collections/:collection_id/catalog', :to => 'catalog#index', :as => 'atrium_collection_home', :via => :get
|
46
|
-
match 'atrium_collections/configure/:id', :to => 'atrium/collections#home_page_text_config', :as => 'atrium_collection_text_configure'
|
47
|
-
match 'atrium_collections/set_scope/:id', :to => 'atrium/collections#set_collection_scope', :as => 'atrium_set_collection_scope'
|
48
|
-
match 'atrium_collections/unset_scope/:id', :to => 'atrium/collections#unset_collection_scope', :as => 'atrium_unset_collection_scope'
|
49
|
-
match 'atrium_exhibits/:id/facet_order', :to => 'atrium/exhibit_facet_order#index', :as => 'atrium_exhibit_facet_order'
|
50
|
-
match 'atrium_exhibits/:id/facet_order/update', :to => 'atrium/exhibit_facet_order#update', :as => 'update_atrium_exhibit_facet_order', :via => :post
|
51
|
-
match 'atrium_exhibits/set_scope/:id', :to => 'atrium/exhibits#set_exhibit_scope', :as => 'atrium_set_exhibit_scope'
|
52
|
-
match 'atrium_exhibits/unset_scope/:id', :to => 'atrium/exhibits#unset_exhibit_scope', :as => 'atrium_unset_exhibit_scope'
|
53
|
-
match 'atrium_exhibits/:id/showcases/:showcase_id', :to => 'atrium/exhibits#show', :as => 'atrium_exhibit_showcase'
|
54
|
-
match 'atrium_showcases/featured/:id', :to => 'atrium/showcases#featured', :as => 'atrium_showcase_featured'
|
55
|
-
match 'atrium_showcases/remove_featured/:id', :to => 'atrium/showcases#remove_featured', :as => 'atrium_showcase_remove_featured', :via => :post
|
56
|
-
match 'atrium_showcases/refresh/:id', :to => 'atrium/showcases#refresh_showcase', :as => 'atrium_showcase_refresh'
|
57
|
-
match 'atrium_collections/:collection_id/catalog/:id', :to => 'catalog#show', :as => 'atrium_collection_catalog'
|
58
|
-
match 'atrium_collections/:collection_id/browse/:id', :to => 'catalog#show', :as => 'atrium_collection_browse', :defaults=>{:atrium_collection_browse=>true}
|
59
|
-
match 'atrium_collections/:collection_id/exhibits/:exhibit_id/browse/:id', :to => 'catalog#show', :as => 'atrium_collection_exhibit_browse', :defaults=>{:atrium_exhibit_browse=>true}
|
60
|
-
match 'atrium_collections/:id/showcases/:showcase_id', :to => 'atrium/collections#show', :as => 'atrium_collection_showcase'
|
61
|
-
match 'atrium_exhibits/:exhibit_id/browse/:id', :to => 'catalog#show', :as => 'atrium_exhibit_browse', :defaults=>{:atrium_exhibit_browse=>true}
|
62
|
-
match 'atrium_showcases/:showcase_id/descriptions', :to => 'atrium/descriptions#index', :as => 'atrium_descriptions', :via => :get
|
63
|
-
match 'atrium_showcases/:showcase_id/descriptions', :to => 'atrium/descriptions#create', :as => 'atrium_descriptions', :via => :post
|
64
|
-
match 'atrium_showcases/:showcase_id/descriptions/new', :to => 'atrium/descriptions#new', :as => 'new_atrium_description'
|
65
|
-
match 'atrium/customization/start', :to => 'atrium/customization#start', :as => 'start_atrium_customization'
|
66
|
-
match 'atrium/customization/stop', :to => 'atrium/customization#stop', :as => 'stop_atrium_customization'
|
67
|
-
match 'atrium_descriptions/add/:showcase_id', :to => 'atrium/descriptions#add_from_solr', :as => 'atrium_descriptions_add'
|
68
|
-
match 'atrium_descriptions/link/:showcase_id', :to => 'atrium/descriptions#save_ids_to_descriptions', :as => 'atrium_descriptions_link'
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
def catalog
|
73
|
-
add_routes do |options|
|
74
|
-
match 'catalog/:id/edit', :to => 'catalog#edit', :as => 'edit_catalog'
|
75
|
-
# The delete method renders a confirmation page with a button to submit actual destroy request
|
76
|
-
match 'catalog/:id/delete', :to => 'catalog#delete', :as => 'delete_catalog'
|
77
|
-
### The rest of these routes are defined in blacklight
|
78
|
-
#resources :catalog, :id=> /.+/
|
79
|
-
# resources :catalog, :only => [:index, :show], :controller => "hydra_head/catalog", :path_prefix => HydraHead::Engine.config.mount_at, :as => "hydra_head", :id=> /.+/
|
80
|
-
#match 'catalog/:id', :to => "hydra_head/catalog#show", :path_prefix => HydraHead::Engine.config.mount_at, :as => "catalog", :id => /.+/
|
81
|
-
#match 'catalog/:id', :to => "hydra_head/catalog#show", :id => /.+/
|
82
|
-
# match 'about', :to => 'catalog#about', :as => 'about'
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
|
87
|
-
def get
|
88
|
-
add_routes do |options|
|
89
|
-
resources :get, :only=>:show
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
|
94
|
-
end
|
95
|
-
include RouteSets
|
96
|
-
|
97
|
-
#match 'generic_contents_object/content/:container_id', :to => 'generic_content_objects#create', :as => 'generic_content_object', :via => :post
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
data/lib/atrium/solr_helper.rb
DELETED
@@ -1,440 +0,0 @@
|
|
1
|
-
# This module is a controller level mixin that uses Blacklight::SolrHelper to make calls to solr in an collection context
|
2
|
-
module Atrium::SolrHelper
|
3
|
-
|
4
|
-
def grouped_result_count(response, facet_name=nil, facet_value=nil)
|
5
|
-
if facet_name && facet_value
|
6
|
-
facet = response.facets.detect {|f| f.name == facet_name}
|
7
|
-
facet_item = facet.items.detect {|i| i.value == facet_value} if facet
|
8
|
-
count = facet_item ? facet_item.hits : 0
|
9
|
-
else
|
10
|
-
count = response.docs.total
|
11
|
-
end
|
12
|
-
pluralize(count, 'document')
|
13
|
-
end
|
14
|
-
|
15
|
-
# Return the link to browse an collection
|
16
|
-
# @return [String] a formatted url to be used in href's etc.
|
17
|
-
def browse_collection_link
|
18
|
-
atrium_collection_path(get_collection_id)
|
19
|
-
end
|
20
|
-
|
21
|
-
# Returns the current collection id in the parameters.
|
22
|
-
# If the current controller is atrium_collections it expects the collection id to be in params[:id]
|
23
|
-
# Otherwise, it expects it to be in params[:collection_id]
|
24
|
-
# @return [String] the collection id
|
25
|
-
def get_collection_id
|
26
|
-
params[:controller] == "atrium_collections" ? params[:id] : params[:collection_id]
|
27
|
-
end
|
28
|
-
|
29
|
-
# Return the link to edit an collection
|
30
|
-
# @param [String] a css class to use in the link if necessary
|
31
|
-
# @return [String] a formatted url to be used in href's etc.
|
32
|
-
def edit_collection_link(css_class=nil)
|
33
|
-
edit_atrium_collection_path(get_collection_id, :class => css_class, :render_search=>"false")
|
34
|
-
end
|
35
|
-
|
36
|
-
# Returns the current atrium_collection instance variable
|
37
|
-
# @return [Atrium::Collection]
|
38
|
-
def atrium_collection
|
39
|
-
@atrium_collection
|
40
|
-
end
|
41
|
-
|
42
|
-
# Returns the current exhibit instance variable
|
43
|
-
# @return [Atrium::Exhibit]
|
44
|
-
def exhibit
|
45
|
-
@exhibit
|
46
|
-
end
|
47
|
-
|
48
|
-
# Returns the current browse_levels instance variable
|
49
|
-
# @return [Array] Array of Atrium::BrowseLevel for current Atrium::Collection
|
50
|
-
def exhibits
|
51
|
-
@exhibits
|
52
|
-
end
|
53
|
-
|
54
|
-
# Returns the current Blacklight solr response for results that should be displayed in current browse navigation scope
|
55
|
-
# @return [RSolr::Ext::Response]
|
56
|
-
def browse_response
|
57
|
-
@browse_response
|
58
|
-
end
|
59
|
-
|
60
|
-
# Returns the current document list from Blacklight solr response for results that should be displayed in current browse navigation scope
|
61
|
-
# @return [Array] array of SolrDocument returned by search result
|
62
|
-
def browse_document_list
|
63
|
-
@browse_document_list
|
64
|
-
end
|
65
|
-
|
66
|
-
# Returns the current extra controller params used in the query to Solr for Browsing response results
|
67
|
-
# @return [Hash]
|
68
|
-
def current_extra_controller_params
|
69
|
-
@extra_controller_params
|
70
|
-
end
|
71
|
-
|
72
|
-
# Initialize the collection and browse instance variables for a current collection scope. To initialize
|
73
|
-
# anything it expects params[:id] to the be collection id if the current controller is "atrium_collections".
|
74
|
-
# If it sees params[:collection_id] defined that will be used. If neither are present then nothing will
|
75
|
-
# be initialized.
|
76
|
-
# If possibled the following will be initialized:
|
77
|
-
# @atrium_collection [Atrium::Collection] The collection object
|
78
|
-
# @browse_levels [Array] The array of Atrium::BrowseLevel objects for this collection
|
79
|
-
# @browse_response [Solr::Response] The response from solr for current collection browse scope (will include any filters/facets applied by browse)
|
80
|
-
# @browse_document_list [Array] An array of SolrDocuments for the current browse scope
|
81
|
-
#
|
82
|
-
def __initialize_collection(collection_id)
|
83
|
-
|
84
|
-
unless collection_id
|
85
|
-
logger.error("Could not initialize collection. If controller is 'atrium_collections' than :id must be defined. Otherwise, :collection_id must be defined. Params were: #{params.inspect}")
|
86
|
-
return
|
87
|
-
end
|
88
|
-
|
89
|
-
begin
|
90
|
-
@atrium_collection = Atrium::Collection.find(collection_id) if @atrium_collection.nil?
|
91
|
-
#raise "No collection was found with id: #{collection_id}" if @atrium_collection.nil?
|
92
|
-
@exhibits = @atrium_collection.exhibits
|
93
|
-
if params[:exhibit_number]
|
94
|
-
exhibit_index = params[:exhibit_number].to_i
|
95
|
-
@exhibit = @exhibits.fetch(exhibit_index-1) if @exhibits && exhibit_index && exhibit_index <= @exhibits.size
|
96
|
-
elsif params[:exhibit_id]
|
97
|
-
@exhibit = Atrium::Exhibit.find(params[:exhibit_id])
|
98
|
-
end
|
99
|
-
##logger.debug("Collection: #{@atrium_collection}")
|
100
|
-
@extra_controller_params ||= {}
|
101
|
-
params[:browse_level_id] ? @browse_level = Atrium::BrowseLevel.find(params[:browse_level_id]): @browse_level = get_current_browse_level(@exhibit)
|
102
|
-
@extra_controller_params = prepare_extra_controller_params_for_collection_query(@atrium_collection,@exhibit,@browse_level,params,@extra_controller_params)
|
103
|
-
(@response, @document_list) = get_search_results(params, @extra_controller_params)
|
104
|
-
@images = get_all_children(@document_list, "is_part_of_s")
|
105
|
-
#@members = get_all_children(@document_list, "is_member_of_s")
|
106
|
-
#reset to just filters in collection filter
|
107
|
-
@extra_controller_params = reset_extra_controller_params_after_collection_query(@atrium_collection,@exhibit,@browse_level,@extra_controller_params)
|
108
|
-
@browse_response = @response
|
109
|
-
@browse_document_list = @document_list
|
110
|
-
##logger.debug("Collection: #{@atrium_collection}, Exhibit: #{@atrium_collection.exhibits}")
|
111
|
-
@collection_showcase = Atrium::Showcase.with_selected_facets(@atrium_collection.id,@atrium_collection.class.name, params[:f]).first
|
112
|
-
##logger.debug("Collection level showcase: #{@collection_showcase.inspect}")
|
113
|
-
rescue Exception=>e
|
114
|
-
logger.error("Could not initialize collection information for id #{collection_id}. Reason - #{e.to_s}")
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
# added as part of solr search params to exclude items from search result
|
119
|
-
# as :f, to solr as appropriate :fq query.
|
120
|
-
def add_exclude_fq_to_solr(solr_parameters, user_params)
|
121
|
-
# :fq, map from :f.
|
122
|
-
#logger.debug("Solr exclude!!!: #{solr_parameters.inspect}, #{user_params.inspect}")
|
123
|
-
if ( user_params[:exclude])
|
124
|
-
exclude_request_params = user_params[:exclude]
|
125
|
-
##logger.debug("user_params[:exclude]!!!: #{user_params[:exclude].inspect}")
|
126
|
-
solr_parameters[:fq] ||= []
|
127
|
-
exclude_request_params.each_pair do |facet_field, value_list|
|
128
|
-
value_list ||= []
|
129
|
-
value_list = [value_list] unless value_list.respond_to? :each
|
130
|
-
value_list.each do |value|
|
131
|
-
exclude_query="-(#{facet_value_to_fq_string(facet_field, value)})"
|
132
|
-
solr_parameters[:fq] << exclude_query
|
133
|
-
##logger.debug("Solr exclude!!!: #{exclude_query.inspect}, #{solr_parameters.inspect}, #{user_params.inspect}")
|
134
|
-
end
|
135
|
-
end
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|
139
|
-
def get_current_filter_query_params(collection,exhibit,browse_level)
|
140
|
-
#params[:exclude]={:f=>{"collection_0_did_0_unittitle_0_imprint_0_publisher_facet"=>["Continental Currency"]}}
|
141
|
-
filter_query_params = nil
|
142
|
-
ex_filter_query_params = solr_search_params(collection.filter_query_params) if collection && !collection.filter_query_params.nil?
|
143
|
-
exhibit_filter_query_params = solr_search_params(exhibit.filter_query_params) if exhibit && !exhibit.filter_query_params.nil?
|
144
|
-
bl_filter_query_params = solr_search_params(browse_level.filter_query_params) if browse_level && !browse_level.filter_query_params.nil?
|
145
|
-
bl_exclude_query_params = solr_search_params(browse_level.exclude_query_params) if browse_level && !browse_level.exclude_query_params.nil?
|
146
|
-
# logger.debug("##### Exclude: #{bl_exclude_query_params.inspect}")
|
147
|
-
queries = []
|
148
|
-
queries << ex_filter_query_params[:q] if (ex_filter_query_params && ex_filter_query_params[:q])
|
149
|
-
queries << exhibit_filter_query_params[:q] if (exhibit_filter_query_params && exhibit_filter_query_params[:q])
|
150
|
-
queries << bl_filter_query_params[:q] if (bl_filter_query_params && bl_filter_query_params[:q])
|
151
|
-
fq = []
|
152
|
-
fq.concat(ex_filter_query_params[:fq]) if (ex_filter_query_params && ex_filter_query_params[:fq])
|
153
|
-
#mixin exhibit facet filters
|
154
|
-
if exhibit_filter_query_params && exhibit_filter_query_params[:fq]
|
155
|
-
exhibit_filter_query_params[:fq].each do |fq_param|
|
156
|
-
fq << fq_param unless fq.include?(fq_param)
|
157
|
-
end
|
158
|
-
end
|
159
|
-
#mixin browse level facet filters
|
160
|
-
if bl_filter_query_params && bl_filter_query_params[:fq]
|
161
|
-
bl_filter_query_params[:fq].each do |fq_param|
|
162
|
-
fq << fq_param unless fq.include?(fq_param)
|
163
|
-
end
|
164
|
-
end
|
165
|
-
if bl_exclude_query_params && bl_exclude_query_params[:fq]
|
166
|
-
bl_exclude_query_params[:fq].each do |fq_exclude_param|
|
167
|
-
fq << fq_exclude_param unless fq.include?(fq_exclude_param)
|
168
|
-
end
|
169
|
-
end
|
170
|
-
|
171
|
-
unless fq.empty? && queries.empty?
|
172
|
-
filter_query_params = {}
|
173
|
-
filter_query_params.merge!(:fq=>fq) unless fq.empty?
|
174
|
-
filter_query_params.merge!(:q=>queries.join(" AND ")) unless queries.empty?
|
175
|
-
end
|
176
|
-
filter_query_params
|
177
|
-
end
|
178
|
-
|
179
|
-
# This method will get extra controller params that are necessary to apply an
|
180
|
-
# collection scope filter. If there are facets selected in the collection filter and
|
181
|
-
# a menu item is selected it will combine the facet selection from params into
|
182
|
-
# extra controller params to ensure that both are in the query correctly.
|
183
|
-
|
184
|
-
def prepare_extra_controller_params_for_collection_query(collection,exhibit,browse_level,params, extra_controller_params)
|
185
|
-
extra_controller_params ||= {}
|
186
|
-
filter_query_params = get_current_filter_query_params(collection,exhibit,browse_level)
|
187
|
-
queries = []
|
188
|
-
#build_lucene_query will be defined if hydra is present to add hydra rights into query etc, otherwise it will be ignored
|
189
|
-
queries << build_lucene_query(params[:q]) if respond_to?(:build_lucene_query)
|
190
|
-
queries << filter_query_params[:q] if (filter_query_params && filter_query_params[:q])
|
191
|
-
queries << params[:q] if params[:q]
|
192
|
-
queries.empty? ? q = params[:q] : q = queries.join(" AND ")
|
193
|
-
extra_controller_params.merge!(:q=>q) unless q.nil?
|
194
|
-
extra_controller_params.merge!(:fq=>filter_query_params[:fq]) if filter_query_params && filter_query_params[:fq]
|
195
|
-
#merge in user params before doing query to correctly handle facets in both extra controller params and params
|
196
|
-
if (extra_controller_params && extra_controller_params[:fq])
|
197
|
-
session_search_params = solr_search_params(params)
|
198
|
-
if session_search_params[:fq]
|
199
|
-
extra_controller_params[:fq].each do |extra_param|
|
200
|
-
#only add if it is not already in params
|
201
|
-
session_search_params[:fq] << extra_param unless session_search_params[:fq].include?(extra_param)
|
202
|
-
end
|
203
|
-
extra_controller_params.merge!(:fq=>session_search_params[:fq])
|
204
|
-
end
|
205
|
-
end
|
206
|
-
extra_controller_params
|
207
|
-
end
|
208
|
-
|
209
|
-
def reset_extra_controller_params_after_collection_query(collection,exhibit,browse_level,extra_controller_params)
|
210
|
-
extra_controller_params ||= {}
|
211
|
-
filter_query_params = get_current_filter_query_params(collection,exhibit,browse_level)
|
212
|
-
extra_controller_params.merge!(:fq=>filter_query_params[:fq]) if filter_query_params && filter_query_params[:fq]
|
213
|
-
extra_controller_params
|
214
|
-
end
|
215
|
-
|
216
|
-
# Returns an array of Atrium::Exhibit objects with its BrowseLevel objects populated with current display
|
217
|
-
# data. It is expected that it will be used for generating current navigation controls when browsing an collection.
|
218
|
-
# All possible browse levels will be present but values will only be filled in for levels that should be
|
219
|
-
# in view. It will fill in values for the top browse level, and then will only fill in values for the second browse level
|
220
|
-
# if something is selected, and so on for any deeper browse levels. If no label is defined
|
221
|
-
# for a browse level, it will fill in the default label for the browse level facet.
|
222
|
-
# If nothing is selected in the first level, there will be no second element. This pattern
|
223
|
-
# continues as it maintains the state for a user drilling into the content by expanding and collapses
|
224
|
-
# browse category values at each browse level. This method calls get_browse_level_data
|
225
|
-
# to actually retrieve the array of data after it makes sure a response for browse information
|
226
|
-
# has come back from Blacklight Solr
|
227
|
-
# @return [Array] An array of Atrium::Exhibit objects defind for an collection with BrowseLevel objects populated with view data
|
228
|
-
# @example Get First Browse Level data
|
229
|
-
# You would access the first level of the first browse set as follows:
|
230
|
-
#
|
231
|
-
# top_browse_level = exhibits.first.browse_levels.first
|
232
|
-
# #get menu values to display
|
233
|
-
# top_browse_level.values
|
234
|
-
# #get label for the browse category
|
235
|
-
# top_browse_level.label
|
236
|
-
# #check if level has a selected value
|
237
|
-
# top_browse_level.selected?
|
238
|
-
#
|
239
|
-
# One should use the above methods to generate data for expand/collapse controls, breadcrumbs, etc.
|
240
|
-
def get_exhibit_navigation_data
|
241
|
-
logger.debug("get_exhibit_navigation_data browse response: #{browse_response.inspect}")
|
242
|
-
initialize_collection if atrium_collection.nil?
|
243
|
-
browse_data = []
|
244
|
-
unless atrium_collection.nil? || atrium_collection.exhibits.nil?
|
245
|
-
atrium_collection.exhibits.each do |exhibit|
|
246
|
-
if exhibit.respond_to?(:browse_levels) && !exhibit.browse_levels.nil?
|
247
|
-
updated_browse_levels = get_browse_level_data(atrium_collection,exhibit,exhibit.browse_levels,browse_response,current_extra_controller_params,true)
|
248
|
-
##logger.debug("Updated Browse Levels: #{updated_browse_levels.inspect}")
|
249
|
-
exhibit.browse_levels.each_index do |index|
|
250
|
-
##logger.debug("#{exhibit.browse_levels.inspect}")
|
251
|
-
exhibit.browse_levels.fetch(index).values = updated_browse_levels.fetch(index).values
|
252
|
-
exhibit.browse_levels.fetch(index).label = updated_browse_levels.fetch(index).label
|
253
|
-
exhibit.browse_levels.fetch(index).selected = updated_browse_levels.fetch(index).selected
|
254
|
-
end
|
255
|
-
exhibit.browse_levels.flatten!(1)
|
256
|
-
browse_data << exhibit
|
257
|
-
end
|
258
|
-
end
|
259
|
-
end
|
260
|
-
##logger.debug("Before BrowseData: #{browse_data.inspect}")
|
261
|
-
|
262
|
-
browse_data=[] if check_for_scope(browse_data)
|
263
|
-
@exhibit_navigation_data=browse_data
|
264
|
-
|
265
|
-
##logger.debug("After BrowseData: #{browse_data.inspect}")
|
266
|
-
browse_data
|
267
|
-
end
|
268
|
-
|
269
|
-
private
|
270
|
-
|
271
|
-
def check_for_scope(exhibit_list)
|
272
|
-
scoped_to_items=false
|
273
|
-
if atrium_collection && atrium_collection.filter_query_params && atrium_collection.filter_query_params[:solr_doc_ids]
|
274
|
-
scoped_to_items=true
|
275
|
-
end
|
276
|
-
return scoped_to_items
|
277
|
-
end
|
278
|
-
|
279
|
-
# This is a private method and should not be called directly.
|
280
|
-
# get_exhibit_navigation_data calls this method to fill out the browse_level_navigation_data array
|
281
|
-
# This method calls itself recursively as it generates the current browse state data.
|
282
|
-
# It returns the browse levels array with its browse level objects passed in updated
|
283
|
-
# with any values, label, and selected value if one is selected. It will fill in values
|
284
|
-
# for the top browse level, and then will only fill in values for the second browse level
|
285
|
-
# if something is selected, and so on for any deeper browse levels. If no label is defined
|
286
|
-
# for a browse level, it will fill in the default label for the browse level facet.
|
287
|
-
# @param [Atrium::Collection] The current collection
|
288
|
-
# @param [Atrium::Exhibit] the current exhibit
|
289
|
-
# @params [Array] The current browse levels (will reduce as this method recurses)
|
290
|
-
# @param [SolrResponse] the browse response from solr
|
291
|
-
# @param [Hash] the extra controller params that need to be passed to solr if we query for another response if necessary to get child level data
|
292
|
-
# @param [Boolean] true if the top level of the exhibit
|
293
|
-
# @return [Array] An array of update BrowseLevel objects that are enhanced with current navigation data such as selected, values, and label filled in
|
294
|
-
# The relevant attributes of a BrowseLevel are
|
295
|
-
# :solr_facet_name [String] the facet used as the category for that browse level
|
296
|
-
# :label [String] browse level category label
|
297
|
-
# :values [Array] values to display for the browse level
|
298
|
-
# :selected [String] the selected value if one
|
299
|
-
def get_browse_level_data(collection, exhibit, browse_levels, response, extra_controller_params={},top_level=false)
|
300
|
-
exhibit_number = exhibit.set_number
|
301
|
-
updated_browse_levels = []
|
302
|
-
unless browse_levels.nil? || browse_levels.empty?
|
303
|
-
browse_level = browse_levels.first
|
304
|
-
browse_facet_name = browse_level.solr_facet_name
|
305
|
-
browse_level.label = facet_field_labels[browse_facet_name] if (browse_level.label.nil? || browse_level.label.blank?)
|
306
|
-
#always add whether there should be values set or not
|
307
|
-
updated_browse_levels << browse_level
|
308
|
-
if params.has_key?(:f) && !params[:f].nil?
|
309
|
-
temp = params[:f].dup
|
310
|
-
unless top_level && !params[:f][browse_facet_name] && !params[:f][browse_facet_name.to_s]
|
311
|
-
browse_levels.each_with_index do |cur_browse_level,index|
|
312
|
-
params[:f].delete(cur_browse_level.solr_facet_name)
|
313
|
-
end
|
314
|
-
else
|
315
|
-
params[:f] = {}
|
316
|
-
end
|
317
|
-
extra_controller_params = prepare_extra_controller_params_for_collection_query(collection,exhibit,browse_level,params,extra_controller_params)
|
318
|
-
(response_without_f_param, @new_document_list) = get_search_results(params,extra_controller_params)
|
319
|
-
extra_controller_params = reset_extra_controller_params_after_collection_query(collection,exhibit,browse_level,extra_controller_params)
|
320
|
-
params[:f] = temp
|
321
|
-
else
|
322
|
-
extra_controller_params = prepare_extra_controller_params_for_collection_query(collection,exhibit,browse_level,params,extra_controller_params)
|
323
|
-
(response_without_f_param, @new_document_list) = get_search_results(params,extra_controller_params)
|
324
|
-
extra_controller_params = reset_extra_controller_params_after_collection_query(collection,exhibit,browse_level,extra_controller_params)
|
325
|
-
end
|
326
|
-
display_facet = response_without_f_param.facets.detect {|f| f.name == browse_facet_name}
|
327
|
-
display_facet_with_f = response.facets.detect {|f| f.name == browse_facet_name}
|
328
|
-
unless display_facet.nil?
|
329
|
-
level_has_selected = false
|
330
|
-
if display_facet.items.any?
|
331
|
-
display_facet.items.each do |item|
|
332
|
-
if facet_in_params?(display_facet.name, item.value )
|
333
|
-
level_has_selected = true
|
334
|
-
updated_browse_levels.first.selected = item.value
|
335
|
-
if browse_levels.length > 1
|
336
|
-
updated_browse_levels << get_browse_level_data(collection,exhibit,browse_levels.slice(1,browse_levels.length-1), response, extra_controller_params)
|
337
|
-
#make sure to flatten any nested arrays from recursive calls
|
338
|
-
updated_browse_levels.flatten!(1)
|
339
|
-
end
|
340
|
-
end
|
341
|
-
updated_browse_levels.first.values << item.value
|
342
|
-
end
|
343
|
-
end
|
344
|
-
#check if facet_in_params and if not just add rest of levels so all are represented since nothing below will be selected
|
345
|
-
unless level_has_selected
|
346
|
-
updated_browse_levels << browse_levels.slice(1,browse_levels.length-1)
|
347
|
-
updated_browse_levels.flatten!(1)
|
348
|
-
end
|
349
|
-
end
|
350
|
-
end
|
351
|
-
updated_browse_levels
|
352
|
-
end
|
353
|
-
|
354
|
-
def get_atrium_showcase(exhibit_id, facet_hash={})
|
355
|
-
atrium_showcase= Atrium::Showcase.with_selected_facets(exhibit_id,facet_hash)
|
356
|
-
return atrium_showcase
|
357
|
-
end
|
358
|
-
|
359
|
-
# Checks if a browse level has been navigated to for a exhibit
|
360
|
-
# @param [Atrium::Exhibit] The current exhibit in view
|
361
|
-
# @return [Atrium::BrowseLevel] It will return a browse level that is selected, otherwise it will return nil
|
362
|
-
def get_current_browse_level(exhibit)
|
363
|
-
cur_browse_level = nil
|
364
|
-
if exhibit
|
365
|
-
#keep recursing until lowest level that has a facet selected is found
|
366
|
-
exhibit.browse_levels.each do |browse_level|
|
367
|
-
cur_browse_level = browse_level if browse_level.solr_facet_name && facet_selected?(browse_level.solr_facet_name)
|
368
|
-
end
|
369
|
-
end
|
370
|
-
cur_browse_level
|
371
|
-
end
|
372
|
-
|
373
|
-
def facet_selected?(facet_name)
|
374
|
-
params[:f].include?(facet_name) if params[:f]
|
375
|
-
end
|
376
|
-
|
377
|
-
def display_solr_essay(pid)
|
378
|
-
##logger.debug("description: #{pid.inspect}")
|
379
|
-
response, document = get_solr_response_for_doc_id(pid)
|
380
|
-
content = render_document_show_field_value :document => document, :field => 'description_content_s'
|
381
|
-
##logger.debug("Content:#{content}")
|
382
|
-
return content.html_safe
|
383
|
-
end
|
384
|
-
|
385
|
-
def get_all_children(doc_list, relationship_field_names, opts={})
|
386
|
-
@child_hash={}
|
387
|
-
parent_arr=[]
|
388
|
-
modified_arr=[]
|
389
|
-
#logger.debug("Get children for list: #{doc_list.count}")
|
390
|
-
doc_list.each_with_index do |doc, i|
|
391
|
-
parent_arr<< doc["id"] unless (doc["id"].blank?)
|
392
|
-
end
|
393
|
-
parent_arr.each do |id|
|
394
|
-
rel_id="info:fedora/#{id}"
|
395
|
-
modified_arr<< rel_id
|
396
|
-
end
|
397
|
-
#logger.debug("Get children for list: #{parent_arr.inspect}, #{modified_arr.inspect}")
|
398
|
-
p = params.dup
|
399
|
-
params.delete(:f)
|
400
|
-
params.delete(:page)
|
401
|
-
params.delete(:q)
|
402
|
-
params.delete(:fq)
|
403
|
-
params.delete(:per_page)
|
404
|
-
params[:rows] = 1000
|
405
|
-
params[:per_page] = 1000
|
406
|
-
response, response_list = get_solr_response_for_field_values(relationship_field_names,modified_arr) ##get child pages
|
407
|
-
#response, is_member_response_list = get_solr_response_for_field_values("is_member_of_s",modified_arr) ## get any child components
|
408
|
-
#logger.debug("Relationship:#{relationship_field_names.inspect}, Children count:#{response_list.count}")
|
409
|
-
params.delete(:rows)
|
410
|
-
params[:f] = p[:f]
|
411
|
-
params[:page] = p[:page]
|
412
|
-
params[:q] = p[:q]
|
413
|
-
params[:fq] = p[:fq]
|
414
|
-
params[:per_page] = p[:per_page]
|
415
|
-
parent_arr.each do |parent|
|
416
|
-
##logger.debug("Processing id: #{parent.inspect}")
|
417
|
-
child_arr=[]
|
418
|
-
member_arr=[]
|
419
|
-
response_list.each do |doc|
|
420
|
-
parent_id = doc[relationship_field_names].first.split("/").last
|
421
|
-
if parent_id.eql?(parent)
|
422
|
-
#logger.debug("is_part_response_list parent #{doc[relationship_field_names.to_s].inspect}, id: #{doc["id"].inspect} ")
|
423
|
-
child_arr<<doc
|
424
|
-
end
|
425
|
-
end
|
426
|
-
#is_member_response_list.each do |doc|
|
427
|
-
# parent_id = doc["is_member_of_s"].first.split("/").last
|
428
|
-
# if parent_id.eql?(parent)
|
429
|
-
# ##logger.debug("is_member_of_s_response_list parent #{doc["is_member_of_s"].inspect}, id: #{doc["id"].inspect} ")
|
430
|
-
# member_arr<<doc
|
431
|
-
# end
|
432
|
-
#end
|
433
|
-
#@image_hash[parent]=image_arr
|
434
|
-
#@member_hash[parent]=member_arr
|
435
|
-
@child_hash[parent]=child_arr
|
436
|
-
end
|
437
|
-
#return [@image_hash, @member_hash ]
|
438
|
-
return @child_hash
|
439
|
-
end
|
440
|
-
end
|