As I was fooling around with the spreadsheet entries, I found that
getDocumentLink()/getSpreadsheetLink() and getHtmlLink()  have errors.
While I was at the issues section, I found Issue 143:

http://code.google.com/p/gdata-java-client/issues/detail?id=143

Thanks for listening...

On Jul 13, 5:52 pm, Daniel <lt.ch...@gmail.com> wrote:
> I'm having trouble following the "create a table" example given in the
> JAVA "working with table feeds" section.
>
> I get a "Not Found" message when trying to create a table.
>
> In the example, I'm assuming "spreadsheetEntry" is actually a
> FeedURLFactory, and tablesFeedUrl at the end is actually tableFeedUrl.
>
> The POST code does follow the "http://spreadsheets.google.com/feeds/
> key/tables" format.
>
> Here's my code:
>
> DocsService client = new DocsService("Test Documents");
> client.setUserCredentials(mail, password);
>
> URL feedUrl = new URL("http://docs.google.com/feeds/documents/private/
> full/");
>
> DocumentListFeed resultFeed = client.getFeed(feedUrl,
> DocumentListFeed.class);
> DocumentListEntry newEntry = new Spreadsheet.Entry();
> newEntry.setTitle(new PlainTextConstruct("TestSpreadsheetTable"));
> client.insert(feedUrl, newEntry);
>
> SpreadsheetService service = new SpreadsheetService("Test
> Spreadsheet");
> service.setUserCredentials(mail, password);
>
> TableEntry tableEntry = new TableEntry();
> FeedURLFactory factory = FeedURLFactory.getDefault();
>
> URL tableFeedUrl = factory.getTableFeedUrl(newEntry.getKey());
>
> // Specify a basic table:
> tableEntry.setTitle(new PlainTextConstruct("New Table"));
> tableEntry.setWorksheet(new Worksheet("Sheet1"));
> tableEntry.setHeader(new Header(1));
>
> // Specify columns in the table, start row, number of rows.
> Data tableData = new Data();
> tableData.setNumberOfRows(0);
> // Start row index cannot overlap with header row.
> tableData.setStartIndex(2);
> // This table has only one column.
> tableData.addColumn(new Column("A", "Column A"));
>
> tableEntry.setData(tableData);
> service.insert(tableFeedUrl, tableEntry);
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to