@@ -45,63 +45,9 @@ xml.feed("xmlns" => "http://www.w3.org/2005/Atom",
4545 # updated is required, for now we'll just set it to now, sorry
4646 xml . updated Time . now . strftime ( "%Y-%m-%dT%H:%M:%SZ" )
4747
48- @document_list . each_with_index do |doc , document_counter |
49- xml . entry do
50- xml . title doc . to_semantic_values [ :title ] [ 0 ] || doc . id
51-
52- # updated is required, for now we'll just set it to now, sorry
53- xml . updated Time . now . strftime ( "%Y-%m-%dT%H:%M:%SZ" )
54-
55- xml . link "rel" => "alternate" , "type" => "text/html" , "href" => polymorphic_url ( doc )
56- # add other doc-specific formats, atom only lets us have one per
57- # content type, so the first one in the list wins.
58- xml << render_link_rel_alternates ( doc , :unique => true )
59-
60- xml . id polymorphic_url ( doc )
61-
62-
63- if doc . to_semantic_values [ :author ] [ 0 ]
64- xml . author { xml . name ( doc . to_semantic_values [ :author ] [ 0 ] ) }
65- end
66-
67- with_format ( "html" ) do
68- xml . summary "type" => "html" do
69- xml . text! render_document_partial ( doc ,
70- :index ,
71- :document_counter => document_counter )
72- end
73- end
74-
75- #If they asked for a format, give it to them.
76- if ( params [ "content_format" ] &&
77- doc . export_formats [ params [ "content_format" ] . to_sym ] )
78-
79- type = doc . export_formats [ params [ "content_format" ] . to_sym ] [ :content_type ]
80-
81- xml . content :type => type do |content_element |
82- data = doc . export_as ( params [ "content_format" ] )
83-
84- # encode properly. See:
85- # http://tools.ietf.org/html/rfc4287#section-4.1.3.3
86- type = type . downcase
87- if ( type . downcase =~ /\+ |\/ xml$/ )
88- # xml, just put it right in
89- content_element << data
90- elsif ( type . downcase =~ /text\/ / )
91- # text, escape
92- content_element . text! data
93- else
94- #something else, base64 encode it
95- content_element << Base64 . encode64 ( data )
96- end
97- end
98-
99- end
100-
101-
102- end
48+ @document_list . each_with_index do |document , document_counter |
49+ xml << Nokogiri ::XML . fragment ( render_document_partials ( document , blacklight_config . view_config ( :atom ) . partials , document_counter : document_counter ) )
10350 end
104-
10551end
10652
10753
0 commit comments