module FcrepoAdmin::Controller::ControllerBehavior

Protected Instance Methods

authorize_object() click to toggle source
# File lib/fcrepo_admin/controller/controller_behavior.rb, line 25
def authorize_object
  authorize! params[:action].to_sym, @object
end
load_and_authorize_object() click to toggle source
# File lib/fcrepo_admin/controller/controller_behavior.rb, line 11
def load_and_authorize_object
  load_object
  authorize_object
end
load_object() click to toggle source
# File lib/fcrepo_admin/controller/controller_behavior.rb, line 16
def load_object
  pid = params[:object_id] || params[:id]
  begin
    @object = ActiveFedora::Base.find(pid, :cast => true)
  rescue ActiveFedora::ObjectNotFoundError
    render :text => "Object not found", :status => 404
  end
end
object_is_governed_by() click to toggle source
# File lib/fcrepo_admin/controller/controller_behavior.rb, line 29
def object_is_governed_by
  @object_is_governed_by ||= @object.send(@object.governed_by_association.name) rescue nil
end
solr_documents_for_response(solr_response) click to toggle source
# File lib/fcrepo_admin/controller/controller_behavior.rb, line 40
def solr_documents_for_response(solr_response)
  solr_response.docs.collect { |doc| SolrDocument.new(doc, solr_response) }
end
solr_response_for_raw_result(solr_result) click to toggle source

solr_response_for_raw_result and solr_documents_for_response duplicate Blacklight functionality outside of a full Blacklight catalog controller context.

# File lib/fcrepo_admin/controller/controller_behavior.rb, line 36
def solr_response_for_raw_result(solr_result)
  Blacklight::SolrResponse.new(solr_result, {})
end