app/models/concerns/dri/solr/document/export.rb
def export_as_dri_citation
  	text = ''

  	authors_list = []
  	authors_list_final = []

  	authors = author_list
  	authors.each do |author|
  	  next if author.blank?
  	  authors_list.push(author)
  	end
  	authors_list.each do |author|
  	  if author == authors_list.first # first
  	    authors_list_final.push(author.strip)
  	  elsif author == authors_list.last # last
  	    authors_list_final.push(', &amp; ' + author.strip)
  	  else # all others
  	    authors_list_final.push(', ' + author.strip)
  	  end
  	end

  	text += authors_list_final.join

  	unless text.blank?
  	  if text[-1, 1] != '.'
  	    text += '. '
  	  else
  	    text += ' '
  	  end
  	end

  	# Get Pub Date
  	#text << '(' + setup_pub_date('dri') + ') ' unless setup_pub_date('dri').nil?
  	title_info = ''
  	self['full_title_tesim'].each do |t|
  	  title_info += clean_end_punctuation(CGI.escapeHTML(t)).strip + ', '
  	end
  	text += title_info unless title_info.blank?
  	# Set database name
  	text += setup_database_name

    unless self['readonly_depositing_institute_tesim'].blank?
  	  text += ", #{self['readonly_depositing_institute_tesim'].first} [Depositing Institution]"
    end

    unless self['readonly_doi_tesim'].blank?
      text += ", https://doi.org/#{self['readonly_doi_tesim'].first}"
    end

  	text.html_safe
  end
# Exports the citation in DRI format
# @return [String] the citation as html-safe text
Exports the citation in DRI format
Exports the citation in DRI format
def export_as_dri_citation
  	text = ''
  	authors_list = []
  	authors_list_final = []
  	authors = author_list
  	authors.each do |author|
  	  next if author.blank?
  	  authors_list.push(author)
  	end
  	authors_list.each do |author|
  	  if author == authors_list.first 
  	    authors_list_final.push(author.strip)
  	  elsif author == authors_list.last 
  	    authors_list_final.push(', &amp; ' + author.strip)
  	  else 
  	    authors_list_final.push(', ' + author.strip)
  	  end
  	end
  	text += authors_list_final.join
  	unless text.blank?
  	  if text[-1, 1] != '.'
  	    text += '. '
  	  else
  	    text += ' '
  	  end
  	end
  	title_info = ''
  	self['full_title_tesim'].each do |t|
  	  title_info += clean_end_punctuation(CGI.escapeHTML(t)).strip + ', '
  	end
  	text += title_info unless title_info.blank?
  	text += setup_database_name
    unless self['readonly_depositing_institute_tesim'].blank?
  	  text += ", #{self['readonly_depositing_institute_tesim'].first} [Depositing Institution]"
    end
    unless self['readonly_doi_tesim'].blank?
      text += ", https://doi.org/#{self['readonly_doi_tesim'].first}"
    end
  	text.html_safe
  end
def export_as_dri_citation text = '' authors_list = [ ] authors_list_final = [ ] authors = author_list authors . each do | author | next if author . blank? authors_list . push ( author ) end authors_list . each do | author | if author == authors_list . first authors_list_final . push ( author . strip ) elsif author == authors_list . last authors_list_final . push ( ', &amp; ' + author . strip ) else authors_list_final . push ( ', ' + author . strip ) end end text += authors_list_final . join unless text . blank? if text [ - 1 , 1 ] != '.' text += '. ' else text += ' ' end end title_info = '' self [ 'full_title_tesim' ] . each do | t | title_info += clean_end_punctuation ( CGI . escapeHTML ( t ) ) . strip + ', ' end text += title_info unless title_info . blank? text += setup_database_name unless self [ 'readonly_depositing_institute_tesim' ] . blank? text += ", #{self['readonly_depositing_institute_tesim'].first} [Depositing Institution]" end unless self [ 'readonly_doi_tesim' ] . blank? text += ", https://doi.org/#{self['readonly_doi_tesim'].first}" end text . html_safe end
Exports the citation in DRI format
Exports the citation in DRI format
# first # last # all others # Get Pub Date #text << '(' + setup_pub_date('dri') + ') ' unless setup_pub_date('dri').nil? # Set database name
the citation as html-safe text
the citation as html - safe text
String