2012-06-06 116 views
0

背景

我目前正在使用Google Drive/Docs实施应用程序。使用最新的​​库,我正在上传图像,将Google Drive作为图像库。Google DocumentsList API - 以编程方式设置描述

问题

我想能够设置在谷歌驱动器的每个项目相关联的描述字段。上传工作正常,我无法使描述字段正常工作。

我可以看到在此post中提到的修改已被集成到最新的库中,所以DocumentEntry类现在有一个Description成员。

将此新成员设置为文本时我希望在Google Drive中插入文件时引发(400) Bad Request错误。完整的错误是:

<errors xmlns='http://schemas.google.com/g/2005'> 
    <error> 
     <domain>GData</domain> 
     <code>ParseException</code> 
     <internalReason>[Line 3, Column 42, element docs:description] Unknown attribute: 'value' </internalReason> 
    </error> 
    <error> 
     <domain>GData</domain> 
     <code>ParseException</code> 
     <internalReason>Unknown attribute: 'value' </internalReason> 
    </error> 
</errors> 

我一直在使用.Summary以及.Content.Content,但没有结果尝试。守则的什么,我想实现一个例子:

DocumentEntry entry = new DocumentEntry(); 

entry.Title.Text = "Test Upload"; 
entry.Description = "Tag1, Tag2"; // Once I set this I get the error 
entry.Summary.Text = "Tag3, Tag 4"; // This doesn't do anything! 

问题

经验的人的任何援助都这样做,或者寻找到它之前,将不胜感激。

是否有人成功实施了此功能?或者,Google API的限制是客户无法控制的吗?

回答

0

docs:description元件不再接受它的值作为属性:

<docs:description>Tag1, Tag2</docs:description> 

的NET库一直:

<docs:description value="Tag1 Tag2" /> 

相反,该值必须为元素的含量被传递修改为rev。 1196:

http://code.google.com/p/google-gdata/source/detail?r=1196

请签出最新的源代码,然后再试一次。

+0

非常感谢Claudio。我已经检出了最新的图书馆资源,编译完成,现在所有的工作都按预期工作。 – kelfish

相关问题