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.



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

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 "visibility_ssi",
                           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 "resource_type_sim", limit: 5
  end
end

Instance Method Details

#indexObject



38
39
40
41
42
43
44
45
46
47
48
# File 'app/controllers/hyrax/my_controller.rb', line 38

def index
  @user = current_user
  (@response, @document_list) = search_service.search_results
  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