【问题标题】:Copying Google Docs documents with Java GWT使用 Java GWT 复制 Google Docs 文档
【发布时间】:2011-01-24 22:20:47
【问题描述】:

根据 Google Documents List Data API,有一个复制文档的选项: http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#CopyingDocs

但是当我查看 API 的 GWT Java 文档时,这个菜单点不见了。 http://code.google.com/apis/documents/docs/3.0/developers_guide_java.html

您知道Java GWT API 中是否有复制GDocs 文档的方法?哪个可能只是没有记录?

查看python API,我找到了python方法: http://code.google.com/apis/documents/docs/3.0/developers_guide_python.html#CopyingDocs

【问题讨论】:

    标签: java gwt google-docs-api


    【解决方案1】:

    我现在设法编写了自己的复制请求:

    t7Z3GLNuO641hOO737UH60Q替换为documents键,你喜欢复制

    String = "new File";
    String userEmail= new CurrentUser ().getUser ().getEmail ();
    
    String body = "<?xml version='1.0' encoding='UTF-8'?>"
          + "<entry xmlns=\"http://www.w3.org/2005/Atom\">"
          + "<id>t7Z3GLNuO641hOO737UH60Q</id>"
          + "<title>"+ title +"</title>"
          + "</entry>";
    
    try {
      GDataRequest gdr = docsService.createRequest(Service.GDataRequest.RequestType.INSERT,
        new URL("https://docs.google.com/feeds/default/private/full/?xoauth_requestor_id="+ userEmail),
        ContentType.ATOM);
    
      gdr.setHeader("GData-Version", "3.0");
      OutputStream requestStream = gdr.getRequestStream();
      requestStream.write(body.getBytes());
    
      log.info(gdr.toString());
      gdr.execute();    
    }
    [.. catch]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多