Hi,

If you make a request to the metafeed url
(http://www.google.com/calendar/feeds/default), the allcalendars url
(http://www.google.com/calendar/feeds/default/allcalendars/full) or
the owncalendars url
(http://www.google.com/calendar/feeds/default/owncalendars/full)
Google will send you a feed of your calendars. This will include your
primary calendar, any secondary calendars that you have and  for the
metafeed and the allcalendars feed, the calendars that you have
subscribed to. These feed contain only the title, links and other
information about those calendars. They do not include the events that
are on those calendars.

The url that you are using in the above code
(http://www.google.com/calendar/feeds/
[EMAIL PROTECTED]/private/full) and calling the feedUrl is the url for
only a single calendar. Your code is fetching your primary calendar,
and printing the title of your primary calendar. If you want to print
the title of each event you should modify your code to iterate over
the individual events of the feed. Instead of this:

CalendarEventFeed myResultsFeed = myService.query(myQuery,
CalendarEventFeed.class);
System.out.println("\t"+myResultsFeed.getTitle().getPlainText());

You should do something like:

CalendarEventFeed myResultsFeed = myService.query(myQuery,
CalendarEventFeed.class);
for (int i = 0; i < myResultsFeed.getEntries().size(); i++) {
    CalendarEventEntry entry = myResultsFeed.getEntries().get(i);
    System.out.println("\t" + entry.getTitle().getPlainText());
}

The Google documentation and examples seem to have been improved
recently. Have a look inside the sample code that you can find on this
page (http://code.google.com/p/gdata-java-client/downloads/list) for
more details.


Ray



On Thu, Nov 27, 2008 at 3:25 AM, Lindberg.he <[EMAIL PROTECTED]> wrote:
>
> Thank you.I got it.If I modify the two places:
>  CalendarEventFeed resultFeed = myService.getFeed
> (feedUrl,CalendarEventFeed.class);
> CalendarEventEntry entry = resultFeed.getEntries().get(i);
> which means change CalendarFeed, CalendarEntry to
> CalendarEventFeed,CalendarEventEntry, it give the same
> result.Therefore,I'm wondering the CalendarFeed and CalendarEventFeed
> are the same thing all the time or just in this kind of Url condition
> coincidently their content are the same and actually they are used to
> represent the different datas.
>
> and another question come from the code below,
> CalendarService myService = new CalendarService("exampleCo-
> exampleApp-1.0");
> myService.setUserCredentials("[EMAIL PROTECTED]", "password");
> URL feedUrl = new URL("http://www.google.com/calendar/feeds/
> [EMAIL PROTECTED]/private/full");
> Query myQuery = new Query(feedUrl);
> myQuery.setFullTextQuery("abcd");
> CalendarEventFeed myResultsFeed = myService.query(myQuery,
> CalendarEventFeed.class);
> System.out.println("\t"+myResultsFeed.getTitle().getPlainText());
> }
>
> the question is: "abcd" both inserted in primay and secondery calendar
> but the runing result only show the title of primay calendar.
>
> On Nov 27, 12:16 am, "Ray Baxter" <[EMAIL PROTECTED]> wrote:
>> The url that you are requesting, http:// ...
>> calendar/feeds/[EMAIL 
>> PROTECTED]/private-33aeaade030a62b5594861bc611389e8/basic
>> is the url that returns the list of events that pertain to a
>> particular calendar (calender ID =
>> [EMAIL PROTECTED]). Since calendars
>> and calendar events both have titles, you get the output that  you do.
>>
>> If you replace that link with either the metafeed link, allcalendar
>> feed link or the owncalendars feed link you will retrieve a feed that
>> contains your calendars. You can read about those links here:
>>
>> http://code.google.com/apis/calendar/docs/2.0/reference.html#Calendar...
>>
>> Ray
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar 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-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to