Class: Hyrax::MyController

Inherits:
ApplicationController
  • Object
show all
Includes:
Blacklight::Configurable, Hydra::Catalog, Collections::AcceptsBatches
Defined in:
app/controllers/hyrax/my_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Collections::AcceptsBatches

#batch, #batch=, #check_for_empty_batch?

Class Method Details

.configure_facetsObject

Define filter facets that apply to all repository objects.



7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/hyrax/my_controller.rb', line 7

def self.configure_facets
  # clear facet's copied from the CatalogController
  blacklight_config.facet_fields = {}
  configure_blacklight do |config|
    # TODO: add a visibility facet (requires visibility to be indexed)
    config.add_facet_field solr_name('visibility', :stored_sortable),
                           helper_method: :visibility_badge,
                           limit: 5, label: I18n.t('hyrax.dashboard.my.heading.visibility')
    config.add_facet_field IndexesWorkflow.suppressed_field, helper_method: :suppressed_to_status
    config.add_facet_field solr_name("resource_type", :facetable), limit: 5
  end
end

Instance Method Details

#indexObject



35
36
37
38
39
40
41
42
43
44
45
# File 'app/controllers/hyrax/my_controller.rb', line 35

def index
  @user = current_user
  (@response, @document_list) = query_solr
  prepare_instance_variables_for_batch_control_display

  respond_to do |format|
    format.html {}
    format.rss  { render layout: false }
    format.atom { render layout: false }
  end
end