Updating a google doc entry

2 views
Skip to first unread message

loghound

unread,
Mar 3, 2008, 2:49:37 AM3/3/08
to Google Data APIs Objective-C Client Library Discussion
Hi All,

This may be the wrong group to ask but I suspect I have a client
library issue (as opposed to a google doc gdata api issue)

I'm playing with a new project and one of the things I'm doing with
the oh-so-excellent Objective-c client library is getting a list of
documents, uploading some new ones, deleting some and modifying some
(the modification consists currently of just changing the 'title'
string which is what google docs shows as the document name)

So everything is working great -- I can download list of docs, upload
new docs, delete docs -- Everything is great but I can't for the life
of me modify a doc entry.

Here is a snippit of code (slightly modified and condensed)..

[gdataEntry setTitle:@"Some fancy new title"];
NSString *modifyURL=[[[gdataEntry valueForKey:@"links"]
editLink]URL];

GDataServiceTicket *ticket;
ticket = [service fetchDocEntryByUpdatingEntry:gdataEntry
forEntryURL:modifyURL
delegate:self

didFinishSelector:@selector(modifyFileTicket:finishedWithEntry:)
didFailSelector:@selector(modifyFileTicket:failedWithError:)];


Turning on logging shows (with a few X's to protect the innocent)

PUT URL: http://docs.google.com/feeds/documents/private/full/document%3Aah4jzqpkXXX_70c28hs4hh/fdba8XXX

With a header of
Accept = "application/atom+xml, text/xml";
Authorization = "GoogleLogin
auth=DQAAAHXXXXXXXXXXXXXXXXXXXEGCT0WqS-
QH0wQBMucb8z5IK7JatmmZL8tANL_vMhLflC1P7JkC_HfTRYrYkXXXXXXXXXXa207NsNBqrAEqghnprJxs1GH56ptR5jJetijozhD7oHMUafZ1Qud7aYUXXXXXXXXXXXXXXaMTfHWNqEw";
"Cache-Control" = "no-cache";
"Content-Length" = 1133;
"Content-Type" = "application/atom+xml;charset=utf-8";
"User-Agent" = "XXXXXXXX-XXXX-1.0 GData-ObjectiveC/1.3 MacOSX/
10.5.2 (gzip)";


This code is boiler plat from my upload & delete (which work fine) but
this fails consistently with a '404' (not found). This same URI
deletes just fine so I'm pretty sure I've got authentication working
and the URI is correct.

I'm sort of stumped on how to proceed....... Anyone see anything
obviously wrong?

Thanks.

-John

Greg Robbins

unread,
Mar 3, 2008, 4:26:01 AM3/3/08
to gdata-objec...@googlegroups.com
I believe the DocList API server does not yet support updates (PUT).

http://code.google.com/p/gdata-issues/issues/detail?id=277

loghound

unread,
Mar 3, 2008, 5:22:50 PM3/3/08
to Google Data APIs Objective-C Client Library Discussion
Hi Greg,

Yup -- that's the one, I didn't even bother checking the enhancement
request list since I *assumed* that it was something I was doing.
It's one of the more frustrating aspects of the GData API -- everyone
implementation is subtly different. For docs you can't update an
entry, blogger doesn't have optimistic concurrancy, notebook doesn't
allow a post,picassa has some oddness (that I don't recall offhand) --
I know the backends are all different and (apparently ) the teams need
to write their own gdata interfaces -- it would just be nice if they
were a bit more consistent in terms of feature set support (so that
once you learned a basic set of rules you could count 100% of the time
they would work)

For the record though I'm really appreciative of the interfaces and
the work the Google team does to support programatic interfaces to
their services so take my feedback as "I care enough to complain"


On a slightly different note, I a saw a method 'setShouldShowDeleted'
for GDataQuery -- "Ah Ha", I thought -- "The way to get items that are
in the Trash". Sadly though it errors out (it adds a showdeleted=true
to the query) What service allows seeing deleted entries or is this
just wishful thinking (for the record I would *LOVE* a way to get
deleted queries, especially in things like docs that actually maintain
a concept of 'Trash')

-Johhn

Greg Robbins

unread,
Mar 3, 2008, 5:53:40 PM3/3/08
to gdata-objec...@googlegroups.com
I'm not sure why there's not currently access to trashed documents in the DocList API. It's worth adding to the issues list. <http://code.google.com/p/gdata-issues/issues/list>

Some future Google data APIs will support "deleted" elements as tombstone indicators for deleted entries; queries must specify that tombstones should be included in the feed. That's probably an interim step, as an Atom-standard tombstone element is beginning to evolve. <http://tools.ietf.org/id/draft-snell-atompub-tombstones-04.txt>


Reply all
Reply to author
Forward
0 new messages