Just reading this whole thread... Harry,
can you verify for me: you were using the DocumentsRequest class and got confused because there is no updateDocument on that class, so you would have had to mix the new with the old model and found not enough documentation etc to make this understandable? If this is correct, please do me a favor and go to: http://code.google.com/p/google-gdata/issues/list and a a feature request for this. If it is not, go to: http://code.google.com/p/google-gdata/issues/list and file a "hey, i was stuck because' bug there, so that i can get this fixed for the .NET client. Frank Mantek Google On Jun 12, 2009, at 12:26 AM, harry mendell wrote: > > Thanks! But the 'write my app for me part isn't fair', this is a very > small part of large system demo I am putting together to convince our > company to fund a large internal trading system based on Google's > tech. In a way I am doing Google's work as an internal evangelist. > Also, I would never have had to ask if the document request class had > an example. Don't you think that updating a doc should be a one-liner? > Things are also difficult because Google keeps switching their > "protocol of the month flavor" and of the examples that work are > either not making use of the high level classes of the API. Some even > (like the doc uploader are using cookies). Man it is all over the > place. On top of that anyone who wants to use this commercially > doesn't want to publish their, in our case, trades and positions on > the public internet, so all of the cool mashup or url based stuff is > useless.The upshot is that it isn't obvious what the best route is to > take, particular because you guys are so prolific and have some many > exciting ways to go. Should I make it a gadget, no maybe a doc, wait, > how about GWT. Maybe I should start over with Wave.Even if a choose > gadget, which kind, you still have 3 flavors. All of this stuff looks > great as a toy demo, but try some heavy lifting and its phhhhht. > Trying to show off with this stuff to type A high pressure traders is > not exactly a joy ride either. I went out on the limb talking Google > up to our management and my neck in now on the chopping block. Its not > as if I am an idiot either. I have a patent on the first MMU chip at > Bell Labs and worked with the original UNIX team.Google me. :) > > What I think is really needed is a different level of support for > early adopters who are more visionary or creative customers then hard > core developers. It is these people which will help Google spread its > magic commercially. Also with all of the different approaches > available, someone just to point people in the right direction is > necessary when their are so many choices. Otherwise people who are not > in the creative explosion long enough to figure it out will lose and > we will be stuck in microsoft hell. :) > > > On Jun 11, 5:16 pm, "Eric (Google)" <api.e...@google.com> wrote: >> This worked for me: >> >> DocumentsService service = new DocumentsService("yourCompany-AppName- >> v1"); >> // TODO: Fetch DocumentEntry >> ReplaceDocContents(entryToUpdate, "C:\somewhere\test.doc"); >> ... >> >> static public DocumentEntry ReplaceDocContents(DocumentEntry >> entryToUpdate, string replacementFileName) >> { >> DocumentEntry entry = null; >> >> FileInfo fileInfo = new FileInfo(replacementFileName); >> FileStream stream = fileInfo.Open(FileMode.Open, FileAccess.Read, >> FileShare.ReadWrite); >> >> try >> { >> // convert the extension to caps and strip the "." off the front >> string ext = fileInfo.Extension.ToUpper().Substring(1); >> >> String contentType = (String)GDocumentsAllowedTypes[ext]; >> >> if (contentType == null) >> { >> throw new ArgumentException("File extension '" + ext + >> "' is not recognized as valid."); >> } >> >> // Make sure we don't overwrite someone else's changes. Use >> entry's ETag >> GDataRequestFactory factory = (GDataRequestFactory) >> service.RequestFactory; >> factory.CustomHeaders.Add("If-Match: " + entryToUpdate.Etag); >> service.RequestFactory = factory; >> >> entry = service.Update(new Uri(entryToUpdate.MediaUri.ToString()), >> stream, contentType, >> entryToUpdate.Title.Text) as DocumentEntry; >> } >> finally >> { >> stream.Close(); >> } >> >> return entry; >> >> } >> >> You may have more luck next time if the post isn't "write my app for >> me". >> >> Eric >> >> On Jun 11, 11:49 am, harry mendell <qvt...@gmail.com> wrote: >> >> >> >>> I tried .net and first and can upload but not update. At this >>> point I >>> would be grateful for any solution. I've been at this for over a >>> week >>> and am ready to put my head through the wall:) >> >>> PS I am able to do it a cell at a time with the spreadsheet api, but >>> its slow, and besides I am not going to be able to sleep until I get >>> this. I haven't felt like such a newbie since I poped out of my >>> mother. Starting to feel postal. > > --~--~---------~--~----~------------~-------~--~----~ 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 Google-Docs-Data-APIs@googlegroups.com To unsubscribe from this group, send email to google-docs-data-apis+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Docs-Data-APIs?hl=en -~----------~----~----~----~------~----~------~--~---