Hi,

I am using the Java GData API and I am trying to list the events for a
given calendar. Below is the code that I have. Basically I loop
through the available calendars and then try listing the events for
the given calendar, but this does not work. What attribute can I get
from the calendar entry to be able to use for listing the events
specific to it?

Andre

CalendarFeed resultFeed = service.getFeed(getOwnCalendarsFeedUrl (),
CalendarFeed.class);
for ( CalendarEntry entry : resultFeed.getEntries() ) {
   listEventsForCalendar ( entry );
}

void listEventsForCalendar  ( CalendarEntry calendar ) {
   CalendarEventFeed resultFeed = service.getFeed(calendar.getId(),
                CalendarEventFeed.class);

    for (int i = 0; i < resultFeed.getEntries().size(); i++) {
      CalendarEventEntry entry = resultFeed.getEntries().get(i);
      System.out.println("\t" + entry.getTitle().getPlainText());
    }
    System.out.println();
}

private URL getOwnCalendarsFeedUrl ( ) {
        String encodedUserName = null;
        try {
                encodedUserName = URLEncoder.encode(username,"UTF-8");
                return new URL( METAFEED_URL_BASE + encodedUserName +
OWNCALENDARS_FEED_URL_SUFFIX );
        } catch (Exception e) {
                e.printStackTrace();
        }
        return null;
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to