# File lib/vpim/agent/ics.rb, line 25 def atomize(caluri, feeduri) repo = Vpim::Repo::Uri.new(caluri) cal = repo.find{true} cal = View.week(cal) feed = Agent::Atomize.calendar(cal, feeduri, caluri, cal.name) return feed.to_xml, Agent::Atomize::MIME end
When we support other forms..
get ‘/ics/:form’ do
form = params[:form]
# File lib/vpim/agent/ics.rb, line 55 def get_atom(caluri) if caluri.empty? redirect script_url end feeduri = script_url + "/atom?" + caluri begin xml, xmltype = atomize(caluri, feeduri) content_type xmltype body xml rescue redirect script_url + "?" + caluri end end
Route handlers:
# File lib/vpim/agent/ics.rb, line 34 def get_base(from) @url_base = script_url # agent mount point @url_ics = from # ics from here @url_atom = nil # atom feed from here, if ics is accessible @url_error= nil # error message, if is is not accessible if not from.empty? begin atomize(from, "http://example.com") @url_atom = @url_base + "/atom" + "?" + from rescue @url_error = CGI.escapeHTML($!.to_s) end end haml :"vpim/agent/ics/view" end
Generated with the Darkfish Rdoc Generator 2.