2013-04-23 99 views

回答

1

Google API的GWT客戶端支持授權和身份驗證。我建議你看看它。他們沒有Drive示例,但它與他們爲其他API執行的流程類似。看看在G +樣品:https://code.google.com/p/gwt-google-apis/source/browse/trunk/apis/samples/plus/com/google/api/gwt/samples/plus/client/PlusEntryPoint.java

+0

感謝您的回覆,但我不確定您提供的鏈接是否與分享有關(我.e。,允許訪問)其他用戶的文件。這更多關於認證,這是我已經考慮到使用適當的OAuth 2.0實現爲我的應用程序。如果我錯了,請糾正我。謝謝。 – user1423102 2013-04-24 06:33:48

+0

對不起,您正在爲Drive購買本地GWT「共享」窗口小部件。我不認爲有一個。 – 2013-04-24 07:07:55

0

是的,你可以在這裏做到這一點:

https://google-developers.appspot.com/drive/manage-sharing#launching_the_google_drive_sharing_dialog_in_your_app

<script type="text/javascript"> 
    init = function() { 
     s = new gapi.drive.share.ShareClient('<YOUR_APP_ID>'); 
     s.setItemIds(["<FILE_ID>"]); 
    } 
    window.onload = function() { 
     gapi.load('drive-share', init); 
    } 
</script> 

<button onclick="s.showSettingsDialog()">Share</button> 

然而,因爲它似乎只在Javascript中可用,你將不得不使用GWT原住民功能JSNI

public static native void alert(String msg) /*-{ 
    $wnd.alert(msg); 
}-*/; 
相關問題