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



370
371
372
# File 'lib/generators/geoblacklight_admin/templates/api_controller.rb', line 370

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

#advanced_search_facetsObject

Administrative view of adv search facets



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

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



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

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