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



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

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 IndexesWorkflow.suppressed_field, helper_method: :suppressed_to_status
    config.add_facet_field solr_name("admin_set", :facetable), limit: 5
    config.add_facet_field solr_name("resource_type", :facetable), limit: 5
  end
end

Instance Method Details

#indexObject



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

def index
  # The user's collections for the "add to collection" form
  # TODO: could this be only on the My::WorksController?
  @user_collections = collections_service.search_results(:edit)

  @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

#suppressed_to_status(value) ⇒ Object



49
50
51
52
53
54
55
56
# File 'app/controllers/hyrax/my_controller.rb', line 49

def suppressed_to_status(value)
  case value
  when "false"
    "Published"
  else
    "In review"
  end
end