簡體   English   中英

GWT應用程序中的Google Drive文件共享彈出窗口

[英]Google Drive file sharing popup in GWT application

有沒有一種簡單的方法將Google Drive文件的共享/權限彈出對話框集成到GWT + GAE(Java)應用程序中?

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/客戶機/ PlusEntryPoint.java

是的你可以在這里做到:

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 Native函數JSNI

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM