Ah, but for a CalendarEntry object (from a Calendar that I created
manually via the Google Calendar website), when I do
myCalenderEntry.getTextContent()
... then I get an exception:
Exception in thread "main" java.lang.IllegalStateException: Content
object is not a TextContent
at com.google.gdata.data.BaseEntry.getTextContent(BaseEntry.java:314)
So the question goes back to: if the description wasn't saved as a
text content, then what type of content was it saved as, and how can I
retrieve the text?
Claire
On Sep 18, 3:40 am, Dipper <[email protected]> wrote:
> To get the Description you could use the following:
>
> calendarEventEntry.getTextContent().getContent().getPlainText();
>
> Good luck,
> tm
>
> On Sep 18, 4:17 am, 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
-~----------~----~----~----~------~----~------~--~---