The statement myEntry.getAuthors().add(author); also appears in an example on the web page http://code.google.com/apis/calendar/developers_guide_java.html#CreatingSingle On that page it says: > You add an author to an entry by calling the entry's getAuthors().add method. It would help to change this page.
I did some other homework on this topic as I was puzzled as to why there's a getAuthors method returning a List rather than a getAuthor method returning a Person. The table giving Event kind properties on the page http://code.google.com/apis/gdata/elements.html#gdEventKind seems to imply that each calendar event only has one author. So why is getAuthors is declared as: public java.util.List<Person> getAuthors() getAuthors is a method of the class BaseEntry which is one of CalendarEventEntry's superclasses. BaseEntry is defined at http://code.google.com/apis/gdata/javadoc/com/google/gdata/data/BaseEntry.html. That page gives a Relax NG schema that says an entry can have multiple authors. So maybe some of the other subclasses of BaseEntry need multiple authors. I had a quick look at some of the other subclasses (such as the one for Spreadsheets) thinking they may have a way of setting multiple authors but I didn't find anything. I'm new to the Calendar API but it looks like a CalendarEntry could be created by using parseAtom and, if the Atom feed contains many author elements, then by this route a CalendarEntry would contain many authors. If this is the case, it explains why the getAuthors method must be able to handle more than one author. However, there is no explicit way in the Calendar API of setting the authors or adding other authors. On May 20, 6:53 pm, Barry Cornelius <[EMAIL PROTECTED]> wrote: > Jacky's original question was: > > > The code below seems not to have any effect. When I tried to add an > > event in a user's calendar, I can not specify the event author by this > > code. After adding successfully, the author in the result entry is > > always the calendar's creator but not Jacky.Seraph Mun. > > Person author = new Person("Jacky.Seraph Mun", null, > > "[EMAIL PROTECTED]"); > > myEntry.getAuthors().add(author); > > What can I do for that? > > I searched Google and got to this forum because I was using the same > code to add an author. I was using this code because this is the code > that is in the createEvent method that is in the file .../gdata/java/ > sample/calendar/CalendarClient.java that you can obtain > fromhttp://code.google.com/apis/gdata/download/gdata.java.zip > > So when someone in Google has time they might like to remove this line > because it doesn't do anything useful. > > On Apr 10, 8:08 pm, "Lane LiaBraaten" <[EMAIL PROTECTED]> wrote: > > > Hi Jacky, > > > When creating events, the Calendar API will automatically set the author to > > be the user that is currently authenticated. While the code you wrote is > > syntactically correct, setting the author in the entry before inserting it > > won't have any effect. > > > If you want to store some extra information, you could store it as an > > extended property of the event. See the developer's guide for more > > information on this > > (http://code.google.com/apis/calendar/developers_guide_java.html#Exten... > > ). > > > Cheers, > > Lane > > > On 4/10/07, Jacky.Seraph Mun <[EMAIL PROTECTED]> wrote: > > > > Dear sir, > > > > May I have a question for you? I got a problem below when I tried to > > > develop programs via google calendar API. Having browsed the forum of > > > Google > > > Data API, I didn't find the exactly answer. So I tried to post a thread on > > > that forum. But my thread always disappeared the moment I sent it. So I > > > can't leave my question there. > > > > Could you help me about this or tell me the reason and what to do for that > > > ? > > > > Thanks, > > > > Jacky > > > > ---------- Forwarded message ---------- > > > From: Jacky.S <[EMAIL PROTECTED]> > > > Date: 2007/4/10 下午 5:29 > > > Subject: Setting author has no effect? > > > To: Google Calendar Data API < > > > [email protected]> > > > > Hello, > > > > The code below seems not to have any effect. When I tried to add an > > > event in a user's calendar, I can not specify the event author by this > > > code. After adding successfully, the author in the result entry is > > > always the calendar's creator but not Jacky.Seraph Mun. > > > > Person author = new Person("Jacky.Seraph Mun", null, > > > "[EMAIL PROTECTED]"); > > > myEntry.getAuthors().add(author); > > > > What can I do for that? > > > > Thanks. > > > > Jacky --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
