the problem is the CalendarService import check if it is the right one and also your gdata library version
On 5 ago, 06:06, ichi <ichi8...@gmail.com> wrote: > Hai, I'm a newbie trying this piece of code to show the total schedule > we have from Google Calendar, I've already import several package and > put the necessary jar files in Reference Library, But I still have > several things error. Could you tell me what I miss? I put the error > message in the line directly. > Thank you > > -- > package calendarTest.client; > > import java.lang.Class; > import com.google.gwt.accounts.client.User; > import com.google.gwt.core.client.EntryPoint; > import com.google.gwt.core.client.GWT; > import com.google.gwt.event.dom.client.ClickEvent; > import com.google.gwt.event.dom.client.ClickHandler; > import com.google.gwt.event.dom.client.KeyCodes; > import com.google.gwt.event.dom.client.KeyUpEvent; > import com.google.gwt.event.dom.client.KeyUpHandler; > import com.google.gwt.gdata.client.GData; > import com.google.gwt.gdata.client.GDataSystemPackage; > import com.google.gwt.gdata.client.calendar.CalendarEventFeedCallback; > import com.google.gwt.gdata.client.impl.CallErrorException; > import com.google.gwt.user.client.Window; > import com.google.gwt.user.client.rpc.AsyncCallback; > import com.google.gwt.user.client.ui.Button; > import com.google.gwt.user.client.ui.DialogBox; > import com.google.gwt.user.client.ui.HTML; > import com.google.gwt.user.client.ui.Label; > import com.google.gwt.user.client.ui.RootPanel; > import com.google.gwt.user.client.ui.TextBox; > import com.google.gwt.user.client.ui.VerticalPanel; > import com.google.gdata.client.*; > import com.google.gdata.client.calendar.CalendarService; > import com.google.gdata.data.acl.*; > import com.google.gdata.data.calendar.*; > import com.google.gdata.data.extensions.*; > import com.google.gdata.util.*; > import java.net.URL; > import java.net.*; > import java.io.*; > > /** > * Entry point classes define <code>onModuleLoad()</code>. > */ > public class CalendarTest { > > private CalendarService service; > > String scope = "http://www.google.com/calendar/feeds/"; > String eventFeed = "http://www.google.com/calendar/feeds/default/ > private/full"; > > public void onModuleLoad(){ > > //make sure GWT app has the necessary packet > if(!GData.isLoaded(GDataSystemPackage.CALENDAR)){ > GData.loadGDataApi(null, new Runnable(){ > public void run(){ > Button b = new Button("Affiche mes > rendez-vous"); > b.addClickHandler(new ClickHandler() { > @Override > public void > onClick(ClickEvent event) { > User.login(scope); > getEvents(); > } > }); > RootPanel.get().add(b); > } > }, GDataSystemPackage.CALENDAR); > } else { > getEvents(); > } > } > private void getEvents() { > service = CalendarService.newInstance("My Demo"); //-->The > method > newInstance(String) is undefined for the type CalendarService > > service.getEventsFeed(eventFeed, new CalendarEventFeedCallback() { > //--> getEventsFeed(String, new CalendarEventFeedCallback(){}) is > undefined for the type CalendarService > > public void onFailure(CallErrorException caught) { > Window.alert("Erreur survenue lors de la lecture du > flux: " > +caught.getMessage()); > } > > public void > onSuccess(com.google.gwt.gdata.client.calendar.CalendarEventFeed > result) { > CalendarEventEntry[] entries = result.getEntries(); > //-->Type > mismatch: cannot convert from EventEntry[] to CalendarEventEntry[] > > if (entries.length == 0) { > Window.alert("Il n'y a aucun événement dans votre > calendrier."); > } else { > showData(result.getEntries()); > } > } > > }); > } > > private void showData(CalendarEventEntry[] entries) { //-->The method > showData(CalendarEventEntry[]) in the type CalendarTest is not > applicable for the arguments (EventEntry[]) > for (int i=0; i < entries.length; i++) { > CalendarEventEntry entry = entries[i]; > String s = "Le " + > entry.getUpdated().getValue().getDate().toString() ; // --> Cannot > invoke getDate() on the primitive type long CalendarTest.java > > s += "<a href=" + entry.getHtmlLink().getHref() + > ">Rendez-vous "; > s += entry.getTitle().getText() + "</a>"; //-->The > method getText() > is undefined for the type TextConstruct CalendarTest.java > > RootPanel.get().add(new HTML(s)); > } > }} > > -- -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.