3

有没有一种简单的方法可以将 Google Drive 文件的共享/权限弹出对话框集成到 GWT+GAE (Java) 应用程序中?

4

2 回答 2

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/客户端/PlusEntryPoint.java

于 2013-04-23T11:15:19.763 回答
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 Native 函数JSNI

public static native void alert(String msg) /*-{
  $wnd.alert(msg);
}-*/;
于 2013-10-04T16:34:22.977 回答