Issue 632 in google-gdata: Update of Google Document removes all parent folders

21 views
Skip to first unread message

google...@googlecode.com

unread,
Oct 14, 2012, 2:41:58 AM10/14/12
to gdata-dotnet-...@googlegroups.com
Status: New
Owner: ----

New issue 632 by Saller....@gmail.com: Update of Google Document removes
all parent folders
http://code.google.com/p/google-gdata/issues/detail?id=632

What steps will reproduce the problem?
1. Create a Document Entry thru Google Data API ResumableUploader=> The
document is added to the MyDrive (root) folder
2. move it to a subfolder thru MoveDocumentTo (e.g. Notes) => The document
is no visible in both folders, Drive root folder and Notes subfolder (why?
When I move it, I would expect it only in the Notes folder afterwards, I
didn't use CopeDocumentTo or soemthing else)
2. Update the same document with ResumableUploader => Now the document lost
all its parentfolders (My Drive as well as Notes, why? It worked some
months ago, but since the switch from Google Documents to Drive this seems
not to work anymore, therefore I have now to move the document always again
to Notes subfolder to have it listed there

What version of the product are you using? On what operating system?
GoogleDataApi 2.1.0 from 27-May-2012

Here is my code I am using:
private void SaveGoogleNote(Document GoogleNote)
{

ResumableUploader uploader = new ResumableUploader();

if (GoogleNote.DocumentEntry.Id.Uri != null)
{

uploader.AsyncOperationCompleted += new
AsyncOperationCompletedEventHandler(OnGoogleNoteUpdated);
uploader.UpdateAsync(authenticator, GoogleNote.DocumentEntry,
match);
//uploader.Update(_authenticator, GoogleNote.DocumentEntry);

}
else
{
uploader.AsyncOperationCompleted += new
AsyncOperationCompletedEventHandler(OnGoogleNoteCreated);
// Define the resumable upload link
Uri createUploadUrl = new
Uri("https://docs.google.com/feeds/upload/create-session/default/private/full");
AtomLink link = new AtomLink(createUploadUrl.AbsoluteUri);
link.Rel = ResumableUploader.CreateMediaRelation;
googleNote.DocumentEntry.Links.Add(link);
googleNote.DocumentEntry.Service = documentsRequest.Service;
// Start the upload process
uploader.InsertAsync(authenticator, googleNote.DocumentEntry,
UserData);
}
}

private void OnGoogleNoteCreated(object sender,
AsyncOperationCompletedEventArgs e)
{

MoveGoogleNote(e.Entry as DocumentEntry, "create", e.Error,
e.Cancelled);
}

private void OnGoogleNoteUpdated(object sender,
AsyncOperationCompletedEventArgs e)
{
MoveGoogleNote(e.Entry as DocumentEntry, "update", e.Error,
e.Cancelled);
}


private void MoveGoogleNote(DocumentEntry entry, string title, Exception
ex, bool cancelled)
{
if (ex != null)
{
ErrorHandler.Handle(new Exception("Google Note couldn't be " +
title + "d: " + entry == null ? null : entry.Title.Text, ex));
return;
}

if (cancelled || entry == null)
{
ErrorHandler.Handle(new Exception("Google Note " + title + " was
cancelled: " + entry == null ? null : entry.Title.Text));
return;
}

//Move now to Notes subfolder
Document newNote = LoadGoogleNotes(entry.Id);
newNote = DocumentsRequest.MoveDocumentTo(googleNotesFolder, newNote);

}

google...@googlecode.com

unread,
Oct 16, 2014, 12:59:25 AM10/16/14
to gdata-dotnet-...@googlegroups.com

Comment #1 on issue 632 by Saller....@gmail.com: Update of Google Document
removes all parent folders
https://code.google.com/p/google-gdata/issues/detail?id=632

is there any fix planned for this?

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages