On Sun, Jan 4, 2009 at 10:31 PM, [email protected]
<[email protected]> wrote:
>
> hi
>  please help me...
>  while fetching the calenadar events, i had to get the values of title
> and content of event. I have no problem with getting the value of
> title but for content i am getting ClassCastException
>
> "Exception in thread "main" java.lang.ClassCastException:
> com.google.gdata.data.OutOfLineContent cannot be cast to
> com.google.gdata.data.TextContent"
>
> Please help. what should i do?
> MY code :
>
>
> myEntry.setTitle(new PlainTextConstruct(" My Title "));
> myEntry.setContent(new PlainTextConstruct(" My Content"));
>
> EventEntry insertedEntry = myService.insert(postUrl, myEntry);
> System.out.println(entry.getTitle().getPlainText());
> System.out.println(((TextContent)entry.getContent()).getContent
> ().getPlainText());

Jayant,
An OutOfLineContent object indicates that the content element contains
a hyperlink, rather than the content itself. You'd need to extract the
hyperlink (by calling entry.getContent().getUri()) and make a seperate
request to retrieve the content.

However, it's a little odd that you'd receive this. Can you provide a
sample program that demonstrates this behavior and an HTTP transcript
(http://code.google.com/apis/gdata/articles/debugging_client_libs.html#java)?

-- 
Trevor Johns

--~--~---------~--~----~------------~-------~--~----~
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