I have tried download the document(form or spread sheet) via code and
upload it back to the server and send email with the same form, using
ruby on rails and gdata, and I have tried many methods and I have not
been able to get it to work( downloading and uploading and send email
with the form ).
I read the API and here is the result:
class RegistrationsController < ApplicationController
......
# First I have to find the document for create a copy and send email
def find_document
# Session Type is a type of a Event
@session_type = @session.session_type
@document_name = @client.get(DOCLIST_FEED +
"?title...@session_type.format_document_name}&title-
exact=true").to_xml
@document_name.elements.each("entry") do |entry|
id = entry.elements['id'].text[/full\/(.*)/, 1]
# THIS IS THE PART I STOPPED
document = download_document(id)
upload_document(document)
send_email
end
redirect_to session_registrations_url
end
def download_document(id)
# I must download via code, because the user only wants send email
with a copy of
# a form that belongs to session type( type of a event)
document = @client.get(SPREADSHEETS_SCOPE +
"download/spreadsheets/Export?key=#{id}&fmcmd=4")
end
def upload_document(document)
feed = @client.get('http://docs.google.com/feeds/documents/private/
full/-/mine').to_xml
end
def send_email
# I have doubts to send email with the form that I upload above
end
......
end
Thanks,
Tomás
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Docs Data APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Docs-Data-APIs?hl=en
-~----------~----~----~----~------~----~------~--~---