The issue with the code below is that you're extending the extension profile after the Service.query() method returns, but the XML parsing has already taken place (inside query()). This is why I suggested you create a CalendarEventFeed instance yourself and use it to declareExtensions() on the service extension profile, before the query() call.
I also notice that you are using the com.google.gdata.data.extensions.EventFeed class instead of the com.google.gdata.data.calendar.CalendarEventFeed class in the query call below. The latter is a subclass of the base EventFeed class that defines some extensions that are specific to the Google Calendar data API. The ExtendedProperty extension happens to be one of those additional extensions, so the next effect of calling EventFeed.declareExtensions() *won't* add ExtendedProperty to the profile, whereas doing it with CalendarEventFeed.declareExtensions() will.
FWIW, I'm working on some auto-extension features that will enable extension profiles to be automatically extended based upon the GData content found in the stream, which will make all this config effort transparent and seamless once released.
Hope this helps!
-- Kyle
On 10/24/06, Jake <[EMAIL PROTECTED]> wrote:
Right, I have a method that creates 'EventEntry's and sends them to the
calendar. The following code is what I've added to that method.
ExtendedProperty priorityField = new ExtendedProperty();
priorityField.setName("Priority");
priorityField.setValue(priority);
myEntry.addExtension(priorityField);
Then I have another method that queries the calendar and returns
'EventEntry's.
EventFeed resultFeed = myService.query(myQuery, EventFeed.class);
Then another method accesses those objects. I use the following code to
access the extension.
ExtendedProperty prop =
matchEntry.getExtension (ExtendedProperty.class);
System.out.println(prop.getValue());
So what you're saying is I need to let the Feed know that there are new
extensions and allow it create the relevant XML data to allow me to
communicate with it? So the code you provided will do that? But it
won't create the new ExtensionProfile will it?
I had to change your code to get it to compile:
resultFeed.declareExtensions(myService.getExtensionProfile ());
Any closer?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
- Re: ExtendedProperty in Java Kyle Marvin
- Re: ExtendedProperty in Java Jake
- Re: ExtendedProperty in Java Jake
- Re: ExtendedProperty in Java Kyle Marvin
