app/controllers/browse_controller.rb
# checks to see if there are previous items to page to
checks to see if there are previous items to page to
checks to see if there are previous items to page to
def check_for_previous
    base_solr_url = Blacklight.connection_config[:url].gsub(/\/solr\/.*/,'/solr')
    dbclnt = HTTPClient.new
    solrResponseFull = []
    return_array = []
    q =  {"q" => '[* TO "' + params[:authq].gsub("\\"," ").gsub('"',' ') +'"]' }
    url = base_solr_url + "/" + @@browse_index_callnumber + "/reverse?wt=json&" + q.to_param + '&fl=*&start=0&rows=1'
    solrResultString = dbclnt.get_content( url )
    if !solrResultString.nil?
      y = solrResultString
      solrResponseFull = JSON.parse(y)
    else
      return false
    end
    return true if solrResponseFull['response']['numFound'] > 0
    return false if solrResponseFull['response']['numFound'] == 0
  end
def check_for_previous base_solr_url = Blacklight . connection_config [ :url ] . gsub ( / \/ solr \/ .* / , '/solr' ) dbclnt = HTTPClient . new solrResponseFull = [ ] return_array = [ ] q = { "q" => '[* TO "' + params [ :authq ] . gsub ( "\\" , " " ) . gsub ( '"' , ' ' ) + '"]' } url = base_solr_url + "/" + @@browse_index_callnumber + "/reverse?wt=json&" + q . to_param + '&fl=*&start=0&rows=1' solrResultString = dbclnt . get_content ( url ) if ! solrResultString . nil? y = solrResultString solrResponseFull = JSON . parse ( y ) else return false end return true if solrResponseFull [ 'response' ] [ 'numFound' ] > 0 return false if solrResponseFull [ 'response' ] [ 'numFound' ] == 0 end
checks to see if there are previous items to page to
checks to see if there are previous items to page to