This project allows you to access all your Google Drive resources such as documents, images from within Elgg and share them with others. The current user interface is basic but fully functional. This is just the beginning because there is so much more possible using the Google Drive libraries. The user interface allows you to configure a specific folder of your Google Drive and explore its contents. To increase speed i have used AJAX technology and caching.
I contribute this code in the hope that others get inspired and help to further develop this great plugin. If you like the plugin please recommend so that others also know you value this.
Based on:
TODO
Comments
Thanks.
I've been just wishing for a GDrive integration : )
This can certainly decrease hosting burden ! I hope other developers join and make this the perfect plugin : )
I use this plugin for a church intranet. We can now setup a seperate directory for each working group of volunteers and people can start sharing documents within the context of the Elgg environment. Next steps are to extend the standard Elgg search functionality to include search within Google Drive for documents.
fantastic! any similar interaction with Dropbox is available somewhere?
hmmm... this sounds so familiarrr.. just cannot remember where, who, when.. ;-\ i maybe shud flip thru my emails.. gotta be in there somewhere!;-X
BIIIIIGGGGG "Thank you".
I needed this
Hi guys,
I can't believe I'm asking that, but where can I create my API keys ?
thanks in advance
@tauvic you can store the user authentication keys in the user plugin settings. http://reference.elgg.org/1.8/engine_2lib_2plugins_8php.html#a722d916f06791ea05196d6c5464b4427
Thank you, Jeroen Dalsem.
@odutel,
Here: https://developers.google.com/drive/quickstart-php
Thanx @thouseef19 for the tip on user plugin settings, i will look into it.
Also good info about how to create that API key. I will include it in the documentation.
@Tauvic: You got the wrong person "thanx" for the plugin tip. Jeroen Dalsem gave you the tip : ) Thank him ; )
& thank you again for the amazing plugin: )
Hi Tauvic,
great idea, thank you for sharing!
I'm trying it but get the following error after putting all of the details in the plugin settings and clicking on login in the widget and putting my google details in:
Error:redirect_uri_mismatch
The redirect URI in the request: http://MYSITE/oauth2callback did not match a registered redirect URI
Where am I wrong? Other than activating and setting the plugin should I also follow all of the steps suggested here https://developers.google.com/drive/quickstart-php ?
Cheers
Hello @Michele,
Ah, you found something that i have to document. Google requires you to specify a callback url when you configure Google API on the Google side, this is a security requirement. I have to find out what exactly should be specified. I think it includes your webserver url and oauth2callback as i remember. I will come back on that.
Found this solution: there is an Google API Console there you see "API Access" then "Client ID for web applications" then update "Authorized Redirect URIs" and add http://MYSITE/oauth2callback
Hi @Tauvic,
Thank you so much for replying. Seems not to work, when clicking on login in the widget I do go to google who asks to permission to access, click on OK but then redirects back to the profile page and in the widget gives me a file not found (Error calling GET https://www.googleapis.com/drive/v2/files/xxx) but it does exist and the spelling has been checked many times, it is correct. Any clue? Thanks for reading
In the widget you have to specify the correct Google drive folder id. That is the big number you see when you use your webbrowser to access Google Drive. It looks like https://drive.google.com/?tab=mo&authuser=0#folders/0Bz5uaqlHTrydQ1BENkRiZy1KQsQ. Then you copy this funny code 0Bz5uaqlHTrydQ1BENkRiZy1KQsQ in the widget. I think you mistyped somewhere.
When i make an error on purpose i get:
Error calling GET https://www.googleapis.com/drive/v2/files/@0Bz5uaqlHTrydQ1BENkRiZy1KQsQ: (404) File not found: @0Bz5uaqlHTrydQ1BENkRiZy1KQsQ
I added the @ sign here to force an error.
O and maybe it is not having enough access rights to the directory.
Thank you Tauvic!
It could surely sound stupid to you but...as Folder I was typing the folder's name...not the 'funny code'...I know...but maybe not so easy to understand for normal users, what about typing some help tip close to 'Folder ID' such as '(ie 0Bz5uaql....)? I guess many users will ask. Just a thought though :)
FYI, after putting the right ID, login to google ok but I was redirected to the site's homepage instead of the profile page where the widget is and I received a warning message '...token..missing field...'.Went back to the profile, logged in again with google and then worked fine
Cheers Tauvic!
Yes, great you solved it. I also sometimes run into the warning message '...token..missing field...'. I don't know where that is comming from. Im not the expert in this field so it is still a mystery to me.
Any help on making this plugin more reliable is appreciated! I think my usage of the Google Oauth2 libray is not 100% correct.