Class: ExhibitsController

Inherits:
AtriumBaseController show all
Defined in:
lib/generators/atrium/install/templates/controllers/exhibits_controller.rb

Overview

TODO: Move to generator

Instance Method Summary collapse

Methods included from SolrHelper

#__initialize_collection, #get_current_browse_level, #get_exhibit_navigation_data

Methods included from CollectionsHelper

#prepare_extra_controller_params_for_asset_query

Methods included from Atrium::CollectionsHelper

#get_saved_items, #get_saved_search, #saved_searches_for_select

Methods included from Atrium::ApplicationHelper

#application_name

Methods included from ApplicationHelper

#application_name, #breadcrumb_builder, #breadcrumb_links, #collection_title, #if_browsing_facet?, #in_collection_context?, #in_unscoped_catalog_search?

Methods included from NavigationHelper

#add_browse_facet_params, #get_browse_facet_path, #get_selected_browse_facet_path, #get_selected_browse_facets, #remove_related_facet_params

Methods included from Atrium::ShowcasesHelper

#facet_element, #get_parent_path, #get_showcase_parent_edit_path, #get_showcase_parent_show_path, #render_showcase_facet_selection

Instance Method Details

#determine_layoutObject



43
44
45
# File 'lib/generators/atrium/install/templates/controllers/exhibits_controller.rb', line 43

def determine_layout
  @exhibit.collection.theme_path
end

#evaluate_query_paramsObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/generators/atrium/install/templates/controllers/exhibits_controller.rb', line 25

def evaluate_query_params
  unless @exhibit
    raise("No exhibit object found. Please initialize exhibit")
  end
  assets_to_extract_query = []
  assets_to_extract_query << @exhibit
  assets_to_extract_query << @exhibit.collection

  if @exhibit.respond_to?(:browse_levels)
    assets_to_extract_query << @exhibit.browse_levels
  end

  @extra_controller_params = prepare_extra_controller_params_for_asset_query(
    assets_to_extract_query,
    params
  )
end

#find_collectionObject



11
12
13
14
15
16
17
18
19
# File 'lib/generators/atrium/install/templates/controllers/exhibits_controller.rb', line 11

def find_collection
  if params.has_key? :id
    @exhibit = Atrium::Exhibit.find(params[:id])
    @collection = @exhibit.collection
    return __initialize_collection
  else
    return false
  end
end

#find_showcasesObject



21
22
23
# File 'lib/generators/atrium/install/templates/controllers/exhibits_controller.rb', line 21

def find_showcases
  Atrium::Showcase.with_selected_facets(@exhibit.id, @exhibit.class.name, params[:f])
end

#showObject



5
6
7
8
9
# File 'lib/generators/atrium/install/templates/controllers/exhibits_controller.rb', line 5

def show
  @exhibit_navigation_data = get_exhibit_navigation_data(@exhibit)
  @showcases=find_showcases
  logger.debug("Showcase: #{@showcase.inspect}")
end