2012-04-09 104 views
0

我是Google API的新手,並試圖根據此處描述的Google Calendar API示例創建應用程序:http://samples.google-api-java-client.googlecode.com/hg/calendar-appengine-sample/instructions.html如何訪問Google日曆API方法

這是有效的,但我遇到了困難,因爲我無法訪問https://developers.google.com/google-apps/calendar/v3/reference/中描述的所有API方法,比如get,patch,list等。

有在示例應用程序的源代碼中實現的一些方法:/year-planner/src/main/java/com/google/api/services/samples/calendar/appengine/server/CalendarGwtRpcSample.java:

void delete(GwtCalendar calendar) throws IOException; 
GwtCalendar insert(GwtCalendar calendar) throws IOException; 
GwtCalendar get(GwtCalendar calendar) throws IOException; 
GwtCalendar update(GwtCalendar updated) throws IOException; 

但是隻執行刪除,插入和更新方法。我預計這些將直接從客戶端庫中提供。

我錯過了什麼嗎?還是我需要自己創建所有這些方法?

我已經遵循了示例應用程序的教程,在Windows(Vista)上使用Eclipse,使用源代碼和來自Maven存儲庫的客戶端庫。

感謝

回答

0

你需要編寫包裝的所有服務調用你想要的 - 原因是你不能使用Ajax來調出Web服務上(在這種情況下,谷歌日曆API)與託管GWT應用程序的服務器不同。

因此,在這個示例中,您的GWT應用程序會向您的服務器發出AJAX調用,然後調用Google Calendar服務並將結果包裝回GWT客戶端。