Open GoogleCodeExporter opened 9 years ago
I need the sample in Atom, I did not know enough about the difference
yesterday.
Original comment by jeremyvillalobos
on 25 Mar 2011 at 2:59
Nevermind. I got it. First, I did not know enough about http protocol and that
was part of the problem. second the documentation in.
http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#Se
archingDocs
can be adapted to google-api-java client by understanding that the POST and
non-xml lines at the beginning of packets are input information for
GoogleHeaders. I am using docs-v3-atom-oauth-sample as reference.
The xml atom information or file's content goes into an InputStreamContent that
is then given to the request object (request.content). for example:
//
//all these attributes have their respective variable in GoogleHeaders Object
//the authorization value is filled in existing sample code.
//
POST /feeds/default/private/full HTTP/1.1
Host: docs.google.com
GData-Version: 3.0
Authorization: <your authorization header here>
Content-Length: 73612
Content-Type: multipart/related; boundary=END_OF_PART
Slug: test.doc
//the content from here down can is given using an InputContentStream (refer to
the only google docs sample to see how it works)
--END_OF_PART
Content-Type: application/atom+xml
<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:docs="http://schemas.google.com/docs/2007">
<category scheme="http://schemas.google.com/g/2005#kind"
term="http://schemas.google.com/docs/2007#document"/>
<title>example document</title>
<docs:writersCanInvite value="false" />
</entry>
Now, the only question I have is how do you input both Atom-xml information
(metadata) and document content ( plain text for example) ? this is not clear
to me from the existing documentation.
Attached are the two methods to get a text file from docs, and to update the
plain/text document. You can add them to docs-v3-atom-oauth-sample.
Original comment by jeremyvillalobos
on 1 Apr 2011 at 2:47
Attachments:
Original issue reported on code.google.com by
jeremyvillalobos
on 24 Mar 2011 at 6:06