TableFeed tableFeed = service.getFeed(tableFeedUrl, TableFeed.class);
for(TableEntry te : tableFeed.getEntries()){
System.out.println(te.getTitle().getPlainText());
System.out.println(te.getRecordsFeedLink());
}
It seems to be parsing the tables from the feed properly since it will
enumerate all the table titles, but getRecordsFeedLink just comes back
as null.
-Ralf
On Mon, Dec 13, 2010 at 13:56, Vic Fryzel <[email protected]> wrote:
> Can you just clarify how you're creating that tableEntry object? If it's
> not pulled from the feed, it won't have the appropriate Link object used by
> that method.
>
> Thanks,
> -Vic
>
>
>
> On Mon, Dec 13, 2010 at 1:48 PM, Ralf Haring <[email protected]> wrote:
>>
>> Ok, so ultimately something like the following?
>>
>> URL feedURL = new URL(tableEntry.getRecordsFeedLink().getHref())
>> service.insert(feedUrl, record);
>>
>> Unfortunately getRecordsFeedLink() seems to be returning null for me.
>>
>> -Ralf
>>
>> On Mon, Dec 13, 2010 at 13:39, Vic Fryzel <[email protected]> wrote:
>> > Oh, right sorry. There was a period of time where we were favoring URL,
>> > but
>> > it was switched to Link.
>> > getRecordsFeedLink is what you're looking for.
>> >
>> > -Vic
>> >
>> >
>> >
>> > On Mon, Dec 13, 2010 at 1:37 PM, Ralf Haring <[email protected]>
>> > wrote:
>> >>
>> >> Are you sure? I'm not seeing getRecordFeedUrl() as a method in
>> >>
>> >>
>> >> http://code.google.com/apis/gdata/javadoc/com/google/gdata/data/spreadsheet/TableEntry.html
>> >> . It also fails to compile:
>> >>
>> >> test.java:281: cannot find symbol
>> >> symbol : method getRecordFeedUrl()
>> >> location: class com.google.gdata.data.spreadsheet.TableEntry
>> >> System.out.println(tableEntry.getRecordFeedUrl());
>> >>
>> >> I see TableEntry.getRecordsFeedLink() which doesn't seem like the same
>> >> thing.
>> >>
>> >> A search for getRecordFeedUrl in all the javadoc only brings up
>> >>
>> >>
>> >> http://code.google.com/apis/gdata/javadoc/com/google/gdata/client/spreadsheet/FeedURLFactory.html
>> >>
>> >> -Ralf
>> >>
>> >> On Mon, Dec 13, 2010 at 13:20, Vic Fryzel <[email protected]> wrote:
>> >> > Hey Ralf,
>> >> > You can just do:
>> >> > URL recordFeedUrl = tableEntry.getRecordFeedUrl();
>> >> > from an existing TableEntry.
>> >> > Thanks,
>> >> > -Vic
>> >> >
>> >> >
>> >> >
>> >> > On Mon, Dec 13, 2010 at 12:32 PM, Ralf Haring <[email protected]>
>> >> > wrote:
>> >> >>
>> >> >> Since you say I wouldn't need to parse out the table id (to pass to
>> >> >> FeedUrlFactory.getRecordFeedUrl) to get the record feed url (to pass
>> >> >> to SpreadsheetServce.insert() to update records), then how should
>> >> >> records be updated? Is there a different way to get the record feed
>> >> >> url?
>> >> >>
>> >> >> -Ralf
>> >> >>
>> >> >> On Mon, Dec 13, 2010 at 11:21, Vic Fryzel <[email protected]>
>> >> >> wrote:
>> >> >> > Hey Ralf,
>> >> >> > Yeah, this returns the full ID of the entry, which is a URL. This
>> >> >> > guarantees that a table ID won't conflict, for instance, with a
>> >> >> > record
>> >> >> > ID.
>> >> >> > In general though, you shouldn't need to parse out the numeric
>> >> >> > table
>> >> >> > ID, as
>> >> >> > any operations you need to perform will have a relevant URL to
>> >> >> > perform
>> >> >> > them
>> >> >> > with.
>> >> >> > getId() returns the entry ID of any GData Entry.
>> >> >> >
>> >> >> > Thanks,
>> >> >> > -Vic
>> >> >> >
>> >> >> > On Mon, Dec 13, 2010 at 5:00 AM, Ralf Haring
>> >> >> > <[email protected]>
>> >> >> > wrote:
>> >> >> >>
>> >> >> >> In trying to use FeedUrlFactory's
>> >> >> >> getRecordFeedUrl(java.lang.String
>> >> >> >> spreadsheetKey, java.lang.String tableId) method, I tried getting
>> >> >> >> the
>> >> >> >> table
>> >> >> >> id from TableEntry's getId() method. However this returns the
>> >> >> >> results
>> >> >> >> in the
>> >> >> >> format
>> >> >> >>
>> >> >> >>
>> >> >> >> "https://spreadsheets.google.com/feeds/spreadsheet_key_here/tables/0"
>> >> >> >> when what I would have expected is "0". Am I wrong to expect
>> >> >> >> getId()
>> >> >> >> to
>> >> >> >> return just the id?
>> >> >> >>
>> >> >> >> -Ralf
>> >> >
>> >> >
>> >
>> >
>
>