A bit more exploration suggests this does the job, but I am not sure
if it is the accepted method:
URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/
owncalendars/full");
CalendarFeed resultFeed = service.getFeed(feedUrl,
CalendarFeed.class);
for ( CalendarEntry entry : resultFeed.getEntries() ) {
String altUrl = null;
for ( Link link : entry.getLinks() ) {
if ( link.getRel().equals("alternate") ) {
altUrl = link.getHref();
}
}
CalendarEventFeed calEventFeed = service.getFeed( new URL
( altUrl ) , CalendarEventFeed.class);
for (int i = 0; i < calEventFeed.getEntries().size(); i++) {
CalendarEventEntry calEventEntry =
calEventFeed.getEntries().get(i);
System.out.println( "eventt: " +
calEventEntry.getTitle().getPlainText() );
}
}
Andre
On Feb 13, 5:32 pm, Andre-John Mas <[EMAIL PROTECTED]> wrote:
> Thanks, but the issue is that I am wanting to iterate through each
> calendar that belongs to me (as opposed to subscribed to) and then the
> even for a given calendar. For example:
>
> Calendars cals = getAllMyCalendars();
> for ( Calendar cal : cals ) {
> displayEventsFor ( cal );
> }
>
> I am currently missing the step between listing my own calendars (the
> web page allows me to create several) and then for each individual
> calendar list only the events that correspond to it.
>
> Andre
>
> On Feb 7, 7:52 pm, "Austin (Google)" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > The following function iterates through your default calendar and
> > prints out all the essential properties of each event -
>
> > public void getAllEvent() throws Exception {
> > // Set up the URL and the object that will handle the
> > connection:
> > URL feedUrl = new
> > URL("http://www.google.com/calendar/feeds/default/
> > private/full");
>
> > // Send the request and receive the response:
> > CalendarEventFeed resultFeed = myService.getFeed(feedUrl,
> > CalendarEventFeed.class);
>
> > System.out.println("Totle results: " +
> > resultFeed.getTotalResults());
>
> > for (int i = 0; i < resultFeed.getEntries().size(); i++) {
> > CalendarEventEntry entry = resultFeed.getEntries().get(i);
>
> > String title = entry.getTitle().getPlainText();
> > System.out.println("Title: " + title);
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Data API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---