Class: Admin::ApiController

Inherits:
ApplicationController
  • Object
show all
Includes:
Blacklight::Catalog, BlacklightAdvancedSearch::Controller
Defined in:
lib/generators/geoblacklight_admin/templates/api_controller.rb

Instance Method Summary collapse

Instance Method Details

#adminObject

Administrative view of document

  • Sidecar Image

  • URIs



368
369
370
# File 'lib/generators/geoblacklight_admin/templates/api_controller.rb', line 368

def admin
  _, @document = search_service.fetch(params[:id])
end

#advanced_search_facetsObject

Administrative view of adv search facets



386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/generators/geoblacklight_admin/templates/api_controller.rb', line 386

def advanced_search_facets
  # We want to find the facets available for the current search, but:
  # * IGNORING current query (add in facets_for_advanced_search_form filter)
  # * IGNORING current advanced search facets (remove add_advanced_search_to_solr filter)
  @response, = search_service.search_results do |search_builder|
    search_builder.except(:add_advanced_search_to_solr).append(:facets_for_advanced_search_form)
  end

  respond_to do |format|
    format.json do
      @presenter = Blacklight::JsonPresenter.new(@response,
        blacklight_config)
    end
  end
end

#fetchObject

Administrative view for array of document ids

  • bookmarks



374
375
376
377
378
379
380
381
382
383
# File 'lib/generators/geoblacklight_admin/templates/api_controller.rb', line 374

def fetch
  @response, = search_service.fetch(params[:id])

  respond_to do |format|
    format.json do
      @presenter = Blacklight::JsonPresenter.new(@response,
        blacklight_config)
    end
  end
end