Class: Atrium::ExhibitsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/atrium/exhibits_controller.rb

Instance Method Summary collapse

Methods included from DescriptionsHelper

#get_description_for_showcase

Methods included from CollectionsHelper

#add_browse_facet_params, #browse_collection_link, #can_add_view_exhibit?, #edit_collection_link, #exhibit_scoped_to_items?, #get_browse_facet_path, #get_collection_id, #get_collections_list, #get_customize_page_path, #get_exhibit_set_number, #get_selected_browse_facet_path, #get_selected_browse_facets, #get_solr_documents_from_asset, #grouped_result_count, #remove_related_facet_params

Methods included from LayoutHelper

#collection_theme_if_present, #current_layout

Methods included from SolrHelper

#__initialize_collection, #add_exclude_fq_to_solr, #atrium_collection, #browse_collection_link, #browse_document_list, #browse_response, #current_extra_controller_params, #edit_collection_link, #exhibit, #exhibits, #get_collection_id, #get_current_filter_query_params, #get_exhibit_navigation_data, #grouped_result_count, #prepare_extra_controller_params_for_collection_query, #reset_extra_controller_params_after_collection_query

Methods included from AtriumHelperBehavior

#application_name, #extra_head_content, #facet_limit_for, #get_start_over_path, #javascript_includes, #link_back_to_catalog, #link_to_document, #render_constraints, #render_facet_limit, #save_collection_id_in_session, #save_exhibit_id_in_session, #set_edit_showcase_in_session, #stylesheet_links

Instance Method Details

#createObject



12
13
14
15
16
17
18
# File 'app/controllers/atrium/exhibits_controller.rb', line 12

def create
  @exhibit = Atrium::Exhibit.new(params[:atrium_exhibit])
  if @exhibit.update_attributes(params[:atrium_exhibit])
    flash[:notice] = 'Exhibit was successfully created.'
    redirect_to :controller=>"atrium/collections", :action => "edit", :id=>@exhibit.atrium_collection_id
  end
end

#destroyObject



70
71
72
73
74
75
# File 'app/controllers/atrium/exhibits_controller.rb', line 70

def destroy
  @exhibit = Atrium::Exhibit.find(params[:id])
  Atrium::Exhibit.destroy(params[:id])
  flash[:notice] = 'Exhibit '+params[:id] +' was deleted successfully.'
  redirect_to edit_atrium_collection_path(@exhibit.atrium_collection_id)
end

#editObject



20
21
22
23
24
# File 'app/controllers/atrium/exhibits_controller.rb', line 20

def edit
  @exhibit = Atrium::Exhibit.find(params[:id])
  @atrium_collection = @exhibit.collection
  @exhibit_navigation_data = get_exhibit_navigation_data
end

#initialize_collectionObject



77
78
79
80
81
82
83
# File 'app/controllers/atrium/exhibits_controller.rb', line 77

def initialize_collection
  if collection_id = determine_collection_id
    return __initialize_collection( collection_id )
  else
    return false
  end
end

#newObject



5
6
7
8
9
10
# File 'app/controllers/atrium/exhibits_controller.rb', line 5

def new
  @exhibit = Atrium::Exhibit.new
  respond_to do |format|
    format.html
  end
end

#set_exhibit_scopeObject



48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'app/controllers/atrium/exhibits_controller.rb', line 48

def set_exhibit_scope
  logger.error("into scoping")
  session[:copy_folder_document_ids] = session[:folder_document_ids]
  session[:folder_document_ids] = []
  @exhibit = Atrium::Exhibit.find(params[:id])

  session[:folder_document_ids] = @exhibit.filter_query_params[:solr_doc_ids].split(',') if @exhibit.filter_query_params && @exhibit.filter_query_params[:solr_doc_ids]
  p = params.dup
  p.delete :action
  p.delete :id
  p.delete :controller
  #make sure to pass in a search_fields parameter so that it shows search results immediately
  redirect_to catalog_index_path(p)
end

#showObject



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'app/controllers/atrium/exhibits_controller.rb', line 34

def show
  #get children of emission dates
  @members = get_all_children(@browse_document_list, "is_member_of_s")
  @exhibit= Atrium::Exhibit.find(params[:id]) unless @exhibit
  @exhibit_navigation_data = get_exhibit_navigation_data
  @collection_items_response, @collection_items_documents=get_solr_documents_from_asset(@exhibit)
  @atrium_showcase=Atrium::Showcase.with_selected_facets(@exhibit.id, @exhibit.class.name, params[:f]).first
  @featured_response, @featured_documents=get_solr_documents_from_asset(@atrium_showcase) unless @atrium_showcase.nil?
  @description_hash=get_description_for_showcase(@atrium_showcase) unless @atrium_showcase.nil?
  if params[:no_layout]
    render :layout=>false
  end
end

#unset_exhibit_scopeObject



63
64
65
66
67
68
# File 'app/controllers/atrium/exhibits_controller.rb', line 63

def unset_exhibit_scope
   @exhibit = Atrium::Exhibit.find(params[:id])
   @exhibit.update_attributes(:filter_query_params=>nil)
   flash[:notice] = 'Exhibit scope removed successfully'
   render :action => "edit"
end

#updateObject



26
27
28
29
30
31
32
# File 'app/controllers/atrium/exhibits_controller.rb', line 26

def update
  @exhibit = Atrium::Exhibit.find(params[:id])
  if @exhibit.update_attributes(params[:atrium_exhibit])
    flash[:notice] = 'Exhibit was successfully updated.'
  end
  redirect_to :action => "edit"
end