Sounds strange to me, the following snippet is from my code
private void printCalendarInfo(CalendarEventFeed resultFeed){
for(CalendarEventEntry entry : resultFeed.getEntries()){
System.out.println(entry.getTitle().getPlainText()
+" description: "
+entry.getTextContent().getContent().getPlainText()
+ " time ");
for(When aTime : entry.getTimes()) {
System.out.println(aTime.getStartTime().toUiString());
}
}
}
All information is entered in the Web UI, and I have no trouble retrieving
it. It does not matter whether my input on the web is pure text or HTML
formated text.
Regards,
tmg
On Sat, Sep 19, 2009 at 4:59 AM, Claire Y <[email protected]> wrote:
>
> Hi Robert,
>
> But it seems that that call won't work if the content is not a
> TextContent - that's why I get the exception. If creating and editing
> the description though the web UI doesn't create a TextContent, then
> how do you get the text? I haven't tried CalendarEventEntry objects
> yet but I'm stuck particularly on the CalendarEntry object.
>
> myCalenderEntry.getTextContent().getContent().getPlainText() looks
> legal, but produces a runtime exception "object is not a TextContent "
>
> Claire
>
> On Sep 18, 6:34 pm, Robert Owens <[email protected]> wrote:
> > Hi Claire,
> >
> > It looks like Dipper sent you the solution today at 12:40
> >
> > calendarEventEntry.getTextContent().getContent().getPlainText();
> >
> > The plainText part was what you needed, I believe, but haven't tried
> myself
> > yet.
> >
> > thanks,
> > r
> >
> > On Thu, Sep 17, 2009 at 7:17 PM, Claire Y <[email protected]> wrote:
> >
> > > Thanks Robert!
> > > But how do I get the text content of the Description field of a
> > > CalendarEntry object that I originally created manually from the
> > > Google Calendar website?
> >
> > > For example, I created a calendar named "TestCalendar" and then set
> > > the "Description" to "Test Description" on the Google Calendar
> > > website. Then, in my code, I get the CalendarEntry object of
> > > "TestCalendar". How, then, can I get the value "Test Description" out
> > > of the CalendarEntry object? When I create the calendar manually from
> > > the website I'm not sure if the Content gets saved as plaintext or XML
> > > or something else, so I'm not sure how to retrieve that data.
> >
> > > Thanks,
> > > Claire
> >
> > > On Sep 17, 9:51 pm, Robert Owens <[email protected]> wrote:
> > > > The "Description" field seen in the web UI is represented by the
> > > "content"
> > > > element. See next 2 line of code for setting regular text in the
> > > > Description:
> >
> > > > CalendarEventEntry myEvent = new CalendarEventEntry();
> > > > myEvent.setContent(new PlainTextConstruct("Some descriptive text. \n
> "));
> >
> > > > On Thu, Sep 17, 2009 at 1:42 PM, Claire Y <[email protected]> wrote:
> >
> > > > > Hi,
> >
> > > > > I went through the step-by-step instructions on getting started
> with
> > > > > the Google Calender Java API. Now that I have my CalendarEntry
> > > > > object, how do I get and set other properties of the calendar;
> > > > > particularly, the "Description" value of the calendar (and
> > > > > CalendarEvents)? I know there are get() and set() methods for
> > > > > location/timezone, etc., but not the Description. I tried:
> >
> > > > > Content myContent = myCalendar.getContent();
> >
> > > > > ... but then what do you do with the Content object after that?
> Are
> > > > > there any example or tutorials about this?
> >
> > > > > Thanks!
> > > > > Claire
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---