Project

General

Profile

Google Docs integration plugin

Added by Tavish Armstrong about 13 years ago

I blogged about my Google Docs integration plugin here: Introducing the Redmine Google Docs Plugin

Please let me know if you have suggestions, complaints, or whatever else.

GitHub repository


Replies (5)

RE: Google Docs integration plugin - Added by Ivan Cenov about 13 years ago

Hi,

Nice and useful plugin.
I tested googledoc macro to edit a document but a empty readonly edit control appeared only.
Then I took a look at plugin's code at https://github.com/tarmstrong/redmine_google_docs/blob/master/lib/google_docs_macros.rb. There is two lines that 'evolvingweb.ca' is referred. I suppose this has been left there by error.

class GoogleDocumentMacros
  def self.get_doc(obj, args)
    doc_key = args[0]
    if args.length == 2
      edit = (args[1].strip == "edit")
    else
      edit = false
    end
    if /^\w+$/.match(doc_key)
      if edit
        url = "https://docs.google.com/a/evolvingweb.ca/document/edit?id=#{doc_key}" 
      else
        url = "https://docs.google.com/a/evolvingweb.ca/document/pub?id=#{doc_key}" 
      end
      out = "<iframe src='#{url}' width='800' height='400'></iframe>" 
    else
      raise "The Google document key must be alphanumeric." 
    end
  end
end
Ivan

RE: Google Docs integration plugin - Added by Ivan Cenov about 13 years ago

Hi again,

It seems Google allows '-' (dash) in document names. Par example, I created such an example document with this key 1vT23KRhqtbfSoxs8fuQtqjLz-XrKyFXQbB0jVjFlHHg. The plugin rejects it saying Error executing the googledoc macro (The Google document key must be alphanumeric.)

Ivan

RE: Google Docs integration plugin - Added by Ivan Cenov about 13 years ago

Ivan Cenov wrote:

It seems Google allows '-' (dash) in document names.

should be "... in document keys."

RE: Google Docs integration plugin - Added by Ivan Cenov about 13 years ago

I changed line 120:

if /^\w+$/.match(doc_key)
to
if /^[\w-]+$/.match(doc_key)
and now it accepts documents with - in their keys.

RE: Google Docs integration plugin - Added by Tavish Armstrong about 13 years ago

Thanks for your interest and the fixes! These are both pushed now.

    (1-5/5)