Class: CatalogController

Inherits:
ApplicationController
  • Object
show all
Includes:
Blacklight::Catalog, BlacklightAdvancedSearch::ParseBasicQ, Hydra::Controller::ControllerBehavior
Defined in:
lib/generators/sufia/templates/catalog_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.modified_fieldObject



55
56
57
# File 'lib/generators/sufia/templates/catalog_controller.rb', line 55

def self.modified_field
  solr_name('desc_metadata__date_modified', :stored_sortable, type: :date)
end

.uploaded_fieldObject



50
51
52
53
# File 'lib/generators/sufia/templates/catalog_controller.rb', line 50

def self.uploaded_field
#  system_create_dtsi
  solr_name('desc_metadata__date_uploaded', :stored_sortable, type: :date)
end

Instance Method Details

#indexObject



25
26
27
28
29
30
# File 'lib/generators/sufia/templates/catalog_controller.rb', line 25

def index
  super
  recent
  #also grab my recent docs too
  recent_me    
end

#recentObject



32
33
34
35
36
37
38
39
40
41
# File 'lib/generators/sufia/templates/catalog_controller.rb', line 32

def recent
  if user_signed_in?
    # grab other people's documents
    (_, @recent_documents) = get_search_results(:q =>filter_not_mine,
                                      :sort=>sort_field, :rows=>4)      
  else 
    # grab any documents we do not know who you are
    (_, @recent_documents) = get_search_results(:q =>'', :sort=>sort_field, :rows=>4)
  end
end

#recent_meObject



43
44
45
46
47
48
# File 'lib/generators/sufia/templates/catalog_controller.rb', line 43

def recent_me
  if user_signed_in?
    (_, @recent_user_documents) = get_search_results(:q =>filter_mine,
                                      :sort=>sort_field, :rows=>4)
  end
end