Class: Hyrax::MyController

Inherits:
ApplicationController
  • Object
show all
Extended by:
Deprecation
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.


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

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


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

def index
  @user = current_user
  Deprecation.silence(Hyrax::MyController) do
    (@response, @document_list) = query_solr
  end
  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