Module: BlacklightMarcHelper
- Defined in:
- app/helpers/blacklight_marc_helper.rb
Instance Method Summary collapse
-
#refworks_export_url(params = {}) ⇒ Object
This method should move to BlacklightMarc in Blacklight 6.x.
- #refworks_solr_document_path(opts = {}) ⇒ Object
-
#render_endnote_texts(documents) ⇒ Object
puts together a collection of documents into one endnote export string.
-
#render_refworks_texts(documents) ⇒ Object
puts together a collection of documents into one refworks export string.
-
#single_endnote_catalog_path(opts = {}) ⇒ Object
For exporting a single endnote document.
Instance Method Details
#refworks_export_url(params = {}) ⇒ Object
This method should move to BlacklightMarc in Blacklight 6.x
4 5 6 |
# File 'app/helpers/blacklight_marc_helper.rb', line 4 def refworks_export_url params = {} "http://www.refworks.com/express/expressimport.asp?vendor=#{CGI.escape(params[:vendor] || application_name)}&filter=#{CGI.escape(params[:filter] || "MARC Format")}&encoding=65001" + (("&url=#{CGI.escape(params[:url])}" if params[:url]) || "") end |
#refworks_solr_document_path(opts = {}) ⇒ Object
8 9 10 11 12 |
# File 'app/helpers/blacklight_marc_helper.rb', line 8 def refworks_solr_document_path opts = {} if opts[:id] refworks_export_url(url: solr_document_url(opts[:id], format: :refworks_marc_txt)) end end |
#render_endnote_texts(documents) ⇒ Object
puts together a collection of documents into one endnote export string
32 33 34 35 36 37 38 39 40 |
# File 'app/helpers/blacklight_marc_helper.rb', line 32 def render_endnote_texts(documents) val = '' documents.each do |doc| if doc.exports_as? :endnote val += doc.export_as(:endnote) + "\n" end end val end |
#render_refworks_texts(documents) ⇒ Object
puts together a collection of documents into one refworks export string
21 22 23 24 25 26 27 28 29 |
# File 'app/helpers/blacklight_marc_helper.rb', line 21 def render_refworks_texts(documents) val = '' documents.each do |doc| if doc.exports_as? :refworks_marc_txt val += doc.export_as(:refworks_marc_txt) + "\n" end end val end |
#single_endnote_catalog_path(opts = {}) ⇒ Object
For exporting a single endnote document. (endnote_catalog_path is defined by blacklight-marc and it is used for multiple document export)
15 16 17 |
# File 'app/helpers/blacklight_marc_helper.rb', line 15 def single_endnote_catalog_path opts = {} solr_document_path(opts.merge(format: 'endnote')) end |