Hi there,

Execute me for asking these questions again but making them shorter:

1. Why a participant of a calendar event can add a comment by UI but
not API?
2. Similarly, why a participant of a calendar event can invite a guset
by UI but not API?

I was confused about these for a long time, who can answer me by some
examples workable?

Thank you very much!

Best wishes,
paul

On 4月2日, 上午12時41分, "r&d" <[EMAIL PROTECTED]> wrote:
> Hi Austin (or any other Google Consultants ^^),
>
> Recently we'd like to use calendar to do some apps. However, following
> your steps, we found some more questions:
>
>       //
> ===========================================================================-===============
>       URL u = new URL("http://www.google.com/calendar/feeds/default/
> private/full/vinopclakkco4q55ivuip28220");
>       URL um = new URL("http://www.google.com/calendar/feeds/default/
> private/full/vinopclakkco4q55ivuip28220/comments");
>       CalendarEventEntry ee = myService.getEntry(u,
> CalendarEventEntry.class); // successfully get the event entry
>
>      MessageFeed messageFeed = myService.getFeed(um,
> MessageFeed.class);
>      Iterator messageIter = messageFeed.getEntries().iterator();
>      while (messageIter.hasNext())
>      {
>         MessageEntry message = (MessageEntry) messageIter.next();
>         String content = ((TextContent)
> message.getContent()).getContent().getPlainText();
>         System.out.println(content);
>         //======== the results for above "getContent" and the below
> "getAuthors" are all OK, thx. ===================
>         Iterator personIter = message.getAuthors().iterator();
>         while(personIter.hasNext()) {
>                 Person o = (Person) personIter.next();
>                 String str = o.getEmail()+","+o.getUri()+","+o.getName();
>                 System.out.println(str);
>         }
>      }
>      //====== want to add a new comment,
> but ...===================================================
>      //
>      HtmlTextConstruct htc = new HtmlTextConstruct("Successful add!");
>      MessageEntry message = new MessageEntry();
>
> message.setContent(htc);                                        
> //------------------------------> content for new comment message
>
>      Person o = new Person("", null, "[EMAIL PROTECTED]");
>
> message.setExtension(o);                                        
> //------------------------------> author for new comment message
>
>      URL uc = new
> URL(ee.getExtension(Comments.class).getFeedLink().getHref()); // same
> as URL um as above
>
>      // we want to add a new message prepared like above and execute
> the following insert, ...
>      myService.insert(uc, message);
>
>      // but two kinds of error messages appear:
>      // first, if we do not  state: "message.setExtension(o);" the
> error messages are
>
>      That's all right! => the exist message content
>      [EMAIL PROTECTED],null,I-Horng Jeng => the exist message author
>      The server had a problem handling your request.
>      com.google.gdata.util.InvalidEntryException: Bad Request
>      No authors for comment
>
>         at
> com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(Unknown
> Source)
>         at
> com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(Unknown
> Source)
>         at
> com.google.gdata.client.http.HttpGDataRequest.checkResponse(Unknown
> Source)
>         at com.google.gdata.client.http.HttpGDataRequest.execute(Unknown
> Source)
>         at com.google.gdata.client.http.GoogleGDataRequest.execute(Unknown
> Source)
>         at com.google.gdata.client.Service.insert(Unknown Source)
>         at com.google.gdata.client.GoogleService.insert(Unknown Source)
>         at EventFeedDemo.main(EventFeedDemo.java:520)
>
>       // so, we state: "message.setExtension(o);" then the error
> messages become
>
>      That's all right! => the exist message content
>      [EMAIL PROTECTED],null,I-Horng Jeng => the exist message author
>      java.lang.IllegalStateException: No @ExtensionDescription.Default
> annotation found on subclass Person
>         at com.google.gdata.data.AbstractExtension.generate(Unknown Source)
>         at com.google.gdata.data.ExtensionPoint.generateExtensions(Unknown
> Source)
>         at com.google.gdata.data.BaseEntry.generateAtom(Unknown Source)
>         at com.google.gdata.client.Service.insert(Unknown Source)
>         at com.google.gdata.client.GoogleService.insert(Unknown Source)
>         at EventFeedDemo.main(EventFeedDemo.java:520)
>
> Could you do me a favor to answer this? Thanks a lot!
>
> paul
>
> On 2月27日, 上午6時14分, "Austin (Google)" <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi Brian,
>
> > Good question!  comments is actually a whole different feed with it's own
> > feed URI.  The comment feed for a given event is basically the event ID (a
> > valid feed URL) with '/comments' appended to the end.  So from this feed
> > URI, you would retrieve it like you would any feed (the feed is a
> > MessageFeed) and you would iterate through its entries (MessageEntry) to get
> > to the message content.  This is a code snippet that demonstrates what I
> > just said -
>
> >     public void getComments() throws Exception {
>
> >        URL feedUrl = new 
> > URL("http://www.google.com/calendar/feeds/default/private/full";);
>
> >         CalendarEventFeed resultFeed = myService.getFeed(feedUrl,
> > CalendarEventFeed.class);
>
> >        Iterator resultIter = resultFeed.getEntries().iterator();
>
> >         while (resultIter.hasNext())
> >        {
> >           CalendarEventEntry entry = (CalendarEventEntry) resultIter.next();
> >           String title = entry.getTitle().getPlainText();
> >           String id = entry.getId();
>
> >           System.out.println(id);
>
> >           URL messageFeedUrl = new URL(id + "/comments");
>
> >            MessageFeed messageFeed = myService.getFeed(messageFeedUrl,
> > MessageFeed.class);
>
> >            Iterator messageIter = messageFeed.getEntries().iterator();
>
> >            while (messageIter.hasNext())
> >            {
> >               MessageEntry message = (MessageEntry) messageIter.next();
>
> >               String content = ((TextContent) message.getContent
> > ()).getContent().getPlainText();
>
> >               System.out.println(content);
> >            }
> >         }
> >     }
>
> > Hope it helps,
> > Austin
>
> > On Sun, Feb 24, 2008 at 3:35 PM, Brian <[EMAIL PROTECTED]> wrote:
>
> > > Hello all,
>
> > > New to the group and the whole calendar api thingie.
>
> > > My scenario:
>
> > > I have a private calendar with a recurring event which I add comments
> > > to as it occurs (a phone call I make and I add the conversation that
> > > took place).
> > > I am using java with eclipse ide.
>
> > > I want to iterate through my calendar and get my comments.
>
> > > My issue (aka ignorance):
> > > I can get lots of data from my calendar (title, author, description,
> > > times, etc). But I can NOT figure out how to at least get the <gd:
> > > feedlink> data.
>
> > > I think I am close with:
> > > ----------------------------------------
> > > CalendarService myService = new CalendarService("exampleCo-
> > > exampleApp-1.0");
> > > myService.setUserCredentials("login", "pass");
> > > URL feedUrl = new URL("http://www.google.com/calendar/feeds/
> > > [EMAIL PROTECTED]/private/full");
> > > CalendarEventFeed resultFeed = myService.getFeed(feedUrl,
> > > CalendarEventFeed.class);
>
> > >  for (int i = 0; i < resultFeed.getEntries().size(); i++) {
> > >         CalendarEventEntry entry = resultFeed.getEntries().get(i);
>
> > >         Iterator<Comments> iterComments;
> > >          List<Comments> commentfeeds = entry.XXXXXXXXXXXXXX;   <<<<<<
> > > This is what I am not sure about
> > >          iterComments = commentfeeds.iterator();
> > >          while (iterComments.hasNext()) {
> > >                  Comments comments = iterComments.next();
> > >                  System.out.println("Start time: " +
> > > comments.getFeedLink());
> > >          }
> > > }
> > > ----------------------------------------
>
> > > Is there a function, property or what that will load my commentfeeds
> > > List with urls?
>
> > > I guess alternatively, I could use a composite feed, but I have NO
> > > idea how to start reading an atom entry either.
>
> > > Sorry for such a basic question. I can't find anything on getting
> > > event comments or feedlinks when I search around.
>
> > > Thanks in advance,
>
> > > Brian- 隱藏被引用文字 -
>
> > - 顯示被引用文字 -- 隱藏被引用文字 -
>
> - 顯示被引用文字 -
--~--~---------~--~----~------------~-------~--~----~
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